paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Bidirectional Higher-Rank Polymorphism with Intersection and Union Types

带有交集与并集类型的双向高阶多态
POPL 9(POPL)2025匹配度 2/10 · 论文属于纯编程语言类型系统与形式化验证方向,研究双向高阶多态、交集/并集类型推断,不涉及 LLM/Agent、机器学习系统静态分析、浮点程序分析或贝叶斯程序分析,与用户当前研究画像的核心交叉点几乎无关。引用 5 inbox
Shengyi Jiang, Chen Cui, Bruno C. d. S. Oliveira
crossref: 2026-09-10

AI 速览

一句话:提出带显式类型应用、交集与并集类型的双向高阶多态类型推断,给出可靠、完备、可判定算法并在 Coq 中形式化。

主流语言(如 TypeScript、Flow、Scala)的多态类型系统常带有交集与并集类型,并实现了双向高阶多态类型推断,但既有实现缺乏对非结构子类型以及交集、并集类型的坚实理论。本文研究带显式类型应用、交集与并集类型的双向高阶多态类型推断,揭示这些特性间的非平凡交互。作者给出双向规格的类型系统,证明其良好性质,并设计可靠、完备且可判定的推断算法,刻画出可推断的类型类。论文还探索记录类型与扩大可推断类型集合等实用变体:部分变体虽失去完备性,却提升了表达力。所有结果均在 Coq 中形式化。

问题
主流语言中的双向高阶多态类型推断在引入非结构子类型、交集与并集类型后缺乏坚实的理论基础,且这些特性的交互尚不清楚。
方法
以双向规格给出带显式类型应用、交集与并集类型的类型系统,设计可靠、完备且可判定的推断算法,并考察记录类型与扩大可推断类型集合等实用变体。
评估
通过类型系统的理论性质与可判定性证明进行评估,并在 Coq 证明助手中形式化全部结果;同时分析实用变体在表达力与完备性之间的权衡。
原文摘要(Abstract)

Modern mainstream programming languages, such as TypeScript, Flow, and Scala, have polymorphic type systems enriched with intersection and union types. These languages implement variants of bidirectional higher-rank polymorphic type inference, which was previously studied mostly in the context of functional programming. However, existing type inference implementations lack solid theoretical foundations when dealing with non-structural subtyping and intersection and union types, which were not studied before. In this paper, we study bidirectional higher-rank polymorphic type inference with explicit type applications, and intersection and union types and demonstrate that these features have non-trivial interactions. We first present a type system, described by a bidirectional specification, with good theoretical properties and a sound, complete, and decidable algorithm. This is helpful to identify a class of types that can always be inferred. We also explore variants incorporating practical features, such as handling records and inferring a larger class of types, which align better with real-world implementations. Though some variants no longer have a complete algorithm, they still enhance the expressiveness of the type system. To ensure rigor, all results are formalized in the Coq proof assistant.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{JiangCO25,
  title = {Bidirectional Higher-Rank Polymorphism with Intersection and Union Types},
  author = {Shengyi Jiang and Chen Cui and Bruno C. d. S. Oliveira},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {POPL},
  year = {2025},
  doi = {10.1145/3704907}
}