Head-Order Techniques and Other Pragmatics of Lambda Calculus Graph Reduction
Nikos B. Troullinos · 2011
In this dissertation Lambda Calculus reduction is studied as a means of improving the support for declarative computing. We consider systems having reduction semantics; i.e., systems in which computations consist of equivalence-preserving transformations between expressions. The approach becomes possible by reducing expressions beyond weak normal form, allowing expression-level output values, and avoiding compilation-centered transformations. In particular, we develop reduction algorithms which, although not optimal, are highly efficient. A minimal linear notation for lambda expressions and for certain runtime structures is introduced for explaining operational features. This notation is related to recent theories which formalize the notion of substitution. Our main reduction technique is Berkling's Head Order Reduction (HOR), a delayed substitution algorithm which emphasizes the extended left spine. HOR uses the de Bruijn representation for variables and a mechanism for artificially binding relatively free variables. HOR produces a lazy variant of the head normal form, the natural midway point of reduction. It is shown that beta reduction in the scope of relative free variables is not hard. Full normalization suggests new applications by not relegating partial evaluation to a meta level. Variations of HOR are presented, including a conservative breadth-first one which takes advantage of the inherent parallelism of the head normal form. A reduction system must be capable of sharing intermediate results. Sharing under HOR has not received attention to date. In this dissertation variations of HOR which achieve sharing are described. Sharing is made possible via the special treatment of expressions referred to by head variables. The reduction strategy is based on normal order, achieves low reduction counts, but is shown to be incomplete. Head Order Reduction with and without sharing, as well as other competing algorithms are evaluated on several test sets. Our results indicate that reduction rates in excess of one million reductions/second can be achieved on current processors in interpretive mode and with minimal pre- and post-processing. By extending the efficient algorithms for the pure calculus presented in this dissertation with primitives and data structures it is now possible to build useful reduction systems. We present some suggestions on how such systems can be designed.