|
ABSTRACT
The call-by-need lambda calculus provides an equational framework for reasoning syntactically about lazy evaluation. This paper examines its operational characteristics. By a series of reasoning steps, we systematically unpack the standard-order reduction relation of the calculus and discover a novel abstract machine definition which, like the calculus, goes "under lambdas." We prove that machine evaluation is equivalent to standard-order evaluation. Unlike traditional abstract machines, delimited control plays a significant role in the machine's behavior. In particular, the machine replaces the manipulation of a heap using store-based effects with disciplined management of the evaluation stack using control-based effects. In short, state is replaced with control. To further articulate this observation, we present a simulation of call-by-need in a call-by-value language using delimited control operations.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Martín Abadi, Luca Cardelli, Pierre-Louis Curien, and Jean-Jacques Lévy. Explicit substitutions. Journal of Functional Programming, 1 (4): 375--416, 1991.
|
| |
2
|
|
 |
3
|
Zena M. Ariola , John Maraist , Martin Odersky , Matthias Felleisen , Philip Wadler, A call-by-need lambda calculus, Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.233-246, January 23-25, 1995, San Francisco, California, United States
[doi> 10.1145/199448.199507]
|
| |
4
|
Henk P. Barendregt. The Lambda Calculus, its Syntax and Semantics. North-Holland, Amsterdam, NL, 1981. Studies in Logic and the Foundations of Mathematics.
|
 |
5
|
|
| |
6
|
Haskell Brookes Curry and Robert Feys. Combinatory Logic, Volume I. Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, 1958. Second printing 1968.
|
 |
7
|
|
| |
8
|
Olivier Danvy and Lasse R. Nielsen. Refocusing in reduction semantics. Technical Report RS-04-26, BRICS, DAIMI, Department of Computer Science, University of Aarhus, Aarhus, Denmark, November 2004.
|
| |
9
|
|
 |
10
|
|
| |
11
|
Matthias Felleisen and Matthew Flatt. Programming languages and lambda calculi. Available from http://www.cs.utah.edu/plt/publications/pllc.pdf, January 2002.
|
| |
12
|
Matthias Felleisen and Daniel P. Friedman. Control operators, the SECD-machine, and the λ-calculus. In M. Wirsing, editor, Formal Description of Programming Concepts, pages 193--217. North-Holland, 1986.
|
| |
13
|
|
| |
14
|
Daniel P. Friedman and David S. Wise. CONS should not evaluate its arguments. In S. Michaelson and Robin Milner, editors, Automata, Languages and Programming, pages 257--284, Edinburgh, Scotland, 1976. Edinburgh University Press.
|
| |
15
|
|
| |
16
|
Jeremy Gibbons and Keith Wansbrough. Tracing lazy functional languages. In Michael E. Houle and Peter Eades, editors, Proceedings of Conference on Computing: The Australian Theory Symposium, pages 11--20, Townsville, January 29-30 1996. Australian Computer Science Communications. ISBN ISSN 0157-3055.
|
 |
17
|
|
 |
18
|
|
 |
19
|
Oleg Kiselyov , Chung-chieh Shan , Daniel P. Friedman , Amr Sabry, Backtracking, interleaving, and terminating monad transformers: (functional pearl), Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, September 26-28, 2005, Tallinn, Estonia
|
 |
20
|
|
| |
21
|
|
 |
22
|
|
| |
23
|
|
| |
24
|
Eugenio Moggi and Amr Sabry. An abstract monadic semantics for value recursion. Theoretical Informatics and Applications, 38 (4): 375--400, 2004.
|
| |
25
|
|
 |
26
|
|
| |
27
|
Gordon D. Plotkin. Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science, 1 (2): 125--159, December 1975.
|
| |
28
|
|
| |
29
|
|
| |
30
|
|
 |
31
|
|
| |
32
|
|
| |
33
|
|
|