Abstract
Plotkin's λ v -calculus for call-by-value programs is weaker than the λβη-calculus for the same programs in continuation-passing style (CPS). To identify the call-by-value axioms that correspond to βη on CPS terms, we define a new CPS transformation and an inverse mapping, both of which are interesting in their own right. Using the new CPS transformation, we determine the precise language of CPS terms closed under βη-transformations, as well as the call-by-value axioms that correspond to the so-called administrative βη-reductions on CPS terms. Using the inverse mapping, we map the remaining β and η equalities on CPS terms to axioms on call-by-value terms. On the pure (constant free) set of Λ-terms, the resulting set of axioms is equivalent to Moggi's computational λ-calculus. If the call-by-value language includes the control operatorsabort andcall-with-current-continuation, the axioms are equivalent to an extension of Felleisenet al.'s λ v -C-calculus and to the equational subtheory of Talcott's logic IOCC.
Similar content being viewed by others
References
Allison, L.A Practical Introduction to Denotational Semantics. Volume 23 ofCambridge Computer Science Texts, Cambridge University Press (1986).
Appel, A.Compiling with Continuations. Cambridge University Press (1992).
Appel, A. and Jim, T. Continuation-passing, closure-passing style. InConference Record of the 16th ACM Symposium on Principles of Programming Languages (1989) 293–302.
Barendregt, H. P.The Lambda Calculus: Its Syntax and Semantics. Volume 103 ofStudies in Logic and the Foundations of Mathematics, North-Holland, revised edition (1984).
Bartley, D. H. and Jensen, J. C. The implementation of PC Scheme. InProceedings of the ACM Conference on Lisp and Functional Programming (1986) 86–93.
Boehm, H.-J. and Demers, A. Implementing Russel. InProceedings of the ACM Sigplan Symposium on Compiler Construction, Sigplan Notices, 21, 7 (1986) 186–195.
Bondorf, A. Improving binding times without explicit CPS-conversion. InProceedings of the ACM Conference on Lisp and Functional Programming (1992) 1–10.
Clinger, W., Friedman, D., and Wand, M. A scheme for a higher-level semantic algebra. In Reynolds, J. and Nivat, M., editors,Algebraic Methods in Semantics, Cambridge University Press (1985) 237–250.
Crank, E. and Felleisen, M. Parameter-passing and the lambda calculus. InConference Record of the 18th ACM Symposium on Principles of Programming Languages (1991) 233–244.
Curry, H. B. and Feys, R.Combinatory Logic, Volume I. North-Holland, Amsterdam (1958).
Danvy, O. Back to direct style.Science of Computer Programming (1993). To appear. Preliminary version in: Proceedings of the 4th European Symposium on Programming, 1992. Lecture Notes in Computer Science, 582, Springer Verlag.
Danvy, O. and Filinski, A. Abstracting control. InProceedings of the ACM Conference on Lisp and Functional Programming (1990) 151–160.
Danvy, O. and Filinski, A. Representing control: A study of the CPS transformation.Mathematical Structures in Computer Science, 2, 4 (1992) 361–391.
Danvy, O. and Lawall, J. Back to direct style II: First-class continuations. InProceedings of the ACM Conference on Lisp and Functional Programming (1992) 299–310.
Felleisen, M. The theory and practice of first-class prompts. InConference Record of the 15th ACM Symposium on Principles of Programming Languages (1988) 180–190.
Felleisen, M. and Friedman, D. P. Control operators, the SECD-machine, and the λ-calculus. In Wirsing, M., editor,Formal Description of Programming Concepts-III, North-Holland (1986) 193–217.
Felleisen, M. and Friedman, D. P. A syntactic theory of sequential state.Theoretical Computer Science, 69, 3 (1989) 243–287. Preliminary version in: Conference Record of the 14th ACM Symposium on Principles of Programming Languages, 1987.
Felleisen, M. and Hieb, R. The revised report on the syntactic theories of sequential control and state.Theoretical Computer Science, 102 (1992) 235–271. Technical Report 89–100, Rice University.
Felleisen, M., Friedman, D. P., Kohlbecker, E., and Duba, B. A syntactic theory of sequential control.Theoretical Computer Science, 52, 3 (1987) 205–237. Preliminary version: Reasoning with Continuations, in Proceedings of the 1st IEEE Symposium on Logic in Computer Science. 1986.
Felleisen, M., Wand, M., Friedman, D.P., and Duba, B.F. Abstract continuations: A mathematical semantics for handling full functional jumps. InProceedings of the ACM Conference on Lisp and Functional Programming (1988) 52–62.
Fischer, M. Lambda calculus schemata. InProceedings of the ACM Conference on Proving Assertions About Programs, Sigplan Notices, 7, 1 (1972) 104–109. Expanded version inLISP and Symbolic Computation (this issue).
Flanagan, C., Sabry, A., Duba, B. F., and Felleisen, M. The essence of compiling with continuations. InProceedings of the ACM Sigplan Conference on Programming Language Design and Implementation (1993). To appear.
Friedman, D. P., Haynes, C.T., and Kohlbecker, E. Programming with continuations. In Pepper, P., editor,Program Transformations and Programming Environments, Springer-Verlag (1985) 263–274.
Friedman, D. P., Wand, M., and Haynes, C.T.Essentials of Programming Languages. The MIT Press (1992).
Galbiati, L. and Talcott, C. L. A simplifier for untyped lambda expressions. InProceedings Conditional Term Rewriting Systems, Lecture Notes in Computer Science, 516 (1990) 342–353.
Griffin, T.G. A formulae-as-type notion of control. InConference Record of the 17th ACM Symposium on Principles of Programming Languages (1990) 47–58.
Haynes, C.T., Friedman, D. P., and Wand, M. Obtaining coroutines from continuations.Journal of Computer Languages (Pergamon Press), 11, 3/4 (1986) 143–153.
Hieb, R., Dybvig, K., and Bruggeman, C. Representing control in the presence of first-class continuations. InProceedings of the ACM Sigplan Conference on Programming Language Design and Implementation (1990) 66–77.
Kelsey, R. and Hudak, P. Realistic compilation by program transformation. InConference Record of the 16th ACM Symposium on Principles of Programming Languages (1989) 281–292.
Kranz, D., Kelsey, R., Rees, J., Hudak, P., Philbin, J., and Adams, N. Orbit: An otpimizing compiler for Scheme. InProceedings of the ACM Sigplan Symposium on Compiler Construction, Sigplan Notices, 21, 7 (1986) 219–233.
Landin, P.J. The mechanical evaluation of expressions.Computer Journal, 6, 4 (1964) 308–320.
Leroy, X.The Zinc Experiment: An Economical Implementation of the ML Language. Technical Report 117, INRIA (1990).
Mason, I. and Talcott, C. L. Equivalence in functional languages with effects.Journal of Functional Programming, 1, 3 (July 1991) 287–327.
Mazurkiewicz, A. W. Proving algorithms by tail functions.Information and Control, 18 (1971) 220–226.
Meyer, A. R. and Wand, M. Continuation semantics in typed lambdacalculi. InProceedings Workshop Logics of Programs, Lecture Notes in Computer Science, 193 (1985) 219–224.
Moggi, E. Computational lambda-calculus and monads. InProceedings of the 4th IEEE Symposium on Logic in Computer Science (1989) 14–23. Also appeared as: LFCS Report ECS-LFCS-88-86, University of Edinburgh, 1988.
Morris, L. The next 700 formal language descriptions.Lisp and Functional Programming (1993). In this issue. Original manuscript dated November 1970.
Nielson, F. A denotational framework for data flow analysis.Acta Informatica, 18 (1982) 265–287.
Plotkin, G.D. Call-by-name, call-by-value, and the λ-calculus.Theoretical Computer Science, 1 (1975) 125–159.
Rees, J. and Clinger, W. Revised3 report on the algorithmic language Scheme.Sigplan Notices, 21, 12 (1986) 37–79.
Reynolds, J. C. Definitional interpreters for higher-order programming languages. InProceedings of the ACM Annual Conference (1972) 717–740.
Sabry, A. and Felleisen, M. Reasoning about programs in continuationpassing style. InProceedings of the ACM Conference on Lisp and Functional Programming (1992) 288–298. Technical Report 92–180, Rice University.
Shivers, O.Control-Flow Analysis of Higher-Order Languages or Taming Lambda. PhD thesis, Carneige-Mellon University (1991).
Sitaram, D. and Felleisen, M. Reasoning with continuations II: Full abstraction for models of control. InProceedings of the ACM Conference on Lisp and Functional Programming (1990) 161–175.
Steel, T.B., editor.Formal Language Description Languages for Computer Programming. North-Holland (1966).
Steele Jr., Guy L.Rabbit: A Compiler for Scheme. MIT AI Memo 474. Massachusetts Institute of Technology (1978).
Strachey, C. and Wadsworth, C.P.Continuations: A Mathematical Semantics for Handling Full Jumps. Technical Monograph PRG-11, Oxford University Computing Laboratory, Programming Research Group (1974).
Talcott, C. L. A theory for program and data specification.Theoretical Computer Science, 104 (1992) 129–159. Preliminary version in Proceedings of the International Symposium on Design and Implementation of Symbolic Computation Systems, (Lecture Notes in Computer Science, 429, 1990).
Wand, M. Correctness of procedure representations in higher-order assembly language. In Brookes, S., editor,Proceedings of the Conference on the Mathematical Foundations of Programing Semantics, Lecture Notes in Computer Science, 598, Springer Verlag (1992) 294–311.
Author information
Authors and Affiliations
Additional information
This article is a revised and extended version of the conference paper with the same title [42]. The technical report of the same title contains additional material.
The authors were supported in part by NSF grant CCR 89-17022 and by Texas ATP grant 91-003604014.
Rights and permissions
About this article
Cite this article
Sabry, A., Felleisen, M. Reasoning about programs in continuation-passing style. LISP and Symbolic Computation 6, 289–360 (1993). https://doi.org/10.1007/BF01019462
Issue Date:
DOI: https://doi.org/10.1007/BF01019462