A Logic-Based Explanation Generation Framework for Classical and Hybrid Planning Problems