Logical relations for call-by-value delimited continuations
نویسنده
چکیده
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.
منابع مشابه
From shift and reset to polarized linear logic
Griffin [22] pointed out that, just as the pure λ-calculus corresponds to intuitionistic logic, a λ-calculus with firstclass continuations corresponds to classical logic. We study how first-class delimited continuations [13], in the form of Danvy and Filinski’s shift and reset operators [10, 11], can also be logically interpreted. First, we refine Danvy and Filinski’s type system for shift and ...
متن کاملLogical Relations for Coherence of Effect Subtyping
A coercion semantics of a programming language with subtyping is typically defined on typing derivations rather than on typing judgments. To avoid semantic ambiguity, such a semantics is expected to be coherent, i.e., independent of the typing derivation for a given typing judgment. In this article we present heterogeneous, biorthogonal, step-indexed logical relations for establishing the coher...
متن کاملTypes for Delimited Control Operators
There are a great variety of control constructs in programming languages: conditionals, goto, coroutines, threads, processes, break, return, and, of course, continuations. The advantage of continuations over the others is that many of the other control constructs are expressible in terms of them. Unfortunately, the global continuations operators (e.g., call/cc) that are implemented in languages...
متن کاملCapturing the Future by Replaying the Past
Delimited continuations are the mother of all monads! So goes the slogan inspired by Filinski’s 1994 paper, which showed that delimited continuations can implement any monadic e ect, letting the programmer use an e ect as easily as if it was built into the language. It’s a shame that not many languages have delimited continuations. Luckily, exceptions and state are also the mother of all monads...
متن کاملPolarity Sensitivity and Evaluation Order in Type-Logical Grammar
We present a novel, type-logical analysis of polarity sensitivity: how negative polarity items (like any and ever) or positive ones (like some) are licensed or prohibited. It takes not just scopal relations but also linear order into account, using the programming-language notions of delimited continuations and evaluation order, respectively. It thus achieves greater empirical coverage than pre...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2005