Expand description
Structure-detecting solve front-end — the auto-dispatcher that puts our whole arsenal behind a single entry point.
An opaque CNF is offered, in cost order, to a battery of CHEAP (O(clauses)) structure recognizers — each polynomial on structure that costs plain CDCL/resolution exponentially, and each FAIL-CLOSED: it claims a verdict only with a re-checked certificate (a Hall witness, a cutting-plane derivation, a GF(2) refutation, a covering-measure collapse, or — the complete deciders — a 2-SAT/Horn model). Anything no recognizer fires on is decided by the authoritative CDCL core. Every recognizer is cheap to apply AND to reject, so the dispatcher is never slower than the plain solver — only faster when structure is present.
Routes, in order:
- 2-SAT (
twosat) — every clause ≤ 2 literals: linear, decides SAT (with model) or UNSAT. - Horn (
hornsat) — every clause ≤ 1 positive literal: linear least-model / refutation. - LLL (
lll) — satisfiability from sparsity: when every clause shares variables with few others (e·2^{-w}·(d+1) ≤ 1), a model is guaranteed and constructed by Moser–Tardos. The SAT-side specialist, dual to the UNSAT recognizers below. - Pigeonhole / Hall (
pigeonhole::decide_pigeonhole_unsat) — bipartite-matching infeasibility: crushes pigeonhole (PHP) instances of any size in microseconds. - Cutting planes (
pseudo_boolean::refute_clausal) — cardinality refutation. - Parity / GF(2) (
xorsat::refute_via_parity) — XOR/Tseitin linear systems. - Covering collapse (
lyapunov::auto_collapse) — auto-discovers the covering symmetry (pigeonhole, clique-colouring, …) or parity collapse with a Lyapunov-certified artifact. - CDCL — the authoritative fallback (model on SAT, RUP proof on UNSAT).
Structs§
- Solved
- A decided instance.
- Symmetric
Count - The solution set described up to symmetry: one representative per orbit, plus the exact total.
- Symmetry
Profile - The structural profile of a formula’s variable-symmetry group —
|Aut|, the orbit/rank/transitivity ladder, primitivity, and block structure. The data a surfacing layer (e.g. a Studio panel) needs to explain why an instance is symmetric.
Enums§
- Answer
- The verdict; a model on SAT, with any UNSAT certificate carried in
Solved::proof. - Equiv
Verdict - The verdict of a symmetry-reduced equivalence check.
- Route
- Which engine decided the instance.
Functions§
- almost_
symmetry_ pairs - The almost-symmetries (variable transpositions) of a CNF: pairs
(a,b)whose swap preserves all but at mostmax_brokenclauses. Returns each pair with the broken imagesσ(B) = { swap(c) : swap(c) ∉ F }— the clauses that must hold for the swap to map a model to a model, i.e. the guard. An empty image set is a true (syntactic) symmetry and is excluded. - assignment_
weight_ inventory - The weight inventory of a formula’s variable symmetry: entry
wis the number of essentially- distinct (modulo symmetry){0,1}assignments to the variables with exactlywones — the weighted Pólya refinement ofSymmetryProfile::assignment_orbits(which is the sum).Nonewhen the group is too large to enumerate. - association_
scheme_ eigenmatrix - The eigenmatrix (P-matrix) of the association scheme of a formula’s variable symmetry — the scheme’s
“character table”. The coherent configuration (
coherent_configuration_constants) yields a commutative algebra spanned by the relation matricesA_i(A_i A_j = Σ_k a_{ijk} A_k); its intersection matricesB_i(B_i[k][j] = a_{ijk}) commute and are simultaneously diagonalizable, andP[m][i]is the eigenvalue ofA_ion them-th common eigenspace. Computed exactly over aGF(p)chosen (by search) so the algebra splits — Dixon’s method applied to the scheme. Returns(prime, P). - association_
scheme_ multiplicities - The multiplicities of the association scheme — the dimensions
m_jof the common eigenspaces of the relation matrices in the full|X|-dimensional space; the “degrees” of the scheme, dual to the valencies. From the eigenmatrixP(#eigenmatrix) and the scheme orthogonality relationm_j = |X| / Σ_i P[j][i]·P[j][ī]/k_i(k_i= valency,ī= transpose relation). Computed exactly over aGF(p)chosen to split the algebra AND exceed|X|(so the small positive integerm_j ≤ |X|decodes uniquely). Returns the multiplicities sorted ascending. - automorphism_
group_ order - The order of
Aut(G)for a formula’s variable-symmetry groupG— the automorphism group of the symmetry itself.Nonewhen out of range. - break_
all_ symmetry - Iterated symmetry breaking to a fixpoint — the automated breaker. Repeatedly detect the formula’s
variable symmetry and break each generator with one sound lex constraint —
x_v ≤ x_{g[v]}atg’s least moved pointv(v < g[v], and the lex-minimum ofg’s orbit satisfies it, so it keeps ≥ 1 model per orbit, no auxiliary variables) — then re-detect on the strengthened formula, so symmetry that earlier breaks expose is broken in its turn. It runs until a round adds no new constraint: the symmetry “broken to conclusion.” Sound: every clause breaks a genuine symmetry of the current formula, so each round is equisatisfiability-preserving and the whole is equisatisfiable with the input. Returns the original clauses plus the accumulated breaks; the residual variable-symmetry group has shrunk (to trivial when single-bit breaks suffice). Solve the result withsolve_comprehensive. - break_
all_ symmetry_ complete - Complete symmetry breaking — the breaker driven all the way to a single representative per orbit.
Detect the full variable-symmetry group and add the COMPLETE lex-leader (one
a ≤_lex a∘gper group element, via the standard lex-chain auxiliaries), which admits exactly one model per symmetry orbit when the group is enumerable. Returns the strengthened clauses and the new variable count (originals + auxiliaries). Sound (equisatisfiable with the input); complete for groups up to the enumeration cap, and a sound partial break (generators ∪ coset representatives) for larger ones. Unlikebreak_all_symmetry(aux-free, complete only for fully-symmetric orbits), this leaves no residual orbit symmetry. - burnside_
ring_ product - The Burnside ring multiplication of a formula’s variable-symmetry group —
N[a][b][l], the decomposition of the product G-set(G/H_a)×(G/H_b)into transitive G-sets (the G-set analogue of the character table’s fusion ring).Nonewhen the subgroup lattice is out of range. - canonical_
form - The canonical form of a formula’s variable structure, computed by individualization–refinement (the
algorithm behind nauty/saucy/bliss). It is an isomorphism invariant: two formulas equal up to a
variable permutation that preserves the clause structure have the same canonical form, and — since
I-R is complete — two that are not get different canonical forms (so it decides isomorphism exactly,
unlike Weisfeiler–Leman). Built on
color_refinementas its refinement step.Noneif the search exceeds its node budget (gate to moderatenum_vars). - character_
table - The character table of a formula’s variable-symmetry group, computed exactly over a finite field by
the Burnside–Dixon algorithm (degrees +
GF(p)-valued irreducible characters). The deepest structural view of the symmetry —Nonewhen the group is too large for the finite-field diagonalisation. - class_
algebra_ constants - The class-algebra structure constants of a formula’s variable-symmetry group —
a[i][j][k], the multiplication coefficients of the conjugacy classes (Cᵢ·Cⱼ = Σₖ a[i][j][k]·Cₖ), the foundation of the character table.Nonewhen the group is too large to enumerate. - coherent_
configuration_ constants - The coherent configuration (association scheme) that 2-WL stabilizes into: its
dbasis relations (the stable pair-color classesR_0,…,R_{d-1}) and their intersection numbersp[i][j][k] = |{z : (x,z) ∈ R_i and (z,y) ∈ R_j}|for any(x,y) ∈ R_k. Returns(d, p). - coherent_
rank - The rank of the coherent configuration — the number of basis relations (
d), the dimension of the coherent algebra. Equal totwo_wl_pair_cells; for a group’s orbital configuration it is the orbital rank.Nonewhen the configuration is out of range / not coherent. - color_
refinement - Color refinement (1-dimensional Weisfeiler–Leman) of a formula’s variable–clause incidence graph —
the coarsest equitable partition of the variables, computed in polynomial time. Variables and clauses
are coloured (clauses initialised by width); each round recolours a clause by the sorted multiset of its
incident
(variable colour, sign)pairs and a variable by the sorted multiset of its incident(clause colour, sign)pairs, to a fixpoint. The resultcell[v]is the variable’s colour. - color_
refinement_ cells - The number of cells in the color-refinement (equitable) partition — a cheap polynomial symmetry
indicator. At most the number of variable orbits (
cells ≤ orbits, since each cell is a union of orbits). - common_
automorphism_ generators - The common variable automorphisms of two formulas — phase-free permutations
σwithσ(F)=FANDσ(S)=S, a generating set for a subgroup ofAut(F) ∩ Aut(S). Detected from each formula’s own automorphisms and then VERIFIED against both clause sets, so every returned generator is a genuine common automorphism (a wrong one can never slip through). This is the group under which a disagreement betweenFandSis symmetric: ifσfixes both, thenFandSdisagree ataiff they disagree atσ(a)— so equivalence checking can be reduced along its orbits. - equivalence_
check_ counts (checks_with_symmetry, naive_checks)— the number of entailment checks the symmetry reduction performs (one per clause-orbit, both directions) versus the naive per-clause count. Equal when there is no usable common symmetry; strictly smaller when the shared automorphism group fuses clauses into orbits.- equivalent_
modulo_ symmetry - Logical equivalence
F ≡ S, symmetry-reduced.F ≡ SiffF ⊨ SandS ⊨ F, andF ⊨ SiffFentails every clause ofS. The key reduction: for a common automorphismσ ∈ Aut(F) ∩ Aut(S),F ⊨ C ⟺ F ⊨ σ(C)(a model ofF ∧ ¬Cmaps underσto a model ofF ∧ ¬σ(C)), so it suffices to check one clause per orbit ofS’s clauses under the common symmetry (and dually forF). The verdict is unchanged from the naive check — only the work shrinks — and aDifferwitness is a concrete, re-checkable disagreement (it satisfies one formula and violates a clause of the other). This is the symmetry-aware companion tocrate::sat::prove_equivalence. - formulas_
isomorphic - Whether two formulas over the same variables are isomorphic — equal up to a variable permutation
preserving the (signed) clause structure — by comparing their canonical forms.
Noneif either canonical form exceeds the search budget. - fractional_
automorphism - A fractional automorphism of a formula: a doubly-stochastic matrix
Bcommuting with the variable co-occurrence matrixA(BA = AB) — the LP relaxation of an automorphism (a permutation matrix commuting withA). The canonical one is block-averaging over the coarsest equitable partition ([equitable_partition_of]):B[u][v] = 1/|cell(u)|ifu,vshare a cell, else0. By Tinhofer’s theorem it commutes withAiff the partition is equitable, and it is non-trivial (not a permutation) exactly when the partition is non-discrete — i.e. exactly when the formula has non-trivial 1-WL symmetry. - frobenius_
schur_ indicators - The Frobenius–Schur indicators of a formula’s variable-symmetry group —
+1/0/−1per irreducible (real/complex/quaternionic), the finest representation-theoretic refinement of the symmetry (it separates groups even when the character table cannot).Nonewhen out of range. - galois_
class_ orbits - The Galois orbits on conjugacy classes of a formula’s variable symmetry — classes fused by the
(ℤ/e)*actionC ↦ C^t(algebraic conjugacy). The singletons are the rational classes.Nonewhen out of range. - generating_
tuple_ count - The number of ordered
k-tuples of symmetries that generate the whole variable-symmetry groupG(Hall’s Eulerian functione_k(G));e_k(G)/|G|^kis the probabilitykrandom symmetries generate it.Nonewhen out of range. - is_
fractional_ automorphism - Verify that block-averaging over
partitiongives a doubly-stochastic matrixBcommuting with the co-occurrence matrixA.Bis doubly-stochastic by construction (each row/column sums to 1), so this checksBA = AB, which holds iffpartitionis equitable — the exact (integer) certificate. The identity(1/|cell(u)|)·Σ_{x∈cell(u)} A[x][w] = (1/|cell(w)|)·Σ_{x∈cell(w)} A[u][x]is verified cross-multiplied. - isotypic_
multiplicities - The isotypic decomposition of a formula’s variable-permutation representation — the multiplicity of
each irreducible in
π = Σ_s m_s χ_s. The representation-theoretic spectrum of the symmetry, tying the character table back to the orbit/orbital structure of the action.Nonewhen out of range. - mine_
clauses - The clause-bundle pass. Run every structure-mining contributor and union the implied clauses (no-goods) they discover. Each contributor’s soundness contract: every returned clause is implied by the formula, so the union preserves the solution set — a sound, never-worse enrichment that lets one method’s discovered structure accelerate the others (and CDCL). Contributors that find nothing are cheap, so this is safe to run before the fallback on any instance.
- mobius_
number - The Möbius number
μ(1, G)of the subgroup lattice of a formula’s variable-symmetry group.Nonewhen the subgroup lattice is out of range. - models_
up_ to_ symmetry - Enumerate the solution set up to symmetry, and count it exactly. Find a model (via the full
arsenal), record it as an orbit representative, then BLOCK its entire symmetry orbit and repeat until
unsatisfiable. Because every orbit is removed in one step, the representatives are the essentially-
distinct solutions and the exact model count is the sum of the orbit sizes — so an instance with
2^Θ(n)models is counted by enumerating only its (far fewer) orbits. Sound: each representative is a re-checked model, each orbit a genuine set of models (the generators are automorphisms), so the orbits partition the model set. The representative count agrees with Burnside (crate::sym_break::count_models_modulo_symmetry) — two independent routes to the orbit count. - optimization_
symmetry_ generators - The symmetries of an optimization problem
(F, weights): variable automorphisms ofFthat also preserve the objective (weights[g[v]] = weights[v]for allv). Under such aσthe objective is constant on orbits, so every optimal model’s whole orbit is optimal — the group along which the optimum may be symmetry-reduced. Verified against bothFand the weights, so every generator is genuine. - optimize_
enumeration_ counts (models_with_symmetry, models_without_symmetry)— how many candidate models the optimizer enumerates with the symmetry break versus the naive enumeration. Equal with no usable symmetry, smaller when the objective-preserving group fuses optimal (and non-optimal) models into orbits.- optimize_
modulo_ symmetry - Weighted minimization, symmetry-reduced. Minimise
Σ weights[i]·x_iover the models ofclauses, exploitingoptimization_symmetry_generators: break the objective-preserving symmetry, then search the reduced model space. SOUND — the optimum is identical to the unbroken problem (an optimal orbit’s lex-leader survives the break and has the same objective) and the witness is a genuine model of the originalF.NoneiffFis unsatisfiable. The symmetry-aware optimizer (a new problem class beyond the decision/counting/equivalence faces). - pb_
symmetry_ profile - The
SymmetryProfileof a pseudo-Boolean system’s coefficient-symmetry group — variables that share a coefficient profile across all constraints (crate::pseudo_boolean::coeff_symmetry_generators) — read through the same structural ladder assymmetry_structure. The symmetry of weighted constraints, surfaced exactly like the clause-structure symmetry. - permutation_
character - The permutation character
π(g) = #fixed variables of gof a formula’s variable-symmetry action, valued per conjugacy class. The character of the representation the symmetry group carries on the variables themselves.Nonewhen the group is too large to enumerate. - permutation_
character_ decomposition - The permutation-character decomposition of a formula’s variable-symmetry group — the bridge between
its table of marks and its character table.
M[i][s]is the multiplicity of irreducibleχ_sin the permutation representation on the cosetsG/H_i(Frobenius reciprocity). Returns(subgroup_orders, irreducible_degrees, M).Nonewhen out of range. - provably_
asymmetric_ variables - The variables that color refinement places in a singleton cell — provably fixed by every (phase-free)
automorphism, since
orbit(v) ⊆ cell(v)and|cell(v)| = 1forces|orbit(v)| = 1. A polynomial certificate of asymmetry: these variables can be skipped entirely when detecting or breaking symmetry. - semantic_
symmetry_ pairs - The semantic symmetries (variable transpositions) of a CNF: pairs
(a,b)whose swap preserves the MODEL SET,F ≡ swap(F), even when it does NOT preserve the clause set. Checked by implication:F ⊨ swap(F)(and, by the involutionswap² = id, that is full equivalence). Returns the semantic pairs and whether any is non-syntactic (clause set changed) — i.e. genuinely beyond what the syntactic detector (crate::sym_break::variable_automorphism_generators) can see. - solve_
by_ components - Decide via plain component decomposition as a public dispatcher route: split into independent components and solve each apart through the full arsenal, combining the verdicts. A single component (or a model that fails the fail-closed recheck) defers to the plain CDCL fallback.
- solve_
by_ symmetry_ breaking - Solve by breaking all symmetry first — the breaker as a front-end. Run the aux-free recursive
breaker (
break_all_symmetry) to collapse the symmetry to its fixpoint, then decide the reduced formula with the full arsenal (solve_comprehensive). Equisatisfiable, so the verdict is the original’s, and any returned model satisfies the original clauses (a subset of the broken set) — re-checked fail-closed. (Uses the aux-free reducer, notbreak_all_symmetry_complete: CDCL handles the residual cheaply, and the complete lex-leader of a large group would be far more expensive than the search it saves.) - solve_
comprehensive - The full arsenal in one call — the opt-in power-mode solver. Runs the cheap specialists
(
structured_prefix); then, before the exponential CDCL fallback, the heavier engines the fast path skips: bounded-degree Nullstellensatz / Polynomial Calculus (the nonlinear algebraic refutation,crate::polycalc) and complete lex-leader symmetry breaking (crate::sym_break: the whole automorphism group from the Schreier–Sims backend, feeding CDCL a one-model-per-orbit formula). Slower thansolve_structured(it may run Nullstellensatz and automorphism detection), so it is the maximum-power entry, not the default. Always correct — the CDCL fallback is complete. - solve_
structured - Decide
clausesovernum_varsvariables, routing through every cheap specialist before CDCL — the fast default front-end. For the full arsenal (heavy algebraic + complete symmetry breaking before the fallback) usesolve_comprehensive. - solve_
with_ declared_ symmetry - The full arsenal with caller-DECLARED symmetry. The modeler often knows symmetries the automatic
detector cannot afford to find (geometric, semantic, or simply large). This entry point accepts declared
variable-permutation generators, verifies each is a genuine symmetry ([
is_declared_symmetry] — never trusting a declaration blindly, so an incorrect one is silently dropped), unions the survivors with the auto-detected symmetry, and breaks the combined group with the lex-leader (complete by enumeration when the group is small, partial over the generators otherwise). Sound: only verified, model-set- preserving permutations enter the break; a SAT model is re-checked, and on any anomaly it falls back to the authoritativesolve_comprehensive. With no declared and no detected symmetry it simply issolve_comprehensive. - structured_
prefix - The cheap-specialist chain — every route O(clauses) to apply and reject, so the front-end is never
slower than plain CDCL. Returns the decision if a specialist fires, or
None(the CDCL fallback is needed). Public so callers that only want the O(clauses) specialist verdict — e.g. a per-node cofactor-DAG leaf check — can skip the expensive CDCL search entirely. - symmetry_
structure - Compute the
SymmetryProfileofclauses— detect the variable-symmetry generators and read off the whole structural ladder (order via Schreier–Sims, orbits, orbitals/rank, transitivity, primitivity, blocks). The rank and transitivity rungs are gated to moderate sizes (their tuple spaces grow with the degree);0signals “not computed” there. - table_
of_ marks - The table of marks of a formula’s variable-symmetry group — the Burnside-ring classification of its
G-sets (the permutation-representation analogue ofcharacter_table). Returns(subgroup_class_orders, marks).Nonewhen the subgroup lattice is out of range. - tensor_
decomposition - The tensor (fusion) decomposition of a formula’s variable-symmetry irreducibles —
N[i][j][k], the multiplicity ofχ_kinχ_i ⊗ χ_j, the multiplication table of the representation ringR(G).Nonewhen the character table is out of range. - three_
wl_ colors - 3-dimensional Weisfeiler–Leman (3-WL) of a formula’s variables — color refinement on ordered
triples. A triple
(i,j,k)is initialized by the 2-WL colors of its three pairs(pc[i][j], pc[i][k], pc[j][k]), then each round recolored by(old color, sorted multiset over all w of (color(w,j,k), color(i,w,k), color(i,j,w)))to a fixpoint. Returns then×n×ncolor tensor. - three_
wl_ fingerprint - The label-independent 3-WL fingerprint: the sorted multiset of triple-color class sizes. Separates strongly-regular graphs that share every 2-WL invariant (the rook’s vs Shrikhande graph).
- two_
wl_ fingerprint - The label-independent 2-WL fingerprint: the sorted multiset of pair-color class sizes. Two formulas with different fingerprints are provably non-isomorphic (as colored variable structures) — the distinguishing power that separates, e.g., a 6-cycle from two triangles where 1-WL cannot.
- two_
wl_ pair_ cells - The number of distinct 2-WL pair colors — at most the number of orbitals (
pair-cells ≤ orbitals). - two_
wl_ pair_ colors - 2-dimensional Weisfeiler–Leman (2-WL) of a formula’s variables — color refinement lifted from
vertices to ordered pairs. Each pair
(i,j)is colored: the diagonal by its 1-WL vertex color, an off-diagonal pair by(1-WL(i), 1-WL(j), co-occurrence signature)where the signature is the sorted multiset over clauses containing both of(clause width, sign of i, sign of j). Each round recolors(i,j)by(old color, sorted multiset over all k of (color(i,k), color(k,j))), to a fixpoint. - weighted_
model_ count - Symmetry-accelerated weighted model counting — the partition function
Z = Σ_{m ⊨ F} W(m)with literal weightsW(m) = Π_v weight[v].{1 if m[v] else 0}. The formula’s variable symmetry partitions the models into orbits, so eachsolve()recovers one model, its whole orbit is enumerated and its members’ weights summed, then the entire orbit is blocked — one solve per orbit instead of per model. Exact for ARBITRARY weights (every model’s true weight is summed; the symmetry only groups the search), the symmetry-aware analogue of weighted #SAT / lifted inference. ReturnsZ. - weighted_
model_ count_ solve_ counts (orbit_solves, total_models)— how manysolve()calls the symmetry-accelerated weighted count makes (one per model-orbit) versus the number of models. Equal with no usable symmetry, smaller when symmetry fuses models into orbits.