Relationally-parametric polymorphic contracts

Arjun Guha*, Jacob Matthews, Robert Bruce Findler, Shriram Krishnamurthi

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contribution

30 Scopus citations

Abstract

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.

Original languageEnglish (US)
Title of host publication2007 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications, OOPSLA - 2007 Dynamic Languages Symposium, DLS
Pages29-40
Number of pages12
DOIs
StatePublished - 2007
Event2007 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications, OOPSLA - 2007 Dynamic Languages Symposium, DLS - Montreal, QC, Canada
Duration: Oct 22 2007Oct 22 2007

Publication series

NameProceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA

Other

Other2007 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications, OOPSLA - 2007 Dynamic Languages Symposium, DLS
Country/TerritoryCanada
CityMontreal, QC
Period10/22/0710/22/07

Keywords

  • Contracts
  • Parametricity
  • Polymorphism

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Relationally-parametric polymorphic contracts'. Together they form a unique fingerprint.

Cite this