Results 1 
8 of
8
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...
A callbyneed lambdacalculus with locally bottomavoiding choice: Context lemma and correctness of transformations
 MATHEMATICAL STRUCTURES IN COMPUTER SCIENCE
, 2008
"... We present a higherorder callbyneed lambda calculus enriched with constructors, caseexpressions, recursive letrecexpressions, a seqoperator for sequential evaluation and a nondeterministic operator amb that is locally bottomavoiding. We use a smallstep operational semantics in form of a sin ..."
Abstract

Cited by 14 (9 self)
 Add to MetaCart
We present a higherorder callbyneed lambda calculus enriched with constructors, caseexpressions, recursive letrecexpressions, a seqoperator for sequential evaluation and a nondeterministic operator amb that is locally bottomavoiding. We use a smallstep operational semantics in form of a singlestep rewriting system that defines a (nondeterministic) normal order reduction. This strategy can be made fair by adding resources for bookkeeping. As equational theory we use contextual equivalence, i.e. terms are equal if plugged into any program context their termination behaviour is the same, where we use a combination of may as well as mustconvergence, which is appropriate for nondeterministic computations. We show that we can drop the fairness condition for equational reasoning, since the valid equations w.r.t. normal order reduction are the same as for fair normal order reduction. We evolve different proof tools for proving correctness of program transformations, in particular, a context lemma for may as well as mustconvergence is proved, which restricts the number of contexts that need to be examined for proving contextual equivalence. In combination with socalled complete sets of commuting and forking diagrams we show that
all the deterministic reduction rules and also some additional transformations preserve contextual equivalence.We also prove a standardisation theorem for fair normal order reduction. The structure of the ordering <= c is also analysed: Ω is not a least element, and <=c already implies contextual equivalence w.r.t. mayconvergence.
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...
Beating the Productivity Checker Using Embedded Languages
"... Abstract. Some total languages, like Agda and Coq, allow the use of guarded corecursion to construct infinite values and proofs. Guarded corecursion is a form of recursion in which arbitrary recursive calls are allowed, as long as they are guarded by a coinductive constructor. Guardedness ensures th ..."
Abstract

Cited by 6 (3 self)
 Add to MetaCart
Abstract. Some total languages, like Agda and Coq, allow the use of guarded corecursion to construct infinite values and proofs. Guarded corecursion is a form of recursion in which arbitrary recursive calls are allowed, as long as they are guarded by a coinductive constructor. Guardedness ensures that programs are productive, i.e. that every finite prefix of an infinite value can be computed in finite time. However, many productive programs are not guarded, and it can be nontrivial to put them in guarded form. This paper gives a method for turning a productive program into a guarded program. The method amounts to defining a problemspecific language as a data type, writing the program in the problemspecific language, and writing a guarded interpreter for this language. 1
Natural Semantics for NonDeterminism
, 1993
"... We present a natural semantics for the untyped lazy calculus plus McCarthy's amb, a nondeterministic choice operator. The natural semantics includes rules for both convergent behaviour (dened inductively) and divergent behaviour (dened coinductively). This semantics is equivalent to a small ste ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
We present a natural semantics for the untyped lazy calculus plus McCarthy's amb, a nondeterministic choice operator. The natural semantics includes rules for both convergent behaviour (dened inductively) and divergent behaviour (dened coinductively). This semantics is equivalent to a small step reduction semantics that corresponds closely to our operational intuitions about McCarthy's amb. We present equivalences for convergent and divergent behaviour based on the natural semantics and prove a Context Lemma for the convergence equivalence. We then give a theory l 8 , based on the equivalences for convergent and divergent behaviour. Since it is able to distinguish between programs that dier only in their divergent behaviour, the theory is more discriminating than equational theories based on current domaintheoretic models. It is therefore more suitable for reasoning about functional programs containing McCarthy's amb. Contents 1 Introduction 2 2 Related Work 3 3 ...
Implementing Declarative Parallel BottomAvoiding Choice
 IN 14TH SYMPOSIUM ON COMPUTER ARCHITECTURE AND HIGH PERFORMANCE COMPUTING
, 2002
"... Nondeterministic choice supports efficient parallel speculation, but unrestricted nondeterminism destroys the referential transparency of purelydeclarative languages by removing unfoldability and it bears the danger of wasting resources on unncessary computations. While numerous choice mechanisms ..."
Abstract

Cited by 2 (1 self)
 Add to MetaCart
Nondeterministic choice supports efficient parallel speculation, but unrestricted nondeterminism destroys the referential transparency of purelydeclarative languages by removing unfoldability and it bears the danger of wasting resources on unncessary computations. While numerous choice mechanisms have been proposed that preserve unfoldability, and some concurrent implementations exist, we believe that no compiled parallel implementation has previously been constructed. This paper presents the design, semantics, implementation and use of a family of bottomavoiding choice operators for Glasgow parallel Haskell. The subtle semantic properties of our choice operations are described, including a careful classification using an existing framework, together with a discussion of operational semantics issues and the pragmatics of distributed memory implementation. The expressiveness of our choice operators is demonstrated by constructing a branch and bound search, a merge and a speculative conditional. Their effectiveness is demonstrated by comparing the parallel performance of the speculative search with naive and 'perfect' implementations. Their efficiency is assessed by measuring runtime overhead and heap consumption.
Mixing Induction and Coinduction
, 2009
"... Purely inductive definitions give rise to treeshaped values where all branches have finite depth, and purely coinductive definitions give rise to values where all branches are potentially infinite. If this is too restrictive, then an alternative is to use mixed induction and coinduction. This techn ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Purely inductive definitions give rise to treeshaped values where all branches have finite depth, and purely coinductive definitions give rise to values where all branches are potentially infinite. If this is too restrictive, then an alternative is to use mixed induction and coinduction. This technique appears to be fairly unknown. The aim of this paper is to make the technique more widely known, and to present several new applications of it, including a parser combinator library which guarantees termination of parsing, and a method for combining coinductively defined inference systems with rules like transitivity. The developments presented in the paper have been formalised and checked in Agda, a dependently typed programming language and proof assistant.
Subtyping, Declaratively An Exercise in Mixed Induction and Coinduction
"... Abstract. It is natural to present subtyping for recursive types coinductively. However, Gapeyev, Levin and Pierce have noted that there is a problem with coinductive definitions of nontrivial transitive inference systems: they cannot be “declarative”—as opposed to “algorithmic ” or syntaxdirected ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract. It is natural to present subtyping for recursive types coinductively. However, Gapeyev, Levin and Pierce have noted that there is a problem with coinductive definitions of nontrivial transitive inference systems: they cannot be “declarative”—as opposed to “algorithmic ” or syntaxdirected—because coinductive inference systems with an explicit rule of transitivity are trivial. We propose a solution to this problem. By using mixed induction and coinduction we define an inference system for subtyping which combines the advantages of coinduction with the convenience of an explicit rule of transitivity. The definition uses coinduction for the structural rules, and induction for the rule of transitivity. We also discuss under what conditions this technique can be used when defining other inference systems. The developments presented in the paper have been mechanised using Agda, a dependently typed programming language and proof assistant. 1