03.08.2013 Views

Satisfiability Modulo Theories - ijcai-11

Satisfiability Modulo Theories - ijcai-11

Satisfiability Modulo Theories - ijcai-11

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong><br />

Roberto Sebastiani<br />

DISI, University of Trento, Italy.<br />

roberto.sebastiani@disi.unitn.it<br />

http://www.disi.unitn.it/~rseba<br />

j. w. w.<br />

Gilles Audemard, Clark Barrett, Marco Bozzano, Roberto Bruttomesso, Alessandro Cimatti,<br />

Anders Franzén, Alberto Griggio, Tommi Junttila, Ziyad Hanna, Zurab Khasidashvili,<br />

Arthur Kornilowicz, Alexander Nadel, Silvio Ranise, Peter vanRossum, Sanjit Seshia,<br />

Bas Schaafsma, Stephan Schultz, Cristian Stenico, Cesare Tinelli, Silvia Tomasi,...<br />

22 nd International Joint Conference on Artificial Intelligence – IJCAI <strong>11</strong><br />

Barcelona, Spain, July 16 th 20<strong>11</strong>.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 1 / 132


Outline<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 2 / 132


Outline<br />

1 Motivations and goals<br />

Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 3 / 132


Motivations and goals<br />

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> (SMT(T ))<br />

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> (SMT(T ))<br />

The problem of deciding the satisfiability of (typically quantifier-free)<br />

formulas in some decidable first-order theory T<br />

T can also be a combination of theories <br />

i Ti.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 4 / 132


Motivations and goals<br />

SMT(T ): theories of interest<br />

Some theories of interest (e.g., for formal verification)<br />

Equality and Uninterpreted Functions (EUF):<br />

((x = y)∧(y = f(z))) → (g(x) = g(f(z)))<br />

Difference logic (DL): ((x = y)∧(y − z ≤ 4)) → (x − z ≤ 6)<br />

UTVPI (UT VPI): ((x = y)∧(y − z ≤ 4)) → (x + z ≤ 6)<br />

Linear arithmetic over the rationals (LA(Q)):<br />

(Tδ → (s1 = s0 + 3.4·t − 3.4·t0))∧(¬Tδ → (s1 = s0))<br />

Linear arithmetic over the integers (LA(Z)):<br />

(x := xl + 2 16 xh)∧(x ≥ 0)∧(x ≤ 2 16 − 1)<br />

Arrays (AR): (i = j)∨read(write(a, i, e), j) = read(a, j)<br />

Bit vectors (BV):<br />

x [16][15 : 0] = (y [16][15 : 8] :: z [16][7 : 0])


Motivations and goals<br />

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> (SMT(T )): Example<br />

Example: SMT(LA(Z)∪EUF ∪AR)<br />

ϕ def<br />

= (d ≥ 0)∧(d < 1)∧<br />

((f(d) = f(0)) → (read(write(V, i, x), i + d) = x + 1))<br />

involves arithmetical, arrays, and uninterpreted function/predicate<br />

symbols, plus Boolean operators<br />

Is it consistent?<br />

No:<br />

ϕ<br />

=⇒ LA(Z) (d = 0)<br />

=⇒EUF (f(d) = f(0))<br />

=⇒Bool (read(write(V, i, x), i + d) = x + 1)<br />

=⇒ LA(Z) (read(write(V, i, x), i) = x + 1)<br />

=⇒ LA(Z) ¬(read(write(V, i, x), i) = x)<br />

=⇒AR ⊥<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 6 / 132


Motivations and goals<br />

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> (SMT(T )): Example<br />

Example: SMT(LA(Z)∪EUF ∪AR)<br />

ϕ def<br />

= (d ≥ 0)∧(d < 1)∧<br />

((f(d) = f(0)) → (read(write(V, i, x), i + d) = x + 1))<br />

involves arithmetical, arrays, and uninterpreted function/predicate<br />

symbols, plus Boolean operators<br />

Is it consistent?<br />

No:<br />

ϕ<br />

=⇒ LA(Z) (d = 0)<br />

=⇒EUF (f(d) = f(0))<br />

=⇒Bool (read(write(V, i, x), i + d) = x + 1)<br />

=⇒ LA(Z) (read(write(V, i, x), i) = x + 1)<br />

=⇒ LA(Z) ¬(read(write(V, i, x), i) = x)<br />

=⇒AR ⊥<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 6 / 132


Motivations and goals<br />

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> (SMT(T )): Example<br />

Example: SMT(LA(Z)∪EUF ∪AR)<br />

ϕ def<br />

= (d ≥ 0)∧(d < 1)∧<br />

((f(d) = f(0)) → (read(write(V, i, x), i + d) = x + 1))<br />

involves arithmetical, arrays, and uninterpreted function/predicate<br />

symbols, plus Boolean operators<br />

Is it consistent?<br />

No:<br />

ϕ<br />

=⇒ LA(Z) (d = 0)<br />

=⇒EUF (f(d) = f(0))<br />

=⇒Bool (read(write(V, i, x), i + d) = x + 1)<br />

=⇒ LA(Z) (read(write(V, i, x), i) = x + 1)<br />

=⇒ LA(Z) ¬(read(write(V, i, x), i) = x)<br />

=⇒AR ⊥<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 6 / 132


Motivations and goals<br />

Some Motivating Applications<br />

Interest in SMT triggered by some real-word applications<br />

Verification of Hybrid & Timed Systems<br />

Verification of RTL Circuit Designs & of Microcode<br />

SW Verification<br />

Planning with Resources<br />

Temporal reasoning<br />

Scheduling<br />

Compiler optimization<br />

...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 7 / 132


Motivations and goals<br />

Verification of Timed Systems<br />

T12<br />

x>=1<br />

l1 l2<br />

x


Motivations and goals<br />

Verification of Hybrid Systems ...<br />

w<br />

.<br />

= 2<br />

T12<br />

Grow<br />

Steady<br />

w >=L<br />

cruise<br />

Stable<br />

L


Motivations and goals<br />

Verification of HW circuit designs & microcode<br />

B2 CK a<br />

B1<br />

CK<br />

itea CK<br />

g = 2*f<br />

f’ = itea+2*e<br />

B3<br />

itea’ = ITE(B1;a;0) c<br />

e’ = ITE(B2;b;0)+2*ite(B3;c;0)<br />

0<br />

b<br />

0<br />

L−Shifter<br />

1<br />

Adder<br />

e<br />

0<br />

L−Shifter<br />

1<br />

Adder<br />

f<br />

L−Shifter<br />

1<br />

control<br />

data<br />

g<br />

SAT/SMT-based Model Checking & Equiv. Checking of RTL<br />

designs, symbolic simulation of µ-code [22, 19, 41]<br />

Control paths handled by Boolean reasoning<br />

Data paths information abstracted into theory-specific terms<br />

words (bit-vectors, integers, EUF vars, ... ): a[31 : 0], a<br />

word operations: (BV, EUF, AR, LA(Z), NLA(Z) operators)<br />

x [16][15 : 0] = (y [16][15 : 8] :: z [16][7 : 0])


Motivations and goals<br />

Verification of SW systems<br />

...<br />

i = 0;<br />

acc = init();<br />

