egg is an open-source library for equality saturation. It represents many equivalent expressions in an e-graph so a program can explore alternative rewrites before choosing a result. The library was introduced by Max Willsey and colleagues in a paper presented at POPL 2021.[1][2]
Equality saturation
An e-graph groups expressions known to be equal and allows multiple forms to share structure. Equality saturation applies rewrite rules to add alternatives to the graph. It can retain alternatives that a conventional optimizer might immediately discard after applying a rule. An extraction step can then select an expression according to a cost criterion. The Rust crate exposes graph, rewrite and extraction types for building an optimizer.[1][2]
Rebuilding and analyses
The authors identified restoring the graph’s invariants as a recurring cost. Their rebuilding method batches part of that work during equality saturation. They also introduced e-class analyses, which allow applications to attach domain-specific facts to groups of equivalent expressions. The paper evaluates the approach in three applications of equality saturation.[2]
Connections
Covered in
View connections on the graph
References
- ↑egg crate API documentation · egg project egraphs-good.github.io
- ↑egg: Fast and Extensible Equality Saturation arxiv.org
Revision history
- 2026-11-28 Publish sourced articles and connect reviewed subjects and dated records
58ff02f4b· View changes