Results 1 -
9 of
9
Delimited Dynamic Binding
, 2006
"... Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is ill-defined yet not expressive enough for these uses. We solve this ..."
Abstract
-
Cited by 23 (8 self)
- Add to MetaCart
Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is ill-defined yet not expressive enough for these uses. We solve this open and subtle problem. We formalise a typed language DB+DC that combines a calculus DB of dynamic binding and a calculus DC of delimited control. We argue from theoretical and practical points of view that its semantics should be based on delimited dynamic binding: capturing a delimited continuation closes over part of the dynamic environment, rather than all or none of it; reinstating the captured continuation supplements the dynamic environment, rather than replacing or inheriting it. We introduce a type- and reduction-preserving translation from DB + DC to DC, which proves that delimited control macro-expresses dynamic binding. We use this translation to implement DB + DC in Scheme, OCaml, and Haskell. We extend DB + DC with mutable dynamic variables and a facility to obtain not only the latest binding of a dynamic variable but also older bindings. This facility provides for stack inspection and (more generally) folding over the execution context as an inductive data structure.
An operational foundation for delimited continuations in the CPS hierarchy
- Department of Computer Science, University of Aarhus
, 2005
"... Vol. 1 (2:5) 2005, pp. 1–39 ..."
From Reduction-Based to Reduction-Free Normalization
, 2004
"... We present a systematic construction of a reduction-free normalization function. Starting from ..."
Abstract
-
Cited by 10 (7 self)
- Add to MetaCart
We present a systematic construction of a reduction-free normalization function. Starting from
A Substructural Type System for Delimited Continuations ⋆
"... Abstract. We propose type systems that abstractly interpret small-step rather than big-step operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the opera ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Abstract. We propose type systems that abstractly interpret small-step rather than big-step operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the operational semantics, but also expressed by structural rules in the type system, so the types track control flow more closely. Binding and evaluation contexts are related, but the latter are linear. We use these ideas to build a type system for delimited continuations. It lets control operators change the answer type or act beyond the nearest dynamically-enclosing delimiter, yet needs no extra fields in judgments and arrow types to record answer types. The typing derivation of a directstyle program desugars it into continuation-passing style. 1
Graph-Based Proof Counting and Enumeration with Applications for Program Fragment Synthesis
- in "International Symposium on Logic-based Program Synthesis and Transformation 2004 (LOPSTR 2004)", S. ETALLE (editor)., Lecture Notes in Computer Science
, 2004
"... Abstract. For use in earlier approaches to automated module interface adaptation, we seek a restricted form of program synthesis. Given some typing assumptions and a desired result type, we wish to automatically build a number of program fragments of this chosen typing, using functions and values av ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Abstract. For use in earlier approaches to automated module interface adaptation, we seek a restricted form of program synthesis. Given some typing assumptions and a desired result type, we wish to automatically build a number of program fragments of this chosen typing, using functions and values available in the given typing environment. We call this problem term enumeration. To solve the problem, we use the Curry-Howard correspondence (propositions-as-types, proofs-as-programs) to transform it into a proof enumeration problem for an intuitionistic logic calculus. We formally study proof enumeration and counting in this calculus. We prove that proof counting is solvable and give an algorithm to solve it. This in turn yields a proof enumeration algorithm. 1
Keeping sums under control
, 2004
"... In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the λ-calculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. ..."
Abstract
- Add to MetaCart
In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the λ-calculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. The main characteristic of this tool is that it produces a result in a canonical form we introduced. That is to say: two βη-equivalent terms will be normalised into (almost) identical terms. It was not the case with the traditional algorithm, which could even lead to an explosion of the size of code. This canonical form is an η-long β-normal form with constraints, which capture the definition of η-long normal form for the λ-calculus without sums, and reduces drastically the η-conversion possibilities for sums. The present paper recall the definition of these normal forms and the normalisation algorithm, and shows how it is possible to use these tools to solve a problem of characterization of type isomorphisms. Indeed, the canonical form allowed to find the complicated counterexamples we exhibited in another work [6], that proves that type isomorphisms in the λ-calculus with sums are not finitely axiomatisable. What’s more, when proving that these terms are isomorphisms, the new partial evaluation algorithm avoids an explosion of the size of the term that arises with the old one.
Exceptional NbE for Sums
"... We devise an algorithm using normalization by evaluation (NbE) for deciding equality between terms in a λ-calculus equipped with strong sums. While proofs of correctness and completeness are still work in progress, the originality of this algorithm is its use of exceptions, which yields a particular ..."
Abstract
- Add to MetaCart
We devise an algorithm using normalization by evaluation (NbE) for deciding equality between terms in a λ-calculus equipped with strong sums. While proofs of correctness and completeness are still work in progress, the originality of this algorithm is its use of exceptions, which yields a particularly simple solution to this intricate problem. 1.
Computational Effects across Generated Binders Maintaining future-stage lexical scope
"... Code generation is the leading approach to making high-performance software reusable. Effects are indispensable in code generators, whether to report failures or to insert let-statements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in und ..."
Abstract
- Add to MetaCart
Code generation is the leading approach to making high-performance software reusable. Effects are indispensable in code generators, whether to report failures or to insert let-statements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in undesirable ways to produce unexpectedly unbound variables, or worse, unexpectedly bound ones. These subtleties prevent experts in the application domain, not in programming languages, from using and extending the generator. A pressing problem is thus to express the desired effects while regulating them so that the generated code is correct, or at least correctly scoped, by construction. In an imminently practical code-generation framework, we show how to express arbitrary effects, including mutable references and delimited control, that move open code across generated binders. The static types of our generator expressions not only ensure that a well-typed generator produces well-typed and well-scoped code, but also express the lexical scopes of generated binders and prevent mixing up variables with different scopes. This precise notion of lexical scope subsumes the complaints about intuitively wrong example generators in the literature. For the first time, we demonstrate statically safe let-insertion across an arbitrary number of binders. Our framework is implemented as a Haskell library that embeds an extensible typed higher-order domain-specific language. It may be regarded as ‘staged Haskell. ’ The library is convenient to use thanks to the maturity of Haskell, higher-order abstract syntax, and polymorphism over generated type environments.

