Pseudo-Boolean Solving by Incremental Translation to SAT Pete - - PowerPoint PPT Presentation

pseudo boolean solving by incremental translation to sat
SMART_READER_LITE
LIVE PREVIEW

Pseudo-Boolean Solving by Incremental Translation to SAT Pete - - PowerPoint PPT Presentation

Pseudo-Boolean Solving by Incremental Translation to SAT Pete Manolios Vasilis Papavasileiou Northeastern University {pete,vpap}@ccs.neu.edu October 31, 2011 How to connect, integrate, assemble thousands of components in an aerospace


slide-1
SLIDE 1

Pseudo-Boolean Solving by Incremental Translation to SAT

Pete Manolios Vasilis Papavasileiou

Northeastern University {pete,vpap}@ccs.neu.edu

October 31, 2011

slide-2
SLIDE 2

Motivation: Industrial Design Problems How to connect, integrate, assemble thousands of components in an aerospace design, subject to global requirements?

1Photo by Luis Argerich, CC-by-2.0

slide-3
SLIDE 3

Motivation: Industrial Design Problems How to connect, integrate, assemble thousands of components in an aerospace design, subject to global requirements?

1Photo by Luis Argerich, CC-by-2.0

slide-4
SLIDE 4

Solution: Synthesizing Architectures1 The core of the problem is pseudo-Boolean constraints!

1CAV 2011

slide-5
SLIDE 5

Solution: Synthesizing Architectures1 The core of the problem is pseudo-Boolean constraints!

1CAV 2011

slide-6
SLIDE 6

Pseudo-Boolean (PB) Constraints

Pseudo-Boolean Constraint

Constraint of the form c1x1 + c2x2 + · · · + cnxn r

◮ is one of <, ≤, =, >, or ≥

variables xi integer coefficients ci generalization of clauses can be encoded as CNF 1

Pseudo-Boolean Problem

Conjunction of PB constraints

1Een and Sorensson, JSAT, 2006 (MiniSat+)

slide-7
SLIDE 7

Pseudo-Boolean (PB) Constraints

Pseudo-Boolean Constraint

Constraint of the form c1x1 + c2x2 + · · · + cnxn r

◮ is one of <, ≤, =, >, or ≥ ◮ variables xi ∈ {0, 1}

integer coefficients ci generalization of clauses can be encoded as CNF 1

Pseudo-Boolean Problem

Conjunction of PB constraints

1Een and Sorensson, JSAT, 2006 (MiniSat+)

slide-8
SLIDE 8

Pseudo-Boolean (PB) Constraints

Pseudo-Boolean Constraint

Constraint of the form c1x1 + c2x2 + · · · + cnxn r

◮ is one of <, ≤, =, >, or ≥ ◮ variables xi ∈ {0, 1} ◮ integer coefficients ci

generalization of clauses can be encoded as CNF 1

Pseudo-Boolean Problem

Conjunction of PB constraints

1Een and Sorensson, JSAT, 2006 (MiniSat+)

slide-9
SLIDE 9

Pseudo-Boolean (PB) Constraints

Pseudo-Boolean Constraint

Constraint of the form c1x1 + c2x2 + · · · + cnxn r

◮ is one of <, ≤, =, >, or ≥ ◮ variables xi ∈ {0, 1} ◮ integer coefficients ci ◮ generalization of clauses

can be encoded as CNF 1

Pseudo-Boolean Problem

Conjunction of PB constraints

1Een and Sorensson, JSAT, 2006 (MiniSat+)

slide-10
SLIDE 10

Pseudo-Boolean (PB) Constraints

Pseudo-Boolean Constraint

Constraint of the form c1x1 + c2x2 + · · · + cnxn r

◮ is one of <, ≤, =, >, or ≥ ◮ variables xi ∈ {0, 1} ◮ integer coefficients ci ◮ generalization of clauses ◮ can be encoded as CNF 1

Pseudo-Boolean Problem

Conjunction of PB constraints

1Een and Sorensson, JSAT, 2006 (MiniSat+)

slide-11
SLIDE 11

Pseudo-Boolean (PB) Constraints

Pseudo-Boolean Constraint

Constraint of the form c1x1 + c2x2 + · · · + cnxn r

◮ is one of <, ≤, =, >, or ≥ ◮ variables xi ∈ {0, 1} ◮ integer coefficients ci ◮ generalization of clauses ◮ can be encoded as CNF 1

