CS Paper Radar

Associativity and Commutativity in Equality Saturation

Tarik Rosin, Marcel Ullrich, Sebastian Hack

cs.PL ·submitted 2026-10-01 07:10 UTC · v1
unusual

Abstract

Equality saturation is a promising technique for program optimization which sidesteps the phase ordering problem. However, current e-graph implementations grow exponentially large, even for simple examples. Many practical applications involve associative and commutative (AC) operators. We present an extension of relational e-matching that handles AC operators natively by storing terms as multisets. Preliminary results show that equality saturation modulo AC uses asymptotically less memory in certain cases.

Closest papers

Nearest neighbours by meaning across the whole index.

Augmenting Rewrite Rule Sets via Knuth-Bendix Completion

cs.PL ·2026-10-01 ·Michael Schifferer, Marcel Ullrich, Sebastian Hack
similarity 0.54
Abstract

Equality Saturation (EqSat) is a powerful technique for program optimization, systematically exploring the search space of candidate programs to overcome the phase ordering problem. However, the feasibility and performance of EqSat rely heavily on the specific rewrite rules used to derive equivalent programs. These rule sets are typically handcrafted, requiring extensive domain expertise and carrying the risk of missing valuable transformations. In this work, we evaluate Knuth-Bendix Completion (KBC) as a method for automatically generating and augmenting rewrite rules for EqSat. Our experiments show faster optimization as well as reaching better terms with previously missed optimizations.

0.21

Associativity of Multiplication Is Hard for Resolution

cs.CC cs.LO ·2026-10-06 ·Vincent Liew
theorycode/data similarity 0.54
Abstract · 33 pages, 10 figures. Lean 4 formalization of the main theorems at https://github.com/dysfunctor/associativity

SAT solvers are empirically known to perform poorly when reasoning about multiplication. Yet for over a decade we have lacked a theoretical explanation for this phenomenon. CDCL SAT solvers implicitly search for resolution proofs, and no lower bound on proof size has ruled out the existence of short proofs that solvers simply fail to find. We give the first lower bound of this kind by showing that general resolution proofs of the associativity of $n$-bit multiplication require size $2^{Ω((n/\log n)^{1/4})}$. This lower bound holds for a broad class of multiplier encodings based on partial product summation, including the standard array and Wallace-tree multipliers used to bit-blast multiplication in SMT solvers. This result resolves an open problem of Beame and Liew. The proof constructs a reduction from a perfect-matching principle on bounded-degree bipartite expander graphs to multiplier associativity. Itsykson, Slabodkin, and Sokolov proved that this principle is hard for resolution. The lower bound for multiplier associativity follows. The same reduction, when combined with Håstad's recent lower bound for the perfect-matching principle of the odd grid, yields an exponential lower bound for multiplier associativity in the stronger bounded-depth Frege proof systems.

0.38

Guanaco: A Global-Uniformity Algorithm for Near-Submodular-Width Conjunctive Query Evaluation

cs.DB cs.DS ·2026-10-04 ·Mahmoud Abo Khamis, Hubie Chen
similarity 0.54
Abstract

We present Guanaco, an algorithm for performing conjunctive query evaluation where, for each Boolean conjunctive query, and positive epsilon, the algorithm achieves polynomial time with exponent equal to the submodular width plus epsilon. The algorithm and its running time generalize smoothly to general conjunctive queries. We believe the algorithm and its analysis to be notably simple, indeed, together we believe they form a highly simple argument that conjunctive query evaluation can be performed in essentially submodular width time. In the case of Boolean conjunctive queries, the algorithm is based on interleaving three simple primitives: a subroutine for establishing a form of consistency; a subroutine for establishing global uniformity, which, briefly speaking, partitions relations as needed to control discrepancies between average degree and maximum degree; and, a simple step that joins pairs of existing relations to form new relations.

0.22

Type-Checking for Pattern-Based Tree Transformations

cs.FL cs.CL ·2026-10-08 ·C. Aiswarya, Sahil Mhaskar, M. Praveen
similarity 0.53
Abstract · 26 pages, 9 figures, full version of a preprint accepted at FSTTCS 2026

We introduce and study pattern-based tree transformations. As an illustrating example, consider a source pattern $(x \cdot y) + (x \cdot z)$ and a target pattern $x \cdot (y + z)$ as a pair. This source pattern matches any expression $e$ of the form $(e_1 \cdot e_2) + (e_1 \cdot e_3)$ (by substituting $x$ with $e_1$, $y$ with $e_2$, and $z$ with $e_3$) and the pair transforms it into the expression $e_1 \cdot (e_2 + e_3)$ as dictated by the target pattern. Note that in this example, the set of expressions that match the source pattern is not a regular tree language. We propose a model of tree transformations given by a finite representation of a (possibly infinite) set of such (source pattern, target pattern) pairs. The expressive power of this model comes at the cost of undecidability of checking equivalence. Nevertheless, we show that the type-checking problem is decidable for our model of pattern-based tree transformations. The type-checking problem asks whether applying a given transformation to trees having a given regular property (type) preserves the property. Our decision procedure is by a reduction to the emptiness problem of alternating tree automata.

