Uses of Higher-Order Unification for Implementing Program Transformers.
John Hannan, Dale Armin Miller · International Conference on Lightning Protection · 1988
Source-to-source program transformers belong to the class of meta-programs that manipulate programs as objects. It has previously been argued that a higher-order extension of Prolog, such as λProlog, makes a suitable implementation language for such meta-programs. In this paper, we consider this claim in more detail. In λProlog, object-level programs and program schemata can be represented using simply typed λ-terms and higher-order (functional) variables. Unification of these λ-terms, called higher-order unification, can elegantly describe several important meta-level operations on programs. We detail some properties of higher-order unification that make it suitable for analyzing program structures. We then present (in λProlog) the specification of several simple program transformers together with a more involved partial evaluator. With the depth-first control strategy of λProlog for both clause selection and unifier selection all the above mentioned specifications can be and have been executed and tested. Comments University of Pennsylvania Department of Computer and Information Science Technical Report No. MSCIS-88-46. This technical report is available at ScholarlyCommons: http://repository.upenn.edu/cis_reports/698 USES OF HIGHER-ORDER UNIFICATION FOR IMPLEMENTING PROGRAM TRANSFORMERS JohnHannan Dale Miller MS-CIS-88-46 LlNC LAB 118 Department of Computer and Information Science School of Engineering and Applied Science University of Pennsylvania Philadelphia, PA 19104