Lookahead Techniques

82
Lookahead Techniques Marijn J.H. Heule http://www.cs.cmu.edu/ ~ mheule/15816-f19/ Automated Reasoning and Satisfiability, September 26, 2019 1 / 29

Transcript of Lookahead Techniques

Page 1: Lookahead Techniques

Lookahead Techniques

Marijn J.H. Heule

http://www.cs.cmu.edu/~mheule/15816-f19/

Automated Reasoning and Satisfiability, September 26, 2019

1 / 29

Page 2: Lookahead Techniques

DPLL Procedure

Look-ahead Architecture

Look-ahead Learning

Autarky Reasoning

Tree-based Look-ahead

2 / 29

Page 3: Lookahead Techniques

DPLL Procedure

Look-ahead Architecture

Look-ahead Learning

Autarky Reasoning

Tree-based Look-ahead

3 / 29

Page 4: Lookahead Techniques

SAT Solving: DPLL

Davis Putnam Logemann Loveland [DP60,DLL62]

Recursive procedure that in each recursive call:Simplifies the formula (using unit propagation)

Splits the formula into two subformulas• Variable selection heuristics (which variable to split on)• Direction heuristics (which subformula to explore first)

4 / 29

Page 5: Lookahead Techniques

DPLL: Example

FDPLL := (x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x1 ∨ x3)

5 / 29

Page 6: Lookahead Techniques

DPLL: Example

FDPLL := (x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x1 ∨ x3)

x3

0 1

5 / 29

Page 7: Lookahead Techniques

DPLL: Example

FDPLL := (x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2 ∨ x3) ∧ (x1 ∨ x3) ∧ (x1 ∨ x3)

x3

0 1

x2

x1 x3

0 1

0 1 1 0

5 / 29

Page 8: Lookahead Techniques

DPLL: Slightly Harder Example

Slightly Harder Example

Construct a DPLL tree for:

(a ∨ b ∨ c) ∧ (a ∨ b ∨ c) ∧(b ∨ c ∨ d) ∧ (b ∨ c ∨ d) ∧(a ∨ c ∨ d) ∧ (a ∨ c ∨ d) ∧(a ∨ b ∨ d)

6 / 29

Page 9: Lookahead Techniques

Look-ahead: Definition

DPLL with selection of (effective) decision variablesby look-aheads on variables

7 / 29

Page 10: Lookahead Techniques

Look-ahead: Definition

DPLL with selection of (effective) decision variablesby look-aheads on variables

Look-ahead:

Assign a variable to a truth value

7 / 29

Page 11: Lookahead Techniques

Look-ahead: Definition

DPLL with selection of (effective) decision variablesby look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

7 / 29

Page 12: Lookahead Techniques

Look-ahead: Definition

DPLL with selection of (effective) decision variablesby look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Measure the reduction

7 / 29

Page 13: Lookahead Techniques

Look-ahead: Definition

DPLL with selection of (effective) decision variablesby look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Measure the reduction

Learn if possible

7 / 29

Page 14: Lookahead Techniques

Look-ahead: Definition

DPLL with selection of (effective) decision variablesby look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Measure the reduction

Learn if possible

Backtrack

7 / 29

Page 15: Lookahead Techniques

DPLL Procedure

Look-ahead Architecture

Look-ahead Learning

Autarky Reasoning

Tree-based Look-ahead

8 / 29

Page 16: Lookahead Techniques

Look-ahead: Example

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

9 / 29

Page 17: Lookahead Techniques

Look-ahead: Example

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0}

9 / 29

Page 18: Lookahead Techniques

Look-ahead: Example

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0}

9 / 29

Page 19: Lookahead Techniques

Look-ahead: Example

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0}

9 / 29

Page 20: Lookahead Techniques

Look-ahead: Example

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0, x3=1}

9 / 29

Page 21: Lookahead Techniques

Look-ahead: Properties

Very expensive

10 / 29

Page 22: Lookahead Techniques

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

10 / 29

Page 23: Lookahead Techniques

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

Detection of failed literals (and more)

10 / 29

Page 24: Lookahead Techniques

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

Detection of failed literals (and more)

Strong on random k-SAT formulae

10 / 29

Page 25: Lookahead Techniques

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

Detection of failed literals (and more)

Strong on random k-SAT formulae

Examples: march, OKsolver, kcnfs

10 / 29

Page 26: Lookahead Techniques

DEMO

11 / 29

Page 27: Lookahead Techniques

Look-ahead: Reduction heuristics

Number of satisfied clauses

12 / 29

Page 28: Lookahead Techniques

Look-ahead: Reduction heuristics

Number of satisfied clauses

Number of implied variables

12 / 29

Page 29: Lookahead Techniques

Look-ahead: Reduction heuristics

Number of satisfied clauses

Number of implied variables

New (reduced, not satisfied) clauses

• Smaller clauses more important

• Weights based on occurring

12 / 29

Page 30: Lookahead Techniques

Look-ahead: Architecture

xa

xb xc

0 1

?

1 0 0

DPLL

x1 x2 x3 x4

FLA

0

9

1

9

0

