Under Consideration for Publication in J. Functional Programming the Logic of Demand in Haskell

Haskell is a functional programming language whose evaluation is lazy by default. However, Haskell also provides pattern matching facilities which add a modicum of eagerness to its otherwise lazy default evaluation. This mixed or “non-strict” semantics can be quite difficult to reason with. This paper introduces a programming logic, P-logic, which neatly formalizes the mixed evaluation in Haskell pattern-matching as a logic, thereby simplifying the task of specifying and verifying Haskell programs. In p-logic, aspects of demand are reflected or represented within both the predicate language and its model theory, allowing for expressive and comprehensible program verification.

[1]  Karl-Filip Faxén,et al.  A static semantics for Haskell , 2002, Journal of Functional Programming.

[2]  Robin Milner,et al.  Definition of standard ML , 1990 .

[3]  Atsushi Ohori,et al.  A simple semantics for ML polymorphism , 1989, FPCA.

[4]  Cliff B. Jones,et al.  On the Usability of Logics which Handle Partial Functions , 1991 .

[5]  John C. Mitchell,et al.  On the type structure of standard ML , 1993, TOPL.

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

[7]  Mark P. Jones,et al.  Typing Haskell in Haskell , 1999 .

[8]  Karel Lambert,et al.  Definitions in nonstrict positive free logic , 1997 .

[9]  H.J.M. Meijer,et al.  Proceedings of the 1999 Haskell Workshop , 1999 .

[10]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[11]  Gordon D. Plotkin,et al.  The category-theoretic solution of recursive domain equations , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[12]  Simon Thompson,et al.  Haskell: The Craft of Functional Programming , 1996 .

[13]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[14]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[15]  Fred B. Schneider,et al.  Avoiding the Undefined by Underspecification , 1995, Computer Science Today.

[16]  J. Girard,et al.  Proofs and types , 1989 .

[17]  John C. Mitchell,et al.  The essence of ML , 1988, POPL '88.

[18]  William M. Farmer,et al.  Reasoning about partial functions with the aid of a computer , 1995 .

[19]  Gordon D. Plotkin,et al.  An Ideal Model for Recursive Polymorphic Types , 1986, Inf. Control..

[20]  William L. Harrison,et al.  Fine Control of Demand in Haskell , 2002, MPC.

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

[22]  Michael Barr,et al.  Category theory for computing science , 1995, Prentice Hall International Series in Computer Science.

[23]  Simon J. Thompson,et al.  A logic for Miranda, revisited , 1995, Formal Aspects of Computing.

[24]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[25]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[26]  Radha Jagadeesan,et al.  Modal Transition Systems: A Foundation for Three-Valued Program Analysis , 2001, ESOP.

[27]  Kim G. Larsen,et al.  Modal Specifications , 1989, Automatic Verification Methods for Finite State Systems.

[28]  David A. Schmidt,et al.  Denotationaisemantics: a methodology for language development , 1986 .

[29]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[30]  J. Y. Girard,et al.  Interpretation fonctionelle et elimination des coupures dans l'aritmetique d'ordre superieur , 1972 .

[31]  Olaf Owe,et al.  Partial logics reconsidered: A conservative approach , 1993, Formal Aspects of Computing.

[32]  Marko C. J. D. van Eekelen,et al.  Theorem Proving for Functional Programmers , 2001, IFL.

[33]  John C. Reynolds,et al.  Towards a theory of type structure , 1974, Symposium on Programming.

[34]  Andrzej Tarlecki,et al.  A three-valued logic for software specification and validation , 1988, Fundam. Informaticae.

[35]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[36]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[37]  Peter Buneman,et al.  A study of semantics, types and languages for databases and object-oriented programming , 1989 .

[38]  Michael Barr,et al.  Category theory for computing science (2. ed.) , 1995, Prentice Hall international series in computer science.