Pseudo-Boolean Problem

Conjunction of PB constraints

1Een and Sorensson, JSAT, 2006 (MiniSat+)

slide-12
SLIDE 12

Two Families of Solvers

. . SAT and ILP solvers and techniques can be applied!

Goal: improve SAT-based PB solving!

Impressive performance improvements Flexibility, well-engineered interfaces Open source, easy to experiment with Works well for almost propositional instances

slide-13
SLIDE 13

Two Families of Solvers

. . SAT and ILP solvers and techniques can be applied!

Goal: improve SAT-based PB solving!

◮ Impressive performance improvements ◮ Flexibility, well-engineered interfaces ◮ Open source, easy to experiment with ◮ Works well for almost propositional instances

slide-14
SLIDE 14

Incremental Translation to SAT

We do not have to encode all the constraints

Satisfiable Formulas

Just enough constraints to find satisfying assignment

Unsatisfiable Formulas

We may hit an unsatisfiable core quickly

slide-15
SLIDE 15

Incremental Translation to SAT

We do not have to encode all the constraints

Satisfiable Formulas

Just enough constraints to find satisfying assignment

Unsatisfiable Formulas

We may hit an unsatisfiable core quickly

slide-16
SLIDE 16

Incremental Translation to SAT

We do not have to encode all the constraints

Satisfiable Formulas

Just enough constraints to find satisfying assignment

Unsatisfiable Formulas

We may hit an unsatisfiable core quickly

slide-17
SLIDE 17

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-18
SLIDE 18

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-19
SLIDE 19

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-20
SLIDE 20

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ . .

returns a partial assignment (A) and a set of units (U)

slide-21
SLIDE 21

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-22
SLIDE 22

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-23
SLIDE 23

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-24
SLIDE 24

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-25
SLIDE 25

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-26
SLIDE 26

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′ .

slide-27
SLIDE 27

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x x x x x x x x x x x x x

slide-28
SLIDE 28

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x x x x x x x x x x x x x

slide-29
SLIDE 29

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x x x x x x x x

slide-30
SLIDE 30

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x x x x x x x x

slide-31
SLIDE 31

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x3 + x4 ≥ 2 ¬x1 x2 x x x x

slide-32
SLIDE 32

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x3 + x4 ≥ 2 ¬x1 x2 x x x x

slide-33
SLIDE 33

Simplification

2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x3 + x4 ≥ 2 ¬x1 x2 ¬x1 x2 x3 x4

slide-34
SLIDE 34

Algorithm

procedure pb-sat(P) C ← {c ∈ P : c is a PB-clause} P ← {p ∈ P : p is not a PB-clause} while true do A, U ← sat(C) if A = UNSAT then return UNSAT P ← simplify(P, U) if A satisfies P then return A P′ ← {p ∈ P : p falsified by A} if P′ = ∅ then P′ ← select(P) for all p ∈ P′ do C ← C ∧ translate(p) P ← P \ P′

slide-35
SLIDE 35

