Higher-Order and Symbolic Computation

, Volume 19, Issue 4, pp 377–414

Call-by-push-value: Decomposing call-by-value and call-by-name

Article

Abstract

We present the call-by-push-value (CBPV) calculus, which decomposes the typed call-by-value (CBV) and typed call-by-name (CBN) paradigms into fine-grain primitives. On the operational side, we give big-step semantics and a stack machine for CBPV, which leads to a straightforward push/pop reading of CBPV programs. On the denotational side, we model CBPV using cpos and, more generally, using algebras for a strong monad. For storage, we present an O’Hearn-style “behaviour semantics’’ that does not use a monad.

We present the translations from CBN and CBV to CBPV. All these translations straightforwardly preserve denotational semantics. We also study their operational properties: simulation and full abstraction.

We give an equational theory for CBPV, and show it equivalent to a categorical semantics using monads and algebras. We use this theory to formally compare CBPV to Filinski’s variant of the monadic metalanguage, as well as to Marz’s language SFPL, both of which have essentially the same type structure as CBPV. We also discuss less formally the differences between the CBPV and monadic frameworks.

Keywords

Call-by-push-value Computational effect Monad Lambda-calculus Call-by-value Call-by-name 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abramsky, S.: The lazy λ-Calculus. In Research Topics in Functional Programming. Addison Wesley, pp. 65–117 (1990)Google Scholar
  2. 2.
    Barendregt, H.: The Lambda-Calculus: Its Syntax and Semantics. North-Holland, Amsterdam (1980)Google Scholar
  3. 3.
    Benton, N., Hughes, J., Moggi, E.: Monads and effects. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.), Advanced Lectures From International Summer School on Applied Semantics (APPSEM), Caminha, Portugal, vol. 2395 of Lecture Notes in Computer Science, pp. 42–122 (2000)Google Scholar
  4. 4.
    Benton, N., Kennedy, A.: Monads, effects and transformations. In: Gordon, A., Pitts, A. (eds.), Proceedings, Higher-Order Operational Techniques in Semantics (HOOTS ’99), vol. 26 of ENTCS, Paris, France, pp. 3–20 (1999)Google Scholar
  5. 5.
    Benton, N., Wadler, P.: Linear logic, monads and the lambda calculus. In: Proceedings, 11th Annual IEEE Symposium on Logic in Computer Science, New Brunswick, New Jersey, IEEE Computer Society Press, pp. 420–431 (1996)Google Scholar
  6. 6.
    Felleisen, M., Friedman, D.: Control operators, the SECD-machine, and the λ-calculus. In: Wirsing, M. (ed.), Formal Description of Programming Concepts III, North-Holland, pp. 193–217 (1986)Google Scholar
  7. 7.
    Filinski, A.: Controlling Effects. PhD thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania (1996)Google Scholar
  8. 8.
    Führmann, C.: Direct models for the computational λ-calculus. In: Brookes, S., Jung, A., Mislove, M., Scedrov, A. (eds.), In: Proceedings of the 15th Conference in Mathematical Foundations of Programming Semantics, New Orleans, vol. 20 of ENTCS, pp. 147–172 (1999).Google Scholar
  9. 9.
    Hatcliff, J.: The Structure of Continuation-Passing Styles. PhD thesis, Kansas State University, (1994)Google Scholar
  10. 10.
    Hatcliff, J., Danvy, O.: Thunks and the λ-calculus. Journal of Functional Programming, 7(3), 303–319 (1997)MATHMathSciNetCrossRefGoogle Scholar
  11. 11.
    Howard, B.: Inductive, coinductive, and pointed types. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP ’96), vol. 31, no. 6 of ACM SIGPLAN Notices, pp. 102–109. ACM, (1996)Google Scholar
  12. 12.
    Jeffrey, A.: A fully abstract semantics for a higher-order functional language with nondeterministic computation. Theoretical Computer Science, 228(1–2), 105–150 (1999)MATHMathSciNetCrossRefGoogle Scholar
  13. 13.
    Krivine, J.-L.: Un interpréteur de λ-calcul. Unpublished, (1985)Google Scholar
  14. 14.
    Laird, J.: A Semantic Analysis of Control. PhD thesis, University of Edinburgh (1998)Google Scholar
  15. 15.
    Laurent, O.: Polarized proof-nets: proof-nets for LC (extended abstract). In: Girard, J.-Y. (ed.), Typed Lambda Calculi and Applications ’99, L’Aquila, Italy, vol. 1581 of Lecture Notes in Computer Science, pp. 213–227. Springer (1999)Google Scholar
  16. 16.
    Levy, P.B.: λ-calculus and cartesian closed categories. Essay for Part III of the Mathematical Tripos, Cambridge University (1996)Google Scholar
  17. 17.
    Levy, P.B.: Call-by-push-value: a subsuming paradigm (extended abstract). In: Girard, J.-Y (ed.), In: Proceedings, Typed Lambda-Calculi and Applications, L’Aquila, Italy, vol. 1581 of LNCS, pp. 228–242. Springer (1999)Google Scholar
  18. 18.
    Levy, P.B.: Possible world semantics for general storage in call-by-value. In: Bradfield, J. (ed.), In: Proceedings, 16th Annual Conference of the European Assocation for Computer Science Logic (CSL), vol. 2471 of LNCS, pp. 232–246. Springer (2002)Google Scholar
  19. 19.
    Levy, P.B.: Adjunction models for call-by-push-value with stacks. In: Blute, R., Selinger, P. (eds.), In: Proceedings, 9th Conference on Category Theory and Computer Science, Ottawa, 2002, vol. 69 of Electronic Notes in Theoretical Computer Science (2003)Google Scholar
  20. 20.
    Levy, P.B.: Call-By-Push-Value. A Functional/Imperative Synthesis. Semantic Structures in Computation. Springer (2004)Google Scholar
  21. 21.
    Levy, P.B.: Adjunction models for call-by-push-value with stacks. Theory and Applications of Categories, 14, 75–110 (2005)MATHMathSciNetGoogle Scholar
  22. 22.
    Levy, P.B.: Jumbo λ-calculus. In: Proceedings, 33rd International Colloquium on Automata, Languages and Programming, vol. 4052 of LNCS pp. 444–455. Springer (2006)Google Scholar
  23. 23.
    Marz, M.: A fully abstract model for sequential computation. Technical Report CSR-98-6, University of Birmingham, School of Computer Science (1998)Google Scholar
  24. 24.
    Marz, M.: A Fully Abstract Model for Sequential Computation. PhD thesis, Technische Universität Darmstadt, published by Logos-Verlag, Berlin (2000)Google Scholar
  25. 25.
    Moggi, E.: Computational lambda-calculus and monads. In: Proceedings, 4th Annual Symposium on Logic in Computer Science, Pacific Grove, California, pp. 14–23. IEEE (1989)Google Scholar
  26. 26.
    Moggi, E.: Notions of computation and monads. Information and Computation 93, 55–92 (1991)MATHMathSciNetCrossRefGoogle Scholar
  27. 27.
    O’Hearn, P.W.: Opaque types in algol-like languages. Manuscript (1993)Google Scholar
  28. 28.
    Ong, C.H.L.: The Lazy Lambda Calculus: An Investigation into the Foundations of Functional Programming. PhD thesis, Imperial College of Science and Technology (1988)Google Scholar
  29. 29.
    Plotkin, G.D.: Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science 1(1), 125–159 (1975)MATHMathSciNetCrossRefGoogle Scholar
  30. 30.
    Plotkin, G.D.: LCF considered as a programming language. Theoretical Computer Science 5, 223–255 (1977)MathSciNetCrossRefGoogle Scholar
  31. 31.
    Pitts, A.M., Stark, I.D.B.: Operational reasoning for functions with local state. In: Gordon, A.D., Pitts, A.M. (eds.), Higher Order Operational Techniques in Semantics, Publications of the Newton Institute, pp. 227–273. Cambridge University Press (1998)Google Scholar
  32. 32.
    Selinger, P.: Control categories and duality: On the categorical semantics of the λμ-calculus. Mathematical Structures in Computer Science 11(2), 207–260 (2001)MATHMathSciNetCrossRefGoogle Scholar
  33. 33.
    Streicher, Th., Reus, B.: Classical logic, continuation semantics and abstract machines. Journal of Functional Programming 8(6), 543–572 (1998)MATHMathSciNetCrossRefGoogle Scholar
  34. 34.
    Tait, W.W.: Intensional interpretation of functionals of finite type I. Journal of Symbolic Logic 32(2), 198–212 (1967)MATHMathSciNetCrossRefGoogle Scholar
  35. 35.
    Winskel, G.: Formal Semantics of Programming Languages. MIT Press (1993)Google Scholar

Copyright information

© Springer Science + Business Media, LLC 2006

Authors and Affiliations

  1. 1.University of BirminghamUK

Personalised recommendations