13

1

6

0 1

7

0

10

1

8

LookAhead

H(xi )

13 / 29

Page 31: Lookahead Techniques

Look-ahead: Pseudo-code

1: F := Simplify (F)

2: if F is empty then return satisfiable

3: if ∅ ∈ F then return unsatisfiable

4: 〈F ; ldecision〉 := LookAhead (F)

5: if (DPLL( F(ldecision ← 1)) = satisfiable) then

6: return satisfiable

7: return DPLL (F(ldecision ← 0))

14 / 29

Page 32: Lookahead Techniques

DPLL Procedure

Look-ahead Architecture

Look-ahead Learning

Autarky Reasoning

Tree-based Look-ahead

15 / 29

Page 33: Lookahead Techniques

Local Learning

Look-ahead solvers do not perform global learning,in contrast to contrast to conflict-driven clauselearning (CDCL) solvers

Instead, look-ahead solvers learn locally:Learn small (typically unit or binary) clauses that are validfor the current node and lower in the DPLL tree

Locally learnt clauses have to be removed duringbacktracking

16 / 29

Page 34: Lookahead Techniques

Failed Literals and Double Look-aheads

A literal l is called a failed literal if the look-ahead on l = 1results in a conflict:

failed literal l is forced to false followed by unit propagation

if both x and x are failed literals, then backtrack

Failed literals can be generalized by double lookahead: assigntwo literals and learn a binary clause in case of a conflict.

17 / 29

Page 35: Lookahead Techniques

Failed Literals and Double Look-aheads

A literal l is called a failed literal if the look-ahead on l = 1results in a conflict:

failed literal l is forced to false followed by unit propagation

if both x and x are failed literals, then backtrack

Failed literals can be generalized by double lookahead: assigntwo literals and learn a binary clause in case of a conflict.

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

17 / 29

Page 36: Lookahead Techniques

Failed Literals and Double Look-aheads

A literal l is called a failed literal if the look-ahead on l = 1results in a conflict:

failed literal l is forced to false followed by unit propagation

if both x and x are failed literals, then backtrack

Failed literals can be generalized by double lookahead: assigntwo literals and learn a binary clause in case of a conflict.

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x4=0, x6=1}

17 / 29

Page 37: Lookahead Techniques

Failed Literals and Double Look-aheads

A literal l is called a failed literal if the look-ahead on l = 1results in a conflict:

failed literal l is forced to false followed by unit propagation

if both x and x are failed literals, then backtrack

Failed literals can be generalized by double lookahead: assigntwo literals and learn a binary clause in case of a conflict.

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x4=0, x6=1, x1=1}

17 / 29

Page 38: Lookahead Techniques

Failed Literals and Double Look-aheads

A literal l is called a failed literal if the look-ahead on l = 1results in a conflict:

failed literal l is forced to false followed by unit propagation

if both x and x are failed literals, then backtrack

Failed literals can be generalized by double lookahead: assigntwo literals and learn a binary clause in case of a conflict.

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x4=0, x6=1, x1=1, x2=1}

17 / 29

Page 39: Lookahead Techniques

Failed Literals and Double Look-aheads

A literal l is called a failed literal if the look-ahead on l = 1results in a conflict:

failed literal l is forced to false followed by unit propagation

if both x and x are failed literals, then backtrack

Failed literals can be generalized by double lookahead: assigntwo literals and learn a binary clause in case of a conflict.

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x4=0, x6=1, x1=1, x2=1, x3=1}

17 / 29

Page 40: Lookahead Techniques

Hyper Binary Resolution [Bacchus 2002]

Definition (Hyper Binary Resolution Rule)

(x ∨ x1 ∨ x2 ∨ · · · ∨ xn) (x̄1 ∨ x ′) (x̄2 ∨ x ′) . . . (x̄n ∨ x ′)

(x ∨ x ′)

binary edge

hyper edge

hyper binary edge

x̄ ′

x

x̄1

. . .x̄2

x̄n

x ′

Hyper Binary Resolution Rule:

combines multiple resolution steps into one

uses one n-ary clauses and multiple binary clauses

special case hyper unary resolution where x = x ′

18 / 29

Page 41: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

19 / 29

Page 42: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0}

19 / 29

Page 43: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0}

19 / 29

Page 44: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0}

19 / 29

Page 45: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0, x3=1}

19 / 29

Page 46: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0, x3=1}

hyper binary resolvents:

(x2 ∨ x6) and (x2 ∨ x3)

19 / 29

Page 47: Lookahead Techniques

Look-ahead: Hyper Binary Resolvents

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0, x3=1}

hyper binary resolvents:

(x2 ∨ x6) and (x2 ∨ x3)

Which one is more useful?

19 / 29

Page 48: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

20 / 29

Page 49: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1}

20 / 29

Page 50: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1}

20 / 29

Page 51: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1}

20 / 29

Page 52: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

20 / 29

Page 53: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

20 / 29

Page 54: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=0}

20 / 29

Page 55: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=0, x6=0}

20 / 29

Page 56: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=0, x6=0, x3=1}

20 / 29

