gemini-2.5-pro| input-price: 1.25 output-price: 10 max-context-length: 200_000 (cost: $0.12) · Anfrage: 2025-07-15T13:03:58.715764
Generated by rs-summarizer Version unbekannt
Abstract:
This paper introduces egglog, a fixpoint reasoning system that unifies the capabilities of Datalog and equality saturation (EqSat). The system is motivated by the complementary weaknesses of the two paradigms: Datalog struggles with efficient equational reasoning, while EqSat lacks support for rich, compositional analyses. egglog addresses this by providing a Datalog-like language that incorporates a built-in, extensible notion of equality and uninterpreted functions. A key technical innovation is the use of merge expressions, a novel mechanism for resolving functional dependency violations that arise when terms are unified, enabling both congruence closure (like EqSat) and lattice-based reasoning (like advanced Datalog systems).
The authors evaluate egglog by reimplementing two real-world applications: a unification-based pointer analysis originally in Datalog and a floating-point optimizer (Herbie) based on EqSat. The results demonstrate that the egglog versions are significantly faster (e.g., a 4.96x speedup for the pointer analysis), are simpler to implement, and fix soundness bugs present in the original systems by enabling the sound application of conditional rewrite rules.
Better Together: A Unified System for Analysis and Optimization
egglog Solution: egglog is a new fixpoint reasoning system that unifies Datalog and EqSat. It combines Datalog's strengths—such as incremental execution and composable analyses—with EqSat's efficient term rewriting and congruence closure.egglog allows users to declare uninterpreted sorts (types) and union values of these sorts. This operation, backed by a union-find data structure, makes two values indistinguishable to the system, forming the basis for all equational reasoning.egglog is expressed as simple rules. A rewrite from one term to another is syntactic sugar for a rule that finds the first term and unions it with the second, effectively adding it to the same equivalence class.egglog is implemented in Rust and leverages database optimizations. It uses a relational query engine with semi-naïve evaluation, an incremental technique from Datalog that avoids re-deriving old facts, leading to significant performance gains.egglog.
egglog version is 4.96x faster than the fastest sound Soufflé (Datalog) implementation and significantly simpler. It avoids inefficient "join modulo equivalence" operations and complex, bug-prone encodings that were necessary in the original Datalog version.egglog.
egglog's support for rich, interacting analyses (e.g., interval analysis) allows Herbie to apply its rewrite rules soundly for the first time, for instance by proving that a denominator is non-zero before applying a division rule. The new version is faster overall and often finds more accurate results.