the dpll procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/fall09/notes/dpll.pdfthe original dpll...

55
The DPLL Procedure Cesare Tinelli [email protected] The University of Iowa 22c:196, Feb 2007 – p.1/17

Upload: others

Post on 26-Mar-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL Procedure

Cesare [email protected]

The University of Iowa

22c:196, Feb 2007 – p.1/17

Page 2: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Propositional Satisfiability: SAT

• Deciding the satisfiability of a propositional formula is awell-studied and important problem.

• Theoretical interest: first established NP-Completeproblem, phase transition, . . .

• Practical interest: applications to scheduling, planning,logic synthesis, verification, . . .

• Development of algorithms and enhancements.• Implementation of extremely efficient tools.• Solvers based on the DPLL procedure have been the

most successful so far.

22c:196, Feb 2007 – p.2/17

Page 3: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL

• Tries to build incrementally a satisfying truth assignmentM for a CNF formula F .

• M is grown by• deducing the truth value of a literal from M and F ,

or• guessing a truth value.

• If a wrong guess for a literal leads to an inconsistency,the procedure backtracks and tries the opposite value.

22c:196, Feb 2007 – p.3/17

Page 4: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.4/17

Page 5: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.4/17

Page 6: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.4/17

Page 7: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.4/17

Page 8: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 4 1, 2, 3, 4 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.4/17

Page 9: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 4 1, 2, 3, 4 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

Inconsistency!

22c:196, Feb 2007 – p.4/17

Page 10: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 4 1, 2, 3, 4 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

undo 3 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.5/17

Page 11: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 4 1, 2, 3, 4 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

undo 3 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

22c:196, Feb 2007 – p.5/17

Page 12: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Original DPLL – Example

Operation Assign. Formula

1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 1 1 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 2 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

deduce 4 1, 2, 3, 4 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

undo 3 1, 2 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

guess 3 1, 2, 3 1 ∨ 2, 2 ∨ 3 ∨ 4, 1 ∨ 2, 1 ∨ 3 ∨ 4, 1

Model Found!

22c:196, Feb 2007 – p.5/17

Page 13: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

An Abstract Framework for DPLL

• The DPLL procedure can be described declaratively bysimple sequent-style calculi.

• Such calculi however cannot model meta-logical featuressuch as backtracking, learning and restarts.

• We model DPLL and its enhancements as transitionsystems instead.

• A transition system is a binary relation over states,induced by a set of conditional transition rules.

22c:196, Feb 2007 – p.6/17

Page 14: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

An Abstract Framework for DPLL

Our states:

fail or M || F

where F is a CNF formula, a set of clauses, and

M is a sequence of annotated literals

denoting a partial truth assignment.

22c:196, Feb 2007 – p.7/17

Page 15: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

An Abstract Framework for DPLL

Our states:

fail or M || F

Initial state:

• ∅ || F , where F is to be checked for satisfiability.

Expected final states:

• fail , if F is unsatisfiable

•M || G, where M is a model of G and

G is logically equivalent to F .

22c:196, Feb 2007 – p.7/17

Page 16: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Transition Rules for the Original DPLL

Extending the assignment:

Propagate

M || F, C ∨ l → M l || F, C ∨ l if

