On laziness and optimality in lambda interpreters: tools for specification and analysis

  • Authors:
  • John Field

  • Affiliations:
  • Department of Computer Science, Cornell University, Upson Hall, Ithaca, NY

  • Venue:
  • POPL '90 Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1989

Quantified Score

Hi-index 0.02

Visualization

Abstract

In this paper, I introduce a new formal system, ACCL, based on Curien's Categorical Combinators [Cur86a]. I show that ACCL has properties not possessed by Curien's original combinators that make it particularly appropriate as the basis for implementation and analysis of a wide range of reduction schemes using shared environments, closures, or &lgr;-terms. As an example of the practical utility of this formalism, I use it to specify a simple lazy interpreter for the &lgr;-calculus, whose correctness follows trivially from the properties of ACCL.I then describe a labeled variant of ACCL, ACCLL, which can be used as a tool to determine the degree of “laziness” possessed by various &lgr;-reduction schemes. In particular, ACCLL is applied to the problem of optimal reduction in the &lgr;-calculus. A reduction scheme for the &lgr;-calculus is optimal if the number of redex contractions that must be performed in the course of reducing any &lgr;-term to a normal form (if one exists) is guaranteed to be minimal. Results of Lévy [Lév78,Lév80] showed that for a natural class of reduction strategies allowing shared redexes, optimal reductions were, at least in principle, possible. He conjectured that an optimal reduction strategy might be realized in practice using shared closures and environments as well as shared &lgr;-terms. I show, however, using ACCLL, a practical optimal reduction scheme for arbitrary &lgr;-terms using only shared environments, closures, or terms is unlikely to exist.