## Logical Relations for Call-by-value Delimited Continuations (2007)

### Cached

### Download Links

- [pllab.is.ocha.ac.jp]
- [www.cs.ioc.ee]
- [pllab.is.ocha.ac.jp]
- DBLP

### Other Repositories/Bibliography

Venue: | In Trends in Functional Programming |

Citations: | 4 - 4 self |

### BibTeX

@INPROCEEDINGS{Asai07logicalrelations,

author = {Kenichi Asai},

title = {Logical Relations for Call-by-value Delimited Continuations},

booktitle = {In Trends in Functional Programming},

year = {2007},

pages = {63--78}

}

### OpenURL

### Abstract

Abstract: Logical relations, defined inductively on the structure of types, provide a powerful tool to characterize higher-order functions. They often enable us to prove correctness of a program transformer written with higher-order functions concisely. This paper demonstrates that the technique of logical relations can be used to characterize call-by-value functions as well as delimited continuations. Based on the traditional logical relations for call-by-name functions, logical relations for call-by-value functions are first defined, whose CPS variant is used to prove the correctness of an offline specializer for the call-by-value λcalculus. They are then modified to cope with delimited continuations and are used to establish the correctness of an offline specializer for the call-by-value λcalculus with delimited continuation constructs, shift and reset. This is the first correctness proof for such a specializer. Along the development, correctness of the continuation-based and shift/reset-based let-insertion and A-normalization is established.

### Citations

760 | Types and Programming Languages - Pierce - 2002 |

342 |
Foundations for programming languages
- Mitchell
- 1996
(Show Context)
Citation Context ...ku, Tokyo 112-8610, Japan; Email: asai@is.ocha.ac.jp 63sinduction on the input program does not usually work, because we can not easily characterize their behavior. The technique of logical relations =-=[16]-=- is one of the proof methods that is often used in such a case. With the help of types, it enables us to define a set of relations that captures necessary properties of higher-order functions. Notably... |

320 | Lambda-calculus notation with nameless dummies: a tool for automatic formula manipulation with application to the Church-Rosser theorem
- Bruijn
- 1972
(Show Context)
Citation Context ...or one of constructors whose arguments are values. When a specializer produces its output, it needs to generate fresh variables. To make the presentation simple, we use so-called the de Bruijn levels =-=[9]-=- (not indices). Define the following five strict operators: var(m) = λn.Var(m) lam( f ) = λn.Lam(n, f (n + 1)) app( f1, f2) = λn.App( f1 n, f2 n) shift( f ) = λn.Shift(n, f (n + 1)) reset( f ) = λn.Re... |

280 | The essence of compiling with continuations
- Flanagan, Sabry, et al.
- 1993
(Show Context)
Citation Context ...lculus with shift and reset. • Along the development, we establish the correctness of the continuation-based let-insertion, the shift/reset-based let-insertion, the continuation-based A-normalization =-=[13]-=-, and the shift/reset-based A-normalization. The paper is organized as follows. After showing preliminaries in Section 5.2, the call-by-name specializer and its correctness proof by Wand are reviewed ... |

118 | Danvy “Automatic autoprojection of recursive equations with global variables and abstract data types
- Bondorf, O
- 1991
(Show Context)
Citation Context ...ll-by-value semantics does not hold for the specializer in Section 5.3 because it may discard a non-terminating computation. The standard method to recover the correctness is to perform let-insertion =-=[5]-=-. Since let-insertion requires explicit manipulation of continuations, we first rewrite our specializer into CPS as follows: P 2 [[Var(n)]]ρκ = κ(ρ(n)) P 2 [[Lam(n,W)]]ρκ = κ(λx.λk.P 2 [[W]]ρ[x/n]k) P... |

96 | Abstracting control
- Danvy, Filinski
- 1990
(Show Context)
Citation Context ... the continuation-based let-insertion to avoid computation elimination/duplication. It is well-known that by using delimited continuation constructs, shift and reset, introduced by Danvy and Filinski =-=[7]-=-, it is possible to implement the letinsertion in direct style [18]. We demonstrate that the correctness of this directstyle specializer with the shift/reset-based let-insertion can be also establishe... |

83 | Representing control: A study of the CPS transformation
- Danvy, Filinski
- 1991
(Show Context)
Citation Context ...on when the abstraction is applied at runtime. This insertion of a dynamic shift is reminiscent of η-expansion. To remove administrative redexes in the one-pass CPS transformation, Danvy and Filinski =-=[8]-=- turned all the continuations that are unknown at transformation time into static 423sfunctions using η-expansion. The above insertion of the dynamic shift does exactly the same thing in the direct-st... |

66 | A functional abstraction of typed contexts
- Danvy, Filinski
- 1989
(Show Context)
Citation Context ...inuations are used to implement the delimited continuations in the source language. To characterize such delimited continuations, we define logical relations based on Danvy and Filinski’s type system =-=[6]-=-. Thanks to the explicit reference to the types of continuations and the final result, we can establish the correctness of the specializer. This is the first correctness proof for the offline speciali... |

