## Classical Call-by-need and duality (2011)

### BibTeX

@MISC{Ariola11classicalcall-by-need,

author = {Zena M. Ariola and Hugo Herbelin and Alexis Saurin},

title = { Classical Call-by-need and duality},

year = {2011}

}

### OpenURL

### Abstract

We study call-by-need from the point of view of the duality between call-by-name and call-by-value. We develop sequent-calculus style versions of call-by-need both in the minimal and classical case. As a result, we obtain a natural extension of call-by-need with control operators. This leads us to introduce a call-by-need λµ-calculus. Finally, by using the dualities principles of λµ˜µ-calculus, we show the existence of a new call-by-need calculus, which is distinct from call-by-name, call-byvalue and usual call-by-need theories.

### Citations

1119 |
The Lambda Calculus: Its Syntax and Semantics
- Barendregt
- 1984
(Show Context)
Citation Context ...es. Keywords: call-by-need, lazy evaluation, duality of computation, sequent calculus, λµ-calculus, classical logic, control, subtraction connective Introduction The theory of call-by-name λ-calculus =-=[9,8]-=- is easy to de ne. Given the syntax of λ-calculus M ::= x | λx.M | M M, the reduction semantics is entirely determined by the β-reduction rule (λx.M) N →β M[x ← N] in the sense that: for any closed te... |

321 |
Lambda-mu-calculus: An algorithmic interpretation of classical natural deduction
- Parigot
- 1992
(Show Context)
Citation Context ...tions; the observational closure of β induces a unique rule η that fully captures observational equality over nite normal terms (Böhm theorem); the extension with control, typically done à la Parigot =-=[30]-=-, is relatively easy to get by adding just two operational rules and an observational rule (though the raw version of Böhm theorem fails [15,35]). The theory of call-by-value λ-calculus, as initiated ... |

260 |
Investigations into logical deduction
- Gentzen
- 1969
(Show Context)
Citation Context ...calculi are not distinguishable. In order to tackle the problem of developing a classical version of call-by-need, we rst study how to formulate (minimal) call-by-need in the sequent calculus setting =-=[22]-=- (while current call-by-need calculi are based on natural deduction [32]). An advantage of a sequent calculus presentation of a calculus is that its extension to the classical case does not require th... |

223 |
Natural Deduction - A proof theoretical study. Almquist and Wiksell
- Prawitz
- 1965
(Show Context)
Citation Context ...oping a classical version of call-by-need, we rst study how to formulate (minimal) call-by-need in the sequent calculus setting [22] (while current call-by-need calculi are based on natural deduction =-=[32]-=-). An advantage of a sequent calculus presentation of a calculus is that its extension to the classical case does not require the introduction of new rules but simply the extension of existing ones [7... |

187 | The call-by-need lambda calculus
- Ariola, Felleisen
- 1997
(Show Context)
Citation Context ...kell [16], is at a much less advanced stage of development. The rst approach to call-by-need as a calculus goes back to the 90's with theinria-00630156, version 1 - 7 Oct 2011 works of Ariola et al. =-=[3]-=- and Maraist et al. [26] for whom the concern was the characterization of standard weak-head reduction. Our paper aims at studying call-by-need in terms that are familiar to the study of call-by-name ... |

173 |
Call-by-name, call-by-value and the lambda-calculus
- Plotkin
- 1975
(Show Context)
Citation Context ...vely easy to get by adding just two operational rules and an observational rule (though the raw version of Böhm theorem fails [15,35]). The theory of call-by-value λ-calculus, as initiated by Plotkin =-=[31]-=-, has a similar property with respect to the βv rule (the argument of β being restricted to a variable or a λx.M only), but the observational closure is noticeably more complex: it at least includes t... |

161 | H.: The duality of computation
- Curien, Herbelin
(Show Context)
Citation Context ...n particular, we will address the question of adding control to call-by-need and the question of what is the dual of call-by-need along the lines of the duality between call-by-name and call-by-value =-=[20,36,11]-=-. Call-by-need is close to callby-value in the sense that only values are substituted, but call-by-need is also close to call-by-name in the sense that only those terms that are bound to needed variab... |

161 | M.: Reasoning about programs in continuation-passing style
- Sabry, Felleisen
- 1993
(Show Context)
Citation Context ...f β being restricted to a variable or a λx.M only), but the observational closure is noticeably more complex: it at least includes the rules unveiled by Moggi [27] as was shown by Sabry and Felleisen =-=[34]-=-. Extensions of standardization and Böhm theorem for call-by-value are more delicate than in call-by-name [24,33]. Comparatively, call-by-need λ-calculus, though at the core of programming languages s... |