while (i


Motivations and goals<br />

Planning with Resources [75]<br />

SAT-bases planning augmented with numerical constraints<br />

Straightforward to encode into into SMT(LA(Q))<br />

Example (sketch) [75]<br />

(Deliver) ∧ // goal<br />

(MaxLoad) ∧ // load constraint<br />

(MaxFuel) ∧ // fuel constraint<br />

(Move → MinFuel) ∧ // move requires fuel<br />

(Move → Deliver) ∧ // move implies delivery<br />

(GoodTrip → Deliver) ∧ // a good trip requires<br />

(GoodTrip → AllLoaded) ∧ // a full delivery<br />

(MaxLoad → (load ≤ 30)) ∧ // load limit<br />

(MaxFuel → (fuel ≤ 15)) ∧ // fuel limit<br />

(MinFuel → (fuel ≥ 7+0.5load)) ∧ // fuel constraint<br />

(AllLoaded → (load = 45)) //<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 12 / 132


Motivations and goals<br />

(Disjunctive) Temporal Reasoning [73, 2]<br />

Temporal reasoning problems encoded as disjunctions of<br />

difference constraints<br />

((x1 − x2 ≤ 6) ∨ (x3 − x4 ≤ −2)) ∧<br />

((x2 − x3 ≤ −2) ∨ (x4 − x5 ≤ 5)) ∧<br />

((x2 − x1 ≤ 4) ∨ (x3 − x7 ≤ −6)) ∧<br />

...<br />

Straightforward to encode into into SMT(DL)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 13 / 132


Motivations and goals<br />

SMT and SMT solvers<br />

Common fact about SMT problems from various applications<br />

SMT requires capabilities for heavy Boolean reasoning combined with<br />

capabilities for reasoning in expressive decidable F.O. theories<br />

SAT alone not expressive enough<br />

standard automated theorem proving inadequate (e.g., arithmetic)<br />

may involve also numerical computation (e.g., simplex)<br />

Modern SMT solvers<br />

combine SAT solvers with decision procedures (theory solvers)<br />

contributions from SAT, Automated Theorem Proving (ATP), formal<br />

verification (FV) and operational research (OR)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 14 / 132


Motivations and goals<br />

SMT and SMT solvers<br />

Common fact about SMT problems from various applications<br />

SMT requires capabilities for heavy Boolean reasoning combined with<br />

capabilities for reasoning in expressive decidable F.O. theories<br />

SAT alone not expressive enough<br />

standard automated theorem proving inadequate (e.g., arithmetic)<br />

may involve also numerical computation (e.g., simplex)<br />

Modern SMT solvers<br />

combine SAT solvers with decision procedures (theory solvers)<br />

contributions from SAT, Automated Theorem Proving (ATP), formal<br />

verification (FV) and operational research (OR)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 14 / 132


Motivations and goals<br />

SMT and SMT solvers<br />

Common fact about SMT problems from various applications<br />

SMT requires capabilities for heavy Boolean reasoning combined with<br />

capabilities for reasoning in expressive decidable F.O. theories<br />

SAT alone not expressive enough<br />

standard automated theorem proving inadequate (e.g., arithmetic)<br />

may involve also numerical computation (e.g., simplex)<br />

Modern SMT solvers<br />

combine SAT solvers with decision procedures (theory solvers)<br />

contributions from SAT, Automated Theorem Proving (ATP), formal<br />

verification (FV) and operational research (OR)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 14 / 132


Motivations and goals<br />

SMT and SMT solvers<br />

Common fact about SMT problems from various applications<br />

SMT requires capabilities for heavy Boolean reasoning combined with<br />

capabilities for reasoning in expressive decidable F.O. theories<br />

SAT alone not expressive enough<br />

standard automated theorem proving inadequate (e.g., arithmetic)<br />

may involve also numerical computation (e.g., simplex)<br />

Modern SMT solvers<br />

combine SAT solvers with decision procedures (theory solvers)<br />

contributions from SAT, Automated Theorem Proving (ATP), formal<br />

verification (FV) and operational research (OR)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 14 / 132


Motivations and goals<br />

SMT and SMT solvers<br />

Common fact about SMT problems from various applications<br />

SMT requires capabilities for heavy Boolean reasoning combined with<br />

capabilities for reasoning in expressive decidable F.O. theories<br />

SAT alone not expressive enough<br />

standard automated theorem proving inadequate (e.g., arithmetic)<br />

may involve also numerical computation (e.g., simplex)<br />

Modern SMT solvers<br />

combine SAT solvers with decision procedures (theory solvers)<br />

contributions from SAT, Automated Theorem Proving (ATP), formal<br />

verification (FV) and operational research (OR)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 14 / 132


Goal of this tutorial<br />

Motivations and goals<br />

Provide an overview of standard “lazy” SMT:<br />

foundations<br />

SMT-solving techniques<br />

beyond solving: advanced SMT functionalities<br />

ongoing research<br />

Does not cover related approaches like:<br />

Eager SAT encodings<br />

Rewrite-based approaches<br />

We refer to [70, 10] for an overview and references.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 15 / 132


Motivations and goals<br />

Notational remark (1): most/all examples in LA(Q)<br />

For better readability, in most/all the examples of this presentation we<br />

will use the theory of linear arithmetic on rational numbers (LA(Q))<br />

because of its intuitive semantics. E.g.:<br />

(¬A1 ∨(3x1 − 2x2 − 3 ≤ 5))∧(A2 ∨(−2x1 + 4x3 + 2 = 3))<br />

Nevertheless, analogous examples can be built with all other theories<br />

of interest.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 16 / 132


Motivations and goals<br />

Notational remark (2): “constants” vs. “variables”<br />

Consider, e.g., the formula:<br />

(¬A1 ∨(3x1 − 2x2 − 3 ≤ 5))∧(A2 ∨(−2x1 + 4x3 + 2 = 3))<br />

How do we call A1, A2?:<br />

(a) Boolean/propositional variables?<br />

(b) uninterpreted 0-ary predicates?<br />

How do we call x1, x2, x3?:<br />

(a) domain variables?<br />

(b) uninterpreted Skolem constants/0-ary uninterpreted functions?<br />

Hint:<br />

(a) typically used in SAT, CSP and OR communities<br />

(b) typically used in logic & ATP communities<br />

Hereafter we call A1, A2 “Boolean/propositional variables” and x1, x2, x3<br />

"domain variables” (logic purists, please forgive me!)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 17 / 132


Motivations and goals<br />

Notational remark (2): “constants” vs. “variables”<br />

Consider, e.g., the formula:<br />

(¬A1 ∨(3x1 − 2x2 − 3 ≤ 5))∧(A2 ∨(−2x1 + 4x3 + 2 = 3))<br />

How do we call A1, A2?:<br />

(a) Boolean/propositional variables?<br />

(b) uninterpreted 0-ary predicates?<br />

How do we call x1, x2, x3?:<br />

(a) domain variables?<br />

(b) uninterpreted Skolem constants/0-ary uninterpreted functions?<br />

Hint:<br />

(a) typically used in SAT, CSP and OR communities<br />

(b) typically used in logic & ATP communities<br />

Hereafter we call A1, A2 “Boolean/propositional variables” and x1, x2, x3<br />

"domain variables” (logic purists, please forgive me!)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 17 / 132


Motivations and goals<br />

Notational remark (2): “constants” vs. “variables”<br />

Consider, e.g., the formula:<br />

(¬A1 ∨(3x1 − 2x2 − 3 ≤ 5))∧(A2 ∨(−2x1 + 4x3 + 2 = 3))<br />

How do we call A1, A2?:<br />

(a) Boolean/propositional variables?<br />

(b) uninterpreted 0-ary predicates?<br />

How do we call x1, x2, x3?:<br />

(a) domain variables?<br />

(b) uninterpreted Skolem constants/0-ary uninterpreted functions?<br />

Hint:<br />

(a) typically used in SAT, CSP and OR communities<br />

(b) typically used in logic & ATP communities<br />

Hereafter we call A1, A2 “Boolean/propositional variables” and x1, x2, x3<br />

"domain variables” (logic purists, please forgive me!)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 17 / 132


Outline<br />

Background: Modern SAT solving<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 18 / 132


Outline<br />

1 Motivations and goals<br />

Background: Modern SAT solving Basics<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 19 / 132


Background: Modern SAT solving Basics<br />

Basic notation & definitions<br />

Boolean formula<br />

⊤,⊥ are formulas<br />

A propositional atom A1, A2, A3,... is a formula;<br />

if ϕ1 and ϕ2 are formulas, then ¬ϕ1, ϕ1 ∧ϕ2, ϕ1 ∨ϕ2, ϕ1 → ϕ2,<br />

ϕ1 ↔ ϕ2 are formulas.<br />

Literal: a propositional atom Ai (positive literal) or its negation ¬Ai<br />

(negative literal)<br />

Notation: if l := ¬Ai, then ¬l := Ai<br />

Atoms(ϕ): the set {A1,..., AN} of atoms occurring in ϕ.<br />

a Boolean formula can be represented as a tree or as a DAG<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 20 / 132


Background: Modern SAT solving Basics<br />

Basic notation & definitions (cont)<br />

Total truth assignment µ for ϕ:<br />

µ : Atoms(ϕ) ↦−→ {⊤,⊥}.<br />

Partial Truth assignment µ for ϕ:<br />

µ : A ↦−→ {⊤,⊥}, A ⊂ Atoms(ϕ).<br />

Set and formula representation of an assignment:<br />

µ can be represented as a set of literals:<br />

EX: {µ(A1) := ⊤,µ(A2) := ⊥} =⇒ {A1,¬A2}<br />

µ can be represented as a formula:<br />

EX: {µ(A1) := ⊤,µ(A2) := ⊥} =⇒ A1 ∧¬A2<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 21 / 132


Background: Modern SAT solving Basics<br />

Basic notation & definitions (cont)<br />

µ |= ϕ (µ satisfies ϕ):<br />

µ |= Ai ⇐⇒ µ(Ai) = ⊤<br />

µ |= ¬ϕ ⇐⇒ not µ |= ϕ<br />

µ |= ϕ1 ∧ϕ2 ⇐⇒ µ |= ϕ1 and µ |= ϕ2<br />

µ |= ϕ1 ∨ϕ2 ⇐⇒ µ |= ϕ1 or µ |= ϕ2<br />

µ |= ϕ1 → ϕ2 ⇐⇒ if µ |= ϕ1, then µ |= ϕ2<br />

µ |= ϕ1 ↔ ϕ2 ⇐⇒ µ |= ϕ1 iff µ |= ϕ2<br />

ϕ is satisfiable iff µ |= ϕ for some µ<br />

ϕ1 |= ϕ2 (ϕ1 entails ϕ2):<br />

ϕ1 |= ϕ2 iff for every µ µ |= ϕ1 =⇒ µ |= ϕ2<br />

|= ϕ (ϕ is valid):<br />

|= ϕ iff for every µ µ |= ϕ<br />

Property<br />

ϕ is valid ⇐⇒ ¬ϕ is not satisfiable<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 22 / 132


Background: Modern SAT solving Basics<br />

Conjunctive Normal Form (CNF)<br />

ϕ is in Conjunctive normal form iff it is a conjunction of<br />

disjunctions of literals:<br />

L<br />

K i<br />

<br />

i=1 ji=1 the disjunctions of literals K i<br />

j i=1 lj i are called clauses<br />

Easier to handle: list of lists of literals.<br />

=⇒ no reasoning on the recursive structure of the formula<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 23 / 132<br />

lj i


Background: Modern SAT solving Basics<br />

Labeling CNF conversion CNFlabel(ϕ) [66, 33]<br />

Every ϕ can be reduced into CNF by, e.g., applying recursively<br />

bottom-up the rules:<br />

ϕ =⇒ ϕ[(li ∨ lj)|B]∧CNF(B ↔ (li ∨ lj))<br />

ϕ =⇒ ϕ[(li ∧ lj)|B]∧CNF(B ↔ (li ∧ lj))<br />

ϕ =⇒ ϕ[(li ↔ lj)|B]∧CNF(B ↔ (li ↔ lj))<br />

li, lj being literals and B being a “new” variable.<br />

Worst-case linear.<br />

Atoms(CNFlabel(ϕ)) ⊇ Atoms(ϕ).<br />

CNFlabel(ϕ) is equi-satisfiable w.r.t. ϕ.<br />

More used in practice.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 24 / 132


Background: Modern SAT solving Basics<br />

Labeling CNF conversion CNFlabel(ϕ) (cont.)<br />

CNF(B ↔ (li ∨ lj)) ⇐⇒ (¬B ∨ li ∨ lj)∧<br />

(B ∨¬li)∧<br />

(B ∨¬lj)<br />

CNF(B ↔ (li ∧ lj)) ⇐⇒ (¬B ∨ li)∧<br />

(¬B ∨ lj)∧<br />

(B ∨¬li¬lj)<br />

CNF(B ↔ (li ↔ lj)) ⇐⇒ (¬B ∨¬li ∨ lj)∧<br />

(¬B ∨ li ∨¬lj)∧<br />

(B ∨ li ∨ lj)∧<br />

(B ∨¬li ∨¬lj)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 25 / 132


Background: Modern SAT solving Basics<br />

Labeling CNF conversion CNFlabel – example<br />

B15<br />

B13 B14<br />

B9 B10 B<strong>11</strong> B12<br />

B1 B2 B3 B4 B5 B6 B7 B8<br />

−A3 A1 A5 −A4 −A3 A4 A2 −A6 A1 A4 A3 −A5 −A2 A6 A1 −A4<br />

⎧<br />

⎨<br />

CNF(B1 ↔ (¬A3 ∨ A1)) ∧ //<br />

⎩<br />

... ∧ // {...}<br />

CNF(B8 ↔ (A1 ∨¬A4)) ∧ // {...}<br />

CNF(B9 ↔ (B1 ↔ B2)) ∧ // {...}<br />

... ∧ // {...}<br />

CNF(B12 ↔ (B7 ∧ B8)) ∧ // {...}<br />

CNF(B13 ↔ (B9 ∨ B10)) ∧ // {...}<br />

CNF(B14 ↔ (B<strong>11</strong> ∨ B12)) ∧ // {...}<br />

CNF(B15 ↔ (B13 ∧ B14)) ∧ // {...}<br />

B15<br />

(¬B1 ∨¬A3 ∨ A1) ∧<br />

(B1 ∨ A3) ∧<br />

(B1 ∨¬A3) ∧<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 26 / 132<br />

⎫<br />

⎬<br />


Resolution Rule<br />

Background: Modern SAT solving Basics<br />

Resolution of a pair of clauses with exactly one incompatible<br />

variable (resolvent/pivot):<br />

common<br />

<br />

( l1 ∨...∨lk ∨<br />

Example:<br />

resolvent<br />

<br />

l ∨<br />

C ′<br />

<br />

l ′ k+1 ∨...∨l ′ m ) (<br />

( l1 ∨...∨lk<br />

<br />

common<br />

∨ l ′ k+1 ∨...∨l ′ m<br />

<br />

C ′<br />

common<br />

<br />

l1 ∨...∨lk ∨<br />

∨ l ′′<br />

k+1 ∨...∨l ′′<br />

n<br />

<br />

C ′′<br />

resolvent<br />

<br />

¬l ∨<br />

( A∨B ∨ C ∨ D ∨ E ) ( A∨B ∨ ¬C ∨ F )<br />

( A∨B ∨ D ∨ E ∨ F )<br />

Note: many standard inference rules subcases of resolution:<br />

A → B B → C<br />

A → C<br />

(Transit.)<br />

A A → B<br />

B<br />

(M. Ponens)<br />

)<br />

¬B A → B<br />

¬A<br />

C ′′<br />

<br />

l ′′<br />

k+1 ∨...∨l ′′<br />

n )<br />

(M. Tollens)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 27 / 132


Background: Modern SAT solving Basics<br />

Resolution Rules [32, 31]: Unit Propagation<br />

Unit resolution:<br />

Unit subsumption:<br />

Γ ′ ∧(l)∧(¬l ∨ <br />

i li)<br />

Γ ′ ∧(l)∧( <br />

i li)<br />

Γ ′ ∧(l)∧(l ∨ <br />

i li)<br />

Γ ′ ∧(l)<br />

Unit propagation: Unit resolution + Unit susubsumption<br />

“Deterministic” rule, applied before other “non-deterministic” rules!<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 28 / 132


Outline<br />

1 Motivations and goals<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 29 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Conflict-Driven Clause-Learning (CDCL) SAT solvers<br />

Conflict-Driven Clause-Learning (CDCL) SAT solvers [72, 59, 40]<br />

Evolution of Davis-Putnam-Longeman-Loveland (DPLL) [32, 31]<br />

non-recursive: stack-based representation of data structures<br />

Perform conflict-directed backtracking (backjumping) and learning<br />

efficient data structures for doing and undoing assignments<br />

(e.g., two-watched-literal scheme)<br />

perform search restarts<br />

...<br />

Dramatically efficient: solve industrial-derived problems with ≈ 10 7<br />

Boolean variables and ≈ 10 7 − 10 8 clauses!<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 30 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Stack-based representation of a truth assignment µ<br />

assign one truth-value at a time (add one<br />

literal to a stack representing µ)<br />

stack partitioned into decision levels:<br />

one decision literal<br />

its implied literals<br />

each implied literal tagged with the<br />

clause causing its unit-propagation<br />

(antecedent clause)<br />

equivalent to an implication graph:<br />

a node without incoming edges<br />

represent a decision literal<br />

c<br />

c<br />

the graph contains l1 ↦−→ l,...,ln ↦−→ l iff<br />

c def<br />

= n j=1 ¬li ∨ l is the antecedent clause<br />

of l<br />

representation of the dependencies<br />

between literals in µ<br />

dec. level 0<br />

dec. level 1<br />

decision literal<br />

implied literals<br />

dec. level N<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 31 / 132<br />

l01<br />

l02<br />

. . .<br />

l1<br />

l<strong>11</strong><br />

l12<br />

. . .<br />

lN<br />

lN1<br />

lN2<br />

. . .<br />

C01<br />

C02<br />

. . .<br />

C<strong>11</strong><br />

C12<br />

. . .<br />

CN1<br />

CN2<br />

. . .


Background: Modern SAT solving Modern CDCL SAT solving<br />

Implication graph - example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

√<br />

√<br />

√<br />

√<br />

√<br />

×<br />

√<br />

√<br />

¬A9<br />

A2<br />

A3<br />

A4<br />

A5<br />

A6<br />

¬A10<br />

A1<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

A12<br />

A13<br />

A1<br />

c1<br />

c2<br />

c2<br />

A2<br />

A3<br />

¬A10<br />

c3<br />

c3<br />

A4<br />

¬A9 ¬A<strong>11</strong><br />

c4<br />

A5<br />

c4<br />

c5<br />

A6<br />

c5<br />

c6<br />

Conflict<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 32 / 132<br />

c6


Background: Modern SAT solving Modern CDCL SAT solving<br />

Schema of a CDCL SAT solver<br />

Function CDCL-SAT (formula: ϕ, assignment & µ) {<br />

status := preprocess(ϕ,µ);<br />

while (1) {<br />

decide_next_branch(ϕ,µ);<br />

while (1) {<br />

status := bcp(ϕ,µ,η); η is a conflict set<br />

if (status == Sat)<br />

return Sat;<br />

if (status == Conflict) {<br />

blevel := analyze_conflict(ϕ,µ,η);<br />

if (blevel == 0)<br />

return Unsat;<br />

else backtrack(blevel,ϕ,µ);<br />

}<br />

else break;<br />

}<br />

} }<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 33 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Schema of a CDCL SAT solver (2)<br />

preprocess(ϕ,µ) simplifies ϕ into an easier equisatisfiable<br />

formula ( and updates µ if it is the case)<br />

decide_next_branch(ϕ,µ) chooses a new decision literal<br />

from ϕ according to some heuristic, and adds it to µ<br />

bcp(ϕ,µ,η) performs all deterministic assignments (unit), and<br />

updates ϕ and µ accordingly. If this causes a conflict, η is the<br />

subset of µ causing the conflict (conflict set).<br />

analyze_conflict(ϕ,µ,η) returns the “wrong-decision” level<br />

suggested by η (“0” means that a conflict exists even without<br />

branching)<br />

backtrack(blevel,ϕ,µ) undoes the branches up to blevel,<br />

and updates ϕ and µ accordingly<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 34 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 35 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

¬A9<br />

¬A10<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

A12<br />

{...,¬A9,¬A10,¬A<strong>11</strong>, A12, A13,...}<br />

(Initial assignment. Note: c1,..., c9 inconsistent.)<br />

A13<br />

¬A10<br />

¬A9 ¬A<strong>11</strong><br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 35 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

√<br />

√<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

¬A9<br />

¬A10<br />

A1<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

{...,¬A9,¬A10,¬A<strong>11</strong>, A12, A13,..., A1}<br />

... (decide A1)<br />

A12<br />

A13<br />

A1<br />

¬A10<br />

¬A9 ¬A<strong>11</strong><br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 36 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

√<br />

√<br />

√<br />

√<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

¬A9<br />

A2<br />

A3<br />

¬A10<br />

A1<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

{...,¬A9,¬A10,¬A<strong>11</strong>, A12, A13,..., A1, A2, A3}<br />

(unit A2, A3)<br />

A12<br />

A13<br />

A1<br />

c1<br />

c2<br />

c2<br />

A2<br />

A3<br />

¬A10<br />

¬A9 ¬A<strong>11</strong><br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 37 / 132


Example<br />

√<br />

c1 : ¬A1 ∨ A2 √<br />

c2 : ¬A1 ∨ A3 ∨ A9 √<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

√<br />

√<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

¬A9<br />

A2<br />

A3<br />

A4<br />

¬A10<br />

A1<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

A12<br />

{...,¬A9,¬A10,¬A<strong>11</strong>, A12, A13,..., A1, A2, A3, A4}<br />

(unit A4)<br />

A13<br />

A1<br />

c1<br />

c2<br />

c2<br />

A2<br />

A3<br />

¬A10<br />

c3<br />

c3<br />

A4<br />

¬A9 ¬A<strong>11</strong><br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 38 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

√<br />

√<br />

√<br />

√<br />

√<br />

×<br />

√<br />

√<br />

¬A9<br />

A2<br />

A3<br />

A4<br />

A5<br />

A6<br />

¬A10<br />

A1<br />

¬A<strong>11</strong><br />

A12<br />

A13<br />

A1<br />

c1<br />

c2<br />

c2<br />

A2<br />

A3<br />

c3<br />

c3<br />

A4<br />

¬A9 ¬A<strong>11</strong><br />

{...,¬A9,¬A10,¬A1¬A 41, A12, A13,..., A1, A2, A3, A4, A5, A6}<br />

(unit A5, A6)=⇒ conflict<br />

A13<br />

A12<br />

¬A10<br />

c4<br />

A5<br />

c4<br />

c5<br />

A6<br />

c5<br />

c6<br />

Conflict!<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 39 / 132<br />

c6


Background: Modern SAT solving Modern CDCL SAT solving<br />

State-of-the-art backjumping and learning [77]<br />

Idea: when a branch µ fails,<br />

(i) conflict analysis: find the conflict set η ⊆ µ by generating the<br />

conflict clause C def<br />

= ¬η via resolution from the falsified clause<br />

(ii) learning: add the conflict clause C to the clause set<br />

(iii) backjumping: backtrack to the highest branching point s.t. the<br />

stack contains all-but-one literals in η, and then unit-propagate<br />

the unassigned literal on C<br />

=⇒ may climb up to many decision levels in the stack<br />

if η (¬C) entirely assigned at level 0, then return UNSAT<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 40 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Conflict analysis: build a conflict clause by resolution<br />

1. C := falsified clause (conflicting clause)<br />

2. repeat<br />

(i) resolve the current clause C with the antecedent clause of the<br />

last unit-propagated literal l in C<br />

until C verifies some given termination criteria<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 41 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Conflict analysis: build a conflict clause by resolution<br />

1. C := falsified clause (conflicting clause)<br />

2. repeat<br />

(i) resolve the current clause C with the antecedent clause of the<br />

last unit-propagated literal l in C<br />

until C verifies some given termination criteria<br />

criterium: decision<br />

...until C contains only decision literals<br />

¬A 4 ∨ A 6 ∨ A <strong>11</strong><br />

Conflicting cl.<br />

<br />

¬A5 ∨¬A 6<br />

¬A4 ∨ A5 ∨ A10 ¬A4 ∨¬A5 ∨ A<strong>11</strong> (A5)<br />

¬A2 ∨¬A 3 ∨ A4 ¬A4 ∨ A10 ∨ A<strong>11</strong> (A4) ¬A1 ∨ A3 ∨ A9 ¬A2 ∨¬A 3 ∨ A10 ∨ A<strong>11</strong> (A3) ¬A1 ∨ A2 ¬A2 ∨¬A 1 ∨ A9 ∨ A10 ∨ A<strong>11</strong> (A2) ¬A1 ∨ A9 ∨ A10 ∨ A<strong>11</strong> Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 41 / 132<br />

(A 6)


Background: Modern SAT solving Modern CDCL SAT solving<br />

Conflict analysis: build a conflict clause by resolution<br />

1. C := falsified clause (conflicting clause)<br />

2. repeat<br />

(i) resolve the current clause C with the antecedent clause of the<br />

last unit-propagated literal l in C<br />

until C verifies some given termination criteria<br />

criterium: 1st UIP<br />

... until C contains only one literal assigned at current decision level<br />

(1st UIP)<br />

¬A4 ∨ A5 ∨ A10<br />

¬A4 ∨ A6 ∨ A<strong>11</strong><br />

¬A4 ∨A10 ∨ A<strong>11</strong> <br />

1st UIP<br />

¬A4 ∨¬A5 ∨ A<strong>11</strong><br />

Conflicting cl.<br />

<br />

¬A5 ∨¬A6<br />

(A5)<br />

(A6)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 41 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Conflict analysis: build a conflict clause by resolution<br />

1. C := falsified clause (conflicting clause)<br />

2. repeat<br />

(i) resolve the current clause C with the antecedent clause of the<br />

last unit-propagated literal l in C<br />

until C verifies some given termination criteria<br />

Note:<br />

Equivalent to finding a partition in the implication graph of µ with all<br />

decision literals on one side and the conflict on the other.<br />

Note<br />

ϕ |= C, so that C can be safely added to C.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 41 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

...<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

√<br />

√<br />

√<br />

√<br />

√<br />

×<br />

√<br />

√<br />

A2<br />

A3<br />

A4<br />

A5<br />

A6<br />

¬A10<br />

A1<br />

¬A<strong>11</strong><br />

A12<br />

A13<br />

decision<br />

A1<br />

c1<br />

c2<br />

c2<br />

A2<br />

A3<br />

¬A10<br />

c3<br />

c3<br />

A4<br />

¬A9 ¬A<strong>11</strong><br />

=⇒ Conflict set: {¬A10,¬A<strong>11</strong>, A4}, learn c10 := A10 ∨ A<strong>11</strong> ∨¬A4<br />

¬A9<br />

A13<br />

A12<br />

c4<br />

A5<br />

c4<br />

c5<br />

A6<br />

c5<br />

1st UIP<br />

c6<br />

Conflict!<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 42 / 132<br />

c6


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

c9 : ¬A7 ∨¬A8 ∨¬A13<br />

c10 : A10 ∨ A<strong>11</strong> ∨¬A4<br />

...<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

¬A9<br />

A1<br />

A2<br />

A3<br />

A4<br />

A5<br />

A6<br />

¬A10<br />

¬A<strong>11</strong><br />

=⇒ backtrack up to A<strong>11</strong> =⇒ {...,¬A9,¬A10,¬A<strong>11</strong>}<br />

A13<br />

A12<br />

¬A10<br />

¬A9 ¬A<strong>11</strong><br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 43 / 132


Example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

c8 : A1 ∨ A8<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

√<br />

√<br />

c9 : ¬A7 ∨¬A8 ∨¬A13 √<br />

c10 : A10 ∨ A<strong>11</strong> ∨¬A4<br />

...<br />

¬A9<br />

A2<br />

A3<br />

A4<br />

A5<br />

A6<br />

¬A10<br />

A1<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

¬A4<br />

¬A10<br />

c9<br />

¬A4<br />

c9<br />

¬A9 ¬A<strong>11</strong><br />

=⇒ unit propagate ¬A4 =⇒ {...,¬A9,¬A10,¬A<strong>11</strong>, A4}...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 44 / 132


Learning – example<br />

c1 : ¬A1 ∨ A2<br />

c2 : ¬A1 ∨ A3 ∨ A9<br />

c3 : ¬A2 ∨¬A3 ∨ A4<br />

c4 : ¬A4 ∨ A5 ∨ A10<br />

c5 : ¬A4 ∨ A6 ∨ A<strong>11</strong><br />

c6 : ¬A5 ∨¬A6<br />

c7 : A1 ∨ A7 ∨¬A12<br />

Background: Modern SAT solving Modern CDCL SAT solving<br />

c8 : A1 ∨ A8<br />

√<br />

c9 : ¬A7 ∨¬A8 ∨¬A13 √<br />

c10 : A9 ∨ A10 ∨ A<strong>11</strong> ∨¬A1 √<br />

c<strong>11</strong> : A9 ∨ A10 ∨ A<strong>11</strong> ∨¬A12 ∨¬A13<br />

...<br />

=⇒ Unit: {¬A1,¬A13}<br />

¬A<strong>11</strong><br />

¬A1<br />

¬A13<br />

¬A10<br />

A12<br />

¬A9<br />

¬A1<br />

¬A13<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 45 / 132<br />

¬A9<br />

A2<br />

A3<br />

A4<br />

A5<br />

A6<br />

¬A10<br />

A1<br />

A13<br />

¬A<strong>11</strong><br />

A12<br />

¬A1<br />

A7<br />

A8<br />

¬A9<br />

¬A10<br />

¬A<strong>11</strong><br />

c10<br />

¬A1<br />

c10<br />

A12<br />

c10<br />

c<strong>11</strong><br />

c<strong>11</strong><br />

c<strong>11</strong><br />

c<strong>11</strong><br />

¬A13


Background: Modern SAT solving Modern CDCL SAT solving<br />

State-of-the-art backjumping and learning: intuitions<br />

Backjumping: allows for climbing up to many decision levels in the<br />

stack<br />

intuition: “ go back to the oldest decision where you’d have done<br />

something different if only you had known C”<br />

=⇒ may avoid lots of redundant search<br />

Learning: in future branches, when all-but-one literals in η are<br />

assigned, the remaining literal is assigned to false by<br />

unit-propagation:<br />

intuition: “when you’re about to repeat the mistake, do the opposite<br />

of the last step”<br />

=⇒ avoids finding the same conflict again<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 46 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Drawbacks of Learning & Clause discharging<br />

Problem with Learning<br />

Learning can generate exponentially-many clauses<br />

may cause a blowup in space<br />

may drastically slow down BCP<br />

A solution: clause discharging<br />

Techniques to drop learned clauses when necessary<br />

according to their size<br />

according to their activity.<br />

A clause is currently active if it occurs in the current implication graph<br />

(i.e., it is the antecedent clause of a literal in the current assignment).<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 47 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Drawbacks of Learning & Clause discharging<br />

Problem with Learning<br />

Learning can generate exponentially-many clauses<br />

may cause a blowup in space<br />

may drastically slow down BCP<br />

A solution: clause discharging<br />

Techniques to drop learned clauses when necessary<br />

according to their size<br />

according to their activity.<br />

A clause is currently active if it occurs in the current implication graph<br />

(i.e., it is the antecedent clause of a literal in the current assignment).<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 47 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Drawbacks of Learning & Clause discharging<br />

Is clause-discharging safe?<br />

Yes, if done properly.<br />

Property (see, e.g., [65])<br />

In order to guarantee correctness, completeness & termination of a<br />

CDCL solver, it suffices to keep each clause until it is active.<br />

=⇒ CDCL solvers require polynomial space<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 48 / 132


Background: Modern SAT solving Modern CDCL SAT solving<br />

Drawbacks of Learning & Clause discharging<br />

Is clause-discharging safe?<br />

Yes, if done properly.<br />

Property (see, e.g., [65])<br />

In order to guarantee correctness, completeness & termination of a<br />

CDCL solver, it suffices to keep each clause until it is active.<br />

=⇒ CDCL solvers require polynomial space<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 48 / 132


Outline<br />

1 Motivations and goals<br />

Background: Modern SAT solving Other SAT functionalities<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 49 / 132


Background: Modern SAT solving Other SAT functionalities<br />

Building Proofs of Unsatisfiability in CDCL SAT solvers<br />

recall: each conflict clause Ci learned is computed from the<br />

conflicting clause Ci−k by backward resolving with the antecedent<br />

clause of one literal<br />

C1<br />

C2<br />

Ck<br />

Ci−1<br />

Ci<br />

<br />

conflict clause<br />

conflicting clause<br />

<br />

Ci−k<br />

.<br />

Ci−2<br />

each resolution (sub)proof can be easily tracked:<br />

k i-k -> i-k-1<br />

...<br />

2 i-2 -> i-1<br />

1 i-1 -> i<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 50 / 132


Background: Modern SAT solving Other SAT functionalities<br />

Building Proofs of Unsatisfiability in CDCL SAT solvers<br />

... in particular, if ϕ is unsatisfiable, the last step produces “false”<br />

as conflict clause:<br />

C1<br />

C2<br />

⊥<br />

Ck<br />

Ci−1<br />

conflicting clause<br />

<br />

Ci−k<br />

.<br />

Ci−2<br />

note: C1 = l, Ci−1 = ¬l for some literal l<br />

C1,..., Ck, and Ci−k are either original or learned clauses...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 51 / 132


Background: Modern SAT solving Other SAT functionalities<br />

Building Proofs of Unsatisfiability in CDCL SAT solvers<br />

Starting from the previous proof of unsatisfiability, repeat recursively:<br />

for every learned leaf clause Ci, substitute Ci with the resolution<br />

proof generating it<br />

until all leaf clauses are original clauses<br />

C<strong>11</strong> ....<br />

C1i1 .... C1ij1i<br />

.<br />

C1i<br />

.<br />

C1<br />

.... C1j1<br />

⊥<br />

C2<br />

Ck1 .... Ckjk<br />

.<br />

Ck<br />

Ci−1<br />

.<br />

Ci−2<br />

Ci−k1 .... Ci−kji−k<br />

.<br />

Ci−k<br />

=⇒ we obtain a resolution proof of unsatisfiability for (a subset of) the<br />

clauses in ϕ<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 52 / 132


Background: Modern SAT solving Other SAT functionalities<br />

SAT under assumptions: SAT(ϕ,{l1,..., ln})<br />

Many SAT solvers allow for solving a CNF formula ϕ under a set of<br />

assumption literals A def<br />

= {l1,..., ln} : SAT(ϕ,{l1,..., ln})<br />

SAT(ϕ,{l1,..., ln}): same result as SAT(ϕ∧ n i=1 li)<br />

Idea:<br />

l1,..., ln “decided” at decision level 0 before starting the search<br />

if backjump to level 0 on C def<br />

= ¬η s.t. η ⊆ A, then return UNSAT<br />

if the “decision” strategy for conflict analysis is used, then η is the<br />

subset of assumptions causing the inconsistency<br />

incremental calls SAT(ϕ,A1), ... , SAT(ϕ,An) without restarting<br />

stack-based interface for {l1,..., ln}<br />

reuse of search (e.g. learned clauses) from call to call<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 53 / 132


Background: Modern SAT solving Other SAT functionalities<br />

SAT under assumptions: SAT(ϕ,{l1,..., ln})<br />

Many SAT solvers allow for solving a CNF formula ϕ under a set of<br />

assumption literals A def<br />

= {l1,..., ln} : SAT(ϕ,{l1,..., ln})<br />

SAT(ϕ,{l1,..., ln}): same result as SAT(ϕ∧ n i=1 li)<br />

Idea:<br />

l1,..., ln “decided” at decision level 0 before starting the search<br />

if backjump to level 0 on C def<br />

= ¬η s.t. η ⊆ A, then return UNSAT<br />

if the “decision” strategy for conflict analysis is used, then η is the<br />

subset of assumptions causing the inconsistency<br />

incremental calls SAT(ϕ,A1), ... , SAT(ϕ,An) without restarting<br />

stack-based interface for {l1,..., ln}<br />

reuse of search (e.g. learned clauses) from call to call<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 53 / 132


Background: Modern SAT solving Other SAT functionalities<br />

SAT under assumptions: SAT(ϕ,{l1,..., ln})<br />

Many SAT solvers allow for solving a CNF formula ϕ under a set of<br />

assumption literals A def<br />

= {l1,..., ln} : SAT(ϕ,{l1,..., ln})<br />

SAT(ϕ,{l1,..., ln}): same result as SAT(ϕ∧ n i=1 li)<br />

Idea:<br />

l1,..., ln “decided” at decision level 0 before starting the search<br />

if backjump to level 0 on C def<br />

= ¬η s.t. η ⊆ A, then return UNSAT<br />

if the “decision” strategy for conflict analysis is used, then η is the<br />

subset of assumptions causing the inconsistency<br />

incremental calls SAT(ϕ,A1), ... , SAT(ϕ,An) without restarting<br />

stack-based interface for {l1,..., ln}<br />

reuse of search (e.g. learned clauses) from call to call<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 53 / 132


Background: Modern SAT solving Other SAT functionalities<br />

Selection of sub-formulas<br />

Let ϕ be n<br />

i=1 Ci.<br />

Idea [40, 54]<br />

let S1...Sn be fresh Boolean atoms (selection variables).<br />

let η def<br />

= {Si ,..., Si } ⊆ {S1,..., Sn}<br />

1 K<br />

SAT( n<br />

i=1 (¬Si ∨ Ci),η ): same as SAT( i k<br />

i=i 1 (Ci) )<br />

=⇒ allows for “selecting” (activating) only a subset of the clauses in ϕ<br />

at each call.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 54 / 132


Outline<br />

1 Motivations and goals<br />

Efficient SMT solving<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 55 / 132


Outline<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 56 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

Modern “lazy” SMT(T ) solvers<br />

A prominent “lazy” approach [44, 2, 75, 3, 8, 35]<br />

a CDCL SAT solver is used to enumerate truth assignments µi for<br />

(the Boolean abstraction of) the input formula ϕ<br />

a theory-specific solver T -solver checks the T -consistency of the<br />

set of T -literals corresponding to each assignment<br />

Many techniques to maximize the benefits of integration [70, 10]<br />

Many lazy SMT tools available<br />

( Barcelogic, CVC3, MathSAT, OpenSMT, SATeen, Yices, Z3, . . . )<br />

Note: lazy SMT(T ) approach often also referred to as “DPLL(T )”<br />

approach<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 57 / 132


Basic schema: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),<br />

