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