Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2)...

39
Everything You Always Wanted to Know About Blocked Sets (But Were Afraid to Ask) Tom´ s Balyo, Andreas Fr¨ ohlich, Marijn J. H. Heule, Armin Biere Charles University, Prague Johannes Kepler University, Linz The University of Texas, Austin SAT 2014 Balyo, Fr¨ohlich, Heule, Biere Blocked Sets SAT 2014 1 / 23

Transcript of Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2)...

Page 1: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Everything You Always Wanted to Know AboutBlocked Sets (But Were Afraid to Ask)

Tomas Balyo, Andreas Frohlich, Marijn J. H. Heule, Armin Biere

Charles University, PragueJohannes Kepler University, LinzThe University of Texas, Austin

SAT 2014

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 1 / 23

Page 2: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Overview

1 Definitions

2 Properties of Blocked Sets

3 Solving Blocked Sets

4 Blocked Clause Decomposition

5 Reencoding

6 Experiments

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 2 / 23

Page 3: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Satisfiability

CNF formula

A Boolean variable has two values: True and False

A literal is Boolean variables or its negation

A clause is a disjunction (or) of literals

A CNF formula is a conjunction (and) of clauses

F = (x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x3)

Satisfiability

A CNF formula is satisfiable it has a satisfying assignment.The problem of satisfiability (SAT) is to determine whether a given CNFformula is satisfiable.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 3 / 23

Page 4: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Resolution

Resolution Rule

C1 = (l ∨ D1) C2 = (¬l ∨ D2)

C1 ⊗l C2 = (D1 ∨ D2)

By C1 ⊗l C2 we denote the resolution of C1 and C2 on the literal l .

The clauses D1 and D2 must not contain a pair of complementaryliterals (C1 ⊗l C2 would be a tautology).

If C1 or C2 is a unit (one-literal) clause we call it a unit resolution.

Unit Propagation

If a unit clause C = (x) or C = (x) is part of a formula F , then F isequivalent to Fx=1 or Fx=0, respectively, and can be replaced by it. Thisprocess is called unit propagation. By UP(F ) we denote the fixpointobtained by iteratively performing unit propagation until no more unitclauses are part of the formula.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 4 / 23

Page 5: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Resolution

Resolution Rule

C1 = (l ∨ D1) C2 = (¬l ∨ D2)

C1 ⊗l C2 = (D1 ∨ D2)

By C1 ⊗l C2 we denote the resolution of C1 and C2 on the literal l .

The clauses D1 and D2 must not contain a pair of complementaryliterals (C1 ⊗l C2 would be a tautology).

If C1 or C2 is a unit (one-literal) clause we call it a unit resolution.

Unit Propagation

If a unit clause C = (x) or C = (x) is part of a formula F , then F isequivalent to Fx=1 or Fx=0, respectively, and can be replaced by it. Thisprocess is called unit propagation. By UP(F ) we denote the fixpointobtained by iteratively performing unit propagation until no more unitclauses are part of the formula.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 4 / 23

Page 6: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Resolution

Resolution Rule

C1 = (l ∨ D1) C2 = (¬l ∨ D2)

C1 ⊗l C2 = (D1 ∨ D2)

By C1 ⊗l C2 we denote the resolution of C1 and C2 on the literal l .

The clauses D1 and D2 must not contain a pair of complementaryliterals (C1 ⊗l C2 would be a tautology).

If C1 or C2 is a unit (one-literal) clause we call it a unit resolution.

Unit Propagation

If a unit clause C = (x) or C = (x) is part of a formula F , then F isequivalent to Fx=1 or Fx=0, respectively, and can be replaced by it. Thisprocess is called unit propagation. By UP(F ) we denote the fixpointobtained by iteratively performing unit propagation until no more unitclauses are part of the formula.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 4 / 23

Page 7: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Blocked Sets

Literal blocks a clauses

A literal l blocks a clause C , l ∈ C w.r.t. a CNF formula F if for eachclause C ′ ∈ F with l ∈ C ′,C ⊗l C ′ is a tautology.

Blocked clauses

A clause C is blocked w.r.t. a CNF formula F if it is a tautology or it hasa literal l ∈ C that blocks it (blocking literal).

Blocked Clause Elimination

Blocked clause elimination (BCE) is the process of removing blockedclauses from a formula F until fixpoint. The obtained formula is denotedby BCE (F ).

Blocked Set

A CNF formula F is a blocked set if BCE (F ) = ∅.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 5 / 23

Page 8: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Blocked Sets

