paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Complete the Cycle: Reachability Types with Expressive Cyclic References

闭合循环:支持表达性循环引用的可达类型
OOPSLA 9(OOPSLA2)2025匹配度 2/10 · 论文聚焦可达类型、循环引用、别名与可变状态的类型系统及机器验证,属于PL类型论方向;但未涉及用户核心关注的 PL→AI/AI→PL、浮点程序分析、贝叶斯程序分析或 LLM/Agent 交叉。引用 2 inbox
Haotian Deng, Siyuan He, Songlin Jia, Yuyan Bao, Tiark Rompf
crossref: 2026-09-10

AI 速览

一句话:扩展可达类型,引入循环引用、浅层限定符跟踪与逃逸规则,提升高阶别名与可变状态表达力并机器验证类型安全。

针对高阶程序中将别名与可变状态结合时的局部推理难题,现有所有权、线性/仿射、唯一性与词法效应跟踪等方法要么施加全局限制,要么依赖浅层语法分析。可达类型(RT)能跟踪高阶别名与分离,但存在三方面局限:禁止循环引用、需深度跟踪传递可达位置、被引用限定符不变导致引用无法逃逸分配上下文。本文扩展 RT,引入循环引用、浅层限定符跟踪以及带引用子类型的逃逸规则,并在 F<:∘ 演算中形式化,机器验证类型可靠性。案例展示不动点组合子、非干扰并行和逃逸只读引用。

问题
如何在包含别名与可变状态的高阶程序中实现精确的局部推理,并克服现有可达类型系统禁止循环引用、深度跟踪和限定符不变带来的表达力限制。
方法
在可达类型基础上引入循环引用、浅层限定符跟踪和带引用子类型的逃逸规则,并在 F<:∘ 演算中形式化,机器验证类型可靠性。
评估
通过机器化可靠性证明以及不动点组合子、非干扰并行和逃逸只读引用等案例研究评估表达力。
原文摘要(Abstract)

Local reasoning about programs that combine aliasing and mutable state is a longstanding challenge. Existing approaches – ownership systems, linear and affine types, uniqueness types, and lexical effect tracking – impose global restrictions such as uniqueness or linearity, or rely on shallow syntactic analyses. These designs fall short with higher-order functions and shared mutable state. Reachability Types (RT) track aliasing and separation in higher-order programs, ensuring runtime safety and non-interference. However, RT systems face three key limitations: (1) they prohibit cyclic references, ruling out non-terminating computations and fixed-point combinators; (2) they require deep tracking, where a qualifier must include all transitively reachable locations, reducing precision and hindering optimizations like fine-grained parallelism; and (3) referent qualifier invariance prevents referents from escaping their allocation contexts, making reference factories inexpressible. In this work, we address these limitations by extending RT with three mechanisms that enhance expressiveness. First, we introduce cyclic references, enabling recursive patterns to be encoded directly through the store. Second, we adopt shallow qualifier tracking, decoupling references from their transitively reachable values. Finally, we introduce an escaping rule with reference subtyping, allowing referent qualifiers to outlive their allocation context. These extensions are formalized in the F < : ∘ -calculus with a mechanized proof of type soundness, and case studies illustrate expressiveness through fixpoint combinators, non-interfering parallelism, and escaping read-only references.

链接与引用

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

BibTeX
@article{paperbot2996,
  title = {Complete the Cycle: Reachability Types with Expressive Cyclic References},
  author = {Haotian Deng and Siyuan He and Songlin Jia and Yuyan Bao and Tiark Rompf},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763172}
}