SLIDE 1 Linear Arithmetic Satisfjability via Strategy Improvement
Azadeh Farzan1 Zachary Kincaid1,2
1University of Toronto 2Princeton University
July 13, 2016
SLIDE 2
- The problem: satisfiability modulo the theory of linear rational (&
integer) arithmetic.
- Applications in program analysis & synthesis
- SMT solvers handle the ground fragment. Techniques for quantifiers:
- Quantifier elimination (expensive)
- Heuristic quantifier instantiation (incomplete)
- Today: alternating quantifier satisfiability modulo linear rational (&
integer) arithmetic via strategy improvement.
SLIDE 3
- The problem: satisfiability modulo the theory of linear rational (&
integer) arithmetic.
- Applications in program analysis & synthesis
- SMT solvers handle the ground fragment. Techniques for quantifiers:
- Quantifier elimination (expensive)
- Heuristic quantifier instantiation (incomplete)
- Today: alternating quantifier satisfiability modulo linear rational (&
integer) arithmetic via strategy improvement.
SLIDE 4
- The problem: satisfiability modulo the theory of linear rational (&
integer) arithmetic.
- Applications in program analysis & synthesis
- SMT solvers handle the ground fragment. Techniques for quantifiers:
- Quantifier elimination (expensive)
- Heuristic quantifier instantiation (incomplete)
- Today: alternating quantifier satisfiability modulo linear rational (&
integer) arithmetic via strategy improvement.
SLIDE 5 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of
. w x y x The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 6 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[ w x y x ] The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 7 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[w → 1; x y x ] The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 8 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[w → 1; x → 2 3; y x ] The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 9 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[w → 1; x → 2 3; y → −1; x ] The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 10 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[w → 1; x → 2 3; y → −1; x → 1] The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 11 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[w → 1; x → 2 3; y → −1; x → 1] The SAT player wins if the corresponding structure is a model of the matrix.
SAT has a winning strategy
SLIDE 12 Game interpretation
ϕ ≜ ∃w.∀x.∃y.∀z.
(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z)
- matrix
- Two players: SAT and UNSAT
- SAT wants to make the formula true
- UNSAT wants to make the formula false
- A play of this game: SAT and UNSAT take turns picking elements of Q.
[w → 1; x → 2 3; y → −1; x → 1] The SAT player wins if the corresponding structure is a model of the matrix.
⇒ SAT has a winning strategy
SLIDE 13 ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z 1
x + 1 2
x ≤ 0
SLIDE 14
Mutual strategy improvement
S0 U beats S beats improves U beats improves Sn X beats Un X beats
SLIDE 15
Mutual strategy improvement
S0 U1 beats S beats improves U beats improves Sn X beats Un X beats
SLIDE 16
Mutual strategy improvement
S0 U1 beats S1 beats improves U beats improves Sn X beats Un X beats
SLIDE 17
Mutual strategy improvement
S0 U1 beats S1 beats improves U2
· · ·
beats improves Sn X beats Un X beats
SLIDE 18
Mutual strategy improvement
S0 U1 beats S1 beats improves U2
· · ·
beats improves Sn X beats Un X beats
SLIDE 19
Mutual strategy improvement
S0 U1 beats S1 beats improves U2
· · ·
beats improves Sn X beats Un X beats
SLIDE 20 Two questions:
- What does it mean to improve a strategy?
- How can we find counter-strategies?
SLIDE 21 Strategy skeletons
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x improves
2x
x ≤ 0
SLIDE 22 Strategy skeletons
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x improves
2x
x
SLIDE 23 Strategy skeletons
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z
2x
x
SLIDE 24 Counter strategy synthesis via ground satisfiability
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z
2x
x z x x z x x z x x z
SLIDE 25
Counter strategy synthesis via ground satisfiability
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x x 2x z1 z2 x x z x x z x x z x x z
SLIDE 26
Counter strategy synthesis via ground satisfiability
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x x 2x z1 z2 ¬ ( (x < 1 ∨ 0 < x) ∧(z1 < x ∨ x < z1) ) ¬ ( (2x < 1 ∨ 0 < 2x) ∧(z2 < 2x ∨ x < z2) )
SLIDE 27
Counter strategy synthesis via ground satisfiability
ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x x 2x z1 z2 x x z x x z x x z x x z −2 −3 −2
SLIDE 28 Selecting good strategies
ϕ ≜ ∀x.∃y.x < y
beats beats improves beats improves
SLIDE 29 Selecting good strategies
ϕ ≜ ∀x.∃y.x < y
2
beats improves beats improves
SLIDE 30 Selecting good strategies
ϕ ≜ ∀x.∃y.x < y
2
3
beats improves beats improves
SLIDE 31 Selecting good strategies
ϕ ≜ ∀x.∃y.x < y
2
3
beats improves
2
beats improves
SLIDE 32 Model-guided term selection
Given:
- ground formula F
- model m |
= F
select(m, x, F) finds a term t such that:
t m = F
- (Finite image) select m x F
m = F is finite Idea: there is a set of terms T such that x F is equivalent to
t T
F x t . Use model m to select the right disjunct. (similar to model based projection - [Komuravelli, Gurfinkel, Chaki 2014]).
SLIDE 33 Model-guided term selection
Given:
- ground formula F
- model m |
= F
select(m, x, F) finds a term t such that:
- (Model preservation) m{x → tm} |
= F
- (Finite image) select m x F
m = F is finite Idea: there is a set of terms T such that x F is equivalent to
t T
F x t . Use model m to select the right disjunct. (similar to model based projection - [Komuravelli, Gurfinkel, Chaki 2014]).
SLIDE 34 Model-guided term selection
Given:
- ground formula F
- model m |
= F
select(m, x, F) finds a term t such that:
- (Model preservation) m{x → tm} |
= F
- (Finite image) {select(m, x, F) : m |
= F} is finite Idea: there is a set of terms T such that x F is equivalent to
t T
F x t . Use model m to select the right disjunct. (similar to model based projection - [Komuravelli, Gurfinkel, Chaki 2014]).
SLIDE 35 Model-guided term selection
Given:
- ground formula F
- model m |
= F
select(m, x, F) finds a term t such that:
- (Model preservation) m{x → tm} |
= F
- (Finite image) {select(m, x, F) : m |
= F} is finite Idea: there is a set of terms T such that ∃x.F is equivalent to ∨
t∈T
F[x → t]. Use model m to select the right disjunct. (similar to model based projection - [Komuravelli, Gurfinkel, Chaki 2014]).
SLIDE 36
Mutual strategy improvement
S0 U1 beats S1 beats improves U2
· · ·
beats improves Sn X beats Un X beats
SLIDE 37 Experimental results
Time (seconds) 75 150 225 300 Instances Solved CVC4 Z3 SIMSAT
27 0.006 27 0.006 27 1
2272 2134 1798 1 1,000
2421 instances drawn from SMTLIB2 & Mjollnir benchmark suite, 300s time limit.
SLIDE 38
Thanks!