A CNF Class Generalizing Exact Linear Formulas

1 downloads 0 Views 75KB Size Report
A CNF Class Generalizing Exact Linear. Formulas. Stefan Porschen joint work with. Ewald Speckenmeyer. Institut für Informatik. Universität zu Köln. Germany ...
SAT 2008, May 12-15, Guangzhou, China

A CNF Class Generalizing Exact Linear Formulas

Stefan Porschen joint work with Ewald Speckenmeyer Institut f¨ ur Informatik Universit¨ at zu K¨ oln Germany

Overview

• Introduction and Preliminaries

• Useful Perspective: Clause Sets regarded fibre-wise

• Exact Linear Formulas and Exact Linearly-Based Formulas

• Solving SAT for Exact Linearly-Based Formulas

• Concluding Remarks/Open Questions

Introduction and Preliminaries Notation and Conventions

• literal l is a propositional variable x ∈ {0, 1} or its negation x := ¬x (negated variable); complement of a literal l is l.

• clause c represented as a literal set

• clauses do not contain literal pairs like x, x

• CNF formula C considered as clause set

• V (C), V (c) denotes set of variables in C, c.

• CNF: set of all clause sets

Introduction and Preliminaries

Models as Clauses

• Clause set C over n variables is satisfiable, iff there is a clause t such that ∀c ∈ C :

• t then is a model of C.

t ∩ c 6= ∅

Useful Perspective: Clause Sets regarded fibre-wise The Fibre-View Concept

• The fibre view regards a clause set C as composed of fibres over a hypergraph: – All clauses c of a clause set C projecting on the same variable set b when negations are eliminated form the fibre Cb of C over b. E.g. c1 = {¯ x, y, z¯} 7→ b := {x, y, z}, c2 = {¯ x, y¯, z} 7→ {x, y, z}, i.e. c1, c2 in fibre over b. – The collection of these base elements b forms a hypergraph, the base hypergraph H = (V (C), B(C)) of C: B(C) = {b := V (c)|c ∈ C},

Cb = {c ∈ C|V (c) = b}

– Hence, C is the disjoint union of all its fibres.

Useful Perspective: Clause Sets regarded fibre-wise Reversely: Base Hypergraph and Total Clause Set • (Variable-) base hypergraph H = (V, B) vertices x ∈ V : regarded as Boolean variables s.t. for each x ∈ V there is a (hyper)edge b ∈ B with x ∈ b. • For b ∈ B, let Wb be consisting of all 2|b| clauses projecting on b; call Wb the hypercube formula over the set of variables in b; for short also hypercube or hc. • The hypercube union KH :=

