Abstract
Manifest contracts track precise properties by refining types with predicates-e.g., {x : Int |x > 0 } denotes the positive integers. Contracts and polymorphism make a natural combination: programmers can give strong contracts to abstract types, precisely stating pre- and post-conditions while hiding implementation details- for example, an abstract type of stacks might specify that the pop operation has input type {x :α Stack |not ( empty x )} . We formalize this combination by defining FH, a polymorphic calculus with manifest contracts, and establishing fundamental properties including type soundness and relational parametricity. Our development relies on a significant technical improvement over earlier presentations of contracts: instead of introducing a denotational model to break a problematic circularity between typing, subtyping, and evaluation, we develop the metatheory of contracts in a completely syntactic fashion, omitting subtyping from the core system and recovering it post facto as a derived property. © 2011 Springer-Verlag.
Author supplied keywords
Cite
CITATION STYLE
Belo, J. F., Greenberg, M., Igarashi, A., & Pierce, B. C. (2011). Polymorphic contracts. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 6602 LNCS, pp. 18–37). https://doi.org/10.1007/978-3-642-19718-5_2
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.