116 |
A syntactic theory of sequential control
- Felleisen, Friedman, et al.
- 1987
(Show Context)
Citation Context ...n addition to variables and lambda abstractions, contains a term of the form µα.c, where c is a command, after Parigot's λµ-calculus [30]. The µ construct is similar to Felleisen's C control operator =-=[18,19,17]-=- and one can approximatively read µα.c as C(λα.c) (see [4] for a detailed analysis of the di erences). Whereas the µ construct allows one to give a name to a context, so as to invoke it later, the dua... |

104 | A New Deconstructive Logic: Linear Logic
- Danos, Joinet, et al.
- 1997
(Show Context)
Citation Context ...y-name. We show next that the same holds for call-by-need in sequent calculus form. To that end, we rst review Curien and Herbelin call-by-name sequent calculus, called λµ˜µT (after Danos et al's LKT =-=[12,13]-=-). λµ˜µT restricts the syntax of legal contexts capturing the intuition that according to the callby-name continuation passing style, the continuation follows a speci c pattern. The syntax of λµ˜µT be... |

102 |
A set of postulates for the foundation of logic
- Church
(Show Context)
Citation Context ...es. Keywords: call-by-need, lazy evaluation, duality of computation, sequent calculus, λµ-calculus, classical logic, control, subtraction connective Introduction The theory of call-by-name λ-calculus =-=[9,8]-=- is easy to de ne. Given the syntax of λ-calculus M ::= x | λx.M | M M, the reduction semantics is entirely determined by the β-reduction rule (λx.M) N →β M[x ← N] in the sense that: for any closed te... |

84 | Control categories and duality: on the categorical semantics of the λµ-calculus
- Selinger
- 1999
(Show Context)
Citation Context ...n particular, we will address the question of adding control to call-by-need and the question of what is the dual of call-by-need along the lines of the duality between call-by-name and call-by-value =-=[20,36,11]-=-. Call-by-need is close to callby-value in the sense that only values are substituted, but call-by-need is also close to call-by-name in the sense that only those terms that are bound to needed variab... |

58 |
Reasoning with continuations
- Felleisen, Friedman, et al.
- 1986
(Show Context)
Citation Context ...n addition to variables and lambda abstractions, contains a term of the form µα.c, where c is a command, after Parigot's λµ-calculus [30]. The µ construct is similar to Felleisen's C control operator =-=[18,19,17]-=- and one can approximatively read µα.c as C(λα.c) (see [4] for a detailed analysis of the di erences). Whereas the µ construct allows one to give a name to a context, so as to invoke it later, the dua... |

44 |
Control operators, the SECD-machine, and the lambda-calculus
- FELLEISEN, FRIEDMAN
- 1986
(Show Context)
Citation Context ...n addition to variables and lambda abstractions, contains a term of the form µα.c, where c is a command, after Parigot's λµ-calculus [30]. The µ construct is similar to Felleisen's C control operator =-=[18,19,17]-=- and one can approximatively read µα.c as C(λα.c) (see [4] for a detailed analysis of the di erences). Whereas the µ construct allows one to give a name to a context, so as to invoke it later, the dua... |

36 | LKQ and LKT: sequent calculi for second order logic based upon dual linear decompositions of classical implication - Danos, Joinet, et al. - 1995 |

30 | Minimal classical logic and control operators
- Ariola, Herbelin
- 2003
(Show Context)
Citation Context ... calculus to be control-free by limiting the set of continuation variables to a single variable, conventionally written ⋆, which is linearly used. This corresponds to the restriction to minimal logic =-=[1]-=-. We introduce next the lazy call-by-value calculus, λmlv. 5De nition 1. The syntax of λmlv is de ned as follows: command c ::= <v |e> term v ::= x | λx.v | µ⋆.c context e ::= E | ˜µx.c yielding cont... |

30 | Declarative continuations and categorical duality
- Filinski
- 1989
(Show Context)
Citation Context ...n particular, we will address the question of adding control to call-by-need and the question of what is the dual of call-by-need along the lines of the duality between call-by-name and call-by-value =-=[20,36,11]-=-. Call-by-need is close to callby-value in the sense that only values are substituted, but call-by-need is also close to call-by-name in the sense that only those terms that are bound to needed variab... |

22 | A concurrent lambda calculus with futures
- Niehren, Schwinghammer, et al.
- 2006
(Show Context)
Citation Context ...our lazy call-by-value and lazy call-by-name with delimited control. Following a suggestion by Danvy, we will investigate connections between our lazy callby-name calculus and a calculus with futures =-=[28]-=-. At last, we want to better understand the underlying logic or type system. Aknowledgements: The authors wish to thank Olivier Danvy and the anonynmous referees for valuable comments and suggestions.... |

20 | Subtractive logic
- Crolard
(Show Context)
Citation Context ...calculi. While µ and ˜µ constructs are dual of each other, implicative constructions λx.t and v · E currently have no dual in λlv. We extend λlv by adding constructions for the subtraction connective =-=[10]-=-. Subtraction was already considered in the setting of λµ˜µ in Curien et al. [11]. We follow the notation introduced by Herbelin in his habilitation thesis [23]. Terms are extended with the constructi... |

17 | Call-by-need and continuationpassing style
- Okasaki, Lee, et al.
- 1994
(Show Context)
Citation Context ...ersa, without the use of subtraction. We are also interested in devising a complete set of axioms with respect to a classical extension of the call-by-need continuationpassing style of Okasaki et al. =-=[29]-=-. A natural development will then be to extend our lazy call-by-value and lazy call-by-name with delimited control. Following a suggestion by Danvy, we will investigate connections between our lazy ca... |

14 | A type-theoretic foundation of delimited continuations
- Ariola, Herbelin, et al.
(Show Context)
Citation Context ...56, version 1 - 7 Oct 2011 standard reduction, which applies the lift and assoc rule eagerly. In the minimal case, the single context variable, called ⋆, could be seen as the constant tp discussed in =-=[6,5]-=-. In the cited work, it is also presented how delimited control can be captured by extending tp to a dynamic variable named ̂tp. This suggests that one could use ̂tp instead of tp to represent computa... |

13 | Lambda terms for natural deduction, sequent calculus and cut elimination
- Barendregt, Ghilezan
- 1998
(Show Context)
Citation Context ...2]). An advantage of a sequent calculus presentation of a calculus is that its extension to the classical case does not require the introduction of new rules but simply the extension of existing ones =-=[7]-=-. Curien and Herbelin [11] designed a calculus that provides an appealing computational interpretation of proofs in sequent calculus, while providing at the same time a syntactic duality between terms... |

