Rewrite Rule Inference Using Equality Saturation
Chandrakana Nandi, Max Willsey, Amy Zhu, Yisu Remy Wang, Brett Saiki,, Adam Anderson, Adriana Schulz, Dan Grossman, Zachary Tatlock

TL;DR
This paper presents a novel method using equality saturation and e-graphs to automatically infer and synthesize compact, effective rewrite rules, improving speed and quality over existing tools.
Contribution
It introduces a new approach leveraging equality saturation for rewrite rule inference, resulting in smaller, faster, and more general rulesets.
Findings
Ruler synthesizes 5.8X smaller rulesets
Ruler operates 25X faster than CVC4-based tools
Synthesized rules match expert-crafted rules in performance
Abstract
Many compilers, synthesizers, and theorem provers rely on rewrite rules to simplify expressions or prove equivalences. Developing rewrite rules can be difficult: rules may be subtly incorrect, profitable rules are easy to miss, and rulesets must be rechecked or extended whenever semantics are tweaked. Large rulesets can also be challenging to apply: redundant rules slow down rule-based search and frustrate debugging. This paper explores how equality saturation, a promising technique that uses e-graphs to apply rewrite rules, can also be used to infer rewrite rules. E-graphs can compactly represent the exponentially large sets of enumerated terms and potential rewrite rules. We show that equality saturation efficiently shrinks both sets, leading to faster synthesis of smaller, more general rulesets. We prototyped these strategies in a tool dubbed ruler. Compared to a similar tool built…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
