paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Polymorphic Type Inference for Dynamic Languages

面向动态语言的多态类型推断
POPL 8(POPL)2024匹配度 2/10 · 论文是动态语言的多态类型推断,属于纯PL类型系统理论,与用户关注的PL与LLM/Agent交叉、浮点程序分析、贝叶斯程序分析等核心方向没有直接关联;仅在静态分析/类型推断的大范畴上略有重叠。引用 12 inbox
Giuseppe Castagna, Mickaël Laurent, Kim Nguyễn
crossref: 2026-09-10

AI 速览

一句话:提出结合多态、交并类型与子类型的类型系统,并给出可靠且终止的类型重建算法,适用于动态语言。

针对动态语言中函数常表现出重载与多态行为、且缺少类型标注难以静态检查的问题,本文提出一种受控融合一阶多态、交类型、并类型与子类型的类型系统。系统通过交引入规则表达函数的重载行为,通过并消除规则实现类型收窄,并借助 Hindley–Milner 为未标注函数推断多态类型。作者证明了该类型系统的安全性,并定义了一个可靠且终止的类型重建算法。该工作使静态类型推断能够更好地刻画动态语言程序,为动态语言的类型化提供了理论候选方案。

问题
如何为缺少类型标注且函数可能具有重载、多态行为的动态语言程序进行静态类型检查与类型推断。
方法
在受控方式下结合一阶多态、交类型、并类型与子类型,利用交引入表达重载、并消除做类型收窄,并基于 Hindley–Milner 设计类型重建算法。
评估
作者以形式化证明评估系统,证明类型系统安全,并证明类型重建算法可靠且终止;摘要未报告实现或基准测试。
原文摘要(Abstract)

We present a type system that combines, in a controlled way, first-order polymorphism with intersection types, union types, and subtyping, and prove its safety. We then define a type reconstruction algorithm that is sound and terminating. This yields a system in which unannotated functions are given polymorphic types (thanks to Hindley-Milner) that can express the overloaded behavior of the functions they type (thanks to the intersection introduction rule) and that are deduced by applying advanced techniques of type narrowing (thanks to the union elimination rule). This makes the system a prime candidate to type dynamic languages.

链接与引用

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

BibTeX
@article{paperbot2596,
  title = {Polymorphic Type Inference for Dynamic Languages},
  author = {Giuseppe Castagna and Mickaël Laurent and Kim Nguyễn},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632882}
}