paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Bialgebraic Reasoning on Stateful Languages

有状态语言的双代数推理
ICFP 9(ICFP)2025匹配度 2/10 · 该论文属于纯形式语义与抽象GSOS/双代数方法,研究有状态语言的操作语义和余归纳等价推理,与用户核心方向(LLM/Agent 与静态分析、浮点程序分析、贝叶斯程序分析的交叉)没有直接关联,也未涉及机器学习系统、Agentic程序或LLM工具。引用 0 inbox
Sergey Goncharov, Stefan Milius, Lutz Schröder, Stelios Tsampas, Henning Urbat
crossref: 2026-09-10

AI 速览

一句话:提出区分读者与写者的操作语义,使有状态语言可纳入抽象 GSOS 并获得余归纳等价推理。

命令式语言的程序等价推理因变量存储等状态而困难:状态增强观察能力,而等价关系必须组合,才能安全替换子程序。作者希望借助 Turi–Plotkin 的数学操作语义(抽象 GSOS)及其高阶扩展获得组合性,但以往将有状态语言纳入抽象 GSOS 的尝试均未成功。本文提出新的有状态语言操作语义,形式区分 reader(执行前期待初始存储的项)与 writer(已获得存储、正在运行的项)。该语义与抽象 GSOS 完全兼容,从而可利用既有理论开展余归纳推理。作者证明,该方法对一阶和高阶存储均能产生非平凡组合性结果,并适用于 trace、cost 和自然等价等不同粒度的程序等价。

问题
有状态命令式语言的程序等价性难以推理且需保持组合性;现有抽象 GSOS/双代数方法难以直接应用于状态。
方法
提出区分 reader 与 writer 的操作语义,使其与抽象 GSOS 兼容,并借此获得余归纳推理技术来证明组合性。
评估
在一阶与高阶存储的有状态语言上展示了非平凡组合性结果,并覆盖 trace、cost 与自然等价等不同粒度的程序等价。
原文摘要(Abstract)

Reasoning about program equivalence in imperative languages is notoriously challenging, as the presence of states (in the form of variable stores) fundamentally increases the observational power of program terms. The key desideratum for any notion of equivalence is compositionality , guaranteeing that subprograms can be safely replaced by equivalent subprograms regardless of the context. To facilitate compositionality proofs and avoid boilerplate work, one would hope to employ the abstract bialgebraic methods provided by Turi and Plotkin's powerful theory of mathematical operational semantics (a.k.a. abstract GSOS ) or its recent extension by Goncharov et al. to higher-order languages. However, multiple attempts to apply abstract GSOS to stateful languages have thus failed. We propose a novel approach to the operational semantics of stateful languages based on the formal distinction between readers (terms that expect an initial input store before being executed), and writers (running terms that have already been provided with a store). In contrast to earlier work, this style of semantics is fully compatible with abstract GSOS, and we can thus leverage the existing theory to obtain coinductive reasoning techniques. We demonstrate that our approach generates non-trivial compositionality results for stateful languages with first-order and higher-order store and that it flexibly applies to program equivalences at different levels of granularity, such as trace, cost, and natural equivalence.

链接与引用

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

BibTeX
@article{paperbot3036,
  title = {Bialgebraic Reasoning on Stateful Languages},
  author = {Sergey Goncharov and Stefan Milius and Lutz Schröder and Stelios Tsampas and Henning Urbat},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {ICFP},
  year = {2025},
  doi = {10.1145/3747513}
}