13 |
Continuations semantics or expressing implication by negation
- Lafont, Reus, et al.
- 1993
(Show Context)
Citation Context ...e di erence between the basic strategy and the second strategy is reminiscent of the di erence between Plotkin's call-by-name continuation-passing-style semantics [31] and Lafont-Reus-Streicher's one =-=[25]-=-: the rst one is not compatible with η but the second is. In the rest of the paper, we will consider the second strategy and the reduction rules corresponding to Vn and En are denoted as µn and ˜µn, r... |

11 | Lazy evaluation and delimited control
- Garcia, Lumsdaine, et al.
- 2009
(Show Context)
Citation Context ...xt is realized by the rule: <x|E>τ0[x := µα.c]τ1 → c[α := ˜µx.<x|E>τ0]τ1. This will naturally lead us to developing abstract machines, which will be compared to the abstract machines of Garcia et al. =-=[21]-=- and Danvy et al. [14], inspired by natural deduction. We have related the lazy call-by-value with subtraction to its dual. We plan to provide a simulation of lazy call-by-value in lazy call-by-name a... |

9 | A proof-theoretic foundation of abortive continuations
- Ariola, Herbelin, et al.
(Show Context)
Citation Context ... the captured context then that computation would occur twice. <II |˜µz.<µα.<λx.µβ.<z |(µδ.<λx.x|α>) · β>|α>|˜µf.<f |z · γ>>>>> 3 To reduce closed commands one can introduce a constant named tp as in =-=[5]-=-, or one can encode the top-level using subtraction (see Section 7). 12Unlike the sequent calculus setting, to extend minimal natural deduction to the classical case, we need to introduce two new con... |

9 |
Defunctionalized interpreters for call-by-need evaluation
- Danvy, Millikin, et al.
- 2010
(Show Context)
Citation Context ...rule: <x|E>τ0[x := µα.c]τ1 → c[α := ˜µx.<x|E>τ0]τ1. This will naturally lead us to developing abstract machines, which will be compared to the abstract machines of Garcia et al. [21] and Danvy et al. =-=[14]-=-, inspired by natural deduction. We have related the lazy call-by-value with subtraction to its dual. We plan to provide a simulation of lazy call-by-value in lazy call-by-name and vice-versa, without... |

9 |
The Parametric λ-Calculus: a Metamodel for Computation. Texts in Theoretical Computer Science: An EATCS Series
- Rocca, Paolini
- 2004
(Show Context)
Citation Context ...it at least includes the rules unveiled by Moggi [27] as was shown by Sabry and Felleisen [34]. Extensions of standardization and Böhm theorem for call-by-value are more delicate than in call-by-name =-=[24,33]-=-. Comparatively, call-by-need λ-calculus, though at the core of programming languages such as Haskell [16], is at a much less advanced stage of development. The rst approach to call-by-need as a calcu... |

