1 understanding the power of clause learning ashish sabharwal, paul beame, henry kautz university of...

30
1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI Conference Aug 14, 2003

Post on 21-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

1

Understanding the Power ofClause Learning

Ashish Sabharwal, Paul Beame, Henry KautzUniversity of Washington, Seattle

IJCAI Conference Aug 14, 2003

Page 2: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

2

SAT: The Satisfiability Problem

Given a CNF formula F,

[e.g. F = (a b) (a c) a ]

determine if F has a satisfying assignment

Your favoriteproblem

NO

SAT Encoder SAT Solver

YES + a solution

CNF formula

Page 3: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

3

SAT Solver: DPLL Algorithm

Best complete CNF (un)satisfiability algorithms in

practice are extensions of the DPLL algorithm [Davis-Putnam 60]

[Davis-Logeman-Loveland 62]

• Recursive backtrack search• Search space pruning based on falsified clauses

Page 4: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

4

DPLL(F)// Perform unit propagationwhile exists unit clause (y) F

F = F|y

if F is empty, report satisfiable and haltif F contains the empty clause returnelse choose a literal x

DPLL(F|x)

DPLL(F|x)

DPLL Algorithm

Remove all clauses containing y Shrink all clauses containing y

Page 5: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

5

Extending DPLL: Clause Learning

Added conflict clauses – Capture reasons of conflicts– Obtained via unit propagations from known ones– Reduce future search by producing conflicts

sooner

When backtracking in DPLL, add new clauses corresponding to causes of failure of the searchEBL [Kleer-Williams 87, Stallman-Sussman 77, Genesereth 84, Davis 84]

CL [Bayardo-Schrag 97, MarquesSilva-Sakallah 96, Zhang 97, Moskewicz et al. 01, Zhang et al. 01]

Page 6: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

6

Conflict Graphs

Our New Scheme:FirstNewCut scheme

(x1 x2 x3)

Decision scheme(p q b)

1-UIP schemet

p

q

b

a

x1

x2

x3

y

yfalset

Known Clauses(p q a)

( a b t)(t x1)(t x2)(t x3)

(x1 x2 x3 y)(x2 y)

Current decisionsp = falseq = falseb = true

Page 7: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

7

Restarts

Clause Learning (CL) algorithms can be restarted at any point [Baptista-Silva 00]

– Unset all variables and start over– But retain all clauses learned so far

• Avoids getting stuck in one part of the search space

• Evidently adds power to CL

Page 8: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

8

CL Critical to Performance

Best current SAT algorithms rely heavily on CL for good behavior on real world problems

GRASP [MarquesSilva-Sakallah 96], SATO [H.Zhang 97]zChaff [Moskewicz et al. 01], Berkmin [Goldberg-Novikov 02]

However,No good understanding of its strengths and

weaknessesNot much insight on why it works when it does

Page 9: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

9

Our Contribution

• Mathematical framework for analyzing clause learning

• Characterization of its power in relation to well-studied topics in proof complexity theory

• Ways to improve solver performance based on formal analysis

Page 10: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

10

Proofs of Unsatisfiability

When F is unsatisfiable,

• DPLL refutation of F is a proof of its unsatisfiability

• Size lower bound on proofs of F givestime lower bound on executions of DPLL(F)

• Size upper bound on proofs of F givespotential for quick executions of such algorithms

(with or w/o learning depending on the class of proofs)

(with the best possible branching heuristic, the best learning scheme, etc.)

Page 11: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

11

What about Satisfiable Formulas?

[Achlioptas-Beame-Molloy 01]

DPLL Tree

Satisfyingassignment

Unsatisfiablesub-formula

Bounds on unsatisfiable formulasimply bounds on satisfiable ones!

Page 12: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

12

Proof System: Resolution

F = (a b) (a c) a (b c) (a c)

Unsatisfiable CNF formula

c

c

Proof size = 9

empty clause

(a b) (a c) (bc) (a c)a

(b c)

Page 13: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

13

Special Cases of Resolution

Tree-like resolution– Graph of inferences forms a tree DPLL

Regular resolution– Variable can be resolved on only once on any

path from input to empty clause Directed acyclic graph analog of DPLL tree

– Natural to not branch on a variable once it has been eliminated

– Used in original DP [Davis-Putnam 60]

Page 14: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

14

Proof System Hierarchy

DPLL =Tree-like

Space of polynomialtime solvable formulas

RegularRES

[Bonet et al. 00]

General RES

[Alekhnovich et al. 02]

Frege systems

……

Pigeonhole principle[Haken 85]

Page 15: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

15

Our Results

DPLL =Tree-like

RegularRES

General RES

