Domain-Based Program Synthesis Using Planning and Derivational Analogy