Skip to content
Open access

Compositional Generator Equivalence

Aug 2026 · Proc. ACM Program. Lang. · Vol 10, pp. 663 - 691 · 0 citations · 36 references
Computer Science

TL;DR

This paper provides a formal account of the syntax and semantics of Hedgehog, a popular PBT framework, and proves that Hedgehog→ possesses a compositional distribution semantics, and introduces Hedgehog→, a restricted version of the language based on the arrow calculus, and proves that Hedgehog→ possesses a compositional distribution semantics.

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.

Read PDF

Similar papers

Polymorphic coverage types ∗

A new refinement type-based verification procedure for validating the coverage provided by input test generators, based on a novel interpretation of types that embeds “ must -style” underapproximate reasoning principles as a fundamental part of the type system.

Unknown authors · 0 citations
Jul 2026

Foundational Constraint Solving for Expressive Refinement Typing

FLEX is presented, a foundational Constrained Horn Clause (CHC) solver implemented in LEAN, that reduces the trusted base to the kernel alone, and allows using LEAN's entire proof ecosystem to verify low-level systems code, via three contributions.

J. Khan, Petros Markopoulos, Nicolás Lehmann et al. · 0 citations
Open access Aug 2026

QuickChecking Convergence of Rewriting Systems (Functional Pearl)

A QuickCheck testing method based on generating and shrinking random execution traces based on checking if the first and last terms of a generated trace share the same deterministic normal form that efficiently finds counterexamples and enables fast, robust shrinking.

Koen Claessen · 0 citations
Preprint Aug 2026

How Powerful are LLMs in Generating Formal Program Specifications?

Coins is introduced, a Rocq based evaluation framework that assesses specification quality by instantiating specifications under evaluation on trusted test cases and generating concrete proof obligations, and finds that accurate specification evaluation, rather than model scaling alone, is central to understanding the...

Fan-Peng Yang, Xing Li, Shu-Ling Wang et al. · 0 citations

SymCert: Verifying SMT-Based Policy Analyses

SymCert is presented, a framework implemented in Lean for building verified SMT-based analyses of Cedar policies that provide a verified symbolic compiler and authorizer for reducing policies to SMT formulas, a hierarchy enforcer for ensuring well-formedness of counterexamples, and a counterex-ample extractor for provi...

Emina Torlak · 0 citations
2026

Certified Infinite Descent Criteria in Isabelle/HOL

A reusable, locale-based framework of sloped graphs is developed that defines Infinite Descent at an abstract level, independently of any concrete graph encoding, and formalize tool-facing sufficient criteria, prove their soundness, and certify incompleteness where appropriate via verified counterexamples.

Jamie Wright, L. Cohen, R. Rowe et al. · 1 citation

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.