Literal blocks a clauses

A literal l blocks a clause C , l ∈ C w.r.t. a CNF formula F if for eachclause C ′ ∈ F with l ∈ C ′,C ⊗l C ′ is a tautology.

Blocked clauses

A clause C is blocked w.r.t. a CNF formula F if it is a tautology or it hasa literal l ∈ C that blocks it (blocking literal).

Blocked Clause Elimination

Blocked clause elimination (BCE) is the process of removing blockedclauses from a formula F until fixpoint. The obtained formula is denotedby BCE (F ).

Blocked Set

A CNF formula F is a blocked set if BCE (F ) = ∅.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 5 / 23

Page 9: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Blocked Sets

Literal blocks a clauses

A literal l blocks a clause C , l ∈ C w.r.t. a CNF formula F if for eachclause C ′ ∈ F with l ∈ C ′,C ⊗l C ′ is a tautology.

Blocked clauses

A clause C is blocked w.r.t. a CNF formula F if it is a tautology or it hasa literal l ∈ C that blocks it (blocking literal).

Blocked Clause Elimination

Blocked clause elimination (BCE) is the process of removing blockedclauses from a formula F until fixpoint. The obtained formula is denotedby BCE (F ).

Blocked Set

A CNF formula F is a blocked set if BCE (F ) = ∅.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 5 / 23

Page 10: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Blocked Sets

Literal blocks a clauses

A literal l blocks a clause C , l ∈ C w.r.t. a CNF formula F if for eachclause C ′ ∈ F with l ∈ C ′,C ⊗l C ′ is a tautology.

Blocked clauses

A clause C is blocked w.r.t. a CNF formula F if it is a tautology or it hasa literal l ∈ C that blocks it (blocking literal).

Blocked Clause Elimination

Blocked clause elimination (BCE) is the process of removing blockedclauses from a formula F until fixpoint. The obtained formula is denotedby BCE (F ).

Blocked Set

A CNF formula F is a blocked set if BCE (F ) = ∅.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 5 / 23

Page 11: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Blocked Sets

Example

F = (x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x3)

The first literal of each clause is the blocking literal. The clauses areremoved from left to right.

Basic properties:

Removing a blocked clause preserves satisfiability.

Blocked sets are always satisfiable.

We define the class of all blocked sets BS := {F | BCE (F ) = ∅}.If G ⊂ F and C is blocked w.r.t. F , then C is blocked w.r.t. G

If F ∈ BS and G ⊆ F then G ∈ BS.

BCE is confluent, i.e., the order of blocked clause removal is notimportant

Pure literal elimination is a special case of BCE.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 6 / 23

Page 12: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

BS not closed under (unit) resolution

Proposition

Blocked sets are not closed under resolution, not even unit resolution.

Proof: This is a blocked set.

(x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x3)

This is a unit resolvent.

(x1 ∨ x2) = (x1 ∨ x2 ∨ x3)⊗ (x3)

This is not a blocked set.

(x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x3) ∧ (x1 ∨ x2)

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 7 / 23

Page 13: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

BS not closed under partial assignments

Proposition

Blocked sets are not closed under partially assigning variables,furthermore, a blocked set may become non-blocked even in the subspacewhere this formula remains satisfiable.

Proof:

F = (x3∨x1∨x4)∧(x3∨x2∨x4)∧(x2∨x1)∧(x1∨x4)∧(x1∨x5)∧(x5∨x4)

This formula F is a blocked set, however, neither Fx3=0 nor Fx3=1 is ablocked set.

Fx3=0 = (x2 ∨ x4) ∧ (x2 ∨ x1) ∧ (x1 ∨ x4) ∧ (x1 ∨ x5) ∧ (x5 ∨ x4)

Fx3=1 = (x1 ∨ x4) ∧ (x2 ∨ x1) ∧ (x1 ∨ x4) ∧ (x1 ∨ x5) ∧ (x5 ∨ x4)

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 8 / 23

Page 14: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

BS closed under unit propagation

Proposition

Blocked sets are closed under unit propagation (F ∈ BS → UP(F ) ∈ BS).

Proof (sketch):

The clauses in UP(F ) can be eliminated in the same order as in F .

Examine all possible (3) cases.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 9 / 23

Page 15: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solving Blocked Sets

Example: (x1 ∨ x2) ∧ (x3 ∨ x2) ∧ (x3 ∨ x2 ∨ x1)

start with [*,*,*]

(x3 ∨ x2 ∨ x1) is not satisfied, V = {x1, x2, x3}, select x1, [F,*,*]