CL w/orestarts

Trivial RES= Learned clauses

DPLL =Tree-like

RegularRES

General RES

Page 16: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

16

Thm1. CL can beat Regular RES

RegularRES

General RES

Formula f• Poly-size RES proof • Exp-size Regular proof

Such formulas exist!GTn Ordering principlePeb Pebbling formulas [Alekhnovich et al. 02]

Formula PT(f, )• Poly-size CL proof• Exp-size Regular proof

RegularRES

CL w/orestarts

Page 17: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

17

PT(f,): Proof Trace Extension

Start with• unsatisfiable formula f with poly-size RES proof

PT(f, ) contains • All clauses of f• For each derived clause Q=(abc) in ,

– Trace variable tQ

– New clauses (tQ a), (tQ b), (tQ c)

CL proof of PT(f, ) works by branching negativelyon tQ’s in bottom up order of clauses of

Page 18: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

18

PT(f,): Proof Trace Extension

(a b x) (c x)

Q (a b c)

… … … …

Formula fRES proof

tQ

a

b

c

x

x

false

• Trace variable tQ

• New clauses(tQ a)(tQ b)(tQ c)

PT(f,)

FirstNewCut(a b c)

Page 19: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

19

How hard is PT(f,)?

Easy for CL: by constructionCL branches exactly once on each trace variable # branches = size()

Hard for Regular RES: reduction argument

Fact 1: PT(f,)|TraceVars = true f

Fact 2: If is a Regular RES proof of g, then |x is a Regular RES proof of g|x

Fact 3: f does not have small Regular proofs!

Page 20: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

20

Implications?

DPLL algorithms w/o clause learning arehopeless for some structured formulas

CL algorithms have potential for small proofs

Can we use such analysis to harness this potential?

Page 21: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

21

Branching Sequence

B = (x1, x4, x3, x1, x8, x2, x4, x7, x1)

• DPLL picks branching literals from B• Repetitions allowed• Different from “branching order”

How “good” is B?– Depends on backtracking process, learning

scheme, etc

Page 22: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

22

From Analysis to Practice

Maximum size of grid pebbling formulas solvable

by zChaff (in 1 day) can be substantially increased!

Unsatisfiable formulas

Naïve DPLL 45 vars

Original zChaff 2,000 vars

zChaff with specified branching sequence

2,500,000 vars

Results extend to general randomized pebbling

formulas [Sabharwal-Beame-Kautz SAT 2003]

Satisfiable formulas

55 vars

4,500 vars

1,000,000 vars

Page 23: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

23

Trivial RES

Simple ladder structure Distinct variables resolved upon Properties:

o Tree-likeo Regularo Linear

Clauses learned by CL are thosethat can be derived by trivial RES

Known clauses: (a b c), (a x), (b c), (c y)Derived clause: (x y)

(b c x)

(c x)

(a b c) (a x)

(b c)

(c y)

(x y)

Page 24: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

24

Our Results

DPLL =Tree-like

RegularRES

CL w/orestarts

Trivial RES= Learned clauses

Page 25: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

25

CL-- A Variant of CL

Allow branching on variables whose value is already implied by unit propagation– Equivalently, allow branching on variables not

appearing at all in the residual formula

How can this possibly help?

Can learn a conflict clause that will reduce search later!

Page 26: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

26

Error in Paper

Incorrect Theorem 1 in the paper:“CL + restarts is equivalent to RES”

Correct version:“CL-- + restarts is equivalent to RES”

Page 27: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

27

Thm2. CL-- + restarts = General RES

• General RES can simulate CL + restarts CL learns by unit propagation Infer learned clauses using RES derivation

• CL-- + restarts can simulate General RES If RES proof resolves (A x) and (B x) to

obtain C, branch and set all literals of A and B to false, learn C, restart

Eventually learn empty clause

Page 28: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

28

Our Results

DPLL =Tree-like

RegularRES

General RES= CL-- + restarts

CL w/orestarts

Trivial RES= Learned clauses

Page 29: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

29

Summary

• Formal framework

• CL can be stronger than Regular RES– FirstNewCut learning scheme

• CL-- + restarts is equivalent to RES

Page 30: 1 Understanding the Power of Clause Learning Ashish Sabharwal, Paul Beame, Henry Kautz University of Washington, Seattle IJCAI ConferenceAug 14, 2003

30

Open Problems

Fill in complexity hierarchy gaps

1. Can CL efficiently simulate Regular RES?

2. Can CL + restarts efficiently simulate RES?

From Analysis to PracticeCan we use this framework to improve SAT solvers for other classes of structured formulas?E.g. Planning as satisfiability

Bounded model checking