Results 1  10
of
18
Improvement in a Lazy Context: An Operational Theory for CallByNeed
 Proc. POPL'99, ACM
, 1999
"... Machine The semantics presented in this section is essentially Sestoft's \mark 1" abstract machine for laziness [Sestoft 1997]. In that paper, he proves his abstract machine 6 A. K. Moran and D. Sands h fx = Mg; x; S i ! h ; M; #x : S i (Lookup) h ; V; #x : S i ! h fx = V g; V; S i (Update) h ; ..."
Abstract

Cited by 38 (7 self)
 Add to MetaCart
Machine The semantics presented in this section is essentially Sestoft's \mark 1" abstract machine for laziness [Sestoft 1997]. In that paper, he proves his abstract machine 6 A. K. Moran and D. Sands h fx = Mg; x; S i ! h ; M; #x : S i (Lookup) h ; V; #x : S i ! h fx = V g; V; S i (Update) h ; M x; S i ! h ; M; x : S i (Unwind) h ; x:M; y : S i ! h ; M [ y = x ]; S i (Subst) h ; case M of alts ; S i ! h ; M; alts : S i (Case) h ; c j ~y; fc i ~x i N i g : S i ! h ; N j [ ~y = ~x j ]; S i (Branch) h ; let f~x = ~ Mg in N; S i ! h f~x = ~ Mg; N; S i ~x dom(;S) (Letrec) Fig. 1. The abstract machine semantics for callbyneed. semantics sound and complete with respect to Launchbury's natural semantics, and we will not repeat those proofs here. Transitions are over congurations consisting of a heap, containing bindings, the expression currently being evaluated, and a stack. The heap is a partial function from variables to terms, and denoted in an identical manner to a coll...
Representations of stream processors using nested fixed points
 Logical Methods in Computer Science
"... Abstract. We define representations of continuous functions on infinite streams of discrete values, both in the case of discretevalued functions, and in the case of streamvalued functions. We define also an operation on the representations of two continuous functions between streams that yields a ..."
Abstract

Cited by 15 (2 self)
 Add to MetaCart
Abstract. We define representations of continuous functions on infinite streams of discrete values, both in the case of discretevalued functions, and in the case of streamvalued functions. We define also an operation on the representations of two continuous functions between streams that yields a representation of their composite. In the case of discretevalued functions, the representatives are wellfounded (finitepath) trees of a certain kind. The underlying idea can be traced back to Brouwer’s justification of barinduction, or to Kreisel and Troelstra’s elimination of choicesequences. In the case of streamvalued functions, the representatives are nonwellfounded trees pieced together in a coinductive fashion from wellfounded trees. The definition requires an alternating fixpoint construction of some ubiquity.
Imprecise Exceptions, CoInductively
"... In a recent paper, Peyton Jones et al. proposed a design for imprecise exceptions in the lazy functional programming language Haskell [PJRH + 99]. The main contribution of the design was that it allowed the language to continue to enjoy its current rich algebra of transformations. However, the den ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
In a recent paper, Peyton Jones et al. proposed a design for imprecise exceptions in the lazy functional programming language Haskell [PJRH + 99]. The main contribution of the design was that it allowed the language to continue to enjoy its current rich algebra of transformations. However, the denotational semantics used to formalise the design does not combine easily with other extensions, most notably that of concurrency. We present an alternative semantics for a lazy functional language with imprecise exceptions which is entirely operational in nature, and combines well with other extensions, such as I/O and concurrency. The semantics is based upon a convergence relation, which describes evaluation, and an exceptional convergence relation, which describes the raising of exceptions. Convergence and exceptional convergence lead naturally to a simple notion of renement, where a term M is re ned by N whenever they have identical convergent behaviour, and any exception raised by N c...
On the Safety of Nöcker’s Strictness Analysis
 FRANKFURT AM MAIN, GERMANY
"... Abstract. This paper proves correctness of Nöcker’s method of strictness analysis, implemented for Clean, which is an effective way for strictness analysis in lazy functional languages based on their operational semantics. We improve upon the work of Clark, Hankin and Hunt, which addresses correctne ..."
Abstract

Cited by 8 (7 self)
 Add to MetaCart
