On the dynamic extent of delimited continuations

We show that breadth-first traversal exploits the difference between the static delimited-control operator shift (alias S) and the dynamic delimited-control operator control (alias F). For the last 15 years, this difference has been repeatedly mentioned in the literature but it has only been illustrated with one-line toy examples. Breadth-first traversal fills this vacuum.

[1]  Robert Harper,et al.  Typing first-class continuations in ML , 1991, POPL '91.

[2]  Eugene Charniak,et al.  Artificial Intelligence Programming , 1987 .

[3]  John Hatcliff,et al.  The structure of continuation-passing styles , 1995 .

[4]  Hayo Thielecke,et al.  Categorical Structure of Continuation Passing Style , 1997 .

[5]  Olivier Danvy,et al.  An Operational Foundation for Delimited Continuations in the CPS Hierarchy , 2005, Log. Methods Comput. Sci..

[6]  Gerald J. Sussman,et al.  Scheme: A Interpreter for Extended Lambda Calculus , 1998, High. Order Symb. Comput..

[7]  Gregory F. Johnson GL-a denotational testbed with continuations and partial continuations as first-class objects , 1987, PLDI.

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

[9]  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 .

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

[11]  Christian Queinnec,et al.  Value Transforming Style , 1992, WSA.

[12]  Gerald Jay Sussman,et al.  An Interpreter for Extended Lambda Calculus , 1975 .

[13]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[14]  Olivier Danvy,et al.  On some Functional Aspects of Control , 1988 .

[15]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[16]  Chris Okasaki,et al.  Breadth-first numbering: lessons from a small exercise in algorithm design , 2000, ICFP '00.

[17]  M. Goldberg On the Recursive Enumerability of Fixed-Point Combinators , 2004 .

[18]  Andrzej Filinski,et al.  Denotational aspects of untyped normalization by evaluation , 2005, RAIRO Theor. Informatics Appl..

[19]  Erik Sandewall,et al.  An early use of continuations and partial evaluation for compiling rules written in FOPC , 1999 .

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

[21]  Peter Bro Miltersen,et al.  Reviewing bounds on the circuit size of the hardest functions , 2005, Inf. Process. Lett..

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

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

[24]  Frank Pfenning,et al.  Functional programming with names and necessity , 2004 .

[25]  James David Laird,et al.  A semantic analysis of control , 1999 .

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

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

[28]  Vincent Balat,et al.  Une étude des sommes fortes : isomorphismes et formes normales. (A study of strong sums: isomorphisms and normal forms) , 2002 .

[29]  Anders Møller,et al.  The Design Space of Type Checkers for XML Transformation Languages , 2004, ICDT.

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

[31]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

[32]  Olivier Danvy,et al.  CPS transformation of beta-redexes , 2000, Inf. Process. Lett..

[33]  Albert R. Meyer,et al.  Continuation Semantics in Typed Lambda-Calculi (Summary) , 1985, Logic of Programs.

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

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

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

[37]  Andrew Twigg,et al.  Distributed Approximation of Fixed-Points in Trust Structures , 2005, 25th IEEE International Conference on Distributed Computing Systems (ICDCS'05).

[38]  Chetan R. Murthy Extracting Constructive Content From Classical Proofs , 1990 .

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

[40]  P. J. Landin,et al.  A Generalization of Jumps and Labels , 1998, High. Order Symb. Comput..

[41]  Robert Hieb,et al.  Revised 5 Report on the Algorithmic Language , 1999 .

[42]  Amr Sabry,et al.  The formal relationship between direct and continuation-passing style optimizing compilers - a synthesis of two paradigms , 1996, Rice COMP TR.

[43]  Daniel P. Friedman,et al.  CONS Should Not Evaluate its Arguments , 1976, ICALP.

[44]  Christopher Strachey,et al.  Continuations: A Mathematical Semantics for Handling Full Jumps , 2000, High. Order Symb. Comput..

[45]  J. Lawall,et al.  Continuation introduction and elimination in higher-order programming languages , 1995 .

[46]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

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

[48]  Jørgen Iversen Type Checking Semantic Functions in ASDF , 2004 .

[49]  Oleg Kiselyov,et al.  How to remove a dynamic prompt: static and dynamic delimited continuation operators are equally expressible , 2005 .

[50]  Peter D. Mosses Exploiting Labels in Structural Operational Semantics , 2005 .

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

[52]  Peter D. Mosses,et al.  Constructive Action Semantics for Core ML , 2005, IEE Proc. Softw..

[53]  Peter D. Mosses,et al.  An Action Environment , 2004, LDTA@ETAPS.

[54]  Chris Mellish,et al.  Integrating Prolog in the POPLOG Environment , 1984, Implementations of Prolog.

[55]  Matthias Felleisen,et al.  Abstract continuations: a mathematical semantics for handling full jumps , 1988, LISP and Functional Programming.

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

[57]  Peter Henderson,et al.  A lazy evaluator , 1976, POPL.

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

[59]  Erich J. Neuhold,et al.  Formal description of programming concepts , 1991 .

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

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

[62]  O. Danvy,et al.  A Simple Proof of a Folklore Theorem about Delimited Control , 2005 .

[63]  Olivier Danvy,et al.  Fast partial evaluation of pattern matching in strings , 2003, PEPM.

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

[65]  Gregory F. Johnson,et al.  Stores and partial continuations as first-class objects in a language and its environment , 1988, POPL '88.

[66]  Mitchell Wand,et al.  Bottom-Up -Substitution: Uplinks and -DAGs , 2004 .

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

[68]  Mitchell Wand,et al.  Continuation-Based Program Transformation Strategies , 1980, JACM.

[69]  Jeff Polakow,et al.  Ordered linear logic and applications , 2001 .

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

[71]  Carsten Führmann,et al.  The structure of call-by-value , 2000 .

[72]  G. F. Johnson GL-a denotational testbed with continuations and partial continuations as first-class objects , 1987, PLDI.

[73]  Mitchell Wand,et al.  A scheme for a higher-level semantic algebra , 1986 .

[74]  Jon L. White Proceedings of the 1992 ACM conference on LISP and functional programming , 1992 .

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

[76]  Olivier Danvy,et al.  Program Extraction From Proofs of Weak Head Normalization , 2005, MFPS.