paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mode Crossing

模式穿越(Mode Crossing)
ICFP 10(ICFP)2026匹配度 3/10 · 论文属于类型系统与静态分析/形式化验证方向,且具有 Rocq/Iris 形式化和工业代码库部署,符合用户对理论+工程及落地案例的部分偏好;但它不涉及 LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析,与画像核心的 PL 与 AI 交叉方向基本无关。引用 0 inbox
Benjamin Peters, Jules Jacobs, Diana Kalinichenko, Liam Stevenson, Aspen Smith, Derek Dreyer, Richard A. Eisenberg
crossref: 2026-09-10

AI 速览

一句话:提出模式穿越与模态种类,使 OxCaml 可自动强化模态类型,减少注解并保持无数据竞争。

OxCaml 通过模式(mode)扩展 OCaml 类型系统,以保证并发程序无数据竞争,但模态跟踪常会拒绝明显安全的程序,例如跨线程共享不可变数据。本文提出模式穿越(mode crossing),允许对特定类型的值自动强化模式(如从 nonportable 到 portable),显著减少模态类型注解负担。为支持抽象类型规范,作者进一步引入模态种类(modal kinds),给出其类型论刻画,将其解释为模式格上的单调函数,并扩展到递归与抽象类型。作者在 Iris 之上用 Rocq 验证该系统的可靠性。论文还设计推断过程,将种类检查与包含关系归约为专用格求解器约束,并在 OxCaml 编译器中实现、部署于大型工业代码库,展示其实用性。

问题
OxCaml 的模态跟踪虽然能防止数据竞争,却会拒绝明显安全的程序(如跨线程共享不可变数据),导致注解负担过大。
方法
提出模式穿越与模态种类,将模态种类解释为模式格上的单调函数,并用 Rocq/Iris 证明可靠性;推断上把种类检查与包含关系归约为格约束求解。
评估
在 OxCaml 编译器中实现该设计,并部署到大型工业代码库,验证其可用性并降低注解负担。
原文摘要(Abstract)

OxCaml extends the OCaml type system with support for safe low-level systems programming via modes . For example, OxCaml’s modal portability and contention axes ensure that concurrent OxCaml programs have no data races. In practice, however, modal tracking can reject programs that are obviously safe, such as when the data shared across threads is immutable. To remedy this problem, we introduce mode crossing —the ability to automatically strengthen modes ( e.g. , from nonportable to portable) for values of certain types. Mode crossing significantly reduces the annotation burden associated with modal types. To support mode crossing in the presence of abstract type specifications, we further introduce a new type system feature, modal kinds . We present a type-theoretic account of modal kinds, interpret them as monotone functions on a lattice of modes, and extend this interpretation to recursive and abstract types. We verify soundness of the modal kind system in Rocq on top of Iris. We design an inference procedure that reduces kind checking and subsumption to constraints solved by a dedicated lattice solver. Our design is implemented in the OxCaml compiler and deployed in a large industrial codebase, demonstrating practical usability.

链接与引用

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

BibTeX
@article{PetersJKSSDE26,
  title = {Mode Crossing},
  author = {Benjamin Peters and Jules Jacobs and Diana Kalinichenko and Liam Stevenson and Aspen Smith and Derek Dreyer and Richard A. Eisenberg},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {ICFP},
  year = {2026},
  doi = {10.1145/3828681}
}