The interaction of contracts and laziness

  • Authors:
  • Markus Degen;Peter Thiemann;Stefan Wehr

  • Affiliations:
  • University of Freiburg, Freiburg, Germany;University of Freiburg, Freiburg, Germany;University of Freiburg, Freiburg, Germany

  • Venue:
  • PEPM '12 Proceedings of the ACM SIGPLAN 2012 workshop on Partial evaluation and program manipulation
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Contract monitoring for strict higher-order functional languages has an intuitive meaning, an established theoretical basis, and a standard implementation. For lazy functional languages, the situation is less clear-cut. There is no agreed-upon intended meaning or theory, and there are competing implementations with subtle semantic differences. This paper proposes meaning preservation and completeness as formally defined properties for evaluating implementations of contract monitoring. Both properties have simple definitions that are straightforward to check. A survey of existing implementations reveals that some are meaning preserving, some are complete, and some have neither property. The main result is that contract monitoring for lazy functional languages cannot be complete and meaning preserving at the same time, although both properties can be achieved in isolation.