Slotted E-Graphs First-Class Support for (Bound) Variables in E-Graphs

Open Access
Authors
  • Thomas Kœhler
  • Michel Steuwer
Publication date 2025
Journal Proceedings of the ACM on Programming Languages
Event 2025 ACM SIGPLAN Conference on Programming Languages Design<br/>and Implementation
Article number 223
Volume | Issue number 9 | PLDI
Pages (from-to) 1888-1910
Organisations
  • Faculty of Science (FNWI) - Informatics Institute (IVI)
Abstract

Equality saturation has gained significant interest as a powerful optimization and reasoning technique. At its heart is the e-graph data structure, that space-efficiently represents equal sub-terms uniquely. An important open problem in this context is extending this efficient representation to languages featuring (bound) variables. Independent of how we represent variables in e-graphs, either as names or nameless (using de Bruijn indices), sharing is broken as sub-terms that differ only in the names of their variables are represented separately. This results in aggressive e-graph growth, bad performance, as well as reduced expressiveness. In this paper, we present a novel approach to representing bound variables in e-graphs by making them a first-class built-in feature of the data structure. Our slotted e-graph represents terms that differ only by (bound or free) variable names uniquely. To do so, e-classes that represent equivalent terms via e-nodes are parameterized by slots, abstracting over free variables of the represented terms. Referring to an e-class from an e-node now requires relating the variables from its context to the slots of the e-class. Our evaluation of slotted e-graph uses two case studies from compiler optimization and theorem proving to show that performing equality saturation for languages with bound variables is greatly simplified and that we can solve practically relevant problems that cannot be solved with e-graphs using de Bruijn indices.

Document type Article
Language English
Published at https://doi.org/10.1145/3729326
Other links https://www.scopus.com/pages/publications/105008278696
Downloads
3729326 (Final published version)
Permalink to this page
Back