Relationally-parametric polymorphic contracts

Relationally-parametric polymorphic contracts
复制标题

关系参数多态合约

DOI:
--
复制
发表时间:
2007
期刊:
Dynamic Languages Symposium
影响因子:
--
通讯作者:
S. Krishnamurthi
S. Krishnamurthi
中科院分区:
--
文献类型:
--
作者:
Arjun Guha;Jacob Matthews;R. Findler;S. Krishnamurthi

文献摘要

被引文献

相似文献

类型和契约之间的类比提出了一个问题,即静态类型系统中有多少特性可以表示为动态契约。在之前的合约工作中缺少的一个重要特性是参数性,如标准ML等语言中的多态类型所表示的那样。 我们提出了一个合同对应parametricity。我们探讨了这样一个系统的多种设计,并提出了一个简单的,产生最小的执行开销。我们展示了如何将合同责任的概念扩展到我们的定义。我们提出了一种形式的推理,往往可以节省程序员从显式实例化许多参数合同。最后,我们提出了几个例子,说明这个系统是如何模仿的感觉和属性的参数多态类型化语言。
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.