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 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 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 Solution: Synthesizing Architectures1 The core of the problem is pseudo-Boolean constraints!
1CAV 2011
SLIDE 5 Solution: Synthesizing Architectures1 The core of the problem is pseudo-Boolean constraints!
1CAV 2011
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 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 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 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 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 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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
Simplification
2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x x x x x x x x x x x x x
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
Simplification
2x1 + 2x2 + x3 + x4 ≥ 4 ¬x1 x2 2x2 + x3 + x4 ≥ 4 ¬x1 x2 x x x x x x x x
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
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
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
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
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
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
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
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
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
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
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
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
Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x = C y candidates : {¬y, . . .} units : U ..
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
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
Extracting More Units { x, ¬y, ¬z, w, . . .} | = C { ¬x, ¬y, z, ¬w, . . .} | = C ∧ ¬x | = ¬(C ∧ y) candidates : { . . .} units : U ∪ {¬y} ..
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 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 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
Conclusions
We have extended the reach of SAT-based approaches to pseudo-Boolean solving.
SLIDE 50
Thank you!
Questions?
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
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
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
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
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
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 Experiments: PB Competition
486 Decision Problems
CPLEX bsolo wbo SAT4J MS+2 PB-SAT VPS3 solved 416 430 397 398 399 402 465
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
30.8 50.2 48.8 25.7 81.3
- 2with PicoSAT as the SAT solver
3Virtual Portfolio Solver
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