## The Call-by-need Lambda Calculus, Revisited

Citations: | 1 - 0 self |

### BibTeX

@MISC{Chang_thecall-by-need,

author = {Stephen Chang and Matthias Felleisen},

title = {The Call-by-need Lambda Calculus, Revisited},

year = {}

}

### OpenURL

### Abstract

Abstract. The existing call-by-need λ calculi describe lazy evaluation via equational logics. A programmer can use these logics to safely ascertain whether one term is behaviorally equivalent to another or to determine the value of a lazy program. However, neither of the existing calculi models evaluation in a way that matches lazy implementations. Both calculi suffer from the same two problems. First, the calculi never discard function calls, even after they are completely resolved. Second, the calculi include re-association axioms even though these axioms are merely administrative steps with no counterpart in any implementation. In this paper, we present an alternative axiomatization of lazy evaluation using a single axiom. It eliminates both the function call retention problem and the extraneous re-association axioms. Our axiom uses a grammar of contexts to describe the exact notion of a needed computation. Like its predecessors, our new calculus satisfies consistency and standardization properties and is thus suitable for reasoning about behavioral equivalence. In addition, we establish a correspondence between our semantics and Launchbury’s natural semantics.

### Citations

1163 |
The Lambda Calculus Its Syntax and Semantics
- Barendregt
- 1984
(Show Context)
Citation Context ...ch enough to mimic machine evaluation, meaning programmers can reduce programs to values without thinking about implementation details. Finally, the λ calculus gives rise to a substantial meta-theory =-=[5, 7]-=- from which researchers have generated useful and practical results for its cousins. Unfortunately, neither of the existing by-need calculi model lazy evaluation in a way that matches lazy language im... |

340 | The Calculi of Lambda-Conversion - Church - 1941 |

194 |
The Next 700 Programming Languages
- Landin
- 1966
(Show Context)
Citation Context ...rm of call-by-value programming, distinct from the notion of β and normalization in Church’s original calculus. Plotkin [25] reconciled the λ calculus and Landin’s SECD machine for the ISWIM language =-=[16]-=- with the introduction of a notion of correspondence and with a proof that two distinct variants of the λ calculus corresponded to two distinct variants of the ISWIM programming language: one for call... |

191 | The call-by-need lambda calculus
- Ariola, Felleisen, et al.
- 1995
(Show Context)
Citation Context ... possible extensions.2 The Original Call-by-need λ Calculi The Call-by-need Lambda Calculus, Revisited 3 The original call-by-need λ calculi are independently due to two groups: Ariola and Felleisen =-=[2, 3]-=- and Maraist, et al. [20, 21]. They were jointly presented at POPL in 1995 [4]. Both calculi use the standard set of terms as syntax: e = x | λx.e | e e (Terms) Our treatment of syntax employs the usu... |

190 | A Natural Semantics for Lazy Evaluation
- Launchbury
- 1993
(Show Context)
Citation Context ...nce, and only if needed. Since then, researchers have explored a number of characterizations of callby-need [8, 11, 13, 15, 23, 24, 26]. Concerning this paper, three stand out. Launchbury’s semantics =-=[17]-=- specifies the meaning of complete programs with a Kahnstyle natural semantics. The call-by-need λ calculi of Ariola and Felleisen [2–4], and of Maraist, Odersky, and Wadler [4, 20, 21] are equational... |

178 |
Call-by-name, call-by-value, and the lambda-calculus. Theoret
- Plotkin
- 1975
(Show Context)
Citation Context ...he basis for new languages. By 1970, however, a disconnect had emerged in the form of call-by-value programming, distinct from the notion of β and normalization in Church’s original calculus. Plotkin =-=[25]-=- reconciled the λ calculus and Landin’s SECD machine for the ISWIM language [16] with the introduction of a notion of correspondence and with a proof that two distinct variants of the λ calculus corre... |

