Splitting on Demand in SAT Modulo Theories Clark Barrett, Robert - - PowerPoint PPT Presentation

splitting on demand in sat modulo theories
SMART_READER_LITE
LIVE PREVIEW

Splitting on Demand in SAT Modulo Theories Clark Barrett, Robert - - PowerPoint PPT Presentation

Splitting on Demand in SAT Modulo Theories Clark Barrett, Robert Nieuwenhuis, Albert Oliveras, Cesare Tinelli New York Univ. Techn. Univ. Catalonia Univ. of Iowa LPAR06 November 17th, 2006, Phom Penh (Cambodia) LPAR06 - Phnom Penh


slide-1
SLIDE 1

LPAR’06 - Phnom Penh (Cambodia)

Splitting on Demand in SAT Modulo Theories

Clark Barrett, Robert Nieuwenhuis, Albert Oliveras, Cesare Tinelli New York Univ.

  • Techn. Univ. Catalonia
  • Univ. of Iowa

LPAR’06 November 17th, 2006, Phom Penh (Cambodia)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.1/18

slide-2
SLIDE 2

LPAR’06 - Phnom Penh (Cambodia)

Overview of the talk

Introduction to SMT Eager approach Lazy approach: Boolean engine DPLL(X) + T-solver Inside the T-solver What does DPLL(X) need from T-solver? Splitting on Demand Use of Splitting on Demand for Nelson-Oppen Conclusions

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.2/18

slide-3
SLIDE 3

LPAR’06 - Phnom Penh (Cambodia)

Introduction to SMT

Some problems are more naturally expressed in other logics than propositional logic, e.g: Software verification needs reasoning about equality, arithmetic, data structures, ... SMT consists of deciding the satisfiability of a (ground) FO formula with respect to a background theory T Example ( Equality with Uninterpreted Functions – EUF ):

g(a)=c ∧ ( f (g(a))= f (c) ∨ g(a)=d ) ∧ c=d

Wide range of applications: Predicate abstraction Model checking Equivalence checking Static analysis Scheduling ...

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.3/18

slide-4
SLIDE 4

LPAR’06 - Phnom Penh (Cambodia)

SMT - Eager approach vs lazy approach

EAGER APPROACH: Methodology: translate problem into equisatisfiable propositional formula and use off-the-shelf SAT solver [Bryant, Velev, Pnueli, Lahiri, Seshia, Strichman, ...] Why “eager”? Search uses all theory information from the beginning Tools: UCLID [Lahiri, Seshia and Bryant] LAZY APPROACH: Methodology: integration of a SAT-solver with a theory solver Why “lazy”? Theory information used lazily when checking T-consistency of propositional models Tools: CVC-Lite, Yices, MathSAT, TSAT+, Barcelogic ...

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.4/18

slide-5
SLIDE 5

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-6
SLIDE 6

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4]

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-7
SLIDE 7

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4] Theory solver says T-inconsistent

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-8
SLIDE 8

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4} to SAT solver

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-9
SLIDE 9

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4} to SAT solver SAT solver returns model [1, 2, 3, 4]

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-10
SLIDE 10

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4} to SAT solver SAT solver returns model [1, 2, 3, 4] Theory solver says T-inconsistent

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-11
SLIDE 11

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4} to SAT solver SAT solver returns model [1, 2, 3, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4, 1 ∨ 2 ∨ 3 ∨ 4} to SAT solver

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-12
SLIDE 12

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach example

Consider EUF and g(a)=c

1

∧ ( f (g(a))= f (c)

  • 2

∨ g(a)=d

3

) ∧ c=d

  • 4

Send {1, 2 ∨ 3, 4} to SAT solver SAT solver returns model [1, 2, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4} to SAT solver SAT solver returns model [1, 2, 3, 4] Theory solver says T-inconsistent Send {1, 2 ∨ 3, 4, 1 ∨ 2 ∨ 4, 1 ∨ 2 ∨ 3 ∨ 4} to SAT solver SAT solver detects it UNSATISFIABLE

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.5/18

