paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mechanised Semantics of Multi-stage Programming

多阶段编程的机器化语义
OOPSLA 10(OOPSLA1)2026匹配度 2/10 · 该论文是纯 PL 理论工作:在 Rocq 中机器化验证多阶段编程核心演算 λ_run$ 的类型/展开可靠性与阶段区分,属于形式语义与证明工程。它与用户的核心方向(针对 ML/Agentic 程序的静态分析、LLM 改进静态分析与形式化验证、浮点与贝叶斯程序分析)几乎不交叉,既不涉及 LLM/Agent,也不涉及浮点或贝叶斯,且没有工程落地或 benchmark 视角。引用 0 inbox
Ka Wing Li, Maite Kramarz, Ningning Xie, Jeremy Yallop
crossref: 2026-09-10

AI 速览

一句话:在 Rocq 中机器化验证带效应的多阶段核心演算 λ_run$,证明类型与展开可靠性和阶段区分。

多阶段编程语言(如 MetaML)具有微妙的语义,许多常见性质在其中不再成立,且与状态、多态等语言特性的交互容易出错;随着通用语言不断引入 MSP 特性,对其设计建立可信性日益紧迫。本文受已有 MSP 系统启发,为一个同时包含编译期与运行期阶段、并带有效应的核心演算 λ_run$ 给出 Rocq(Coq)机器化形式化,覆盖其类型系统、展开(elaboration)与求值语义。作者形式化地建立了类型可靠性、展开可靠性以及阶段区分(phase distinction)等关键性质。该机器化语义旨在为其他 MSP 设计的形式研究提供基础,降低为现有语言扩展 MSP 支持的验证门槛。

问题
多阶段编程语言语义微妙、常见性质失效,且与状态、多态等特性交互危险,而通用语言正不断引入 MSP 特性,亟需对其设计建立形式保证。
方法
受现有 MSP 系统启发,设计带效应的编译期与运行期核心演算 λ_run$,并在 Rocq(Coq)中机器化其类型与求值语义。
评估
通过 Rocq 机器化证明建立类型可靠性、展开可靠性及阶段区分等关键定理,未进行实证评估。
原文摘要(Abstract)

Multi-stage programming (MSP) languages such as MetaML have subtle semantics, in which familiar properties often fail to hold and hazardous interactions with other language features such as state or polymorphism abound. The ongoing incorporation of MSP features into general purpose languages makes the need to establish confidence in their design increasingly pressing. Taking inspiration from existing MSP systems, we present a Rocq mechanisation of a core calculus for compile-time and run-time MSP with effects, λ run $ , formally establishing key properties such as type and elaboration soundness and phase distinction. We hope that our mechanised semantics will be a useful basis for formal study of other designs, easing the extension of existing languages with support for MSP.

链接与引用

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

BibTeX
@article{paperbot3821,
  title = {Mechanised Semantics of Multi-stage Programming},
  author = {Ka Wing Li and Maite Kramarz and Ningning Xie and Jeremy Yallop},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA1},
  year = {2026},
  doi = {10.1145/3798260}
}