Preferred Explanations: Theory and Generation via Planning