True Lies: Lazy Contracts for Lazy Languages

Markus Degen, Peter Thiemann and Stefan Wehr


Contracts are a proven tool in software development. They provide specifications for operations that may be statically verified or dynamically validated by contract monitoring.

Contract monitoring for strict languages has a by now established theoretical basis. An analysis of the situation for lazy languages yields three conceivable approaches to contract monitoring, eager, semi-eager, and lazy monitoring, all of which are flawed. The first two may change program behavior, while the last two may lead to silent contract violations.

The paper analyzes causes and effects of the phenomena of contract monitoring for lazy languages.