## The Occurrence of Continuation Parameters in CPS Terms (1995)

### Cached

### Download Links

Citations: | 25 - 18 self |

### BibTeX

@TECHREPORT{Danvy95theoccurrence,

author = {Olivier Danvy and Frank Pfenning},

title = {The Occurrence of Continuation Parameters in CPS Terms},

institution = {},

year = {1995}

}

### Years of Citing Articles

### OpenURL

### Abstract

We prove an occurrence property about formal parameters of continuations in Continuation-Passing Style (CPS) terms that have been automatically produced by CPS transformation of pure, call-byvalue -terms. Essentially, parameters of continuations obey a stack-like discipline. This property was introduced, but not formally proven, in an earlier work on the Direct-Style transformation (the inverse of the CPS transformation). The proof has been implemented in Elf, a constraint logic programming language based on the logical framework LF. In fact, it was the implementation that inspired the proof. Thus this note also presents a case study of machineassisted proof discovery. All the programs are available in ( ftp.daimi.aau.dk:pub/danvy/Programs/danvy-pfenning-Elf93.tar.gz ftp.cs.cmu.edu:user/fp/papers/cpsocc95.tar.gz Most of the research reported here was carried out while the first author visited Carnegie Mellon University in the Spring of 1993. Current address: Olivier Danvy, Ny Munkeg...

### Citations

709 | A framework for defining logics - Harper, Honsell, et al. - 1993 |

311 |
Higher-order abstract syntax
- Pfenning, Elliot
(Show Context)
Citation Context ...S) terms in BNF form. DS (Root) Terms r ::= e DS (Serious) Expressions e ::= e 0 e 1 j t DS Trivial Expressions t ::= x j x:r We only remark that the representation uses higher-order abstract syntax =-=[11]-=- to represent objectlevel abstractions, and that the natural inclusions (e.g., every trivial expression is an expression) are modeled by explicit coercions (e.g., dtriv_dexp). droot : type. %name droo... |

221 |
Call-by-name, call-by-value and the ‚-calculus
- PLOTKIN
- 1975
(Show Context)
Citation Context ... 17 7 The call-by-value DS transformation formulated as a judgment and using a stack : : 17 1 1 Introduction Continuation-Passing Style (CPS) -terms encode both evaluation order and sequencing order =-=[13]-=-. For example, consider the Direct Style (DS) -term x:f x (g x): Evaluating it from left to right under call-by-value (CBV) amounts 1. to evaluate f x | call the result v 1 , 2. to evaluate g x | ca... |

219 | Intensional Interpretation of Functionals of Finite Type - Tait - 1967 |

176 | Logic programming in the LF logical framework
- Pfenning
- 1991
(Show Context)
Citation Context ...otkin's CPS transformation, after administrative reductions [3, 16]. However this characterization was not formally proven. The goal of this note is to prove it. The proof has been implemented in Elf =-=[10]-=-, a constraint logic programming language based on the logical framework LF [5]. In fact, it was the implementation that inspired the proof. LF turned out to be particularly suited for this problem, s... |

164 | Reasoning about programs in continuation-passing style
- Sabry, Felleisen
- 1993
(Show Context)
Citation Context ... on conformant CPS terms to run them on a stack machine. In their work on reasoning about CPS programs, Sabry and Felleisen also rely on the unicity of continuations parameters in the pure -calculus =-=[14, 15]-=-. In their work on separating stages in the CPS transformation [7], Lawall and Danvy noticed that the sequencing order encoded in CPS terms is accounted for by the occurrences of parameters of continu... |

107 |
Danvy and Andrzej Filinski. Representing control: a study of the CPS transformation
- Olivier
- 1992
(Show Context)
Citation Context ...tion, i.e., a \direct-style transformation" [2]. To this end, it was necessary to characterize CPS terms that correspond to the output of Plotkin's CPS transformation, after administrative reductions =-=[3, 16]-=-. However this characterization was not formally proven. The goal of this note is to prove it. The proof has been implemented in Elf [10], a constraint logic programming language based on the logical ... |

96 |
Rabbit: A compiler for Scheme
- Jr
- 1978
(Show Context)
Citation Context ...tion, i.e., a \direct-style transformation" [2]. To this end, it was necessary to characterize CPS terms that correspond to the output of Plotkin's CPS transformation, after administrative reductions =-=[3, 16]-=-. However this characterization was not formally proven. The goal of this note is to prove it. The proof has been implemented in Elf [10], a constraint logic programming language based on the logical ... |

67 |
A framework for de logics
- Harper, Honsell, et al.
- 1993
(Show Context)
Citation Context ...s characterization was not formally proven. The goal of this note is to prove it. The proof has been implemented in Elf [10], a constraint logic programming language based on the logical framework LF =-=[5]-=-. In fact, it was the implementation that inspired the proof. LF turned out to be particularly suited for this problem, since two-level -terms and the CPS transformation can be encoded very naturally... |