50 | Back to direct style II: First-class continuations
- Danvy, Lawall
- 1992
(Show Context)
Citation Context ...e correctness of a specializer written in CPS in the previous section, the development in this section is easy. Roughly speaking, we transform the results in the previous section back to direct style =-=[8]-=-. During this process, we use the firstclass delimited continuation constructs, shift and reset, to cope with non-standard use of continuations. Intuitively, shift captures the current continuation up... |

50 | to direct style
- Danvy
- 1992
(Show Context)
Citation Context ...e correctness of a specializer written in CPS in the previous section, the development in this section is easy. Roughly speaking, we transform the results in the previous section back to direct style =-=[5, 9]-=-. During this process, we use the first-class delimited continuation constructs, shift and reset, to cope with non-standard use of continuations. Here is the definition of the specializer written in d... |

37 |
Specifying the Correctness of Binding-Time Analysis
- Wand
- 1993
(Show Context)
Citation Context ... of the proof methods that is often used in such a case. With the help of types, it enables us to define a set of relations that captures necessary properties of higher-order functions. Notably, Wand =-=[20]-=- used this technique to prove correctness of an offline specializer [14] in which higher-order functions rather than closures were used for the representation of abstractions. However, the logical rel... |

26 | A semantic account of type-directed partial evaluation
- Filinski
- 1999
(Show Context)
Citation Context ...sed the environmentbased formulation, which is essentially the same but is more close to the implementation. Filinski presented normalization-by-evaluation algorithms for the call-by-value λ-calculus =-=[10]-=- and the computational λ-calculus [11]. He showed their correctness denotationally using logical relations. The same framework is extended to the untyped λ-calculus by Filinski and Rohde [12]. The typ... |

25 | A sound and complete axiomatization of delimited continuations - Kameyama, Hasegawa - 2003 |

19 | Normalization by evaluation for the computational lambda-calculus
- Filinski
- 2001
(Show Context)
Citation Context ...which is essentially the same but is more close to the implementation. Filinski presented normalization-by-evaluation algorithms for the call-by-value λ-calculus [10] and the computational λ-calculus =-=[11]-=-. He showed their correctness denotationally using logical relations. The same framework is extended to the untyped λ-calculus by Filinski and Rohde [12]. The type system used in this paper is due to ... |

13 | Towards Partial Evaluation of Full Scheme
- Thiemann
- 1996
(Show Context)
Citation Context ...tion of logical relations for shift and reset. We also presented the online specializers for the λ-calculus with shift and reset [2]. However, their correctness has not been formally proved. Thiemann =-=[17]-=- presented an offline partial evaluator for Scheme including call/cc. In his partial evaluator, call/cc is reduced if the captured continuation and the body of call/cc are both static. This is close t... |

10 | Offline Partial Evaluation for Shift and Reset
- Asai
- 2004
(Show Context)
Citation Context ...-style account of the previous work, but it contains non-trivial definition of logical relations for shift and reset. We also presented the online specializers for the λ-calculus with shift and reset =-=[2]-=-. However, their correctness has not been formally proved. Thiemann [17] presented an offline partial evaluator for Scheme including call/cc. In his partial evaluator, call/cc is reduced if the captur... |

7 | A denotational account of untyped normalization by evaluation
- Filinski, Rohde
- 2002
(Show Context)
Citation Context ...calculus [10] and the computational λ-calculus [11]. He showed their correctness denotationally using logical relations. The same framework is extended to the untyped λ-calculus by Filinski and Rohde =-=[12]-=-. The type system used in this paper is due to Danvy and Filinski [6]. A similar type system is studied by Ariola, Herbelin, and Sabry [1], which explicitly mentions the type of continuations. 5.12 CO... |

3 | Continuation-Based Partial Evaluation without Continuation
- Thiemann
- 2003
(Show Context)
Citation Context ... continuation-capturing constructs, but with a side-effect that all the residualized abstractions include a toplevel shift, which could be removed by a simple post-processing. More recently, Thiemann =-=[19]-=- showed a sophisticated effect-based type system to show the equivalence of the continuation-based let-insertion and the state-based let-insertion. His type system captures the information on the let-... |

1 |
A Sabry “A Type-Theoretic Foundation of Continuations and
- Ariola, Herbelin
- 2004
(Show Context)
Citation Context ... is extended to the untyped λ-calculus by Filinski and Rohde [12]. The type system used in this paper is due to Danvy and Filinski [6]. A similar type system is studied by Ariola, Herbelin, and Sabry =-=[1]-=-, which explicitly mentions the type of continuations. 5.12 CONCLUSION This paper demonstrated that logical relations can be defined to characterize not only call-by-name higher-order functions but al... |