Manuscript Offprint
arXiv:2609.03998Typed Flexible-Arity Slotted E-Graphs: A Soundness Construction and an Alloy Case Study
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, for , unary binding, and binder blocks. A child invocation embeds the exposed slots of e-class 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.
A parent e-node therefore represents both and while sharing their common subterms.
Ordinary positional nodes do not internalize ACI: explicit bidirectional rules may materialize many parenthesizations and permutations. Rewriting modulo AC and canonized completion provides the established basis for flat bags and sets [3, 6]. Here we combine these techniques with typed open-term interfaces.
Thus, an e-graph represents a family of known-equivalent terms rather than one selected term. Its purpose is to retain alternatives while rewrites are explored, propagate equalities through congruence, and defer the choice of a representative until extraction. In this paper, it provides the shared structure on which flexible-arity operators and typed slot renamings are combined. Various existing works has encoded flattening of variadic operators and variable bindings in e-graphs and general programming languages that extends naturally with implementations of equality saturation. Egglog supports typed container values in a relational fixpoint system [18, 19]; E-graphs Modulo Theories supplies a general interface to theory-specific canonical domains [20]. Lifting E-Graphs represents open terms as functions over interfaces [21], while Categorical E-Graphs treats binding through hierarchical hypergraphs [15]. Slotted E-Graphs instead expose a finite slot interface for each class and represent an occurrence as , where maps into the caller [13]. Shapes quotient concrete slot names; separately justified groups record symmetries, and a coordinate may be removed only after independence is proved. De Bruijn indices normalize ordinary alpha-renaming but do not express side-conditioned permutations of declaration blocks [1, 9].
Our scope is the following composition: operator-declared Seq/Bag/Set ports contain typed slot-mapped invocations, and their keys are rebuilt jointly with leaders, invocation embeddings, certified slot symmetries, and binder-block automorphisms. Flat construction opens only visible applications of the same type-instantiated operator; it never unfolds an opaque invocation. A carrier annotation contributes no semantic equation without its endpoint-indexed certificate.
Alloy, a formal language expressing first-order temporal logic with a particular type system based on declared sets, is the evaluation target [4, 16]. In that study, “canonical” means canonical under the implementation’s stored keys and declared rewrite vocabulary; the checked normal-form result is instead generic over a supplied finite presentation. Neither layer claims semantic completeness, unrestricted saturation termination, parser correctness, Java refinement, or experimental replay.
3 Typed Flexible-Arity Slotted E-Graphs
We fix one typed source signature and semantic profile. Every quotient, flattening law, binder automorphism, and graph equality used below carries an endpoint-indexed certificate; annotations alone introduce no equation.
3.1 Typed contexts, embeddings, and ports
The familiar cost of materializing AC closure motivates a flat carrier.
G. Wu and A. Sullivan
Lemma 1 (Size of a Complete Binary AC Closure). Represent a product class in the free commutative semigroup by a nonempty square-free subset of generators, and a binary operator node by an ordered pair of disjoint nonempty subsets. For every , these two finite types have constructive codings of sizes and , respectively. Their counting functions are and .
Proof. See Appendix A.2.
For a carrier , let
Here bag cardinality counts occurrences, , and ; write , , and for , . Sequences observe order and multiplicity, bags quotient order, and sets quotient order and duplication.
Definition 1. Fix an injective rank rank : ; types may, for example, be generated by
A finite typed context is a finite list of coordinate types; positions are distinct slots even when their types agree. Its canonical context Can( ) is the stable rank-sorted list. It preserves every type-fibre cardinality and names each sorted coordinate by , where i is below that fibre's cardinality. Bound coordinates are represented separately by a typed de Bruijn scope.
Definition 2. For finite typed contexts , a typed slot embedding is a type-preserving injection,
A typed slot renaming is an embedding equipped with a typed inverse and both inverse laws. Write for these proof-relevant isomorphisms; a typed permutation is an element of .
An e-class identifier has interface . Its invocation in caller context is with and output ; abbreviates . The star is a constructor, not a map action.
Proposition 1. For finite typed contexts , the identity is injective and composition preserves typed embeddings:
For , its stored typed inverse lies in and .
Proof. Directly from injection, surjection, and type preservation; see Appendix A.2.
Each binder descriptor has a finite typed context , domain, multiplicity, disjointness, and dependency data, and a certified subgroup . An occurrence in is with and ; write for all such occurrences.
Definition 3. A schema is generated by , an arity-licensed tagged Seq/Bag/Set container, , or . A checked port value is indexed by its free context, typed de Bruijn bound scope, and schema. Its atoms are typed free coordinates, typed bound indices, or invocations . A container stores a length-indexed occurrence vector and a proof that its length is admitted. Unary and block binders extend the bound-type list by one type or by the descriptor's type list. Bag/set quotient behavior is not definitional syntax equality: the extensional finite-bag and finite-set carriers above are separate mathematical definitions, and their matching rules enter the structural relation below.
For every container-valued port path of an exact operator instance , the signature records . A Seq, Bag, or Set port respectively requires , , or . Set arities and explicitly flat arities satisfy
The separate license Flat is admitted only for a sole root container whose element and result types agree, and requires ; if , it also requires a source unit and . Thus a carrier never licenses flattening by itself.
Let be an independently fixed typed source proof theory for the profile. For and fixed outside arguments, write for the declared source realizer. The labels denote families of inhabitants of EqCert with the following endpoints:
for every well-typed context and legal permutation, typed surjection, or splice. When , additionally certifies and deletion of an empty nested occurrence. Every concrete endpoint is checked; the label is not evidence.
Definition 4 (Typed Flexible-Arity E-Nodes). A concrete typed signature supplies class interfaces and outputs, descriptor-bound type lists, and each already-instantiated operator's input schemas and output type. A typed node in is
G. Wu and A. Sullivan
Write for all such nodes of output . Support is defined recursively by
Every acts on the free-context index of ports and nodes: , , containers act componentwise, typed de Bruijn indices are fixed, and both binder constructors recurse under their extended bound-type lists. This action chooses no fresh free coordinate.
Lemma 2 (Typed Embeddings Preserve Types). If , , and , then
In particular, .
Proof. See Appendix A.2.
Corollary 1 (Slot Support Invariance). Under the hypotheses above, slots and slots .
Proof. By the induction for Lemma 2; see Appendix A.2.
Corollary 2 (Type Safety of Invocation). If , then has type in . Moreover, , and for every , .
Proof. Immediate from the invocation constructor and action; see Appendix A.2.
3.2 Graph state and graph-relative structure
The raw typed-shape carrier is a well-typed node over a canonical finite free context. Its sequence, bag, and set tags all retain finite occurrence vectors; quotient normalization and set deduplication are separate supplied operations.
Definition 5 (Flexible Arity Typed Slotted E-Graph). A flexible-arity typed slotted e-graph environment packages a finitely encoded class carrier and:
– class outputs and interfaces, finite stored-shape domains, and typed ambient records satisfying
-
a depth-decreasing typed parent forest (roots have no parent) and a total recursive find; and
-
a collision-owner relation and per-class symmetry predicates closed under identity, inverse, and composition.
The checked depth makes find total. Representing by its membership relation, exactly when is a leader and . Thus a bucket may contain several leaders and asserts only collision candidacy; it has no owners when that set is empty.
Lemma 3 (Leaderization Contracts Support). If the stored parent path for a composes with a caller embedding , then every slot in the composite image already lies in . Thus finding a leader cannot add caller support to an invocation, although a proper parent embedding may contract that invocation's support.
Proof. See Appendix A.2.
For every Boolean value supplied by an empty-context witness, it is false that every one-slot Boolean input equals that value; thus no such value realizes the one-slot identity. In the graph contract, a proper parent embedding is not treated as a renaming or as evidence of independence. It is admissible only with the exact parent-edge equation (PC) below. Changing the stored interface is a distinct abstract rekey/restriction obligation with checked endpoint bridges; no implementation-level refactoring follows.
Definition 6 (Typed -Equivalence of Port Values). For , , and , the indexed judgement is the reflexive-symmetric-transitive closure, indexed by composition of renamings, of the following direct structural generator.
-
Slots require ; invocations require the same identifier and .
-
Sequences relate pointwise at equal length. Bags relate when a bijection between expanded occurrence tokens pairs related values, thereby preserving multiplicity. Sets relate when every element on either side has a related mate on the other.
-
A unary binder fixes the new head de Bruijn variable and acts on the outer tail by the selected typed permutation.
-
A block binder chooses a typed permutation of the descriptor prefix, certified by the signature's declared automorphism policy, and acts on the outer tail by the selected typed permutation.
Proposition 2 (Typed Alpha-Equivalence Laws). Let , , and , with and . Then
G. Wu and A. Sullivan
Consequently, the dependent-pair unindexed relation is an equivalence relation.
Proof. See Appendix A.2.
The graph-relative relation changes only the invocation clause. For appropriately typed and ,
Consistently with this boundary, every enclosing clause remains structural. There exist a Boolean child observation, a swap, a parent observation, and an input for which the parent observations agree while the corresponding child observations differ; thus parent equality alone does not imply child symmetry.
Lemma 4 (Transport of Graph-Relative Invocation Alignment). Let two invocation leaves in caller contexts be aligned under by a common found leader and a recorded leader symmetry. For and , put . Renaming both callers preserves that invocation alignment under .
Proof. See Appendix A.2.
Leader kernels. The intended producer replaces invocations by found leaders, composes parent embeddings, and reapplies only declared sibling quotients and flat smart constructors. Its checked interface is instead a supplied extraction record: an original term over , a kernel over , an inclusion , and finite replay provenance. The provenance is not part of a collision key; constructing this record from a graph remains a refinement obligation.
For quiescent , let and be values whose invocations all name leaders. Their support need only be contained in .
Lemma 5 (Identity Alignment Preserves Leader-Invocation Support). If two invocations of the same leader are identity-aligned in through an admitted leader symmetry, then for every caller slot their two image-support predicates are equivalent.
Proof. See Appendix A.2.
Quotient-first normal form. The concrete design minimizes child and block orbits before bag aggregation or set deduplication. The following claims are stated over a finite quotient presentation. A finite quotient presentation supplies a linearly ordered carrier , local generators fixed independently of normalization, a decision procedure for their reflexive-symmetric-transitive closure , an explicit finite carrier containing every value, and support, schema, leaf-type, and output observations preserved by every local generator. Define as the least member of the enumerated -orbit of . Establishing that a particular recursive program constructs such a presentation is a separate refinement obligation.
Lemma 6 (Ambient Quotient-Normal-Form Exactness). For every ,
It also preserves the recorded schema, leaf types, and output, and is idempotent: .
Proof. See Appendix A.2.
The proposed producer therefore normalizes elements before bag aggregation or set deduplication; this ordering is a design choice outside the generic finite-presentation theorem.
Canonical typed shape. An effective-support canonicalizer packages a finite structural quotient presentation, a constructive selector for its proof-relevant typed renaming witness, and node-to-kernel extraction with exact support, schema, leaf-type, and output observations. It also packages a generally non-surjective kernel-to-ambient inclusion and provenance. Its canonical shape is . The returned record keeps the typed shape witness separate from ambient transport, which is definitionally the inclusion composed with that witness and is never inverted. A concrete canonical-alphabet enumeration may instantiate this interface, but leastness of a particular witness is not part of the checked theorem.
Corollary 3 (Effective-Support Canonical-Shape Exactness). For nodes in an effective-support canonicalizer , let their kernels have contexts . Then
where is the proof-relevant generated structural derivation. Either side implies equality of the recorded node outputs. No renaming between the larger ambient input contexts is asserted.
Proof. See Appendix A.2.
G. Wu and A. Sullivan
3.3 Canonicalization and rebuilding
The checked canonicalization contract takes a finite candidate list that is extensionally complete in both directions, selects a present least candidate, and returns a record whose candidate is exactly that selection. The selected candidate is therefore complete, and only the returned shape projection is a collision key. Producing that list by recursive typed-bijection and local-orbit enumeration is a separate refinement obligation.
Let be expanded input size, kernel size, L retained provenance length, InvOcc the multiset of leader-invocation occurrences, and BlockOcc the block occurrences. To expose the sources of combinatorial work, define the reporting factor and budget
Here the executable natural-number function is zero at inputs 0 and 1. For every , it satisfies . The budget uses comparison sorting and charges map operations to encoded sizes; its intended auxiliary and returned-record budgets are and , excluding input, stored groups, and materialized replay certificates. These are accounting definitions, not proved asymptotic bounds: the Lean development contains no operational cost semantics, and no Java runtime claim is inferred from them.
The intended producer allocates , gates collision union on the two source-to-kernel certificates and a directed (PC) certificate, and treats support shrinkage as an explicit interface restriction. These are producer obligations: the trace theorem consumes only certified obligation additions, rekeys, compositions, and removals, not allocation, hashing, or a dirty-set algorithm.
Proposition 3 (Finite Rebuild Quiescence). Let a rebuild system have a natural-valued measure, a step relation, and a quiescence predicate. If every step strictly decreases the measure and every nonquiescent state admits a step, then every initial state reaches a quiescent state by a finite rebuild trace.
Proof. See Appendix A.2.
4 Certificate-Based Metatheory
The generic local-law interface declares descriptor-local automorphism tokens, but a token alone proves no equation. Its block-automorphism rule accepts an already checked certificate between the selected body endpoints and lifts that certificate under the matching binder block. Constructing such endpoints or their plug/conjugation certificate from concrete descriptor metadata is a separate refinement obligation. A TypedTermLanguage supplies its typed term family and renaming action together with primitive-equation and forward structural-congruence relations. The intended source instance may populate those relations with checked alpha, descriptor, A/C/I/U, and input-equation endpoints; the generic Lean theorems assume rather than construct that instantiation. Neither a schema annotation nor operator injectivity is assumed.
Definition 7 (Typed Equational Certificate). For , is the type of finite well-typed equational derivation trees concluding . Its constructors are reflexivity, a primitive equation, a forward structural-congruence rule, symmetry, transitivity, and transport along a typed embedding. In particular,
induces
An equality judgement asserts that this type is inhabited.
A typed model supplies value and environment families, environment restriction along embeddings, term evaluation, its transport-naturality field, and local soundness of every primitive equation and structural-congruence rule. The evaluator maps a same-context term and environment to its output value; the separate naturality field belongs to the preceding model structure. A structural realizer maps atoms, containers, unary binders, descriptor blocks, and nodes to source terms; each constructor comes with its one-step naturality equation. Local laws provide only checked atom certificates and forward congruence rules. In particular, a block automorphism is admitted through a descriptor-local certificate rule rather than by a bare permutation label. An optional admissibility family may also record its outer-context restriction law; this specification is separate from the soundness induction below.
Lemma 7 (Soundness of Typed -Equivalence Modulo Binder-Block Automorphisms). Given , , a typed model , and a proof-relevant structural alpha derivation under , every target environment satisfies
The binder-block case uses exactly the independently supplied descriptor-local rule in Q.
Proof. See Appendix A.3.
The realizer is a function on the structural syntax. Its constructor-level naturality fields are the only hypotheses needed for the following equality.
G. Wu and A. Sullivan
Lemma 8 (Naturality of Structural Realization). For every structural value and typed embedding ,
Proof. See Appendix A.3.
Lemma 9 (Soundness of Direct Node Congruence). Every proof-relevant direct structural derivation under a typed embedding whose atom steps and constructor rules carry the local certificates in yields
Applying typed-certificate soundness gives the corresponding evaluation equality in every typed model; at identity embedding this is the untransported equation.
Proof. See Appendix A.3.
Let with . A raw obligation package gives only the typed endpoints for stored cases, parent edges, and recorded symmetry generators; it contains no endpoint certificate.
Definition 8 (Coherent Equational Certificate Family). The family is coherent with an obligation package relative to when it supplies:
(EC) for every stored case of class , with stored context , stored realization , and interface inclusion , a certificate
(PC) for every parent edge , a certificate ; and (SC) for every recorded generator at , a certificate .
Identity, inverse, and composition derive (SC) for every represented word in the recorded generators.
A finite parent path contains only raw parent edges. Its embedding is their composition. A certified finite unfolding of to chooses an actual stored case , an extension with , and a finite trace from to whose leaves are primitive equations or forward structural congruence rules (with symmetry permitted).
Lemma 10 (Find and Finite Unfolding Preserve Equational Certificates). Let be a raw finite parent path from to a leader , let , and suppose is coherent. Then
Moreover, every certified finite unfolding of to yields
Proof. See Appendix A.3.
Lemma 11 (Certified Leader-Kernel Extraction). Let a certified extraction record contain an original term , an exact kernel , an inclusion , and finite provenance whose leaves are primitive equations or forward structural-congruence rules. Replaying that provenance yields
The theorem validates such a record; constructing it from a concrete graph is a refinement obligation.
Proof. See Appendix A.3.
Corollary 4 (Certified Effective-Shape Collision). Let two certified canonical records have the same output type , common canonical context , shape type , and realization real: . Record contains an extracted kernel over , a renaming , a shape , and a certified normalization from to real . If , put
Then normalization replay, the shape equality, and inverse replay produce
For any satisfying , composing with both certified extraction records also gives
Equality of output type and canonical context is a premise of this typed collision theorem, not a consequence of untagged payload equality.
Proof. See Appendix A.3.
Theorem 1 (Certificate-Preserving Reachability and Finite-Unfolding Soundness). Let a theorem state expose exactly its live EC, PC, and SC endpoint obligations. Suppose a finite proof-relevant trace starts at a state with no live obligations and ends at the package O of Definition 8. Each step is one of the following nine certified families:
-
insertion and rebuilding add obligations with local certificates;
-
canonicalization, symmetry update, and interface restriction rekey obligations using typed endpoint bridges;
-
collision, union, and path compression compose two certified obligations with typed endpoint bridges; and
-
noninferential union only removes or inherits obligations.
G. Wu and A. Sullivan
Then has a coherent equational certificate family.
Moreover, let two raw parent paths end at the same leader, let certified finite unfoldings in one caller context produce and , and let a word in the recorded symmetry generators satisfy the exact equality between the two composed caller embeddings. Then
Consequently, for every and ,
The same certificate transports to a common typed context along two equal embeddings of the caller context.
Proof. See Appendix A.3.
The nine labels above classify abstract obligation transformations, not Java transition semantics. The theorem is a conditional validation envelope: it proves neither that a concrete implementation emits the local evidence nor unrestricted symmetry, interface restriction, saturation termination, or semantic completeness.
Formalization status and trust boundary. Every retained formal environment carries a distinct correspondence tag. The target development is Lean 4 [10], pinned to version 4.33.0, under the STANDARD-LEAN-EXPLICIT-TCB profile, permitting only propext, Quot.sound, and Classical.choice and forbidding project axioms, proof placeholders, native_decide, unsafe/partial proof dependencies, FFI oracles, and unverified solver results. The complete statement index, proof dependencies, and artifact-refinement boundary are recorded in Appendix A and the packaged formal registry. Abstract-kernel closure, Java refinement, and experimental replay are reported as separate layers; none follows from proof volume or bounded tests.
5 Implementation and Evaluation
Alloy is a typed relational specification language. [4] A sig declares a set of atoms, a field declares a relation, extends declares a subsignature, dot is relational join, and all x:T | φ universally quantifies an atom of type T. Thus, u.follows.posts denotes the photos posted by users followed by u, while p in u.sees tests whether u sees p. Figure 1 compares two predicates for the same policy. Predicate left uses a nested implication; after implication elimination, its body contains two copies of p in Ad. Predicate right states directly that every seen photo is either posted by a followed user or is an ad. The implication and ACI steps are admitted only by their endpoint-indexed certificates, while the α-equivalence step maps u/user to _q0: User and p/photo to _q1: Photo through type-preserving slot maps. The disjunction port then flattens association, forgets child order, and removes the duplicate under idempotence. Both
Model context
sig User {
follows: set User,
sees: set Photo,
posts: set Photo,
suggested: set User
}
sig Influencer extends User {} sig Photo { date: one Day }
sig Ad extends Photo {} sig Day {}
LEFT
pred left {
all u: User, p: Photo |
p in u.sees implies
(p not in Ad) implies
p in u.follows.posts
or p in Ad
}
RIGHT
pred right {
all user: User, photo: Photo |
photo in user.sees implies
photo in user.follows.posts
or photo in Ad
}
Let , , and . The typed quotient context is .
Shared readable quotient
all .q0: User, .q1: Photo |
.q1 not in .q0.sees
or .q1 in .q0.follows.posts
or .q1 in Ad
Fig. 1. Schematic certificate-bound saturation of two Alloy predicates. Imp denotes certified implication elimination; admits only type-preserving binder renamings, so the User and Photo coordinates cannot be exchanged; and flattens, reorders, and deduplicates the visible disjunction children under the declared ACI certificates. The final Alloy text is a readable projection of the common canonical observation, rather than an independent authority for equality.
inputs therefore have the readable quotient shown below. This equality is relative to the declared certified rewrite theory, not to a complete decision procedure for Alloy.
We instantiate the representation with Alloy. The evaluation asks how much recorded structural variation the implemented observations consolidate, which transformation families distinguish the evaluated arms, and at what recorded cost. Throughout, canonical means canonical only under the implementation's side-conditioned rewrite vocabulary. The frozen measurements are manifest-bound observations: the current evidence does not establish that the Java adapter refines the formal construction, that the reported equalities are complete for Alloy semantics, or that the corpus has been replayed by an independently verified checker. The values below are bound to clean publication run
G. Wu and A. Sullivan
prefix df4d8d4c and source-commit prefix fbd9b149; Appendix B records the complete manifest identities and hashes.
Corpus and protocol. The classified Alloy4Fun snapshot [7, 8, 5] contains 66,080 student-oracle pairs. Removing 4,482 pairs with identical parsed Abstract Syntax Trees (ASTs) leaves 61,598 pairs: 19,212 labeled CORRECT and 42,386 labeled overconstrained, underconstrained, or both, in 181 invariant groups and 17 problem variants. Labels come from the dataset, not from a distance. The seven arms are controlled variants of the same Java pipeline, not executions of external e-graph systems. Each arm ran once in a fresh process on an AMD Ryzen 9 9950X3D with 16 workers and an 8 GiB heap cap. Appendix B records the complete arm definitions, tables, and provenance qualifications.
Observation and equality. The pipeline separates an editable repair projection from a deterministic finite-term equality observation. On all 61,598 pairs, the mean raw AST has 26.787 nodes and the Certificate-Integrated repair observation has 17.990 units. The Fast Rewrite Intermediate Representation (IR) normal form averages 18.196 units, and the Certificate-Integrated materialized canonical-representative tree averages 33.199 nodes; these view-specific sizes are not interchangeable edit budgets. Within invariant groups, 19,393 recorded truths have 4,496 distinct raw ASTs. The Certificate-Integrated arm records 2,101 distinct exact observations whose classes contain 11,382 AST-different equal pairs; Fast Rewrite records 2,136 observations and 10,934 such pairs. On the paired corpus the Certificate-Integrated arm assigns zero distance to 4,088 of 19,212 labeled-correct pairs and to none of the 42,386 inherited incorrect pairs. These are zeroes under the frozen implementation's key, not a refinement proof or an unbounded semantic soundness result.
Repair distance and coverage. For a formula , let , , and be its temporal skeleton, binding view, and normalized matrix in the repair projection. The reported specification is
The coordinates respectively use ordered dynamic programming, exact type-compatible binder-orbit matching, and carrier-specific sequence, bag-assignment, set-assignment, or direct-child comparison. Proof wrappers, certificates, rebuild metadata, and support plumbing are absent from the projection. The Certificate-Integrated paired mean is 14.022, compared with 13.943 for Fast Rewrite. Over the 42,386 incorrect predicates, their respective nearest-truth means are 11.563 and 11.451.
At inclusive radii 1, 2, 5, and 10, Certificate-Integrated IR coverage (blue) is respectively 4.0%, 10.4%, 31.0%, and 59.3%; raw-AST coverage (orange) is 8.2%, 11.7%, 23.8%, and 43.0%. Each curve uses its own edit units and independently selects the nearest AST-distinct recorded truth in the same invariant group; the vertical difference is therefore not an equal-budget improvement. Unlike mutation-based specification repair [2], this study generates or executes no repair candidates.

