paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Shoggoth: A Formal Foundation for Strategic Rewriting

Shoggoth:策略重写的形式化基础
POPL 8(POPL)2024匹配度 3/10 · 论文属于程序语言与形式方法中的策略重写语义、最弱前置条件演算和 Isabelle/HOL 机化验证,偏纯形式化与定理证明;未涉及 ML/Agentic 程序静态分析、LLM 辅助静态分析/形式验证、浮点程序分析或贝叶斯程序分析等画像核心方向,仅有非常间接的形式验证基础关联。引用 2 inbox
Xueying Qin, Liam O’Connor, Rob van Glabbeek, Peter Höfner, Ohad Kammar, Michel Steuwer
crossref: 2026-09-10

AI 速览

一句话:提出 Shoggoth,为策略重写建立指称语义与基于位置的弱前置条件演算,并在 Isabelle/HOL 中机化验证。

策略重写通过组合重写规则构造复杂策略,但其语义复杂:可能非确定、通过错误触发回溯且不终止,因此需要形式化基础来推理终止性、兼容性与后置条件。本文提出 Shoggoth 与核心语言 System S,给出其指称语义,并证明它与扩展了发散行为的大步操作语义等价。在此基础上定义基于位置的弱前置条件演算,证明其相对指称语义的可靠性,并展示如何推理策略的终止、良好组合及后置条件。全部语义与演算在 Isabelle/HOL 中形式化,所有证明均机器检查。

问题
策略重写的语义复杂(非确定、错误回溯、可能发散),缺乏形式化基础来推理终止性、组合兼容性与应用后性质。
方法
定义核心语言 System S 的指称语义,证明其与显式处理发散的大步操作语义等价,并提出基于位置的弱前置条件演算,证明其可靠性。
评估
在 Isabelle/HOL 中形式化语义与演算并机器检查全部证明,同时用例展示如何推理策略的终止、良好组合和后置条件。
原文摘要(Abstract)

Rewriting is a versatile and powerful technique used in many domains. Strategic rewriting allows programmers to control the application of rewrite rules by composing individual rewrite rules into complex rewrite strategies. These strategies are semantically complex, as they may be nondeterministic, they may raise errors that trigger backtracking, and they may not terminate. Given such semantic complexity, it is necessary to establish a formal understanding of rewrite strategies and to enable reasoning about them in order to answer questions like: How do we know that a rewrite strategy terminates? How do we know that a rewrite strategy does not fail because we compose two incompatible rewrites? How do we know that a desired property holds after applying a rewrite strategy? In this paper, we introduce Shoggoth: a formal foundation for understanding, analysing and reasoning about strategic rewriting that is capable of answering these questions. We provide a denotational semantics of System S, a core language for strategic rewriting, and prove its equivalence to our big-step operational semantics, which extends existing work by explicitly accounting for divergence. We further define a location-based weakest precondition calculus to enable formal reasoning about rewriting strategies, and we prove this calculus sound with respect to the denotational semantics. We show how this calculus can be used in practice to reason about properties of rewriting strategies, including termination, that they are well-composed, and that desired postconditions hold. The semantics and calculus are formalised in Isabelle/HOL and all proofs are mechanised.

链接与引用

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

BibTeX
@article{paperbot2573,
  title = {Shoggoth: A Formal Foundation for Strategic Rewriting},
  author = {Xueying Qin and Liam O’Connor and Rob van Glabbeek and Peter Höfner and Ohad Kammar and Michel Steuwer},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3633211}
}