Extracting More Units A | = C { x, y, z, w, = C { x, y, z, w, = C x = C y candidates : x y z w units : U ..

slide-36
SLIDE 36

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { x, y, z, w, = C x = C y candidates : x y z w units : U ..

slide-37
SLIDE 37

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { x, y, z, w, = C x = C y candidates : x y z w units : U . . U does not say anything about x, y, z, or w! .

slide-38
SLIDE 38

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { x, y, z, w, = C x = C y candidates : {x, ¬y, ¬z, w, . . .} units : U ..

slide-39
SLIDE 39

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { x, y, z, w, = C x = C y candidates : {x, ¬y, ¬z, w, . . .} units : U .. . sat(C ∧ ¬x) ?

slide-40
SLIDE 40

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x = C y candidates : {x, ¬y, ¬z, w, . . .} units : U .. . sat(C ∧ ¬x) ?

slide-41
SLIDE 41

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x = C y candidates : {x, ¬y, ¬z, w, . . .} units : U ..

slide-42
SLIDE 42

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x = C y candidates : {¬y, . . .} units : U ..

slide-43
SLIDE 43

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x = C y candidates : {¬y, . . .} units : U .. . sat(C ∧ y) ?

slide-44
SLIDE 44

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x | = ¬(C ∧ y) candidates : {¬y, . . .} units : U .. . sat(C ∧ y) ?

slide-45
SLIDE 45

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x | = ¬(C ∧ y) candidates : { . . .} units : U ∪ {¬y} ..

slide-46
SLIDE 46

Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x | = ¬(C ∧ y) candidates : { . . .} units : U ∪ {¬y} . .

SAT queries cost! limit a resource (e.g., decisions)

.

slide-47
SLIDE 47

Experiments: Industrial Instances 1

MiniSat+

◮ Default configuration takes more than a day ◮ BDDs: blow-up with 96GB of RAM ◮ Human intervention: 91 minutes (11 minutes for SAT solving)

PB-SAT

19 seconds; 9 seconds for SAT solving (PicoSAT 2) Only BDDs for the translation less than 2GB of RAM

1CAV 2011

slide-48
SLIDE 48

Experiments: Industrial Instances 1

MiniSat+

◮ Default configuration takes more than a day ◮ BDDs: blow-up with 96GB of RAM ◮ Human intervention: 91 minutes (11 minutes for SAT solving)

PB-SAT

◮ 19 seconds; 9 seconds for SAT solving (PicoSAT 2) ◮ Only BDDs for the translation ◮ less than 2GB of RAM

1CAV 2011 2Thanks Armin!

slide-49
SLIDE 49

Conclusions

We have extended the reach of SAT-based approaches to pseudo-Boolean solving.

slide-50
SLIDE 50

Thank you!

Questions?

slide-51
SLIDE 51

PB Competition Benchmarks

486 Decision Instances

bsolo PB-SAT PB-SATR solved 430 402 431

A Twist: Linear Relaxations

procedure pb-satR(P) if the relaxation of P is infeasible then return UNSAT else return pb-sat P .

slide-52
SLIDE 52

PB Competition Benchmarks

486 Decision Instances

bsolo PB-SAT PB-SATR solved 430 402 431

A Twist: Linear Relaxations

procedure pb-satR(P) if the relaxation of P is infeasible then return UNSAT else return pb-sat P .

slide-53
SLIDE 53

PB Competition Benchmarks

486 Decision Instances

bsolo PB-SAT PB-SATR solved 430 402 431

A Twist: Linear Relaxations

procedure pb-satR(P) if the relaxation of P is infeasible then return UNSAT else return pb-sat(P) .

slide-54
SLIDE 54

PB Competition Benchmarks

486 Decision Instances

bsolo PB-SAT PB-SATR solved 430 402 431

A Twist: Linear Relaxations

procedure pb-satR(P) if the relaxation of P is infeasible then return UNSAT else return pb-sat(P) . .

variables in [0, 1]; simplex

slide-55
SLIDE 55

PB Competition Benchmarks

486 Decision Instances

bsolo PB-SAT PB-SATR solved 430 402 431

A Twist: Linear Relaxations

procedure pb-satR(P) if the relaxation of P is infeasible then return UNSAT else return pb-sat(P) .

slide-56
SLIDE 56

PB Competition Benchmarks

486 Decision Instances

bsolo PB-SAT PB-SATR solved 430 402 431

A Twist: Linear Relaxations

procedure pb-satR(P) if the relaxation of P is infeasible then return UNSAT else return pb-sat(P) .

slide-57
SLIDE 57

Experiments: PB Competition

486 Decision Problems

CPLEX bsolo wbo SAT4J MS+2 PB-SAT VPS3 solved 416 430 397 398 399 402 465

  • avg. time

135.8 38.0 70.3 67.8 83.1 67.7

  • 939 Optimization Problems

CPLEX bsolo wbo SAT4J PB-SAT VPS solved 676 580 579 542 540 792

  • avg. time

30.8 50.2 48.8 25.7 81.3

  • 2with PicoSAT as the SAT solver

3Virtual Portfolio Solver

slide-58
SLIDE 58

Extracting More Units: The Algorithm

procedure more-units(C) A, U ← sat(C) if A = UNSAT then return UNSAT α ← {A} for all l ∈ U do C ← C ∧ l for all variables v s.t. v / ∈ U ∧ ¬v / ∈ U do if ∀A1, A2 ∈ α : A1(v) = A2(v) then l ← polarity(A′, v) for some A′ ∈ α B ← sat-limited(C ∧ ¬l, R) if B = UNSAT then U ← U ∪ {l} C ← C ∧ l else α ← α ∪ {B} return pick(α), U