The base graph of a #1-in-SAT instance #
The reduction of #1-in-SAT to #Cycle Cover attaches Valiant's XOR gadget at
one site per occurrence of a literal in a clause; this file builds the
base graph the gadgets are attached to, and evaluates the terms of the XOR
sum (DescriptiveComplexity.Site.xorSum) it leaves.
The graph #
An occurrence (DescriptiveComplexity.SatCover.Occ) is a real one, the
literal (x, s) in the clause c, or a dummy one, the literal (x, s) in
the tautological clause x ∨ ¬x added for every variable x; the dummy
clause is written ⊥. Every occurrence o has a track node trk o and a
spoke spk o, and every clause, dummy ones included, a hub. The base
edges are:
- the track of each literal
(x, s): a cycle through the track nodes of its occurrences, in the order of the clauses, the dummy occurrence first (DescriptiveComplexity.SatCover.nextOcc, built onDescriptiveComplexity.cycNext); - from each spoke to its hub, and from each hub to each of its spokes.
The site of an occurrence pairs the self-loop at its track node with the
self-loop at its spoke, so that exactly one of the two is used: the track
loop when the literal is true and the spoke loop when it is false.
A cycle cover of the base graph with the chosen loops forced is then unique
when the choice is consistent
(DescriptiveComplexity.SatCover.Consistent) – the track of a literal is
used entirely or not at all, so the loops of a literal are all chosen or
none, exactly one loop of the two dummy occurrences of a variable is chosen,
so that each variable has one value, and exactly one spoke of each clause is
free to close a cycle with its hub, so that each clause has exactly one true
literal – and does not exist otherwise
(DescriptiveComplexity.SatCover.pdel_base). The consistent choices are the
exactly-one models (DescriptiveComplexity.SatCover.consistentEquiv).
Occurrences and nodes #
An occurrence is valid when it is a real one, (x, s) in the clause c,
or the dummy one of a variable.
Equations
- DescriptiveComplexity.SatCover.OccValid o = (o.1 = ⊥ ∧ DescriptiveComplexity.SatOccurs A o.2.1 ∨ ∃ (c : A), o.1 = ↑c ∧ DescriptiveComplexity.SatOcc.OccIn c o.2.1 o.2.2)
Instances For
Dependency graph
The occurrences: the real ones and the dummy ones.
Equations
Instances For
Dependency graph
The clause of an occurrence, ⊥ for a dummy one.
Instances For
Dependency graph
The variable of an occurrence.
Instances For
Dependency graph
The sign of an occurrence.
Instances For
Dependency graph
Dependency graph
The variable of an occurrence is a variable of the formula.
Dependency graph
Dependency graph
The dummy occurrence of a variable.
Instances For
Dependency graph
The hubs: one per clause, and one per variable for its dummy clause.
Equations
- DescriptiveComplexity.SatCover.Hub A = ({ c : A // DescriptiveComplexity.SatOcc.IsCl c } ⊕ { x : A // DescriptiveComplexity.SatOccurs A x })
Instances For
Dependency graph
The nodes of the base graph: a track node and a spoke per occurrence, and the hubs.
Equations
Instances For
Dependency graph
The track node of an occurrence.
Equations
Instances For
Dependency graph
The spoke of an occurrence.
Equations
Instances For
Dependency graph
A hub, as a node.
Equations
Instances For
Dependency graph
The hub of the clause of an occurrence.
Equations
Instances For
Dependency graph
The tracks #
The clauses an occurrence of the literal (x, s) can be in, the dummy
clause ⊥ first.
Equations
- DescriptiveComplexity.SatCover.chain x s = insert ⊥ (Finset.image WithBot.some {c : A | DescriptiveComplexity.SatOcc.OccIn c x s})
Instances For
Dependency graph
Dependency graph
Dependency graph
The next occurrence of the same literal, cyclically.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The base edges #
The edges of the base graph.
- track
{A : Type}
[FirstOrder.Language.sat.Structure A]
[LinearOrder A]
[Fintype A]
(o : Occ A)
: BaseEdge (trk o) (trk (nextOcc o))
Along the track of a literal.
- spoke
{A : Type}
[FirstOrder.Language.sat.Structure A]
[LinearOrder A]
[Fintype A]
(o : Occ A)
: BaseEdge (spk o) (SatCover.hub (hubOf o))
From a spoke to its hub.
- hub
{A : Type}
[FirstOrder.Language.sat.Structure A]
[LinearOrder A]
[Fintype A]
(o : Occ A)
: BaseEdge (SatCover.hub (hubOf o)) (spk o)
From a hub to each of its spokes.
Instances For
Dependency graph
The base matrix: the adjacency matrix of the base graph.
Equations
Instances For
Dependency graph
The sites and the choices #
Equations
- DescriptiveComplexity.SatCover.instFintypeWithBot = { elems := DescriptiveComplexity.SatCover.instFintypeWithBot._aux_1, complete := ⋯ }
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The site of an occurrence: the self-loop at its track node, used when the literal is true, paired with the self-loop at its spoke, used when it is false.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The rows deleted by the choice U of the occurrences whose track loop is
used: their track nodes, and the spokes of the other occurrences.
Equations
Instances For
Dependency graph
A consistent choice: the track loops of a literal are all chosen or none (the track is then used entirely or not at all), and every hub has exactly one spoke whose loop is not chosen, to close a cycle with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The nodes left by a choice.
Equations
Instances For
Dependency graph
The term of the XOR sum of a choice: 1 when the choice is
consistent, 0 otherwise.
Dependency graph
The XOR sum over all the choices #
Dependency graph
Dependency graph
Dependency graph
The sites, enumerated.