paperbot · PL 论文追踪

全部论文 待读 收藏

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

Slotted E-Graph:为(绑定)变量提供一等支持
PLDI 9(PLDI)2025匹配度 3/10 · 论文研究 E-Graph 数据结构对绑定变量的支持,属于程序语言、编译优化与定理证明的形式化基础工作,但与用户核心关注的 LLM/Agent 与静态分析/形式化验证交叉、浮点程序分析、贝叶斯程序分析等方向没有直接关联,也未涉及 AI/ML 系统或工业落地案例。引用 1 inbox
Rudi Schneider, Marcus Rossel, Amir Shaikhha, Andrés Goens, Thomas Kœhler, Michel Steuwer
crossref: 2026-09-10

AI 速览

一句话:提出槽位 E-Graph,将绑定变量作为内建一等特性,使仅变量名不同的项共享表示,避免 E-Graph 膨胀。

Equality saturation 以 e-graph 高效唯一表示等价子项,但将 e-graph 扩展到含(绑定)变量的语言时,无论用名字还是 de Bruijn 索引表示变量,仅变量名不同的子项都会被分开表示,破坏共享,导致 e-graph 膨胀、性能下降和表达力受限。本文提出 slotted e-graph,将绑定变量作为数据结构的内建一等特性,用 slots 参数化表示等价项的 e-class 以抽象其自由变量;e-node 引用 e-class 时需将上下文变量关联到该 e-class 的 slots。评估通过编译器优化与定理证明两个案例研究,表明对有绑定变量的语言执行 equality saturation 被大幅简化,并能解决使用 de Bruijn 索引 e-graph 无法处理的实用问题。

问题
如何在 e-graph 中高效表示含绑定变量的语言,避免仅变量名不同导致共享破坏与 e-graph 膨胀。
方法
提出 slotted e-graph,将绑定变量内建为一等特性,用 slots 参数化 e-class,并在 e-node 引用时建立上下文变量到 slots 的关联。
评估
通过编译器优化与定理证明两个案例研究进行评估,显示可简化 equality saturation 并解决 de Bruijn 索引 e-graph 难以处理的实用问题。
原文摘要(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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3096,
  title = {Slotted E-Graphs: First-Class Support for (Bound) Variables in E-Graphs},
  author = {Rudi Schneider and Marcus Rossel and Amir Shaikhha and Andrés Goens and Thomas Kœhler and Michel Steuwer},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {PLDI},
  year = {2025},
  doi = {10.1145/3729326}
}