Continuations, Processes, and Sharing

Continuation-passing style (CPS) transforms have long been important tools in the study of programming. They have been shown to correspond to abstract machines and, when combined with a naming transform that expresses shared values, they enjoy a direct correspondence with encodings into process calculi such as the π-calculus. We present our notion of correctness and discuss the sufficient conditions that guarantee the correctness of transforms. We then consider the call-by-value, call-by-name and call-by-need evaluation strategies for the λ-calculus and present their CPS transforms, abstract machines, π-encodings, and proofs of correctness. Our analysis covers a uniform CPS transform, which differentiates the three evaluation strategies only by the treatment of function calls. This leads to a new CPS transform for call-by-need requiring a less expressive form of side effect, which we call constructive update.

[1]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

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

[3]  Raheel Ahmad,et al.  The π-Calculus: A theory of mobile processes , 2008, Scalable Comput. Pract. Exp..

[4]  Olivier Danvy,et al.  A synthetic operational account of call-by-need evaluation , 2013, PPDP.

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

[6]  Roberto M. Amadio A decompilation of the pi-calculus and its application to termination , 2011, ArXiv.

[7]  Peter Sestoft,et al.  Deriving a lazy abstract machine , 1997, Journal of Functional Programming.

[8]  Xavier Leroy,et al.  A Formally Verified Compiler Back-end , 2009, Journal of Automated Reasoning.

[9]  Davide Sangiorgi,et al.  The Pi-Calculus - a theory of mobile processes , 2001 .

[10]  Davide Sangiorgi,et al.  From λ to π; or, Rediscovering continuations , 1999, Mathematical Structures in Computer Science.

[11]  Robin Milner,et al.  Functions as processes , 1990, Mathematical Structures in Computer Science.

[12]  Simon Brock,et al.  Process Semantics of Graph Reduction , 1995, CONCUR.

[13]  Peter Lee,et al.  Call-by-need and continuation-passing style , 1994, LISP Symb. Comput..

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

[15]  Matthias Felleisen,et al.  The Call-by-need Lambda Calculus, Revisited , 2012, ESOP.

[16]  Beniamino Accattoli Evaluating functions as processes , 2013, TERMGRAPH.

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

[18]  Olivier Danvy,et al.  A first-order one-pass CPS transformation , 2001, Theor. Comput. Sci..

[19]  Jean-Louis Krivine,et al.  A call-by-name lambda-calculus machine , 2007, High. Order Symb. Comput..

[20]  Olivier Danvy,et al.  A functional correspondence between evaluators and abstract machines , 2003, PPDP '03.

[21]  Zena M. Ariola,et al.  Lambda Calculus with Explicit Recursion , 1997, Inf. Comput..

[22]  Robin Milner,et al.  Elements of interaction: Turing award lecture , 1993, CACM.

[23]  Bernardo Toninho,et al.  Functions as Session-Typed Processes , 2012, FoSSaCS.