Page 57: Lookahead Techniques

Look-ahead: Necessary assignments

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=0, x6=0, x3=1}

20 / 29

Page 58: Lookahead Techniques

St̊almarck’s Method

In short, St̊almarck’s Method is a procedure that generalizesthe concept of necessary assignments.

For each variable x , (Simplify(F |x) ∩ Simplify(F |x)) \ F isadded to F .

The above is repeated until fixpoint, i.e., until∀x : (Simplify(F |x) ∩ Simplify(F |x)) \ F = ∅

Afterwards the procedure is repeated using all pairs forvariables x and y : Add (Simplify(F |xy ) ∩ Simplify(F |xy) ∩Simplify(F |xy ∩ Simplify(F |xy)) \ F to F .

The second round is very expensive and can typically not befinished in reasonable time.

21 / 29

Page 59: Lookahead Techniques

DPLL Procedure

Look-ahead Architecture

Look-ahead Learning

Autarky Reasoning

Tree-based Look-ahead

22 / 29

Page 60: Lookahead Techniques

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all

clauses that are “touched” by the assignment

23 / 29

Page 61: Lookahead Techniques

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all

clauses that are “touched” by the assignmenta pure literal is an autarky

23 / 29

Page 62: Lookahead Techniques

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all

clauses that are “touched” by the assignmenta pure literal is an autarky

each satisfying assignment is an autarky

23 / 29

Page 63: Lookahead Techniques

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all

clauses that are “touched” by the assignmenta pure literal is an autarky

each satisfying assignment is an autarky

the remaining formula is satisfiability equivalentto the original formula

23 / 29

Page 64: Lookahead Techniques

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all

clauses that are “touched” by the assignmenta pure literal is an autarky

each satisfying assignment is an autarky

the remaining formula is satisfiability equivalentto the original formula

An 1-autarky is a partial assignment that

satisfies all touched clauses except one

23 / 29

Page 65: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

24 / 29

Page 66: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1}

24 / 29

Page 67: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1}

24 / 29

Page 68: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1}

24 / 29

Page 69: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

24 / 29

Page 70: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning satisfiability equivalent to (x5 ∨ x6)

24 / 29

Page 71: Lookahead Techniques

Look-ahead: Autarky detection

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x1=1, x2=1, x3=1, x4=1}

Flearning satisfiability equivalent to (x5 ∨ x6)

Could reduce computational cost on UNSAT

24 / 29

Page 72: Lookahead Techniques

Look-ahead: Autarky or Conflict on 2-SAT Formulae

Lookahead techniques can solve 2-SAT formulae inpolynomial time. Each lookahead on l results:

1. in an autarky: forcing l to be true

2. in a conflict: forcing l to be false

25 / 29

Page 73: Lookahead Techniques

Look-ahead: Autarky or Conflict on 2-SAT Formulae

Lookahead techniques can solve 2-SAT formulae inpolynomial time. Each lookahead on l results:

1. in an autarky: forcing l to be true

2. in a conflict: forcing l to be false

SAT Gameby Olivier Roussel

http://www.cs.utexas.edu/~marijn/game/2SAT

25 / 29

Page 74: Lookahead Techniques

Look-ahead: 1-Autarky learning

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

26 / 29

Page 75: Lookahead Techniques

Look-ahead: 1-Autarky learning

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0}

26 / 29

Page 76: Lookahead Techniques

Look-ahead: 1-Autarky learning

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0}

26 / 29

Page 77: Lookahead Techniques

Look-ahead: 1-Autarky learning

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0}

26 / 29

Page 78: Lookahead Techniques

Look-ahead: 1-Autarky learning

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0, x3=1}

26 / 29

Page 79: Lookahead Techniques

Look-ahead: 1-Autarky learning

Flearning := (x1 ∨ x3 ∨ x4) ∧ (x1 ∨ x2 ∨ x3) ∧(x1 ∨ x2) ∧ (x1 ∨ x3 ∨ x6) ∧ (x1 ∨ x4 ∨ x5) ∧

(x1 ∨ x6) ∧ (x4 ∨ x5 ∨ x6) ∧ (x5 ∨ x6)

ϕ = {x2=0, x1=0, x6=0, x3=1}

(local) 1-autarky resolvents:

(x2 ∨ x4) and (x2 ∨ x5)

26 / 29

Page 80: Lookahead Techniques

DPLL Procedure

Look-ahead Architecture

Look-ahead Learning

Autarky Reasoning

Tree-based Look-ahead

27 / 29

Page 81: Lookahead Techniques

Tree-based Look-ahead

Given a formula F which includes the clauses (a ∨ b) and(a ∨ c), tree-based look-ahead can reduce the look-ahead costs.

F

a

b c

2

3 4

5

1 6

implication

action

1 propagate a

2 propagate b

3 backtrack b

4 propagate c

5 backtrack c

6 backtrack a

28 / 29

Page 82: Lookahead Techniques

Lookahead Techniques

Marijn J.H. Heule

http://www.cs.cmu.edu/~mheule/15816-f19/

Automated Reasoning and Satisfiability, September 26, 2019

29 / 29