Results 1 -
5 of
5
Thunks and the λ-calculus
- IN THE JOURNAL OF FUNCTIONAL PROGRAMMING. RS-97-6 OLIVIER DANVY AND ULRIK
, 1997
"... Plotkin, in his seminal article Call-by-name, call-by-value and the λ-calculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how call-by-name evaluation could be simulated under call-by-value evaluation and vice versa. Si ..."
Abstract
-
Cited by 21 (9 self)
- Add to MetaCart
Plotkin, in his seminal article Call-by-name, call-by-value and the λ-calculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how call-by-name evaluation could be simulated under call-by-value evaluation and vice versa. Since Algol 60, however, call-by-name is both implemented and simulated with thunks rather than with continuations. We recast
Isolating Side Effects in Sequential Languages
- In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’95
, 1995
"... It is well known that adding side effects to functional languages changes the operational equivalences of the language. We develop a new language construct, encap, that forces imperative pieces of code to behave purely functionally, i.e., without any visible side effects. The coercion operator enca ..."
Abstract
-
Cited by 17 (2 self)
- Add to MetaCart
It is well known that adding side effects to functional languages changes the operational equivalences of the language. We develop a new language construct, encap, that forces imperative pieces of code to behave purely functionally, i.e., without any visible side effects. The coercion operator encap provides a means of extending the simple reasoning principles for equivalences of code in a functional language to a language with side effects. In earlier work [36], similar coercion operators were developed, but their correctness required the underlying functional language to include parallel operations. The coercion operators developed here are simpler and are proven correct for purely sequential languages. The sequential setting requires the construction of fully abstract models for sequential call-by-value languages and the formulation of a weak form of "monad" suitable for expressing the semantics of call-by-value languages with side effects. 1 Introduction Two pieces of code are...
Exceptions, Continuations and Macro-Expressiveness
- LNCS 2305
, 2002
"... This paper studies the dierences between exceptions and continuations via the problem of expressing exceptions using rst-class continuations in a functional-imperative language. The main result is that exceptions cannot be macro-expressed using rst-class continuations and references (contrary to ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
This paper studies the dierences between exceptions and continuations via the problem of expressing exceptions using rst-class continuations in a functional-imperative language. The main result is that exceptions cannot be macro-expressed using rst-class continuations and references (contrary to \folklore"). This is shown using two kinds of counterexample. The rst consists of two terms which are equivalent with respect to contexts containing continuations and references, but which can be distinguished using exceptions. It is shown, however, that there are no such terms which do not contain callcc. However, there is a 1 sentence of rst-order logic which is satised when interpreted in the domain of programs containing continuations and references but not satised in the domain of programs with exceptions and references.
The elimination of nesting in SPCF
- In Proceedings of TLCA ’05, number 3461 in LNCS
, 2005
"... Abstract. We use a fully abstract denotational model to show that nested function calls and recursive definitions can be eliminated from SPCF (a typed functional language with simple non-local control operators) without losing expressiveness. We describe — via simple typing rules — an affine fragmen ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
Abstract. We use a fully abstract denotational model to show that nested function calls and recursive definitions can be eliminated from SPCF (a typed functional language with simple non-local control operators) without losing expressiveness. We describe — via simple typing rules — an affine fragment of SPCF in which function nesting and recursion (other than iteration) are not permitted. We prove that this affine fragment is fully expressive in the sense that every term of SPCF is observationally equivalent to an affine term. Our proof is based on the observation of Longley — already used to prove universality and full abstraction results for models of SPCF — that every type of SPCF is a retract of a first-order type. We describe retractions of this kind which are definable in the affine fragment. This allows us to transform an arbitrary SPCF term into an affine one by mapping it to a first-order term, obtaining an (affine) normal form, and then projecting back to the original type. In the case of finitary SPCF, the retraction is based on a simple induction, which yields bounds for the size of the resulting term. In the infinitary case, it is based on an analysis of the relationship between SPCF definable functions and strategies for computing them sequentially. 1
Algebraic Reasoning and Completeness in Typed Languages
- In Proc. 20th ACM Symposium on Principles of Programming Languages
, 1992
"... : We consider the following problem in proving observational congruences in functional languages: given a call-by-name language based on the simplytyped -calculus with algebraic operations axiomatized by algebraic equations E, is the set of observational congruences between terms exactly those prov ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
: We consider the following problem in proving observational congruences in functional languages: given a call-by-name language based on the simplytyped -calculus with algebraic operations axiomatized by algebraic equations E, is the set of observational congruences between terms exactly those provable from (fi), (j), and E? We find conditions for determining whether fijE-equational reasoning is complete for proving the observational congruences between such terms. We demonstrate the power and generality of the theorems by presenting a number of easy corollaries for particular algebras. 1 Introduction The (fi) and (j) axioms form the basis for proving equations in call-by-name functional languages. In these languages, (fi) and (j) yield sound program optimizations. For example, consider a version of the call-by-name language PCF [11, 15] which is described in Appendix A. Our version of PCF includes simplytyped -calculus, numerals 0; 1; 2; : : :, successor and predecessor, addition, ...

