Enriching the lambda calculus with contexts: toward a theory of incremental program construction

  • Authors:
  • Shinn-Der Lee;Daniel P. Friedman

  • Affiliations:
  • Computer Science Department, Indiana University, Bloomington, IN;Computer Science Department, Indiana University, Bloomington, IN

  • Venue:
  • Proceedings of the first ACM SIGPLAN international conference on Functional programming
  • Year:
  • 1996

Quantified Score

Hi-index 0.00

Visualization

Abstract

A context in the λ-calculus is a term with some holes. Hole filling differs from β-substitution in that name capture is intended. This seemingly simple feature transcends static scope and lies at the heart of modular and object-oriented programming. Still, the name capture feature of hole filling is at odds with hygienic β-substitution. In this paper we conservatively extend the λ-calculus to incorporate the notion of contexts without jeopardizing the β-rule. We perceive contexts as source code and λ-terms as target code. Context filling is encoded as compilation operations and the enriched calculus is a theory of separate compilation and incremental program construction. Linking of separately-developed programs is done by coherent renaming of free variables.We apply our context-enriching schema to the λ-calculus extended with definitions and devise a calculus of first-class modules. We show that module linking can be modeled solely by the renaming of import and export variables. We add relinkable variable references to model virtual method references essential to object systems.The inclusion of contexts introduces parameters whose linking is based on names (symbols, identifiers, or keywords). We simulate in the context-enriched calculus other extensions of the λ-calculus with name-based programming notions such as Dami's λ-calculus with names, Aït-Kaci and Garrigue's label-selective λ-calculus, Lamping's transparent data parameters, and our quasi-static procedures.