7 |
W.: Lambda-mu-calculus and Böhm’s theorem
- David, Py
- 2001
(Show Context)
Citation Context ...); the extension with control, typically done à la Parigot [30], is relatively easy to get by adding just two operational rules and an observational rule (though the raw version of Böhm theorem fails =-=[15,35]-=-). The theory of call-by-value λ-calculus, as initiated by Plotkin [31], has a similar property with respect to the βv rule (the argument of β being restricted to a variable or a λx.M only), but the o... |

7 |
The call-by-need λ-calculus
- Maraist, Odersky, et al.
- 1998
(Show Context)
Citation Context ... less advanced stage of development. The rst approach to call-by-need as a calculus goes back to the 90's with theinria-00630156, version 1 - 7 Oct 2011 works of Ariola et al. [3] and Maraist et al. =-=[26]-=- for whom the concern was the characterization of standard weak-head reduction. Our paper aims at studying call-by-need in terms that are familiar to the study of call-by-name and call-byvalue. In par... |

7 |
Separation with streams in the λµ-calculus
- Saurin
- 2005
(Show Context)
Citation Context ...); the extension with control, typically done à la Parigot [30], is relatively easy to get by adding just two operational rules and an observational rule (though the raw version of Böhm theorem fails =-=[15,35]-=-). The theory of call-by-value λ-calculus, as initiated by Plotkin [31], has a similar property with respect to the βv rule (the argument of β being restricted to a variable or a λx.M only), but the o... |

6 | An operational account of call-by-value minimal and classical lambda-calculus in “natural deduction” form
- Herbelin, Zimmermann
- 2009
(Show Context)
Citation Context ...it at least includes the rules unveiled by Moggi [27] as was shown by Sabry and Felleisen [34]. Extensions of standardization and Böhm theorem for call-by-value are more delicate than in call-by-name =-=[24,33]-=-. Comparatively, call-by-need λ-calculus, though at the core of programming languages such as Haskell [16], is at a much less advanced stage of development. The rst approach to call-by-need as a calcu... |

4 |
Sequent calculi and abstract machines
- Ariola, Bohannon, et al.
(Show Context)
Citation Context ...mbda abstractions only. In order to specify which contexts are substitutable, it is important to notice that the goal of the structural rules is to bring to the top of a term the redex to be perfomed =-=[2]-=-. Thus, one should allow the reduction of 4<µα.<I |I · α>|v · α> (I stands for λx.x) to <I |I · v · α> since the applicative redex (i.e., the one underlined) is needed in order to continue the comput... |

4 |
Control Reduction Theories: The Bene t of Structural Substitution
- Ariola, Herbelin
(Show Context)
Citation Context ...ch occurrence of [α]M in J is replaced by [α]F [M], where F is the context captured by a continuation which is either □ M or let x = □ in C[x]. The bene ts of structural substitution are discussed in =-=[4]-=-. In addition to lift, assoc, deref v and β, the reduction theory includes the following reduction rules: (µap) (µα.J)M → µα.J[α ← [α](□ M)] (µlet) let x = µα.J in C[x] → µα.J[α ← [α](let x = □ in C[x... |

4 |
special issue
- Fasel, Hudak, et al.
- 1992
(Show Context)
Citation Context ... standardization and Böhm theorem for call-by-value are more delicate than in call-by-name [24,33]. Comparatively, call-by-need λ-calculus, though at the core of programming languages such as Haskell =-=[16]-=-, is at a much less advanced stage of development. The rst approach to call-by-need as a calculus goes back to the 90's with theinria-00630156, version 1 - 7 Oct 2011 works of Ariola et al. [3] and M... |

2 |
C’est maintenant qu’on calcule
- Herbelin
(Show Context)
Citation Context ...ns on the context. This however requires extending the ˜µ rule to <v |v1 · · · vn.˜µx.c> → c[x = µ⋆.<v |v1 · · · vn.⋆>]. The rule is sound for call-by-name extended with the eta rule, called η R → in =-=[23]-=-, given as y = λx.α.<y |x.α>. We have: <v |w · ˜µx.c> =˜µ <v |˜µy.<y |w · ˜µx.c>> = η R → <v |˜µy.<λz.µ⋆.<y |z · ⋆>|w · ˜µx.c>> =→ <v |˜µy.<w |˜µz.<µ⋆.<y |z · ⋆>|˜µx.c>>> = ˜µ <v |˜µy.<w |˜µz.c[x = µ⋆... |

2 | Computational λ-calculus and monads - Moggi |