134 |
Lambda Calculus Models of Programming Languages
- Morris
- 1968
(Show Context)
Citation Context ...are equational logics in the spirit of the λ calculus. The appeal of the λ calculus has several reasons. First, a calculus is sound with respect to the observational (behavioral) equivalence relation =-=[22]-=-. It can therefore serve as the starting point for other, more powerful logics. Second, its axioms are rich enough to mimic machine evaluation, meaning programmers can reduce programs to values withou... |

117 |
Semantics and pragmatics of the lambda calculus
- Wadsworth
- 1971
(Show Context)
Citation Context ...riants of the λ calculus corresponded to two distinct variants of the ISWIM programming language: one for call-by-value and one for call-by-name. In the early 1970s, researchers proposed call-by-need =-=[12, 14, 28]-=-, a third kind of parameter passing mechanism that could be viewed as yet another variant of the ISWIM language. Call-by-need is supposed to represent the best of both worlds. While call-by-value ISWI... |

92 |
should not evaluate its arguments
- Friedman, Wise
- 1976
(Show Context)
Citation Context ...riants of the λ calculus corresponded to two distinct variants of the ISWIM programming language: one for call-by-value and one for call-by-name. In the early 1970s, researchers proposed call-by-need =-=[12, 14, 28]-=-, a third kind of parameter passing mechanism that could be viewed as yet another variant of the ISWIM language. Call-by-need is supposed to represent the best of both worlds. While call-by-value ISWI... |

89 |
Evaluation
- Henderson
- 1971
(Show Context)
Citation Context ...riants of the λ calculus corresponded to two distinct variants of the ISWIM programming language: one for call-by-value and one for call-by-name. In the early 1970s, researchers proposed call-by-need =-=[12, 14, 28]-=-, a third kind of parameter passing mechanism that could be viewed as yet another variant of the ISWIM language. Call-by-need is supposed to represent the best of both worlds. While call-by-value ISWI... |

72 | Deriving a lazy abstract machine
- Sestoft
- 1997
(Show Context)
Citation Context ...ically construct a series of intermediate systems that makes comparisons easy, all while ensuring correctness at each step. A first step is to convert the natural semantics into a store-based machine =-=[27]-=-. To further bridge the gap we note that a single-use assignment statement is equivalent to a program-wide substitution of shared expressions [10]. A closely related idea is to reduce shared expressio... |

47 |
Semantics Engineering with PLT Redex
- Felleisen, Findler, et al.
- 2009
(Show Context)
Citation Context ...egrained for direct comparison. Fortunately, it is easy to construct an intermediate transition system that eliminates the remainder of the gap. We convert λneed to an equivalent CK transition system =-=[9]-=-, where the program is partitioned into a control string (C) and an explicit context (K) and we show that there is a correspondence between this transition system and λ‖. Figure 4 outlines our proof s... |

47 |
The spineless tagless G-machine
- Jones, Salkild
- 1989
(Show Context)
Citation Context ...lting value is used from then onward. In short, call-by-need evaluates an argument at most once, and only if needed. Since then, researchers have explored a number of characterizations of callby-need =-=[8, 11, 13, 15, 23, 24, 26]-=-. Concerning this paper, three stand out. Launchbury’s semantics [17] specifies the meaning of complete programs with a Kahnstyle natural semantics. The call-by-need λ calculi of Ariola and Felleisen ... |

45 | The call-by-need lambda calculus
- Maraist, Odersky, et al.
- 1998
(Show Context)
Citation Context ...aunchbury’s semantics [17] specifies the meaning of complete programs with a Kahnstyle natural semantics. The call-by-need λ calculi of Ariola and Felleisen [2–4], and of Maraist, Odersky, and Wadler =-=[4, 20, 21]-=- are equational logics in the spirit of the λ calculus. The appeal of the λ calculus has several reasons. First, a calculus is sound with respect to the observational (behavioral) equivalence relation... |

39 |
A syntactic theory of sequential state
- Felleisen, Friedman
- 1989
(Show Context)
Citation Context ...vert the natural semantics into a store-based machine [27]. To further bridge the gap we note that a single-use assignment statement is equivalent to a program-wide substitution of shared expressions =-=[10]-=-. A closely related idea is to reduce shared expressions simultaneously. This leads to a parallel program rewriting system, dubbed λ‖. Equipped with λ‖ we get closer to λneed but not all the way there... |