(x3 ∨ x2) is not satisfied, V = {x2, x3} select x2, [F,F,*]

(x1 ∨ x2) is not satisfied, V = ∅ flip x1, [T,F,*]

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 10 / 23

Page 16: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solving Blocked Sets

Example: (x1 ∨ x2) ∧ (x3 ∨ x2) ∧ (x3 ∨ x2 ∨ x1)

start with [*,*,*]

(x3 ∨ x2 ∨ x1) is not satisfied, V = {x1, x2, x3}, select x1, [F,*,*]

(x3 ∨ x2) is not satisfied, V = {x2, x3} select x2, [F,F,*]

(x1 ∨ x2) is not satisfied, V = ∅ flip x1, [T,F,*]

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 10 / 23

Page 17: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solving Blocked Sets

Example: (x1 ∨ x2) ∧ (x3 ∨ x2) ∧ (x3 ∨ x2 ∨ x1)

start with [*,*,*]

(x3 ∨ x2 ∨ x1) is not satisfied, V = {x1, x2, x3}, select x1, [F,*,*]

(x3 ∨ x2) is not satisfied, V = {x2, x3} select x2, [F,F,*]

(x1 ∨ x2) is not satisfied, V = ∅ flip x1, [T,F,*]

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 10 / 23

Page 18: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solving Blocked Sets

Example: (x1 ∨ x2) ∧ (x3 ∨ x2) ∧ (x3 ∨ x2 ∨ x1)

start with [*,*,*]

(x3 ∨ x2 ∨ x1) is not satisfied, V = {x1, x2, x3}, select x1, [F,*,*]

(x3 ∨ x2) is not satisfied, V = {x2, x3} select x2, [F,F,*]

(x1 ∨ x2) is not satisfied, V = ∅ flip x1, [T,F,*]

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 10 / 23

Page 19: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solving Blocked Sets

Example: (x1 ∨ x2) ∧ (x3 ∨ x2) ∧ (x3 ∨ x2 ∨ x1)

start with [*,*,*]

(x3 ∨ x2 ∨ x1) is not satisfied, V = {x1, x2, x3}, select x1, [F,*,*]

(x3 ∨ x2) is not satisfied, V = {x2, x3} select x2, [F,F,*]

(x1 ∨ x2) is not satisfied, V = ∅ flip x1, [T,F,*]

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 10 / 23

Page 20: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solving Blocked Sets

Properties:

The algorithm can find partial satisfying assignments.

It runs in linear time.

The algorithm is non-deterministic (select on line S7).

All the solutions can be found (by doing proper selections).

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 11 / 23

Page 21: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Smells Like Local SearchWhat if WalkSat always flipped the blocking literal?

0.01

0.1

1

10

100

1000

0 10 20 30 40 50 60 70 80 90 100

Tim

e [

s]

Problems

flip blitCCA 2013

ProbSatSparrow

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 12 / 23

Page 22: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Getting Blocked Sets

Are blocked sets commonly found among application formulas?

NO.

... among competition benchmarks? NO.

Where can we get some blocked sets?

Blocked Clause Decomposition

The set of clauses of any CNF formula F can be split into two blocked setsL and R. This process is called Blocked Clause Decomposition (BCD).

BCD(F ) = (L,R); F = L ∪ R; L,R ∈ BS; |L| ≥ |R|

The larger of the two blocked sets is called L (large) and the other isR (rest). A BCD is better if L is much bigger than R.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 13 / 23

Page 23: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Getting Blocked Sets

Are blocked sets commonly found among application formulas? NO.

... among competition benchmarks? NO.

Where can we get some blocked sets?

Blocked Clause Decomposition

The set of clauses of any CNF formula F can be split into two blocked setsL and R. This process is called Blocked Clause Decomposition (BCD).

BCD(F ) = (L,R); F = L ∪ R; L,R ∈ BS; |L| ≥ |R|

The larger of the two blocked sets is called L (large) and the other isR (rest). A BCD is better if L is much bigger than R.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 13 / 23

Page 24: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Getting Blocked Sets

Are blocked sets commonly found among application formulas? NO.

... among competition benchmarks?

NO.

Where can we get some blocked sets?

Blocked Clause Decomposition

The set of clauses of any CNF formula F can be split into two blocked setsL and R. This process is called Blocked Clause Decomposition (BCD).

BCD(F ) = (L,R); F = L ∪ R; L,R ∈ BS; |L| ≥ |R|