0.30

The complexity of entangled graph colouring via polymorphisms

cs.CC quant-ph ·2026-10-01 ·Eric Culf
theory similarity 0.52
Abstract · 33 pages, 0 figures

Constraint satisfaction problems (CSPs) with operator assignments to the variables provide a well-structured setting to study the decision complexity of the entangled value of classes of nonlocal games. Due to the CSP dichotomy theorem, the complexity of constraint satisfaction problems with classical assignments can be fully understood by studying the symmetries of the CSP, in terms of the polymorphisms of the underlying relational structure. In this work, we show that the polymorphism-based reductions between CSPs can be generalised to gap-preserving reductions between entangled CSPs based on an entangled analogue of the polymorphisms. This reduction allows us to show undecidability of entangled graph colouring with more than three colours, a problem that has proved resistant to prior hardness reductions based on commutativity gadgets.

0.50

Compact Partial Symmetry Breaking for Graph Search Problems

cs.LO ·2026-09-18 ·Michael Codish, Mikoláš Janota, Peter J. Stuckey
similarity 0.52
Abstract

Symmetry breaking in graph search problems remains challenging: complete symmetry breaking constraints are typically exponential in size, while partial approaches trade precision for scalability. We introduce a strength-driven, redundancy-aware methodology for constructing compact partial symmetry breaking constraints based on graph patterns. Each pattern corresponds to a Boolean clause over equality literals and can be integrated directly into CP or SAT models. Our approach incrementally selects strong, non-redundant graph patterns, yielding partial symmetry breaks that achieve substantial pruning of non-canonical graphs while remaining compact in size. This provides a principled framework for deriving lightweight partial symmetry breaking constraints which are significantly more precise than all published state-of-the-art alternatives. We evaluate the proposed constraints on graph instances with up to 25 vertices using a redundancy ratio metric. The resulting partial symmetry breaks constitute only a small fraction of the size of complete symmetry breaking constraints, while delivering significant performance improvements across several graph search benchmarks compared to previously defined partial symmetry breaking methods.

0.24

Efficient Extraction for Effectful E-Graphs

cs.PL ·2026-09-25 ·Oliver Flatt, Anjali Pal, Yihong Zhang, Ryan Tjoa, Kirsten Graham +5 more
publishedtheory similarity 0.52
Abstract · Accepted for publication at OOPSLA 2026

Egraphs have enabled recent advances in program optimization, synthesis, and verification, yet remain difficult to apply to effectful programs whose memory and I/O operations must respect execution order. Existing effect-aware extraction algorithms rely on integer linear programming (ILP) and dominate total runtime. We introduce Statewalk DP, a new extraction algorithm that enforces effect ordering efficiently without external solvers. We prove that finding any effect-safe extraction is NP-complete, but show that Statewalk DP is tractable in statewalk width, a parameter that measures the complexity of dataflow interactions among effects. In practice, statewalk width generally remains small, enabling Statewalk DP to achieve order-of-magnitude speedups over ILP extraction while producing programs comparable to LLVM across our benchmarks. We implement the algorithm in eggcc, a prototype egraph-based compiler for imperative Bril programs and demonstrate that effect-aware extraction is no longer a bottleneck.

0.32

StructHCP: Structure-Aware SAT--CEGAR for the Hamiltonian Cycle Problem

cs.LO ·2026-10-10 ·Quan Van Vi, Tuyen Van Kieu, Khanh Van To
similarity 0.51
Abstract · 9 pages, 2 figures, 5 tables

Many exact Hamiltonian-cycle solvers use the same edge-level representation for every input, even when graph structure admits a smaller set of global decisions. We present StructHCP, a SAT--CEGAR pipeline that selects a representation through inexpensive structural recognizers. Specialized searches handle high-degree clusters and paired chains, while complete directed and undirected encodings handle cubic and general graphs. Every returned cycle is reconstructed when necessary and verified in the input graph. On the 1,001-instance FHCP Challenge Set, StructHCP solves 826 instances, compared with 741 when the same general SAT--CEGAR engine is applied directly to every unreduced input graph. Relative to this ablation, StructHCP reduces PAR-2 by 32.9 percent. Formulation selection solves 82 more instances than the contracted general encoding; high-degree-cluster and cubic graphs account for 81 of this difference. StructHCP also solves 34 of the 51 instances solved by neither HCup nor Cut-set CEGAR, raising the combined coverage of the three solvers from 950 to 984. Twelve of its solutions lie outside the union of published per-instance SAT results analyzed here, and six also lie outside the published exact result sets in our comparison. These results show that selecting the representation can complement connectivity refinement on structured HCP instances.

0.26