Proving lazy folklore with mixed lazy/strict semantics

Abstract. Explicit enforcement of strictness is used by functional programmers for many different purposes. Few functional programmers, however, are aware that explicitly enforcing strictness has serious consequences for (formal) reasoning about their programs. Some vague “folklore” knowledge has emerged concerning the correspondence between lazy and strict evaluation but this is based on experience rather than on rigid proof. This paper employs a model for formal reasoning with enforced strictness based on John Launchbury’s lazy graph semantics. In this model Launchbury’s semantics are extended with an explicit strict let construct. Examples are given of the use of these semantics in formal proofs. We formally prove some “folklore” properties that are often used in informal reasoning by programmers.

[1]  Marko C. J. D. van Eekelen,et al.  Proof Tool Support for Explicit Strictness , 2005, IFL.

[2]  Nils Anders Danielsson,et al.  Chasing Bottoms: A Case Study in Program Verification in the Presence of Partial and Infinite Values , 2004, MPC.

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

[4]  David Sands,et al.  Possibilities and limitations of call-by-need space improvement , 2001, ICFP '01.

[5]  Rinus Plasmeijer,et al.  Concurrent Clean Language Report - version 1.3 , 1998 .

[6]  Paul Hudak The Haskell School of Expression: Learning Functional Programming through Multimedia , 1999 .

[7]  Richard S. Bird,et al.  Introduction to functional programming using haskeu , 1998 .

[8]  Marko C. J. D. van Eekelen,et al.  Parallel graph rewriting - some contributions to its theory, its implementation and its application , 1988 .

[9]  Marinus J. Plasmeijer,et al.  Theorem Proving for functional Programmers - Sparkle: A Functional Theorem Prover , 2001 .

[10]  S. Abramsky The lazy lambda calculus , 1990 .

[11]  Nils Anders Danielsson,et al.  Fast and loose reasoning is morally correct , 2006, POPL '06.

[12]  Marko C. J. D. van Eekelen,et al.  Keep it clean: a unique approach to functional programming. , 1999, SIGP.

[13]  Marko C. J. D. van Eekelen,et al.  CLEAN: A language for functional graph writing , 1987, FPCA.

[14]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[15]  C.-H. Luke Ong,et al.  Full Abstraction in the Lazy Lambda Calculus , 1993, Inf. Comput..

[16]  M PaulHudakEt,et al.  Report on the programming language haskell: a non-strict , 1992 .

[17]  Philip W. Trinder,et al.  An operational semantics for parallel lazy evaluation , 2000, ICFP '00.

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

[19]  Marko C. J. D. van Eekelen,et al.  Term Graph Rewriting , 1987, PARLE.

[20]  R. Bird Introduction to functional programming using Haskell, Second Edition , 1998 .

[21]  Marko van Eekelen,et al.  Mixed Lazy/Strict Natural Semantics , 2004 .