paperbot · PL 论文追踪

全部论文 待读 收藏

P2 When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class Polymorphism

当子类型约束带来自由:面向一等多态的新颖类型推断方法
POPL 8(POPL)2024匹配度 2/10 · 该论文属于纯编程语言类型系统与类型推断理论,研究一等多态与子类型约束,不涉及用户关注的 PL→AI、AI→PL、浮点程序分析或贝叶斯程序分析。虽然属于 PL 领域,但与具体研究方向的交叉点几乎没有。引用 12 inbox
Lionel Parreaux, Aleksander Boruch-Gruszecki, Andong Fan, Chun Yin Chau
crossref: 2026-09-10

AI 速览

一句话:提出基于多界多态的子类型类型推断系统 F≤ 与算法 SuperF,显著提升一等多态的类型推断能力。

一等/非谓词二阶多态(System F)下的类型推断仍有基本问题,例如可靠地类型检查 (λx.(x 123, x True)) id。本文提出基于多界多态的方法,即带多个下界与上界的隐式多态子类型;定义声明式系统 F≤(源自 Cretin 与 Rémy 的隐式强制转换),并设计 SuperF 算法,在检查 System F 用户注解时推断多态多界 F≤ 类型。为终止推断,SuperF 采用避免递归的启发式,代价是可拒绝少量合法程序,但实践中很少触发。作者表明 SuperF 远比此前所有一等多态类型推断系统强大,显著推进了通用语言类型推断技术水平。

问题
一等/非谓词二阶多态(System F)下的类型推断长期存在基本未解问题,例如如何可靠地类型检查 (λx.(x 123, x True)) id 这类表达式。
方法
基于多界多态(带多个下界和上界的隐式多态子类型),定义声明式系统 F≤,并设计 SuperF 算法,在检查 System F 注解的同时推断多态多界 F≤ 类型;用避免递归的启发式保证终止。
评估
摘要主要通过理论构造与能力比较说明 SuperF 比已有所有一等多态类型推断系统更强大,未报告具体实验评估。
原文摘要(Abstract)

Type inference in the presence of first-class or “ impredicative ” second-order polymorphism à la System F has been an active research area for several decades, with original works dating back to the end of the 80s. Yet, until now many basic problems remain open, such as how to type check expressions like ( λ x . ( x 123 , x True ) ) id reliably. We show that a type inference approach based on multi-bounded polymorphism , a form of implicit polymorphic subtyping with multiple lower and upper bounds, can help us resolve most of these problems in a uniquely simple and regular way. We define F ≤ , a declarative type system derived from the existing theory of implicit coercions by Cretin and Rémy (LICS 2014), and we introduce SuperF, a novel algorithm to infer polymorphic multi-bounded F ≤ types while checking user type annotations written in the syntax of System F. We use a recursion-avoiding heuristic to guarantee termination of type inference at the cost of rejecting some valid programs, which thankfully rarely triggers in practice. We show that SuperF is vastly more powerful than all first-class-polymorphic type inference systems proposed so far, significantly advancing the state of the art in type inference for general-purpose programming languages.

链接与引用

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

BibTeX
@article{paperbot2611,
  title = {When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class Polymorphism},
  author = {Lionel Parreaux and Aleksander Boruch-Gruszecki and Andong Fan and Chun Yin Chau},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632890}
}