Results 1 - 10
of
11
A rational deconstruction of Landin’s SECD machine
- Implementation and Application of Functional Languages, 16th International Workshop, IFL’04, number 3474 in Lecture Notes in Computer Science
, 2004
"... Abstract. Landin’s SECD machine was the first abstract machine for applicative expressions, i.e., functional programs. Landin’s J operator was the first control operator for functional languages, and was specified by an extension of the SECD machine. We present a family of evaluation functions corre ..."
Abstract
-
Cited by 23 (16 self)
- Add to MetaCart
Abstract. Landin’s SECD machine was the first abstract machine for applicative expressions, i.e., functional programs. Landin’s J operator was the first control operator for functional languages, and was specified by an extension of the SECD machine. We present a family of evaluation functions corresponding to this extension of the SECD machine, using a series of elementary transformations (transformation into continuation-passing style (CPS) and defunctionalization, chiefly) and their left inverses (transformation into direct style and refunctionalization). To this end, we modernize the SECD machine into a bisimilar one that operates in lockstep with the original one but that (1) does not use a data stack and (2) uses the caller-save rather than the callee-save convention for environments. We also identify that the dump component of the SECD machine is managed in a callee-save way. The caller-save counterpart of the modernized SECD machine precisely corresponds to Thielecke’s doublebarrelled continuations and to Felleisen’s encoding of J in terms of call/cc. We then variously characterize the J operator in terms of CPS and in terms of delimited-control operators in the CPS hierarchy. As a byproduct, we also present several reduction semantics for applicative expressions
A type-theoretic foundation of delimited continuations. Higher Order Symbol
- Comput
, 2009
"... Abstract. There is a correspondence between classical logic and programming language calculi with first-class continuations. With the addition of control delimiters, the continuations become composable and the calculi become more expressive. We present a fine-grained analysis of control delimiters a ..."
Abstract
-
Cited by 8 (1 self)
- Add to MetaCart
Abstract. There is a correspondence between classical logic and programming language calculi with first-class continuations. With the addition of control delimiters, the continuations become composable and the calculi become more expressive. We present a fine-grained analysis of control delimiters and formalise that their addition corresponds to the addition of a single dynamically-scoped variable modelling the special top-level continuation. From a type perspective, the dynamically-scoped variable requires effect annotations. In the presence of control, the dynamically-scoped variable can be interpreted in a purely functional way by applying a store-passing style. At the type level, the effect annotations are mapped within standard classical logic extended with the dual of implication, namely subtraction. A continuation-passing-style transformation of lambda-calculus with control and subtraction is defined. Combining the translations provides a decomposition of standard CPS transformations for delimited continuations. Incidentally, we also give a direct normalisation proof of the simply-typed lambda-calculus with control and subtraction.
Answer type polymorphism in call-by-name continuation passing
- In Proc. European Symposium on Programming, Springer Lecture Notes in Comput. Sci
, 2004
"... Abstract. This paper studies continuations by means of a polymorphic type system. The traditional call-by-name continuation passing style transform admits a typing in which some answer types are polymorphic, even in the presence of first-class control operators. By building on this polymorphic typin ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
Abstract. This paper studies continuations by means of a polymorphic type system. The traditional call-by-name continuation passing style transform admits a typing in which some answer types are polymorphic, even in the presence of first-class control operators. By building on this polymorphic typing, and using parametricity reasoning, we show that the call-by-name transform satisfies the eta-law, and is in fact isomorphic to the more recent CPS transform defined by Streicher. 1
Combining algebraic effects with continuations
, 2007
"... We consider the natural combinations of algebraic computational effects such as side-effects, exceptions, interactive input/output, and nondeterminism with continuations. Continuations are not an algebraic effect, but previously developed combinations of algebraic effects given by sum and tensor ext ..."
Abstract
-
Cited by 6 (3 self)
- Add to MetaCart
We consider the natural combinations of algebraic computational effects such as side-effects, exceptions, interactive input/output, and nondeterminism with continuations. Continuations are not an algebraic effect, but previously developed combinations of algebraic effects given by sum and tensor extend, with effort, to include commonly used combinations of the various algebraic effects with continuations. Continuations also give rise to a third sort of combination, that given by applying the continuations monad transformer to an algebraic effect. We investigate the extent to which sum and tensor extend from algebraic effects to arbitrary monads, and the extent to which Felleisen et al.’s C operator extends from continuations to its combination with algebraic effects. To do all this, we use Dubuc’s characterisation of strong monads in terms of enriched large Lawvere theories.
Linear Continuation-Passing
- in the 2001 ACM SIGPLAN Workshop on Continuations (CW'01
, 2002
"... Continuations can be used to explain a wide variety of control behaviours, including calling/returning (procedures), raising/handling (exceptions), labelled jumping (goto statements), process switching (coroutines), and backtracking. However, continuations are often manipulated in a highly stylised ..."
Abstract
-
Cited by 3 (1 self)
- Add to MetaCart
Continuations can be used to explain a wide variety of control behaviours, including calling/returning (procedures), raising/handling (exceptions), labelled jumping (goto statements), process switching (coroutines), and backtracking. However, continuations are often manipulated in a highly stylised way, and we show that all of these, bar backtracking, in fact use their continuations linearly ; this is formalised by taking a target language for cps transforms that has both intuitionistic and linear function types.
Combining Continuations with Other Effects
- University of Birmingham
, 2004
"... A fundamental question, in modelling computational effects, is how to give a unified semantic account of modularity, i.e., a mathematical theory that supports the various combinations one naturally makes of computational effects such as exceptions, side-effects, interactive input/output, nondetermin ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
A fundamental question, in modelling computational effects, is how to give a unified semantic account of modularity, i.e., a mathematical theory that supports the various combinations one naturally makes of computational effects such as exceptions, side-effects, interactive input/output, nondeterminism, and, particularly
A System F with call-by-name exceptions
"... Abstract. We present an extension of System F with call-by-name exceptions. The type system is enriched with two syntactic constructs: a union type A ⋆ ∪ {ε} for programs of type A whose execution may raise the exception ε at top level, and a corruption type A {ε} for programs that may raise the exc ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Abstract. We present an extension of System F with call-by-name exceptions. The type system is enriched with two syntactic constructs: a union type A ⋆ ∪ {ε} for programs of type A whose execution may raise the exception ε at top level, and a corruption type A {ε} for programs that may raise the exception ε in any evaluation context (not necessarily at top level). We present the syntax and reduction rules of the system, as well as its typing and subtyping rules. We then study its properties, such as confluence. Finally, we construct a realizability model using orthogonality techniques, from which we deduce that well-typed programs are weakly normalizing and that the ones who have the type of natural numbers really compute a natural number, without raising exceptions. 1
Combining Continuations with Other Effects
"... A fundamental question, in modelling computational effects, is how to give a unified semantic account of modularity, i.e., a mathematical theory that supports the various combinations one naturally makes of computational effects such as exceptions, side-effects, interactive input/output, nondetermin ..."
Abstract
- Add to MetaCart
A fundamental question, in modelling computational effects, is how to give a unified semantic account of modularity, i.e., a mathematical theory that supports the various combinations one naturally makes of computational effects such as exceptions, side-effects, interactive input/output, nondeterminism, and, particularly for this workshop, continuations [2, 3, 5]. We have begun to give such an account over recent years for all of these effects other than continuations [8], describing the sum and the tensor, or commutative combination, of effects, starting from Eugenio Moggi's proposal to use monads to give semantics for each individual effect [15]. That has yielded the most commonly used combinations of the various effects. Here, we extend our account to include continuations. We consider three distinct ways in which continuations combine with the other effects: sum, tensor, and by applying the continuations monad transformer C(-); we analyse each of these in the following three Detections. We did not...