[

Wb

b∈B

is called the total clause set over H. • Hypercube Wb is the fibre of KH over b.

Useful Perspective: Clause Sets regarded fibre-wise

Example: Total Clause Set

• For V = {x1, x2, x3}, and B = {b1 := x1x2, b2 := x1x3}, we have K H = W b1 ∪ W b 2 • where ¯1x2, x1x ¯2, x ¯1x ¯2} Wb1 = {x1x2, x Wb2 = {x1x3, x ¯1x3, x1x ¯3, x ¯1x ¯3} are the hc formulas over b1, b2.

Useful Perspective: Clause Sets regarded fibre-wise Formula and Based Complement Formula

• A formula over H (or H-formula) is any subset C ⊆ KH s.t. Cb := C ∩ Wb 6= ∅

for eachb ∈ B

Cb is the fibre of C over b.

• For C ⊂ KH such that Wb − Cb 6= ∅, for all b ∈ B, we define the H-based complement formula of C as ¯ := C

[

(Wb − Cb) = KH − C

b∈B

¯ has the same base hypergraph H as C. • By construction: C

Useful Perspective: Clause Sets regarded fibre-wise Example: Formula, Based Complement Formula

• For H = (V, B) with V = {x1, x2, x3}, and B = {x1x2, x1x3}, let C = {x1x ¯2, x1x2, x1x ¯3, x ¯1x ¯3} ¯ where • Then: KH = C ∪ C ¯ = {¯ C x1 x2 , x ¯1x ¯2, x1x3, x ¯1x3}

• C has two fibres: over

b1 := x1x2 :

Cb1 = {x1x ¯2, x1x2}

over

b2 := x1x3 :

Cb1 = {x1x ¯3, x ¯1x ¯3}

Useful Perspective: Clause Sets regarded fibre-wise

Fibre-Transversals

• A fibre-transversal (f-transversal) of KH is a formula F ⊂ KH s.t. |F ∩ Wb| = 1,

for each

b∈B

• Hence: F contains exactly one clause of each fibre of KH

• Let that clause be denoted as F (b).

Useful Perspective: Clause Sets regarded fibre-wise

Compatible Fibre-Transversal

• Important type of f-transversals F : So-called compatible f-transversals have the defining property [

.

F (b) ∈ WV

b∈B

• Thus: F contains each variable x of V as a pure literal (i.e., occuring in F with a fixed polarity only)

Useful Perspective: Clause Sets regarded fibre-wise Example: Compatible Fibre-Transversal

• Base hypergraph H = (V, B) where V := {x1, x2, x3} and B = {b1, b2, b3} with b 1 = x1 x2 ,

b 2 = x1 x3 ,

b3 = x2x3

c2 := x ¯1x ¯3,

c3 := x2x ¯3

• Then: E.g. clauses c1 := x ¯1x2,

form a compatible f-transversal of corresponding KH

• Because: c1 ∪ c2 ∪ c3 = x ¯1x2x ¯3 ∈ WV

Useful Perspective: Clause Sets regarded fibre-wise

The SAT-Compatible-Transversal-Theorem Theorem: For a base hypergraph H = (V, B), let C ⊂ KH and ¯ ⊂ KH be H-based (hence its complement formula C ¯ B = B(C) = B(C)). ¯ admits a compatible Then: C is satisfiable if and only if C fibre-transversal. This connection is applied to the CNF classes considered below.

Useful Perspective: Clause Sets regarded fibre-wise

Diagonal Formulas A formula D ⊆ KH is called a diagonal if for each compatibel fibre-transversal F , we have F ∩ D 6= ∅. Theorem: A formula C ⊆ KH is unsatisfiable if and only if it contains a subformula D ⊆ C that is diagonal. Proof: With D, C has a clause of each compatible fibretransversal ¯ of C cannot admit a whole compatible So: the complement C fibre-transversal.

Exact Linear Formulas and Exact Linearly-Based CNF Linear Formulas

• The class of linear CNF formulas generalizes the notion of linear hypergraphs.

• (Distinct) clauses of a linear formula intersect pairwise in at most one variable (modulo negations). Example: (¯ x ∨ y ∨ z¯) ∧ (x ∨ u ¯ ∨ v) ∧ (¯ y∨u ¯ ∨ w) ¯ ∧ (¯ z∨w∨¯ v ) ∧ (r ∨ ¯ s)

• Note: Linear Formulas always are fibre-transversals: Each fibre contains exactly one element.

• The base hypergraph of a linear formula C is obtained by simply removing all negations.

Exact Linear Formulas and Exact Linearly-Based CNF

SAT-Complexity of Linear Formulas: Known Results Theorem: SAT for the unrestricted class of linear formulas remains NP-complete The subclass of exactly linear formulas, where distinct clauses have exactly 1 variable in common, is always satisfiable (modulo unit clauses). An exactly linear formula C over n variables has the property |C| ≤ n.

Exact Linear Formulas and Exact Linearly-Based CNF

Exactly Linear Base Hypergraphs

• Let H = (V, B) be an exact linear base hypergraph: each two distinct b1, b2 ∈ B share exactly one element.

• Example: V = {x, y, z, u, v, w}, and B: b1 = {x, y, z}, b2 = {x, u, v), b3 = {y, u, w}, b4 = {z, w, v}

• Clearly: Any fibre-transversal of KH then is an exact linear formula: {¯ x, y, z¯}, {x, u ¯, v}, {¯ y, u ¯, w}, ¯ {¯ z , w, ¯ v}

Exact Linear Formulas and Exact Linearly-Based CNF

Formulas with Exactly Linear Base Hypergraphs

• Let CNFxbased be the class of all formulas C, for which there is H exact linear such that C ⊆ KH

• Note: The fibre-transversals in CNFxbased just coincides with the class of exactly linear formulas.

• Observe: CNFxbased coincides with the class of all formulas such that each two distinct clauses share exactly one or all variables.

Solving SAT for Exact Linearly-Based formulas The fibre graph G(C) of C Each clause c of C corresponds to a vertex

Vertices c, c0 ∈ C form an edge iff (1) they belong to distinct fibres of C,and (2) c ∩ c0 6= ∅. Theorem: (The clique characterization): For H = (V, B) exactly linear, let C ∈ CNFxbased such that ¯ ⊂ KH is H-based, too. C ¯ admits a clique of size |B|. Then: C is satisfiable iff G(C) Proof-Basis: The SAT-Compatible-Transversal-Theorem

Solving SAT for Exact Linearly-Based formulas

A simple subclass of CNFxbased Lemma: For H = (V, B) exactly linear such that each b ∈ B contains a fixed vertex x ∈ V . Let C ⊂ KH be a H-based formula ¯ also is H-based. such that C Then: C ∈ is unsatisfiable if and only if (∗)

¯b : x ∈ c}| > 0 |{b ∈ B|∀c ∈ C

and

¯b : x |{b ∈ B|∀c ∈ C ¯ ∈ c}| > 0

Assuming that C is given by its fibres, satisfiability can be checked in linear time. ¯ can shown to have no |B|-clique iff (∗) holds. Proof-Idea: G(C)

Solving SAT for Exact Linearly-Based formulas

Main result for CNFxbased Theorem: We can check in polynomial time whether C ∈ CNFxbased is satisfiable assuming that C is represented in terms of its fibres.

Solving SAT for Exact Linearly-Based formulas

Proof-Sketch

• Basic idea: Say a clause c meets a truth assignment t ∈ WV iff c ⊆ t. • A single clause c meets exactly 2n−|c| truth assignments.

• Show that the total number N of all distinct truth assignments met by all clauses in C can be computed efficiently.

Solving SAT for Exact Linearly-Based formulas Sketch Ctd.

• Then: C ∈ SAT iff N < 2n.

• Because: Only then C does not contain a diagonal formula, ¯ admits a compatible f-transversal corresponding to since C a truth assignment not met by any c ∈ C.

• So, we are done with the SAT-Compatible-TransversalTheorem.

• Crucial for polynomial time is the fact that for exact linear hypergraphs |B| ≤ |V | holds.

Solving SAT for Exact Linearly-Based formulas

Some Consequences Corollary: The algorithm works also when H is replaced with a linear hypergraph (V, B) such that |B| ≤ |V |. Proof: Trivial.

Solving SAT for Exact Linearly-Based formulas

Some Consequences Ctd. Corollary: The search problem of SAT for CNFxbased is in P . Proof-Idea: Use self-reducibility on basis of the decision algorithm. The Corollary above ensures that the algorithm is applicable though CNFxbased is not stable under partial assignments.

Solving SAT for Exact Linearly-Based formulas

Some Consequences Ctd. Corollary: #-SAT for CNFxbased is in P . Proof-Idea: The algorithm for the decision version can be adapted easily for solving both problems

Solving SAT for Exact Linearly-Based formulas Concluding Remarks and Open Problems

• The class of exact linearly-based CNF formulas was introduced

• Decision, search and counting variants of SAT for this class all are polynomial time solvable.

• Open Problems/Future Work – Can the methods be carried over to the case where the base hypergraph is mutually intersecting (but not necessarily linear) – Elaborate more deeply the relationships between the polynomial time classes studied here to other such classes.

THE END

Thanks For Your Attention