egg: Fast and extensible equality saturation
Open accessThe DOI matches its Crossref record; 18 of the 18 references it cites were found in a registry or an index.
Abstract
An e-graph efficiently represents a congruence relation over many expressions. Although they were originally developed in the late 1970s for use in automated theorem provers, a more recent technique known as equality saturation repurposes e-graphs to implement state-of-the-art, rewrite-driven compiler optimizations and program synthesizers. However, e-graphs remain unspecialized for this newer use case. Equality saturation workloads exhibit distinct characteristics and often require ad-hoc e-graph extensions to incorporate transformations beyond purely syntactic rewrites. This work contributes two techniques that make e-graphs fast and extensible, specializing them to equality saturation. A new amortized invariant restoration technique called rebuilding takes advantage of equality saturation's distinct workload, providing asymptotic speedups over current techniques in practice. A general mechanism called e-class analyses integrates domain-specific analyses into the e-graph, reducing the need for ad hoc manipulation. We implemented these techniques in a new open-source library called egg. Our case studies on three previously published applications of equality saturation highlight how egg's performance and flexibility enable state-of-the-art results across diverse domains.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
de Moura, L., & Bjørner, N. (2008) · Lecture Notes in Computer Science · doi:10.1007/978-3-540-78800-3_24 · Cited by 6,595 · cited 6×
“TASO uses Z3 [De Moura and Bjùrner 2008] to perform the verification even though most of Z3’s features (disjunctions, backtracking, theories, etc.) were not required.”
BackgroundMethodInfluentialA Computing Procedure for Quantification Theory
Davis, M., & Putnam, H. (1960) · Journal of the ACM · doi:10.1145/321033.321034 · Cited by 2,647
Efficiency of a Good But Not Linear Set Union Algorithm
Tarjan, R. E. (1975) · Journal of the ACM · doi:10.1145/321879.321884 · Cited by 1,403
Simplify: a theorem prover for program checking
Detlefs, D., Nelson, G., & Saxe, J. B. (2005) · Journal of the ACM · doi:10.1145/1066100.1066102 · Cited by 786 · cited 11×
“Traditionally [Detlefs et al. 2005; Nelson 1980], e-graphs maintain their data structure invariants after each operation.”
BackgroundMethodResultInfluentialFast Decision Procedures Based on Congruence Closure
Nelson, G., & Oppen, D. C. (1980) · Journal of the ACM · doi:10.1145/322186.322198 · Cited by 611 · cited 1×
“E-graph were originally proposed several decades ago as an efficient data structure for maintaining congruence closure [Kozen 1977; Nelson 1980; Nelson and Oppen 1980].”
MethodDERSHOWITZ, N., & JOUANNAUD, J.-P. (1990) · Formal Models and Semantics · doi:10.1016/b978-0-444-88074-1.50011-1 · Cited by 579
Variations on the Common Subexpression Problem
Downey, P. J., Sethi, R., & Tarjan, R. E. (1980) · Journal of the ACM · doi:10.1145/322217.322228 · Cited by 368
TASO: optimizing deep learning computation with automatic generation of graph substitutions
Jia, Z., Padon, O., Thomas, J., Warszawski, T., Zaharia, M., & Aiken, A. (2019) · Proceedings of the 27th ACM Symposium on Operating Systems Principles · doi:10.1145/3341301.3359630 · Cited by 261 · cited 1×
“To demonstrate this, we replicated a portion of the recent TASO paper [Jia et al. 2019], which optimizes deep learning models.”
MethodBuilding program optimizers with rewriting strategies
Visser, E., Benaissa, Z.-E.-A., & Tolmach, A. (1998) · Proceedings of the third ACM SIGPLAN international conference on Functional programming · doi:10.1145/289423.289425 · Cited by 251 · cited 1×
“Term rewriting [Dershowitz and Jouannaud 1990] has been used widely to facilitate equational reasoning for program optimizations [Boyle et al. 1996; van den Brand et al. 2002; Visser et al. 1998].”
MethodInverseCSG: automatic conversion of 3D models to CSG trees
Du, T., Inala, J. P., Pu, Y., Spielberg, A., Schulz, A., Rus, D. L., Solar-Lezama, A., & Matusik, W. (2018) · ACM Transactions on Graphics · doi:10.1145/3272127.3275006 · Cited by 206
Cited by
Top-Down Synthesis for Library Learning
Bowers, M., Olausson, T. X., Wong, L., Grand, G., Tenenbaum, J. B., Ellis, K., & Solar-Lezama, A. (2023) · Proceedings of the ACM on Programming Languages · doi:10.1145/3571234 · Cited by 33
“One major direction is extending the CTS approach to handle reasoning over more general deductive rewrite systems, like those encoded in egg [Willsey et al. 2021] as babble does [Cao et al. 2023] (also see Section 7.5).”
MethodInfluential
Metadata
- Authors
- Willsey, M., Nandi, C., Wang, Y. R., Flatt, O., Tatlock, Z., & Panchekha, P.
- Venue
- Proceedings of the ACM on Programming Languages
- Published
- 2021-01-04
- Volume
- 5
- Issue
- POPL
- Pages
- 1-29
- ISSN
- 2475-1421 (ISSN-L)
- OpenAlex
- W3099525000
- Cited by
- 174
- References
- 18
- FWCI
- 8.38
- Type
- journal article
- Language
- en
- Open access
- diamond
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
How to cite
Cite CoChat for the checks on this page, and the paper for its own findings.
- This page
- CoChat. (2026). Citation check: egg: Fast and extensible equality saturation. https://app.cochat.ai/papers/10.1145/3434304
- The paper
- Willsey, M., Nandi, C., Wang, Y. R., Flatt, O., Tatlock, Z., & Panchekha, P. (2021). egg: Fast and extensible equality saturation. Proceedings of the ACM on Programming Languages. https://doi.org/10.1145/3434304
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.