practical sat solving: look-ahead techniquespractical sat solving: look-ahead techniques...

65
Practical SAT Solving: Look-ahead Techniques Marijn J.H. Heule Warren A. Hunt Jr. The University of Texas at Austin Heule & Hunt (UT Austin) Look-ahead Techniques 1/1

Upload: others

Post on 23-Dec-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Practical SAT Solving: Look-ahead Techniques

Marijn J.H. HeuleWarren A. Hunt Jr.

The University of Texas at Austin

Heule & Hunt (UT Austin) Look-ahead Techniques 1 / 1

Page 2: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Sat solving: DPLL

Davis Putnam Logemann Loveland [DP60,DLL62]

Simplify (Unit Propagation)

Split the formula

Variable Selection HeuristicsDirection heuristics

Heule & Hunt (UT Austin) Look-ahead Techniques 2 / 1

Page 3: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

DPLL: Example

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

Heule & Hunt (UT Austin) Look-ahead Techniques 3 / 1

Page 4: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

DPLL: Example

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

x3

1 0

Heule & Hunt (UT Austin) Look-ahead Techniques 3 / 1

Page 5: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

DPLL: Example

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

x3

1 0

x2

x1 x3

0 1

0 1 1 0

Heule & Hunt (UT Austin) Look-ahead Techniques 3 / 1

Page 6: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Definition

DPLL with selection of (effective) decision variables by

look-aheads on variables

Heule & Hunt (UT Austin) Look-ahead Techniques 4 / 1

Page 7: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Definition

DPLL with selection of (effective) decision variables by

look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Heule & Hunt (UT Austin) Look-ahead Techniques 4 / 1

Page 8: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Definition

DPLL with selection of (effective) decision variables by

look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Heule & Hunt (UT Austin) Look-ahead Techniques 4 / 1

Page 9: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Definition

DPLL with selection of (effective) decision variables by

look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Measure the reduction

Heule & Hunt (UT Austin) Look-ahead Techniques 4 / 1

Page 10: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Definition

DPLL with selection of (effective) decision variables by

look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Measure the reduction

Learn if possible

Heule & Hunt (UT Austin) Look-ahead Techniques 4 / 1

Page 11: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Definition

DPLL with selection of (effective) decision variables by

look-aheads on variables

Look-ahead:

Assign a variable to a truth value

Simplify the formula

Measure the reduction

Learn if possible

Backtrack

Heule & Hunt (UT Austin) Look-ahead Techniques 4 / 1

Page 12: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 5 / 1

Page 13: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 5 / 1

Page 14: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 5 / 1

Page 15: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 5 / 1

Page 16: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 5 / 1

Page 17: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Properties

Very expensive

Heule & Hunt (UT Austin) Look-ahead Techniques 6 / 1

Page 18: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

Heule & Hunt (UT Austin) Look-ahead Techniques 6 / 1

Page 19: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

Detection of failed literals (and more)

Heule & Hunt (UT Austin) Look-ahead Techniques 6 / 1

Page 20: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Properties

Very expensive

Effective compared to cheap heuristics

Detection of failed literals (and more)

Strong on random k-Sat formulae

Heule & Hunt (UT Austin) Look-ahead Techniques 6 / 1

Page 21: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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

Heule & Hunt (UT Austin) Look-ahead Techniques 6 / 1

Page 22: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Reduction heuristics

Number of satisfied clauses

Heule & Hunt (UT Austin) Look-ahead Techniques 7 / 1

Page 23: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Reduction heuristics

Number of satisfied clauses

Number of implied variables

Heule & Hunt (UT Austin) Look-ahead Techniques 7 / 1

Page 24: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Reduction heuristics

Number of satisfied clauses

Number of implied variablesNew (reduced, not satisfied) clauses

Smaller clauses more importantWeights based on occurring

Heule & Hunt (UT Austin) Look-ahead Techniques 7 / 1

Page 25: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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 )

Heule & Hunt (UT Austin) Look-ahead Techniques 8 / 1

Page 26: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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 then6: return satisfiable

7: end if

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

