Unit propagation for CNF formulas #
This module formalizes unit-clause detection and unit propagation over Cslib.Logic.PL.CNF, built
on Cslib.Logic.PL.CNF.restrict and Cslib.Logic.PL.CNF.restrictList.
Iterated propagation uses structural recursion on a clause-count fuel bound φ.length
(unitPropagateWithTrailAux), ensuring kernel reducibility while terminating cleanly on every
formula because each unit step removes at least the unit clause [l].
Because propagating [l] drops [l] itself from φ.restrict l.1 l.2, evaluation equivalence
carries an explicit side condition that every propagated unit literal holds under σ
(CNF.eval_unitPropagate_iff). Satisfiability (CNF.satisfiable_unitPropagate_iff) and model
counts (CNF.modelCountOn_unitPropagate, CNF.modelCount_unitPropagate) are conserved exactly.
Main definitions #
Cslib.Logic.PL.Clause.unit?,Cslib.Logic.PL.CNF.findUnit?: syntactic unit-clause detection.Cslib.Logic.PL.CNF.unitPropagateStep: one step of unit propagation.Cslib.Logic.PL.CNF.unitPropagateWithTrail,Cslib.Logic.PL.CNF.unitPropagate,Cslib.Logic.PL.CNF.unitTrail: iterated unit propagation to a unit-free normal form.
Main results #
Cslib.Logic.PL.CNF.eval_eq_of_mem_singleton,Cslib.Logic.PL.CNF.modelCountOn_restrict_of_mem_singleton: single-unit forcing and declared model-count conservation.Cslib.Logic.PL.CNF.unitPropagate_eq_restrictList: propagated formula equals sequential restriction along the trail.Cslib.Logic.PL.CNF.eval_unitPropagate_iff,Cslib.Logic.PL.CNF.satisfiable_unitPropagate_iff,Cslib.Logic.PL.CNF.modelCountOn_unitPropagate,Cslib.Logic.PL.CNF.modelCount_unitPropagate: soundness, completeness, and model-count conservation of iterated unit propagation.Cslib.Logic.PL.CNF.findUnit?_unitPropagate,Cslib.Logic.PL.CNF.unitPropagate_idem: normal form (no unit clauses remain) and idempotence.
Unit-clause recognition #
Single-unit forcing and model-count conservation #
For a unit clause [l] ∈ φ, φ holds under σ iff σ l.1 = l.2 and φ.restrict l.1 l.2
holds under σ.
Propagating a unit clause [l] ∈ φ preserves satisfiability.
Propagating a unit clause [l] ∈ φ on l.1 ∈ declared preserves CNF.modelCountOn on
declared.erase l.1.
Propagating a unit clause [l] ∈ φ preserves occurring-variable CNF.modelCount up to the
factor 2 for each variable other than l.1 dropped alongside [l].
Single-step and iterated unit propagation #
Perform a single unit-propagation step on φ, returning φ unchanged if no unit clause
exists.
One step of unit propagation preserves satisfiability.
One step of unit propagation does not increase clause count.
Structural fuel helper for iterated unit propagation.
Repeatedly propagate unit clauses to a unit-free formula, returning (trail, reduced) with
the list of propagated unit literals and the resulting unit-free CNF.
The unit-free CNF produced by iterated unit propagation on φ.
The list of unit literals forced during iterated unit propagation on φ.
Induction principle matching iterated unit propagation: either φ has no unit clauses, or
some unit literal l is propagated via φ.restrict l.1 l.2 with strictly fewer variables.
Iterated unit propagation equals sequential restriction along φ.unitTrail.
Iterated unit propagation preserves satisfiability.
A unit-propagation conflict (deriving the empty clause) certifies unsatisfiability.
φ.unitTrail never repeats a variable.
No unit clauses remain after CNF.unitPropagate.
Every clause remaining in φ.unitPropagate has length distinct from 1.
CNF.unitPropagate is idempotent.
Declared-universe model counting is conserved across iterated unit propagation, removing the
forced trail variables from declared.
When declared contains all occurring variables of φ, φ.modelCountOn declared equals
φ.unitPropagate.modelCountOn on the unpropagated declared variables.
Occurring-variable CNF.modelCount under iterated unit propagation, accounting for any
variables eliminated alongside forced unit clauses.
Iterated unit propagation does not increase clause count.
Remaining variables after iterated unit propagation belong to φ outside the trail.
Iterated unit propagation does not increase variable occurrences.
Any variable forced in φ.unitTrail has zero remaining occurrences in φ.unitPropagate.