Linear Arithmetic Satisfjability via Strategy Improvement July 13, - - PowerPoint PPT Presentation

linear arithmetic satisfjability via strategy improvement
SMART_READER_LITE
LIVE PREVIEW

Linear Arithmetic Satisfjability via Strategy Improvement July 13, - - PowerPoint PPT Presentation

Linear Arithmetic Satisfjability via Strategy Improvement July 13, 2016 Azadeh Farzan 1 Zachary Kincaid 1 , 2 1 University of Toronto 2 Princeton University SMT solvers handle the ground fragment. Techniques for quantifiers: Quantifier


slide-1
SLIDE 1

Linear Arithmetic Satisfjability via Strategy Improvement

Azadeh Farzan1 Zachary Kincaid1,2

1University of Toronto 2Princeton University

July 13, 2016

slide-2
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
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
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
SLIDE 5

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-6
SLIDE 6

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-7
SLIDE 7

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-8
SLIDE 8

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-9
SLIDE 9

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-10
SLIDE 10

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-11
SLIDE 11

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • is satisfiable

SAT has a winning strategy

slide-12
SLIDE 12

Game interpretation

ϕ ≜ ∃w.∀x.∃y.∀z.

  • quantifier prefix

(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.

  • ϕ is satisfiable ⇐

⇒ SAT has a winning strategy

slide-13
SLIDE 13

ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z 1

  • x + 2

x + 1 2

  • x > 0

x ≤ 0

slide-14
SLIDE 14

Mutual strategy improvement

S0 U beats S beats improves U beats improves Sn X beats Un X beats

slide-15
SLIDE 15

Mutual strategy improvement

S0 U1 beats S beats improves U beats improves Sn X beats Un X beats

slide-16
SLIDE 16

Mutual strategy improvement

S0 U1 beats S1 beats improves U beats improves Sn X beats Un X beats

slide-17
SLIDE 17

Mutual strategy improvement

S0 U1 beats S1 beats improves U2

· · ·

beats improves Sn X beats Un X beats

slide-18
SLIDE 18

Mutual strategy improvement

S0 U1 beats S1 beats improves U2

· · ·

beats improves Sn X beats Un X beats

slide-19
SLIDE 19

Mutual strategy improvement

S0 U1 beats S1 beats improves U2

· · ·

beats improves Sn X beats Un X beats

slide-20
SLIDE 20

Two questions:

  • What does it mean to improve a strategy?
  • How can we find counter-strategies?
slide-21
SLIDE 21

Strategy skeletons

ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x improves

  • x

2x

  • x > 0

x ≤ 0

slide-22
SLIDE 22

Strategy skeletons

ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z x improves

  • x

2x

  • x

x

slide-23
SLIDE 23

Strategy skeletons

ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z

  • x
  • improves
  • x

2x

  • x

x

slide-24
SLIDE 24

Counter strategy synthesis via ground satisfiability

ϕ ≜ ∃w.∀x.∃y.∀z.(y < 1 ∨ 2w < y) ∧ (z < y ∨ x < z) ∃w ∀x ∃y ∀z

  • x

2x

  • x

x z x x z x x z x x z

slide-25
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
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
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
SLIDE 28

Selecting good strategies

ϕ ≜ ∀x.∃y.x < y

  • 1

beats beats improves beats improves

slide-29
SLIDE 29

Selecting good strategies

ϕ ≜ ∀x.∃y.x < y

  • 1

2

  • beats

beats improves beats improves

slide-30
SLIDE 30

Selecting good strategies

ϕ ≜ ∀x.∃y.x < y

  • 1

2

  • beats
  • 1

3

beats improves beats improves

slide-31
SLIDE 31

Selecting good strategies

ϕ ≜ ∀x.∃y.x < y

  • 1

2

  • beats
  • 1

3

beats improves

2

  • 4
  • · · ·

beats improves

slide-32
SLIDE 32

Model-guided term selection

Given:

  • ground formula F
  • model m |

= F

  • variable x

select(m, x, F) finds a term t such that:

  • (Model preservation) m x

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
SLIDE 33

Model-guided term selection

Given:

  • ground formula F
  • model m |

= F

  • variable x

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
SLIDE 34

Model-guided term selection

Given:

  • ground formula F
  • model m |

= F

  • variable x

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
SLIDE 35

Model-guided term selection

Given:

  • ground formula F
  • model m |

= F

  • variable x

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
SLIDE 36

Mutual strategy improvement

S0 U1 beats S1 beats improves U2

· · ·

beats improves Sn X beats Un X beats

slide-37
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
SLIDE 38

Thanks!