slide-13
SLIDE 13

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach optimizations

Several optimizations for enhancing efficiency: Check T-consistency only of full propositional models

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-14
SLIDE 14

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach optimizations

Several optimizations for enhancing efficiency: Check T-consistency only of full propositional models Check T-consistency of partial assignment while being built

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-15
SLIDE 15

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach optimizations

Several optimizations for enhancing efficiency: Check T-consistency only of full propositional models Check T-consistency of partial assignment while being built Given a T-inconsistent assignment M, add ¬M as a clause

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-16
SLIDE 16

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach optimizations

Several optimizations for enhancing efficiency: Check T-consistency only of full propositional models Check T-consistency of partial assignment while being built Given a T-inconsistent assignment M, add ¬M as a clause Given a T-inconsistent assignment M, identify a T-inconsistent subset M0 ⊆ M and add ¬M0 as a clause

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-17
SLIDE 17

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach optimizations

Several optimizations for enhancing efficiency: Check T-consistency only of full propositional models Check T-consistency of partial assignment while being built Given a T-inconsistent assignment M, add ¬M as a clause Given a T-inconsistent assignment M, identify a T-inconsistent subset M0 ⊆ M and add ¬M0 as a clause Upon a T-inconsistency, add clause and restart

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-18
SLIDE 18

LPAR’06 - Phnom Penh (Cambodia)

SMT - Lazy approach optimizations

Several optimizations for enhancing efficiency: Check T-consistency only of full propositional models Check T-consistency of partial assignment while being built Given a T-inconsistent assignment M, add ¬M as a clause Given a T-inconsistent assignment M, identify a T-inconsistent subset M0 ⊆ M and add ¬M0 as a clause Upon a T-inconsistency, add clause and restart Upon a T-inconsistency, use the conflicting clause ¬M0 to backjump to some point where the assignment was still T-consistent, as in SAT-solvers.

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-19
SLIDE 19

LPAR’06 - Phnom Penh (Cambodia)

Overview of the talk

Introduction to SMT Eager approach Lazy approach: Boolean engine DPLL(X) + T-solver Inside the T-solver ⇐ What does DPLL(X) need from T-solver? Splitting on Demand Use of Splitting on Demand for Nelson-Oppen Conclusions

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.6/18

slide-20
SLIDE 20

LPAR’06 - Phnom Penh (Cambodia)

What does DPLL(X) need from T-Solver?

T-consistency check of a set of literals M, with: Explain of T-inconsistency: find (small) T-inconsistent subset of M [minimal wrt. size?, wrt. ⊆?] Incrementality: if l is added to M, check for M l faster than reprocessing M l from scratch. Theory propagation: find input T-consequences of M, with: Explain T-Propagate of l: find (small) subset of M that T-entails l (needed in conflict analysis). Backtrack n: undo last n literals added PAPER FOCUSES only on T-consistency checks

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.7/18

slide-21
SLIDE 21

LPAR’06 - Phnom Penh (Cambodia)

A T-Solver for EUF

Theory solvers can usually be described using inference rules The input conjunction of literals C is saturated wrt the rules C is unsat iff ⊥ has been derived

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.8/18

slide-22
SLIDE 22

LPAR’06 - Phnom Penh (Cambodia)

A T-Solver for EUF

Theory solvers can usually be described using inference rules The input conjunction of literals C is saturated wrt the rules C is unsat iff ⊥ has been derived A congruence closure algorithm (a solver for EUF) can be described with the following rules: Reflexitivy: Symmetry: Transitivity: t = t u = t t = u t = u u = v t = v Monotonicity: Contradiction: t1 = u1 . . . tn = un f (t1, . . . , tn) = f (u1, . . . , un) t = u t = u ⊥

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.8/18