52 | Lawall “Back to Direct Style II: First-Class Continuations
- Danvy, L
- 1992
(Show Context)
Citation Context ...pendix A. CPS terms that do not satisfy the occurrence conditions over continuation parameters correspond to DS terms that use a control operator such as call/cc. This point is investigated elsewhere =-=[4, 6]-=-. 3.3 Occurrences of formal parameters of continuations The occurrence conditions over the formal parameters of continuations are reproduced in Figure 4. Thissgure should be read as follows. Given a C... |

49 | Back to Direct Style
- Danvy
- 1994
(Show Context)
Citation Context ...of this term yields k:k (x:k:gx v 2 :f xv 1 :v 1 v 2 v 3 :k v 3 ): In earlier work, thesrst author developed a textual inverse of the CPS transformation, i.e., a \direct-style transformation" =-=[2]-=-. To this end, it was necessary to characterize CPS terms that correspond to the output of Plotkin's CPS transformation, after administrative reductions [3, 16]. However this characterization was not ... |

46 |
and Hanne Riis Nielson. Two-Level Functional Languages, volume 34 of Cambridge Tracts
- Nielson
- 1992
(Show Context)
Citation Context ...tkin's CPS transformer [13], derived in an earlier work [3]; it is slightly rephrased to match the syntactic domains. These equations can be read as a two-level specication a la Nielson and Nielson =-=[8]-=-. Operationally, for any variable x and any expressions e, e 0 , and e 1 , [x]e and e 0 (e 1 ) respectively correspond to functional abstractions and applications in the translation program (and de... |

37 | of the Church-Rosser Theorem and its Representation in a Logical Framework
- Pfenning
- 1992
(Show Context)
Citation Context ...esults. In unary form: A function is valid if it maps valid arguments to valid results. This kind of denition is pervasive in the application of logical frameworks to meta-theoretic reasoning (e.g., =-=[9]-=-). It works smoothly here. Four notions of validity arise: for root terms, for trivial expressions, for serious expressions, and for continuations. In their denitions, we must account for the context... |

32 | Implementing the meta-theory of deductive systems
- Pfenning, Rohwedder
- 1992
(Show Context)
Citation Context ...)). 5.5 The proof The informal proof in Section 4 that continuation parameters obey a stack-like discipline can be translated into Elf using the technique of higher-level judgments (see, for example, =-=[12]-=-). Our (constructive) proof may be seen as containing an algorithm for computing a derivation R 0 of ` CRoot Var r 0 from a derivation R of ` r DRoot ! r 0 . In Elf, this algorithm is implemented as ... |

24 | Proving the correctness of storage representations
- Wand, Oliva
(Show Context)
Citation Context ... Figure 7: The call-by-value DS transformation formulated as a judgment and using a stack 17 7 Related Work The structure of CPS terms has been little investigated. Most authors (e.g., Wand and Oliva =-=[18]-=-) implicitly rely on conformant CPS terms to run them on a stack machine. In their work on reasoning about CPS programs, Sabry and Felleisen also rely on the unicity of continuations parameters in the... |

13 | Separating stages in the continuation-passing style transformation
- Lawall, Danvy
- 1993
(Show Context)
Citation Context ...y, they specify another evaluation order or another sequencing order than the one captured in the CPS transformation of Figures 1 and 2. Therefore, they cannot be mapped back to direct style navely =-=[2, 7]-=-. 4 The Proof Globally, we are interested in proving that if ` r DRoot ! r 0 then ` CRoot Var r 0 . Clearly, we cannot prove this inductively by itself since properties at the root of a term are den... |

12 |
Intensional interpretation of functionals of type I
- Tait
- 1967
(Show Context)
Citation Context ...uctive hypothesis) for the translation of expressions under a continuation. A continuation is a (meta-level) function from trivial terms to expressions, which suggests the method of logical relations =-=[17]-=-. The idea behind binary logical relations is to consider two functions related if they map related arguments to related results. In unary form: A function is valid if it maps valid arguments to valid... |

6 |
Continuation Introduction and Elimination in Higher-Order Programming Languages
- Lawall
- 1994
(Show Context)
Citation Context ...pendix A. CPS terms that do not satisfy the occurrence conditions over continuation parameters correspond to DS terms that use a control operator such as call/cc. This point is investigated elsewhere =-=[4, 6]-=-. 3.3 Occurrences of formal parameters of continuations The occurrence conditions over the formal parameters of continuations are reproduced in Figure 4. Thissgure should be read as follows. Given a C... |