We demonstrate a new connection between e-graphs and Boolean circuits. This allows us to adapt existing literature on circuits to easily arrive at an algorithm for optimal e-graph extraction, parameterized by treewidth, which runs in $2^{O(w^2)}\text{poly}(w, n)$ time, where $w$ is the treewidth of the e-graph. Additionally, we show how the circuit view of e-graphs allows us to apply powerful simplification techniques, and we analyze a dataset of e-graphs to show that these techniques can reduce e-graph size and treewidth by 40-80% in many cases. While the core parameterized algorithm may be adapted to work directly on e-graphs, the primary value of the circuit view is in allowing the transfer of ideas from the well-established field of circuits to e-graphs.
翻译:我们揭示了e-graphs与布尔电路之间的新联系。这一发现使我们能够借鉴现有电路理论文献,推导出基于树宽度的最优e-graph提取算法,其时间复杂度为$2^{O(w^2)}\text{poly}(w, n)$,其中$w$表示e-graph的树宽度。此外,我们展示了e-graph的电路视角如何支持应用强大的简化技术,并通过分析e-graph数据集证明这些技术能在多数情况下将e-graph规模和树宽度降低40-80%。虽然核心参数化算法可直接适配于e-graphs,但电路视角的主要价值在于能够将成熟电路领域的思想迁移至e-graph研究中。