egg

Aa Appearance
Text size
Reading width
Contents

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

View connections on the graph
Graph neighborhood · Open full Graph Explorer
Formal solvers and p…egg

References

  1. ↑egg crate API documentation · egg project egraphs-good.github.io
  2. ↑egg: Fast and Extensible Equality Saturation arxiv.org
Revision history
Time view Latest revision

Event dates describe the subject. The knowledge cutoff controls which editorial revisions you can see.