paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Local Contextual Type Inference

局部上下文类型推断
POPL 10(POPL)2026匹配度 2/10 · 该论文属于纯类型系统/定理证明方向,讨论 System F 的局部类型推断与机械化形式化,未涉及 LLM/Agent、机器学习系统静态分析、浮点程序分析或贝叶斯程序分析,与研究画像的核心问题几乎无直接交集。引用 2 inbox
Xu Xue, Chen Cui, Shengyi Jiang, Bruno C. d. S. Oliveira
crossref: 2026-09-10

AI 速览

一句话:提出基于上下文类型论的局部上下文类型推断,为 System F 的 LTI 给出首个机械化形式化与算法设计。

类型推断是编程语言的关键技术,但在 System F 等丰富类型系统中,完整全局推断往往不可判定。Pierce 和 Turner 提出的局部类型推断(LTI)依赖应用局部信息,虽被广泛采用,却存在理论不完善、规格复杂且限制过多的问题。本文提出 Local Contextual Type Inference,以 contextual typing 形式化方法重新设计 LTI。作者定义 Contextual System F(F_c),支持隐式与一等多态,给出声明式类型系统,证明可靠性、完备性与可判定性,并引入 matching subtyping 连接声明式与算法推断。该工作是 LTI 的首个机械化处理,去除若干实际限制,展示 contextual typing 在设计稳健、可扩展且易实现类型推断算法方面的能力。

问题
在 System F 等丰富类型系统中,完整且全局的类型推断通常不可判定;现有局部类型推断(LTI)虽可扩展,但理论不完善、规格复杂且限制较多。
方法
提出 Local Contextual Type Inference,以 contextual typing 为基础重构 LTI,定义支持隐式与一等多态的 Contextual System F(F_c),并用声明式类型系统与 matching subtyping 连接声明式推断和算法推断。
评估
通过形式化证明评估:证明 F_c 的可靠性、完备性与可判定性,并给出首个 LTI 的机械化处理,同时展示该方法消除若干实际限制。
原文摘要(Abstract)

Type inference is essential for programming languages, yet complete and global inference quickly becomes undecidable in the presence of rich type systems like System F. Pierce and Turner proposed local type inference (LTI) as a scalable, partially annotated alternative by relying on information local to applications. While LTI has been widely adopted in practice, there are significant gaps between theory and practice, with its theory being underdeveloped and specifications for LTI being complex and restrictive. We propose Local Contextual Type Inference , a principled redesign of LTI grounded in contextual typing—a recent formalism which captures type information flow. We present Contextual System F ( F c ), a variant of System F with implicit and first-class polymorphism. We formalize F c using a declarative type system, prove soundness, completeness, and decidability, and introduce matching subtyping as a bridge between declarative and algorithmic inference. This work offers the first mechanized treatment of LTI, while at the same time removing important practical restrictions and also demonstrating the power of contextual typing in designing robust, extensible and simple to implement type inference algorithms.

链接与引用

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

BibTeX
@article{XueCJO26,
  title = {Local Contextual Type Inference},
  author = {Xu Xue and Chen Cui and Shengyi Jiang and Bruno C. d. S. Oliveira},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {POPL},
  year = {2026},
  doi = {10.1145/3776653}
}