The unit-propagation machine of a Horn formula #
The program half of HORNSAT ≤ᶠᵒ[≤] DTMAccept, the deterministic machine
bridge: the states, symbols and transitions of the deterministic machine
computing the unit-propagation closure of a CNF instance and verifying it, on
the tape laid out in DescriptiveComplexity.Problems.Machine.HornTape.
The program #
init: at ⊢, dispatch – first check sweep if a clause exists, else accept
chk(r, c): sweep right, f := f ∧ (negIn c x → marked x)
mark(r, c): sweep back left; if the check succeeded, mark the positive
literal of c in passing
… next clause; after the last clause, next round; after the last round …
ver(c): sweep, f := f ∨ (posIn c x ∧ marked x) ∨ (negIn c x ∧ ¬marked x),
alternating direction; a failed clause leaves no transition
accept after the last verified clause – gated on the Horn condition
n rounds of one check-and-mark pass per clause compute the propagation
closure DescriptiveComplexity.Forced (DescriptiveComplexity.forced_forcedIn_card is the
stabilization), and the verification phase accepts exactly when the closure,
read as an assignment, satisfies every clause – which for a Horn instance is
satisfiability itself (DescriptiveComplexity.satisfiable_iff_forced_model).
The machine is deterministic everywhere – there is no guess phase – and
DescriptiveComplexity.TMData.Deterministic for the constructed machine is part of
the statement, not bookkeeping: it is what makes the image a potential
yes-instance of DTMAccept at all. The instance is read exactly as by the SAT
machine (DescriptiveComplexity.SatCl, DescriptiveComplexity.SatPos …,
imported from DescriptiveComplexity.Problems.Machine.Hardness together with
the clause-order machinery), and the only two additions are the element order
(rounds walk it) and the Horn gate on the accept transition.
The elements of the machine #
The universe of the machine: tagged triples.
Equations
- DescriptiveComplexity.HV A = (DescriptiveComplexity.UPTag × (Fin 3 → A))
Instances For
Dependency graph
A constant of the machine: a tag on the triple of least elements.
Equations
- DescriptiveComplexity.cstH t = (t, fun (x : Fin 3) => DescriptiveComplexity.botA)
Instances For
Dependency graph
A tag carrying one element.
Equations
Instances For
Dependency graph
A tag carrying two elements.
Equations
Instances For
Dependency graph
Dependency graph
Symbols #
The left-marker symbol.
Equations
Instances For
Dependency graph
The right-marker symbol.
Equations
Instances For
Dependency graph
The blank symbol.
Equations
Instances For
Dependency graph
The symbol of the cell of x, with mark m.
Equations
Instances For
Dependency graph
Positions #
The left-marker cell.
Equations
Instances For
Dependency graph
The cell of the element x.
Equations
Instances For
Dependency graph
The right-marker cell.
Equations
Instances For
Dependency graph
States #
The dispatch state.
Equations
Instances For
Dependency graph
Checking the clause c in round r, flag f.
Equations
Instances For
Dependency graph
The return sweep of clause c in round r, marking iff m.
Equations
Instances For
Dependency graph
Verifying the clause c, flag f, sweeping in direction d.
Equations
Instances For
Dependency graph
The accepting state.
Instances For
Dependency graph
Reading the order of the elements #
Dependency graph
Dependency graph
b is the successor of a in the order of the elements: rounds walk this
relation.
Instances For
Dependency graph
The satisfaction test of the verification phase: the cell x, with mark
m, satisfies the clause c under the marked assignment. This is
DescriptiveComplexity.SatLit with the marks as the valuation.
Equations
- DescriptiveComplexity.MLit c x m = (DescriptiveComplexity.SatPos c x ∧ m = true ∨ DescriptiveComplexity.SatNeg c x ∧ m = false)
Instances For
Dependency graph
The transition table #
Which tagged triples are transitions: the payload promises. Coordinates not pinned by the source state or the symbol read are pinned here, so that no junk element is a transition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The state a transition applies in.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The symbol a transition reads.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The state a transition moves to. The check and verification sweeps branch on a first-order test of the source instance; each pair of branches is exclusive, which is what keeps the table functional.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The symbol a transition writes: only the return sweep of a successful check writes anything new, and only at the positive literal of its clause.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Which transitions move the head right.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Accepting states.
Equations
Instances For
Dependency graph
Start states: the dispatch state alone.
Equations
Instances For
Dependency graph
The unit-propagation machine of a CNF instance.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The machine is well formed #
The machine is deterministic #
There is no guess phase, so – unlike the SAT machine – the whole table is
functional: the state and the symbol read pin the transition's tag up to
promise-exclusive alternatives, the tag pins the payload, and the branching
destinations and writes are separated by their first-order tests. This
discharges the DescriptiveComplexity.TMData.Deterministic promise of the
constructed instance, which is part of the correctness of the reduction.
Dependency graph
Dependency graph
The promise-exclusive alternatives #
The positions of the tape, concretely #
The dimension-3 mirror of the SAT machine's marker and cell lemmas: the left marker is the lowest position, cells follow in the order of their elements, the right marker closes the chain, and ranks are what the budget compares.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The intended run: marks and tapes #
The machine's working state is a set of marked elements, as a Bool-valued
assignment. Processing one clause – a check sweep and a return sweep – applies
DescriptiveComplexity.procB to it: unconditionally, because when the check fails the
inner conjunction is false and nothing is added, exactly as the machine's
return sweep writes nothing when its marking bit is off.
One clause processed on a marked set: if every negative literal of c is
marked, its positive literals join the marks.
Equations
- DescriptiveComplexity.procB M c x = (M x || decide (DescriptiveComplexity.SatPos c x) && decide (∀ (y : A), DescriptiveComplexity.SatNeg c y → M y = true))
Instances For
Dependency graph
The tape carrying the marked set M: markers and blanks in place, the
cell of y holding (y, M y). A junk cell tuple reads its initial, unmarked
symbol forever – it is never written, so its value must not depend on M.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The tape during a return sweep of the clause c with the head at p,
moving left: the cells strictly above the head have been processed, the rest
still carry the old marks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The intended run: configurations #
The initial configuration: the dispatch state at the left marker, all cells unmarked.
Equations
- DescriptiveComplexity.confHInit = { state := DescriptiveComplexity.stHInit, head := DescriptiveComplexity.posHStart, tape := DescriptiveComplexity.hTape fun (x : A) => false }
Instances For
Dependency graph
The flags and tapes along a sweep #
The intended run: single steps #
Ranks, sweeps, and one whole clause #
The folds: what the rounds compute #
Processing the clauses from c to the last one, relationally: the marked
set each clause leaves behind.
- last {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {c : A} {M : A → Bool} : SatMaxCl c → ClauseFold c M (procB M c)
- step {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {c c' : A} {M M' : A → Bool} : SatNextCl c c' → ClauseFold c' (procB M c) M' → ClauseFold c M M'
Instances For
Dependency graph
Processing the rounds from r to the last one, each a pass over all the
clauses from c₀.
- last {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {c₀ r : A} {M M' : A → Bool} : MaxElt r → ClauseFold c₀ M M' → RoundFold c₀ r M M'
- step {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {c₀ r r' : A} {M M' M'' : A → Bool} : SuccElt r r' → ClauseFold c₀ M M' → RoundFold c₀ r' M' M'' → RoundFold c₀ r M M''
Instances For
Dependency graph
The machine walks the folds #
The verification phase #
The machine accepts every Horn-satisfiable instance #
The run of the machine on a yes-instance of HORN-SAT: within the
budget it reaches an accepting configuration – dispatch, n rounds of
propagation, and a verification pass that the closure, which satisfiability
makes a model, lets run to acceptance – and the tape then holds the marks of
the propagation closure.
Dependency graph
The machine accepts only Horn-satisfiable instances #
Determinism replaces the SAT machine's run-analysis induction: the run from the unique initial configuration is the intended trajectory, so it suffices that on a non-Horn-satisfiable instance the trajectory never carries an accepting state – either because no accept transition exists at all (the Horn gate), or because the trajectory gets stuck at the first failing verification sweep.