Every NP language, as a formula #
Cook--Levin and Tseitin already reduce any NP language to encoded 3SAT. What
the gap reduction needs is slightly more: not a string that lies in 3SAT, but
the formula itself, so that the constraint graph can be built from it.
The Tseitin reduction is total — malformed inputs go to a fixed unsatisfiable
formula — so the formula is always there to be named: redCNF names it, and
reduction_eq_encode says the reduction writes exactly its encoding.
Main definitions #
Complexity.redCNF— the 3CNF a string reduces to
Main results #
Complexity.exists_reduction_cnf— everyNPlanguage is the satisfiability of anFPfamily of 3CNFs
The exact 3-CNF that the total Tseitin reduction produces.
Equations
- Complexity.redCNF z = match Complexity.SAT.CNF.decode? z with | some φ => (Complexity.SAT.CNF.to3Aux (z.length + 1) φ).1 | none => Complexity.SAT.ThreeSAT.falseFormula
Instances For
Every NP language is the satisfiability of an FP family of exact
3-CNFs.