¬(2v2 − v3 > 2),¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

=⇒ inconsistent in LA(Q) =⇒ backtrack<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 58 / 132


Basic schema: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),<br />

¬(2v2 − v3 > 2),¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

=⇒ inconsistent in LA(Q) =⇒ backtrack<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 58 / 132


Basic schema: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

¬B3<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),<br />

¬(2v2 − v3 > 2),¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

=⇒ inconsistent in LA(Q) =⇒ backtrack<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 58 / 132<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5


Basic schema: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

¬B3<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),<br />

¬(2v2 − v3 > 2),¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

=⇒ inconsistent in LA(Q) =⇒ backtrack<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 58 / 132<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning [49, 75, 3, 8, 35]<br />

Similar to Boolean backjumping & learning<br />

important property of T -solver:<br />

extraction of T -conflict sets: if µ is T -unsatisfiable,<br />

then T -solver (µ) returns the subset η of µ causing<br />

the T -inconsistency of µ (T -conflict set)<br />

If so, the T -conflict clause C := ¬η is used to drive<br />

the backjumping & learning mechanism of the SAT<br />

solver<br />

=⇒ lots of search saved<br />

the less redundant is η, the more search is saved<br />

l5<br />

l4<br />

l3<br />

l2<br />

l1<br />

¬l1 ∨¬l2 ∨¬l3 ∨¬l4 ∨ l5<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 59 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning: example<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

c8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

B5 ∨¬B8 ∨¬B2<br />

¬B3<br />

¬B1<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),¬(2v2 − v3 > 2),<br />

¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

η = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v1 − v5 ≤ 1)}<br />

η p = {¬B5, B8, B2}<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 60 / 132<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning: example<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

c8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

B5 ∨¬B8 ∨¬B2<br />

¬B3<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5<br />

c8 : B5 ∨¬B8 ∨¬B2<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),¬(2v2 − v3 > 2),<br />

¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

η = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v1 − v5 ≤ 1)}<br />

η p = {¬B5, B8, B2}<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 60 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning: example<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

c8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

B5 ∨¬B8 ∨¬B2<br />

¬B3<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5<br />

¬B2<br />

¬A2<br />

B3<br />

c8 : B5 ∨¬B8 ∨¬B2<br />

µ p = {¬B5, B8, B6,¬B1,¬B3, A1, A2, B2}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),¬(2v2 − v3 > 2),<br />

¬(3v1 − 2v2 ≤ 3),(v1 − v5 ≤ 1)}<br />

η = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v1 − v5 ≤ 1)}<br />

η p = {¬B5, B8, B2}<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 60 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning: example (2)<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

c ′ 8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

c8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

true, false<br />

c 8: theory conflicting clause<br />

<br />

B5 ∨¬B8 ∨¬B2<br />

B5 ∨¬B8 ∨¬A2<br />

c 2<br />

<br />

¬A2 ∨ B2<br />

B5 ∨¬B8 ∨ B3<br />

(B2)<br />

c 3<br />

<br />

B3 ∨ A2<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

B5 ∨¬B8 ∨ B1<br />

B5 ∨¬B8 ∨¬B2<br />

(¬A2)<br />

B5 ∨¬B8 ∨ B1<br />

<br />

c ′ 8<br />

: mixed Boolean+theory conflict clause<br />

¬B3<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5<br />

c8 : B5 ∨¬B8 ∨¬B2<br />

c T<br />

<br />

B5 ∨ B1 ∨¬B3<br />

(B3)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 61 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning: example (2)<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

c ′ 8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

c8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

true, false<br />

c 8: theory conflicting clause<br />

<br />

B5 ∨¬B8 ∨¬B2<br />

B5 ∨¬B8 ∨¬A2<br />

c 2<br />

<br />

¬A2 ∨ B2<br />

B5 ∨¬B8 ∨ B3<br />

(B2)<br />

c 3<br />

<br />

B3 ∨ A2<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

B5 ∨¬B8 ∨ B1<br />

B5 ∨¬B8 ∨¬B2<br />

(¬A2)<br />

B5 ∨¬B8 ∨ B1<br />

<br />

c ′ 8<br />

: mixed Boolean+theory conflict clause<br />

¬B3<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5<br />

B1<br />

A1<br />

c ′ 8 : B5 ∨¬B8 ∨ B1<br />

c T<br />

<br />

B5 ∨ B1 ∨¬B3<br />

(B3)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 61 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

T -Backjumping & T -learning: example (2)<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

c ′ 8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

c8 : (3v1 − v3 ≤ 6)∨¬(v3 = 3v5 + 4)∨...<br />

true, false<br />

c 8: theory conflicting clause<br />

<br />

B5 ∨¬B8 ∨¬B2<br />

B5 ∨¬B8 ∨¬A2<br />

c 2<br />

<br />

¬A2 ∨ B2<br />

B5 ∨¬B8 ∨ B3<br />

(B2)<br />

c 3<br />

<br />

B3 ∨ A2<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

B5 ∨¬B8 ∨ B1<br />

B5 ∨¬B8 ∨¬B2<br />

(¬A2)<br />

B5 ∨¬B8 ∨ B1<br />

<br />

c ′ 8<br />

: mixed Boolean+theory conflict clause<br />

¬B3<br />

¬B1<br />

A1<br />

A2<br />

B2<br />

T<br />

B6<br />

B8<br />

¬B5<br />

B1<br />

A1<br />

¬B2<br />

¬A2<br />

B3<br />

c ′ 8 : B5 ∨¬B8 ∨ B1<br />

