Blame assignment for higher-order contracts with intersection and union

Matthias Keil, Peter Thiemann
2015 Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming - ICFP 2015  
We present an untyped calculus of blame assignment for a higherorder contract system with two new operators: intersection and union. The specification of these operators is based on the corresponding type theoretic constructions. This connection makes intersection and union contracts their inevitable dynamic counterparts with a range of desirable properties and makes them suitable for subsequent integration in a gradual type system. A denotational specification provides the semantics of a
more » ... ct in terms of two sets: a set of terms satisfying the contract and a set of contexts respecting the contract. This kind of specification for contracts is novel and interesting in its own right. A nondeterministic operational semantics serves as the specification for contract monitoring and for proving its correctness. It is complemented by a deterministic semantics that is closer to an implementation and that is connected to the nondeterministic semantics by simulation. The calculus is the formal basis of TreatJS, a language embedded, higher-order contract system implemented for JavaScript.
doi:10.1145/2784731.2784737 dblp:conf/icfp/KeilT15 fatcat:itoh5srbrjb35g5vn3sg3svmjm