Unifying Hybrid Types and Contracts.

Jessica Gronski, Cormac Flanagan · 2007

Contract systems and hybrid type systems provide two alternative approaches for enforcing precisely-defined interface specifications, with complementary advantages: contract systems excel at blame assignment, whereas hybrid type systems support type-based static analysis. We unify these two approaches by demonstrating that hybrid type checking is sufficiently expressive to encode higher-order contracts with proper blame assignment. In particular, a contract obligation that enforces both sides of a contract is decomposed into two type casts that each enforce one side of the contract. This expressiveness result provides several benefits, including allowing one of these casts to be lifted from variable references to variable definitions, resulting in improved contract coverage and removing the need for privileged contract obligations. 1

Read the paper · More papers on PaperTik