通过肯定前件的交集子类型化归结
Resolution as Intersection Subtyping via Modus Ponens
摘要:
解析和子类型化是程序设计语言中两种常见的机制。Resolution由诸如类型类或Scala风格的implant之类的功能使用,以自动从上下文类型信息合成值。子类型通常用于将值的类型自动转换为另一个兼容的类型。到目前为止,这两种机制一直被认为是相互独立的。本文表明,一个小的扩展,子类型与交叉类型可以substrate分辨率。这有三个主要后果。第一,解决不需要作为一个单独的机制来实施。其次,解析和子类型化之间的相互作用变得明显。最后,将解析集成到子类型中可以实现一流(隐式)环境。通过子类型恢复归结能力的扩展是命题逻辑的肯定前件规则。虽然它很容易添加到声明子类型中,但需要非常小心地保留所需的属性,例如算法子类型的传递性和可判定性以及一致性。为了实现这些想法,我们开发了$λ_i^{\mathsf{MP}}$,一个演算,扩展了iperrival演算与不相交的交集类型,并在Coq定理证明器中开发其元理论。
英文摘要:
Resolution and subtyping are two common mechanisms in programming languages. Resolution is used by features such as type classes or Scala-style implicits to synthesize values automatically from contextual type information. Subtyping is commonly used to automatically convert the type of a value into another compatible type. So far the two mechanisms have been considered independently of each other. This paper shows that, with a small extension, subtyping with intersection types can subsume resolution. This has three main consequences. Firstly, resolution does not need to be implemented as a separate mechanism. Secondly, the interaction between resolution and subtyping becomes apparent. Finally, the integration of resolution into subtyping enables first-class (implicit) environments. The extension that recovers the power of resolution via subtyping is the modus ponens rule of propositional logic. While it is easily added to declarative subtyping, significant care needs to be taken to retain desirable properties, such as transitivity and decidability of algorithmic subtyping, and coherence. To materialize these ideas we develop $λ_i^{\mathsf{MP}}$, a calculus that extends a iprevious calculus with disjoint intersection types, and develop its metatheory in the Coq theorem prover.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。