Schema-based program transformation [8] has been proposed as an effective technique for the optimisation of logic programs. Schemata are applied to a logic program, mapping inefficient constructs to more efficient ones. One challenging aspect of the technique is that of proving that the schemata are correct. This paper addresses the issue of correctness. We define operations for developing correct schemata by construction. The schema development operations are higher order equivalents of the classic program transformations of fold/unfold [6]. We consider a transformation schema to be correct if its application yields a target program which is equivalent to the source program under the pure Prolog semantics. The work described in this paper makes three contributions: a methodology for the development of provably correct program transformation schemata, abstraction of program transformation operations to transformation operations on schemata, and a higher-order unification algorithm w...
Julian Richardson, Norbert E. Fuchs