c8 : B5 ∨¬B8 ∨¬B2<br />

c T<br />

<br />

B5 ∨ B1 ∨¬B3<br />

(B3)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 61 / 132


Early Pruning [44, 2, 75] I<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Introduce a T -satisfiability test on intermediate assignments:<br />

if T -solver returns UNSAT, the procedure backtracks.<br />

benefit: prunes drastically the Boolean search<br />

Drawback: possibly many useless calls to T -solver<br />

UNSAT<br />

SAT<br />

Calls to T−Solve()<br />

SAT<br />

SAT<br />

UNSAT UNSAT<br />

UNSAT<br />

SAT<br />

UNSAT<br />

SAT<br />

UNSAT<br />

SAT<br />

SAT SAT<br />

SAT<br />

UNSAT<br />

SAT<br />

UNSAT UNSAT<br />

UNSAT UNSAT<br />

UNSAT<br />

SAT<br />

WITHOUT EARLY−PRUNING<br />

WITH EARLY−PRUNING<br />

UNSAT<br />

SAT<br />

UNSAT<br />

SAT<br />

SAT<br />

UNSAT UNSAT<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 62 / 132


Early Pruning [44, 2, 75] II<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Different strategies for interleaving Boolean search steps and<br />

T -solver calls<br />

Eager E.P. [75, <strong>11</strong>, 74, 43]): invoke T -solver every time a new<br />

T -atom is added to the assignment (unit propagations included)<br />

Selective E.P.: Do not call T -solver if the have been added only<br />

literals which hardly cause any T -conflict with the previous<br />

assignment (e.g., Boolean literals, disequalities (x − y = 3),<br />

T -literals introducing new variables (x − z = 3) )<br />

Weakened E.P.: for intermediate checks only, use weaker but faster<br />

versions of T -solver (e.g., check µ on R rather than on Z):<br />

{(x − y ≤ 4),(z − x ≤ −6),(z = y),(3x + 2y − 3z = 4)}<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 63 / 132


Early pruning: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = {¬(2v2 − v3 > 2) ∨ A1} ∧<br />

{¬A2 ∨(2v1 − 4v5 > 3)} ∧<br />

{(3v1 − 2v2 ≤ 3) ∨ A2} ∧<br />

{¬(2v3 + v4 ≥ 5) ∨¬(3v1 − v3 ≤ 6) ∨¬A1} ∧<br />

{A1 ∨(3v1 − 2v2 ≤ 3)} ∧<br />

{(v1 − v5 ≤ 1) ∨(v5 = 5−3v4)∨¬A1} ∧<br />

{A1 ∨(v3 = 3v5 + 4) ∨ A2}.<br />

Suppose it is built the intermediate assignment:<br />

µ ′p = ¬B1 ∧¬A2 ∧ B3 ∧¬B5.<br />

corresponding to the following set of T -literals<br />

ϕ p = {¬B1 ∨ A1} ∧<br />

{¬A2 ∨ B2} ∧<br />

{B3 ∨ A2} ∧<br />

{¬B4 ∨¬B5 ∨¬A1} ∧<br />

{A1 ∨ B3} ∧<br />

{B6 ∨ B7 ∨¬A1} ∧<br />

{A1 ∨ B8 ∨ A2}.<br />

µ ′ = ¬(2v2 − v3 > 2)∧¬A2 ∧(3v1 − 2v2 ≤ 3)∧¬(3v1 − v3 ≤ 6).<br />

If T -solver is invoked on µ ′ , then it returns UNSAT, and DPLL<br />

backtracks without exploring any extension of µ ′ .<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 64 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


Early pruning: remark<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Incrementality & Backtrackability of T -solvers<br />

With early pruning, lots of incremental calls to T -solver:<br />

T -solver (µ1) ⇒ Sat Undo µ4, µ3, µ2<br />

T -solver (µ1 ∪µ2) ⇒ Sat T -solver (µ1 ∪µ ′ 2<br />

T -solver (µ1 ∪µ2 ∪µ3) ⇒ Sat T -solver (µ1 ∪µ ′ 2 ∪µ′ 3<br />

T -solver (µ1 ∪µ2 ∪µ3 ∪µ4) ⇒ Unsat ...<br />

) ⇒ Sat<br />

) ⇒ Sat<br />

=⇒ Desirable features of T -solvers:<br />

incrementality: T -solver(µ1 ∪µ2) reuses computation of<br />

T -solver(µ1) without restarting from scratch<br />

backtrackability (resettability): T -solver can efficiently undo steps<br />

and return to a previous status on the stack<br />

=⇒ T -solver requires a stack-based interface<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 65 / 132


T -Propagation [2, 3, 43]<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

strictly related to early pruning<br />

important property of T -solver:<br />

T -deduction: when a partial assignment µ is T -satisfiable, T -solver<br />

may be able to return also an assignment η to some unassigned<br />

atom occurring in ϕ s.t. µ |=T η.<br />

If so:<br />

the literal η is then unit-propagated;<br />

optionally, a T -deduction clause C := ¬µ ′ ∨η can be learned, µ ′<br />

being the subset of µ which caused the deduction (µ ′ |=T η)<br />

=⇒ may prune drastically the search<br />

Both T -deduction clauses and T -conflict clauses are called T -lemmas<br />

since they are valid in T<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 66 / 132


T -Propagation [2, 3, 43]<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

strictly related to early pruning<br />

important property of T -solver:<br />

T -deduction: when a partial assignment µ is T -satisfiable, T -solver<br />

may be able to return also an assignment η to some unassigned<br />

atom occurring in ϕ s.t. µ |=T η.<br />

If so:<br />

the literal η is then unit-propagated;<br />

optionally, a T -deduction clause C := ¬µ ′ ∨η can be learned, µ ′<br />

being the subset of µ which caused the deduction (µ ′ |=T η)<br />

=⇒ may prune drastically the search<br />

Both T -deduction clauses and T -conflict clauses are called T -lemmas<br />

since they are valid in T<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 66 / 132


T -propagation: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

¬B1<br />

=⇒ propagate ¬B3 [and learn the deduction clause B5 ∨ B1 ∨¬B3]<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 67 / 132<br />

B6<br />

B8<br />

¬B5


T -propagation: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

¬B1<br />

µ p = {¬B5, B8, B6,¬B1}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),¬(2v2 − v3 > 2)}<br />

|=LA(Q) ¬(3v1 − 2v2 ≤ 3)<br />

<br />

¬B 3<br />

=⇒ propagate ¬B3 [and learn the deduction clause B5 ∨ B1 ∨¬B3]<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 67 / 132<br />

B6<br />

B8<br />

¬B5


T -propagation: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = ϕ p =<br />

c1 : ¬(2v2 − v3 > 2)∨A1<br />

c2 : ¬A2 ∨(v1 − v5 ≤ 1)<br />

c3 : (3v1 − 2v2 ≤ 3)∨A2<br />

c4 : ¬(2v3 + v4 ≥ 5)∨¬(3v1 − v3 ≤ 6)∨¬A1<br />

c5 : A1 ∨(3v1 − 2v2 ≤ 3)<br />

c6 : (v2 − v4 ≤ 6)∨(v5 = 5−3v4)∨¬A1<br />

c7 : A1 ∨(v3 = 3v5 + 4)∨A2<br />

true, false<br />

¬B1 ∨ A1<br />

¬A2 ∨ B2<br />

B3 ∨ A2<br />

¬B4 ∨¬B5 ∨¬A1<br />

A1 ∨ B3<br />

B6 ∨ B7 ∨¬A1<br />

A1 ∨ B8 ∨ A2<br />

¬B3<br />

¬B1<br />

B6<br />

B8<br />

¬B5<br />

T -propagate<br />

µ p = {¬B5, B8, B6,¬B1}<br />

µ = {¬(3v1 − v3 ≤ 6),(v3 = 3v5 + 4),(v2 − v4 ≤ 6),¬(2v2 − v3 > 2)}<br />

|=LA(Q) ¬(3v1 − 2v2 ≤ 3)<br />

<br />

¬B 3<br />

=⇒ propagate ¬B3 [and learn the deduction clause B5 ∨ B1 ∨¬B3]<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 67 / 132


Pure-literal filtering [75, 3, 14]<br />

Property<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

If we have non-Boolean T -atoms occurring only positively [negatively]<br />

in the original formula ϕ (learned clauses are not considered), we can<br />

drop every negative [positive] occurrence of them from the assignment<br />

to be checked by T -solver (and from the T -deducible ones).<br />

increases the chances of finding a model<br />

reduces the effort for the T -solver<br />

eliminates unnecessary “nasty” negated literals<br />

(e.g. negative equalities like ¬(3v1 − 9v2 = 3) in LA(Z) force<br />

splitting: (3v1 − 9v2 > 3)∨(3v1 − 9v2 < 3)).<br />

may weaken the effect of early pruning.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 68 / 132


Pure literal filtering: example<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

ϕ = {¬(2v2 − v3 > 2) ∨ A1} ∧<br />

{¬A2 ∨(2v1 − 4v5 > 3)} ∧<br />

{(3v1 − 2v2 ≤ 3) ∨ A2} ∧<br />

{¬(2v3 + v4 ≥ 5) ∨¬(3v1 − v3 ≤ 6) ∨¬A1} ∧<br />

{A1 ∨(3v1 − 2v2 ≤ 3)} ∧<br />

{(v1 − v5 ≤ 1) ∨(v5 = 5−3v4)∨¬A1} ∧<br />

{A1 ∨(v3 = 3v5 + 4) ∨ A2} ∧<br />

{(2v2 − v3 > 2)∨¬(3v1 − 2v2 ≤ 3)∨(3v1 − v3 ≤ 6)} learned<br />

µ ′ = {¬(2v2 − v3 > 2),¬A2,(3v1 − 2v2 ≤ 3),¬A1,(v3 = 3v5 + 4),(3v1 − v3 ≤ 6)}.<br />

=⇒ Sat: v1 = v2 = v3 = 0, v5 = −4/3 is a solution<br />

N.B. (3v1 − v3 ≤ 6) “filtered out” from µ ′ because it occurs only<br />

negatively in the original formula ϕ<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 69 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

Preprocessing atoms [44, 49, 4]<br />

Source of inefficiency: semantically equivalent but syntactically<br />

different atoms are not recognized to be identical [resp. one the<br />

negation of the other]<br />

=⇒ they may be assigned different [resp. identical] truth values.<br />

=⇒ lots of redundant unsatisfiable assignment generated<br />

Solution<br />

Rewrite a priori trivially-equivalent atoms/literals into the same<br />

atom/literal.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 70 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

Preprocessing atoms [44, 49, 4]<br />

Source of inefficiency: semantically equivalent but syntactically<br />

different atoms are not recognized to be identical [resp. one the<br />

negation of the other]<br />

=⇒ they may be assigned different [resp. identical] truth values.<br />

=⇒ lots of redundant unsatisfiable assignment generated<br />

Solution<br />

Rewrite a priori trivially-equivalent atoms/literals into the same<br />

atom/literal.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 70 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

Preprocessing atoms [44, 49, 4]<br />

Source of inefficiency: semantically equivalent but syntactically<br />

different atoms are not recognized to be identical [resp. one the<br />

negation of the other]<br />

=⇒ they may be assigned different [resp. identical] truth values.<br />

=⇒ lots of redundant unsatisfiable assignment generated<br />

Solution<br />

Rewrite a priori trivially-equivalent atoms/literals into the same<br />

atom/literal.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 70 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

Preprocessing atoms [44, 49, 4]<br />

Source of inefficiency: semantically equivalent but syntactically<br />

different atoms are not recognized to be identical [resp. one the<br />

negation of the other]<br />

=⇒ they may be assigned different [resp. identical] truth values.<br />

=⇒ lots of redundant unsatisfiable assignment generated<br />

Solution<br />

Rewrite a priori trivially-equivalent atoms/literals into the same<br />

atom/literal.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 70 / 132


Preprocessing atoms (cont.)<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Sorting: (v1 + v2 ≤ v3 + 1), (v2 + v1 ≤ v3 + 1), (v1 + v2 − 1 ≤ v3)<br />

=⇒ (v1 + v2 − v3 ≤ 1));<br />

Rewriting dual operators:<br />

(v1 < v2), (v1 ≥ v2) =⇒ (v1 < v2), ¬(v1 < v2)<br />

Exploiting associativity:<br />

(v1 +(v2 + v3) = 1), ((v1 + v2)+v3) = 1) =⇒ (v1 + v2 + v3 = 1);<br />

Factoring (v1 + 2.0v2 ≤ 4.0), (−2.0v1 − 4.0v2 ≥ −8.0), =⇒<br />

(0.25v1 + 0.5v2 ≤ 1.0);<br />

Exploiting properties of T :<br />

(v1 ≤ 3), (v1 < 4) =⇒ (v1 ≤ 3) if v1 ∈ Z;<br />

...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 71 / 132


Preprocessing atoms (cont.)<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Sorting: (v1 + v2 ≤ v3 + 1), (v2 + v1 ≤ v3 + 1), (v1 + v2 − 1 ≤ v3)<br />

=⇒ (v1 + v2 − v3 ≤ 1));<br />

Rewriting dual operators:<br />

(v1 < v2), (v1 ≥ v2) =⇒ (v1 < v2), ¬(v1 < v2)<br />

Exploiting associativity:<br />

(v1 +(v2 + v3) = 1), ((v1 + v2)+v3) = 1) =⇒ (v1 + v2 + v3 = 1);<br />

Factoring (v1 + 2.0v2 ≤ 4.0), (−2.0v1 − 4.0v2 ≥ −8.0), =⇒<br />

(0.25v1 + 0.5v2 ≤ 1.0);<br />

Exploiting properties of T :<br />

(v1 ≤ 3), (v1 < 4) =⇒ (v1 ≤ 3) if v1 ∈ Z;<br />

...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 71 / 132


Preprocessing atoms (cont.)<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Sorting: (v1 + v2 ≤ v3 + 1), (v2 + v1 ≤ v3 + 1), (v1 + v2 − 1 ≤ v3)<br />

=⇒ (v1 + v2 − v3 ≤ 1));<br />

Rewriting dual operators:<br />

(v1 < v2), (v1 ≥ v2) =⇒ (v1 < v2), ¬(v1 < v2)<br />

Exploiting associativity:<br />

(v1 +(v2 + v3) = 1), ((v1 + v2)+v3) = 1) =⇒ (v1 + v2 + v3 = 1);<br />

Factoring (v1 + 2.0v2 ≤ 4.0), (−2.0v1 − 4.0v2 ≥ −8.0), =⇒<br />

(0.25v1 + 0.5v2 ≤ 1.0);<br />

Exploiting properties of T :<br />

(v1 ≤ 3), (v1 < 4) =⇒ (v1 ≤ 3) if v1 ∈ Z;<br />

...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 71 / 132


Preprocessing atoms (cont.)<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Sorting: (v1 + v2 ≤ v3 + 1), (v2 + v1 ≤ v3 + 1), (v1 + v2 − 1 ≤ v3)<br />

=⇒ (v1 + v2 − v3 ≤ 1));<br />

Rewriting dual operators:<br />

(v1 < v2), (v1 ≥ v2) =⇒ (v1 < v2), ¬(v1 < v2)<br />

Exploiting associativity:<br />

(v1 +(v2 + v3) = 1), ((v1 + v2)+v3) = 1) =⇒ (v1 + v2 + v3 = 1);<br />

Factoring (v1 + 2.0v2 ≤ 4.0), (−2.0v1 − 4.0v2 ≥ −8.0), =⇒<br />

(0.25v1 + 0.5v2 ≤ 1.0);<br />

Exploiting properties of T :<br />

(v1 ≤ 3), (v1 < 4) =⇒ (v1 ≤ 3) if v1 ∈ Z;<br />

...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 71 / 132


Preprocessing atoms (cont.)<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Sorting: (v1 + v2 ≤ v3 + 1), (v2 + v1 ≤ v3 + 1), (v1 + v2 − 1 ≤ v3)<br />

=⇒ (v1 + v2 − v3 ≤ 1));<br />

Rewriting dual operators:<br />

(v1 < v2), (v1 ≥ v2) =⇒ (v1 < v2), ¬(v1 < v2)<br />

Exploiting associativity:<br />

(v1 +(v2 + v3) = 1), ((v1 + v2)+v3) = 1) =⇒ (v1 + v2 + v3 = 1);<br />

Factoring (v1 + 2.0v2 ≤ 4.0), (−2.0v1 − 4.0v2 ≥ −8.0), =⇒<br />

(0.25v1 + 0.5v2 ≤ 1.0);<br />

Exploiting properties of T :<br />

(v1 ≤ 3), (v1 < 4) =⇒ (v1 ≤ 3) if v1 ∈ Z;<br />

...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 71 / 132


Static Learning [2, 4]<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Often possible to quickly detect a priori short and “obviously<br />

inconsistent” pairs or triplets of literals occurring in ϕ.<br />

mutual exclusion {x = 0, x = 1},<br />

congruence {(x1 = y1),(x2 = y2),¬(f(x1, x2) = f(y1, y2))},<br />

transitivity {(x − y = 2),(y − z ≤ 4),¬(x − z ≤ 7)},<br />