{

M falsifies C,

l is undefined in M

22c:196, Feb 2007 – p.8/17

Page 17: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Transition Rules for the Original DPLL

Extending the assignment:

Propagate

M || F, C ∨ l → M l || F, C ∨ l if

{

M falsifies C,

l is undefined in M

Decide

M || F → M l• || F if

{

l or l occurs in F,

l is undefined in M

Notation: l• annotates l as a decision literal.

22c:196, Feb 2007 – p.8/17

Page 18: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Transition Rules for the Original DPLL

Repairing the assignment:

Fail

M || F, C → fail if

{

M falsifies C,

M contains no decision literals

22c:196, Feb 2007 – p.9/17

Page 19: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Transition Rules for the Original DPLL

Repairing the assignment:

Fail

M || F, C → fail if

{

M falsifies C,

M contains no decision literals

Backtrack

M l• N || F,C → M l || F,C if

{

M l• N falsifies C,

l last decision literal

22c:196, Feb 2007 – p.9/17

Page 20: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

22c:196, Feb 2007 – p.10/17

Page 21: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

22c:196, Feb 2007 – p.10/17

Page 22: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

22c:196, Feb 2007 – p.10/17

Page 23: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

22c:196, Feb 2007 – p.10/17

Page 24: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

22c:196, Feb 2007 – p.10/17

Page 25: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

22c:196, Feb 2007 – p.10/17

Page 26: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

22c:196, Feb 2007 – p.10/17

Page 27: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

p1•, p2, p3

•, p4, p5 Backtrack 4.

22c:196, Feb 2007 – p.10/17

Page 28: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

p1•, p2, p3

•, p4, p5 Backtrack 4.

p1•, p2, p3

•, p4, p5, p7 Propagate 5.

22c:196, Feb 2007 – p.10/17

Page 29: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

p1•, p2, p3

•, p4, p5 Backtrack 4.

p1•, p2, p3

•, p4, p5, p7 Propagate 5.

p1•, p2, p3 Backtrack 6.

22c:196, Feb 2007 – p.10/17

Page 30: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Original DPLL System – Example

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

p1•, p2, p3

•, p4, p5 Backtrack 4.

p1•, p2, p3

•, p4, p5, p7 Propagate 5.

p1•, p2, p3 Backtrack 6.

. . .22c:196, Feb 2007 – p.10/17

Page 31: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

From Backtracking to BackjumpingBacktrack

M l• N || F,C → M l || F,C if

{

M l• N falsifies C,

l last decision literal

22c:196, Feb 2007 – p.11/17

Page 32: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

From Backtracking to BackjumpingBacktrack

M l• N || F,C → M l || F,C if

{

M l• N falsifies C,

l last decision literal

Backjump

M l• N || F,C → M k || F,C if

1. M l• N falsifies C,

2. for some clause D ∨ k:

F,C |= D ∨ k,

M falsifies D,

k is undefined in M,

k or k occurs in

M l• N || F,C

22c:196, Feb 2007 – p.11/17

Page 33: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

From Backtracking to BackjumpingBacktrack

M l• N || F,C → M l || F,C if

{

M l• N falsifies C,

l last decision literal

Backjump

M l• N || F,C → M k || F,C if

1. M l• N falsifies C,

2. for some clause D ∨ k:

F,C |= D ∨ k,

M falsifies D,

k is undefined in M,

k or k occurs in

M l• N || F,C

Note: D ∨ k is computed by conflict analysis.22c:196, Feb 2007 – p.11/17

Page 34: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Example Revised

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

22c:196, Feb 2007 – p.12/17

Page 35: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Example Revised

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

p1•, p2, p5 Backjump with p2 ∨ p5.

22c:196, Feb 2007 – p.12/17

Page 36: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Example Revised

F := 1. p1 ∨ p2, 2. p3 ∨ p4, 3. p6 ∨ p5 ∨ p2

4. p5 ∨ p6, 5. p5 ∨ p7, 6. p1 ∨ p5 ∨ p7

M Rule

p1• Decide

p1•, p2 Propagate 1.

p1•, p2, p3

• Decide

p1•, p2, p3

•, p4 Propagate 2.

p1•, p2, p3

•, p4, p5• Decide

p1•, p2, p3

•, p4, p5•, p6 Propagate 3.

p1•, p2, p5 Backjump with p2 ∨ p5.

. . .

22c:196, Feb 2007 – p.12/17

Page 37: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Basic DPLL System

At the core, current DPLL-based SAT solvers areimplementations of the transition system:

Basic DPLL

• Propagate

• Decide

• Fail

• Backjump

22c:196, Feb 2007 – p.13/17

Page 38: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Basic DPLL System – CorrectnessSome terminology

Irreducible state: state to which no transition rule applies.

Execution: sequence of transitions allowed by the rules and

starting with states of the form ∅ || F .

Exhausted execution: execution ending in an irreducible state.

22c:196, Feb 2007 – p.14/17

Page 39: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Basic DPLL System – CorrectnessSome terminology

Irreducible state: state to which no transition rule applies.

Execution: sequence of transitions allowed by the rules and

starting with states of the form ∅ || F .

Exhausted execution: execution ending in an irreducible state.

Proposition (Strong Termination) Every execution in BasicDPLL is finite.

Note: This is not so immediate, because of Backjump.

22c:196, Feb 2007 – p.14/17

Page 40: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The Basic DPLL System – CorrectnessSome terminology

Irreducible state: state to which no transition rule applies.

Execution: sequence of transitions allowed by the rules and

starting with states of the form ∅ || F .

Exhausted execution: execution ending in an irreducible state.

Proposition (Soundness) For every exhausted executionstarting with ∅ || F and ending in M || F , M satisfies F .

Proposition (Completeness) If F is unsatisfiable, everyexhausted execution starting with ∅ || F ends with fail .

22c:196, Feb 2007 – p.14/17

Page 41: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Enhancements to Basic DPLL

22c:196, Feb 2007 – p.15/17

Page 42: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Enhancements to Basic DPLL

Learn

M || F → M || F, C if

{

all atoms of C occur in F,

F |= C

22c:196, Feb 2007 – p.15/17

Page 43: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Enhancements to Basic DPLL

Learn

M || F → M || F, C if

{

all atoms of C occur in F,

F |= C

Forget

M || F, C → M || F if F |= C

22c:196, Feb 2007 – p.15/17

Page 44: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Enhancements to Basic DPLL

Learn

M || F → M || F, C if

{

all atoms of C occur in F,

F |= C

Forget

M || F, C → M || F if F |= C

Usually C is a clause identified during conflict analysis.

22c:196, Feb 2007 – p.15/17

Page 45: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Enhancements to Basic DPLL

Learn

M || F → M || F, C if

{

all atoms of C occur in F,

F |= C

Forget

M || F, C → M || F if F |= C

RestartM || F → ∅ || F if . . . you want to

22c:196, Feb 2007 – p.15/17

Page 46: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

Enhancements to Basic DPLL

Learn

M || F → M || F, C if

{

all atoms of C occur in F,

F |= C

Forget

M || F, C → M || F if F |= C

RestartM || F → ∅ || F if . . . you want to

The DPLL system =

{Propagate,Decide,Fail,Backjump, Learn,Forget,Restart}

22c:196, Feb 2007 – p.15/17

Page 47: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Strategies• Applying one Basic DPLL rule between each two Learn

and applying Restart less and less often ensurestermination.

22c:196, Feb 2007 – p.16/17

Page 48: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Strategies• Applying one Basic DPLL rule between each two Learn

and applying Restart less and less often ensurestermination.

• In practice, Learn is usually (but not only) applied rightafter Backjump.

22c:196, Feb 2007 – p.16/17

Page 49: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Strategies• Applying one Basic DPLL rule between each two Learn

and applying Restart less and less often ensurestermination.

• In practice, Learn is usually (but not only) applied rightafter Backjump.

• A common strategy is to apply the rules with thesepriorities:

22c:196, Feb 2007 – p.16/17

Page 50: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Strategies• Applying one Basic DPLL rule between each two Learn

and applying Restart less and less often ensurestermination.

• In practice, Learn is usually (but not only) applied rightafter Backjump.

• A common strategy is to apply the rules with thesepriorities:

1. If n > 0 conflicts have been found so far,increase n and apply Restart.

22c:196, Feb 2007 – p.16/17

Page 51: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Strategies• Applying one Basic DPLL rule between each two Learn

and applying Restart less and less often ensurestermination.

• In practice, Learn is usually (but not only) applied rightafter Backjump.

• A common strategy is to apply the rules with thesepriorities:

1. If n > 0 conflicts have been found so far,increase n and apply Restart.

2. If a current clause is falsified by the currentassignment,apply Fail or Backjump + Learn.

22c:196, Feb 2007 – p.16/17

Page 52: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Strategies• Applying one Basic DPLL rule between each two Learn

and applying Restart less and less often ensurestermination.

• In practice, Learn is usually (but not only) applied rightafter Backjump.

• A common strategy is to apply the rules with thesepriorities:

1. If n > 0 conflicts have been found so far,increase n and apply Restart.

2. If a current clause is falsified by the currentassignment,apply Fail or Backjump + Learn.

3. Apply Propagate

22c:196, Feb 2007 – p.16/17

Page 53: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Correctness

Proposition (Termination) Every execution in which(a) Learn/Forget are applied only finitely many times and(b) Restart is applied with increased periodicity

is finite.

22c:196, Feb 2007 – p.17/17

Page 54: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Correctness

Proposition (Termination) Every execution in which(a) Learn/Forget are applied only finitely many times and(b) Restart is applied with increased periodicity

is finite.

Proposition (Soundness) For every execution∅ || F =⇒ · · · =⇒ M || F with M || F irreducible wrt. BasicDPLL, M models F .

22c:196, Feb 2007 – p.17/17

Page 55: The DPLL Procedurehomepage.cs.uiowa.edu/~tinelli/classes/196/Fall09/notes/dpll.pdfThe Original DPLL • Tries to build incrementally a satisfying truth assignment M for a CNF formula

The DPLL System – Correctness

Proposition (Termination) Every execution in which(a) Learn/Forget are applied only finitely many times and(b) Restart is applied with increased periodicity

is finite.

Proposition (Soundness) For every execution∅ || F =⇒ · · · =⇒ M || F with M || F irreducible wrt. BasicDPLL, M models F .

Proposition (Completeness) If F is unsatisfiable, for everyexecution ∅ || F =⇒ · · · =⇒ S with S irreducible wrt. BasicDPLL, S = fail .

22c:196, Feb 2007 – p.17/17