slide-23
SLIDE 23

LPAR’06 - Phnom Penh (Cambodia)

A T-solver for difference logic (in R)

Atoms are of the form x ⊲ ⊳ y + d, being x and y variables, d a real constant and ⊲ ⊳∈ {<, ≤}, or of the form x = y + d. Transitivity: x ≤ z + c z ⊲ ⊳ y + d x ⊲ ⊳ y + (c + d) x < z + c z ⊲ ⊳ y + d x < y + (c + d) Equality treatment: x ≤ y + c y ≤ x − c x = y + c x = y + c x ≤ y + c, y ≤ x − c Contradiction: x < x + c ⊥ (if c ≤ 0) x = y + c x = y + c ⊥

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.9/18

slide-24
SLIDE 24

LPAR’06 - Phnom Penh (Cambodia)

A T-solver for difference logic (in Z)

Consider the unsatisfiable set of literals {1 ≤ x − y, x − y ≤ 2, x = y + 1, x = y + 2} Saturation wrt the previous inference rules only adds {y ≤ y + 1}. To obtain a (refutationally) complete inference system: Add splitting rule: x = y + c x < y + c x > y + c Or add splitting rules of the form: c ≤ x − y x − y ≤ (c + k) x − y = c x − y = c + 1 . . . x − y = c + k This may give an exponential amount of work, but problem is NP-hard anyway.

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.10/18

slide-25
SLIDE 25

LPAR’06 - Phnom Penh (Cambodia)

Other theories requiring case-splitting

T-solvers requiring internal case-splitting are common: Theory of arrays: read(write(A, i, v), j) = read(A, j) i = j i = j , read(A, j) = v A x y A’ v y i j i j Fragments of set theory: S1 = S2 e ∈ S1, e ∈ S2 e ∈ S1, e ∈ S2 This type of solvers are much more difficult to implement than “deterministic” ones

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.11/18

slide-26
SLIDE 26

LPAR’06 - Phnom Penh (Cambodia)

Other theories requiring case-splitting

T-solvers requiring internal case-splitting are common: Theory of arrays: read(write(A, i, v), j) = read(A, j) i = j i = j , read(A, j) = v A x A’ v i i Fragments of set theory: S1 = S2 e ∈ S1, e ∈ S2 e ∈ S1, e ∈ S2 This type of solvers are much more difficult to implement than “deterministic” ones

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.11/18

slide-27
SLIDE 27

LPAR’06 - Phnom Penh (Cambodia)

Our proposal: splitting on demand

INFORMALLY: IDEA: pass theory case-splits to the DPLL engine as clauses BENEFITS: Split-backtrack infrastructure is not duplicated Allow flexibility in T-reasoning (cheap computations first)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.12/18

slide-28
SLIDE 28

LPAR’06 - Phnom Penh (Cambodia)

Our proposal: splitting on demand

INFORMALLY: IDEA: pass theory case-splits to the DPLL engine as clauses BENEFITS: Split-backtrack infrastructure is not duplicated Allow flexibility in T-reasoning (cheap computations first) FORMALLY: Given initial state ∅ || F, consider L the finite set of all literals that might need case splitting. Modify T-Learn: also clauses with literals form L may be learned. L avoids termination problems (under certain conditions) T-solvers complete only when all atoms in L are decided

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.12/18

