Results 1 - 10
of
14
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 34 (14 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.
From reduction-based to reduction-free normalization
- Proceedings of the Fourth International Workshop on Reduction Strategies in Rewriting and Programming (WRS'04
, 2004
"... We document an operational method to construct reduction-free normal-ization functions. Starting from a reduction-based normalization function from a reduction semantics, i.e., the iteration of a one-step reduction func-tion, we successively subject it to refocusing (i.e., deforestation of the in-te ..."
Abstract
-
Cited by 29 (13 self)
- Add to MetaCart
(Show Context)
We document an operational method to construct reduction-free normal-ization functions. Starting from a reduction-based normalization function from a reduction semantics, i.e., the iteration of a one-step reduction func-tion, we successively subject it to refocusing (i.e., deforestation of the in-termediate successive terms in the reduction sequence), equational simpli-cation, refunctionalization (i.e., the converse of defunctionalization), and direct-style transformation (i.e., the converse of the CPS transformation), ending with a reduction-free normalization function of the kind usually crafted by hand. We treat in detail four simple examples: calculating arithmetic ex-pressions, recognizing Dyck words, normalizing lambda-terms with explicit substitutions and call/cc, and attening binary trees. The overall method builds on previous work by the author and his stu-dents on a syntactic correspondence between reduction semantics and ab-stract machines and on a functional correspondence between evaluators and abstract machines. The measure of success of these two correspondences is that each of the inter-derived semantic artifacts (i.e., man-made constructs) could plausibly have been written by hand, as is the actual case for several ones derived here.
Shift to control
- In ACM SIGPLAN Scheme Workshop, Snowbird
, 2004
"... Delimited control operators abound, but their relationships are ill-understood, and it remains unclear which (if any) to consider canon-ical. Although all delimited control operators ever proposed can be implemented using undelimited continuations and mutable state, Gasbichler and Sperber [28] showe ..."
Abstract
-
Cited by 25 (3 self)
- Add to MetaCart
(Show Context)
Delimited control operators abound, but their relationships are ill-understood, and it remains unclear which (if any) to consider canon-ical. Although all delimited control operators ever proposed can be implemented using undelimited continuations and mutable state, Gasbichler and Sperber [28] showed that an implementation that does not rely on undelimited continuations can be much more ef-ficient. Unfortunately, they only implemented Felleisen’s control
An operational foundation for delimited continuations in the CPS hierarchy
- Logical Methods in Computer Science
, 2005
"... Vol. 1 (2:5) 2005, pp. 1–39 www.lmcs-online.org ..."
(Show Context)
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 9 (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
A static simulation of dynamic delimited control
- HIGHER-ORDER AND SYMBOLIC COMPUTATION
"... We present a continuation-passing-style (CPS) transformation for some dynamic delimited-control operators, including Felleisen’s control and prompt, that extends a standard call-by-value CPS transformation. Based on this new transformation, we show how Danvy and Filinski’s static delimited-control ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
We present a continuation-passing-style (CPS) transformation for some dynamic delimited-control operators, including Felleisen’s control and prompt, that extends a standard call-by-value CPS transformation. Based on this new transformation, we show how Danvy and Filinski’s static delimited-control operators shift and reset simulate dynamic operators, allaying in passing some skepticism in the literature about the existence of such a simulation. The new CPS transformation and simulation use recursive delimited continuations to avoid undelimited control and the overhead it incurs in implementation and reasoning.
A Substructural Type System for Delimited Continuations
"... 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 sem ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
(Show Context)
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.
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
-
Cited by 2 (0 self)
- Add to MetaCart
(Show Context)
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.
Abstract Oleg Kiselyov
"... 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
- Add to MetaCart
(Show Context)
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.