Skip to main content
Log in

Linear-Time Self-Interpretation of the Pure Lambda Calculus

  • Published:
Higher-Order and Symbolic Computation

Abstract

We show that linear-time self-interpretation of the pure untyped lambda calculus is possible, in the sense that interpretation has a constant overhead compared to direct execution under various execution models. The present paper shows this result for reduction to weak head normal form under call-by-name, call-by-value and call-by-need.

We use a self-interpreter based on previous work on self-interpretation and partial evaluation of the pure untyped lambda calculus.

We use operational semantics to define each reduction strategy. For each of these we show a simulation lemma that states that each inference step in the evaluation of a term by the operational semantics is simulated by a sequence of steps in evaluation of the self-interpreter applied to the term (using the same operational semantics).

By assigning costs to the inference rules in the operational semantics, we can compare the cost of normal evaluation and self-interpretation. Three different cost-measures are used: number of beta-reductions, cost of a substitution-based implementation (similar to graph reduction) and cost of an environment-based implementation.

For call-by-need we use a non-deterministic semantics, which simplifies the proof considerably.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Barendregt, H.P. The Lambda Calculus, its Syntax and Semantics, 2 edition, North-Holland, Amsterdam, New York, Oxford, 1984. Studies in Logic and the Foundations of Mathematics, vol. 103.

  2. Durand, I. and Middeldorp, A. Decidable call by need computations in term rewriting. In CADE '97. Springer-Verlag, 1997, pp. 4–18. Lecture Notes in Artificial Intelligence 1249.

  3. Frandsen, G. and Sturtivant, C. In Proceedings of the Fifth ACM Conference on Functional Programming and Computer Architecture, John Hughes (Ed.). Springer-Verlag, Cambridge, Massachusetts, 1991, pp. 289–312. Lecture Notes in Computer Science 523.

    Google Scholar 

  4. Hennessy, M. The Semantics of Programming Languages. John Wiley and Sons, Chichester, New York, Brisbane, Toronto, Signapore, 1990.

    Google Scholar 

  5. Jones, N.D. Constant time factors do matter. In STOC '93. Symposium on Theory of Computing, S. Homer (Ed.). ACM Press, 1993, pp. 602–611.

  6. Lawall, J.L. and Mairson, H.G. Optimality and inefficiency: What isn't a cost model of the lambda calculus. In Proceedings of ICFP '95, R.K. Dybvig (Ed.). ACM, ACM Press, 1996, pp. 92–101.

  7. Mogensen, T.Æ . Efficient self-interpretation in lambda calculus. Journal of Functional Programming 2(3) (1992) 345–364.

    Google Scholar 

  8. Mogensen, T.Æ . Self-applicable partial evaluation for pure lambda calculus. In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation, C. Consel (Ed.). ACM, Yale University, 1992, pp. 116–121.

  9. Mogensen, T.Æ . Self-applicable online partial evaluation of the pure lambda calculus. In Proceedings of PEPM '95, W.L. Scherlis (Ed.). ACM, ACM Press, 1995, pp. 39–44.

  10. Pfenning, F. and Elliot, C. Higher-order abstract syntax. In Proceedings of the ACM-SIGPLAN Conference on Programming Language Design and Implementation, ACM, ACM Press, 1988, pp. 199–208.

  11. Plotkin, G.D. A structural approach to operational semantics. Technical Report FN-19, DAIMI, Aarhus University, Denmark, Sept. 1981.

    Google Scholar 

  12. Rose, E. Characterizing computation models with a constant factor time hierarchy. In DIMACS Workshop On Computational Complexity and Programming Languages, B. Kapron (Ed.). New Jersey, USA, July 1996. DIMACS, RUTCOR, Rutgers University.

  13. Rose, E. Linear time hierarchies for a functional language machine model. Science of Computer Programming 32(1–3) (1998) 109–143.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Mogensen, T.Æ. Linear-Time Self-Interpretation of the Pure Lambda Calculus. Higher-Order and Symbolic Computation 13, 217–237 (2000). https://doi.org/10.1023/A:1010058213619

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1010058213619

Navigation