Higher-Order and Symbolic Computation

, Volume 22, Issue 1, pp 3–66 | Cite as

Compilation of extended recursion in call-by-value functional languages

Article
  • 45 Downloads

Abstract

This paper formalizes and proves correct a compilation scheme for mutually-recursive definitions in call-by-value functional languages. This scheme supports a wider range of recursive definitions than previous methods. We formalize our technique as a translation scheme to a lambda-calculus featuring in-place update of memory blocks, and prove the translation to be correct.

Compilation Recursion Semantics Functional languages 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Appel, A.W.: Compiling with Continuations. Cambridge University Press, Cambridge (1992) Google Scholar
  2. 2.
    Ariola, Z.M., Blom, S.: Skew confluence and the lambda calculus with letrec. Ann. Pure Appl. Log. 117(1–3), 95–178 (2002) MATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Boudol, G.: The recursive record semantics of objects revisited. J. Funct. Program. 14(3), 263–315 (2004) MATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Boudol, G., Zimmer, P.: Recursion in the call-by-value lambda-calculus. In: Ésik, Z., Ingólfsdóttir, A. (eds.) Fixed Points in Computer Science. BRICS Notes Series, vol. NS-02-2, pp. 61–66 (2002) Google Scholar
  5. 5.
    Cardelli, L.: A semantics of multiple inheritance. In: Kahn, G., MacQueen, D., Plotkin, G. (eds.) Semantics of Data Types. Lecture Notes in Computer Science, vol. 173, pp. 51–67. Springer, Berlin (1984) Google Scholar
  6. 6.
    Cousineau, G., Curien, P.L., Mauny, M.: The categorical abstract machine. Sci. Comput. Program. 8(2), 173–202 (1987) MATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Crary, K., Harper, R., Puri, S.: What is a recursive module? In: Programming Language Design and Implementation, pp. 50–63. ACM Press, New York (1999) Google Scholar
  8. 8.
    Dougherty, D.J., Lescanne, P., Liquori, L., Lang, F.: Addressed term rewriting systems: Syntax, semantics, and pragmatics: Extended abstract. In: Proceedings of the 2nd Int. Workshop on Term Graph Rewriting (TERMGRAPH 2004). Electr. Notes Theor. Comput. Sci., vol. 127(5), pp. 57–82. Elsevier, Amsterdam (2005) Google Scholar
  9. 9.
    Dreyer, D.: A type system for well-founded recursion. In: Principles of Programming Languages, pp. 293–305. ACM Press, New York (2004) Google Scholar
  10. 10.
    Dreyer, D.: A type system for recursive modules. In: International Conference on Functional Programming, pp. 289–302. ACM Press, New York (2007) Google Scholar
  11. 11.
    Erkök, L., Launchbury, J.: Recursive monadic bindings. In: International Conference on Functional Programming, pp. 174–185. ACM Press, New York (2000) Google Scholar
  12. 12.
    Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Prentice-Hall, Englewood Cliffs (2005) Google Scholar
  13. 13.
    Hirschowitz, T.: Mixin modules, modules, and extended recursion in a call-by-value setting. Ph.D. thesis, University of Paris VII (2003) Google Scholar
  14. 14.
    Hirschowitz, T.: Rigid mixin modules. In: Kameyama, Y., Stuckey, P. (eds.) Functional and Logic Programming. Lecture Notes in Computer Science, vol. 2998, pp. 214–228. Springer, Berlin (2004) Google Scholar
  15. 15.
    Hirschowitz, T., Leroy, X.: Mixin modules in a call-by-value setting. ACM Trans. Program. Lang. Syst. 27(5), 857–881 (2005) CrossRefGoogle Scholar
  16. 16.
    Hirschowitz, T., Leroy, X., Wells, J.B.: Compilation of extended recursion in call-by-value functional languages. In: Principles and Practice of Declarative Programming, pp. 160–171. ACM Press, New York (2003) Google Scholar
  17. 17.
    Hirschowitz, T., Leroy, X., Wells, J.B. Call-by-value mixin modules: Reduction semantics, side effects, types. In: Schmidt, D.A. (ed.) Programming Languages and Systems, 13th European Symposium on Programming, ESOP 2004. Lecture Notes in Computer Science, vol. 2986, pp. 64–78. Springer, Berlin (2004) Google Scholar
  18. 18.
    Kelsey, R., Clinger, W., Rees, J. (eds.): Revised5 report on the algorithmic language Scheme. Higher-Order Symb. Comput. 11(1), 7–105 (1998) CrossRefGoogle Scholar
  19. 19.
    Kranz, D., Kelsey, R., Rees, J., Hudak, P., Philbin, J., Adams, N.: ORBIT: An optimizing compiler for Scheme. In: Symposium on Compiler Construction, pp. 219–233. ACM Press, New York (1986) Google Scholar
  20. 20.
    Leroy, X., Doligez, D., Garrigue, J., Rémy, D., Vouillon, J.: The Objective Caml system release 3.11, documentation and user’s manual. Available at http://caml.inria.fr/pub/docs/manual-ocaml/ (2008)
  21. 21.
    Leroy, X., Doligez, D., Garrigue, J., Vouillon, J.: The Objective Caml system. Software and documentation available at http://caml.inria.fr/ (1996–2009)
  22. 22.
    Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML (revised). MIT Press, Cambridge (1997) Google Scholar
  23. 23.
    Moggi, E., Sabry, A.: An abstract monadic semantics for value recursion. Theor. Inf. Appl. 38(4), 375–400 (2004) MATHCrossRefMathSciNetGoogle Scholar
  24. 24.
    Nordlander, J., Carlsson, M., Gill, A.: Unrestricted call-by-value recursion. In: ML’08: Proceedings of the 2008 ACM SIGPLAN workshop on ML, pp. 23–34. ACM Press, New York (2008) CrossRefGoogle Scholar
  25. 25.
    Peyton Jones, S. (ed.): Haskell 98 Language and Libraries, the revised report. Cambridge University Press, Cambridge (2003) Google Scholar
  26. 26.
    Plotkin, G.D.: Call-by-name, call-by-value and the λ-calculus. Theor. Comput. Sci. 1(2), 125–159 (1975) MATHCrossRefMathSciNetGoogle Scholar
  27. 27.
    Russo, C.V.: Recursive structures for Standard ML. In: International Conference on Functional Programming, pp. 50–61. ACM Press, New York (2001) Google Scholar
  28. 28.
    Sewell, P., Stoyle, G., Hicks, M., Bierman, G., Wansbrough, K.: Dynamic rebinding for marshalling and update, via redex-time and destruct-time reduction. J. Funct. Program. 18(4), 437–502 (2008) MATHMathSciNetGoogle Scholar
  29. 29.
    Shivers, O.: Control-flow analysis in Scheme. In: Programming Language Design and Implementation, pp. 164–174. ACM Press, New York (1988) Google Scholar
  30. 30.
    Syme, D.: Initializing mutually referential abstract objects: The value recursion challenge. In: Proceedings of the ACM-SIGPLAN Workshop on ML (ML 2005). Electronic Notes in Theoretical Computer Science, vol. 148(2), pp. 3–25. Elsevier, Amsterdam (2006) Google Scholar
  31. 31.
    Waddell, O., Sarkar, D., Dybvig, R.K.: Fixing letrec: A faithful yet efficient implementation of Scheme’s recursive binding construct. Higher-Order Symb. Comput. 18(3/4), 299–326 (2005) MATHCrossRefGoogle Scholar
  32. 32.
    Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1992) CrossRefMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  1. 1.Department of MathematicsUniversity of SavoieLe Bourget-du-LacFrance
  2. 2.INRIA Paris-RocquencourtLe ChesnayFrance
  3. 3.School of Mathematical and Computer SciencesHeriot-Watt UniversityEdinburghUK

Personalised recommendations