arXiv:2609.03998cs.PLSep 2026

Manuscript Offprint

arXiv:2609.03998

Typed Flexible-Arity Slotted E-Graphs: A Soundness Construction and an Alloy Case Study

Guanxuan Wu, Allison Sullivan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Guanxuan Wu[0009-0006-8102-7329] and Allison Sullivan[0000-0001-7400-2218]

University of Texas at Arlington, Arlington, TX 76019, USA gxw6804@mavs.uta.edu, allison.sullivan@uta.edu

Abstract. Slotted e-graphs represent open terms modulo consistent renaming, while algebraic operators benefit from canonical sequence, bag, or set children. We compose the two at a specification level: typed slot-mapped invocations inhabit operator-declared ports whose sibling quotient and recursive flattening licenses are certified separately. A generic finite quotient presentation proves exactness of its least-orbit normal form, while certified records specify effective-support kernel extraction and collision. For abstract obligation traces carrying local endpoint certificates, we prove finite-unfolding equational soundness. An Alloy case study compares seven related pipeline arms on a frozen corpus and a controlled transformation suite. Its measurements characterize bounded capability and structural consolidation; they do not establish refinement of the Java artifact or experimental replay against the formal model.

Keywords: E-graphs · Binding · AC rewriting · Alloy · Canonical intermediate representations

1 Introduction

E-graphs compactly maintain congruence among many equivalent terms and support equality saturation [11, 12, 14, 17]. Two orthogonal extensions complicate those keys: algebraic operators benefit from sequence-, bag-, or set-valued children rather than explicit associativity, commutativity, and idempotency (ACI) saturation; open terms benefit from interfaces quotiented by consistent renaming. Neither dimension alone covers the case where an algebraic container holds a typed invocation of an open e-class.

We give a proof-carrying composition. Each operator declares ports generated by One, KJK^J for K∈{Seq,Bag,Set}K \in \{\text{Seq}, \text{Bag}, \text{Set}\}, unary binding, and binder blocks. A child invocation m∗am * a embeds the exposed slots of e-class aa into its caller. The carrier determines only the certified sibling quotient; a separate, operator-and path-specific certificate licenses recursive same-head flattening. Equality-certified permutations act on exposed slots, while descriptor-certified automorphisms act locally inside a binder block. Rebuilding normalizes these actions jointly with union-find leaders in the intended design without inferring child

G. Wu and A. Sullivan

equality from parent equality. The checked trace theorem instead consumes local obligation evidence and does not verify an operational rebuild implementation.

The proposed construction is quotient-first. Leader finding may contract support through a proper embedding, so canonicalization first extracts an exact-support leader kernel and retains a source-to-kernel certificate. It then minimizes local leader and binder orbits before aggregating bags or deduplicating sets, and only afterward minimizes the finite free-slot-renaming orbit. The checked mathematical layer proves exactness for any supplied finite quotient presentation and validates supplied extraction and collision records; showing that the concrete procedure constructs those records is a separate refinement obligation. A collision may create a parent edge only when the composed certificate inhabits that edge's exact directed type.

We prove finite-unfolding soundness for abstract finite certified traces. Their nine step labels are classified as local obligation addition, rekeying, composition, or removal, each carrying the needed typed endpoint evidence. Under these premises, two certified unfoldings whose parent paths reach one leader and whose caller maps align by a recorded symmetry word are equal in every supplied model. The result establishes neither concrete transition semantics, unrestricted ACI completeness, nor refinement of the Java code.

The accompanying Alloy case study evaluates seven related pipeline arms on a frozen corpus and a targeted capability suite. It separates a targeted binder-permutation capability from whole-pipeline structural consolidation; the measurements are bounded implementation evidence, not a proof that the adapter realizes the abstract construction.

Our contributions are: (i) a typed flexible-arity port grammar for slotted invocations; (ii) a generic finite-orbit exactness theorem and certified effective-support record interfaces with explicit parent-versus-interface restriction; (iii) an abstract certificate-preserving trace contract and finite-unfolding soundness theorem; and (iv) a bounded Alloy study whose evidence boundary is stated separately from the mathematical result. Full statements and proof details appear in Appendix A.