论文标题
分辨率作为交点通过Modus Ponens的亚型
Resolution as Intersection Subtyping via Modus Ponens
论文作者
论文摘要
分辨率和亚型是编程语言中的两种常见机制。分辨率是由类型类或Scala式式的功能使用的,即从上下文类型信息中自动合成值。亚型通常用于自动将值的类型转换为另一种兼容类型。到目前为止,这两种机制已被彼此独立地考虑。本文表明,随着较小的扩展,带有相交类型的子类型可以集成分辨率。这有三个主要后果。首先,不需要将分辨率作为单独的机制实施。其次,分辨率和亚型之间的相互作用变得显而易见。最后,将分辨率集成到亚型中可以实现一流的(隐式)环境。通过子类型恢复分辨率的扩展是命题逻辑的作案Ponens规则。虽然很容易添加到声明性的亚型中,但仍需要进行大量护理以保留理想的特性,例如算法亚型的可传递性和可决定性和连贯性。为了实现这些想法,我们开发了$λ_i^{\ mathsf {mp}} $,一种计算,它扩展了具有脱节相交类型的iprevious微积分,并在Coq定理摊子中开发其Metatheory。
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.