Abstract. This paper proves correctness of Nöcker’s method of strictness analysis, implemented for Clean, which is an effective way for strictness analysis in lazy functional languages based on their operational semantics. We improve upon the work of Clark, Hankin and Hunt, which addresses correctness of the abstract reduction rules. Our method also addresses the cycle detection rules, which are the main strength of Nöcker’s strictness analysis. We reformulate Nöcker’s strictness analysis algorithm in a higherorder lambdacalculus with case, constructors, letrec, and a nondeterministic choice operator ⊕ used as a union operator. Furthermore, the calculus is expressive enough to represent abstract constants like Top or Inf. The operational semantics is a smallstep semantics and equality of expressions is defined by a contextual semantics that observes termination of expressions. The correctness of several reductions is proved using a context lemma and complete sets of forking and commuting diagrams.
FUNDIO: A LambdaCalculus with a letrec, case, Constructors, and an IOInterface: Approaching a Theory of unsafePerformIO
, 2003
"... This paper proposes a nonstandard way to combine lazy functional languages with I/O. In order to demonstrate the usefulness of the approach, a tiny lazy functional core language “FUNDIO”, which is also a callbyneed lambda calculus, is investigated. The syntax of “FUNDIO ” has case, letrec, constr ..."
Abstract

Cited by 7 (0 self)
 Add to MetaCart
This paper proposes a nonstandard way to combine lazy functional languages with I/O. In order to demonstrate the usefulness of the approach, a tiny lazy functional core language “FUNDIO”, which is also a callbyneed lambda calculus, is investigated. The syntax of “FUNDIO ” has case, letrec, constructors and an IOinterface: its operational semantics is described by smallstep reductions. A contextual approximation and equivalence depending on the inputoutput behavior of normal order reduction sequences is defined and a context lemma is proved. This enables to study a semantics of “FUNDIO ” and its semantic properties. The paper demonstrates that the technique of complete reduction diagrams enables to show a considerable set of program transformations to be correct. Several optimizations of evaluation are given, including strictness optimizations and an abstract machine, and shown to be correct w.r.t. contextual equivalence. Correctness of strictness optimizations also justifies correctness of parallel evaluation.
Thus this calculus has a potential to integrate nonstrict functional programming with a nondeterministic approach to inputoutput and also to provide a useful semantics for this combination.
It is argued that monadic IO and unsafePerformIO can be combined in Haskell, and that the result is reliable, if all reductions and transformations are correct w.r.t. to the FUNDIOsemantics. Of course, we do not address the typing problems the are involved in the usage of Haskell’s
unsafePerformIO.
The semantics can also be used as a novel semantics for strict functional languages with IO, where the sequence of IOs is not fixed.
Unique Fixed Point Induction for McCarthy's Amb
 IN: PROCEEDINGS OF THE 24TH INTERNATIONAL SYMPOSIUM ON MATHEMATICAL FOUNDATIONS OF COMPUTER SCIENCE, ”LNCS” 1672
, 1999
"... We develop an operational theory of higherorder functions, recursion, and fair nondeterminism for a nontrivial, higherorder, callbyname functional programming language extended with McCarthy's amb. Implemented via fair parallel evaluation, functional programming with amb is very expressive. ..."
Abstract

Cited by 7 (2 self)
 Add to MetaCart
We develop an operational theory of higherorder functions, recursion, and fair nondeterminism for a nontrivial, higherorder, callbyname functional programming language extended with McCarthy's amb. Implemented via fair parallel evaluation, functional programming with amb is very expressive. However, conventional semantic fixed point principles for reasoning about recursion fail in the presence of fairness. Instead, we adapt higherorder operational methods to deal with fair nondeterminism. We present two natural semantics, describing mayand mustconvergence, and define a notion of contextual equivalence over these two modalities. The presence of amb raises special difficulties when reasoning about contextual equivalence. In particular, we report on a challenging open problem with regard to the validity of bisimulation proof methods. We develop two sound and useful reasoning methods which, in combination, enable us to prove a rich collection of laws for contextual...
On generic context lemmas for lambda calculi with sharing
, 2008
"... This paper proves several generic variants of context lemmas and thus contributes to improving the tools for observational semantics of deterministic and nondeterministic higherorder calculi that use a smallstep reduction semantics. The generic (sharing) context lemmas are provided for may as we ..."
Abstract

Cited by 5 (3 self)
 Add to MetaCart