Fig. 2. Cumulative nearest-reference coverage for the non-CORRECT predicates. At inclusive radius , blue is the Certificate-Integrated IR observation distance and orange is raw-AST tree-edit distance to the nearest AST-distinct recorded CORRECT predicate in the same invariant group. The horizontal axis is capped at 50 while all 42,386 predicates remain in the denominator. “Repaired” in the axis label denotes only falling within this nearest-reference radius: no candidate is generated or executed, and the curves do not measure operational repair success.
Table 1. Headline manifest-bound results. Natural-corpus zeroes and wall time use 61,598 AST-different pairs; targeted recognition uses 5,500 generated, side-conditioned pairs. All distances and times are arm-specific.
| Arm | Correct | Incorrect | Wall (s) | Targeted |
|---|---|---|---|---|
| Raw + De Bruijn | 2,160 | 0 | 19.440 | 3,628/5,500 |
| Slot-shaped core | 2,159 | 0 | 19.300 | 5,500/5,500 |
| Fast Rewrite IR | 4,074 | 0 | 23.860 | 5,500/5,500 |
| Certificate-Integrated | 4,088 | 0 | 2,775.650 | 5,500/5,500 |
Ablation, capability, and cost. Table 1 retains the comparisons needed to interpret the main claims; the full seven-arm ablation and all eleven transformation rows appear in Appendix B. De Bruijn storage raises the raw arm's labeled-correct zeroes from 820 to 2,160, whereas the slot-shaped arm records 2,159. On the targeted 5,500-pair suite, however, the slot-shaped, Fast Rewrite, and Certificate-Integrated arms recognize every pair. Binder-block permutation is the discriminating family: the De Bruijn arm recognizes 22/500 and each slot-aware arm 500/500. These are in-vocabulary recognition results, not completeness or prevalence estimates.
The Certificate-Integrated arm behaves as an auditor rather than as a like-for-like canonicalizer. For each predicate it first runs Fast Rewrite IR and then reconstructs an in-process certificate-checked typed slotted graph. Each certified mutation validates exact types and slot contexts, source-occurrence and binder
G. Wu and A. Sullivan
metadata, and law authority. Insertions and rebuild steps invoke whole-state invariant checking, including certificate and provenance ledgers; congruence merges can re-dirty earlier parent records, producing a superlinear worst-case work pattern.
The path also enumerates complete bounded finite unfoldings and materializes proof-heavy construction artifacts. Several certificate families are occurrence-bound, while memoization is local to one adaptation, so these objects cannot be reused wholesale across predicates. The measured path did not retain an independent replay trace. With 16 workers, it reached 7,153.183 MiB peak used heap and 8,912.141 MiB maximum Resident Set Size (RSS). No GC-pause or object-allocation profile was collected, so the measurements do not attribute a quantified share of the slowdown to garbage collection.
Against Fast Rewrite on the same snapshot, this arm was 116.331 times slower in process wall time and used 573.666 times more engine CPU; on the targeted suite the process-wall ratio was 87.680. Its average pair-level ablation representation-unit count was slightly smaller, 29.541 versus 30.001. The observed gap is therefore consistent with this audit-heavy implementation—global validation, exact renaming and certificate work, rebuilds, and finite unfolding—rather than representation growth or a different repair objective. It is not evidence of an inherent cost of typed e-graphs or the repair metric, nor an external-system ranking.
Independent checks and limits. A separate verifier reconstructs typed judgments, graph checkpoints, canonical orbits, and finite unfoldings from closed bundles. Separately, Lean checks one fixed nontrivial abstract trace comprising AC reassociation, a bijective two-slot binder remapping, union insertion, rebuild, and congruence restoration after operand reordering: its indexed construction enforces exact adjacency, and replay under its supplied finite-set interpreter proves endpoint-denotation equality. This witness establishes neither Java producer-verifier correspondence nor coverage of other trace shapes. The corpus used in-process checks rather than complete exported-and-replayed traces. A manifest-bound bounded Alloy analysis covered the union of 4,088 current correct-pair zero-distance claim identities from the Fast Rewrite and Certificate-Integrated arms. Its supported analyses found no counterexample or solver error and rejected four deliberately invalid probes; 23 conclusive non-temporal targeted checks had no failures. Six temporal checks were inconclusive, and one raw solver counterexample arose only under a warned, unsupported static reduction and is not evidence about temporal semantics. Consequently, the evaluation supports bounded structural-consolidation and transformation-recognition observations only; Java-Lean refinement, full-trace replay, semantic completeness, industrial generalization, and causal attribution remain open.
6 Conclusion
Typed flexible-arity ports compose certified sibling quotients, separately licensed flattening, bound-name alpha-renaming, and equality-certified slot symmetry.
The checked quotient-first theorem is exact for a supplied finite quotient presentation, and certified records expose the evidence needed for effective-support extraction and collision. Abstract local obligation traces preserve a coherent witness family; two certified unfoldings reaching one leader and aligned by a recorded symmetry word are equal in every supplied typed model. Concrete construction of those records remains an implementation-refinement obligation.
The Alloy measurements isolate binder-permutation capability and whole-pipeline consolidation but do not close the implementation-refinement or experimental-replay layers. Establishing those bridges, improving finite orbit search, and calibrating structural distance against operational repair remain future work.
20 G. Wu and A. Sullivan
References
-
de Bruijn, N.G.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Mathematicae (Proceedings) 75(5), 381-392 (1972). https://doi.org/10.1016/1385-7258(72)90034-0
-
Cerqueira, J., Cunha, A., Macedo, N.: Timely specification repair for alloy 6. In: Software Engineering and Formal Methods: 20th International Conference, SEFM 2022, Berlin, Germany, September 26-30, 2022, Proceedings. p. 288-303. Springer-Verlag, Berlin, Heidelberg (2022). https://doi.org/10.1007/978-3-031-17108-6_18
-
Conchon, S., Contejean, E., Iguernelala, M.: Canonized rewriting and ground AC completion modulo Shostak theories: Design and implementation. Logical Methods in Computer Science 8(3), 16:1-16:30 (Sep 2012). https://doi.org/10.2168/LMCS-8(3:16)2012
-
Jackson, D.: Alloy: A lightweight object modelling notation. ACM Trans. Softw. Eng. Methodol. 11(2), 256-290 (apr 2002). https://doi.org/10.1145/505145.505149
-
Jovanovic, A., Sullivan, A.: Right or wrong – understanding how users write software models in alloy. In: Software Engineering and Formal Methods: 22nd International Conference, SEFM 2024, Aveiro, Portugal, November 6-8, 2024, Proceedings. p. 309-327. Springer-Verlag, Berlin, Heidelberg (2025). https://doi.org/10.1007/978-3-031-77382-2_18
-
Kapur, D.: A modular associative commutative (AC) congruence closure algorithm. In: Kobayashi, N. (ed.) 6th International Conference on Formal Structures for Computation and Deduction (FSCD 2021). Leibniz International Proceedings in Informatics (LIPIcs), vol. 195, pp. 15:1-15:21. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2021). https://doi.org/10.4230/LIPIcs.FSCD.2021.15
-
Macedo, N., Cunha, A., Paiva, A.C.R.: Alloy4Fun dataset for 2022/23. Zenodo (Jul 2023). https://doi.org/10.5281/zenodo.8123547, dataset, version EM 2022/23
-
Macedo, N., Cunha, A., Pereira, J., Carvalho, R., Silva, R., Paiva, A.C.R., Ramalho, M.S., Silva, D.: Experiences on teaching alloy with an automated assessment platform. In: Rigorous State-Based Methods: 7th International Conference, ABZ 2020, Ulm, Germany, May 27-29, 2020, Proceedings. p. 61-77. Springer-Verlag, Berlin, Heidelberg (2020). https://doi.org/10.1007/978-3-030-48077-6_5
-
Maziarz, K., Ellis, T., Lawrence, A., Fitzgibbon, A.W., Peyton Jones, S.: Hashing modulo alpha-equivalence. In: Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation. pp. 960-973. PLDI 2021, Association for Computing Machinery, New York, NY, USA (2021). https://doi.org/10.1145/3453483.3454088
-
de Moura, L., Ullrich, S.: The Lean 4 theorem prover and programming language. In: Platzer, A., Sutcliffe, G. (eds.) Automated Deduction – CADE 28. Lecture Notes in Computer Science, vol. 12699, pp. 625-635. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-79876-5_37
-
Nelson, G., Oppen, D.C.: Fast decision procedures based on congruence closure. J. ACM 27(2), 356-364 (Apr 1980). https://doi.org/10.1145/322186.322198
-
Nieuwenhuis, R., Oliveras, A.: Proof-producing congruence closure. In: Giesl, J. (ed.) Term Rewriting and Applications. Lecture Notes in Computer Science, vol. 3467, pp. 453-468. Springer, Berlin, Heidelberg (2005). https://doi.org/10.1007/978-3-540-32033-3_33
-
Schneider, R., Rossel, M., Shaikhha, A., Goens, A., Kœhler, T., Steuwer, M.: Slotted e-graphs: First-class support for (bound) variables in e-graphs. Proc. ACM Program. Lang. 9(PLDI) (Jun 2025). https://doi.org/10.1145/3729326
-
Tate, R., Stepp, M., Tatlock, Z., Lerner, S.: Equality saturation: a new approach to optimization. In: Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. p. 264–276. POPL '09, Association for Computing Machinery, New York, NY, USA (2009). https://doi.org/10.1145/1480881.1480915
-
Tiurin, A., Ghica, D.R., Hu, N.: Categorical e-graphs for lambda calculi (2026), https://arxiv.org/abs/2505.00807
-
Torlak, E., Jackson, D.: Kodkod: A relational model finder. In: Grumberg, O., Huth, M. (eds.) Proceedings of the 13th International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, vol. 4424, pp. 632–647. Springer, Berlin, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71209-1_49
-
Willsey, M., Nandi, C., Wang, Y.R., Flatt, O., Tatlock, Z., Panchekha, P.: egg: Fast and extensible equality saturation. Proc. ACM Program. Lang. 5(POPL) (Jan 2021). https://doi.org/10.1145/3434304
-
Zhang, Y., Wang, Y.R., Flatt, O., Cao, D., Zucker, P., Rosenthal, E., Tatlock, Z., Willsey, M.: Better together: Unifying datalog and equality saturation. Proc. ACM Program. Lang. 7(PLDI) (Jun 2023). https://doi.org/10.1145/3591239
-
Zhang, Y., Wang, Y.R., Flatt, O., Cao, D., Zucker, P., Rosenthal, E., Tatlock, Z., Willsey, M., egglog contributors: egglog: A fixpoint reasoning system unifying datalog and equality saturation. https://github.com/egraphs-good/egglog (2026), github repository; software artifact documenting current container structures and features
-
Zucker, P.: Omelets need onions: E-graphs modulo theories via bottom-up e-matching (2025), https://arxiv.org/abs/2504.14340
-
Zucker, P.: Lifting e-graphs: A function isn't a constant (2026), https://arxiv.org/abs/2606.22734
G. Wu and A. Sullivan
A Formal Statement Index and Proof Details
Table 2 records the complete named-unit inventory in dependency order. The main-text tags map each named unit to its Lean declaration, while the packaged ledger records the atomic units.
Table 2: Named formal units.
| ID | Kind | Paper unit |
|---|---|---|
| F01 | Lemma | Size of a Complete Binary AC Closure |
| F02 | Definition | Types, typed slots, finite contexts, and canonical context |
| F03 | Definition | Typed embeddings, renamings, and permutations |
| F04 | Proposition | Identity, composition, and inverses of typed embeddings |
| F05 | Definition | Port grammar and context-indexed port values |
| F06 | Definition | Typed flexible-arity e-nodes and structural support |
| F07 | Lemma | Typed embeddings preserve port and node types |
| F08 | Corollary | Slot support invariance under embeddings |
| F09 | Corollary | Type safety and functoriality of invocation |
| F10 | Definition | Flexible-arity typed slotted e-graph state and quiescence |
| F11 | Lemma | Leaderization contracts support |
| F12 | Definition | Indexed typed alpha-equivalence of ports |
| F13 | Proposition | Typed alpha-equivalence groupoid laws |
| F14 | Lemma | Transport of graph-relative invocation alignment |
| F15 | Lemma | Identity alignment preserves leader-invocation support |
| F16 | Lemma | Ambient quotient-normal-form exactness |
| F17 | Corollary | Effective-support canonical-shape exactness |
| F18 | Proposition | Finite rebuild quiescence |
| F19 | Definition | Typed equational certificates |
| F20 | Lemma | Semantic soundness of typed alpha-equivalence and block automorphisms |
| F21 | Lemma | Naturality of structural realization |
| F22 | Lemma | Soundness of certified direct node congruence |
| F23 | Definition | Coherent EC/PC/SC certificate family |
| F24 | Lemma | Find and finite unfolding preserve equational certificates |
| F25 | Lemma | Certified leader-kernel extraction |
| F26 | Corollary | Certified effective-shape collision |
| F27 | Theorem | Certificate-preserving reachability and finite-unfolding soundness |
A.1 Complete formal statement index
The current census contains 146 active formal units with an exact 146-ID/146-declaration source-tag bijection. Each row names one distinct Lean declaration; the suffix is the first twelve hexadecimal digits of its exact pretty-type SHA-256.
| ID | Source | Exact Lean declaration | Type hash |
|---|---|---|---|
| TSG-FND-001 | foundations.compressed.tex:11--23 | TypedSlottedEGraphsPaper.ACClosureCounts.completeBinaryACClosureCounts | 795bd01d724e |
| TSG-FND-004 | foundations.compressed.tex:26--37 | TypedSlottedEGraphsPaper.AtomicLedger.FiniteContainerCarrierDefinition | 44bb5b066665 |
| TSG-DEF-001 | foundations.compressed.tex:39--54 | TypedSlottedEGraphsPaper.FiniteTypedContext.f02CanonicalContextEncoding | 3f464a97d215 |
| TSG-DEF-002 | foundations.compressed.tex:56--68 | TypedSlottedEGraphsPaper.paperTypedEmbeddingNamingDefinition | 83798f2a89d4f |
| TSG-PROP-001 | foundations.compressed.tex:75--89 | TypedSlottedEGraphsPaper.typeEmbeddingCategoryLaws | e4334a5411bf |
| TSG-FND-006 | foundations.compressed.tex:93--100 | TypedSlottedEGraphsPaper.ClaimLedger.TSGFND006BinderDescriptorOccurrenceBundle | 5cfe108cae4c |
| TSG-DEF-003 | foundations.compressed.tex:102--116 | TypedSlottedEGraphsPaper.TypePortSchemaAndValueDefinition | 148ce2b3a63c |
| TSG-FND-007 | foundations.compressed.tex:118--124 | TypedSlottedEGraphsPaper.AtomicLedger.SignaturePathLawful | 28a73a2c7858 |
| TSG-INV-001 | foundations.compressed.tex:125--128 | TypedSlottedEGraphsPaper.AtomicLedger.SetArityDownwardClosed | b2ed25478161 |
| TSG-FND-008 | foundations.compressed.tex:133--137 | TypedSlottedEGraphsPaper.AtomicLedger.FlatLicense | b007f9c526f7 |
| TSG-INV-002 | foundations.compressed.tex:129--131 | TypedSlottedEGraphsPaper.AtomicLedger.FlatAritySliceClosed | c0ff799a70a8 |
| TSG-FND-009 | foundations.compressed.tex:139--154 | TypedSlottedEGraphsPaper.AtomicLedger.CIAEndpointCertificateFamilies | 55b00c69158b |
| TSG-FND-010 | foundations.compressed.tex:153--156 | TypedSlottedEGraphsPaper.AtomicLedger.UnitEndpointCertificateFamily | dcb836f30be2 |
| TSG-DEF-004 | foundations.compressed.tex:158--180 | TypedSlottedEGraphsPaper.TypeNodeAndSupportDefinition | 5e0b802d4f6bf |
| TSG-DEF-005 | foundations.compressed.tex:182--187 | TypedSlottedEGraphsPaper.ClaimLedger.TSGDEF005ConcreteEmbeddingActionBundle | 262c1c76f4f5 |
| TSG-LEN-002 | foundations.compressed.tex:189--203 | TypedSlottedEGraphsPaper.concreteTypedEmbeddingsPreserveTypes | 426190d09f95 |
| TSG-COR-001 | foundations.compressed.tex:206--214 | TypedSlottedEGraphsPaper.concreteSlotSupportInvariance | 78ef31ac144d |
| TSG-COR-002 | foundations.compressed.tex:218--227 | TypedSlottedEGraphsPaper.concreteTypeSafetyOfInvocation | 5bdbd9a7c6ca |
| TSG-DEF-006 | foundations.compressed.tex:233--236 | TypedSlottedEGraphsPaper.ClaimLedger.TSGDEF006TypedShapeCarrier | ec1683ef4d40 |
| TSG-DEF-007 | foundations.compressed.tex:238--259 | TypedSlottedEGraphsPaper.QuiescentFiniteTypedGraph.f10FiniteQuiescentGraphEncoding | 5de2de620b23 |
| TSG-INV-003 | foundations.compressed.tex:254--258 | TypedSlottedEGraphsPaper.QuiescentFiniteTypedGraph.F10FiniteQuiescentGraphEnvironment.collisionIndexExact | e514f4692c51 |
| TSG-LEN-003 | foundations.compressed.tex:261--268 | TypedSlottedEGraphsPaper.leaderizationContractsSupport | cc2cc05d276f |
| TSG-INV-004 | foundations.compressed.tex:274--277 | TypedSlottedEGraphsPaper.CertifiedParentEdge | 765e5870faaa |
| TSG-DEF-008 | foundations.compressed.tex:279--301 | TypedSlottedEGraphsPaper.ConcreteTypedAlphaPort | fea91969c82e |
| TSG-PROP-002 | foundations.compressed.tex:303--326 | TypedSlottedEGraphsPaper.concreteTypedAlphaFullEquivalenceLaws | 5958a456312a |
| TSG-DEF-009 | foundations.compressed.tex:329--344 | TypedSlottedEGraphsPaper.QuiescentFiniteTypedGraph.GraphStructuredAlignedBy | 354c13d071a8 |
| TSG-LEN-004 | foundations.compressed.tex:349--359 | TypedSlottedEGraphsPaper.QuiescentFiniteTypedGraph.graphInvocationAlignment.transport | ac0b3a6fc849 |
| TSG-DEF-010 | foundations.compressed.tex:362--370 | TypedSlottedEGraphsPaper.PaperCertifiedKernelExtraction | 53992cbb8aa9 |
G. Wu and A. Sullivan
| ID | Source | Exact Lean declaration | Type hash |
|---|---|---|---|
| TSG-DEF-011 | foundations.compressed.tex:372--376 | TypedSlottedEGraphsPaper.QuiescentFiniteTypedEGraph.GraphStructuredValue.LeaderNormalized | 4aa922ce77ce |
| TSG-LEN-005 | foundations.compressed.tex:378--384 | TypedSlottedEGraphsPaper.QuiescentFiniteTypedEGraph.identityAlignedLeaderSupport | bb9bf09a81e1 |
| TSG-DEF-012 | foundations.compressed.tex:387--398 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.quotientNormal | f888451b1855 |
| TSG-LEN-006 | foundations.compressed.tex:400--416 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.ambientQuotientNormalFormExactness | f38f33333b2f |
| TSG-DEF-013 | foundations.compressed.tex:423--435 | TypedSlottedEGraphsPaper.NormalizationBridge.EffectiveSupportCanonicalizer | 05215802755e |
| TSG-INV-005 | foundations.compressed.tex:424--435 | TypedSlottedEGraphsPaper.NormalizationBridge.EffectiveSupportCanonicalizer.canonicalRecordPostconditions | 19aaa59cb9f0 |
| TSG-COR-003 | foundations.compressed.tex:437--453 | TypedSlottedEGraphsPaper.NormalizationBridge.EffectiveSupportCanonicalizer.effectiveSupportCanonicalShapeExactness | ab958cad8a9b |
| TSG-ALG-002 | foundations.compressed.tex:459--465 | TypedSlottedEGraphsPaper.ClaimLedger.TSGALG002CompleteFiniteCanonicalizationContract | 4a41e4310117 |
| TSG-DEF-014 | foundations.compressed.tex:468--476 | TypedSlottedEGraphsPaper.AtomicLedger.canonicalizationWorkFactor | c973a9d006e5 |
| TSG-ALG-003 | foundations.compressed.tex:494--500 | TypedSlottedEGraphsPaper.ClaimLedger.TSGALG003CompatibilityGatedCollisionContract | 0eb77522a1bb |
| TSG-ALG-004 | foundations.compressed.tex:495--500 | TypedSlottedEGraphsPaper.ClaimLedger.TSGALG004CertificatePreservingRebuildContract | 5c31abf9c6f5 |
| TSG-PRDP-003 | foundations.compressed.tex:502--509 | TypedSlottedEGraphsPaper.finiteRebuildQuiescence | 9adf0659e20f |
| TSG-FND-011 | foundations.compressed.tex:515--521 | TypedSlottedEGraphsPaper.StructuralLocalLaws | 064d27c37de5 |
| TSG-DEF-015 | foundations.compressed.tex:522--528 | TypedSlottedEGraphsPaper.TypeTermLanguage | 2583f5ea906a |
| TSG-DEF-016 | foundations.compressed.tex:530--549 | TypedSlottedEGraphsPaper.TypeEquationalCertificate | db61c1551258 |
| TSG-DEF-017 | foundations.compressed.tex:551--570 | TypedSlottedEGraphsPaper.TypeModel | ba2e84d221d9 |
| TSG-DEF-018 | foundations.compressed.tex:555--557 | TypedSlottedEGraphsPaper.TypeModel.evaluate | 07ae0f41c162 |
| TSG-INV-006 | foundations.compressed.tex:567--570 | TypedSlottedEGraphsPaper.ClaimLedger.TSGINV006BinderAdmissibilityNaturality | 1fe931e6092a |
| TSG-INV-007 | foundations.compressed.tex:564--570 | TypedSlottedEGraphsPaper.StructuralLocalLaws.binderBlockAutomorphismCongruence | ecd61b1e3449 |
| TSG-INV-008 | foundations.compressed.tex:562--570 | TypedSlottedEGraphsPaper.StructuralRealizer.binderBlockNatural | 5f549609474b |
| TSG-DEF-019 | foundations.compressed.tex:558--566 | TypedSlottedEGraphsPaper.StructuralRealizer.binderBlock | 8c7646a8c42d |
| TSG-LEN-007 | foundations.compressed.tex:572--586 | TypedSlottedEGraphsPaper.concreteTypedAlphaSemanticSoundness | 6c17ff8fd9ce |
| TSG-DEF-020 | foundations.compressed.tex:559--566 | TypedSlottedEGraphsPaper.ConcreteStructuralRealizer | 7153d0045f2a |
| TSG-LEN-008 | foundations.compressed.tex:592--599 | TypedSlottedEGraphsPaper.StructuralRealizer.structuralRealizationNaturality | 3f2b28e01908 |
| TSG-LEN-009 | foundations.compressed.tex:602--617 | TypedSlottedEGraphsPaper.concretePortAndNodeCongruenceCertificate | 846a95264df3 |
| TSG-DEF-021 | foundations.compressed.tex:624--644 | TypedSlottedEGraphsPaper.PaperF23CoherentCertificateFamily | ddb76d9f7f35 |
| TSG-DEF-022 | foundations.compressed.tex:646--652 | TypedSlottedEGraphsPaper.PaperFiniteUnfolding | dcd440667ec1 |
| TSG-LEN-010 | foundations.compressed.tex:654--673 | TypedSlottedEGraphsPaper.paperF24FindAndFiniteUnfoldingPreserveEquationalCertificates | d606d9404214 |
| TSG-LEN-011 | foundations.compressed.tex:676--693 | TypedSlottedEGraphsPaper.paperF25CertifiedLeaderKernelExtraction | ec80838ba8b3 |
| ID | Source | Exact Lean declaration | Type hash |
|---|---|---|---|
| TSG-COR-004 | foundations.compressed.tex:696--726 | TypedSlottedEGraphsPaper.paperF26CertifiedEffectiveShapeCollision | 90ada0833065 |
| TSG-DEF-023 | foundations.compressed.tex:732--754 | TypedSlottedEGraphsPaper.LocalCertifiedTrace | 18a02a6441ea |
| TSG-THN-001 | foundations.compressed.tex:728--776 | TypedSlottedEGraphsPaper.paperF27CertificatePreservingReachabilityAndFiniteUnfoldingSoundness | 3dc00323c4bc |
| TSG-CE-001 | foundations.compressed.tex:345--347 | TypedSlottedEGraphsPaper.AtomicLedger.parentEqualityDoesNotImplyChildSymmetry | 3783cca82281 |
| TSG-CE-002 | foundations.compressed.tex:271--273 | TypedSlottedEGraphsPaper.AtomicLedger.properEmbeddingDoesNotImplyIndependence | 9c4168363f24 |
| TSG-APP-001 | appendixC.vmcai.stage1.tex:60--70 | TypedSlottedEGraphsPaper.ProfileRules.tagApp001.kernelTraceReplayContract | 94df51658734 |
| TSG-APP-002 | appendixC.vmcai.stage1.tex:109--123 | TypedSlottedEGraphsPaper.ProfileRules.tagApp002.completeCanonicalRecords | f5d828b75009 |
| TSG-APP-003 | appendixC.vmcai.stage1.tex:125--134 | TypedSlottedEGraphsPaper.ProfileRules.tagApp003.canonicalBlockCurrencyContract | 60beb0bc2c26 |
| TSG-APP-004 | appendixC.vmcai.stage1.tex:168--177 | TypedSlottedEGraphsPaper.ProfileRules.tagApp004.canonLeaderPortContract | 66bef1785cf9 |
| TSG-APP-005 | appendixC.vmcai.stage1.tex:179--188 | TypedSlottedEGraphsPaper.ClaimLedger.TSGAPP005CertifiedAbstractRebuildContract | 248773f47c77 |
| TSG-ALG-005 | appendixC.vmcai.stage1.tex:141--144 | TypedSlottedEGraphsPaper.ProfileRules.tagAlg005.leaderKernelTracePseudocodeContract | c24d01c3ea15 |
| TSG-ALG-006 | appendixC.vmcai.stage1.tex:145--151 | TypedSlottedEGraphsPaper.ClaimLedger.TSGAL006CompleteCanonPseudocodeContract | b87bd0a2e081 |
| TSG-ALG-007 | appendixC.vmcai.stage1.tex:152--154 | TypedSlottedEGraphsPaper.ProfileRules.tagAlg007.replayKernelCertificatePseudocodeContract | 9f19c91b1dc2 |
| TSG-ALG-008 | appendixC.vmcai.stage1.tex:155--157 | TypedSlottedEGraphsPaper.ProfileRules.tagAlg008.certifiedCanonWrapperPseudocodeContract | 5d8c130e9440 |
| TSG-ALG-009 | appendixC.vmcai.stage1.tex:158--167 | TypedSlottedEGraphsPaper.ProfileRules.tagAlg009.canonLeaderPortPseudocodeContract | 69a8ada16651 |
| TSG-RULE-001 | appendixC.vmcai.stage1.tex:193--203 | TypedSlottedEGraphsPaper.ProfileRules.tagRule01orderedRulePipeline | d063fc2c3c73 |
| TSG-RULE-002 | appendixC.vmcai.stage1.tex:207--238 | TypedSlottedEGraphsPaper.ProfileRules.tagRule002.parserHeadNormalization | 077d03f82f91 |
| TSG-RULE-003 | appendixC.vmcai.stage1.tex:240--252 | TypedSlottedEGraphsPaper.ProfileRules.tagRule003.parserStructuralCleanup | 7a673bf41ce |
| TSG-RULE-004 | appendixC.vmcai.stage1.tex:254--263 | TypedSlottedEGraphsPaper.ProfileRules.tagRule004.captureAvoidingLetBeta | 8d315f4673ec |
| TSG-RULE-005 | appendixC.vmcai.stage1.tex:267--285 | TypedSlottedEGraphsPaper.ProfileRules.tagRule005_branchConnectiveElimination | 65219f15ab9f |
| TSG-RULE-006 | appendixC.vmcai.stage1.tex:287--297 | TypedSlottedEGraphsPaper.ProfileRules.tagRule006_boolanNegationNormalForm | 8f4dd2687c56 |
| TSG-RULE-007 | appendixC.vmcai.stage1.tex:299--313 | TypedSlottedEGraphsPaper.ProfileRules.tagRule007_involutiveAtomicNegationDuals | eb548d29bf9e |
| TSG-RULE-008 | appendixC.vmcai.stage1.tex:317--341 | TypedSlottedEGraphsPaper.ProfileRules.tagRule008_temporalNegationDuals | 014960402835 |
| TSG-RULE-009 | appendixC.vmcai.stage1.tex:345--359 | TypedSlottedEGraphsPaper.ProfileRules.tagRule009_quantifierNegation | 2ecf182b224a |
| TSG-RULE-010 | appendixC.vmcai.stage1.tex:361--377 | TypedSlottedEGraphsPaper.ProfileRules.tagRule010_emplyAdmissibleBindings | 638504b73480 |
| TSG-RULE-011 | appendixC.vmcai.stage1.tex:379--394 | TypedSlottedEGraphsPaper.ProfileRules.tagRule011_constantBodyQuantifiers | 3d00fbb82c1a |
| TSG-RULE-012 | appendixC.vmcai.stage1.tex:396--411 | TypedSlottedEGraphsPaper.ProfileRules.tagRule012_phaseLocalPrenexandDomainGuarding | c657e0cb0168 |
| TSG-RULE-013 | appendixC.vmcai.stage1.tex:413--423 | TypedSlottedEGraphsPaper.ProfileRules.tagRule013_descriptorCertifiedBlockPermutation | 72ebc7de4519 |
| TSG-RULE-014 | appendixC.vmcai.stage1.tex:427--461 | TypedSlottedEGraphsPaper.ProfileRules.tagRule014_completeOperatorLawBoundary | 11e03531e3a8 |
| TSG-RULE-015 | appendixC.vmcai.stage1.tex:463--466 | TypedSlottedEGraphsPaper.ProfileRules.tagRule015_modularIntegerACProfile | 754fd742cfb9 |
| TSG-CE-003 | appendixC.vmcai.stage1.tex:467--471 | TypedSlottedEGraphsPaper.ProfileRules.tagCe003_overflowReassociationCounterexample | ec58334c99d6 |
| TSG-RULE-016 | appendixC.vmcai.stage1.tex:482--495 | TypedSlottedEGraphsPaper.ProfileRules.tagRule016_boolanLocalSaturation | 8bd59693c6c7 |
| TSG-RULE-017 | appendixC.vmcai.stage1.tex:497--507 | TypedSlottedEGraphsPaper.ProfileRules.tagRule017_atomicComplementSaturation | 2d8819ef30f |
| TSG-RULE-018 | appendixC.vmcai.stage1.tex:509--523 | TypedSlottedEGraphsPaper.ProfileRules.tagRule018_relationalLocalSaturation | b8494af5768f |
| TSG-RULE-019 | appendixC.vmcai.stage1.tex:525--534 | TypedSlottedEGraphsPaper.ProfileRules.tagRule019_implicationLocalSaturation | 3b1d6cc0222c |
| TSG-SCOPE-001 | appendixC.vmcai.stage1.tex:538--549 | TypedSlottedEGraphsPaper.ProfileRules.tagScope001_zeroCanonicalDistanceBoundary | 56321c485c73 |
| TSG-ATOM-001 | foundations.compressed.tex:14--22 | TypedSlottedEGraphsPaper.ACClosureCounts.completeBinaryACProductClassCount | 9c4e8409e2a3 |
| TSG-ATOM-002 | foundations.compressed.tex:15--22 | TypedSlottedEGraphsPaper.ACClosureCounts.completeBinaryACOperatorNodeCount | bc5261b762c0 |
| TSG-ATOM-003 | foundations.compressed.tex:78--84 | TypedSlottedEGraphsPaper.TypedSlotEmbedding.id | bd7a9ba9b49f |
| TSG-ATOM-004 | foundations.compressed.tex:79--84 | TypedSlottedEGraphsPaper.TypedSlotEmbedding comp | 5bb04ea2d00 |
| TSG-ATOM-005 | foundations.compressed.tex:86--88 | TypedSlottedEGraphsPaper.TypedSlotRenaming.symm | 52a0f22561b0 |
G. Wu and A. Sullivan
| ID | Source | Exact Lean declaration | Type hash |
|---|---|---|---|
| TSG-ATOM-006 | foundations.compressed.tex:192--200 | TypedSlottedEGraphsPaper.ConcretePort.act | bce8ad4b647c |
| TSG-ATOM-007 | foundations.compressed.tex:193--200 | TypedSlottedEGraphsPaper.ConcreteFlexibleArityENode.act | a14fe7cfb0f5 |
| TSG-ATOM-008 | foundations.compressed.tex:201--202 | TypedSlottedEGraphsPaper.AtomicLedger.embeddedNodeOutputTypeUnchanged | 0d403b39907b |
| TSG-ATOM-009 | foundations.compressed.tex:209--213 | TypedSlottedEGraphsPaper.concretePortSupportImageEquality | d32403a25c14 |
| TSG-ATOM-010 | foundations.compressed.tex:210--213 | TypedSlottedEGraphsPaper.concreteNodeSupportImageEquality | 28fe9aa460af |
| TSG-ATOM-011 | foundations.compressed.tex:221--222 | TypedSlottedEGraphsPaper.concreteInvocation | c67140711180 |
| TSG-ATOM-012 | foundations.compressed.tex:223--225 | TypedSlottedEGraphsPaper.concreteIdentityInvocation | 0d77a1f907a5 |
| TSG-ATOM-013 | foundations.compressed.tex:224--226 | TypedSlottedEGraphsPaper.AtomicLedger.invocationActionComposition | 4fad5b1ca3f1 |
| TSG-ATOM-014 | foundations.compressed.tex:311--313 | TypedSlottedEGraphsPaper.ConcreteAlphaPortClosure.reflexive | 6c29d9e19b0a |
| TSG-ATOM-015 | foundations.compressed.tex:314--316 | TypedSlottedEGraphsPaper.ConcreteAlphaPortClosure.symmetric | c720881db2e2 |
| TSG-ATOM-016 | foundations.compressed.tex:317--320 | TypedSlottedEGraphsPaper.ConcreteAlphaPortClosure.transitive | 2cca843ed7f6 |
| TSG-ATOM-017 | foundations.compressed.tex:322--325 | TypedSlottedEGraphsPaper.concreteInindexedAlphaPortEquivalenceLaws | d1933b38bb53 |
| TSG-ATOM-020 | foundations.compressed.tex:403--408 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.quotientNormal.sound | 10d4fd1d3a45 |
| TSG-ATOM-021 | foundations.compressed.tex:407--408 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.quotientNormal.eqiff | 51a7c606090b |
| TSG-ATOM-022 | foundations.compressed.tex:409--410 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.quotientNormal.preserves_support | 4c24e20c9fbb |
| TSG-ATOM-023 | foundations.compressed.tex:412--413 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.quotientNormal.preserves_schema_leafTypes.output | a2dc4f2bab51 |
| TSG-ATOM-025 | foundations.compressed.tex:414--415 | TypedSlottedEGraphsPaper.NormalizationBridge.AmbientQuotientPresentation.quotientNormal_idempotent | delf218161ee |
| TSG-ATOM-026 | foundations.compressed.tex:443--451 | TypedSlottedEGraphsPaper.NormalizationBridge.EffectiveSupportCanonicalizer.canonicalShape.eqiff.effectiveKernel.typedRenaming | 813374a6c2a2 |
| TSG-ATOM-027 | foundations.compressed.tex:450--452 | TypedSlottedEGraphsPaper.NormalizationBridge.EffectiveSupportCanonicalizer.canonicalShape.exactness.preserves.output | 0f5cf6810340 |
| TSG-ATOM-028 | foundations.compressed.tex:575--585 | TypedSlottedEGraphsPaper.paperatom028AlphaEquivalenceEvaluationTransport | 1e83d64819dd |
| TSG-ATOM-029 | foundations.compressed.tex:583--585 | TypedSlottedEGraphsPaper.AtomicLedger.binderBlockAutomorphismEvaluationInvariant | da7a0e330ee4 |
| TSG-ATOM-030 | foundations.compressed.tex:605--611 | TypedSlottedEGraphsPaper.paperatom030CertifiedGraphRelativeNodeEquation | c905e5886ebd |
| TSG-ATOM-031 | foundations.compressed.tex:612--616 | TypedSlottedEGraphsPaper.concretePortAndNodeCongruenceSemanticSoundness | 6bb40e903f1a |
| TSG-ATOM-032 | foundations.compressed.tex:614--616 | TypedSlottedEGraphsPaper.AtomicLedger.sameContextIdentityCongruence | 56df92f7fc62 |
| TSG-ATOM-033 | foundations.compressed.tex:657--665 | TypedSlottedEGraphsPaper.paperatom033FindWitnessCertificate | 783c4c88ad83 |
| TSG-ATOM-034 | foundations.compressed.tex:666--672 | TypedSlottedEGraphsPaper.paperatom034FiniteUnfoldingWitnessCertificate | 9b7e5fae191 |
| TSG-ATOM-037 | foundations.compressed.tex:704--714 | TypedSlottedEGraphsPaper.paperatom037EffectiveKernelCollisionCertificate | a5106c3bfac4 |
| TSG-ATOM-038 | foundations.compressed.tex:715--722 | TypedSlottedEGraphsPaper.paperatom038AmbientCollisionCertificate | 0af3c7f91853 |
| TSG-ATOM-039 | foundations.compressed.tex:731--754 | TypedSlottedEGraphsPaper.paperatom039CertifiedReachabilityPreservesCoherence | a3ef9796c90d |
| ID | Source | Exact Lean declaration | Type hash |
|---|---|---|---|
| TSG-ATOM-040 | foundations.compressed.tex:756--764 | TypedSlottedEGraphsPaper.paperAtom040FiniteUnfoldingEquationalSoundness | 17b320836b0 |
| TSG-ATOM-041 | foundations.compressed.tex:765--772 | TypedSlottedEGraphsPaper.paperAtom041FiniteUnfoldingModelSoundness | 856616c62323 |
| TSG-ATOM-042 | foundations.compressed.tex:773--775 | TypedSlottedEGraphsPaper.paperAtom042CommonContextWeakenedFiniteUnfoldingSoundness | f6a4fd99c1ba |
| TSG-STEP-001 | foundations.compressed.tex:738--740 | TypedSlottedEGraphsPaper.LocalCertifiedStep.insertion | bfd820ad107d |
| TSG-STEP-002 | foundations.compressed.tex:741--745 | TypedSlottedEGraphsPaper.LocalCertifiedStep.canonicalization | 0ee77c88b334 |
| TSG-STEP-003 | foundations.compressed.tex:746--750 | TypedSlottedEGraphsPaper.LocalCertifiedStep.collision | abcfe91d2ef1 |
| TSG-STEP-004 | foundations.compressed.tex:747--750 | TypedSlottedEGraphsPaper.LocalCertifiedStep.union | c191cb7e25d4 |
| TSG-STEP-005 | foundations.compressed.tex:742--745 | TypedSlottedEGraphsPaper.LocalCertifiedStep.symmetry | ff3b39ec1759 |
| TSG-STEP-006 | foundations.compressed.tex:743--745 | TypedSlottedEGraphsPaper.LocalCertifiedStep.interfaceRestriction | d3620a48123a |
| TSG-STEP-007 | foundations.compressed.tex:751--752 | TypedSlottedEGraphsPaper.LocalCertifiedStep.noninferentialUnion | 4b5fda7ef12d |
| TSG-STEP-008 | foundations.compressed.tex:739--740 | TypedSlottedEGraphsPaper.LocalCertifiedStep.rebuild | a822d1d13b2f |
| TSG-STEP-009 | foundations.compressed.tex:748--750 | TypedSlottedEGraphsPaper.LocalCertifiedStep.pathCompression | 7527099aa538 |
| TSG-ATOM-043 | foundations.compressed.tex:19--22 | TypedSlottedEGraphsPaper.ACClosureCounts.productClassCountThetaTwoPow | 0eb32dc881ce |
| TSG-ATOM-044 | foundations.compressed.tex:20--22 | TypedSlottedEGraphsPaper.ACClosureCounts.binaryOperatorModeCountThetaThreePow | 9661da711df8 |
| TSG-ACC-001 | foundations.compressed.tex:477--484 | TypedSlottedEGraphsPaper.ClaimLedger.ceilLog2 | fe78ff56c51f |
| TSG-ACC-002 | foundations.compressed.tex:467--480 | TypedSlottedEGraphsPaper.ClaimLedger.structuralComputationBudget | c7b38868a328 |
| TSG-ACC-003 | foundations.compressed.tex:485--489 | TypedSlottedEGraphsPaper.ClaimLedger.auxiliaryKernelWorkspaceBudget | c8cbef7f88d57 |
| TSG-ACC-004 | foundations.compressed.tex:486--489 | TypedSlottedEGraphsPaper.ClaimLedger.returnedStructuralRecordBudget | da55c79eafe7f |
| TSG-ATOM-045 | foundations.compressed.tex:641--643 | TypedSlottedEGraphsPaper.paperF235symmetryWordCertificate | b8b860bfea8f |
A.2 Structural proofs
F01: complete binary AC closure. For distinct generators in the free commutative semigroup, with no unit or additional equations, every nonempty subset appears as a subproduct in some permutation and parenthesisization, yielding product classes. A binary node is indexed by an ordered pair of nonempty disjoint subsets . Giving each generator one of the states “left,” “right,” or “absent” and excluding an empty side yields nodes. The compiled Lean declaration constructs bijections to both finite cardinalities from binary and ternary assignment encodings and proves the two stated natural-number growth relations. This is a combinatorial encoding theorem, not a claim about an operational e-graph saturation procedure.
F04: embedding laws. The identity is injective and type preserving; a composite of injective, type-preserving maps has both properties. For a proof-relevant typed
G. Wu and A. Sullivan
renaming, the stored inverse laws give directly. No finite-cardinality or surjective-injection argument is used.
F07–F09: typing and support. The concrete action is defined recursively on ports, heterogeneous argument lists, and nodes. Because schema, bound-scope, and output type are indices, applying the action immediately supplies inhabitants at the same schema and output indices; the node-output equality is reflexivity. The recursive support calculation proves, for every target slot, that support after action is exactly the direct image of support before action. Function extensionality and propositional extensionality turn those pointwise facts into the two predicate equalities for ports and nodes. Bound indices are carried by a separate de Bruijn scope; this theorem introduces no fresh free coordinate. F09 unfolds the concrete invocation constructor. Its result schema contains the class output by construction, the bare occurrence is definitionally the identity-embedded invocation, and ambient action definitionally composes the outer and inner embeddings.
F11: leader support. The compiled statement is the range inclusion for two typed embeddings. If for caller map and parent-path embedding , choose as the witness that . The conclusion is only invocation-image containment: it neither lifts the result to arbitrary ports or nodes nor proves independence from a missing coordinate.
F13: alpha groupoid laws. The public indexed judgement is the reflexive-symmetric-transitive closure of the concrete direct structural generators. Identity, inverse, and composition are therefore respectively its reflexive, symmetric, and transitive constructors; the composite renaming is retained in the transitive index. The unindexed carrier is the dependent sum of a context and a port value, and its relation existentially retains the typed renaming, so the same three constructors prove equivalence. The container and binder clauses belong to the direct generator; F13 does not independently prove them closed under inversion.
F14: graph-relative transport. Unpack the invocation alignment into its two checked parent paths, common leader, admitted symmetry, and embedding equation. From obtain, after independently renaming the callers,
The stored inverse law cancels . This is an invocation-level transport theorem; it asserts no recursive container or binder transport.
F15: identity-aligned support. For leader invocations the identity-alignment equation reduces to for an admitted typed permutation . The forward image direction applies to the leader-slot witness; the reverse direction applies its stored inverse. The statement is exactly pointwise equivalence of the two invocation-image predicates, not a structural-support theorem for containers or binders.
F16: quotient-normal-form exactness. An AmbientQuotientPresentation supplies a complete finite carrier, fixed local generators, their observation laws, and a linear order. The finite-presentation lemmas show that the least enumerated orbit member is related to its input and that two such least members are equal exactly when the inputs are in the generated relation. Generator invariance yields preservation of support, schema, leaf types, and output; exactness applied to the normal form yields idempotence. This proof is generic over the carrier and does not verify a recursive port/node normalization program.
F17: shape exactness. An EffectiveSupportCanonicalizer first extracts each exact kernel and then applies its structural quotient presentation. F16's exactness and the bridge from the unindexed generated relation to its proof-relevant typed derivation give
The quotient observation law and the two kernel-output equations give output equality in either direction. The theorem constructs neither an ambient input-context renaming nor a least renaming witness.
F18: rebuild quiescence. The compiled statement takes an explicit rebuild-step relation, a quiescence predicate, progress from every nonquiescent state, and a natural-valued strict decrease witness. Lean embeds the step relation into strict order on that natural measure, obtains well-foundedness, and uses well-founded induction. At a nonquiescent state, progress supplies a decreasing successor; at a quiescent state, the reflexive trace closes the proof. No particular graph worklist or lexicographic implementation measure is part of F18.
A.3 Certificate and semantic proofs
F20: semantic alpha-soundness. First induct on the concrete alpha-closure derivation. A direct generator is converted to an equational certificate by the supplied ConcreteStructuralLaws; reflexivity uses rename-identity, symmetry transports the recursively obtained certificate along the inverse renaming, and transitivity transports and composes certificates using rename composition. Typed-certificate semantic soundness then gives the displayed equality for every target environment. A descriptor automorphism is usable only through the policy and local certificate laws supplied to this proof; no consumer-invariance theorem is inferred from a permutation label.
F21: realization naturality. The mutual structural recursion covers complete values and their child forests. Each atom, container, unary binder, binder block, and node case rewrites with the corresponding constructor-level naturality field of the realizer; the forest cases reduce to list-map composition. This proves the syntactic equality and uses neither fresh-name choice nor sibling/flat equational laws.
G. Wu and A. Sullivan
F22: certified congruence. The concrete node-alignment structure carries a certified concrete leaf at every atom step; each leaf contains exactly the required endpoint certificate. Recursive port/argument certificate soundness combines those leaves with the supplied one-constructor laws, and node congruence closes the outer node. The model result is obtained by applying typed-certificate semantic soundness. Thus F22 assumes the licensed local constructor rules and per-leaf certificates; it does not manufacture them from graph metadata.
F23: coherent certificate family. The raw graph-obligation structure contains only stored-case realizations and inclusions, parent-edge embeddings, and symmetry-generator renamings. F23 is the proposition that every obligation in each of those three endpoint families has, respectively, an (EC), (PC), or (SC) certificate. It is a coherence specification, not an existence theorem; F27 derives an inhabitant for the final obligation family from a certified trace.
F24: find and finite unfolding. For find, induct on the raw finite parent path. Transport each (PC) certificate along the preceding embedding, compose it with the recursive path certificate, and rewrite by rename composition. A PaperFiniteUnfolding chooses one actual stored case, a caller extension compatible with its stored inclusion, and a finite trace whose local steps are primitive equations or structural-congruence rules (in either direction). Induction on that trace gives its endpoint certificate; transported (EC) and the compatibility equation identify the caller witness. Composing this result with find proves the two certificates returned by F24. F24 itself has no redundant-coordinate-independence conclusion.
F25: certified kernel extraction. A PaperCertifiedKernelExtraction explicitly records the original term, exact kernel, its typed inclusion, and a finite CertifiedKernelReplay from the original to the renamed kernel. An induction on that replay maps reflexive, primitive, congruence, symmetric, and transitive constructors to the corresponding equational-certificate constructors. F25 performs this replay only; it does not claim that a particular extraction algorithm constructs the record.
F26: certified collision. Each certified canonical record supplies an exact kernel, a renaming from a shared canonical context to its support, a shape in one shared shape type, and normalization replay to one shared function canonicalRealization. Shape equality becomes equality of those canonical terms by congruence. Transport the left normalization through the right support renaming, compose with that equality, and reverse the right normalization to obtain the directed kernel certificate. Transporting this certificate and the two F25 certificates to a common context, then rewriting by the stated embedding-compatibility equation, gives the ambient source certificate. F26 assumes shape equality and common output/context indices; it does not derive them.
F27: trace preservation and finite-unfolding soundness. An obligation-free initial state is coherent by elimination. Induction on the proof-relevant LocalCertifiedTrace then uses exactly four local preservation schemas: insertion and rebuild add inherited or locally certified obligations; canonicalization, symmetry, and interface restriction rekey an obligation with checked endpoint bridges; collision, union, and path compression compose two source obligations with checked bridges; and a noninferential union only removes or inherits obligations. Converting the resulting coherence of the exact final endpoint state constructs F23. These nine constructors are abstract certificate-transition families, not a Lean refinement theorem for particular graph code.
For finite-unfolding soundness, F24 sends both unfoldings along their raw parent paths to one leader. The recorded (SC) generators close under identity, inverse, and composition to certify the supplied symmetry word; its exact embedding equation transports that certificate between the two leader endpoints. Transitivity yields the term certificate, typed-model soundness yields evaluation equality, and transport gives the common-context result only when the two embeddings of the caller context are equal.
A.4 Foundation and evidence boundary
The selected profile is STANDARD-LEAN-EXPLICIT-TCB; the only permitted foundational axioms are propext, Quot.sound, and Classical.choice. Each proof-bearing declaration receives a per-declaration axiom report. Java tests, bounded checks, mutation rejection, and corpus measurements do not establish a Lean refinement. The final artifact-refinement and experimental-replay matrices therefore remain separate from the mathematical statement index.
A.5 Artifact-refinement boundary
Table 4 is a compact rendering of formal/artifact-refinement-map.json. "Exact Lean specification" means that the paper-side contract has a distinct compiled declaration; it does not mean that the listed Java producer refines that contract. No row has a Lean refinement proof or a Lean-checked implementation trace.
Table 4: Artifact-refinement matrix.
| Bridge row | Paper-side status | Artifact evidence class | Bridge status |
|---|---|---|---|
| ART-TYPED-CARRIERS | Exact Lean specification | Property/mutation tests | OPEN |
| ART-LEADER-KERNEL | Exact Lean specification | Independent checker | non-Lean |
| ART-CANONICALIZER | Exact Lean specification | Property/mutation tests | OPEN |
| ART-CERTIFICATE-VERIFYER | Exact Lean specification | Independent checker | non-Lean |
| ART-REBUILD | Exact Lean specification | Property/mutation tests | OPEN |
| ART-ALLOY-NORMALIZATION | Exact Lean rule specifications | Bounded partial repair | PARTIAL |
G. Wu and A. Sullivan
| Bridge row | Paper-side status | Artifact evidence class | Bridge status |
|---|---|---|---|
| ART-OPERATOR-LAW-ROUTING | Exact Lean specification | Independent checker | OPEN |
| ART-EXPERIMENT-PIPELINE | Exact scope boundary | Pure Java/run-manifest evidence | OPEN |
Thus the abstract mathematical layer and the implementation bridge have different denominators: the former is the 146-unit paper–Lean registry, whereas the latter consists of these eight Java-facing rows. Closing the former cannot upgrade any status in the latter.
A.6 Edge-case closure summary
Table 5 renders the layer assessments in formal/edge-case-closure.json. “Proved narrow claim” records the exact scoped Lean result, not an end-to-end implementation fact.
Table 5: Edge-case closure by layer.
| Edge case | Abstract Lean layer | Artifact layer | Scope boundary |
|---|---|---|---|
| EDGE-PROPER-PARENT-SUPPORT | Proved narrow claim | OPEN | Parent paths and restriction remain separate obligations. |
| EDGE-PARENT-NONINJECTIVITY | Proved nonimplication | OPEN | Parent equality alone supplies no child symmetry. |
| EDGE-QUOTIENT-BEFORE-MINIMUM | Proved finite-presentation contract | OPEN | The Java orbit producer is not refined. |
| EDGE-BINDER-DESCRIPTOR | Proved certified scope | OPEN | Only descriptor-admitted automorphisms apply. |
| EDGE-EMPTY-BINDINGS | Proved rule specification | PARTIAL | Bounded regressions do not refine the parser/normalizer. |
| EDGE-HETEROGENEOUS-JOIN | Proved operator boundary | Bounded tested | Heterogeneous chains are excluded from homogeneous flattening. |
| EDGE-INTEGER-OVERFLOW-PROFILE | Proved modular-profile scope | OPEN | Adapter/profile correspondence remains unproved. |
| EDGE-RAW-SOURCE-REFINEMENT | Out of scope | OPEN | Raw Alloy parsing and normalization are not Lean-replayed. |
| EDGE-BOUNDED-REWRITE-SATURATION | Out of scope of the finite-rebuild proposition | Bounded tested | A 32-pass rewrite guard is not finite administrative rebuild. |
B Evaluation Detail
This appendix expands the immutable publication measurements summarized in Section 5. The Certificate-Integrated arm is an in-process certificate-checked implementation observation; its complete traces were not exported and independently replayed, and it establishes no Java-theory refinement.
The evidence is bound to ACGN publication HEAD 63f3b8c2931202e9b3 582a8802c558725a67ac26 and immutable publication run df4d8d4c-6265-4 fe7-88d5-3aceee60398b, generated from a clean checkout of source commit fbd9b1497a9036c55780da777f56581bc1c6bcec. The natural-corpus dataset SHA-256 is d6741fbf4c4a9b3714d012d068f84cc918052f1f55211bf4d0443b990736a689, and the executable JAR SHA-256 is 361b33ef56f6ccb1089a7a6fdda2a92bf621e501166c5a1c73330a0cc1686807. The manifest records rule set canonical-equivalences-v3-explicit-laws and repair metric certified-fast-rewrite-repair-distance-v12. These identifiers bind the measurements; they do not certify the implementation against the formal model.
B.1 Arms and Representation Boundaries
Table 6. Evaluation arms and their representation boundaries.
| Arm | Stored form | Equality discovery | Boundary |
|---|---|---|---|
| Raw | ordered keys | bounded rewrite frontier | internal baseline |
| Raw + De Bruijn | fixed keys with DB leaves | same frontier | binding encoding added |
| Java egglog | flattened keys | same frontier | flexible-arity internal baseline |
| Java egglog + De Bruijn Slotted | flattened keys with DB leaves ordered invocations and integer slots | same frontier | combined internal baseline |
| Fast Rewrite | flexible Alloy repair view | frontier plus bounded slot canonicalizer staged normalization and reference metric | precursor without the exact contract high-throughput normalization arm |
| Certificate-Integrated | typed Seq/Bag/Set/One ports | certified graph, orbit, rebuild, finite unfolding | in-process checked observation; no Java-theory refinement |
The front end constructs a temporal skeleton, moves quantifiers only within a temporal phase under recorded free-variable and domain conditions, and keeps non-primitive domain constraints as matrix guards. It then eliminates implication, biconditional, and formula-level conditionals, pushes negation, applies safe prenexing, and performs local relational and logical rewrites. The certified view stores typed ports, supports, binder descriptors, witnesses, transition certificates, and bounded finite unfoldings; the repair projection removes proof and schema plumbing before measuring distance. The publication run records the current explicit-law rule set and repair metric. Its runtime checks and empirical outputs do not prove conformance to the paper construction.
G. Wu and A. Sullivan
B.2 Corpus Views and Distance Summaries
Table 7. Mean student-side representation size on the paired corpus (). Counts are view-specific structural units, not bytes, pair-level ablation units, or directly comparable edit budgets.
| View | Experimental role | Mean units |
|---|---|---|
| Raw Alloy AST | source-level structural baseline | 26.787 |
| Certificate-Integrated repair observation | editable view used by the certified re-pair metric | 17.990 |
| Certificate-Integrated representative tree | deterministic finite tree used for representative TED | 33.199 |
| Fast Rewrite form | normal finite term emitted by the Fast Rewrite arm | 18.196 |
Table 8. Recorded truths within each invariant group. Certificate-Integrated (CI) classes are equivalence classes of CI equality; equivalent pairs count AST-different pairs within those classes.
| Problem | Recorded | Unique AST | CI classes | Equivalent pairs |
|---|---|---|---|---|
| classroom_fol | 1,628 | 279 | 88 | 1,303 |
| classroom_rl | 1,133 | 266 | 154 | 252 |
| coursesNew | 1,353 | 408 | 196 | 639 |
| coursesOld | 2,163 | 527 | 272 | 808 |
| cv_v1 | 110 | 42 | 23 | 29 |
| cv_v2 | 61 | 32 | 25 | 10 |
| graphs | 828 | 224 | 116 | 328 |
| lts | 256 | 105 | 57 | 110 |
| productionLineNew | 703 | 249 | 117 | 530 |
| productionLine_v1 | 149 | 58 | 44 | 17 |
| productionLine_v2 | 1,134 | 354 | 196 | 567 |
| socialMedia | 4,558 | 919 | 311 | 4,274 |
| trainStationNew | 1,611 | 360 | 171 | 798 |
| trainStationOld | 127 | 62 | 54 | 11 |
| trash_fol | 1,677 | 253 | 87 | 1,302 |
| trash_ltl | 883 | 157 | 87 | 126 |
| trash_rl | 1,019 | 201 | 103 | 278 |
| Total | 19,393 | 4,496 | 2,101 | 11,382 |
The augmented truth pool is restricted to predicates labeled CORRECT in the same invariant group; comparisons do not cross group boundaries. Each repair coordinate selects its own nearest reference and has its own edit unit. Canonical-representative tree edit distance is a diagnostic baseline rather than the primary repair metric.
Table 10 records schema-level context. Several problem variants share a base schema, so its ten rows do not correspond one-to-one with the 17 variants used above.
Table 9. Distance summaries. Coordinates have different units and are reported descriptively; a dash means that the augmented nearest-truth run did not compute that diagnostic.
| Coordinate | Unit | Paired meann = 61,598 | Nearest-truth meann = 42,386 |
|---|---|---|---|
| Levenshtein | characters | 39.261 | 28.055 |
| Raw tree edit | AST nodes | 22.841 | 15.988 |
| Certificate-Integrated repair | projection edits | 14.022 | 11.563 |
| Fast Rewrite | projection edits | 13.943 | 11.451 |
| Representative TED | finite-tree edits | 32.256 | — |
Table 10. Base-model size context. Sig./Abs./Ext./Rel. denote signatures, abstract signatures, extensions, and relations.
| Model | Sig. | Abs. | Ext. | Rel. | Mean arity | Scope | LOC | AST |
|---|---|---|---|---|---|---|---|---|
| classroom | 5 | 0 | 2 | 3 | 2.33 | 4 | 96 | 221 |
| courses | 6 | 0 | 2 | 5 | 2.20 | 4 | 88 | 316 |
| cv-v1 | 5 | 1 | 2 | 4 | 2.00 | 3 | 36 | 113 |
| cv-v2 | 5 | 1 | 2 | 4 | 2.00 | 3 | 36 | 121 |
| lts | 3 | 0 | 1 | 1 | 3.00 | 3 | 57 | 165 |
| product-line-v1 | 5 | 0 | 2 | 3 | 2.00 | 3 | 36 | 88 |
| product-line-v2/v3 | 10 | 1 | 7 | 4 | 2.00 | 3 | 70 | 200 |
| social-media | 5 | 0 | 2 | 5 | 2.00 | 3 | 57 | 184 |
| train-station-ltl | 7 | 0 | 4 | 3 | 2.00 | 3 | 125 | 570 |
| trash | 3 | 0 | 2 | 1 | 2.00 | 3 | 42 | 80 |
G. Wu and A. Sullivan
B.3 Full Ablation and Targeted Recognition
Table 11. Seven-arm ablation on 61,598 AST-different pairs from the current manifest-bound run. The final two arms are Fast Rewrite and Certificate-Integrated; all timings and memory values come from that same run.
| Arm | Correct d = 0 | Incorrect d = 0 | Mean distance |
|---|---|---|---|
| Raw | 820 (4.268%) | 0 | 18.364 |
| Raw + De Bruijn | 2,160 (11.243%) | 0 | 17.911 |
| Java egglog | 820 (4.268%) | 0 | 18.147 |
| Java egglog + De Bruijn | 2,160 (11.243%) | 0 | 17.690 |
| Slotted | 2,159 (11.238%) | 0 | 17.824 |
| Fast Rewrite | 4,074 (21.205%) | 0 | 13.943 |
| Certificate-Integrated | 4,088 (21.278%) | 0 | 14.022 |
| Arm | Wall (s) | Engine CPU (s) | Max RSS (MiB) | Mean units |
|---|---|---|---|---|
| Raw | 19.440 | 4.335 | 1,485.313 | 58.073 |
| Raw + De Bruijn | 19.440 | 5.292 | 1,491.105 | 57.752 |
| Java egglog | 19.010 | 4.099 | 1,608.297 | 57.055 |
| Java egglog + De Bruijn | 19.090 | 5.010 | 1,647.250 | 56.732 |
| Slotted | 19.300 | 16.389 | 1,772.973 | 53.168 |
| Fast Rewrite | 23.860 | 73.605 | 1,840.508 | 30.001 |
| Certificate-Integrated | 2,775.650 | 42,224.753 | 8,912.141 | 29.541 |
Notes. Wall is process wall; engine CPU is the arm's accumulated engine CPU. All arms completed 61,598 pairs without failure; 4,482 raw-AST-identical pairs were skipped. Percentages use the 19,212 recorded-correct eligible pairs as denominator. Max RSS is process maximum resident-set size. Distances and pair-level mean units are arm-specific.
Table 12. Targeted transformation-recognition suite. Each row has 500 AST-different pairs generated by the named, side-conditioned transformation.
| Transformation | Fix. F+DB | Var. V+DB | Slot | Leg. | Exact | ||
|---|---|---|---|---|---|---|---|
| -equivalence | 0 | 500 | 0 | 500 | 500 | 500 | |
| ACI | 500 | 500 | 500 | 500 | 500 | 500 | |
| Binder-block permutation | 1 | 22 | 1 | 22 | 500 | 500 | 500 |
| Safe prenexing | 500 | 500 | 500 | 500 | 500 | 500 | 500 |
| Logical normalization | 500 | 500 | 500 | 500 | 500 | 500 | 500 |
| Temporal normalization | 500 | 500 | 500 | 500 | 500 | 500 | 500 |
| 0 | 500 | 0 | 500 | 500 | 500 | 500 | |
| binder permutation | 0 | 22 | 0 | 22 | 500 | 500 | 500 |
| Binder permutation + prenex | 22 | 22 | 22 | 22 | 500 | 500 | 500 |
| AC + logical normalization | 500 | 500 | 500 | 500 | 500 | 500 | 500 |
| Mixed 2-4 transformations | 62 | 62 | 62 | 62 | 500 | 500 | 500 |
| All 5,500 | 2,585 | 3,628 | 2,585 | 3,628 | 5,500 | 5,500 | 5,500 |
Scope. This in-vocabulary suite tests historical representation and pipeline recognition, not semantic completeness or prevalence. DB denotes De Bruijn encoding; Var. denotes the variadic core.
The compact headers in Table 12 are preserved display aliases: Fix., F+DB, Var., V+DB, Slot., Leg., and Exact denote Raw, Raw + De Bruijn, Java egglog, Java egglog + De Bruijn, Slotted, Fast Rewrite, and Certificate-Integrated, respectively.
The natural-corpus arms combine different normalization and representation boundaries, so transitions between them are pipeline-level attributions rather than estimates for individual rewrite rules. Absolute timing is compared only within a run. Every arm completed the recorded natural-corpus pairs, but the single fresh-process execution per arm does not support distributional timing claims or a cross-system performance ranking.
B.4 Checker Boundary and Threats to Validity
The separate certificate verifier's adversarial suite covers support contraction, collision and union, restriction, symmetry, rebuild, path compression, container laws, binder orbits, and incomplete evidence. The standalone Lean module formal/TypedSlottedEGraphsPaper/TraceEnvelopeWitness.lean supplies one fixed nontrivial abstract trace: AC reassociation, a bijective two-slot binder remapping, union insertion, rebuild, and congruence restoration after operand reordering. It constructs the indexed trace with exact adjacency and replays that trace under an explicit finite-set interpreter to endpoint-denotation equality, packaging both facts as one checked witness. This establishes only inhabitation of that abstract trace shape, not Java producer-verifier correspondence or coverage of other shapes. Complete experimental traces were not exported and replayed.
The bounded Alloy analysis covers the 4,088 claim identities in the current Certificate-Integrated arm's labeled-correct natural-corpus zero-distance set. It found no counterexample or solver error for those identities and rejected four invalid probes: capture during beta reduction, comprehension-column permutation, signature shadowing, and a temporal implication error. None of 23 conclusive non-temporal targeted subtypes failed. Six temporal checks remained inconclusive because temporal analysis was unavailable; a warned static reduction is not counted as a pass or failure.
The natural corpus consists of short educational specifications with inherited labels, and excluding identical ASTs conditions the analysis on syntactic difference. Distances are not calibrated semantic-error probabilities. Natural and targeted artifacts have separate run and dataset identities, so comparisons remain within their respective manifests. These data do not establish Java-theory refinement, full semantic equivalence, industrial generalization, or operational repair success.
C Canonicalization Algorithm and Rewrite Theory
This appendix makes explicit the proposed canonicalizer and its abstract rewrite contract. The Lean development proves finite-orbit normalization and
G. Wu and A. Sullivan
the Boolean, list, finite-function, and relation equations identified below. Figure 3 and the Alloy/Java names are a refinement target for those abstract objects, not a proved implementation correspondence. An arrow below denotes a proposed representative orientation unless the text marks the operation as structural cleanup. Publication run df4d8d4c-6265-4fe7-88d5-3aceee60398b records rule set canonical-equivalences-v3-explicit-laws. This binds the measured configuration but does not prove that Java realizes this appendix's abstract rules or contracts.
C.1 Notation and Preconditions
Let be a flexible-arity typed slotted e-graph. The parent assignment maps each e-class identifier to an immediate parent invocation, with a root mapped to its identity invocation; find composes these links to return a leader invocation in caller context . The map stores the result type, exposed typed slots, canonical shapes, and justified slot-symmetry group of e-class , and is the shape collision index. A typed e-node has the form
where . The schemas Seq, Bag, and Set respectively preserve order and multiplicity, quotient by permutation while preserving multiplicity, and quotient by both permutation and idempotence. A first-class BindBlock( ) carries a complete descriptor , a fresh occurrence-local bound context, and precisely the certified finite group . Fix a total structural order over complete well-typed port and node keys, and a total order over completed typed shapes. The latter compares the operator, type instantiation, atom, slot interface, and normalized ports. Fix also the same total map order as in the main text, , for deterministic witness selection, and let compare a shape-map pair first by and then by .
At the specification level, leader normalization may reduce support, so the proposed graph operation distinguishes the input context from the effective kernel context. For a node with , its intended structural extraction is
Here and denote the proposed kernel and trace. The exact formal claim APP-001 uses an indexed trace interface. For an indexed family , an extractor returns an effective size , a kernel in , and a structural trace with dependent endpoints and . For any two trace interpreters, each supplying an equality for every trace label, replay proves equality of the corresponding endpoint denotations. This theorem neither identifies those equalities with the paper's EqCert type nor proves that Java extraction emits the required trace; those are separate refinement obligations.
For a finite typed context , is the context containing the same number of slots of each type, named from a fixed type-indexed alphabet. The shape witness for is
which maps canonical slots bijectively to the effective source support. Its transport into the original ambient context is the typed embedding
The map is classified as a typed embedding; it is a renaming in the support-preserving case . This separation retains the shape's exact slots, its effective support, and its original ambient support, including coordinates removed by find. Binder-block automorphisms act on exactly the bound coordinates admitted by the complete descriptor: domain, quantifier, cardinality/multiplicity, disjointness class, dependency constraints, and type. Each block occurrence is alpha-aligned with a fresh canonical variant of the descriptor's bound context; the descriptor group is transported to that occurrence context before it acts. This local action is disjoint from the one global free-slot renaming.
As the smallest strict-support case, suppose with a proper embedding . Then wrap() has input support , whereas its leader kernel wrap() has support . The construction below therefore uses and keeps the inclusion into separately. Its shape witness is the bijection onto the effective support, while its ambient transport is the proper embedding .
C.2 The Graph-Relative Canonicalizer
Figure 3 gives the proposed graph-level pseudocode. The exact formal claim APP-002 concerns an abstract structural record extending the extractor result with a shape and an effective-size renaming. Its ambient transport is definitionally the inclusion composed with that renaming, and its collision key is definitionally the shape. For any trace interpreter, replay adds only equality of the two endpoint denotations. No completeness of a local orbit, graph insertion behavior, or EqCert construction is part of APP-002. The paper tuple
is the intended concrete realization of that record; establishing that the Java record realizes it remains an artifact-refinement task.
The exact formal block-occurrence claim APP-003 uses de Bruijn indices of one fixed finite size. The canonical occurrence is the identity, the alignment is the inverse of the source occurrence, and the returned list is the descriptor's supplied automorphism list mapped by conjugation with that identity. Consequently source occurrence followed by alignment is the identity occurrence. Fresh-name choice, disjointness from a caller, leastness, and completeness of any richer paper descriptor are not conclusions of this claim; the corresponding steps in Figure 3 are refinement requirements.
G. Wu and A. Sullivan
Fig. 3. Proposed graph-relative canonicalization refinement target (not verified as a producer by Lean). The design minimizes invocation and binder-block orbits before bag aggregation and set deduplication. It would retain , , , and in the structural record, obtain a dependent certificate only by separate replay, and use only as a hash key. The exact checked contracts are stated after the figure.
status: specification-only pseudocode; every producer and Java correspondence below is a separate refinement obligation
procedure leaderKernelTrace
require is well typed and is its exact context
// find every invocation; do not unfold leaders
return
procedure canon
require is well typed and already uses its declared sibling quotients and explicit flat licenses
write
// option of a shape-renaming pair
for each do
// effective source slots to canonical slots
for to do
if or then
require // TRen contains a bijection
return
procedure replayKernelCertificate
require is a coherent witness family for
require and every certificate named by verifies
require
return
procedure canon
return
procedure canonLeaderPort
require and
target postcondition result is
match with
(One(), ): return x)
Figure 3 continued
(One(), ): require is a leader; None for each do return get(b) // id (Seq, ): return [canonLeaderPort (Bag, ): the empty finite multiplicity map for each do ; return // serialization order is not part of the bag (Set, ): return {canonLeaderPort_{\mathcal{G}}(\kappa', q', \rho) \mid q' \in Y} (Bind(, ), bind ): \rho' \leftarrow \rho \uplus [\x \mapsto $y]y: \tau{\mathcal{G}}(\kappa', q, \rho')\beta\kappa'{\beta}^o q(o_B, \alpha_o, A_B) \leftarrow \text{canonicalBlockOccurrence}(\beta, o, \text{cod}(\rho))o_B = (B, a_B)\alpha_o = a_B \circ a_o^{-1}A_Bb \leftarrow\pi_B \in A_B\rho_\pi \leftarrow \rho \uplus (\pi_B \circ \alpha_o)u \leftarrow \text{bind}{\beta}^{o_B}{\mathcal{G}}(\kappa', q, \rho_\pi)b \leftarrow \text{keepLeast}_\mathcal{A}(b, u)\in \text{Aut}(\beta)$
Exact formal contracts for the figure. The algorithm rows are read through the following abstract claims, not as a verified execution of the displayed graph program. ALG-005 says that an abstract kernel extractor's returned finite inclusion is injective and that its trace replays to endpoint-denotation equality under a supplied interpreter. ALG-006 uses an extensionally complete nonempty finite candidate list: every enumerated candidate is admissible, every admissible candidate is enumerated, the selected candidate is present and least, the returned record contains exactly it, and the collision key projects only the returned shape. These are finite-presentation contracts, not a proof that the concrete enumerator has them. ALG-007 says that a structural trace between two dependent sigma endpoints replays to equality under a supplied interpreter. ALG-008 says that the certified wrapper preserves its input structural record and adds that replayed equality. Finally, ALG-009 proves constructor-by-constructor that the abstract recursive function realizes its independently defined untyped PortQuotient relation: slots are mapped, invocation candidates are passed to the defined leastByKey function, sequence and bag lists are recursively mapped, set lists are deduplicated by key, unary binders recurse, and a block applies the same
G. Wu and A. Sullivan
function to its supplied candidates. It does not prove typed-schema admissibility, graph lookup, or completeness of the supplied invocation or block candidates.
The exact finite-orbit claim APP-004 is correspondingly generic. For any finite normalization presentation , belongs to the supplied orbit of and is -related to , and
This is the finite-presentation normal-form theorem used by the paper; identifying with the concrete graph-relative relation is an additional refinement obligation.
The exact rebuild claim APP-005 is an abstract three-part contract. For a supplied finite-decreasing rebuild system, every initial state reaches some quiescent state. A supplied interface-restriction certificate decomposes the old natural-number size as the retained size plus further removals plus one, so committing it strictly decreases the size. Finally, pointwise port evidence at one shared head and type instantiation constructs the corresponding node-congruence witness. Concrete collision buckets, transport of graph witnesses, pending-certificate behavior, and Java fixed-point scheduling are not conclusions of this theorem; they remain implementation obligations.
C.3 Ordered Application of Rules
The formal object for RULE-001 is the displayed list of nine stage names: (1) parser cleanup; (2) alpha normalization; (3) beta reduction; (4) branch elimination; (5) first NNF; (6) phase-local prenexing; (7) guard elimination and NNF; (8) sibling and flat normalization; and (9) local saturation and rebuild. Its only phase theorem is that the formal normalizeWithinPhase operation, presently the identity, preserves the stored phase index. It does not establish that the Java stages execute in this order, that temporal children are normalized recursively, or that arbitrary quantifier motion cannot cross a phase. Those are artifact conformance requirements.
C.4 Parser and Structural Normalization
For RULE-002, each finite parser-head constructor in Table 14 maps to the shown canonical-head constructor; the enumerated operation-meaning label of the result equals the enumerated label of the source. This is a datatype equation, not a denotational theorem about the Java parser or Alloy expressions.
Internal no-op and end markers are removed:
The exact RULE-003 equations say that a singleton NOOP list unwraps, a singleton END list deletes, and a singleton abstract INCOMPLETE list deletes. They contain no arity validator and no claim about Java parser rejection. Lexical
Table 14. Parser heads mapped to canonical internal heads.
| Source heads | Canonical head | Source heads | Canonical head |
|---|---|---|---|
| BF/AND, LF/AND | BOOL/AND | BF/OR, LF/OR | BOOL/OR |
| BF/IMPLIES | BOOL/IMPLIES | BF/IFF | BOOL/IFF |
| UF/NOT | BOOL/NOT | BE/PLUS | REL/PLUS |
| BE/INTERSECT | REL/INTERSECT | BE/JOIN | REL/JOIN |
| BE/ARROW | REL/ARROW | BE/MUL | ARITH/MUL |
| BE/IPLUS | ARITH/PLUS | LE/DISJOINT | LIST/DISJOINT |
alpha-renaming and diagnostic-name retention are likewise implementation requirements, not conclusions of this rule.
For intrinsically scoped de Bruijn terms, RULE-004 defines
Precisely, reducing the formal letE(E, P) returns some(substituteTop(E, P)), and lifted substitution fixes the newly bound coordinate 0. The index types enforce scoping; the theorem does not assert semantic preservation for a concrete Alloy AST or its Java substitution routine.
C.5 Branch Connectives and Boolean NNF
The third rule below applies to formula-valued conditionals:
The same Boolean equations imply
These five RULE-005 equalities are proved only for the formal Boolean truth functions. Classifying and rewriting formula-valued versus expression-valued Alloy conditionals is an artifact-refinement obligation.
The Boolean NNF rules are
Here RULE-006 is exactly the two constant equations, double negation, and the two De Morgan equations for finite lists of Booleans.
G. Wu and A. Sullivan
Atomic negation uses the following involutive duals:
The exact RULE-007 theorem is conditional: if the finite atomicDual function returns for o, it returns o for , and normalizing the negation of o returns the atom . Behavior of parser-specific negative comparison heads and unsupported operators is not part of this theorem; Java conformance to the table is checked separately.
C.6 Temporal Negation
The supported temporal duals are
The exact RULE-008 theorem has the same conditional form: whenever temporalDual(o) = o^⊥, the reverse lookup returns o and normalization returns the dualized constructor o^⊥. It does not prove a temporal semantics, phase separation, or Java handling of before and after.
C.7 Quantifier Rewrites and Prenexing
Write Qx:D.P suggestively, but RULE-009 is formalized as evaluation of a quantifier over a finite list of Boolean matrix values. Negation follows exactly
The theorem is the corresponding Boolean-list equality for all seven formal quantifier constructors; it is not an Alloy evaluator correspondence theorem.
For an empty domain, independently of ,
For RULE-010, “empty” means exactly that the formal admissible-value list is []; the seven displayed values are then proved by evaluation. Determining emptiness from Alloy declaration syntax and multiplicity is outside this theorem and is a required frontend/Java check.
The carrier-independent constant-body rules are
These are exactly the seven RULE-011 equalities for a list of any length. No value is asserted for existential true or universal false, whose Boolean-list values depend on whether that list is empty.
The exact RULE-012 statement is four finite Boolean-list equations. For a carrier list , predicates , and Boolean ,
Its binding-tuple operation changes only the primitive carrier and preserves the quantifier, lower and upper multiplicities, disjointness class, and phase fields. Fresh-variable conditions, general AST free-variable preservation, cardinality lowering, sums, and comprehensions are not conclusions of this claim.
For RULE-013, an accepted finite permutation is packaged with a proof that the supplied binder descriptor certifies it. The theorem proves that it occurs in the descriptor's supplied automorphism list and that, for every environment coordinate i,
It does not establish semantic preservation of a quantified Alloy body or preservation of additional descriptor metadata; those are separate refinement obligations.
C.8 Flexible-Arity Structural Laws
For RULE-014, Table 15 is exactly the finite operatorLaw lookup table. Its three Boolean columns are policy flags, not semantic certificates. In particular, the theorem proves the noninteger lookup equations; the integer row belongs to RULE-015. Neither theorem derives a source-level law merely from a flag.
G. Wu and A. Sullivan
Table 15. Formal carrier assignments and policy flags.
| Formal operator | Carrier | C/I flags | Flat flag |
|---|---|---|---|
| boolAnd, boolOr | setPlus | true/false | true |
| relationalUnion, relationalIntersection | setPlus | true/false | true |
| integerAddition, integerMultiplication | bagPlus | true/false | profile-dependent |
| relationalJoin, relationalProduct | fixedBinary Positional | false/false | false |
| equality, inequality, biconditional | fixedBinary Commutative | true/false | false |
| disjoint(k) | nonflatBag | true/false | false |
| call(g, k) | positional(k) | false/false | false |
| totalOrder(k) | positional(k) | false/false | false |
The disjoint, call, and total-order equations are quantified over their natural number arities (and, for calls, the callee identifier). Whether the Java frontend enforces source arities and whether a policy flag is backed by the required endpoint certificates are separate artifact checks. No additional role-sensitive-list or dependent-chain row is covered by RULE-014.
The exact RULE-015 model uses Fin(2^w). Its addition and multiplication are proved associative and commutative; the modular profile has both flat flags set, and the overflow-forbidding profile has both cleared. Separately, the checked signed four-bit functions prove checkedAdd4(7, 1) = none, checkedAdd4(1, -1) = some(0), and hence the left association fails while the right returns 7. Connecting either model to an Alloy or Java integer mode is not part of these Lean results.
In the abstract ALG-009 procedure, sequence and bag constructors map their child lists recursively, whereas a set constructor additionally applies the supplied key-deduplication function. This statement is about lists in the formal quotient datatype; it does not prove multiset semantics, Java sorting, or graph-invocation equality.
C.9 Local Saturation Rules
The Boolean identities, annihilators, and complements are
These eight RULE-016 identities are Boolean equations. The associated formal smart constructor returns a constant on an empty input list, the child on a singleton, and a nonempty-port record otherwise; its stored-port arity can never be 0. No theorem here connects that datatype to a frontend Set⁺ node or to an emitted unit certificate.
For RULE-017, an atomic literal consists only of an arbitrary atom and a positive/negative polarity. Complement flips the polarity while retaining the same atom, and for any Boolean valuation
Recognizing concrete operator duals and equal canonical e-class invocations is an implementation premise, not a conclusion of this theorem.
For RULE-018, relations are abstract predicates . Given a witness that is nonempty, the theorem proves pointwise
and also that the empty predicate is a subset of itself. This theorem contains no typed Alloy AST, multiplicity analysis, ACI-port inference, or Java rewrite claim.
Finally, RULE-019 proves the Boolean identities
and the Boolean equality . Stage placement and Java saturation behavior are outside this equality theorem.
C.10 Boundary and Implementation Correspondence
The exact SCOPE-001 theorem is about an arbitrary complete finite normalization presentation . Define its discrete canonical distance to be 0 when and 1 otherwise. Then
This follows from the presentation's normal-form exactness. It neither proves that the individual rules in this appendix generate one combined , nor identifies this 0/1 function with the dataset's AST edit distance, nor states a Java-refinement premise or conclusion.
The remaining production statements are artifact-only obligations. In particular, graph-relative typed-renaming enumeration, binder-group closure, the behavior of SlotPermutationGroup, the 720-permutation guard, and the 32-pass rewrite bound are not Lean conclusions. The publication run gives in-process checked observations under its recorded rule set; it does not prove those correspondences and cannot be cited as realizing SCOPE-001 or the abstract algorithm contracts above.