Hardness of HORN-SAT: the Horn discharge #
Every SO-Horn definable problem admits an ordered first-order reduction to
HORN-SAT (DescriptiveComplexity.hornSat_hard_of_sigmaSOHornDefinable): the
machine-free P-hardness statement, one level below the Cook–Levin discharge of
DescriptiveComplexity.Problems.Sat.Hardness and in the same style.
It is simpler than Cook–Levin, and this is the whole point of the Horn
fragment. The Tseitin translation of an arbitrary first-order kernel has to
name every subformula by an auxiliary gate variable, and the gate clauses it
emits are not Horn. Here nothing has to be named: a Horn program
(DescriptiveComplexity.HornProgram) is already a conjunction of clauses, its
first-order guards mention the input vocabulary only – so they are evaluated
in the input structure rather than encoded – and each clause instance
translates to one propositional clause with at most one positive literal.
Given a block B, a number k of universally quantified first-order variables
and a program prog, the reduction interprets, inside an ordered input
structure A:
- propositional variables: one per relation variable
iofBand perB.arity i-tuple overA, canonically padded (DescriptiveComplexity.Padding) to the common dimensionDescriptiveComplexity.clauseDim; - clauses: one per clause
cof the program and perk-tuple overAsatisfying the guard ofc– the guard is an input-vocabulary formula, so “the guard holds” is literally what the defining formula ofsatIsClausesays; - literals: the head atom of
coccurs positively and its body atoms occur negatively, at the canonically padded tuples of their arguments.
A clause of the program with no head (a goal clause) yields a purely negative
propositional clause, and one with a head yields exactly one positive literal:
the interpreted structure is always Horn
(DescriptiveComplexity.horn_atMostOnePositive), which is what makes the reduction land
in HORN-SAT rather than merely in SAT.
The correctness proof (DescriptiveComplexity.horn_satisfiable_iff) reads in both
directions through the canonical padding: an assignment ρ of the block gives
the truth value ρ i (pref x) of the propositional variable (i, x), and
conversely a satisfying truth assignment ν gives the assignment
ρ i ā := ν (i, pad ā).
Tags and clause access #
The dimension, the tags and the two generic defining formulas are shared with
the Krom discharge; they live in DescriptiveComplexity.ClauseDischarge.
The tags of the Horn interpretation: the generic clausal tags at the program's number of clauses.
Equations
Instances For
Dependency graph
The c-th clause of the program.
Equations
- DescriptiveComplexity.clauseAt prog c = prog[↑c]
Instances For
Dependency graph
The defining formulas #
The defining formula of a positive occurrence: the head atom of the
clause, when it is an atom of the relation variable i.
Equations
- DescriptiveComplexity.headOccF c i u x = c.head.elim ⊥ fun (a : DescriptiveComplexity.SOAtom B k) => if a.idx = i then DescriptiveComplexity.atomOccF a u x else ⊥
Instances For
Dependency graph
The defining formula of a negative occurrence: any body atom of the
clause that is an atom of the relation variable i.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Realization of the defining formulas #
Dependency graph
Dependency graph
The Horn interpretation: the CNF instance of the propositional translation of the program, defined inside the ordered input structure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Characterization of the interpreted relations #
Every statement below is the corresponding realization lemma read through
DescriptiveComplexity.FOInterpretation.relMap_map; the tag combinations that are not
listed have ⊥ as defining formula, so the corresponding relation is empty.
The clause elements: one per clause of the program and per canonically padded tuple satisfying that clause's guard.
Dependency graph
Elements carrying a variable tag are not clauses.
Dependency graph
Elements carrying the junk tag are not clauses.
Dependency graph
The positive literals: the head atom of the clause, at the canonically padded tuple of its arguments.
Dependency graph
The negative literals: any body atom of the clause, at the canonically padded tuple of its arguments.
Dependency graph
The interpreted structure is Horn, and correct #
The interpretation always lands in HORN-SAT: a clause of the program has at most one head atom, and canonical padding makes the element encoding it unique, so every interpreted clause has at most one positive literal.
Dependency graph
Correctness of the Horn discharge: the program has a satisfying assignment iff the interpreted CNF is satisfiable.
Dependency graph
The program has a satisfying assignment iff the interpreted CNF is a yes-instance of HORN-SAT.
Dependency graph
The generic Horn reduction: an ordered first-order reduction to HORN-SAT from any problem defined, on nonempty finite structures, by an existential second-order sentence with a Horn kernel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
P-hardness of HORN-SAT, machine-free: every SO-Horn definable problem
admits an ordered first-order reduction to HORN-SAT. This is the Horn analogue
of the Cook–Levin discharge DescriptiveComplexity.sat_hard_of_sigmaSODefinable, one
level below it.