substitution {(x = y),(2x − 3z ≤ 3),¬(2y − 3z ≤ 3)}<br />

...<br />

Preprocessing step: detect these literals and add blocking clauses<br />

to the input formula:<br />

(e.g., ¬(x = 0)∨¬(x = 1))<br />

=⇒ No assignment including one such group of literals is ever<br />

generated: as soon as all but one literals are assigned, the<br />

remaining one is immediately assigned false by unit-propagation.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 72 / 132


Static Learning [2, 4]<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Often possible to quickly detect a priori short and “obviously<br />

inconsistent” pairs or triplets of literals occurring in ϕ.<br />

mutual exclusion {x = 0, x = 1},<br />

congruence {(x1 = y1),(x2 = y2),¬(f(x1, x2) = f(y1, y2))},<br />

transitivity {(x − y = 2),(y − z ≤ 4),¬(x − z ≤ 7)},<br />

substitution {(x = y),(2x − 3z ≤ 3),¬(2y − 3z ≤ 3)}<br />

...<br />

Preprocessing step: detect these literals and add blocking clauses<br />

to the input formula:<br />

(e.g., ¬(x = 0)∨¬(x = 1))<br />

=⇒ No assignment including one such group of literals is ever<br />

generated: as soon as all but one literals are assigned, the<br />

remaining one is immediately assigned false by unit-propagation.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 72 / 132


Static Learning [2, 4]<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Often possible to quickly detect a priori short and “obviously<br />

inconsistent” pairs or triplets of literals occurring in ϕ.<br />

mutual exclusion {x = 0, x = 1},<br />

congruence {(x1 = y1),(x2 = y2),¬(f(x1, x2) = f(y1, y2))},<br />

transitivity {(x − y = 2),(y − z ≤ 4),¬(x − z ≤ 7)},<br />

substitution {(x = y),(2x − 3z ≤ 3),¬(2y − 3z ≤ 3)}<br />

...<br />

Preprocessing step: detect these literals and add blocking clauses<br />

to the input formula:<br />

(e.g., ¬(x = 0)∨¬(x = 1))<br />

=⇒ No assignment including one such group of literals is ever<br />

generated: as soon as all but one literals are assigned, the<br />

remaining one is immediately assigned false by unit-propagation.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 72 / 132


Other optimization techniques<br />

T -deduced-literal filtering<br />

Ghost-literal filtering<br />

T -solver layering<br />

T -solver clustering<br />

...<br />

(see [70, 10] for an overview)<br />

Efficient SMT solving Combining SAT with Theory Solvers<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 73 / 132


Efficient SMT solving Combining SAT with Theory Solvers<br />

Other SAT-solving techniques for SMT?<br />

Frequently-asked question:<br />

Are CDCL SAT solvers the only suitable Boolean Engines for SMT?<br />

Some previous attempts:<br />

Ordered Binary Decision Diagrams (OBDDs) [76, 58, 1]<br />

Stochastic Local Search [48]<br />

CDCL based currently much more efficient.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 74 / 132


Outline<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

Efficient SMT solving Theory Solvers for theories of interest<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 75 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Equality and Uninterpreted Functions<br />

(EUF)<br />

EUF polynomial: O(n·log(n))<br />

use a congruence closure data structures (E-Graphs) [38, 61, 34],<br />

based on the Union-Find data-structure for equivalence classes<br />

Idea (sketch):<br />

if (t = s), then merge the eq. classes of t and s<br />

if ∀i ∈ 1...k, ti and si pairwise belong to the same eq. classes, then<br />

merge the the eq. classes of f(t1,..., tk) and f(s1,..., sk)<br />

if (t = s) and t and s belong to the same eq. class, then conflict<br />

g<br />

a<br />

f<br />

b<br />

f<br />

g<br />

c<br />

Example borrowed from [38].<br />

f(a, b) = a<br />

f(f(a, b), b) = c<br />

g(a) = g(c)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 76 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Equality and Uninterpreted Functions<br />

(EUF)<br />

EUF polynomial: O(n·log(n))<br />

use a congruence closure data structures (E-Graphs) [38, 61, 34],<br />

based on the Union-Find data-structure for equivalence classes<br />

Idea (sketch):<br />

if (t = s), then merge the eq. classes of t and s<br />

if ∀i ∈ 1...k, ti and si pairwise belong to the same eq. classes, then<br />

merge the the eq. classes of f(t1,..., tk) and f(s1,..., sk)<br />

if (t = s) and t and s belong to the same eq. class, then conflict<br />

g<br />

a<br />

f<br />

b<br />

f<br />

g<br />

c<br />

Example borrowed from [38].<br />

f(a, b) = a<br />

f(f(a, b), b) = c<br />

g(a) = g(c)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 76 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Equality and Uninterpreted Functions<br />

(EUF)<br />

EUF polynomial: O(n·log(n))<br />

use a congruence closure data structures (E-Graphs) [38, 61, 34],<br />

based on the Union-Find data-structure for equivalence classes<br />

Idea (sketch):<br />

if (t = s), then merge the eq. classes of t and s<br />

if ∀i ∈ 1...k, ti and si pairwise belong to the same eq. classes, then<br />

merge the the eq. classes of f(t1,..., tk) and f(s1,..., sk)<br />

if (t = s) and t and s belong to the same eq. class, then conflict<br />

g<br />

a<br />

f<br />

b<br />

f<br />

g<br />

c<br />

Example borrowed from [38].<br />

f(a, b) = a<br />

f(f(a, b), b) = c<br />

g(a) = g(c)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 76 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Equality and Uninterpreted Functions<br />

(EUF)<br />

EUF polynomial: O(n·log(n))<br />

use a congruence closure data structures (E-Graphs) [38, 61, 34],<br />

based on the Union-Find data-structure for equivalence classes<br />

Idea (sketch):<br />

if (t = s), then merge the eq. classes of t and s<br />

if ∀i ∈ 1...k, ti and si pairwise belong to the same eq. classes, then<br />

merge the the eq. classes of f(t1,..., tk) and f(s1,..., sk)<br />

if (t = s) and t and s belong to the same eq. class, then conflict<br />

g<br />

a<br />

f<br />

b<br />

f<br />

g<br />

c<br />

Example borrowed from [38].<br />

f(a, b) = a<br />

f(f(a, b), b) = c<br />

g(a) = g(c)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 76 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Equality and Uninterpreted Functions<br />

(EUF)<br />

EUF polynomial: O(n·log(n))<br />

use a congruence closure data structures (E-Graphs) [38, 61, 34],<br />

based on the Union-Find data-structure for equivalence classes<br />

Idea (sketch):<br />

if (t = s), then merge the eq. classes of t and s<br />

if ∀i ∈ 1...k, ti and si pairwise belong to the same eq. classes, then<br />

merge the the eq. classes of f(t1,..., tk) and f(s1,..., sk)<br />

if (t = s) and t and s belong to the same eq. class, then conflict<br />

g<br />

a<br />

f<br />

b<br />

f<br />

g<br />

c<br />

Example borrowed from [38].<br />

f(a, b) = a<br />

f(f(a, b), b) = c<br />

g(a) = g(c)<br />

=⇒ conflict<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 76 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Difference logic (DL)<br />

[0, x0]<br />

