Results 1 - 10
of
60
Introduction to functional programming
, 1995
"... The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating e ects found in other languages, such as global state, exception handling, output, or non-determinism. Three case studies are looked at in detail: how monads ease the modi cation of ..."
Abstract
-
Cited by 1224 (37 self)
- Add to MetaCart
The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating e ects found in other languages, such as global state, exception handling, output, or non-determinism. Three case studies are looked at in detail: how monads ease the modi cation of a simple evaluator; how monads act as the basis of a datatype of arrays subject to in-place update; and how monads can be used to build parsers.
Reasoning about Programs in Continuation-Passing Style
- Lisp and Symbolic Computation
"... Plotkin's v -calculus for call-by-value programs is weaker than the fij- calculus for the same programs in continuation-passing style (CPS). To identify the callby -value axioms that correspond to fij on CPS terms, we define a new CPS transformation and an inverse mapping, both of which are interes ..."
Abstract
-
Cited by 150 (11 self)
- Add to MetaCart
Plotkin's v -calculus for call-by-value programs is weaker than the fij- calculus for the same programs in continuation-passing style (CPS). To identify the callby -value axioms that correspond to fij on CPS terms, we define a new CPS transformation and an inverse mapping, both of which are interesting in their own right. Using the new CPS transformation, we determine the precise language of CPS terms closed under fij-transformations, as well as the call-by-value axioms that correspond to the so-called administrative fij-reductions on CPS terms. Using the inverse mapping, we map the remaining fi and j equalities on CPS terms to axioms on call-by-value terms. On the pure (constant free) set of-terms, the resulting set of axioms is equivalent to Moggi's computational -calculus. If the call-by-value language includes the control operators abort and call-with-current-continuation, the axioms are equivalent to an extension of Felleisen et al.'s v-C-calculus and to the equational subtheory of Talcott's logic IOCC. Contents 1 Compiling with and without Continuations 4 2 : Calculi and Semantics 7 3 The Origins and Practice of CPS 10 3.1 The Original Encoding : : : : : : : : : : : : : : : : : : : : : 10 3.2 The Universe of CPS Terms : : : : : : : : : : : : : : : : : : 11 4 A Compacting CPS Transformation 13
Representing control: a study of the CPS transformation
, 1992
"... This paper investigates the transformation of v -terms into continuation-passing style (CPS). We show that by appropriate j-expansion of Fischer and Plotkin's two-pass equational specification of the CPS transform, we can obtain a static and context-free separation of the result terms into "esse ..."
Abstract
-
Cited by 69 (6 self)
- Add to MetaCart
This paper investigates the transformation of v -terms into continuation-passing style (CPS). We show that by appropriate j-expansion of Fischer and Plotkin's two-pass equational specification of the CPS transform, we can obtain a static and context-free separation of the result terms into "essential" and "administrative" constructs. Interpreting the former as syntax builders and the latter as directly executable code, we obtain a simple and efficient one-pass transformation algorithm, easily extended to conditional expressions, recursive definitions, and similar constructs. This new transformation algorithm leads to a simpler proof of Plotkin's simulation and indifference results. Further we show how CPS-based control operators similar to but more general than Scheme's call/cc can be naturally accommodated by the new transformation algorithm. To demonstrate the expressive power of these operators, we use them to present an equivalent but even more concise formulation of t...
Explaining Crossover and Superiority as Left-to-Right Evaluation
- LINGUISTICS AND PHILOSOPHY
, 2006
"... We present a general theory of scope and binding in which both crossover and superiority violations are ruled out by one key assumption: that natural language expressions are normally evaluated (processed) from left to right. Our theory is an extension of Shan’s (2002) account of multiple-wh questi ..."
Abstract
-
Cited by 34 (10 self)
- Add to MetaCart
We present a general theory of scope and binding in which both crossover and superiority violations are ruled out by one key assumption: that natural language expressions are normally evaluated (processed) from left to right. Our theory is an extension of Shan’s (2002) account of multiple-wh questions, combining continuations (Barker, 2002) and dynamic type-shifting. Like other continuation-based analyses, but unlike most other treatments of crossover or superiority, our analysis is directly compositional (in the sense of, e.g., Jacobson, 1999). In particular, it does not postulate a level of Logical Form or any other representation distinct from surface syntax. One advantage of using continuations is that they are the standard tool for modeling order-ofevaluation in programming languages. This provides us with a natural and independently motivated characterization of what it means to evaluate expressions from left to right. We give a combinatory categorial grammar that models the syntax and the semantics of quantifier scope and wh-question formation. It allows quantificational binding but not crossover, in-situ wh but not superiority violations. In addition, the analysis automatically accounts for a variety of sentence types involving binding in the presence of pied piping, including reconstruction cases such as Whose criticism of hisi mother did each personi resent?
A Dynamic Extent Control Operator for Partial Continuations
- In Conference Record of the Eighteenth Annual ACM Symposium on Principles of Programming Languages
, 1991
"... : A partial continuation is a prefix of the computation that remains to be done. We propose in this paper a new operator which precisely controls which prefix is to be abstracted into a partial continuation. This operator is strongly related to the notion of dynamic extent which we denotationally ch ..."
Abstract
-
Cited by 30 (6 self)
- Add to MetaCart
: A partial continuation is a prefix of the computation that remains to be done. We propose in this paper a new operator which precisely controls which prefix is to be abstracted into a partial continuation. This operator is strongly related to the notion of dynamic extent which we denotationally characterize. Some programming examples are commented and we also show how to express previously proposed control operators. A suggested implementation is eventually discussed. Keywords: continuation, partial continuation, dynamic and indefinite extent, escape feature. Continuations were introduced within denotational semantics to express the "rest of the computation" in these cases where some constructs of a language can alter it. Non local exits or jumps (stop, goto), exception handling, failure semantics in Prolog-like languages are usually described with continuations [Stoy 77, Schmidt 86]. The Scheme language [Rees & Clinger 86] offers procedural first-class continuations with indefinit...
Secure Information Flow via Linear Continuations
- Higher Order and Symbolic Computation
, 2002
"... Security-typed languages enforce secrecy or integrity policies by type-checking. This paper investigates continuation-passing style (CPS) as a means of proving that such languages enforce noninterference and as a rst step towards understanding their compilation. We present a low-level, secure calcu ..."
Abstract
-
Cited by 30 (6 self)
- Add to MetaCart
Security-typed languages enforce secrecy or integrity policies by type-checking. This paper investigates continuation-passing style (CPS) as a means of proving that such languages enforce noninterference and as a rst step towards understanding their compilation. We present a low-level, secure calculus with higher-order, imperative features and linear continuations.
Monads and Composable Continuations
, 1993
"... . Moggi's use of monads to factor semantics is used to model the composable continuations of Danvy and Filinski. This yields some insights into the type systems proposed by Murthy and by Danvy and Filinski. Interestingly, modelling some aspects of composable continuations requires a structure that i ..."
Abstract
-
Cited by 30 (1 self)
- Add to MetaCart
. Moggi's use of monads to factor semantics is used to model the composable continuations of Danvy and Filinski. This yields some insights into the type systems proposed by Murthy and by Danvy and Filinski. Interestingly, modelling some aspects of composable continuations requires a structure that is almost, but not quite, a monad. 1. Introduction Continuation-passing style was introduced to model one feature of programming languages -- the jump -- and to explicate the execution order of programs [14, 12]. Recently, Moggi has shown how monads, a notion from category theory, generalise the continuation-passing style transformation [9]. Monads can model a wide variety of features, including continuations, state, exceptions, input-output, non-determinism, and parallellism. Monads have also been applied both as a way of structuring functional programs [16, 17] and as a way of introducing new features into functional languages [11]. It begins to seem as if any feature of a programming lang...
Reasoning with Continuations II: Full Abstraction for Models of Control
- In Proceedings of the 1990 ACM Conference on Lisp and Functional Programming
, 1990
"... A fully abstract model of a programming language assigns the same meaning to two terms if and only if they have the same operational behavior. Such models are well-known for functional languages but little is known about extended functional languages with sophisticated control structures. We show th ..."
Abstract
-
Cited by 29 (4 self)
- Add to MetaCart
A fully abstract model of a programming language assigns the same meaning to two terms if and only if they have the same operational behavior. Such models are well-known for functional languages but little is known about extended functional languages with sophisticated control structures. We show that a direct model with error values and the conventional continuation model are adequate for functional languages augmented with first- and higher-order control facilities, respectively. Furthermore, both models become fully abstract on adding a control delimiter and a parallel conditional to the programming languages.
Cogen in Six Lines
- Proc. International Conference on Functional Programming
, 1996
"... We have designed and implemented a program-generator generator (PGG) for an untyped higher-order functional programming language. The program generators perform continuation-based multi-level offline specialization and thus combine the most powerful and general offline partial evaluation techniques. ..."
Abstract
-
Cited by 27 (10 self)
- Add to MetaCart
We have designed and implemented a program-generator generator (PGG) for an untyped higher-order functional programming language. The program generators perform continuation-based multi-level offline specialization and thus combine the most powerful and general offline partial evaluation techniques. The correctness of the PGG is ensured by deriving it from a multi-level specializer. Our PGG is extremely simple to implement due to the use of multi-level techniques and higher-order abstract syntax. Keywords: partial evaluation, multi-level computation, continuations. 1 Introduction An attractive feature of partial evaluation is the ability to generate generating extensions. A generating extension for a program p with two inputs inp s and inp d is a program p-gen which accepts the static input inp s of p and produces a residual program p s which accepts the dynamic input inp d and produces the same result as JpK inp s inp d , provided both p and p s terminate. Jp-genK inp ...
Minimal Classical Logic and Control Operators
- In ICALP: Annual International Colloquium on Automata, Languages and Programming, volume 2719 of LNCS
, 2003
"... We give an analysis of various classical axioms and characterize a notion of minimal classical logic that enforces Peirce's law without enforcing Ex Falso Quodlibet. We show that a \natural" implementation of this logic is Parigot's classical natural deduction. ..."
Abstract
-
Cited by 25 (4 self)
- Add to MetaCart
We give an analysis of various classical axioms and characterize a notion of minimal classical logic that enforces Peirce's law without enforcing Ex Falso Quodlibet. We show that a \natural" implementation of this logic is Parigot's classical natural deduction.

