The logic of demand in Haskell

  • Authors:
  • William L. Harrison;Richard B. Kieburtz

  • Affiliations:
  • Department of Computer Science, University of Missouri, Columbia, MO, USA (email: HarrisonWL@missouri.edu);Pacific Software Research Center, OGI School of Science & Engineering, Oregon Health & Science University

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.