paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mutually Iso-Recursive Subtyping

互递归的 iso 递归子类型
OOPSLA 7(OOPSLA2)2023匹配度 2/10 · 论文属于类型系统与子类型递归类型理论,关注 iso-recursive subtyping 与 WebAssembly 扩展,并未涉及用户当前核心方向:ML/Agentic 程序的静态分析、LLM 与静态分析/形式化验证的交叉、浮点程序分析或贝叶斯程序分析。仅在 PL 领域有较弱的背景关联。引用 7 inbox
Andreas Rossberg
crossref: 2026-09-10

AI 速览

一句话:提出带声明子类型的 iso 递归类型核心演算,无需平方级膨胀即可表达互递归与高阶/混合种类子类型,并给出可高效检查的片段。

iso 递归类型常被用作编程语言中类型递归(如类与代数数据类型)的类型论模型,比 equi 递归更简单、类型检查更廉价。但标准 iso 递归难以高效表达互递归与非一致递归:高阶编码在与子类型结合时失效,经典 Amber 规则太弱,只能退化为平方规模的编码。本文提出带声明子类型的 iso 递归类型核心演算,可无膨胀表达递归间与递归内子类型,涵盖高阶与混合种类的构造子。作者进一步刻画一个语法片段,用高阶 iso 递归类型充当守卫以阻止多余的 β 归约,实现无需深层替换的高效类型检查;该片段类似 nominal 子类型系统但无需 nominal 语义,并已成为 WebAssembly 递归类型扩展提案的基础。

问题
标准 iso 递归类型无法高效表达互递归与非一致递归;将其推广到高阶种类虽可编码二者,但与子类型结合时可行方案失效,经典 Amber 子类型规则过弱,导致编码规模平方级膨胀。
方法
提出一个带声明子类型的 iso 递归类型核心演算,支持递归间与递归内的子类型,以及高阶或混合种类构造子之间的子类型;并识别出一个以高阶 iso 递归类型作守卫、避免多余 β 归约的语法片段,使类型检查无需深层替换。
评估
摘要未报告实验评估,论文以核心演算及其高效片段的提出为主,并以该片段被用作 WebAssembly 递归类型扩展提案的基础作为实际应用佐证。
原文摘要(Abstract)

Iso-recursive types are often taken as a type-theoretic model for type recursion as present in many programming languages, e.g., classes in object-oriented languages or algebraic datatypes in functional languages. Their main advantage over an equi-recursive semantics is that they are simpler and algorithmically less expensive, which is an important consideration when the cost of type checking matters, such as for intermediate or low-level code representations, virtual machines, or runtime casts. However, a closer look reveals that iso-recursion cannot, in its standard form, efficiently express essential type system features like mutual recursion or non-uniform recursion. While it has been folklore that mutual recursion and non-uniform type parameterisation can nicely be handled by generalising to higher kinds, this encoding breaks down when combined with subtyping: the classic “Amber” rule for subtyping iso-recursive types is too weak to express mutual recursion without falling back to encodings of quadratic size.We present a foundational core calculus of iso-recursive types withdeclaredsubtyping that can express both inter- and intra-recursion subtyping without such blowup, including subtyping between constructors of higher or mixed kind. In a second step, we identify a syntactic fragment of this general calculus that allows for more efficient type checking without “deep” substitutions, by observing that higher-kinded iso-recursive types can be inserted to “guard” against unwanted β-reductions. This fragment closely resembles the structure of typical nominal subtype systems, but without requiring nominal semantics. It has been used as the basis for a proposed extension of WebAssembly with recursive types.

链接与引用

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

BibTeX
@article{paperbot1876,
  title = {Mutually Iso-Recursive Subtyping},
  author = {Andreas Rossberg},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA2},
  year = {2023},
  doi = {10.1145/3622809}
}