paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Compositional Generator Equivalence

组合式生成器等价性
ICFP 10(ICFP)2026匹配度 3/10 · 本文属于程序语言/形式语义与基于属性的测试(PBT)方向,讨论 Hedgehog 生成器的组合分布语义与等价证明;与用户核心关注的静态分析、LLM/Agentic 程序、浮点程序分析、贝叶斯程序分析及 LLM 与形式化验证交叉均无直接关联。仅在广义 PL 形式化与形式验证兴趣上有弱重叠。引用 0 inbox
Anthony Vandikas, Kiarash Sotoudeh, Marsha Chechik
crossref: 2026-09-10

AI 速览

一句话:为 Hedgehog 生成器建立形式语义,提出受限语言 Hedgehog→ 以获得可组合的分布语义,支持生成器等价证明。

属性测试依赖随机生成器与收缩来寻找反例,但生成器优化难以形式化证明,因为现有语言缺少足够粗粒度、可组合的语义。论文首先形式化 Hedgehog 的语法与语义,证明其分布语义不可组合;并进一步证明任何可靠且完备的组合语义都必等价于过细的采样语义,无法支持常规优化。为此作者基于 arrow calculus 提出受限语言 Hedgehog→,证明其具有组合式分布语义;并通过 Haskell 实现评估,表明其仍能表达实用生成器,为生成器等价证明提供形式基础。

问题
属性测试中生成器优化的形式化证明缺乏可组合、粗粒度的语义基础;Hedgehog 的分布语义非组合,且无法在保持健全完备的同时避免退化到采样语义。
方法
形式化 Hedgehog 语法与分布/采样语义,证明非组合性与不可能结果,并基于 arrow calculus 设计受限语言 Hedgehog→,给出组合式分布语义及 Haskell 实现。
评估
通过 Haskell 实现评估 Hedgehog→ 的表达力,说明它能覆盖实际关注的生成器,并支持组合式生成器等价证明。
原文摘要(Abstract)

Property-based testing (PBT) is a powerful technique for software verification that relies on random input generators and ”shrinking” processes to find and minimize counterexamples to executable specifications called properties. While optimizing these generators is crucial for testing efficiency, formally justifying such optimizations is currently difficult because existing languages lack a compositional semantics that is coarse-grained enough for high-level reasoning. In this paper, we first provide a formal account of the syntax and semantics of Hedgehog, a popular PBT framework. We demonstrate that Hedgehog’s distribution semantics — which models how users typically reason about generators — is non-compositional. Furthermore, we prove that any sound and complete compositional semantics for Hedgehog must necessarily be equivalent to its sampling semantics, which is too fine-grained to justify common program optimizations. To resolve this dilemma, we introduce Hedgehog → , a restricted version of the language based on the arrow calculus, and prove that Hedgehog → possesses a compositional distribution semantics. We evaluate Hedgehog → through a Haskell implementation and show that it remains expressive enough to capture generators of practical interest, while providing the formal foundation needed for compositional generator equivalence proofs.

链接与引用

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

BibTeX
@article{VandikasSC26,
  title = {Compositional Generator Equivalence},
  author = {Anthony Vandikas and Kiarash Sotoudeh and Marsha Chechik},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {ICFP},
  year = {2026},
  doi = {10.1145/3828695}
}