当前位置: X-MOL 学术J. Funct. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
COCHIS: Stable and coherent implicits
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2019-02-08 , DOI: 10.1017/s0956796818000242
TOM SCHRIJVERS , BRUNO C.D.S. OLIVEIRA , PHILIP WADLER , KOAR MARNTIROSIAN

Implicit programming (IP) mechanisms infer values by type-directed resolution, making programs more compact and easier to read. Examples of IP mechanisms include Haskell’s type classes, Scala’s implicits, Agda’s instance arguments, Coq’s type classes and Rust’s traits. The design of IP mechanisms has led to heated debate: proponents of one school argue for the desirability of strong reasoning properties, while proponents of another school argue for the power and flexibility of local scoping or overlapping instances. The current state of affairs seems to indicate that the two goals are at odds with one another and cannot easily be reconciled. This paper presents COCHIS, the Calculus Of CoHerent ImplicitS, an improved variant of the implicit calculus that offers flexibility while preserving two key properties: coherence and stability of type substitutions. COCHIS supports polymorphism, local scoping, overlapping instances, first-class instances and higher-order rules, while remaining type-safe, coherent and stable under type substitution. We introduce a logical formulation of how to resolve implicits, which is simple but ambiguous and incoherent, and a second formulation, which is less simple but unambiguous, coherent and stable. Every resolution of the second formulation is also a resolution of the first, but not conversely. Parts of the second formulation bear a close resemblance to a standard technique for proof search called focusing. Moreover, key for its coherence is a rigorous enforcement of determinism.

中文翻译:

COCHIS:稳定和连贯的隐含

隐式编程 (IP) 机制通过类型导向的解析来推断值,从而使程序更紧凑且更易于阅读。IP 机制的示例包括 Haskell 的类型类、Scala 的隐式、Agda 的实例参数、Coq 的类型类和 Rust 的特征。IP 机制的设计引发了激烈的争论:一个学派的支持者主张强推理属性的可取性,而另一个学派的支持者则主张局部范围界定或重叠实例的力量和灵活性。目前的事态似乎表明,这两个目标相互矛盾,难以调和。本文介绍了 COCHIS,即 CoHerent ImplicitS 的微积分,它是隐式微积分的改进变体,它提供了灵活性,同时保留了两个关键属性:连贯性类型替换的稳定性. COCHIS 支持多态性、局部作用域、重叠实例、一流实例和高阶规则,同时在类型替换下保持类型安全、连贯和稳定。我们介绍了一个关于如何解决隐含的逻辑公式,它简单但模糊且不连贯,以及第二个公式,它不太简单但明确、连贯且稳定。第二个公式的每个决议也是第一个公式的决议,但不是相反。第二个公式的部分内容与称为聚焦的证明搜索的标准技术非常相似。此外,其连贯性的关键是严格执行确定性。
更新日期:2019-02-08
down
wechat
bug