A count-preserving 3-coloring gadget graph of a CNF formula #
The gadget graph of DescriptiveComplexity.Problems.ThreeColorability.SatGadget
decides satisfiability but does not count models: its OR gate leaves its
output free when exactly one input is true. This file builds the graph the
counting reduction draws, whose proper 3-colorings are the models of the
formula, each 6 · 8 ^ g times, g the number of non-first occurrences
(DescriptiveComplexity.SatToColCount.card_proper).
The vertices are a palette T, F, B; a pair of complementary Boolean
vertices per variable of the formula and per gate, i.e., per non-first
occurrence of a clause, adjacent to each other and to B, so colored T and
F in some order; a spoiler per empty clause, adjacent to the palette; and
nine triangle vertices per gate. A triangle whose three vertices are attached
to three Boolean or palette vertices has exactly two colorings when these are
not all equal and none otherwise (DescriptiveComplexity.SatToColCount.tri_card),
and the gate z = p ∨ ℓ, p the value of the prefix of the clause before the
occurrence and ℓ its literal, is exactly
NAE(z, ¬p, ¬ℓ) ∧ NAE(¬p, z, F) ∧ NAE(¬ℓ, z, F)
(DescriptiveComplexity.SatToColCount.gate_iff): three triangles per gate,
each with two colorings. The value of the last prefix of each clause is
forced true by an edge to F.
The palette.
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Dependency graph
Two Boolean facts #
The color of a truth value: 0 for true, 1 for false.
Instances For
Dependency graph
Three colors are not all equal.
Instances For
Dependency graph
Equations
Dependency graph
The gate: z = p ∨ ℓ iff the three not-all-equal conditions hold.
Dependency graph
A triangle attached to three vertices of colors other than B has two
colorings when the three colors are not all equal, none otherwise.
Dependency graph
The graph #
The variables of the formula.
Equations
Instances For
Dependency graph
The gates: the non-first occurrences.
Equations
- DescriptiveComplexity.SatToColCount.Gate A = { o : A × A × Bool // DescriptiveComplexity.SatOcc.Chained o.1 o.2.1 o.2.2 }
Instances For
Dependency graph
The carriers of a Boolean pair: a variable or a gate.
Equations
Instances For
Dependency graph
The vertices outside the triangles.
Equations
Instances For
Dependency graph
The vertices: the core, and nine triangle vertices per gate.
Equations
Instances For
Dependency graph
Dependency graph
The prefix vertex of an occurrence: the vertex whose color is the disjunction of the literals of the clause up to it. The literal itself for the first occurrence, the output of the gate otherwise.
Equations
Instances For
Dependency graph
The predecessor of a gate.
Instances For
Dependency graph
Dependency graph
The value of the predecessor's prefix, negated.
Equations
Instances For
Dependency graph
The gate output.
Instances For
Dependency graph
The negated literal of a gate.
Equations
Instances For
Dependency graph
The attachment of the triangles of a gate: NAE(z, ¬p, ¬ℓ),
NAE(¬p, z, F) and NAE(¬ℓ, z, F).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The edges between core vertices, in one direction.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.SatToColCount.CoreE (Sum.inl p) (Sum.inl q) = (p ≠ q)
- DescriptiveComplexity.SatToColCount.CoreE (Sum.inr (Sum.inl (b, s))) (Sum.inr (Sum.inl (b', s'))) = (b = b' ∧ s' = !s)
- DescriptiveComplexity.SatToColCount.CoreE (Sum.inr (Sum.inl val)) (Sum.inl DescriptiveComplexity.SatToColCount.Pal.B) = True
- DescriptiveComplexity.SatToColCount.CoreE (Sum.inr (Sum.inr val)) (Sum.inl val_1) = True
- DescriptiveComplexity.SatToColCount.CoreE x✝¹ x✝ = False
Instances For
Dependency graph
The edges of the graph, in one direction.
Equations
- DescriptiveComplexity.SatToColCount.E (Sum.inl u) (Sum.inl v) = DescriptiveComplexity.SatToColCount.CoreE u v
- DescriptiveComplexity.SatToColCount.E (Sum.inr (g, j, r)) (Sum.inr (g', j', r')) = (g = g' ∧ j = j' ∧ r ≠ r')
- DescriptiveComplexity.SatToColCount.E (Sum.inr (g, j, r)) (Sum.inl v) = (v = DescriptiveComplexity.SatToColCount.outer g j r)
- DescriptiveComplexity.SatToColCount.E x✝¹ x✝ = False
Instances For
Dependency graph
A proper 3-coloring.
Equations
- DescriptiveComplexity.SatToColCount.Proper χ = ∀ (u v : DescriptiveComplexity.SatToColCount.V A), DescriptiveComplexity.SatToColCount.E u v → χ u ≠ χ v
Instances For
Dependency graph
Normalizing the palette #
A palette vertex.
Equations
Instances For
Dependency graph
A Boolean vertex.
Equations
Instances For
Dependency graph
A spoiler.
Equations
Instances For
Dependency graph
The triangles #
The core is properly colored.
Equations
- DescriptiveComplexity.SatToColCount.CoreProper κ = ∀ (u v : DescriptiveComplexity.SatToColCount.Core A), DescriptiveComplexity.SatToColCount.CoreE u v → κ u ≠ κ v
Instances For
Dependency graph
The palette is colored 0, 1, 2, on the core.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The core colorings are the models #
Every triangle sees three colors not all equal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The assignment read off a core coloring.
Equations
- DescriptiveComplexity.SatToColCount.modelOf κ x = ∃ (h : DescriptiveComplexity.SatOccurs A x), κ (DescriptiveComplexity.SatToColCount.bvV (Sum.inl ⟨x, h⟩, true)) = 0
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
A core coloring gives a model.
Dependency graph
From a model to a core coloring #
The value of a carrier under an assignment: the variable, or the prefix disjunction of the gate.
Equations
- DescriptiveComplexity.SatToColCount.baseVal ν (Sum.inl x_1) = ν ↑x_1
- DescriptiveComplexity.SatToColCount.baseVal ν (Sum.inr g) = DescriptiveComplexity.SatOcc.PrefixOr ν (↑g).1 (↑g).2.1 (↑g).2.2
Instances For
Dependency graph
The value of a Boolean vertex.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The core coloring of an assignment: the palette 0, 1, 2, every
Boolean vertex by its value.
Equations
- DescriptiveComplexity.SatToColCount.colOf ν (Sum.inl DescriptiveComplexity.SatToColCount.Pal.T) = 0
- DescriptiveComplexity.SatToColCount.colOf ν (Sum.inl DescriptiveComplexity.SatToColCount.Pal.F) = 1
- DescriptiveComplexity.SatToColCount.colOf ν (Sum.inl DescriptiveComplexity.SatToColCount.Pal.B) = 2
- DescriptiveComplexity.SatToColCount.colOf ν (Sum.inr (Sum.inl w)) = DescriptiveComplexity.SatToColCount.bc (decide (DescriptiveComplexity.SatToColCount.valBv ν w))
- DescriptiveComplexity.SatToColCount.colOf ν (Sum.inr (Sum.inr val)) = 0
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The core colorings are the models.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The count #
The number of proper 3-colorings of the gadget graph: 6 · 8 ^ g
times the number of models, g the number of non-first occurrences.