EGGs are adhesive!

📅 2025-03-17
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
E-graphs (as implemented in Egg) lack formal semantic foundations and support for modeling concurrent operations in equality-saturation–based program optimization. Method: We introduce the first categorical modeling of E-graphs as structures within an adhesive category, defining node equivalence relations and operator closures via rigorous categorical semantics to formally characterize rewriting behavior, dynamic merging, and concurrent updates. Contribution/Results: This framework unifies confluence proofs, parallel rewriting analysis, and compositional transformation verification, while providing a categorical foundation for dynamically adding equivalent components. By deeply integrating graph rewriting theory with equality saturation—unlike prior approaches that treat them separately—our method significantly strengthens correctness guarantees and formal verifiability of optimization processes. The adhesive category setting ensures well-behaved pushouts and pullbacks, enabling precise reasoning about structural changes during saturation. This advances the theoretical underpinnings of e-graph–based optimizers and supports mechanized verification of their semantics.

Technology Category

Application Category

📝 Abstract
The use of rewriting-based visual formalisms is on the rise. In the formal methods community, this is due also to the introduction of adhesive categories, where most properties of classical approaches to graph transformation, such as those on parallelism and confluence, can be rephrased and proved in a general and uniform way.E-graphs (EGGs) are a formalism for program optimisation via an efficient implementation of equality saturation. In short, EGGs can be defined as (acyclic) term graphs with an additional notion of equivalence on nodes that is closed under the operators of the signature. Instead of replacing the components of a program, the optimisation step is performed by adding new components and linking them to the existing ones via an equivalence relation, until an optimal program is reached. This work describes EGGs via adhesive categories. Besides the benefits in itself of a formal presentation, which renders the properties of the data structure precise, the description of the addition of equivalent program components using standard graph transformation tools offers the advantages of the adhesive framework in modelling, for example, concurrent updates.
Problem

Research questions and friction points this paper is trying to address.

Formalizing E-graphs using adhesive categories for program optimization.
Enhancing program optimization via equality saturation and equivalence relations.
Leveraging adhesive categories to model concurrent updates in graph transformations.
Innovation

Methods, ideas, or system contributions that make the work stand out.

Uses adhesive categories for graph transformation
Implements equality saturation via E-graphs
Optimizes programs by adding equivalent components
🔎 Similar Papers
No similar papers found.
R
Roberto Biondo
Department of Computer Science, University of Pisa, Pisa, IT
D
Davide Castelnovo
Department of Computer Science, University of Pisa, Pisa, IT
Fabio Gadducci
Fabio Gadducci
Professore di Informatica, Università di Pisa
formal methodsprogramming languagessemantics