Heule & Hunt (UT Austin) Look-ahead Techniques 9 / 1

Page 27: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Local learning

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

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

Heule & Hunt (UT Austin) Look-ahead Techniques 10 / 1

Page 28: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Local 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}

Heule & Hunt (UT Austin) Look-ahead Techniques 10 / 1

Page 29: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Local 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}

Heule & Hunt (UT Austin) Look-ahead Techniques 10 / 1

Page 30: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Local 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}

Heule & Hunt (UT Austin) Look-ahead Techniques 10 / 1

Page 31: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Local 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}

Heule & Hunt (UT Austin) Look-ahead Techniques 10 / 1

Page 32: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Local 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) constraint resolventsa.k.a. hyper binary resolvents:

(x2 ∨ x3) and (x2 ∨ ¬x6)

Heule & Hunt (UT Austin) Look-ahead Techniques 10 / 1

Page 33: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 34: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 35: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 36: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 37: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 38: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 39: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 40: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 41: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 42: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 11 / 1

Page 43: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all clausesthat are “touched” by the assignment

Heule & Hunt (UT Austin) Look-ahead Techniques 12 / 1

Page 44: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all clausesthat are “touched” by the assignment

a pure literal is an autarky

Heule & Hunt (UT Austin) Look-ahead Techniques 12 / 1

Page 45: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all clausesthat are “touched” by the assignment

a pure literal is an autarky

each satisfying assignment is an autarky

Heule & Hunt (UT Austin) Look-ahead Techniques 12 / 1

Page 46: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all clausesthat are “touched” by the assignment

a pure literal is an autarky

each satisfying assignment is an autarky

the remaining formula is satisfiability equivalent

to the original formula

Heule & Hunt (UT Austin) Look-ahead Techniques 12 / 1

Page 47: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Look-ahead: Autarky definition

An autarky is a partial assignment that satisfies all clausesthat are “touched” by the assignment

a pure literal is an autarky

each satisfying assignment is an autarky

the remaining formula is satisfiability equivalent

to the original formula

An 1-autarky is a partial assignment thatsatisfies all touched clauses except one

Heule & Hunt (UT Austin) Look-ahead Techniques 12 / 1

Page 48: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 49: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 50: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 51: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 52: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 53: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 54: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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

Heule & Hunt (UT Austin) Look-ahead Techniques 13 / 1

Page 55: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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

Lookahead techniques can solve 2-SAT formulae in

polynomial time. Each lookahead on l results:

1 in an autarky: forcing l to be true

2 in a conflict: forcing l to be false

Heule & Hunt (UT Austin) Look-ahead Techniques 14 / 1

Page 56: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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

Lookahead techniques can solve 2-SAT formulae in

polynomial 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

Heule & Hunt (UT Austin) Look-ahead Techniques 14 / 1

Page 57: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 15 / 1

Page 58: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 15 / 1

Page 59: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 15 / 1

Page 60: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 15 / 1

Page 61: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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}

Heule & Hunt (UT Austin) Look-ahead Techniques 15 / 1

Page 62: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

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)

Heule & Hunt (UT Austin) Look-ahead Techniques 15 / 1

Page 63: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Tree-based Look-ahead

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

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

Heule & Hunt (UT Austin) Look-ahead Techniques 16 / 1

Page 64: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Homework puzzle

Populate the matrix with the following numbers:

10, 40, 50, 12, 21, 31, 35, 43, 46, 56, 74, 75, 83, 87, 89, 98such that no digit repeats in any row, column or diagonal.

Heule & Hunt (UT Austin) Look-ahead Techniques 17 / 1

Page 65: Practical SAT Solving: Look-ahead TechniquesPractical SAT Solving: Look-ahead Techniques MarijnJ.H.Heule WarrenA.HuntJr. The University of Texas at Austin Heule&Hunt (UTAustin) Look-ahead

Practical SAT Solving: Look-ahead Techniques

Marijn J.H. HeuleWarren A. Hunt Jr.

The University of Texas at Austin

Heule & Hunt (UT Austin) Look-ahead Techniques 18 / 1