Higher-Order and Symbolic Computation

, Volume 15, Issue 2–3, pp 181–208 | Cite as

Linear Continuation-Passing

  • Josh Berdine
  • Peter O'Hearn
  • Uday Reddy
  • Hayo Thielecke
Article

Abstract

Continuations can be used to explain a wide variety of control behaviours, including calling/returning (procedures), raising/handling (exceptions), labelled jumping (goto statements), process switching (coroutines), and backtracking. However, continuations are often manipulated in a highly stylised way, and we show that all of these, bar backtracking, in fact use their continuations linearly; this is formalised by taking a target language for CPS transforms that has both intuitionistic and linear function types.

continuations continuation-passing style linear typing call/cc exceptions goto coroutines 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abadi, M. and Fiore, M.P. Syntactic considerations on recursive types. In 11th Annual IEEE Symposium on Logic in Computer Science, LICS'96, Proceedings, 1996, pp. 242–252.Google Scholar
  2. 2.
    Abramsky, S. and McCusker, G. Call-by-value games. In Computer Science Logic: 11th International Workshop, CSL'97, Annual Conference of the EACSL. Selected Papers,M. Nielsen and W. Thomas (Eds.). Lecture Notes in Computer Science, Vol. 1414, 1997, pp. 1–17.Google Scholar
  3. 3.
    Barber, A. and Plotkin, G. Dual intuitionistic linear logic. Technical Report ECS-LFCS-96-347, University of Edinburgh Laboratory for Foundations of Computer Science, 1997.Google Scholar
  4. 4.
    Berdine, J., O'Hearn, P.W., Reddy, U.S., and Thielecke, H. Linearly used continuations. In Proceedings of the Third ACM SIGPLANWorkshop on Continuations (CW'01), A. Sabry (Ed.). Technical Report 545, Computer Science Department, Indiana University, 2001, pp. 47–54.Google Scholar
  5. 5.
    Bruggeman, C., Waddell, O., and Dybvig, R.K. Representing control in the presence of one-shot continuations. In Proceedings of the ACMSIGPLAN '96 Conference on Programming Language Design and Implementation, 1996, pp. 99–107.Google Scholar
  6. 6.
    Danvy, O. Formalizing implementation strategies for first-class continuations. In Programming Languages and Systems: 9th European Symposium on Programming, ESOP 2000, Lecture Notes in Computer Science, Vol. 1782, Springer-Verlag, Berlin, 2000, pp. 88–103.Google Scholar
  7. 7.
    Danvy, O., Dzafic, B., and Pfenning, F. On proving syntactic properties of CPS programs. In Proceedings of HOOTS99, the Third International Workshop on Higher Order Operational Techniques in Semantics, A. Gordon and A. Pitts (Eds.). Electronic Notes in Theoretical Computer Science, Vol. 26, 2000, pp. 19–31.Google Scholar
  8. 8.
    Filinski, A. Linear continuations. In Proceedings of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 1992, pp. 27–38.Google Scholar
  9. 9.
    Fischer, M.J. Lambda calculus schemata. In Proceedings of an ACM Conference on Proving Assertions about Programs. New York, 1972, pp. 104–109. Also in SIGPLAN Notices, Vol. 7, No. 1 and SIGACT News, No. 14.Google Scholar
  10. 10.
    Fischer, M.J. Lambda-calculus schemata. LISP and Symbolic Computation, 6(3/4) (1993) 259–288.Google Scholar
  11. 11.
    Flanagan, C., Sabry, A., Duba, B.F., and Felleisen, M. The essence of compiling with continuations. In Proceedings of the Conference on Programming Language Design and Implementation, 1993, pp. 237–247.Google Scholar
  12. 12.
    Friedman, D.P. and Haynes, C.T. Constraining control. In Conference Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages, 1985, pp. 245–254.Google Scholar
  13. 13.
    Friedman, D.P., Wand, M., and Haynes, C.T. 1992, Essentials of Programming Languages, 1st edn. The MIT Press/McGraw-Hill.Google Scholar
  14. 14.
    Hasegawa, M. Linearly used effects: Monadic and CPS transformations into the linear lambda calculus. In Proceedings of the 6th International Symposium on Functional and Logic Programming (FLOPS2002). Aizu, Japan, 2002.Google Scholar
  15. 15.
    Haynes, C.T. Logic continuations. Journal of Logic Programming, 4(2) (1987) 157–176.Google Scholar
  16. 16.
    Laird, J.D. A Semantic analysis of control. Ph.D. Thesis, University of Edinburgh, 1998.Google Scholar
  17. 17.
    Laird, J. A game semantics of linearly used continuations. Personal communication, 2002.Google Scholar
  18. 18.
    Moreau, L. and Queinnec, C. Partial continuations as the difference of continuations, A duumvirate of control operators. In International Conference on Programming Language Implementation and Logic Programming (PLILP'94), Proceedings, M. Hermenegildo and J. Penjam (Eds.). Lecture Notes in Computer Science, Vol. 0844, 1994, pp. 182–197.Google Scholar
  19. 19.
    Morris, L. The Next 700 programming language descriptions (1970). Later published as [20].Google Scholar
  20. 20.
    Morris, L. The Next 700 programming language descriptions. LISP and Symbolic Computation 6(3/4) (1993) 249–258. Publication of previously circulated [19].Google Scholar
  21. 21.
    O'Hearn, P.W. and Reynolds, J.C. From algol to polymorphic linear lambda-calculus. Journal of the ACM, 47(1) (2000) 167–223.Google Scholar
  22. 22.
    Plotkin, G.D. Call-by-name, Call-by-value and the ?-calculus. Theoretical Computer Science, 1(2) (1975) 125–159.Google Scholar
  23. 23.
    Polakow, J. and Pfenning, F. Properties of terms in continuation-passing style in an ordered logical framework. InWorkshop on Logical Frameworks and Meta-Languages (LFM 2000), J. Despeyroux (Ed.). 2000. Available at http://www-sop.inria.fr/certilab/LFM00/Proceedings/.Google Scholar
  24. 24.
    Polakow, J. and Yi,K. Proving syntactic properties of exceptions in an ordered logical framework. In Functional and Logic Programming: 5th International Symposium, FLOPS 2001, H. Kuchen and K. Ueda (Eds.). Lecture Notes in Computer Science, Vol. 2024, 2001, pp. 61–77.Google Scholar
  25. 25.
    Reynolds, J.C. GEDANKEN-A simple typeless language based on the principle of completeness and the reference concept. Communications of the ACM, 13(5) (1970) 308–319.Google Scholar
  26. 26.
    Reynolds, J.C. Definitional interpreters for higher-order programming languages. In Proceedings of the ACM Annual Conference, New York, 1972, Vol. 2, pp. 717–740. Reprinted as [27].Google Scholar
  27. 27.
    Reynolds, J.C. Definitional interpreters for higher-order programming languages. Higher-Order and Symbolic Computation, 11(4) (1998) 363–397. Reprint of [26].Google Scholar
  28. 28.
    Sabry, A. (Ed.). Proceedings of the Third ACM SIGPLAN Workshop on Continuations (CW'01) (2001). Technical Report 545, Computer Science Department, Indiana University, London, England.Google Scholar
  29. 29.
    Sabry, A. and Felleisen, M. Reasoning about programs in continuation-passing style. LISP and Symbolic Computation, 6(3/4) (1993) 289–360.Google Scholar
  30. 30.
    Scott, D.S. Outline of a mathematical theory of computation. Technical Monograph PRG-2, Programming Research Group, Oxford University Computing Laboratory, 1970.Google Scholar
  31. 31.
    Smolka, G. (Ed.). Programming Languages and Systems: 9th European Symposium on Programming, ESOP 2000, held as part of the joint European Conferences on Theory and Practice of Software, ETAPS 2000, Proceedings, Lecture Notes in Computer Science, Vol. 1782, Springer-Verlag, Berlin, 2000.Google Scholar
  32. 32.
    Steele, Jr., G.L. and Gabriel, R.P. The evolution of LISP. In History of Programming Languages, T.J. Bergin and R.G. Gibson (Eds.). Vol. 2, Addison Wesley, Reading, MA, 1996, pp. 233–308.Google Scholar
  33. 33.
    Strachey, C. and Wadsworth, C.P. Continuations: A mathematical semantics for handling full jumps. Technical Monograph PRG-11, Programming Research Group, Oxford University Computing Laboratory, 1974 Reprinted as [34].Google Scholar
  34. 34.
    Strachey, C. and Wadsworth, C.P. Continuations: A mathematical semantics for handling full jumps. Higher-Order and Symbolic Computation, 13(1/2) (2000) 135–152. Reprint of [33].Google Scholar
  35. 35.
    Tennent, R.D. Mathematical semantics of SNOBOL4. In Conference Record of the First Annual ACM Symposium on Principles of Programming Languages, 1973, pp. 95–107.Google Scholar
  36. 36.
    Thielecke, H. Comparing control constructs by double-barrelled CPS. Higher-Order and Symbolic Computation, 15(2/3) (2002) 141–160.Google Scholar
  37. 37.
    Thielecke, H. Using a continuation twice and its implications for the expressive power of call/cc. Higher-Order and Symbolic Computation, 12(1) (1999) 47–74.Google Scholar
  38. 38.
    Thielecke, H. On exceptions versus continuations in the presence of state. In Programming Languages and Systems: 9th European Symposium on Programming, ESOP 2000, Lecture Notes in Computer Science, Vol. 1782, Springer-Verlag, Berlin, 2000, pp. 397–411.Google Scholar
  39. 39.
    Zdancewic, S. and Myers, A.C. Secure information flow and linear continuations. Higher-Order and Symbolic Computation, 15(2/3) (2002) 209–234.Google Scholar

Copyright information

© Kluwer Academic Publishers 2002

Authors and Affiliations

  • Josh Berdine
    • 1
  • Peter O'Hearn
    • 1
  • Uday Reddy
    • 2
  • Hayo Thielecke
    • 2
  1. 1.Department of Computer Science, Queen MaryUniversity of LondonLondonUnited Kingdom
  2. 2.School of Computer ScienceThe University of BirminghamBirminghamUnited Kingdom

Personalised recommendations