37 | Cyclic lambda calculi
- Ariola, Blom
- 1997
(Show Context)
Citation Context ...licit letrec constructor for cyclic terms. Since cyclic programming is an important idiom in lazy programming languages, others have extensively explored cyclic by-need calculi, e.g., Ariola and Blum =-=[1]-=-, and applying their solutions to our calculus should pose no problems. 7 Conclusion Following Plotkin’s work on call-by-name and call-by-value, we present a callby-need λ calculus that expresses comp... |

31 | Call-by-name, call-by-value, call-by-need, and the linear lambda calculus
- Maraist, Odersky, et al.
- 1995
(Show Context)
Citation Context ...us, Revisited 9 Aaf[v]. Also, the Aaf answer contexts are identical to the third kind of evaluation context in λaf-mod and the new definition of Eaf reflects this relationship. Second, Maraist et al. =-=[19]-=- observed that once an argument is reduced to axiom exploits a value, all substitutions can be performed at once. The β ′ need this idea and performs a full substitution. Obviously β ′ need occasional... |

23 |
An operational semantics of sharing in lazy evaluation
- Seaman, Iyer
- 1996
(Show Context)
Citation Context ...lting value is used from then onward. In short, call-by-need evaluates an argument at most once, and only if needed. Since then, researchers have explored a number of characterizations of callby-need =-=[8, 11, 13, 15, 23, 24, 26]-=-. Concerning this paper, three stand out. Launchbury’s semantics [17] specifies the meaning of complete programs with a Kahnstyle natural semantics. The call-by-need λ calculi of Ariola and Felleisen ... |

18 | Notes on simply typed lambda calculus
- Loader
- 1998
(Show Context)
Citation Context ...R. Proof. By triple lexicographic induction on (1) length n of the given standard reduction sequence, (2) e0 ⇒ e1 , and (3) structure of e0. 4 4 We conjecture that the use of Ralph Loader’s technique =-=[18]-=- may simplify our proof. need12 Stephen Chang, Matthias Felleisen 4.3 Observational Equivalence Following Morris [22] two expressions e1 and e2 are observationally equivalent, e1 ≃ e2, if they are in... |

13 |
The semantics of lazy functional languages
- Josephs
- 1989
(Show Context)
Citation Context ...lting value is used from then onward. In short, call-by-need evaluates an argument at most once, and only if needed. Since then, researchers have explored a number of characterizations of callby-need =-=[8, 11, 13, 15, 23, 24, 26]-=-. Concerning this paper, three stand out. Launchbury’s semantics [17] specifies the meaning of complete programs with a Kahnstyle natural semantics. The call-by-need λ calculi of Ariola and Felleisen ... |

11 | Lazy evaluation and delimited control
- Garcia, Lumsdaine, et al.
- 2009
(Show Context)
Citation Context |

9 |
Defunctionalized interpreters for call-by-need evaluation
- Danvy, Millikin, et al.
- 2010
(Show Context)
Citation Context |

8 | Small-step and big-step semantics for call-by-need
- Nakata, Hasegawa
- 2009
(Show Context)
Citation Context |

6 | Improving the lazy Krivine machine
- Friedman, Ghuloum, et al.
- 2004
(Show Context)
Citation Context |

4 | P.: The call-by-need lambda calculus (unabridged
- Maraist, Odersky, et al.
- 1994
(Show Context)
Citation Context ...aunchbury’s semantics [17] specifies the meaning of complete programs with a Kahnstyle natural semantics. The call-by-need λ calculi of Ariola and Felleisen [2–4], and of Maraist, Odersky, and Wadler =-=[4, 20, 21]-=- are equational logics in the spirit of the λ calculus. The appeal of the λ calculus has several reasons. First, a calculus is sound with respect to the observational (behavioral) equivalence relation... |