Skip to main content

Evaluation under lambda abstraction

  • Evaluation
  • Conference paper
  • First Online:
Programming Languages: Implementations, Logics, and Programs (PLILP 1997)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1292))

Abstract

In light of the usual definition of values [18] as terms in weak head normal form (WHNF), a λ-abstraction is regarded as a value, and therefore no expressions under λ-abstraction can get evaluated and the sharing of computation under λ has to be achieved through program transformations such as λ-lifting and supercombinators. In this paper we generalise the notion of head normal form (HNF) and introduce the definition of generalised head normal form (GHNF). We then define values as terms in GHNF with flexible heads, and study a call-by-value λ-calculus λ v hd corresponding to this new notion of values. After establishing a version of the normalisation theorem in λ v hd , we construct an evaluation function evalhd for λ v hd which evaluates under λ-abstraction. We prove that a program can be evaluated in λ v hd to a term in GHNF if and only if it can be evaluated in the usual λ-calculus to a term in HNF. We also present an operational semantics for λ v hd via a SECD machine. We argue that lazy functional programming languages can be implemented through λ v hd and an implementation of λ v hd can significantly enhance the degree of sharing in evaluation. This establishes a solid foundation for implementing run-time code generation through λ v hd

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. M. Abadi, L. Cardelli, P.-L. Curien, and I.-I. Lévy (1991), Explicit substitutions, Journal of Functional Programming, 4(1), pp. 375–416.

    Google Scholar 

  2. S. Abramsky (1990), The lazy lambda calculus. In D. Turner, editor, Declarative Programming, Addison-Wesley Publishing Company.

    Google Scholar 

  3. Z.M. Ariola, M. Felleisen, J. Maraist, M. Odersky and P. Wadler (1996), A Callby-Need Lambda Calculus, Proceedings of the 22 nd ACM Symposium on Principles of Programming Languages, San Francisco, pp. 233–246

    Google Scholar 

  4. H.P. Barendregt, The Lambda Calculus: Its Syntax and Semantics, North-Holland, Amsterdam, 1984.

    Google Scholar 

  5. R. Bloo, F. Kamareddine and R. Nederpelt (1996), The Barendregt cube with definitions and generalised reduction, Information and Computation, vol 126(2), pp. 123–143. A useful lambda-notation, Theoretical Computer Science, vol. 155(1), pp 85–109.

    Google Scholar 

  6. R. Davies and F. Pfenning (1996), A Modal Analysis of Staged Computation, In Proceedings of the 23 rd ACM Symposium on Principles of Programming Languages, pp. 206–209

    Google Scholar 

  7. A.J. Field and P.G. Harrison (1988), Functional Programming, Addison-Wesley Publishing Company.

    Google Scholar 

  8. J.R. Hindley (1978), Reductions of residuals are finite, Trans. Amer. Math. Soc. 240, pp. 345–361.

    Google Scholar 

  9. G. Huét (1994), Residual Theory in λ-Calculus: A Formal Development, Journal of Functional Programming Vol. 4, pp. 371–394.

    Google Scholar 

  10. R.J.M. Hughes (1984), The design and implementation of programming languages, Ph.D. thesis, University of Oxford.

    Google Scholar 

  11. C.K. Holst and C.K. Gomard (1991), Partial Evaluation is Fuller Laziness, in Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 223–233.

    Google Scholar 

  12. R. Glück and J. Jørgensen (1995), Efficient multi-level generating extensions for program specialisation. In S.D. Swierstra and M. Hermenegildo, editors, Programming Languages, Implementations Logics and Programs, Springer-Verlag LNCS 982, pp. 259–278.

    Google Scholar 

  13. T. Johnsson (1985), Lambda lifting: transforming programs to recursive equations, In Proceedings of the Conference on Functional programming Languages and Computer Architecture, Nancy, pp. 190–203.

    Google Scholar 

  14. F. Kamareddine and R. Nederpelt (1996), A useful lambda-notation, Theoretical Computer Science, vol. 155(1), pp 85–109.

    Google Scholar 

  15. J. Lamping (1990), An Algorithm for Optimal Lambda Calculus Reduction, In Seventeenth ACM Symposium on Principles of Programming Languages, pp 16–30.

    Google Scholar 

  16. P.J. Landin (1964), The mechanical evaluation of expressions, BCS Computing Journal 6(4), pp. 308–320.

    Google Scholar 

  17. S.L. Peyton Jones (1991), A fully-lazy λ-lifter in Haskell, Software practice and experience 21.

    Google Scholar 

  18. G.D. Plotkin (1975), Call-by-name, call-by-value and the lambda-calculus, Theoretical Computer Science 1, pp. 125–159.

    Google Scholar 

  19. C. Reade (1989), Elements of Functional Programming, Addison-Wesley Publishing Company.

    Google Scholar 

  20. H. Xi (1996), Separating developments in λ-calculus http://www.cs.cmu.edu/-hwxi/papers/SepDev.ps

    Google Scholar 

  21. H. Xi (1996), Evaluation under lambda abstraction: http://www.cs.cmu.edu/-hwxi/papers/EvUdLam.ps

    Google Scholar 

  22. H. Xi (1997), Generalized Lambda-Calculi: http://www.cs.cmu.edu/-hwxi/papers/GLam.ps

    Google Scholar 

  23. N. Yoshida (1993), Optimal reduction in weak λ-calculus with shared environments. In Proc. ACM conference on Functional Programming Languages and Computer Architecture, Copenhagen.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Hugh Glaser Pieter Hartel Herbert Kuchen

Rights and permissions

Reprints and permissions

Copyright information

© 1997 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Xi, H. (1997). Evaluation under lambda abstraction. In: Glaser, H., Hartel, P., Kuchen, H. (eds) Programming Languages: Implementations, Logics, and Programs. PLILP 1997. Lecture Notes in Computer Science, vol 1292. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0033849

Download citation

  • DOI: https://doi.org/10.1007/BFb0033849

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-63398-3

  • Online ISBN: 978-3-540-69537-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics