The Call-by-need Lambda Calculus, Revisited

The existing call-by-need λ 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.

[1]  P. Wadler,et al.  The Call-by-Need Lambda Calculus ( Unabridged ) , 1994 .

[2]  Simon L. Peyton Jones,et al.  The spineless tagless G-machine , 1989, FPCA.

[3]  William C. Frederick,et al.  A Combinatory Logic , 1995 .

[4]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[5]  Olivier Danvy,et al.  Defunctionalized Interpreters for Call-by-Need Evaluation , 2010, FLOPS.

[6]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[7]  Daniel P. Friedman,et al.  CONS Should Not Evaluate its Arguments , 1976, ICALP.

[8]  Masahito Hasegawa,et al.  Small-step and big-step semantics for call-by-need , 2009, J. Funct. Program..

[9]  Ralph Loader Notes on Simply Typed Lambda Calculus , 1998 .

[10]  A. Church The calculi of lambda-conversion , 1941 .

[11]  Stefan Blom,et al.  Cyclic Lambda Calculi , 1997, TACS.

[12]  S. Purushothaman Iyer,et al.  An Adequate Operational Semantics for Sharing in Lazy Evaluation , 1992, ESOP.

[13]  Matthias Felleisen,et al.  A Syntactic Theory of Sequential State , 1989, Theor. Comput. Sci..

[14]  Martin Odersky,et al.  Call-by-name, call-by-value, call-by-need and the linear lambda calculus , 1995, MFPS.

[15]  Peter Sestoft,et al.  Deriving a lazy abstract machine , 1997, Journal of Functional Programming.

[16]  Amr Sabry,et al.  Lazy evaluation and delimited control , 2009, POPL '09.

[17]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[18]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[19]  John Launchbury,et al.  A natural semantics for lazy evaluation , 1993, POPL '93.

[20]  Mark B. Josephs,et al.  The Semantics of Lazy Functional Languages , 1989, Theor. Comput. Sci..

[21]  Daniel P. Friedman,et al.  Improving the lazy Krivine machine , 2007, High. Order Symb. Comput..

[22]  P. J. Landin,et al.  The next 700 programming languages , 1966, CACM.

[23]  Haskell B. Curry,et al.  Combinatory Logic, Volume I , 1959 .

[24]  Peter Henderson,et al.  A lazy evaluator , 1976, POPL.

[25]  Matthias Felleisen,et al.  Semantics Engineering with PLT Redex , 2009 .