This paper proves several generic variants of context lemmas and thus contributes to improving the tools for observational semantics of deterministic and nondeterministic higherorder calculi that use a smallstep reduction semantics. The generic (sharing) context lemmas are provided for may as well as two variants of mustconvergence, which hold in a broad class of extended process and extended lambda calculi, if the calculi satisfy certain natural conditions. As a guideline, the proofs of the context lemmas are valid in callbyneed calculi, in callbyvalue calculi if substitution is restricted to variablebyvariable and in process calculi like variants of the πcalculus. For calculi employing betareduction using a callbyname or callbyvalue strategy or similar reduction rules, some iuvariants of ciutheorems are obtained from our context lemmas. Our results reestablish several context lemmas already proved in the literature, and also provide some new context lemmas as well as some new variants of the ciutheorem. To make the results widely applicable, we use a higherorder abstract syntax that allows untyped calculi as well as certain simple typing schemes. The approach may lead to a unifying view of higherorder calculi, reduction, and observational equality.
Correctness of Copy in Calculi with Letrec,
, 2007
"... Abstract. This paper extends the internal frank report 28 as follows: It is shown that for a callbyneed lambda calculus LRCCPλ extending the calculus LRCCλ by por, i.e in a lambdacalculus with letrec, case, constructors, seq and por, copying can be done without restrictions, and also that callby ..."
Abstract

Cited by 5 (3 self)
 Add to MetaCart
Abstract. This paper extends the internal frank report 28 as follows: It is shown that for a callbyneed lambda calculus LRCCPλ extending the calculus LRCCλ by por, i.e in a lambdacalculus with letrec, case, constructors, seq and por, copying can be done without restrictions, and also that callbyneed and callbyname strategies are equivalent w.r.t. contextual equivalence. 1
Equivalence of callbyname and callbyneed for lambdacalculi with letrec. Frank report 25
 Inst. f. Informatik
, 2006
"... Abstract. We develop a proof method to show that in a (deterministic) lambda calculus with letrec and equipped with contextual equivalence the callbyname and the callbyneed evaluation are equivalent, and also that the unrestricted copyoperation is correct. Given a letbinding x = t, the copyop ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
Abstract. We develop a proof method to show that in a (deterministic) lambda calculus with letrec and equipped with contextual equivalence the callbyname and the callbyneed evaluation are equivalent, and also that the unrestricted copyoperation is correct. Given a letbinding x = t, the copyoperation replaces an occurrence of the variable x by the expression t, regardless of the form of t. This gives an answer to unresolved problems in several papers, it adds a strong method to the tool set for reasoning about contextual equivalence in higherorder calculi with letrec, and it enables a class of transformations that can be used as optimizations. The method can be used in different kind of lambda calculi with cyclic sharing. Probably it can also be used in nondeterministic lambda calculi if the variable x is “deterministic”, i.e., has no interference with nondeterministic executions. The main technical idea is to use a restricted variant of the infinitary lambdacalculus, whose objects are the expressions that are unrolled w.r.t. let, to define the infinite developments as a reduction calculus on the infinite trees and showing a standardization theorem. 1
Correctness of copy in calculi with letrec, case and constructors
, 2007
"... Callbyneed lambda calculi with letrec provide a rewritingbased operational semantics for (lazy) callbyname functional languages. These calculi model the sharing behavior during evaluation more closely than letbased calculi that use a fixpoint combinator. In a previous paper we showed that the ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Callbyneed lambda calculi with letrec provide a rewritingbased operational semantics for (lazy) callbyname functional languages. These calculi model the sharing behavior during evaluation more closely than letbased calculi that use a fixpoint combinator. In a previous paper we showed that the copytransformation is correct for the small calculus LRλ. In this paper we demonstrate that the proof method based on a calculus on infinite trees for showing correctness of instantiation operations can be extended to the calculus LRCCλ with case and constructors, and show that copying at compiletime can be done without restrictions. We also show that the callbyneed and callbyname strategies are equivalent w.r.t. contextual equivalence. A consequence is correctness of all the transformations like instantiation, inlining, specialization and common subexpression elimination in LRCCλ. We are confident that the method scales up for proving correctness of copyrelated transformations in nondeterministic lambda calculi if restricted to “deterministic” subterms.