{"slug":"egg-equality-saturation","article":{"kind":"article","title":"egg","category":"Technology","entityType":"package","summary":"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.","sources":["source:egg-equality-saturation-api","source:research-track-math-factgraph-solvers-egg"],"relations":[{"to":"article:research-track-math-factgraph-solvers","rel":"covered-in"}],"id":"article:egg-equality-saturation","from":"2026-11-28","revision":"58ff02f4b64d6aecc1e9fd90152fc89af0215a25d336308b35b4b75833582534","recordedAt":"2026-11-28T23:42:44.620Z"},"sections":[{"kind":"section","article":"article:egg-equality-saturation","title":"Equality saturation","text":"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.","order":0,"sources":["source:egg-equality-saturation-api","source:research-track-math-factgraph-solvers-egg"],"id":"section:egg-equality-saturation-rewrites","from":"2026-11-28","revision":"58ff02f4b64d6aecc1e9fd90152fc89af0215a25d336308b35b4b75833582534","recordedAt":"2026-11-28T23:42:44.620Z"},{"kind":"section","article":"article:egg-equality-saturation","title":"Rebuilding and analyses","text":"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.","order":1,"sources":["source:research-track-math-factgraph-solvers-egg"],"id":"section:egg-equality-saturation-library","from":"2026-11-28","revision":"58ff02f4b64d6aecc1e9fd90152fc89af0215a25d336308b35b4b75833582534","recordedAt":"2026-11-28T23:42:44.620Z"}],"events":[],"examples":[],"links":[],"sources":[{"kind":"source","title":"egg crate API documentation · egg project","url":"https://egraphs-good.github.io/egg/egg/","id":"source:egg-equality-saturation-api","from":"2026-11-28","revision":"58ff02f4b64d6aecc1e9fd90152fc89af0215a25d336308b35b4b75833582534","recordedAt":"2026-11-28T23:42:44.620Z"},{"kind":"source","title":"egg: Fast and Extensible Equality Saturation","url":"https://arxiv.org/abs/2004.03082","id":"source:research-track-math-factgraph-solvers-egg","from":"2026-11-28","revision":"bee1b84cf15d5703092428a85af3e05749af0151d0401ab9acd6269b76311f17","recordedAt":"2026-11-28T22:36:26.545Z"}],"related":[{"slug":"research-track-math-factgraph-solvers","title":"Formal solvers and proof search","category":"Research Collections","entityType":"collection","rel":"covered-in"}],"backlinks":[],"history":[{"id":"58ff02f4b64d6aecc1e9fd90152fc89af0215a25d336308b35b4b75833582534","recordedAt":"2026-11-28T23:42:44.620Z","message":"Publish sourced articles and connect reviewed subjects and dated records"}]}