slide-29
SLIDE 29

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-30
SLIDE 30

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2) 1 4 || 1, 2 ∨ 3, 4 ⇒ (T-Learn with 5 ≡ x > y)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-31
SLIDE 31

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2) 1 4 || 1, 2 ∨ 3, 4 ⇒ (T-Learn with 5 ≡ x > y) 1 4 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Decide)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-32
SLIDE 32

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2) 1 4 || 1, 2 ∨ 3, 4 ⇒ (T-Learn with 5 ≡ x > y) 1 4 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Decide) 1 4 5 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (T-Propagate x 2)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-33
SLIDE 33

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2) 1 4 || 1, 2 ∨ 3, 4 ⇒ (T-Learn with 5 ≡ x > y) 1 4 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Decide) 1 4 5 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (T-Propagate x 2) 1 4 5 2 3 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Backjump)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-34
SLIDE 34

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2) 1 4 || 1, 2 ∨ 3, 4 ⇒ (T-Learn with 5 ≡ x > y) 1 4 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Decide) 1 4 5 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (T-Propagate x 2) 1 4 5 2 3 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Backjump) 1 4 5 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (UnitPropagate)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-35
SLIDE 35

LPAR’06 - Phnom Penh (Cambodia)

Example

Consider again Diff. Logic over Z and the formula: x ≤ y + 1

  • 1

∧ ( x < y

2

∨ x = y + 1

  • 3

) ∧ x=y

  • 4

∅ || 1, 2 ∨ 3, 4 ⇒ (UnitPropagate x 2) 1 4 || 1, 2 ∨ 3, 4 ⇒ (T-Learn with 5 ≡ x > y) 1 4 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Decide) 1 4 5 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (T-Propagate x 2) 1 4 5 2 3 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (Backjump) 1 4 5 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 ⇒ (UnitPropagate) 1 4 5 2 || 1, 2 ∨ 3, 4, 4 ∨ 2 ∨ 5 (Model found)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-36
SLIDE 36

LPAR’06 - Phnom Penh (Cambodia)

Overview of the talk

Introduction to SMT Eager approach Lazy approach: Boolean engine DPLL(X) + T-solver Inside the T-solver What does DPLL(X) need from T-solver? Splitting on Demand Use of Splitting on Demand for Nelson-Oppen ⇐ Conclusions

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.13/18

slide-37
SLIDE 37

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: combination of theories

SMT problems usually involve more than one theory:

a=b+2 ∧ A=write(B, a+1, 4) ∧ ( read(A, b+3)=2 ∨ f (a−1)= f (b+1) )

Combination problem: INPUT: Two theories T1 and T2. A T1-solver and a T2-solver OUTPUT: A (T1 ∪ T2)−solver Nelson-Oppen provides a combination procedure if: Theories are signature disjoint Theories are stably-infinite

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.14/18

slide-38
SLIDE 38

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: example

Γ = { f ( f ( x ) − f ( y ) ) = f (z), x ≤ y, y + z ≤ x, z ≥ 0}

  • 1. Purify literals: introduce new variables

w1 = f (x), w2 = f (y), w3 = w1 − w2

  • 2. Now we get

ΓR = {x ≤ y, y + z ≤ x, z ≥ 0, w3 = w1 − w2} and ΓE = { f (w3) = f (z), w1 = f (x), w2 = f (y)} with shared variables {x, y, z, w1, w2, w3}.

  • 3. N-O: Γ SAT in the combined theory iff exists arrangement A

(for each pair of shared variables, say whether they are equal

  • r distinct) such that ΓR ∧ A is TR-SAT and ΓE ∧ A is TE-SAT.

Ideal implementation: T-solvers exchange entailed equations until fix point or unsatisfiability is detected by a single T-solver.

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.15/18

slide-39
SLIDE 39

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: example(2)

ΓR = {x ≤ y, y + z ≤ x, z ≥ 0, w3 = w1 − w2} ΓE = { f (w3) = f (z), w1 = f (x), w2 = f (y)} with shared variables {x, y, z, w1, w2, w3}. Arrangement A (init. empty) is seen by both solvers: TR-solver detects x = y is entailed (and added to A)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.16/18

slide-40
SLIDE 40

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: example(2)

ΓR = {x ≤ y, y + z ≤ x, z ≥ 0, w3 = w1 − w2} ΓE = { f (w3) = f (z), w1 = f (x), w2 = f (y)} with shared variables {x, y, z, w1, w2, w3}. Arrangement A (init. empty) is seen by both solvers: TR-solver detects x = y is entailed (and added to A) TE-solver detects w1 = w2 is entailed (and added to A)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.16/18

