A first-order one-pass CPS transformation

We present a new transformation of call-by-value lambda-terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and first-order. Because it operates in one pass, it directly yields compact CPS programs that are comparable to what one would write by hand. Because it is compositional, it allows proofs by structural induction. Because it is first-order, reasoning about it does not require the use of a logical relation.This new CPS transformation connects two separate lines of research. It has already been used to state a new and simpler correctness proof of a direct-style transformation, and to develop a new and simpler CPS transformation of control-flow information.

[1]  William D. Clinger Proper tail recursion and space efficiency , 1998, PLDI.

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

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

[4]  P. Wadler,et al.  A Reeection on Call-by-value , 1996 .

[5]  Olivier Danvy,et al.  A Simple CPS Transformation of Control-Flow Information , 2002, Log. J. IGPL.

[6]  Olivier Danvy,et al.  Syntactic Theories in Practice , 2001, RULE@PLI.

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

[8]  Daniel Damian,et al.  On Static and Dynamic Control-Flow Information in Program Analysis and Transformation , 2001 .

[9]  Olivier Danvy,et al.  Formalizing Implementation Strategies for First-Class Continuations , 1999, ESOP.

[10]  John C. Reynolds,et al.  The discoveries of continuations , 1993, LISP Symb. Comput..

[11]  Kwangkeun Yi,et al.  Proving Syntactic Properties of Exceptions in an Ordered Logical Framework , 2001, APLAS.

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

[13]  Mitchell Wand Correctness of Procedure Representations in Higher-Order Assembly Language , 1991, MFPS.

[14]  Olivier Danvy,et al.  Back to Direct Style , 1992, Sci. Comput. Program..

[15]  Olivier Danvy,et al.  A Simple Cps Transformation Of Control-flow Information , 2001 .

[16]  Andrew C. Myers,et al.  Secure Information Flow via Linear Continuations , 2002, High. Order Symb. Comput..

[17]  Kwangkeun Yi Interconnecting Between CPS Terms and Non-CPS Terms , 2001 .

[18]  Olivier Danvy,et al.  Syntactic accidents in program analysis: on the impact of the CPS transformation , 2000, ICFP '00.

[19]  Mitchell Wand,et al.  Embedding type structure in semantics , 1985, POPL.

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

[21]  Olivier Danvy,et al.  A Higher-Order Colon Translation , 2000, FLOPS.

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

[23]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[24]  Frank Pfenning,et al.  Natural Deduction for Intuitionistic Non-communicative Linear Logic , 1999, TLCA.

[25]  Ichiro Ogata A CPS-Transform of Constructive Classical Logic , 1999, ASIAN.

[26]  Olivier Danvy,et al.  A generic account of continuation-passing styles , 1994, POPL '94.

[27]  Frank Pfenning,et al.  Properties of Terms in Continuation-Passing Style in an Ordered Logical Framework , 2000 .

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

[29]  Lasse R. Nielsen A Simple Correctness Proof of the Direct-Style Transformation , 2002 .

[30]  Olivier Danvy,et al.  On proving syntactic properties of CPS programs , 1999, Electron. Notes Theor. Comput. Sci..

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

[32]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[33]  Olivier Danvy,et al.  The Occurrence of Continuation Parameters in CPS Terms , 1995 .

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

[35]  William D. Clinger,et al.  Proper Tail Recursion and Space Eeciency , 1998 .

[36]  Glynn Winskel,et al.  The formal semantics of programming languages - an introduction , 1993, Foundation of computing series.

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

[38]  Amr Sabry,et al.  Reasoning about programs in continuation-passing style , 1992, LFP '92.

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

[40]  G. Winskel The formal semantics of programming languages , 1993 .

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

[42]  Paul Hudak,et al.  ORBIT: an optimizing compiler for scheme , 1986, SIGPLAN '86.

[43]  Jens Palsberg,et al.  CPS transformation of flow information , 2003, J. Funct. Program..

[44]  Mitchell Wand,et al.  Essentials of programming languages , 2008 .

[45]  J. van Leeuwen,et al.  Theoretical Computer Science , 2003, Lecture Notes in Computer Science.

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