Fixed-width Cook SAT masks for set intersection
DefinitionCookSplitIntersectionFamilycomplexity-theoryformal-verification
For a bit vector, add one mask clause per variable. A set bit contributes an always true two-literal clause, and a cleared bit contributes a two-literal clause forcing the variable false. The left half encodes its masks. The right half encodes its masks followed by the disjunction of all variables. Concatenate the halves.
Definition code
import Definitions.Def_PvsNP
set_option autoImplicit false
namespace PvsNP.SATIntersectionFamily
/-- A variable is allowed when the set bit is true and forced false otherwise. -/
def maskClause (member : Bool) (i : ℕ) : Clause := [(false,i),(member,i)]
def maskFormula {n : ℕ} (a : Fin n → Bool) : CNF :=
List.ofFn fun i => maskClause (a i) i.val
def someVariable (n : ℕ) : Clause :=
List.ofFn fun i : Fin n => (true,i.val)
def leftHalf {n : ℕ} (a : Fin n → Bool) : Str :=
encodeCNF (maskFormula a)
def rightHalf {n : ℕ} (b : Fin n → Bool) : Str :=
encodeCNF (maskFormula b ++ [someVariable n])
def intersectionPayload {n : ℕ} (a b : Fin n → Bool) : Str :=
leftHalf a ++ rightHalf b
end PvsNP.SATIntersectionFamily
Source
Cook CNF bit encoding in the Prove2Me P vs NP definitions.