一句话:为幺半群 e-graph 建立范畴语义与 e-超图表示,并实现 DPO 重写。
等式饱和通过给图配备等价关系来优化程序,但已有 e-graph 技术主要局限于笛卡尔(代数)理论。本文用半格范畴丰富化的笛卡尔范畴给出 e-graph 的范畴语义,并将其推广到幺半群范畴,从而把等式饱和扩展到幺半群理论。作者进一步提出 e-超图,作为该范畴态射的可靠且完备的组合表示,使许多结构方程被同构吸收。基于该表示,论文给出 e-超图上的双推重写(DPO)规则,构成主要贡献。这为 e-graph 提供了原理化的重写框架,有望支持更广泛的程序优化应用。
The technique of equality saturation, which equips graphs with an equivalence relation, has proven effective for program optimisation. We give a categorical semantics to these structures, called e-graphs, in terms of Cartesian categories enriched over the category of semilattices. This approach generalises to monoidal categories, which opens the door to new applications of e-graph techniques, from algebraic to monoidal theories. Finally, we present a sound and complete combinatorial representation of morphisms in such a category, based on a generalisation of hypergraphs which we call e-hypergraphs. They have the usual advantage that many of their structural equations are absorbed into a general notion of isomorphism. This new principled approach to e-graphs enables double-pushout (DPO) rewriting for these structures, which constitutes the main contribution of this paper.