Dis/Equality Graphs
George Zakhour, Pascal Weisenburger, Jahrim Gabriele Cesario, Guido Salvaneschi
Abstract
E-graphs are a data structure to compactly represent a program space and reason about equality of program terms. E-graphs have been successfully applied to a number of domains, including program optimization and automated theorem proving. In many applications, however, it is necessary to reason about disequality of terms as well as equality. While disequality reasoning can be encoded, direct support for disequalities increases performance and simplifies the metatheory.
In this paper, we develop a framework independent of a specific implementation to formally reason about e-graphs. For the first time, we prove the equivalence of e-graphs to the reflexive, symmetric, transitive, and congruent closure of the equivalence relation they are expected to encode. We use these results to present the first formalization of an extension of e-graphs that directly supports disequalities and prove an analytical result about their superior efficiency compared to embedding techniques that are commonly used in SMT solvers and automated verifiers. We further profile an SMT solver and find that it spends a measurable amount of time handling disequalities.
We implement our approach in an extension to egg, a popular e-graph Rust library. We evaluate our solution in an SMT solver and an automated theorem prover using standard benchmarks. The results indicate that direct support for disequalities outperforms other encodings based on equality embedding, confirming the results obtained analytically.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- babble: Learning Better Abstractions with E-Graphs and Anti-unification cites Synthesizing structured CAD models with equality saturation and inverse transformations
- babble: Learning Better Abstractions with E-Graphs and Anti-unification cites egg: Fast and extensible equality saturation
- babble: Learning Better Abstractions with E-Graphs and Anti-unification cites Vectorization for digital signal processors via equality saturation
- Towards Pen-and-Paper-Style Equational Reasoning in Interactive Theorem Provers by Equality Saturation cites Better Together: Unifying Datalog and Equality Saturation
- Towards Pen-and-Paper-Style Equational Reasoning in Interactive Theorem Provers by Equality Saturation cites egg: Fast and extensible equality saturation
- Better Together: Unifying Datalog and Equality Saturation cites Synthesizing structured CAD models with equality saturation and inverse transformations
- Better Together: Unifying Datalog and Equality Saturation cites egg: Fast and extensible equality saturation
- Better Together: Unifying Datalog and Equality Saturation cites Vectorization for digital signal processors via equality saturation
- Metamorphic Testing for Infrastructure-as-Code Engines cites babble: Learning Better Abstractions with E-Graphs and Anti-unification
- Metamorphic Testing for Infrastructure-as-Code Engines cites Synthesizing structured CAD models with equality saturation and inverse transformations
- Metamorphic Testing for Infrastructure-as-Code Engines cites egg: Fast and extensible equality saturation
- egg: Fast and extensible equality saturation cites Synthesizing structured CAD models with equality saturation and inverse transformations
- EUFⁿ: A Decidable Extension to the Theory of Equality with Uninterpreted Functions cites egg: Fast and extensible equality saturation
- Vectorization for digital signal processors via equality saturation cites Synthesizing structured CAD models with equality saturation and inverse transformations
- Versioned E-Graphs cites babble: Learning Better Abstractions with E-Graphs and Anti-unification
- Versioned E-Graphs cites Synthesizing structured CAD models with equality saturation and inverse transformations
- Versioned E-Graphs cites egg: Fast and extensible equality saturation
- Versioned E-Graphs cites Vectorization for digital signal processors via equality saturation
Cited by top-tier papers4
- Towards Pen-and-Paper-Style Equational Reasoning in Interactive Theorem Provers by Equality SaturationMarcus Rossel, Rudi Schneider, Thomas Koehler, Michel Steuwer et al.POPL 2026 · 2 citations
- Metamorphic Testing for Infrastructure-as-Code EnginesDavid Spielmann, George Zakhour, Dominik Arnold, Matteo Biagiola et al.OOPSLA 2026
- EUFⁿ: A Decidable Extension to the Theory of Equality with Uninterpreted FunctionsYide Du, Zhenbang Chen, Weijiang Hong, Wei DongOOPSLA 2026
- Versioned E-GraphsJahrim Gabriele Cesario, George Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2026
Builds on10
- egg: Fast and extensible equality saturationMax Willsey, Chandrakana Nandi, Yisu Remy Wang, Oliver Flatt et al.POPL 2021 · 170 citations
- Synthesizing structured CAD models with equality saturation and inverse transformationsChandrakana Nandi, Max Willsey, Adam Anderson, James R. Wilcox et al.PLDI 2020 · 65 citations
- Vectorization for digital signal processors via equality saturationAlexa VanHattum, Rachit Nigam, Vincent T. Lee, James Bornholt et al.ASPLOS 2021 · 57 citations
- babble: Learning Better Abstractions with E-Graphs and Anti-unificationDavid Cao, Rose Kunkel, Chandrakana Nandi, Max Willsey et al.POPL 2023 · 38 citations
- Better Together: Unifying Datalog and Equality SaturationYihong Zhang, Yisu Remy Wang, Oliver Flatt, David Cao et al.PLDI 2023 · 38 citations
Related papers
- Fast and Optimal Extraction for Sparse Equality GraphsAmir Kafshdar Goharshady, Chun Kit Lam, Lionel ParreauxOOPSLA 2024 · 11 citations
- Slotted E-Graphs: First-Class Support for (Bound) Variables in E-GraphsRudi Schneider, Marcus Rossel, Amir Shaikhha, Andrés Goens et al.PLDI 2025 · 1 citation
- Improving Equality Saturation for EDA via Semantic E-GraphsSijie Kong, Jingtao Xia, Daniel Ruelas-Petrisko, Zachary D. Sisco et al.PLDI 2026
- Equivalence Hypergraphs: DPO Rewriting for Monoidal E-GraphsAleksei Tiurin, Chris Barrett, Dan R. Ghica, Nick HuLICS 2025
- Relational e-matchingYihong Zhang, Yisu Remy Wang, Max Willsey, Zachary TatlockPOPL 2022 · 12 citations
