TY - GEN
T1 - Relationally-parametric polymorphic contracts
AU - Guha, Arjun
AU - Matthews, Jacob
AU - Findler, Robert Bruce
AU - Krishnamurthi, Shriram
PY - 2007
Y1 - 2007
N2 - The analogy between types and contracts raises the question of how many features of static type systems can be expressed as dynamic contracts. An important feature missing in prior work on contracts is parametricity, as represented by the polymorphic types in languages like Standard ML. We present a contract counterpart to parametricity. We explore multiple designs for such a system and present one that is simple and incurs minimal execution overhead. We show how to extend the notion of contract blame to our definition. We present a form of inference that can often save programmers from having to explicitly instantiate many parametric contracts. Finally, we present several examples that illustrate how this system mimics the feel and properties of parametric polymorphism in typed languages.
AB - The analogy between types and contracts raises the question of how many features of static type systems can be expressed as dynamic contracts. An important feature missing in prior work on contracts is parametricity, as represented by the polymorphic types in languages like Standard ML. We present a contract counterpart to parametricity. We explore multiple designs for such a system and present one that is simple and incurs minimal execution overhead. We show how to extend the notion of contract blame to our definition. We present a form of inference that can often save programmers from having to explicitly instantiate many parametric contracts. Finally, we present several examples that illustrate how this system mimics the feel and properties of parametric polymorphism in typed languages.
KW - Contracts
KW - Parametricity
KW - Polymorphism
UR - http://www.scopus.com/inward/record.url?scp=41149124483&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=41149124483&partnerID=8YFLogxK
U2 - 10.1145/1297081.1297089
DO - 10.1145/1297081.1297089
M3 - Conference contribution
AN - SCOPUS:41149124483
SN - 9781595938688
T3 - Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA
SP - 29
EP - 40
BT - 2007 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications, OOPSLA - 2007 Dynamic Languages Symposium, DLS
T2 - 2007 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications, OOPSLA - 2007 Dynamic Languages Symposium, DLS
Y2 - 22 October 2007 through 22 October 2007
ER -