The semantics of lazy (and industrious) evaluation

Since the publication of two influential papers on lazy evaluation in 1976 [Henderson and Morris, Friedman and Wise], the idea has gained widespread acceptance among language theoreticians—particularly among the advocates of “functional programming” [Henderson80, Backus78]. There are two basic reasons for the popularity of lazy evaluation. First, by making some of the data constructors in a functional language non-strict, it supports programs that manipulate “infinite objects” such as recursively enumerable sequences, which may make some applications easier to program. Second, by delaying evaluation of arguments until they are actually needed, it may speed up computations involving ordinary finite objects. First, there are several semantically distinct definitions of lazy evaluation that plausibly capture the intuitive notion. Second, non-trivial lazy spaces are similar in structure (under the approximation ordering) to universal domains (as defined by Scott [Scott81, Scott76]) such as the P@@@@ model for the untyped lambda calculus. Third, we prove that neither initial algebra specifications [ADJ76,77] nor final algebra specifications [Guttag78, Kamin80] have the power to define lazy spaces. Fourth, although lazy spaces have the same “higher-order” structure as P@@@@, they nevertheless have an elegant, natural characterization within first order logic. In this paper, we develop a simple, yet comprehensive first order theory of lazy spaces relying on three axiom schemes asserting (1) the principle of structural induction for finite objects; (2) the existence of least upper bounds for directed sets; and (3) the continuity of functions.

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

[2]  Samuel N. Kamin Final data type specifications: a new data type specification method , 1980, POPL '80.

[3]  Dana S. Scott,et al.  Data Types as Lattices , 1976, SIAM J. Comput..

[4]  Robert Cartwright,et al.  A constructive alternative to axiomatic data type definitions , 1980, LISP Conference.

[5]  H. Keisler,et al.  Handbook of mathematical logic , 1977 .

[6]  Peter Henderson,et al.  Functional programming - application and implementation , 1980, Prentice Hall International Series in Computer Science.

[7]  John W. Backus,et al.  Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs , 1978, CACM.

[8]  Dana S. Scott,et al.  Some Domain Theory and Denotational Semantics in Coq , 2009, TPHOLs.

[9]  H. Barendregt The type free lambda calculus , 1977 .

[10]  Herbert B. Enderton,et al.  A mathematical introduction to logic , 1972 .

[11]  Robert S. Boyer,et al.  Proving Theorems about LISP Functions , 1973, JACM.

[12]  Dana S. Scott,et al.  Lectures on a Mathematical Theory of Computation , 1982 .

[13]  Robert Cartwright,et al.  User-Defined Data Types as an Aid to Verifying LISP Programs , 1976, ICALP.

[14]  James Wong COMPUTER SCIENCE DEPARTMENT , 1971 .

[15]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

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

[17]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.