slide-41
SLIDE 41

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: example(2)

ΓR = {x ≤ y, y + z ≤ x, z ≥ 0, w3 = w1 − w2} ΓE = { f (w3) = f (z), w1 = f (x), w2 = f (y)} with shared variables {x, y, z, w1, w2, w3}. Arrangement A (init. empty) is seen by both solvers: TR-solver detects x = y is entailed (and added to A) TE-solver detects w1 = w2 is entailed (and added to A) TR-solver detects z = w3 is entailed (and added to A)

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.16/18

slide-42
SLIDE 42

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: example(2)

ΓR = {x ≤ y, y + z ≤ x, z ≥ 0, w3 = w1 − w2} ΓE = { f (w3) = f (z), w1 = f (x), w2 = f (y)} with shared variables {x, y, z, w1, w2, w3}. Arrangement A (init. empty) is seen by both solvers: TR-solver detects x = y is entailed (and added to A) TE-solver detects w1 = w2 is entailed (and added to A) TR-solver detects z = w3 is entailed (and added to A) TE-solver detects ΓE ∧ A is TE-unsat

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.16/18

slide-43
SLIDE 43

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen: example(2)

ΓR = {x ≤ y, y + z ≤ x, z ≥ 0, w3 = w1 − w2} ΓE = { f (w3) = f (z), w1 = f (x), w2 = f (y)} with shared variables {x, y, z, w1, w2, w3}. Arrangement A (init. empty) is seen by both solvers: TR-solver detects x = y is entailed (and added to A) TE-solver detects w1 = w2 is entailed (and added to A) TR-solver detects z = w3 is entailed (and added to A) TE-solver detects ΓE ∧ A is TE-unsat But exchanging entailed equalities does not always suffice: ΓZ = {1 ≤ x − y, x − y ≤ 2, w1 = y + 1, w2 = y + 2} ΓE = { f (x) = f (w1), f (x) = f (w2)} is UNSAT, but no equation is entailed.

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.16/18

slide-44
SLIDE 44

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen with non-convex theories

Why didn’t it work with ΓZ = {1 ≤ x − y, x − y ≤ 2, w1 = y + 1, w2 = y + 2} ΓE = { f (x) = f (w1), f (x) = f (w2)} ?

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.17/18

slide-45
SLIDE 45

LPAR’06 - Phnom Penh (Cambodia)

Nelson-Oppen with non-convex theories

Why didn’t it work with ΓZ = {1 ≤ x − y, x − y ≤ 2, w1 = y + 1, w2 = y + 2} ΓE = { f (x) = f (w1), f (x) = f (w2)} ? ΓZ does not entail any equation between shared variables But ΓZ | =T x = w1 ∨ x = w2 (non-convex theory) For non-convex theories, DISJUNCTIONS of equalities should be communicated. Possibilities: Send clauses from solver to solver Force DPLL(X) to split on equalities between shared variables [DTC] Send clauses from solvers to DPLL(X) only as necessary [DTC,Splitting on Demand]

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.17/18

slide-46
SLIDE 46

LPAR’06 - Phnom Penh (Cambodia)

Overview of the talk

Introduction to SMT Eager approach Lazy approach: Boolean engine DPLL(X) + T-solver Inside the T-solver What does DPLL(X) need from T-solver? Splitting on Demand Use of Splitting on Demand for Nelson-Oppen Conclusions ⇐

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.17/18

slide-47
SLIDE 47

LPAR’06 - Phnom Penh (Cambodia)

Conclusions

Expensive theories easily dealt with the appropriate infrastructure This infrastructure allows greater flexibility Nelson-Oppen easily accommodated

LPAR’06. Splitting on Demang in SAT Modulo Theories – p.18/18