Axioms for control operators in the CPS hierarchy

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.

[1]  Akinori Yonezawa,et al.  Portable Implementation of Continuation Operators in Imperative Languages by Exception Handling , 2000, Advances in Exception Handling Techniques.

[2]  Chung-chieh Shan,et al.  Shift control. , 2002, Nursing standard (Royal College of Nursing (Great Britain) : 1987).

[3]  O. Danvy,et al.  An Operational Foundation for Delimited Continuations , 2003 .

[4]  Amr Sabry,et al.  A type-theoretic foundation of continuations and prompts , 2004, ICFP '04.

[5]  Olivier Danvy,et al.  Type-directed partial evaluation , 1995, POPL '96.

[6]  Peter W. O'Hearn,et al.  Linear Continuation-Passing , 2002, High. Order Symb. Comput..

[7]  Olivier Danvy,et al.  Abstracting control , 1990, LISP and Functional Programming.

[8]  Olivier Danvy,et al.  An Operational Investigation of the CPS Hierarchy , 1999, ESOP.

[9]  Andrzej Filinski,et al.  Representing monads , 1994, POPL '94.

[10]  Hayo Thielecke,et al.  From control effects to typed continuation passing , 2003, POPL '03.

[11]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[12]  Yukiyoshi Kameyama,et al.  A sound and complete axiomatization of delimited continuations , 2003, ICFP '03.

[13]  Timothy G. Griffin,et al.  A formulae-as-type notion of control , 1989, POPL '90.

[14]  Kenichi Asai Online partial evaluation for shift and reset , 2002, PEPM.

[15]  Olivier Danvy,et al.  Representing Control: a Study of the CPS Transformation , 1992, Mathematical Structures in Computer Science.

[16]  Andrzej Filinski,et al.  Representing layered monads , 1999, POPL '99.

[17]  Olivier Danvy,et al.  A Functional Abstraction of Typed Contexts , 1989 .

[18]  Yukiyoshi Kameyama,et al.  A Type-Theoretic Study on Partial Continuations , 2000, IFIP TCS.

[19]  Olivier Danvy,et al.  On the dynamic extent of delimited continuations , 2005, Inf. Process. Lett..

[20]  Harvey M. Friedman,et al.  Classically and intuitionistically provably recursive functions , 1978 .

[21]  M. Felleisen,et al.  Reasoning about programs in continuation-passing style , 1993 .

[22]  Amr Sabry,et al.  The essence of compiling with continuations , 1993, PLDI '93.

[23]  Olivier Danvy,et al.  Continuation-based partial evaluation , 1994, LFP '94.

[24]  Olivier Danvy,et al.  AN OPERATIONAL FOUNDATION FOR DELIMITED CONTINUATIONS IN THE CPS HIERARCHY , 2005 .

[25]  Kenichi Asai Offline partial evaluation for shift and reset , 2004, PEPM '04.

[26]  Matthias Felleisen,et al.  The theory and practice of first-class prompts , 1988, POPL '88.

[27]  Didier Rémy,et al.  A generalization of exceptions and control in ML-like languages , 1995, FPCA '95.