paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A formal foundation for symbolic evaluation with merging

带合并的符号求值的形式化基础
POPL 6(POPL)2022匹配度 4/10 · 论文为支持状态合并的可复用符号求值器建立形式语义并在 Lean 中机械化验证,属于形式方法与程序分析/符号执行基础,与用户对理论形式化+工程实现的偏好有一定契合。但它未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,与画像中 PL↔AI 交叉的核心方向匹配有限。引用 13 inbox
Sorawee Porncharoenwase, Luke Nelson, Xi Wang, Emina Torlak
crossref: 2026-09-10

AI 速览

一句话:首次为支持状态合并的可复用符号求值器建立形式语义,并在 Lean 中机械化证明其可靠性与完备性。

可复用符号求值器是求解器辅助验证与综合工具的关键组件,但其正确性此前主要依赖测试与手工推理。本文提出首个推理此类求值器行为的形式化框架,给出融入状态合并的符号语义。该语义由 symbolic factory 参数化,面向扩展 Core Scheme 的语言,支持分支、循环和一等过程,并保证所生成符号状态的合法性以及符号求值到具体求值的可归约性。作者在 Lean 中机械化该语义,证明其相对具体语义可靠且完备;实现 Leanette 参考求值器并证明其正确,开发优化版 Rosette 4,通过求解器辅助差分测试验证,并迁移 16 个工具。结果显示 Rosette 4 性能与 Rosette 3 持平。

问题
可复用符号求值器的正确性对求解器辅助验证与综合工具至关重要,但此前缺乏形式化基础,主要依赖测试和手工推理。
方法
论文提出新的符号语义,显式建模状态合并,并以 symbolic factory 参数化以覆盖不同实现;语义面向带 assumption/assertion 的 Core Scheme,并在 Lean 中机械化,证明其相对具体语义可靠且完备,以及合法性和可归约性。
评估
作者实现 Lean 参考求值器 Leanette 并证明其正确,开发优化版 Rosette 4,通过求解器辅助差分测试对照 Leanette,并将 16 个已发表工具从 Rosette 3 迁移到 Rosette 4;结果显示性能持平。
原文摘要(Abstract)

Reusable symbolic evaluators are a key building block of solver-aided verification and synthesis tools. A reusable evaluator reduces the semantics of all paths in a program to logical constraints, and a client tool uses these constraints to formulate a satisfiability query that is discharged with SAT or SMT solvers. The correctness of the evaluator is critical to the soundness of the tool and the domain properties it aims to guarantee. Yet so far, the trust in these evaluators has been based on an ad-hoc foundation of testing and manual reasoning. This paper presents the first formal framework for reasoning about the behavior of reusable symbolic evaluators. We develop a new symbolic semantics for these evaluators that incorporates state merging. Symbolic evaluators use state merging to avoid path explosion and generate compact encodings. To accommodate a wide range of implementations, our semantics is parameterized by a symbolic factory, which abstracts away the details of merging and creation of symbolic values. The semantics targets a rich language that extends Core Scheme with assumptions and assertions, and thus supports branching, loops, and (first-class) procedures. The semantics is designed to support reusability, by guaranteeing two key properties: legality of the generated symbolic states, and the reducibility of symbolic evaluation to concrete evaluation. Legality makes it simpler for client tools to formulate queries, and reducibility enables testing of client tools on concrete inputs. We use the Lean theorem prover to mechanize our symbolic semantics, prove that it is sound and complete with respect to the concrete semantics, and prove that it guarantees legality and reducibility. To demonstrate the generality of our semantics, we develop Leanette, a reference evaluator written in Lean, and Rosette 4, an optimized evaluator written in Racket. We prove Leanette correct with respect to the semantics, and validate Rosette 4 against Leanette via solver-aided differential testing. To demonstrate the practicality of our approach, we port 16 published verification and synthesis tools from Rosette 3 to Rosette 4. Rosette 3 is an existing reusable evaluator that implements the classic merging semantics, adopted from bounded model checking. Rosette 4 replaces the semantic core of Rosette 3 but keeps its optimized symbolic factory. Our results show that Rosette 4 matches the performance of Rosette 3 across a wide range of benchmarks, while providing a cleaner interface that simplifies the implementation of client tools.

链接与引用

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

BibTeX
@article{paperbot1540,
  title = {A formal foundation for symbolic evaluation with merging},
  author = {Sorawee Porncharoenwase and Luke Nelson and Xi Wang and Emina Torlak},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {POPL},
  year = {2022},
  doi = {10.1145/3498709}
}