The larger of the two blocked sets is called L (large) and the other isR (rest). A BCD is better if L is much bigger than R.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 13 / 23

Page 25: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Getting Blocked Sets

Are blocked sets commonly found among application formulas? NO.

... among competition benchmarks? NO.

Where can we get some blocked sets?

Blocked Clause Decomposition

The set of clauses of any CNF formula F can be split into two blocked setsL and R. This process is called Blocked Clause Decomposition (BCD).

BCD(F ) = (L,R); F = L ∪ R; L,R ∈ BS; |L| ≥ |R|

The larger of the two blocked sets is called L (large) and the other isR (rest). A BCD is better if L is much bigger than R.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 13 / 23

Page 26: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Getting Blocked Sets

Are blocked sets commonly found among application formulas? NO.

... among competition benchmarks? NO.

Where can we get some blocked sets?

Blocked Clause Decomposition

The set of clauses of any CNF formula F can be split into two blocked setsL and R. This process is called Blocked Clause Decomposition (BCD).

BCD(F ) = (L,R); F = L ∪ R; L,R ∈ BS; |L| ≥ |R|

The larger of the two blocked sets is called L (large) and the other isR (rest). A BCD is better if L is much bigger than R.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 13 / 23

Page 27: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Getting Blocked Sets

Are blocked sets commonly found among application formulas? NO.

... among competition benchmarks? NO.

Where can we get some blocked sets?

Blocked Clause Decomposition

The set of clauses of any CNF formula F can be split into two blocked setsL and R. This process is called Blocked Clause Decomposition (BCD).

BCD(F ) = (L,R); F = L ∪ R; L,R ∈ BS; |L| ≥ |R|

The larger of the two blocked sets is called L (large) and the other isR (rest). A BCD is better if L is much bigger than R.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 13 / 23

Page 28: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Pure Decomposition

Pure decomposition is a simple linear BCD algorithm.

1 let L = R = ∅2 select any x ∈ Vars(F )

3 let Fx ⊆ F (Fx ⊆ F ) be the clauses of F that contain x (x).

4 if |Fx | > |Fx | then add Fx into L and Fx to R otherwise add Fx intoR and Fx to L.

5 remove Fx and Fx from F .

6 if F 6= ∅ then goto step 2.

Produces blocked sets that can be solved by pure literal elimination.

Runs in linear time. Quality of the decomposition is not great.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 14 / 23

Page 29: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Improved Unit Decomposition

Two incomplete algorithms for BCD:

Unit Decomposition

Test if the non-unit clauses of F are a blocked set. If so, L = non-unitclauses of F , R = unit clauses of F .

Works on 77 of the 300 instances of the application track of the 2013 SATCompetition.

Improved Unit Decomposition

Run unit propagation on F without removing unsat literals from clauses.Test if the remaining clauses of F are a blocked set. If so, L = remainingclauses of F , R = clauses removed by UP.

Works on 95 of the 300 instances of the application track of the 2013 SATCompetition.If these algorithms fail run pure decomposition.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 15 / 23

Page 30: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Improved Unit Decomposition

Two incomplete algorithms for BCD:

Unit Decomposition

Test if the non-unit clauses of F are a blocked set. If so, L = non-unitclauses of F , R = unit clauses of F .

Works on 77 of the 300 instances of the application track of the 2013 SATCompetition.

Improved Unit Decomposition

Run unit propagation on F without removing unsat literals from clauses.Test if the remaining clauses of F are a blocked set. If so, L = remainingclauses of F , R = clauses removed by UP.

Works on 95 of the 300 instances of the application track of the 2013 SATCompetition.

If these algorithms fail run pure decomposition.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 15 / 23

Page 31: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Improved Unit Decomposition

Two incomplete algorithms for BCD:

Unit Decomposition

Test if the non-unit clauses of F are a blocked set. If so, L = non-unitclauses of F , R = unit clauses of F .

Works on 77 of the 300 instances of the application track of the 2013 SATCompetition.

Improved Unit Decomposition

Run unit propagation on F without removing unsat literals from clauses.Test if the remaining clauses of F are a blocked set. If so, L = remainingclauses of F , R = clauses removed by UP.

Works on 95 of the 300 instances of the application track of the 2013 SATCompetition.If these algorithms fail run pure decomposition.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 15 / 23

Page 32: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

BCD Post-processing

After running pure decomposition or (improved) unit decomposition someclauses can be moved to L from R to improve BCD quality.

Clauses from R that are blocked w.r.t. L can be moved immediately.

So called ‘blockable’ clauses can be also moved.

