paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Constraint-based type inference for FreezeML

面向 FreezeML 的基于约束的类型推断
ICFP 6(ICFP)2022匹配度 2/10 · 该论文属于程序语言理论中的类型推断与类型系统研究,与静态分析/形式化验证有间接关联,但未涉及用户核心关注的 LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析。其约束求解和终止性证明偏理论基础,缺乏工业落地或问题驱动的 benchmark 分析。引用 3 inbox
Frank Emrich, Jan Stolarek, James Cheney, Sam Lindley
crossref: 2026-09-10

AI 速览

一句话:为 FreezeML 提出基于约束的类型推断,借助新约束语言与确定性栈机求解,并证明终止性和正确性。

FreezeML 是一种支持一等多态类型推断的方法,通过项标注控制多态类型的实例化与泛化,此前仅以 Algorithm W 扩展形式给出。为融入 HM(X)、OutsideIn(X) 等现代约束式推断技术,本文首次将 FreezeML 现代化:设计一种受 Pottier/Rémy 的 HM(X) 表述启发的新约束语言,把 FreezeML 类型推断问题编码为约束。论文给出求解这些约束的确定性栈机,并证明该求解器终止且相对于类型系统正确。这为 FreezeML 扩展类型类、类型族、行多态等特性奠定基础。

问题
FreezeML 原先基于 Algorithm W,难以利用现代约束式推断框架来支持类型类、类型族、行多态等扩展。
方法
定义受 HM(X) 启发的约束语言,将 FreezeML 类型推断问题编码为约束,并给出确定性栈机来求解这些约束。
评估
通过理论证明展示求解栈机的终止性与正确性。
原文摘要(Abstract)

FreezeML is a new approach to first-class polymorphic type inference that employs term annotations to control when and how polymorphic types are instantiated and generalised. It conservatively extends Hindley-Milner type inference and was first presented as an extension to Algorithm W. More modern type inference techniques such as HM(X) and OutsideIn(X) employ constraints to support features such as type classes, type families, rows, and other extensions. We take the first step towards modernising FreezeML by presenting a constraint-based type inference algorithm. We introduce a new constraint language, inspired by the Pottier/Rémy presentation of HM(X), in order to allow FreezeML type inference problems to be expressed as constraints. We present a deterministic stack machine for solving FreezeML constraints and prove its termination and correctness.

链接与引用

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

BibTeX
@article{paperbot1490,
  title = {Constraint-based type inference for FreezeML},
  author = {Frank Emrich and Jan Stolarek and James Cheney and Sam Lindley},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {ICFP},
  year = {2022},
  doi = {10.1145/3547642}
}