Automatic Autoprojection of Higher Order Recursive Equations

Anders Bondorf. Automatic Autoprojection of Higher Order Recursive Equations. Science of Computer Programming, 17(1-3):3-34, 1991.

Abstract

Autoprojection, or self-applicable partial evaluation, has been implemented for first order functional languages for some years now. This paper describes an approach to treat a higher order subset of the Scheme language. The system has been implemented as an extension to the existing autoprojector Similix [6, 7] that treats a first order Scheme subset. To our knowledge, our system is the first fully automatic and implemented autoprojector for a higher order language. We describe a new automatic binding time analysis for higher order programs. The analysis requires no type information. It is based on a closure analysis [34], which for any application point finds the set of lambda abstractions that can possibly be applied at that point. The binding time analysis has the interesting property that no structured binding time values are needed. Since our language is higher order, interpreters written in a higher order style can be partially evaluated. To exemplify this, we present and partially evaluate four versions of an interpreter for a lambda calculus language: one written in direct style, one written in continuation passing style, one implementing call-by-name reduction, and one implementing call-by-need reduction. The three latter interpreters are heavily based on higher order functions. To our knowledge, this is the first time autoprojection has been used to generate compilers from so sophisticated interpreters. This paper is a modified and slightly extended version of [2].