Skip to main content
Log in

Axioms for control operators in the CPS hierarchy

  • Published:
Higher-Order and Symbolic Computation

Abstract

A CPS translation is a syntactic translation of programs, which is useful for describing their operational behavior. By iterating the standard call-by-value CPS translation, Danvy and Filinski discovered the CPS hierarchy and proposed a family of control operators, shift and reset, that make it possible to capture successive delimited continuations in a CPS hierarchy.

Although shift and reset have found their applications in several areas such as partial evaluation, most studies in the literature have been devoted to the base level of the hierarchy, namely, to level-1 shift and reset. In this article, we investigate the whole family of shift and reset. We give a simple calculus with level-n shift and level-n reset for an arbitrary n>0. We then give a set of equational axioms for them, and prove that these axioms are sound and complete with respect to the CPS translation. The resulting set of axioms is concise and a natural extension of those for level-1 shift and reset.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Ariola, Z.M., Herbelin, H., Sabry, A.: A type-theoretic foundation of continuations and prompts. In: Proc. ACM SIGPLAN International Conference on Functional Programming, pp. 40–53 (2004)

  2. Asai, K.: Online partial evaluation for shift and reset. In: Proc. ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pp. 19–30 (2002)

  3. Asai, K.: Offline partial evaluation for shift and reset. In: Proc. 2004 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 3–14 (2004)

  4. Berdine, J., O’Hearn, P., Reddy, U., Thielecke, H.: Linear continuation passing. Higher-Order Symb. Comput. 15(2–3), 181–208 (2002)

    Article  MATH  Google Scholar 

  5. Biernacka, M., Biernacki, D., Danvy, O.: An operational foundation for delimited continuations. In: Proc. Fourth ACM SIGPLAN Workshop on Continuations, pp. 25–34. Technical Report CSR-04-1, School of Computer Science, University of Birmingham (2004)

  6. Biernacki, D., Danvy, O.: On the dynamic extent of delimited continuations. Technical Report BRICS-RS-05-2, BRICS, University of Aarhus, Denmark (2005)

  7. Danvy, O.: Type-directed partial evaluation. In: Proc. 23rd Symposium on Principles of Programming Languages, pp. 242–257 (1996)

  8. Danvy, O., Filinski, A.: A functional abstraction of typed contexts. Technical Report 89/12, DIKU, University of Copenhagen (1989)

  9. Danvy, O., Filinski, A.: Abstracting control. In: Proc. 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160 (1990)

  10. Danvy, O., Filinski, A.: Representing control: a study of the CPS transformation. Math. Struct. Comput. Sci. 2(4), 361–391 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  11. Danvy, O., Yang, Z.: An operational investigation of the CPS hierarchy. In: Proc. 8th European Symposium on Programming, pp. 224–242 (1999)

  12. Felleisen, M.: The theory and practice of first-class prompts. In: Proc. 15th Symposium on Principles of Programming Languages, pp. 180–190 (1988)

  13. Filinski, A.: Representing monads. In: Proc. 21st Symposium on Principles of Programming Languages, pp. 446–457 (1994)

  14. Filinski, A.: Controlling effects. Ph.D. Thesis, Carnegie Mellon University, available as Technical Report CMU-CS-96-119 (1996)

  15. Filinski, A.: Representing layered monads. In: Proc. 26th Symposium on Principles of Programming Languages, pp. 175–188 (1999)

  16. Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: Proc. ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 237–247 (1993)

  17. Friedman, H.: Classically and intuitionistically provably recursive functions. In: Lecture Notes in Mathematics, vol. 699, pp. 21–28 (1978)

  18. Griffin, T.: A formulae-as-types notion of control. In: Proc. 17th Symposium on Principles of Programming Languages, pp. 47–58 (1990)

  19. Gunter, C.A., Rémy, D., Riecke, J.G.: A generalization of exceptions and control in ML-like languages. In: Proc. Functional Programming and Computer Architecture, pp. 12–23 (1995)

  20. Hieb, R., Dybvig, R., Anderson, C.W.: Subcontinuations. Lisp Symb. Comput. 6, 453–484 (1993)

    Google Scholar 

  21. Kameyama, Y.: A type-theoretic study on partial continuations. In: Proc. IFIP International Conference on Theoretical Computer Science, pp. 489–504 (2000)

  22. Kameyama, Y.: Axiomatizing higher level delimited continuations. In: Proc. 3rd ACM SIGPLAN Workshop on Continuations, pp. 49–53. Technical Report 545, Computer Science Department, Indiana University (2004)

  23. Kameyama, Y., Hasegawa, M.: A sound and complete axiomatization of delimited continuations. In: Proc. ACM SIGPLAN International Conference on Functional Programming, pp. 177–188 (2003)

  24. Lawall, J., Danvy, O.: Continuation-based partial evaluation. In: Proc. 1994 ACM Conference on LISP and Functional Programming, pp. 227–238 (1994)

  25. Moggi, E.: Computational lambda-calculus and monads. In: Proc. 4th Symposium on Logic in Computer Science, pp. 14–28 (1989)

  26. Murthy, C.: Control operators, hierarchies, and pseudo-classical type systems: a-translation at work. In: Proc. First ACM Workshop on Continuations, pp. 49–72. Technical Report STAN-CS-92-1426, Stanford University (1992)

  27. Plotkin, G.D.: Call-by-name, call-by-value, and the λ-calculus. Theor. Comput. Sci. 1, 125–159 (1975)

    Article  MATH  MathSciNet  Google Scholar 

  28. Sabry, A.: Note on axiomatizing the semantics of control operators. Technical Report CIS-TR-96-03, Dept. of Computer Science, University of Oregon (1996)

  29. Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. Lisp Symb. Comput. 6(3–4), 289–360 (1993)

    Article  Google Scholar 

  30. Sekiguchi, T., Sakamoto, T., Yonezawa, A.: Portable implementation of continuation operators in imperative languages by exception handling. In: Advances in Exception Handling Techniques, pp. 217–233 (2001)

  31. Shan, C.: Shift to control. In: Proc. 5th Workshop on Scheme and Functional Programming, pp. 99–107 (2004)

  32. Thielecke, H.: From control effects to typed continuation passing. In: Proc. 30th Symposium on Principles of Programming Languages, pp. 139–149 (2003)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yukiyoshi Kameyama.

Additional information

This article is a revised version of the paper presented at 18th International Workshop on Computer Science Logic (CSL’04), September, 2004.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Kameyama, Y. Axioms for control operators in the CPS hierarchy. Higher-Order Symb Comput 20, 339–369 (2007). https://doi.org/10.1007/s10990-007-9009-x

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10990-007-9009-x

Keywords

Navigation