DL polynomial: O(#vars ·#constraints)<br />

variants of the Bellman-Ford shortest-path algorithm: a negative<br />

cycle reveals a conflict [62, 30]<br />

Ex:<br />

{(x1 − x2 ≤ −1),(x1 − x4 ≤ −1),(x1 − x3 ≤ −2),<br />

(x3 − x1 ≤ −1),(x3 − x2 ≤ −1),(x4 − x2 ≤ 3),(x4 − x3 ≤ 6)}<br />

x0<br />

0<br />

0<br />

0<br />

0<br />

[−4, x3]<br />

−2<br />

x1<br />

x3<br />

[−2, x4]<br />

−1<br />

6<br />

−2<br />

=⇒ Sat<br />

−1<br />

−1<br />

x2<br />

x4<br />

[0, x0]<br />

3<br />

[0, x0]<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 77 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Difference logic (DL)<br />

[0, x0]<br />

DL polynomial: O(#vars ·#constraints)<br />

variants of the Bellman-Ford shortest-path algorithm: a negative<br />

cycle reveals a conflict [62, 30]<br />

Ex:<br />

{(x1 − x2 ≤ −1),(x1 − x4 ≤ −1),(x1 − x3 ≤ −2),(x2 − x1 ≤ 2),<br />

(x3 − x1 ≤ −1),(x3 − x2 ≤ −1),(x4 − x2 ≤ 3),(x4 − x3 ≤ 6)}<br />

x0<br />

0<br />

0<br />

0<br />

0<br />

[−4, x3]<br />

−2<br />

x1<br />

x3<br />

[−2, x4]<br />

−1<br />

6<br />

−2<br />

−1<br />

−1<br />

x2<br />

x4<br />

[0, x0]<br />

3<br />

[0, x0]<br />

x0<br />

[0,x0]<br />

0<br />

0<br />

0<br />

0<br />

[-6,x3]<br />

−1 [-4,x1]<br />

−2<br />

x1<br />

x3<br />

2<br />

6<br />

−1<br />

−1<br />

x2<br />

x4<br />

[-5,x2] −2 [0,x0]<br />

=⇒ Sat =⇒ Unsat<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 77 / 132<br />

3


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Linear arithmetic over the rationals<br />

(LA(Q))<br />

EX: {(s1 − s2 ≤ 5.2),(s1 = s0 + 3.4·t − 3.4·t0),¬(s1 = s0)}<br />

LA(Q) polynomial<br />

variants of the simplex LP algorithm [39]<br />

[39] allows for detecting conflict sets & performing T -propagation<br />

strict inequalities t < 0 rewritten as t+ǫ ≤ 0, ǫ treated symbolically<br />

⎡<br />

B<br />

⎤ ⎡ ⎤ ⎡<br />

N<br />

x1 ...A1j ...<br />

⎢ ⎥ ⎢ ⎥ ⎢<br />

⎢ . ⎥ ⎢<br />

⎥ ⎢ . ⎥ ⎢<br />

⎥ ⎢ .<br />

⎢ xi<br />

⎥ = ⎢ Ai1...Aij ...AiM<br />

⎥ ⎢<br />

⎥ ⎢ xj<br />

⎢ ⎥ ⎢ ⎥ ⎢<br />

⎣ . ⎦ ⎣ . ⎦ ⎣ .<br />

...ANj ...<br />

xN<br />

Invariant: β(xj) ∈ [lj, uj] ∀xj ∈ N<br />

xN+1<br />

xN+M<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 78 / 132<br />

⎤<br />

⎥<br />

⎥;<br />

⎥<br />


Efficient SMT solving Theory Solvers for theories of interest<br />

Remark: infinite precision arithmetic<br />

In order to avoid incorrect results due to numerical errors and to<br />

overflows, all T -solvers for LA(Q), LA(Z) and their subtheories which<br />

are based on numerical algorithms must be implemented on top of<br />

infinite-precision-arithmetic software packages.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 79 / 132


Efficient SMT solving Theory Solvers for theories of interest<br />

T -solvers for Linear arithmetic over the integers<br />

(LA(Z))<br />

EX: {(x := xl + 2 16 xh),(x ≥ 0),(x ≤ 2 16 − 1)}<br />

LA(Z) NP-complete<br />

combination of many techniques: simplex, branch&bound, cutting<br />

planes, ... [39, 46]<br />

DPLL<br />

LA(Z)-conflict<br />

5<br />

1 3<br />

conflict<br />

LA(Q)-solver<br />

2<br />

Branch and Bound-lemma<br />

no conflict 1<br />

no conflict<br />

equality elimination<br />

Branch and Bound<br />

lemmas generator<br />

LA(Z)-solver<br />

conflict<br />

2<br />

Diophantine<br />

equations handler<br />

no conflict 3<br />

trail simplifications Internal<br />

Branch and Bound<br />

4 conflict<br />

LA(Z) model<br />

1<br />

4<br />

timeout 5<br />

LA(Z) model<br />

Figure courtesy of A. Griggio [46]<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 80 / 132<br />

SAT


T -solvers for Arrays (AR)<br />

Efficient SMT solving Theory Solvers for theories of interest<br />

EX: (write(A, i, v) = write(B, i, w))∧¬(v = w)<br />

NP-complete<br />

congruence closure (EUF) plus on-the-fly instantiation of array’s<br />

axioms:<br />

EX:<br />

∀a.∀i.∀e. (read(write(a, i, e), i) = e), (1)<br />

∀a.∀i.∀j.∀e. ((i = j) → read(write(a, i, e), j) = read(a, j)),(2)<br />

∀a.∀b. (∀i.(read(a, i) = read(b, i)) → (a = b)). (3)<br />

Input : (write(A, i, v) = write(B, i, w))∧¬(v = w)<br />

inst. (1) : (read(write(A, i, v), i) = v)<br />

(read(write(B, i, w), i) = w)<br />

|=EUF (v = w)<br />

|=Bool ⊥<br />

Roberto manySebastiani strategies () discussed <strong>Satisfiability</strong> in the <strong>Modulo</strong>literature <strong>Theories</strong> (e.g., [38, July 45, 16th17, 20<strong>11</strong> 37]) 81 / 132


T -solvers for Bit vectors (BV)<br />

Efficient SMT solving Theory Solvers for theories of interest<br />

EX: {(x [16][15 : 0] = (y [16][15 : 8] :: z [16][7 : 0])


Outline<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

Efficient SMT solving SMT for combinations of theories<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 83 / 132


Efficient SMT solving SMT for combinations of theories<br />

SMT for combined theories: SMT( <br />

i Ti)<br />

Problem: Many problems can be expressed as SMT problems only in<br />

combination of theories <br />

i Ti — SMT( <br />

i Ti)<br />

GE01 ≥<br />

LE01<br />

≥<br />

v0 v1 v3 v2 v6<br />

h<br />

h<br />

Sub<br />

v4 v8 RESET5v5<br />

v7<br />

LA(Z) : (GE01 ↔ (v0 ≥ v1))∧(LE01 ↔ (v0 ≤ v1))∧<br />

EUF : (v3 = h(v0))∧(v4 = h(v1))∧<br />

LA(Z) : (v2 = v3 − v4)∧(RESET5 → (v5 = 0))∧<br />

EUF or LA(Z) : (¬RESET5 → (v5 = v8))∧<br />

EUF : (v6 = f(v2))∧(v7 = f(v5))∧<br />

EUF or LA(Z) : (EQ67 ↔ (v6 = v7))∧....<br />

0<br />

f<br />

f<br />

=<br />

EQ67<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 84 / 132


Efficient SMT solving SMT for combinations of theories<br />

SMT( <br />

i Ti) via “classic” Nelson-Oppen<br />

Main idea<br />

Combine two or more Ti-solvers into one ( <br />

i Ti)-solver via<br />

Nelson-Oppen/Shostak (N.O.) combination procedure [60, 71]<br />

based on the deduction and exchange of equalities between<br />

shared variables/terms (interface equalities, eijs)<br />

important improvements and evolutions [68, 7, 38]<br />

drawbacks [20, 21]:<br />

require (possibly expensive) deduction capabilities from Ti-solvers<br />

[ with non-convex theories ] case-splits forced by the deduction of<br />

disjunctions of eij’s<br />

generate (typically long) ( <br />

i Ti)-lemmas, without interface equalities<br />

=⇒ no backjumping & learning from eij-reasoning<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 85 / 132


N.O.: example<br />

Efficient SMT solving SMT for combinations of theories<br />

EUF : (v3 = h(v0))∧(v4 = h(v1))∧(v6 = f(v2))∧(v7 = f(v5))∧<br />

LA(Q) : (v0 ≥ v1)∧(v0 ≤ v1)∧(v2 = v3 − v4)∧(RESET5 → (v5 = 0))∧<br />

Both : (¬RESET5 → (v5 = v8))∧¬(v6 = v7).<br />

v3 = h(v0)<br />

v4 = h(v1)<br />

v6 = f(v2)<br />

v7 = f(v5)<br />

¬(v6 = v7)<br />

RESET5<br />

v2 = v3−v4<br />

v5 = 0<br />

Branch 1 Branch 2 ¬RESET5<br />

EUF LA(Q)<br />

v0 ≥ v1<br />

EUF LA(Q)<br />

v0 ≥ v1<br />

v0 ≤ v1<br />

v0 ≤ v1<br />

〈eij-deduction〉<br />

v3 = h(v0)<br />

v4 = h(v1)<br />

v6 = f(v2)<br />

v7 = f(v5)<br />

¬(v6 = v7)<br />

v0 = v1<br />

v0 = v1<br />

v0 = v1<br />

〈eij-deduction〉 〈eij-deduction〉<br />

v3 = v4<br />

v3 = v4<br />

v3 = v4<br />

〈eij-deduction〉<br />

v2 = v5<br />

v2 = v5<br />

v2 = v3−v4<br />

v5 = v8<br />

〈eij-deduction〉<br />

v0 = v1<br />

v3 = v4<br />

EUF ∪LA(Q)-Satisfiable!<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 86 / 132


N.O.: example (cont.)<br />

v3 = h(v0)<br />

v4 = h(v1)<br />

v6 = f(v2)<br />

v7 = f(v5)<br />

¬(v6 = v7)<br />

RESET5<br />

Efficient SMT solving SMT for combinations of theories<br />

v2 = v3−v4<br />

v5 = 0<br />

Branch 1 Branch 2 ¬RESET5<br />

EUF LA(Q)<br />

v0 ≥ v1<br />

EUF LA(Q)<br />

v0 ≥ v1<br />

v0 ≤ v1<br />

v0 ≤ v1<br />

〈eij-deduction〉<br />

v3 = h(v0)<br />

v4 = h(v1)<br />

v6 = f(v2)<br />

v7 = f(v5)<br />

¬(v6 = v7)<br />

v0 = v1<br />

v0 = v1<br />

v0 = v1<br />

〈eij-deduction〉 〈eij-deduction〉<br />

v3 = v4<br />

v3 = v4<br />

v3 = v4<br />

〈eij-deduction〉<br />

v2 = v5<br />

v2 = v5<br />

v2 = v3−v4<br />

v5 = v8<br />

〈eij-deduction〉<br />

v0 = v1<br />

v3 = v4<br />

EUF ∪LA(Q)-Satisfiable!<br />

EUF-conflict : ((v6 = f(v2))∧(v7 = f(v5))∧¬(v6 = v7)∧(v2 = v5)) → ⊥<br />

LA(Q)-deduction : ((v2 = v3 − v4)∧(v5 = 0)∧(v3 = v4)) → (v2 = v5)<br />

EUF-deduction : ((v3 = h(v0))∧(v4 = h(v1))∧(v0 = v1)) → (v3 = v4)<br />

LA(Q)-deduction : ((v0 ≥ v1)∧(v0 ≤ v1)) → (v0 = v1)<br />

=⇒<br />

EUF ∪LA(Q)-conflict : ((v6 = f(v2))∧(v7 = f(v5))∧¬(v6 = v7)∧(v2 = v3 − v4)∧<br />

(v5 = 0)∧(v3 = h(v0))∧(v4 = h(v1))∧(v0 ≥ v1)) → ⊥.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 87 / 132


Efficient SMT solving SMT for combinations of theories<br />

N.O.: example (non-convex theory)<br />

µ LA(Z) µEUF<br />

v1 ≥ 0<br />

v1 ≤ 1<br />

v2 ≥ v6<br />

v2 ≤ v6+1 v4<br />

v5 = v4−1<br />

v3 = 0<br />

= 1<br />

〈eij-deduction〉<br />

v1 = v3∨v1 = v4<br />

v5 = v6<br />

〈eij-deduction〉<br />

v2 = v3∨v2 = v4<br />

v1 = v3<br />

〈eij-deduction〉<br />

v2 = v3<br />

¬(f(v1) = f(v2))<br />

¬(f(v2) = f(v4))<br />

f(v3) = v5<br />

f(v1) = v6<br />

v5 = v6<br />

v2 = v4<br />

v1 = v4<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 88 / 132<br />

SAT!


Efficient SMT solving SMT for combinations of theories<br />

SMT( <br />

i Ti) via Delayed Theory Combination (DTC)<br />

Main idea<br />

Delegate to the CDCL SAT solver part/most of the (possibly very<br />

expensive) reasoning effort on interface equalities previously due to<br />

the Ti-solvers (eij-deduction, case-split). [12, 13, 21]<br />

based on Boolean reasoning on interface equalities via CDCL<br />

(plus T -propagation)<br />

important improvements and evolutions [36, 9]<br />

feature wrt N.O. [20, 21]<br />

do not require (possibly expensive) deduction capabilities from<br />

Ti-solvers<br />

with non-convex theories, case-splits on eij’s handled by SAT<br />

generate Ti-lemmas with interface equalities<br />

=⇒ backjumping & learning from eij-reasoning<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 89 / 132


DTC: example<br />

Efficient SMT solving SMT for combinations of theories<br />

EUF : (v3 = h(v0))∧(v4 = h(v1))∧(v6 = f(v2))∧(v7 = f(v5))∧<br />

LA(Q) : (v0 ≥ v1)∧(v0 ≤ v1)∧(v2 = v3 − v4)∧(RESET5 → (v5 = 0))∧<br />

Both : (¬RESET5 → (v5 = v8))∧¬(v6 = v7).<br />

Search for an assignmentµ<br />

propositionally satisfying ϕ<br />

Search on eij’s:<br />

check the T1 ∪T2satisfiability<br />

ofµ<br />

¬(v3 = v4) LA(Q)-unsat<br />

C25<br />

¬(v0 = v1) EUF-unsat<br />

C34<br />

LA(Q)-unsat<br />

C01<br />

µEUF :<br />

{(v3 = h(v0)),(v4 = h(v1)),¬(v6 = v7),<br />

(v6 = f(v2)),(v7 = f(v5))}<br />

¬(v2 = v5)<br />

¬eij”<br />

RESET5<br />

¬e ′ ij<br />

C67<br />

(v5 = 0)<br />

(v0 = v1)<br />

(v3 = v4)<br />

(v2 = v5)<br />

EUF-unsat<br />

C01 : (µ ′ LA(Q)<br />

) → (v0 = v1)<br />

....<br />

C34 : (µ ′ EUF ∧(v0 = v1)) → (v3 = v4)<br />

C25 : (µ ′′ LA(Q) ∧(v5 = 0)∧(v3 = v4)) → (v2 = v5)<br />

C67 : (µ ′′<br />

EUF ∧(v2 = v5)) → (v6 = v7)<br />

µLA(Q) :<br />

{(v0 ≥ v1),(v0 ≤ v1),<br />

(v2 = v3 − v4)}<br />

¬RESET5<br />

(v5 = v8)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 90 / 132


Efficient SMT solving SMT for combinations of theories<br />

DTC: example (non-convex theory)<br />

¬(v2 = v3)<br />

¬(v5 = v6)<br />

¬(v2 = v4)<br />

µEUF:<br />

¬(f(v1) = f(v2))<br />

¬(f(v2) = f(v4))<br />

f(v3) = v5<br />

f(v1) = v6<br />

¬(v1 = v3)<br />

v2 = v3<br />

¬(v1 = v4)<br />

SAT!<br />

v1 = v3<br />

v5 = v6<br />

v2 = v4<br />

v1 ≥ 0 v5 = v4−1<br />

v1 ≤ 1 v3 = 0<br />

v2 ≥ v6 v4 = 1<br />

v2 ≤ v6+1<br />

v1 = v4<br />

µ LA(Z):<br />

C13 : (µ ′ LA(Z) ) → ((v1 = v3)∨(v1 = v4))<br />

C14 : (µ ′′′<br />

EUF ∧(v1<br />

C24 : (µ<br />

= v3)∧(v2 = v4)) → ⊥<br />

′′<br />

EUF ∧(v1<br />

C23 : (µ<br />

= v3)∧(v2 = v3)) → ⊥<br />

′′ LA(Z) ∧(v5<br />

C56 : (µ<br />

= v6)) → ((v2 = v3)∨(v2 = v4))<br />

′ EUF ∧(v1 = v3)) → (v5 = v6)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 91 / 132


Outline<br />

Beyond Solving: advanced SMT functionalities<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 92 / 132


Beyond Solving: advanced SMT functionalities<br />

Beyond Solving: advanced SAT & SMT functionalities<br />

Advanced SMT functionalities (very important in FV):<br />

Building proofs of T -unsatisfiability<br />

Extracting T -unsatisfiable Cores<br />

Computing Craig interpolants<br />

Performing All-SMT and Predicate Abstraction<br />

Deciding/optimizing SMT problems with costs<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 93 / 132


Outline<br />

Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 94 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

Building (Resolution) Proofs of T -Unsatisfiability<br />

Resolution proof of T -unsatisfiability<br />

Very similar to building proofs with plain SAT:<br />

resolution proofs whose leaves are original clauses and T -lemmas<br />

returned by the T -solver (i.e., T -conflict and T -deduction clauses)<br />

built by backward traversal of implication graphs, as in CDCL SAT<br />

Sub-proofs of T -lemmas can be built in some T -specific<br />

deduction framework if requested<br />

Important for:<br />

certifying T -unsatisfiability results<br />

computing unsatisfiable cores<br />

computing interpolants<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 95 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

Building Proofs of T -Unsatisfiability: example<br />

(x = 0∨¬(x = 1)∨A1)∧(x = 0∨x = 1∨A2)∧(¬(x = 0)∨x = 1∨A2)∧<br />

(¬A2 ∨ y = 1)∧(¬A1∨x+y > 3)∧(y < 0)∧(A2∨x−y = 4)∧(y = 2∨¬A1)∧(x ≥ 0),<br />

(¬(x = 0)∨¬(x = 1))LA(Z)<br />

(x = 1∨¬(x = 0)∨A2)<br />

(¬(x = 0)∨A2)<br />

(¬A1 ∨ y = 2)<br />

(x = 0∨¬(x = 1)∨A1)<br />

(A1 ∨ A2)<br />

(¬(y = 1)∨¬(y < 0))LA(Z)<br />

(y < 0)<br />

(x = 0∨A1 ∨ A2)<br />

(y = 2∨A2) (¬(y = 2)∨¬(y < 0))LA(Z)<br />

⊥<br />

(A2 ∨¬(y < 0)) (¬A2 ∨ y = 1)<br />

(¬(y < 0))<br />

(¬(y < 0)∨y = 1)<br />

(x = 1∨x = 0∨A2)<br />

relevant original clauses, irrelevant original clauses, T -lemmas<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 96 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

Extraction of T -unsatisfiable cores<br />

The problem<br />

Given a T -unsatisfiable set of clauses, extract from it a (possibly<br />

small/minimal/minimum) T -unsatisfiable subset (T -unsatisfiable core)<br />

wide literature in SAT<br />

Some implementations, very few literature for SMT [25, 53]<br />

We recognize three approaches:<br />

Proof-based approach (CVClite, MathSAT):<br />

byproduct of finding a resolution proof<br />

Assumption-based approach (Yices):<br />

use extra variables labeling clauses, as in the plain Boolean case<br />

Lemma-Lifting approach [25] :<br />

use an external (possibly-optimized) Boolean unsat-core extractor<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 97 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

The proof-based approach to T -unsat cores<br />

Idea (adapted from [78])<br />

Unsatisfiable core of ϕ:<br />

in SAT: the set of leaf clauses of a resolution proof of<br />

unsatisfiability of ϕ<br />

in SMT(T ): the set of leaf clauses of a resolution proof of<br />

T -unsatisfiability of ϕ, minus the T -lemmas<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 98 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

The proof-based approach to T -unsat cores: example<br />

(x = 0∨¬(x = 1)∨A1)∧(x = 0∨x = 1∨A2)∧(¬(x = 0)∨x = 1∨A2)∧<br />

(¬A2 ∨ y = 1)∧(¬A1∨x+y > 3)∧(y < 0)∧(A2∨x−y = 4)∧(y = 2∨¬A1)∧(x ≥ 0),<br />

(¬(x = 0)∨¬(x = 1))LA(Z)<br />

(x = 1∨¬(x = 0)∨A2)<br />

(¬(x = 0)∨A2)<br />

(¬A1 ∨ y = 2)<br />

(x = 0∨¬(x = 1)∨A1)<br />

(A1 ∨ A2)<br />

(¬(y = 1)∨¬(y < 0))LA(Z)<br />

(y < 0)<br />

(x = 0∨A1 ∨ A2)<br />

(y = 2∨A2) (¬(y = 2)∨¬(y < 0))LA(Z)<br />

⊥<br />

(A2 ∨¬(y < 0)) (¬A2 ∨ y = 1)<br />

(¬(y < 0))<br />

(¬(y < 0)∨y = 1)<br />

(x = 1∨x = 0∨A2)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 99 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

The assumption-based approach to T -unsat cores<br />

Let ϕ be n<br />

i=1 Ci s.t. ϕ inconsistent.<br />

Idea (adapted from [55])<br />

1 each clause Ci in ϕ is substituted by ¬Si ∨ Ci, s.t. Si fresh<br />

“selector” variable<br />

2 the resulting formula is checked for satisfiability under the<br />

assumption of all Si’s<br />

3 final conflict clause at dec. level 0: <br />

j ¬Sj<br />

=⇒{Cj}j is the unsat core<br />

extends straightforwardly to SMT(T ).<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 100 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

The assumption-based approach to T -unsat cores:<br />

Example<br />

(S1 → (x = 0∨¬(x = 1)∨A1))∧(S2 → (x = 0∨x = 1∨A2)) ∧<br />

(S3 → (¬(x = 0)∨x = 1∨A2))∧(S4 → (¬A2 ∨ y = 1)) ∧<br />

(S5 → (¬A1 ∨ x + y > 3))∧(S6 → y < 0) ∧<br />

(S7 → (A2 ∨ x − y = 4))∧(S8 → (y = 2∨¬A1))∧(S9 → x ≥ 0)<br />

Conflict analysis (Yices 1.0.6) returns:<br />

¬S1 ∨¬S2 ∨¬S3 ∨¬S4 ∨¬S6 ∨¬S7 ∨¬S8,<br />

corresponding to the unsat core in red.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 101 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

The lemma-lifting approach to T -unsat cores<br />

Idea [25, 29]<br />

(i) The T -lemmas Di are valid in T<br />

(ii) The conjunction of ϕ with all the T -lemmas D1,...,Dk is<br />

propositionally unsatisfiable: T 2B(ϕ∧ n<br />

i=1 Di) |= ⊥.<br />

Input clauses:<br />

{C1,...,Cn} T 2B({C 1,...,Cn, D 1,...,D k})<br />

Result:<br />

SAT/UNSAT<br />

Lazy_SMT_Solver<br />

StoredT-Lemmas:<br />

{D1,...,D k}<br />

T -unsat core:<br />

{C ′ 1 ,...,C′ m }<br />

Boolean abstraction:<br />

Refinement:<br />

T 2B B2T<br />

Boolean_Unsat_Core_Extractor<br />

{D ′ 1 ,...,D′ j }<br />

T -valid clauses:<br />

Boolean unsat−core:<br />

T 2B({C ′ 1 ,...,C′ m, D ′ 1 ,...,D′ j })<br />

interfaces with an external Boolean Unsat-core Extractor<br />

=⇒benefits for free of all state-of-the-art size-reduction techniques<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 102 / 132


Beyond Solving: advanced SMT functionalities Proofs and unsatisfiable cores<br />

The lemma-lifting approach to T -unsat cores: example<br />

(x = 0∨¬(x = 1)∨A1)∧(x = 0∨x = 1∨A2)∧(¬(x = 0)∨x = 1∨A2)∧<br />

(¬A2 ∨ y = 1)∧(¬A1∨x+y > 3)∧(y < 0)∧(A2∨x−y = 4)∧(y = 2∨¬A1)∧(x ≥ 0),<br />

1 The SMT solver generates the following set of LA(Z)-lemmas:<br />

{(¬(x = 1)∨¬(x = 0)), (¬(y = 2)∨¬(y < 0)), (¬(y = 1)∨¬(y < 0))}.<br />

2 The following formula is passed to the external Boolean core<br />

extractor<br />

(B0 ∨¬B1 ∨ A1)∧(B0 ∨ B1 ∨ A2)∧(¬B0 ∨ B1 ∨ A2)∧<br />

(¬A2 ∨ B2)∧(¬A1 ∨ B3)∧B4 ∧(A2 ∨ B5)∧(B6 ∨¬A1)∧B7∧<br />

(¬B1 ∨¬B0)∧(¬B6 ∨¬B4)∧(¬B2 ∨¬B4)<br />

which returns the unsat core in red.<br />

3 The unsat-core is mapped back, the three T -lemmas are removed<br />

=⇒ the final T -unsat core (in red above).<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 103 / 132


Outline<br />

Beyond Solving: advanced SMT functionalities Interpolants<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 104 / 132


Beyond Solving: advanced SMT functionalities Interpolants<br />

Computing (Craig) Interpolants in SMT<br />

Craig Interpolant<br />

Given an ordered pair (A, B) of formulas such that A∧B |=T ⊥, a<br />

Craig interpolant is a formula I s.t.:<br />

a) A |=T I,<br />

b) I ∧ B |=T ⊥,<br />

c) I A and I B.<br />

“I A” meaning that all uninterpreted (in T ) symbols in I occur in A.<br />

Very important in many FV applications<br />

A few works presented for various theories:<br />

EUF [57, 69], DL [26, 28], UT VPI [27, 28], LA(Q)<br />

[57, 69, 26, 28], LA(Z) [50, 15, 47], BV [51], ...<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 105 / 132


Beyond Solving: advanced SMT functionalities Interpolants<br />

A General Algorithm<br />

Algorithm: Interpolant generation for SMT(T ) [67, 57]<br />

(i) Generate a resolution proof of T -unsatisfiability P for A∧B.<br />

(ii) ...<br />

def<br />

def<br />

(iii) For every original leaf clause C in P, set IC = C ↓ B if C ∈ A, and IC = ⊤ if C ∈ B.<br />

(iv) For every inner node C of P obtained by resolution from C1 = p ∨φ1 and<br />

def<br />

def<br />

def<br />

C2 = ¬p ∨φ2, set IC = IC ∨ IC if p does not occur in B, and IC = IC ∧ IC 1 2 1 2<br />

otherwise.<br />

(v) Output I⊥ as an interpolant for (A, B).<br />

“η\ B” [resp. “η ↓ B”] is the set of literals in η whose atoms do not [resp. do] occur in B.<br />

row 2. only place where T comes in to play<br />

=⇒ Reduced to the problem of finding an interpolant for two sets of<br />

T -literals (Boolean and T -specific component decoupled)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 106 / 132<br />

def


Beyond Solving: advanced SMT functionalities Interpolants<br />

A General Algorithm<br />

Algorithm: Interpolant generation for SMT(T ) [67, 57]<br />

(i) Generate a resolution proof of T -unsatisfiability P for A∧B.<br />

(ii) Foreach T -lemma ¬η in P, generate an interpolant I¬η for (η \ B,η ↓ B) .<br />

def<br />

def<br />

(iii) For every original leaf clause C in P, set IC = C ↓ B if C ∈ A, and IC = ⊤ if C ∈ B.<br />

(iv) For every inner node C of P obtained by resolution from C1 = p ∨φ1 and<br />

def<br />

def<br />

def<br />

C2 = ¬p ∨φ2, set IC = IC ∨ IC if p does not occur in B, and IC = IC ∧ IC 1 2 1 2<br />

otherwise.<br />

(v) Output I⊥ as an interpolant for (A, B).<br />

“η\ B” [resp. “η ↓ B”] is the set of literals in η whose atoms do not [resp. do] occur in B.<br />

row 2. only place where T comes in to play<br />

=⇒ Reduced to the problem of finding an interpolant for two sets of<br />

T -literals (Boolean and T -specific component decoupled)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 106 / 132<br />

def


Beyond Solving: advanced SMT functionalities Interpolants<br />

Computing Craig Interpolants in SMT: example<br />

A def<br />

= (B1 ∨(0 ≤ x1 − 3x2 + 1))∧(0 ≤ x1 + x2)∧(¬B2 ∨¬(0 ≤ x1 + x2))<br />

B def<br />

= (¬(0 ≤ x3 − 2x1 − 3)∨(0 ≤ 1−2x3))∧(¬B1 ∨ B2)∧(B1 ∨(0 ≤ x3 − 2x1 − 3))<br />

¬(0 ≤ x1 − 3x2 + 1)∨¬(0 ≤ x1 + x2)∨<br />

¬(0 ≤ x3 − 2x1 − 3)∨¬(0 ≤ 1−2x3)<br />

¬(0 ≤ x3 − 2x1 − 3)∨(0 ≤ 1−2x3)<br />

¬(0 ≤ x1 − 3x2 + 1)∨¬(0 ≤ x1 + x2)∨<br />

¬(0 ≤ x3 − 2x1 − 3) B1 ∨(0 ≤ x3 − 2x1 − 3)<br />

B1 ∨(0 ≤ x1 − 3x2 + 1)<br />

¬(0 ≤ x1 − 3x2 + 1)∨¬(0 ≤ x1 + x2)∨B1<br />

¬(0 ≤ x1 + x2)∨B1<br />

¬B1 ∨ B2<br />

¬(0 ≤ x1 + x2)∨B2<br />

(0 ≤ x1 + x2)<br />

⊥<br />

¬B2 ∨¬(0 ≤ x1 + x2)<br />

¬(0 ≤ x1 + x2)<br />

(0 ≤ 4x1 + 1)<br />

(0 ≤ 4x1 + 1)<br />

B1 ∨(0 ≤ 4x1 + 1)<br />

(0 ≤ 4x1 + 1)<br />

⊤<br />

⊤<br />

B1 ∨(0 ≤ 4x1 + 1)<br />

⊥<br />

⊤<br />

(B1 ∨(0 ≤ 4x1 + 1))∧¬B2<br />

(B1 ∨(0 ≤ 4x1 + 1))∧¬B2<br />

original proof interpolant proof<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 107 / 132<br />

B1<br />

¬B2


Beyond Solving: advanced SMT functionalities Interpolants<br />

Example: interpolation algorithms for difference logic<br />

An inference-based algorithm [57]<br />

(0 ≤ x1 − x2 + 1) (0 ≤ x2 − x3)<br />

COMB (0 ≤ x1 − x3 + 1) (0 ≤ x4 − x5 − 1)<br />

COMB (0 ≤ x1 − x3 + x4 − x5) (0 ≤ 0)<br />

COMB (0 ≤ x1 − x3 + x4 − x5) (0 ≤ 0)<br />

COMB (0 ≤ x1 − x3 + x4 − x5)<br />

=⇒ Interpolant: (0 ≤ x1 − x3 + x4 − x5) (not in DL, and weaker).<br />

A graph-based algorithm [26, 28]<br />

A<br />

<br />

Chord: (0≤x1−x3+1) <br />

B<br />

= { (0 ≤ x1 − x2 + 1),(0 ≤ x2 − x3),(0 ≤ x4 − x5 − 1)}<br />

A def<br />

B def<br />

x2<br />

= {(0 ≤ x5 − x1),(0 ≤ x3 − x4 − 1)}. −1<br />

=⇒ Interpolant: (0 ≤ x1 − x3 + 1)∧(0 ≤ x4 − x5 − 1) (still in DL)<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 108 / 132<br />

1<br />

x1<br />

0<br />

1<br />

x3<br />

0<br />

x5<br />

−1<br />

x4


Outline<br />

Beyond Solving: advanced SMT functionalities All-SMT & Predicate Abstraction<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 109 / 132


Beyond Solving: advanced SMT functionalities All-SMT & Predicate Abstraction<br />

All-SAT/All-SMT<br />

All-SAT: enumerate all truth assignments satisfying ϕ<br />

All-SMT: enumerate all T -satisfiable truth assignments<br />

propositionally satisfying ϕ<br />

All-SMT over an “important” subset of atoms P def<br />

= {Pi}i:<br />

enumerate all assignments over P which can be extended to<br />

T -satisfiable truth assignments propositionally satisfying ϕ<br />

=⇒can compute predicate abstraction<br />

Algorithms:<br />

BCLT [52]<br />

each time a T -satisfiable assignment {l1,..., ln} is found, perform<br />

conflict-driven backjumping as if the restricted clause ( <br />

i ¬li) ↓ P<br />

belonged to the clause set<br />

MathSAT/NuSMV [23]<br />

As above, plus the Boolean search of the SMT solver is driven by<br />

an OBDD.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>0 / 132


Beyond Solving: advanced SMT functionalities All-SMT & Predicate Abstraction<br />

Predicate Abstraction<br />

Predicate abstraction<br />

if ϕ(v) is a SMT formula over the domain variables v def<br />

= {vj}j, {γi}i is a<br />

set of “relevant” predicates over v, and P def<br />

= {Pi}i a set of Boolean<br />

labels, then:<br />

PredAbsP(ϕ)<br />

def<br />

= ∃v.( ϕ(v)∧ <br />

Pi ↔ γi(v) )<br />

i<br />

= µ | µ truth assignment on P<br />

s.t. µ∧ϕ∧ <br />

i (Pi ↔ γi) is T -satisfiable<br />

projection of ϕ over (the Boolean abstraction of) the set {γi}i.<br />

essential step in FV: extracts finite-state abstractions from a<br />

infinite state space<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>1 / 132


Beyond Solving: advanced SMT functionalities All-SMT & Predicate Abstraction<br />

Predicate Abstraction: example<br />

PreAbs(ϕ) {P1,P 2}<br />

ϕ def<br />

= (v1 + v2 > 12)<br />

γ1<br />

γ2<br />

def<br />

= (v1 + v2 = 2)<br />

def<br />

= (v1 − v2 < 10)<br />

def<br />

= ∃ v1 v2 .<br />

⇓<br />

⎛<br />

⎝<br />

(v1 + v2 > 12) ∧<br />

(P1 ↔ (v1 + v2 = 2)) ∧<br />

(P2 ↔ (v1 − v2 < 10))<br />

= (¬P1 ∧¬P2)∨(¬P1 ∧ P2)<br />

= ¬P1.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>2 / 132<br />

⎞<br />


Outline<br />

Beyond Solving: advanced SMT functionalities SMT with cost optimization<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>3 / 132


Beyond Solving: advanced SMT functionalities SMT with cost optimization<br />

SMT cost-minimization problems<br />

The problem<br />

SMT(T ) problem ϕ for some T , augmented with cost functions:<br />

costi = Ni j=1 ite(Pij , c ij<br />

1<br />

, cij<br />

2 ), s.t. costi ∈ (li , ui ], c ij<br />

{1,2} > 0<br />

Decision problem: is there a model complying with cost ranges?<br />

Optimization problem: find model minimizing some cost i .<br />

allows for encoding MaxSAT/MaxSMT and PseudoBoolean<br />

Proposed solution: [63, 24]<br />

SMT(T ∪C), C is an ad-hoc “theory of costs”<br />

a specialized very-fast theory-solver for C added to MathSAT<br />

very fast & aggressive search pruning and theory-propagation<br />

cost minimization handled by linear or binary search<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>4 / 132


Beyond Solving: advanced SMT functionalities SMT with cost optimization<br />

SMT cost-minimization problems<br />

The problem<br />

SMT(T ) problem ϕ for some T , augmented with cost functions:<br />

costi = Ni j=1 ite(Pij , c ij<br />

1<br />

, cij<br />

2 ), s.t. costi ∈ (li , ui ], c ij<br />

{1,2} > 0<br />

Decision problem: is there a model complying with cost ranges?<br />

Optimization problem: find model minimizing some cost i .<br />

allows for encoding MaxSAT/MaxSMT and PseudoBoolean<br />

Proposed solution: [63, 24]<br />

SMT(T ∪C), C is an ad-hoc “theory of costs”<br />

a specialized very-fast theory-solver for C added to MathSAT<br />

very fast & aggressive search pruning and theory-propagation<br />

cost minimization handled by linear or binary search<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>4 / 132


Beyond Solving: advanced SMT functionalities SMT with cost optimization<br />

SMT(T ∪C): main ideas<br />

A “theory of costs” C:<br />

Cost variables cost i<br />

“bound cost” BC(cost i , k): “cost i ≤ k"<br />

“incur cost” IC(cost i , j, k i<br />

j ): “the jth addend of cost i := k i<br />

j<br />

“cost i = N i<br />

j=1 ite(Pi i<br />

j , kj , 0), s.t. cost i ∈ (li , ui ]” encoded as<br />

¬BC(cost i , li )∧BC(cost i , ui )∧ N i<br />

j=1 (Pi j ↔ IC(cost i , j, k i<br />

j ))<br />

very-fast theory solver: C-solver<br />

1. IC(cost i , j, k i<br />

j ) = ⊤ =⇒ costi = costi + k i<br />

j<br />

2. costi > ubi =⇒ conflict<br />

3. costi +{total cost of all unassigned IC ′ s} ≤ lbi =⇒ conflict<br />

4. IC(cost i , j, k i<br />

j ) = ⊤ causes 2. =⇒ C-propagate ¬IC(costi , j, k i<br />

j )<br />

5. IC(cost i , j, k i<br />

j ) = ⊥ causes 3. =⇒ C-propagate IC(costi , j, k i<br />

j )<br />

no symbol shared with T<br />

=⇒ independent theory solvers for T and C<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>5 / 132


Beyond Solving: advanced SMT functionalities SMT with cost optimization<br />

Ongoing work: SMT with linear cost functions<br />

The problem<br />

SMT(LA(Q)∪ <br />

k Tk) problem ϕ for some Tk’s, augmented with cost<br />

functions: cost i = N i<br />

j=1 aixi, s.t. cost i ∈ (l i , u i ], xi ∈ Q<br />

Decision problem: standard SMT(LA(Q)∪ <br />

k Tk)<br />

Optimization problem: find model minimizing some cost i .<br />

Optimization along two orthogonal directions: BOOL and Q<br />

Allows for encoding generalized linear disjunctive programming<br />

Proposed solution:<br />

SMT(LA(Q)∪ <br />

k Tk) augmented with a LP optimization routine<br />

very fast & aggressive search pruning and theory-propagation<br />

cost minimization (branch&bound or binary search) embedded<br />

inside the CDCL search<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>6 / 132


Outline<br />

Conclusions & current research directions<br />

1 Motivations and goals<br />

2 Background: Modern SAT solving<br />

Basics<br />

Modern CDCL SAT solving<br />

Other SAT functionalities<br />

3 Efficient SMT solving<br />

Combining SAT with Theory Solvers<br />

Theory Solvers for theories of interest<br />

SMT for combinations of theories<br />

4 Beyond Solving: advanced SMT functionalities<br />

Proofs and unsatisfiable cores<br />

Interpolants<br />

All-SMT & Predicate Abstraction<br />

SMT with cost optimization<br />

5 Conclusions & current research directions<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>7 / 132


Conclusions<br />

Conclusions & current research directions<br />

SMT very popular, due to successful application in many domains<br />

Combines techniques from SAT, ATP and operational research<br />

Not only satisfiability, but also advanced functionalities<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>8 / 132


Conclusions & current research directions<br />

Open/ongoing research directions<br />

Solving:<br />

improve efficiency (e.g. BV , AR, LA(Z) & their combinations)<br />

“a never-ending fight against the search-space explosion problem<br />

[E. Clarke, Turing-award winner 2007]”<br />

develop efficient solvers for other theories (NLA(Q), NLA(Z))<br />

develop new theories & solvers (e.g., floating-point arithmetic)<br />

...<br />

Functionalities<br />

Interpolation in some theories (LA(Z), BV) still very challenging<br />

Predicate abstraction (AllSMT) still a bottleneck in SMT-based FV<br />

SMT with costs/optimization still in very early stage<br />

...<br />

Combination of SMT solvers and ATP (SMT with quantifiers)<br />

Integration & customization of SMT solvers with (FV) tools<br />

See also [64]<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> <strong>11</strong>9 / 132


Links I<br />

Links & References<br />

a 20-hour PhD course on SAT & SMT:<br />

http://disi.unitn.it/~rseba/DIDATTICA/SAT_BASED10/<br />

survey papers:<br />

http://disi.unitn.it/~rseba/publist.html<br />

Roberto Sebastiani: "Lazy <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>".<br />

Journal on <strong>Satisfiability</strong>, Boolean Modeling and Computation, JSAT.<br />

Vol. 3, 2007. Pag 141–224, c○IOS Press.<br />

Clark Barrett, Roberto Sebastiani, Sanjit Seshia, Cesare Tinelli<br />

"<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>". Part II, Chapter 26, The Handbook<br />

of <strong>Satisfiability</strong>. 2009. c○IOS press.<br />

web links:<br />

The SMT library SMT-LIB:<br />

http://goedel.cs.uiowa.edu/smtlib/<br />

The SMT Competition SMT-COMP: http://www.smtcomp.org/<br />

The 20<strong>11</strong> MIT SAT/SMT School<br />

http://people.csail.mit.edu/vganesh/summerschool/<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 120 / 132


References I<br />

[1] A. Armando.<br />

Simplifying OBDDs in Decidable <strong>Theories</strong>.<br />

In Proc. PDPAR’03., 2003.<br />

Links & References<br />

[2] A. Armando, C. Castellini, and E. Giunchiglia.<br />

SAT-based procedures for temporal reasoning.<br />

In Proc. European Conference on Planning, CP-99, 1999.<br />

[3] G. Audemard, P. Bertoli, A. Cimatti, A. Korniłowicz, and R. Sebastiani.<br />

A SAT Based Approach for Solving Formulas over Boolean and Linear Mathematical Propositions.<br />

In Proc. CADE’2002., volume 2392 of LNAI. Springer, July 2002.<br />

[4] G. Audemard, P. Bertoli, A. Cimatti, A. Korniłowicz, and R. Sebastiani.<br />

Integrating Boolean and Mathematical Solving: Foundations, Basic Algorithms and Requirements.<br />

In Proc. AIARSC’2002, volume 2385 of LNAI. Springer, 2002.<br />

[5] G. Audemard, M. Bozzano, A. Cimatti, and R. Sebastiani.<br />

Verifying Industrial Hybrid Systems with MathSAT.<br />

In Proc. PDPAR’03, 2003.<br />

[6] G. Audemard, A. Cimatti, A. Korniłowicz, and R. Sebastiani.<br />

SAT-Based Bounded Model Checking for Timed Systems.<br />

In Proc. FORTE’02., volume 2529 of LNCS. Springer, November 2002.<br />

[7] C. Barret, D. Dill, and A. Stump.<br />

A Generalization of Shostak’s Method for Combining Decision Procedures.<br />

In Proc. FROCOS’02, 2002.<br />

[8] C. Barrett, D. Dill, and A. Stump.<br />

Checking <strong>Satisfiability</strong> of First-Order Formulas by Incremental Translation to SAT.<br />

In 14th International Conference on Computer-Aided Verification, 2002.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 121 / 132


References II<br />

Links & References<br />

[9] C. Barrett, R. Nieuwenhuis, A. Oliveras, and C. Tinelli.<br />

Splitting on Demand in SAT <strong>Modulo</strong> <strong>Theories</strong>.<br />

In Proc. LPAR’06, volume 4246 of LNAI. Springer, 2006.<br />

[10] C. W. Barrett, R. Sebastiani, S. A. Seshia, and C. Tinelli.<br />

<strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>.<br />

In Handbook of <strong>Satisfiability</strong>, chapter 26, pages 825–885. IOS Press, 2009.<br />

[<strong>11</strong>] P. Baumgartner.<br />

FDPLL - A First Order Davis-Putnam-Longeman-Loveland Procedure.<br />

In Proceedings of CADE-17, pages 200–219. Springer-Verlag, 2000.<br />

[12] M. Bozzano, R. Bruttomesso, A. Cimatti, T. Junttila, P. van Rossum, S. Ranise, and R. Sebastiani.<br />

Efficient <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> via Delayed Theory Combination.<br />

In Proc. CAV 2005, volume 3576 of LNCS. Springer, 2005.<br />

[13] M. Bozzano, R. Bruttomesso, A. Cimatti, T. A. Junttila, S. Ranise, P. van Rossum, and R. Sebastiani.<br />

Efficient theory combination via boolean search.<br />

Information and Computation, 204(10):1493–1525, 2006.<br />

[14] M. Bozzano, R. Bruttomesso, A. Cimatti, T. A. Junttila, P. van Rossum, S. Schulz, and R. Sebastiani.<br />

Mathsat: Tight integration of sat and mathematical decision procedures.<br />

Journal of Automated Reasoning, 35(1-3):265–293, 2005.<br />

[15] A. Brillout, D. Kroening, P. Rümmer, and T. Wahl.<br />

An Interpolating Sequent Calculus for Quantifier-Free Presburger Arithmetic.<br />

In Proc. IJCAR, volume 6173 of LNCS. Springer, 2010.<br />

[16] R. Brinkmann and R. Drechsler.<br />

RTL-datapath verification using integer linear programming.<br />

In Proc. ASP-DAC 2002, pages 741–746. IEEE, 2002.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 122 / 132


References III<br />

Links & References<br />

[17] R. Brummaryer and A. Biere.<br />

Lemmas on Demand for the Extensional Theory of Arrays.<br />

Journal on <strong>Satisfiability</strong>, Boolean Modeling and Computation (JSAT), 6, 2009.<br />

[18] R. Brummayer and A. Biere.<br />

Boolector: An efficient smt solver for bit-vectors and arrays.<br />

In TACAS, volume 5505 of LNCS, pages 174–177. Springer, 2009.<br />

[19] R. Bruttomesso, A. Cimatti, A. Franzén, A. Griggio, Z. Hanna, A. Nadel, A. Palti, and R. Sebastiani.<br />

A Lazy and Layered SMT(BV) Solver for Hard Industrial Verification Problems.<br />

In CAV, volume 4590 of LNCS, pages 547–560. Springer, 2007.<br />

[20] R. Bruttomesso, A. Cimatti, A. Franzén, A. Griggio, and R. Sebastiani.<br />

Delayed Theory Combination vs. Nelson-Oppen for <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>: A Comparative Analysis.<br />

In Proc. LPAR, volume 4246 of LNCS. Springer, 2006.<br />

[21] R. Bruttomesso, A. Cimatti, A. Franzén, A. Griggio, and R. Sebastiani.<br />

Delayed Theory Combination vs. Nelson-Oppen for <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>: A Comparative Analysis. .<br />

Annals of Mathematics and Artificial Intelligence., 55(1-2), 2009.<br />

[22] J. R. Burch and D. L. Dill.<br />

Automatic Verification of Pipelined Microprocessor Control.<br />

In Proc. CAV ’94, volume 818 of LNCS. Springer, 1994.<br />

[23] R. Cavada, A. Cimatti, A. Franzén, K. Kalyanasundaram, M. Roveri, and R. K. Shyamasundar.<br />

Computing Predicate Abstractions by Integrating BDDs and SMT Solvers.<br />

In FMCAD, pages 69–76. IEEE Computer Society, 2007.<br />

[24] A. Cimatti, A. Franzén, A. Griggio, R. Sebastiani, and C. Stenico.<br />

<strong>Satisfiability</strong> modulo the theory of costs: Foundations and applications.<br />

In TACAS, volume 6015 of LNCS, pages 99–<strong>11</strong>3. Springer, 2010.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 123 / 132


References IV<br />

Links & References<br />

[25] A. Cimatti, A. Griggio, and R. Sebastiani.<br />

A Simple and Flexible Way of Computing Small Unsatisfiable Cores in SAT <strong>Modulo</strong> <strong>Theories</strong>.<br />

In SAT, volume 4501 of LNCS, pages 334–339. Springer, 2007.<br />

[26] A. Cimatti, A. Griggio, and R. Sebastiani.<br />

Efficient Interpolant Generation in <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>.<br />

In Tools and Algorithms for the Construction and Analysis of Systems, TACAS’08., volume 4963 of LNCS. Springer, 2008.<br />

[27] A. Cimatti, A. Griggio, and R. Sebastiani.<br />

Interpolant Generation for UTVPI.<br />

In CADE, volume 5663 of LNCS, pages 167–182, 2009.<br />

[28] A. Cimatti, A. Griggio, and R. Sebastiani.<br />

Efficient Generation of Craig Interpolants in <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>.<br />

ACM Transaction on Computational Logics – TOCL, 12(1), October 2010.<br />

[29] A. Cimatti, A. Griggio, and R. Sebastiani.<br />

Computing small unsatisfiable cores in sat modulo theories.<br />

Journal of Artificial Intelligence Research, JAIR, 40:701–728, April 20<strong>11</strong>.<br />

[30] S. Cotton and O. Maler.<br />

Fast and Flexible Difference Logic Propagation for DPLL(T).<br />

In Proc. SAT’06, volume 4121 of LNCS. Springer, 2006.<br />

[31] M. Davis, G. Longemann, and D. Loveland.<br />

A machine program for theorem proving.<br />

Journal of the ACM, 5(7), 1962.<br />

[32] M. Davis and H. Putnam.<br />

A computing procedure for quantification theory.<br />

Journal of the ACM, 7:201–215, 1960.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 124 / 132


References V<br />

Links & References<br />

[33] T. B. de la Tour.<br />

Minimizing the Number of Clauses by Renaming.<br />

In Proc. of the 10th Conference on Automated Deduction, pages 558–572. Springer-Verlag, 1990.<br />

[34] L. de Moura and N. Bjørner.<br />

Efficient E-matching for SMT solvers.<br />

In Proc. CADE-21, 21st International Conference on Automated Deduction, volume 4603 of LNCS. Springer, 2007.<br />

[35] L. de Moura, H. Ruess, and M. Sorea.<br />

Lazy Theorem Proving for Bounded Model Checking over Infinite Domains.<br />

In Proc. CADE’2002., volume 2392 of LNAI. Springer, July 2002.<br />

[36] L. M. de Moura and N. Bjørner.<br />

Model-based theory combination.<br />

Electr. Notes Theor. Comput. Sci., 198(2):37–49, 2008.<br />

[37] L. M. de Moura and N. Bjørner.<br />

Generalized, efficient array decision procedures.<br />

In FMCAD, pages 45–52. IEEE, 2009.<br />

[38] D. Detlefs, G. Nelson, and J. Saxe.<br />

Simplify: a theorem prover for program checking.<br />

Journal of the ACM, 52(3):365–473, 2005.<br />

[39] B. Dutertre and L. de Moura.<br />

System Description: Yices 1.0.<br />

In Proc. on 2nd SMT competition, SMT-COMP’06, 2006.<br />

Available at yices.csl.sri.com/yices-smtcomp06.pdf.<br />

[40] N. Eén and N. Sörensson.<br />

An extensible SAT-solver.<br />

In Theory and Applications of <strong>Satisfiability</strong> Testing (SAT 2003), volume 2919 of LNCS, pages 502–518. Springer, 2004.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 125 / 132


References VI<br />

Links & References<br />

[41] A. Franzen, A. Cimatti, A. Nadel, R. Sebastiani, and J. Shalev.<br />

Applying SMT in Symbolic Execution of Microcode.<br />

In Proc. Int. Conference on Formal Methods in Computer Aided Design (FMCAD’10). IEEE, 2010.<br />

[42] V. Ganesh and D. L. Dill.<br />

A Decision Procedure for Bit-Vectors and Arrays.<br />

In CAV, 2007.<br />

[43] H. Ganzinger, G. Hagen, R. Nieuwenhuis, A. Oliveras, and C. Tinelli.<br />

DPLL(T): Fast decision procedures.<br />

In R. Alur and D. Peled, editors, Proceedings of the 16th International Conference on Computer Aided Verification, CAV’04<br />

(Boston, Massachusetts), LNCS. Springer, 2004.<br />

(To appear).<br />

[44] F. Giunchiglia and R. Sebastiani.<br />

Building decision procedures for modal logics from propositional decision procedures - the case study of modal K.<br />

In Proc. CADE’13, LNAI, New Brunswick, NJ, USA, August 1996. Springer.<br />

[45] A. Goel, S. Krstić, and A. Fuchs.<br />

Deciding array formulas with frugal axiom instantiation.<br />

In Proceedings of SMT’08/BPR’08, pages 12–17, New York, NY, USA, 2008. ACM.<br />

[46] A. Griggio.<br />

A Practical Approach to SMT(LA(Z)).<br />

In Proc. SMT 2010, 2010.<br />

[47] A. Griggio, T. T. H. Le, and R. Sebastiani.<br />

Efficient Interpolant Generation in <strong>Satisfiability</strong> <strong>Modulo</strong> Linear Integer Arithmetic.<br />

In Proc. Tools and Algorithms for the Construction and Analysis of Systems, TACAS’<strong>11</strong>, LNCS. Springer, 20<strong>11</strong>.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 126 / 132


References VII<br />

Links & References<br />

[48] A. Griggio, Q. S. Phan, R. Sebastiani, and S. Tomasi.<br />

Stochastic Local Search for SMT: Combining Theory Solvers with WalkSAT.<br />

In Frontiers of Combining Systems, FroCoS’<strong>11</strong>, LNAI. Springer, 20<strong>11</strong>.<br />

[49] I. Horrocks and P. F. Patel-Schneider.<br />

FaCT and DLP.<br />

In Proc. Tableaux’98, pages 27–30, 1998.<br />

[50] H. Jain, E. M. Clarke, and O. Grumberg.<br />

Efficient Craig Interpolation for Linear Diophantine (Dis)Equations and Linear Modular Equations.<br />

In A. Gupta and S. Malik, editors, CAV, volume 5123 of Lecture Notes in Computer Science, pages 254–267. Springer,<br />

2008.<br />

[51] D. Kroening and G. Weissenbacher.<br />

Lifting Propositional Interpolants to the Word-Level.<br />

In FMCAD, pages 85–89, Los Alamitos, CA, USA, 2007. IEEE Computer Society.<br />

[52] S. K. Lahiri, R. Nieuwenhuis, and A. Oliveras.<br />

SMT techniques for fast predicate abstraction.<br />

In Proc. CAV, LNCS 4144. Springer, 2006.<br />

[53] M. Liffiton and K. Sakallah.<br />

Algortithms for Computing Minimal Unsatisfiable Subsets of Constraints.<br />

Journal of Automated Reasoning, 40(1), 2008.<br />

[54] I. Lynce and J. Marques-Silva.<br />

On Computing Minimum Unsatisfiable Cores.<br />

In 7th International Conference on Theory and Applications of <strong>Satisfiability</strong> Testing, 2004.<br />

[55] I. Lynce and J. P. Marques-Silva.<br />

On computing minimum unsatisfiable cores.<br />

In SAT, 2004.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 127 / 132


References VIII<br />

Links & References<br />

[56] M. Mahfoudh, P. Niebert, E. Asarin, and O. Maler.<br />

A Satisfibaility Checker for Difference Logic.<br />

In Proceedings of SAT-02, pages 222–230, 2002.<br />

[57] K. L. McMillan.<br />

An interpolating theorem prover.<br />

Theor. Comput. Sci., 345(1):101–121, 2005.<br />

[58] J. Moeller, J. Lichtenberg, H. R. Andersen, and H. Hulgaard.<br />

Fully symbolic model checking of timed systems using difference decision diagrams.<br />

In Proc. Workshop on Symbolic Model Checking (SMC), FLoC’99, Trento, Italy, July 1999.<br />

[59] M. W. Moskewicz, C. F. Madigan, Y. Z., L. Zhang, and S. Malik.<br />

Chaff: Engineering an efficient SAT solver.<br />

In Design Automation Conference, 2001.<br />

[60] G. Nelson and D. Oppen.<br />

Simplification by Cooperating Decision Procedures.<br />

ACM Trans. on Programming Languages and Systems, 1(2):245–257, 1979.<br />

[61] R. Nieuwenhuis and A. Oliveras.<br />

Congruence closure with integer offsets.<br />

In In 10th Int. Conf. Logic for Programming, Artif. Intell. and Reasoning (LPAR), volume 2850 of LNAI, pages 78–90.<br />

Springer, 2003.<br />

[62] R. Nieuwenhuis and A. Oliveras.<br />

DPLL(T) with Exhaustive Theory Propagation and its Application to Difference Logic.<br />

In Proc. CAV’05, volume 3576 of LNCS. Springer, 2005.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 128 / 132


References IX<br />

Links & References<br />

[63] R. Nieuwenhuis and A. Oliveras.<br />

On SAT <strong>Modulo</strong> <strong>Theories</strong> and Optimization Problems.<br />

In Proc. Theory and Applications of <strong>Satisfiability</strong> Testing - SAT 2006, volume 4121 of LNCS. Springer, 2006.<br />

[64] R. Nieuwenhuis, A. Oliveras, E. Rodríguez-Carbonell, and A. Rubio.<br />

Challenges in <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong>.<br />

In Proc. RTA’07, volume 4533 of LNCS. Springer, 2007.<br />

[65] R. Nieuwenhuis, A. Oliveras, and C. Tinelli.<br />

Solving SAT and SAT <strong>Modulo</strong> <strong>Theories</strong>: from an Abstract Davis-Putnam-Logemann-Loveland Procedure to DPLL(T).<br />

Journal of the ACM, 53(6):937–977, November 2006.<br />

[66] D. Plaisted and S. Greenbaum.<br />

A Structure-preserving Clause Form Translation.<br />

Journal of Symbolic Computation, 2:293–304, 1986.<br />

[67] P. Pudlák.<br />

Lower bounds for resolution and cutting planes proofs and monotone computations.<br />

J. of Symb. Logic, 62(3), 1997.<br />

[68] H. Rueßand N. Shankar.<br />

Deconstructing Shostak.<br />

In Proc. LICS ’01. IEEE Computer Society, 2001.<br />

[69] A. Rybalchenko and V. Sofronie-Stokkermans.<br />

Constraint Solving for Interpolation.<br />

In Proc. VMCAI, volume 4349 of LNCS. Springer, 2007.<br />

[70] R. Sebastiani.<br />

Lazy Satisability <strong>Modulo</strong> <strong>Theories</strong>.<br />

Journal on <strong>Satisfiability</strong>, Boolean Modeling and Computation, JSAT, 3(3-4):141–224, 2007.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 129 / 132


References X<br />

[71] R. Shostak.<br />

Deciding Combinations of <strong>Theories</strong>.<br />

Journal of the ACM, 31:1–12, 1984.<br />

Links & References<br />

[72] J. P. M. Silva and K. A. Sakallah.<br />

GRASP - A new Search Algorithm for <strong>Satisfiability</strong>.<br />

In Proc. ICCAD’96, 1996.<br />

[73] K. Stergiou and M. Koubarakis.<br />

Backtracking algorithms for disjunctions of temporal constraints.<br />

In Proc. AAAI, pages 248–253, 1998.<br />

[74] A. Stump, C. W. Barrett, and D. L. Dill.<br />

CVC: A Cooperating Validity Checker.<br />

In Proc. CAV’02, number 2404 in LNCS. Springer Verlag, 2002.<br />

[75] S. Wolfman and D. Weld.<br />

The LPSAT Engine & its Application to Resource Planning.<br />

In Proc. IJCAI, 1999.<br />

[76] T. Yavuz-Kahveci, M. Tuncer, and T. Bultan.<br />

A Library for Composite Symbolic Representation.<br />

In Proc. TACAS2001, volume 2031 of LNCS. Springer Verlag, 2000.<br />

[77] L. Zhang, C. F. Madigan, M. W. Moskewicz, and S. Malik.<br />

Efficient conflict driven learning in boolean satisfiability solver.<br />

In ICCAD, pages 279–285, 2001.<br />

[78] L. Zhang and S. Malik.<br />

Extracting small unsatisfiable cores from unsatisfiable boolean formula.<br />

In Proc. of SAT, 2003.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 130 / 132


References XI<br />

Disclaimer<br />

Links & References<br />

The list of references above is by no means intended to be<br />

all-inclusive. I apologize both with the authors and with the readers for<br />

all the relevant works which are not cited here.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 131 / 132


Links & References<br />

c○Warner Bros. Inc.<br />

Roberto Sebastiani () <strong>Satisfiability</strong> <strong>Modulo</strong> <strong>Theories</strong> July 16th 20<strong>11</strong> 132 / 132

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!