AN OPERATIONAL FOUNDATION FOR DELIMITED CONTINUATIONS IN THE CPS HIERARCHY

We present an abstract machine and a reduction semantics for the lambda-calculus extended with control operators that give access to delimited continuations in the CPS hierarchy. The abstract machine is derived from an evaluator in continuation-passing style (CPS); the reduction semantics (i.e., a small-step operational semantics with an explicit representation of evaluation contexts) is constructed from the abstract machine; and the control operators are the shift and reset family. At level n of the CPS hierarchy, programs can use the control operators shift_i and reset_i for 1 We also present new applications of delimited continuations in the CPS hierarchy: finding list prefixes and normalization by evaluation for a hierarchical language of units and products.

[1]  Eijiro Sumii,et al.  An Implementation of Transparent Migration on Standard Scheme , 2002 .

[2]  Olivier Danvy,et al.  A functional correspondence between monadic evaluators and abstract machines for languages with computational effects , 2003, Theor. Comput. Sci..

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

[4]  Scott Draves,et al.  Implementing bit-addressing with specialization , 1997, ICFP '97.

[5]  Andrzej Filinski,et al.  Normalization by Evaluation for the Computational Lambda-Calculus , 2001, TLCA.

[6]  Jonathan Rees,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[7]  Per Martin-Löuf About Models for Intuitionistic Type Theories and the Notion of Definitional Equality , 1975 .

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

[9]  Dorai Sitaram,et al.  Models of control and their implications for programming language design , 1994, Rice COMP TR.

[10]  Matthias Felleisen,et al.  Control delimiters and their hierarchies , 1990, LISP Symb. Comput..

[11]  Matthias Felleisen,et al.  Reasoning with continuations II: full abstraction for models of control , 1990, LISP and Functional Programming.

[12]  Lasse Nielsen,et al.  A Denotational Investigation of Defunctionalization , 2000 .

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

[14]  Yoshiki Kinoshita A BICATEGORICAL ANALYSIS OF E-CATEGORIES , 1998 .

[15]  Luc Moreau,et al.  Partial Continuations as the Difference of Continuations - A Duumvirate of Control Operators , 1994, PLILP.

[16]  Lasse R. Nielsen,et al.  Refocusing in Reduction Semantics , 2004 .

[17]  Robert Hieb,et al.  Continuations and concurrency , 1990, PPOPP '90.

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

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

[20]  Simon L. Peyton Jones,et al.  Making a fast curry: push/enter vs. eval/apply for higher-order languages , 2006, J. Funct. Program..

[21]  Olivier Danvy,et al.  A functional correspondence between call-by-need evaluators and lazy abstract machines , 2003, Inf. Process. Lett..

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

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

[24]  Olivier Danvy A Rational Deconstruction of Landin's SECD Machine , 2004, IFL.

[25]  Olivier Danvy,et al.  A Concrete Framework for Environment Machines , 2005 .

[26]  Yukiyoshi Kameyama,et al.  Axioms for Delimited Continuations in the CPS Hierarchy , 2004, CSL.

[27]  Olivier Danvy,et al.  On the Dynamic Extent of Delimited Continuations , 2005 .

[28]  Ulrich Berger,et al.  An inverse of the evaluation functional for typed lambda -calculus , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[29]  Naoki Kobayashi,et al.  A Hybrid Approach to Online and Offline Partial Evaluation , 2001, High. Order Symb. Comput..

[30]  John C. Reynolds Definitional Interpreters for Higher-Order Programming Languages , 1998, High. Order Symb. Comput..

[31]  Matthew L. Ginsberg,et al.  Multivalued logics: a uniform approach to reasoning in artificial intelligence , 1988, Comput. Intell..

[32]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

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

[34]  Thierry Coquand,et al.  Intuitionistic model constructions and normalization proofs , 1997, Mathematical Structures in Computer Science.

[35]  Philip Wadler,et al.  Monads and composable continuations , 1994, LISP Symb. Comput..

[36]  Olivier Danvy,et al.  A Functional Correspondence between Evaluators and Abstract Machines , 2003 .

[37]  Olivier Danvy,et al.  A Dynamic Continuation-Passing Style for Dynamic Delimited Continuations , 2005 .

[38]  Simon Peyton Jones,et al.  A Monadic Framework for Subcontinuations , 2005 .

[39]  Peter Dybjer,et al.  Normalization and Partial Evaluation , 2000, APPSEM.

[40]  Olivier Danvy,et al.  On Evaluation Contexts, Continuations, and the Rest of the Computation , 2004 .

[41]  Olivier Danvy,et al.  Defunctionalization at work , 2001, PPDP '01.

[42]  Amr Sabry,et al.  From Syntactic Theories to Interpreters: Automating the Proof of Unique Decomposition , 2001, High. Order Symb. Comput..

[43]  Helmut Schwichtenberg,et al.  Normalisation by Evaluation , 1998, Prospects for Hardware Foundations.

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

[45]  Olivier Danvy On listing list prefixes , 1989, LIPO.

[46]  Olivier Danvy,et al.  Memoization in Type-Directed Partial Evaluation , 2002 .

[47]  Michael Sperber,et al.  Final shift for call/cc:: direct implementation of shift and reset , 2002, ICFP '02.

[48]  Olivier Danvy Type-Directed Partial Evaluation , 1998, Partial Evaluation.

[49]  Matthias Felleisen,et al.  The calculi of lambda-nu-cs conversion: a syntactic theory of control and state in imperative higher-order programming languages , 1987 .

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

[51]  Peter Dybjer,et al.  Extracting a Proof of Coherence for Monoidal Categories from a Proof of Normalization for Monoids , 1995, TYPES.

[52]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[53]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[54]  Matthias Felleisen,et al.  Control operators, the SECD-machine, and the λ-calculus , 1987, Formal Description of Programming Concepts.

[55]  Anindya Banerjee,et al.  Design and Correctness of Program Transformations Based on Control-Flow Analysis , 2001, TACS.

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

[57]  Christian Queinnec,et al.  A dynamic extent control operator for partial continuations , 1991, POPL '91.

[58]  Peter Thiemann,et al.  Combinators for program generation , 1999, Journal of Functional Programming.

[59]  Gordon D. Plotkin,et al.  A structural approach to operational semantics , 2004, J. Log. Algebraic Methods Program..

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

[61]  Roberto Di Cosmo,et al.  Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums , 2004, POPL.

[62]  Thérèse Hardin,et al.  Functional runtime systems within the lambda-sigma calculus , 1998, Journal of Functional Programming.

[63]  O. Danvy,et al.  A Syntactic Correspondence between Context-Sensitive Calculi and Abstract Machines , 2005 .

[64]  Olivier Danvy,et al.  From Interpreter to Logic Engine by Defunctionalization , 2003, LOPSTR.

[65]  Jr. Guy L. Steele,et al.  Rabbit: A Compiler for Scheme , 1978 .

[66]  Olivier Danvy From Reduction-Based to Reduction-Free Normalization , 2004 .

[67]  Peter Thiemann,et al.  Two Flavors of Offline Partial Evaluation , 1998, ASIAN.

[68]  Martin Hofmann,et al.  Categorical Reconstruction of a Reduction Free Normalization Proof , 1995, Category Theory and Computer Science.

[69]  John Hughes,et al.  A Novel Representation of Lists and its Application to the Function "reverse" , 1986, Inf. Process. Lett..