For any set S ⊂ R we can try if BCE (L ∪ S) = ∅ and move it.However, this is costly.

L is called a maximal blocking set if none of the clauses in R can bemoved to L.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 16 / 23

Page 33: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Solitaire Decomposition

Solitaire Decomposition

A special kind of BCD where the the small blocked set R contains only asingle unit clause is called a Solitaire decomposition.Solitaire decomposition can be always achieved if we add a new variable yto each clause of F and a unit clause (y).

C1 ∧ · · · ∧ Cm → (C1 ∨ y) ∧ · · · ∧ (Cm ∨ y) ∧ (y)

Then R = (y) and L = (C1 ∨ y) ∧ · · · ∧ (Cm ∨ y).

It is better to first do BCD and then add y only to the clauses in R andmove them into L.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 17 / 23

Page 34: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

ReencodingInstead of implementing the algorithm for solving blocked sets we encodeits progression on a given BS into SAT.

For each original variable x1, . . . , xn of F , we will have several newvariables called versions. By xi ,k , we denote the k-th version of xi(xi ,0 is xi ) and by xi ,$, the latest version of xi

For each clause C = (xi ∨ yj1 ∨ · · · ∨ yjk ), where xi is the blockingliteral, we create a new version of xi . The value of the new version isgiven by the following definition.

xi ,$+1 := xi ,$ ∨ (y j1,$ ∧ · · · ∧ y jk ,$)

Example: (x1 ∨ x3 ∨ x2) ∧ (x3 ∨ x4 ∨ x1) ∧ (x1 ∨ x2 ∨ x3).

x1,1 := x1,0 ∨ (x2,0 ∧ x3,0)

x3,1 := x3,0 ∨ (x4,0 ∧ x1,1)

x1,2 := x1,1 ∨ (x3,1 ∧ x2,0)

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 18 / 23

Page 35: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Reencoding

The equations xi ,$+1 := xi ,$ ∨ (y j1,$ ∧ · · · ∧ y jk ,$) are then:

Directly encoded into CNF (using k + 2 clauses for each):

(x i ,$ ∨ xi ,$+1) ∧ (xi ,$+1 ∨ yj1,$ ∨ · · · ∨ yjk ,$) ∧k∧

l=1

(y jl ,$ ∨ x i ,$+1 ∨ xi ,$)

The final versions of the variables (xi ,$) are then substituted in theclauses of the small blocked set.

OR

Expressed as an And-Inverter-Graph (AIG) circuit, then simplifiedusing circuit simplification techniques (dc2 of ABC) and finally thesimplified AIG is translated into CNF.We use solitaire decomposition and the unit clause of the smallblocked set represents the output of the AIG.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 19 / 23

Page 36: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Experiments

We evaluated the proposed methods on the 300 instances from theapplication track of the SAT Competition 2013.

We used a 32-node cluster with Intel Core 2 Quad ([email protected]) processors and 8GB of memory, time limit of 5000seconds and a memory limit of 7000MB.

We compared the performance of Lingeling with and withoutreencoding.

Results for the direct CNF encoding:

With reencoding we can solve 8 more formulas (240/300).

Useful only for hard instances (solved longer than 1 hour).

Better BCD gives better runtimes.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 20 / 23

Page 37: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Experiments – AIG Method

0

1000

2000

3000

4000

5000

6000

0 20 40 60 80 100 120

Tim

e in S

eco

nds

Poblems

Solving Time with and without Circuit Simplification

Ligenling + ABCLigenling after ABC

Lingeling

The time required to solve the benchmark formulas, which can bedecomposed with a quality of at least 90% (135 of 300 instances).Reencoding helps to solve 7 more formulas.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 21 / 23

Page 38: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Conclusion

We showed some structural properties of blocked sets.

We introduced new algorithms for solving blocked sets anddecomposing formulas into blocked sets.

We showed that BCD can be used to reencode formulas and improvethe performance of SAT solving on hard instances.

Future work:

Is it possible to enumerate all the solutions of a blocked set?

Can blocked sets be used to improve local search SAT solvers?

Other usages of blocked sets?

More efficient BCD.

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 22 / 23

Page 39: Everything You Always Wanted to Know About Blocked Sets ... · 2 = (:l _D 2) C 1 l C 2 = (D 1 _D 2) By C 1 l C 2 we denote the resolution of C 1 and C 2 on the literal l. The clauses

Thank You

Balyo, Frohlich, Heule, Biere Blocked Sets SAT 2014 23 / 23