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 $\lambda_i^{\mathsf{MP}}$, a calculus that extends a iprevious calculus with disjoint intersection types, and develop its metatheory in the Coq theorem prover.


翻译:分辨率和亚型是编程语言中的两种常见机制。 分辨率被类型类或 Scala 式隐含的隐含功能用来自动合成背景型信息中的值。 亚型通常用来自动将一个值的类型转换成另一个兼容型。 到目前为止, 这两种机制已经相互独立地考虑过。 本文显示, 通过小扩展, 与交叉类型相交的亚型可以包含分辨率。 这有三个主要后果。 首先, 分辨率不需要作为一个单独的机制来实施。 其次, 分辨率和亚型之间的相互作用变得显而易见。 最后, 将分辨率整合到亚型中可以促成第一类( 隐含) 环境。 通过亚型转换恢复解析力的扩展是方略逻辑的扩展。 虽然它很容易被添加到声明性亚型中, 但需要小心保留可取的属性, 如算法子型的过渡性和变异性, 以及一致性。 要实现这些想法, 我们开发了 $\lamda_ i ⁇ maths {MP$。 $, a calculusulus 恢复了分辨率的交叉、 和交叉性。

0
下载
关闭预览

相关内容

iOS 8 提供的应用间和应用跟系统的功能交互特性。
  • Today (iOS and OS X): widgets for the Today view of Notification Center
  • Share (iOS and OS X): post content to web services or share content with others
  • Actions (iOS and OS X): app extensions to view or manipulate inside another app
  • Photo Editing (iOS): edit a photo or video in Apple's Photos app with extensions from a third-party apps
  • Finder Sync (OS X): remote file storage in the Finder with support for Finder content annotation
  • Storage Provider (iOS): an interface between files inside an app and other apps on a user's device
  • Custom Keyboard (iOS): system-wide alternative keyboards

Source: iOS 8 Extensions: Apple’s Plan for a Powerful App Ecosystem
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
计算机视觉近一年进展综述
机器学习研究会
9+阅读 · 2017年11月25日
Arxiv
0+阅读 · 2020年11月30日
Arxiv
20+阅读 · 2020年6月8日
VIP会员
相关资讯
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
计算机视觉近一年进展综述
机器学习研究会
9+阅读 · 2017年11月25日
Top
微信扫码咨询专知VIP会员