Skip to main content

Correctness of Copy in Calculi with Letrec

  • Conference paper
Term Rewriting and Applications (RTA 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4533))

Included in the following conference series:

Abstract

Call-by-need lambda calculi with letrec provide a rewriting-based operational semantics for (lazy) call-by-name functional languages. These calculi model the sharing behavior during evaluation more closely than let-based calculi that use a fixpoint combinator. However, currently the knowledge about correctness w.r.t. observational equivalence of modifying the sharing in letrec-based calculi is full of gaps. In this paper we develop a new proof method based on a calculus on infinite trees, generalizing the parallel 1-reduction, for showing correctness of instantiation operations. We demonstrate the method in the small calculus LRλ and show that copying at compile-time can be done without restrictions. We also show that the call-by-need and call-by-name strategies are equivalent w.r.t. contextual equivalence. A consequence is correctness of all the transformations like instantiation, inlining, specialization and common subexpression elimination in LRλ. The result for LRλ also gives an answer to unresolved problems in several papers and thus contributes to the knowledge about deterministic calculi with letrec.

The method also works for a calculus with case and constructors, and also with parallel or. We are also confident that the method scales up for proving correctness of copy-related transformations in non-deterministic lambda calculi if restricted to “deterministic” subterms.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abramsky, S.: The lazy lambda calculus. In: Turner, D. (ed.) Research Topics in Functional Programming, pp. 65–116. Addison-Wesley, Reading (1990)

    Google Scholar 

  2. Ariola, Z.M., Blom, S.: Cyclic lambda calculi. In: TACS, pp. 77–106, Sendai, Japan (1997)

    Google Scholar 

  3. Ariola, Z.M., Blom, S.: Skew confluence and the lambda calculus with letrec. Annals of Pure and Applied Logic 117, 95–168 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  4. Ariola, Z.M., Felleisen, M.: The call-by-need lambda calculus. J. functional programming 7(3), 265–301 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  5. Ariola, Z.M., Felleisen, M., Maraist, J., Odersky, M., Wadler, P.: A call-by-need lambda calculus. In: Principles of Programming Languages, San Francisco, California, pp. 233–246. ACM Press, New York (1995)

    Google Scholar 

  6. Ariola, Z.M., Klop, J.W.: Lambda calculus with explicit recursion. Information and Computation 139(2), 154–233 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  7. Barendregt, H.P.: The Lambda Calculus. Its Syntax and Semantics. North-Holland, Amsterdam, New York (1984)

    Google Scholar 

  8. Claessen, K., Sands, D.: Observable sharing for functional circuit description. In: Thiagarajan, P.S., Yap, R. (eds.) ASIAN 1999. LNCS, vol. 1742, pp. 62–73. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  9. Dezani-Ciancaglini, M., Tiuryn, J., Urzyczyn, P.: Discrimination by parallel observers: The algorithm. Information and Computation 150(2), 153–186 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  10. Jeffrey, A.: A fully abstract semantics for concurrent graph reduction. In: Proc. LICS, pp. 82–91 (1994)

    Google Scholar 

  11. Kennaway, R., Klop, J.W., Sleep, M.R., de Vries, F.-J.: Infinitary lambda calculus. Theor. Comput. Sci. 175(1), 93–125 (1997)

    Article  MATH  Google Scholar 

  12. Launchbury, J.: A natural semantics for lazy evaluation. In: Proc. 20th Principles of Programming Languages (1993)

    Google Scholar 

  13. Machkasova, E., Turbak, F.A.: A calculus for link-time compilation. In: ESOP 2000 (2000)

    Google Scholar 

  14. Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. J. Functional programming 8, 275–317 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  15. Moran, A.K.D.: Call-by-name, call-by-need, and McCarthys Amb. PhD thesis, Dept. of Comp. Science, Chalmers University, Sweden (1998)

    Google Scholar 

  16. Moran, A.K.D., Sands, D., Carlsson, M.: Erratic fudgets: A semantic theory for an embedded coordination language. In: Ciancarini, P., Wolf, A.L. (eds.) COORDINATION 1999. LNCS, vol. 1594, pp. 85–102. Springer, Heidelberg (1999)

    Google Scholar 

  17. Moran, A.K.D., Sands, D., Carlsson, M.: Erratic fudgets: A semantic theory for an embedded coordination language. Sci. Comput. Program. 46(1-2), 99–135 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  18. Peyton Jones, S.: Haskell 98 Language and Libraries. Cambridge University Press, Cambridge (2003), www.haskell.org

    Google Scholar 

  19. Plasmeijer, R., van Eekelen, M.: The concurrent Clean language report: Version 1.3 and 2.0. Technical report, Dept. of Computer Science, University of Nijmegen (2003), http://www.cs.kun.nl/~clean/

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

    Article  MATH  MathSciNet  Google Scholar 

  21. Sabel, D., Schmidt-Schauß, M.: A call-by-need lambda-calculus with locally bottom-avoiding choice: Context lemma and correctness of transformations. Frank report 24, Inst. Informatik. J.W.G.-university Frankfurt (2006)

    Google Scholar 

  22. Schmidt-Schauß, M.: Equivalence of call-by-name and call-by-need for lambda-calculi with letrec. Frank report 25, Inst. Informatik. J.W.G.-university Frankfurt (2006)

    Google Scholar 

  23. Schmidt-Schauß, M.: Correctness of copy in calculi with letrec, case and constructors. Frank report 28, Inst. Informatik. J.W.G.-University Frankfurt (2007)

    Google Scholar 

  24. Schmidt-Schauß, M., Schütz, M., Sabel, D.: A complete proof of the safety of Nöcker’s strictness analysis. Frank report 20, Inst. Informatik. J.W.G.-University Frankfurt (2005)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Franz Baader

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Schmidt-Schauß, M. (2007). Correctness of Copy in Calculi with Letrec. In: Baader, F. (eds) Term Rewriting and Applications. RTA 2007. Lecture Notes in Computer Science, vol 4533. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-73449-9_25

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-73449-9_25

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-73447-5

  • Online ISBN: 978-3-540-73449-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics