paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A mechanical formalization of higher-ranked polymorphic type inference

高阶多态类型推断的机械化形式化
ICFP 3(ICFP)2019匹配度 2/10 · 论文是高阶多态类型推断的机械化形式化,属于类型系统与定理证明工程;但未涉及静态分析、ML/Agentic 程序、LLM 或浮点/贝叶斯程序分析,与用户核心交叉方向关联很弱。引用 12 inbox
Jinxu Zhao, Bruno C. d. S. Oliveira, Tom Schrijvers
crossref: 2026-09-10

AI 速览

一句话:首次在 Abella 中完整机械化高阶多态类型推断的元理论,并证明可靠、完备与可判定。

现代函数式语言(如 Haskell、OCaml)依赖复杂类型推断,但其元理论在定理证明器中的机械化工作很少,尤其缺乏对核心推断算法的完整形式化。本文在 Abella 证明助手中给出高阶多态类型推断元理论的首次完整机械化形式化。作者形式化了 Dunfield 与 Krishnaswami 的双向声明式类型系统,并设计了一个新的算法式系统;新系统采用工作列表(worklist)判定,精确刻画变量作用域,从而简化证明助手中的作用域形式化。该工作还修正了 DK 人工证明中缺失或错误的细节。最终机器验证了与 DK 相同的可靠性、完备性与可判定性,但使用了显著不同的证明与证明技术。

问题
如何为现代函数式语言所依赖的高阶多态类型推断建立完整、机器可检查的元理论,尤其是可靠、完备与可判定性证明。
方法
在 Abella 中形式化 DK 的声明式双向类型系统,并引入基于工作列表的新算法式系统,建立二者对应关系。
评估
通过 Abella 机器化证明验证类型推断的可靠、完备与可判定,并处理原人工证明中的缺失与错误。
原文摘要(Abstract)

Modern functional programming languages, such as Haskell or OCaml, use sophisticated forms of type inference. While an important topic in the Programming Languages research, there is little work on the mechanization of the metatheory of type inference in theorem provers. In particular we are unaware of any complete formalization of the type inference algorithms that are the backbone of modern functional languages. This paper presents the first full mechanical formalization of the metatheory for higher-ranked polymorphic type inference. The system that we formalize is the bidirectional type system by Dunfield and Krishnaswami (DK). The DK type system has two variants (a declarative and an algorithmic one) that have been manually proven sound , complete and decidable . We present a mechanical formalization in the Abella theorem prover of DK’s declarative type system with a novel algorithmic system. We have a few reasons to use a new algorithm. Firstly, our new algorithm employs worklist judgments , which precisely capture the scope of variables and simplify the formalization of scoping in a theorem prover. Secondly, while DK’s original formalization comes with very well-written manual proofs, there are several details missing and some incorrect proofs, which complicate the task of writing a mechanized proof. Despite the use of a different algorithm we prove the same results as DK, although with significantly different proofs and proof techniques. Since such type inference algorithms are quite subtle and have a complex metatheory, mechanical formalizations are an important advance in type-inference research.

链接与引用

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

BibTeX
@article{paperbot578,
  title = {A mechanical formalization of higher-ranked polymorphic type inference},
  author = {Jinxu Zhao and Bruno C. d. S. Oliveira and Tom Schrijvers},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {ICFP},
  year = {2019},
  doi = {10.1145/3341716}
}