Explanation-Based Learning for Planning