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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 84899b13-3dea-4f74-b1d1-529b72c33720Cited 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
