Exact violation counts for forbidden-pattern CNF compilation #
Each violated Boolean constraint contributes exactly one falsified clause to the existing forbidden-pattern compiler, even when its scope repeats variables. The unique falsified clause forbids the local pattern induced by the assignment. Thus compilation preserves the number of violated constraints, although the total number of clauses can grow. The exact-count formulation is an original library lemma about the existing compiler.
Main results #
Cslib.Logic.PL.Constraint.countUnsat_toCNF: one falsified clause per violated constraint.Cslib.Logic.PL.CSP.countUnsat_toCNF,Cslib.Logic.PL.CSP.countUnsat_toCNFBounded: exact counts for systems and for the width-guarded compiler on its valid domain.
Exactly one forbidden-pattern clause is false when the constraint is violated; otherwise all its clauses are true. No distinctness assumption on the scope is needed.
Forbidden-pattern compilation preserves the number of violated constraints, counted with multiplicity.
The width-guarded compiler preserves violation counts when every scope satisfies its width bound.