3-CNF formulas #
The 3-CNF refinement of the existing CNF type: a CNF is in 3-CNF when every
clause has exactly three literals. Following the roadmap (track N3), 3-CNF is
introduced here as a predicate on the existing CNF = List Clause, so that all
of the CNF semantics (CNF.eval, CNF.Satisfiable, CNF.maxVar, renaming)
apply unchanged and a 3-CNF is literally a CNF.
Main definitions and results #
CNF.Is3CNF— every clause has length3; decidableCNF.is3CNF_cons— the cons characterizationCNF.Is3CNF.mapVar— variable renaming preserves the 3-CNF shape
The substantive N3 milestone — a size-controlled clause-padding transformation turning an arbitrary CNF into an equisatisfiable 3-CNF — builds on this predicate and is tracked separately.
A CNF is in 3-CNF when every clause is a disjunction of exactly three
literals. This is a predicate on the existing CNF type, so a 3-CNF formula
is literally a CNF and inherits all of its semantics.
Equations
- φ.Is3CNF = ∀ c ∈ φ, List.length c = 3
Instances For
Equations
- Complexity.SAT.instDecidableIs3CNF φ = List.decidableBAll (fun (c : Complexity.SAT.Clause) => List.length c = 3) φ
Variable renaming preserves the 3-CNF shape: Clause.mapVar maps literals
one-for-one, so it does not change clause lengths.
Padding short clauses to width three #
A clause with one or two literals is padded to exactly three literals by
repeating its last literal. This changes neither the clause's models nor its
satisfiability (repeating a literal in a disjunction is idempotent), and turns a
CNF whose clauses all have width 1 … 3 into an equivalent 3-CNF. Splitting
wide clauses (width > 3) needs fresh Tseitin variables and is tracked
separately.
Pad a clause of one or two literals to width three by repeating a literal; clauses of any other width are left unchanged.
Equations
Instances For
Padding preserves the clause's value under every assignment (repeating a literal in a disjunction is idempotent).
A clause of width 1 … 3 is padded to width exactly three.
Pad every clause of a CNF to width three.
Equations
Instances For
Padding preserves the CNF's value under every assignment — hence satisfiability.
Padding preserves satisfiability.
If every clause of φ has width 1 … 3, then CNF.padTo3 φ is a genuine
3-CNF equivalent to φ.