【24h】

Refinement Types and Computational Duality

机译:优化类型和计算对偶

获取原文
获取原文并翻译 | 示例

摘要

One lesson learned painfully over the past twenty years is the perilous interaction of Curry-style typing with evaluation order and side-effects. This led eventually to the value restriction on polymorphism in ML, as well as, more recently, to similar artifacts in type systems for ML with intersection and union refinement types. For example, some of the traditional subtyping laws for unions and intersections are unsound in the presence of effects, while union-elimination requires an evaluation context restriction in addition to the value restriction on intersection-introduction.rnOur aim is to show that rather than being ad hoc artifacts, phenomena such as the value and evaluation context restrictions arise naturally in type systems for effectful languages, out of principles of duality. Beginning with a review of recent work on the Curry-Howard interpretation of focusing proofs as pattern-matching programs, we explain how to interpret intersection and union refinements on these programs, and how to logically derive the subtyping relationship via an identity coercion interpretation. The value restriction, etc., emerge out of this analysis. However, this abstract account does not immediately yield a decidable type system, essentially because the syntax is infinitary-both "infinitely wide" and "infinitely deep". We show how to mechanically construct a fini-tary syntax by applying two well-known PL techniques-pattern-compilation and defunctionalization-and conclude by giving this finitary syntax an algorithmic refinement type system. Parallel to the text, we describe an embedding in the dependently-typed functional language Agda, both for the sake of clarifying these ideas, and also because formalization was an important guide in developing them. As one example, the Agda encoding split very naturally into an intrinsic ("Church") view of well-typed programs, and an extrinsic ("Curry") view of refinement typing for those programs.
机译:在过去的二十年中,痛苦地学习到的一个教训是,咖喱式打字与评估顺序和副作用之间的危险相互作用。最终,这导致了ML中多态性的值限制,以及最近,导致具有交集和并集改进类型的ML类型系统中的类似工件。例如,在存在效果的情况下,一些传统的联合和交叉路口分型法不完善,而联合消除除了对交叉路口引入值进行限制外,还需要评估上下文限制.rn我们的目的是证明这一点,而不是特有的人工制品,诸如价值和评估上下文限制之类的现象自然而然地出于二元性原则而出现在有效语言的类型系统中。首先回顾最近关于将证明作为模式匹配程序的Curry-Howard解释的工作,然后,我们解释如何解释这些程序的交集和并集改进,以及如何通过身份强制解释从逻辑上推导子类型关系。价值限制等从此分析中得出。但是,此抽象说明不能立即产生可确定的类型系统,这主要是因为语法是无限的,包括“无限宽”和“无限深”。我们展示了如何通过应用两种众所周知的PL技术(模式编译和去功能化)来机械构造最终语法,并通过为最终语法赋予算法精炼类型系统来得出结论。与文本平行,我们描述了一种依赖类型的功能语言Agda的嵌入,这既是为了阐明这些想法,也是因为形式化是开发它们的重要指南。作为一个示例,Agda编码非常自然地拆分为类型良好的程序的内在(“ Church”)视图和这些程序的精炼类型的外在(“ Curry”)视图。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号