skip to main content
research-article

Compositional semantics for composable continuations: from abortive to delimited control

Published:19 August 2014Publication History
Skip Abstract Section

Abstract

Parigot's λμ-calculus, a system for computational reasoning about classical proofs, serves as a foundation for control operations embodied by operators like Scheme's callcc. We demonstrate that the call-by-value theory of the λμ-calculus contains a latent theory of delimited control, and that a known variant of λμ which unshackles the syntax yields a calculus of composable continuations from the existing constructs and rules for classical control. To relate to the various formulations of control effects, and to continuation-passing style, we use a form of compositional program transformations which preserves the underlying structure of equational theories, contexts, and substitution. Finally, we generalize the call-by-name and call-by-value theories of the λμ-calculus by giving a single parametric theory that encompasses both, allowing us to generate a call-by-need instance that defines a calculus of classical and delimited control with lazy evaluation and sharing.

References

  1. Z. M. Ariola and M. Felleisen. The call-by-need lambda calculus. Journal of Functional Programmin, 7(3):265--301, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Z. M. Ariola and H. Herbelin. Control reduction theories: the benefit of structural substitution. Journal of Functional Programming, 18(3): 373--419, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Z. M. Ariola, H. Herbelin, and A. Sabry. A proof-theoretic foundation of abortive continuations. Higher-Order and Symbolic Computation, 20(4):403--429, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Z. M. Ariola, H. Herbelin, and A. Sabry. A type-theoretic foundation of delimited continuations. Higher-Order and Symbolic Computation, 22(3):233--273, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Z. M. Ariola, P. Downen, H. Herbelin, K. Nakata, and A. Saurin. Classical call-by-need sequent calculi: The unity of semantic artifacts. In FLOPS, pages 32--46, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P.-L. Curien and H. Herbelin. The duality of computation. In ICFP, pages 233--243, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. O. Danvy and A. Filinski. A functional abstraction of typed contexts. Technical Report 89/12, DIKU, University of Copenhagen, Copenhagen, Denmark, 1989.Google ScholarGoogle Scholar
  8. O. Danvy and A. Filinski. Abstracting control. In LISP and Functional Programming, pages 151--160, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. David and W. Py. Lambda-mu-calculus and Böhm's theorem. Journal of Symbolic Logic, 66(1):407--413, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  10. P. de Groote. On the relation between the λμ-calculus and the syntactic theory of sequential control. In LPAR, pages 31--43, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Downen and Z. M. Ariola. Delimited control and computational effects. Journal of Functional Programming, 24(1):1--55, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  12. R. K. Dybvig, S. P. Jones, and A. Sabry. A monadic framework for delimited continuations. Journal of Functional Programming, 17(06): 687--730, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. etsu Fujita. Explicitly typed λμ-calculus for polymorphism and call-by-value. In TLCA, pages 162--176, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science, 103(2): 235--271, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Filinski. Representing monads. In POPL, pages 446--457, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Griffin. A formulae-as-types notion of control. In POPL, pages 47--58, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. H. Herbelin and S. Ghilezan. An approach to call-by-name delimited continuations. In POPL, pages 383--394, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. H. Herbelin and S. Zimmermann. An operational account of call-byvalue minimal and classical λ-calculus in "natural deduction" form. In TLCA, pages 142--156, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Y. Kameyama and M. Hasegawa. A sound and complete axiomatization of delimited continuations. In ICFP, pages 177--188, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Materzok. Axiomatizing subtyped delimited continuations. In CSL, pages 521--539, 2013.Google ScholarGoogle Scholar
  21. M. Materzok and D. Biernacki. Subtyping delimited continuations. In ICFP, pages 81--93, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Materzok and D. Biernacki. A dynamic interpretation of the CPS hierarchy. In APLAS, pages 296--311, 2012.Google ScholarGoogle ScholarCross RefCross Ref
  23. E. Moggi. Computational λ-calculus and monads. In Logic in Computer Science, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C.-H. L. Ong and C. A. Stewart. A curry-howard foundation for functional computation with control. In POPL, pages 215--227, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Parigot. Lambda-my-calculus: An algorithmic interpretation of classical natural deduction. In LPAR, pages 190--201, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. G. D. Plotkin. Call-by-name, call-by-value and the lambda-calculus. Theoretical Computer Science, 1(2):125--159, 1975.Google ScholarGoogle Scholar
  27. S. Ronchi Della Rocca and L. Paolini. The Parametric Lambda Calculus: A Metamodel for Computation. Texts in Theoretical Computer Science. An EATCS Series. Springer-Verlag, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. Sabry. Note on axiomatizing the semantics of control operators. Technical Report CIS-TR-96-03, Department of Computer and Information Science, University of Oregon, 1996.Google ScholarGoogle Scholar
  29. A. Sabry and M. Felleisen. Reasoning about programs in continuation-passing style. Lisp and Symbolic Computation, 6(3-4):289--360, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Sabry and P. Wadler. A reflection on call-by-value. ACM Transactions on Programming Languages and Systems, 19(6):916--941, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Saurin. Separation with streams in the λμ-calculus. In LICS, pages 356--365, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. Saurin. Typing streams in the λμ-calculus. ACM Transactions on Computational Logic, 11(4), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. C. Shan. Shift to control. In Workshop on Scheme and Functional Programming, page 99, 2004.Google ScholarGoogle Scholar

Index Terms

  1. Compositional semantics for composable continuations: from abortive to delimited control

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!