SlideShare a Scribd company logo
1 of 149
Download to read offline
SAT and Satisfiability Modulo Theories
Roberto Bruttomesso
roberto.bruttomesso@gmail.com
University of Lugano, Switzerland
(Universit`a della Svizzera Italiana)
St.Petersburg
September 18, 2010
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 1 / 32
Outline
1 Introduction
2 SAT
SAT and SAT-Solvers
The DPLL Procedure
The Enhanced DPLL Procedure
Conflict Analysis and Learning
3 SMT
From SAT to SMT
The Eager Approach
The Lazy Approach
The Theory Solver
4 Conclusive Remarks
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 2 / 32
Efficient Solvers as Core Engines
SAT
SMT
Theorem Proving
BDDs
Testing
Automated
Model
Checking
Checking
Equiv.
Planning
Dependency
Analysis
Security
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 3 / 32
Bird’s Eye View
expressiveness
efficiency
decidable
undecidable
BDDs SAT−Solvers
SMT−Solvers
First Order Theorem Provers
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 4 / 32
SAT
• SAT is the Boolean Satisfiability Problem
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
• A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g.
∧ ⊥ is ⊥)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
• A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g.
∧ ⊥ is ⊥)
• Given a formula ϕ, is there an assignment to the variables such that
ϕ evaluates to ?
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
• A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g.
∧ ⊥ is ⊥)
• Given a formula ϕ, is there an assignment to the variables such that
ϕ evaluates to ?
• E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
• A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g.
∧ ⊥ is ⊥)
• Given a formula ϕ, is there an assignment to the variables such that
ϕ evaluates to ?
• E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥
• Simple formulation, but enormous relevance in computer science
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
• A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g.
∧ ⊥ is ⊥)
• Given a formula ϕ, is there an assignment to the variables such that
ϕ evaluates to ?
• E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥
• Simple formulation, but enormous relevance in computer science
• “Classical” NP-Complete problem
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
SAT
• SAT is the Boolean Satisfiability Problem
• A set of Boolean variables {a, b, . . .} which may assume values in
{⊥, }
• A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g.
∧ ⊥ is ⊥)
• Given a formula ϕ, is there an assignment to the variables such that
ϕ evaluates to ?
• E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥
• Simple formulation, but enormous relevance in computer science
• “Classical” NP-Complete problem
• A lot of practical problems can be encoded in SAT
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
The DPLL Procedure
• Remember SAT is NP-Complete
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
The DPLL Procedure
• Remember SAT is NP-Complete
• Still, SAT-Solvers are extremely efficient tools (nowadays), and can
handle (within reasonable time) hundred thousands of variables and
clauses∗
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
The DPLL Procedure
• Remember SAT is NP-Complete
• Still, SAT-Solvers are extremely efficient tools (nowadays), and can
handle (within reasonable time) hundred thousands of variables and
clauses∗
• SOTA Solvers are based on the DPLL procedure (Davis Putnam
Loveland Longman, ∼1960)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
The DPLL Procedure
• Remember SAT is NP-Complete
• Still, SAT-Solvers are extremely efficient tools (nowadays), and can
handle (within reasonable time) hundred thousands of variables and
clauses∗
• SOTA Solvers are based on the DPLL procedure (Davis Putnam
Loveland Longman, ∼1960)
• DPLL assumes the input as a CNF , i.e. a set of clauses , each
clause being a disjuntion of variables or negated variables
(a ∨ ¬b)
(c ∨ ¬a ∨ b)
. . .
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
a =
Splitting on a =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b =
a =
Splitting on b =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b =
a =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b = ⊥b =
a =
Backtracking on b = ⊥
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b = ⊥b =
a =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
a = ⊥
b = ⊥b =
a =
Backtracking on a = ⊥
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b =
a = ⊥
b = ⊥b =
a =
Splitting on b =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b =
a = ⊥
b = ⊥b =
a =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b = ⊥b =
a = ⊥
b = ⊥b =
a =
Backtracking on b =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b = ⊥b =
a = ⊥
b = ⊥b =
a =
No more paths to explore: formula unsatisfiable
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
The Enhanced DPLL Procedure
Enhancements
• Splitting heuristics : choosing the “right” variable to split upon can
make a great difference
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
The Enhanced DPLL Procedure
Enhancements
• Splitting heuristics : choosing the “right” variable to split upon can
make a great difference
• Unit propagation : if a clause has all literals but one to ⊥, assign
the remaining literal to
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
The Enhanced DPLL Procedure
Enhancements
• Splitting heuristics : choosing the “right” variable to split upon can
make a great difference
• Unit propagation : if a clause has all literals but one to ⊥, assign
the remaining literal to
• E.g.: the assignment a = , b = ⊥ in (¬a ∨ b ∨ c) triggers c = .
Otherwise the clause cannot be satisfied
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
The Enhanced DPLL Procedure
Enhancements
• Splitting heuristics : choosing the “right” variable to split upon can
make a great difference
• Unit propagation : if a clause has all literals but one to ⊥, assign
the remaining literal to
• E.g.: the assignment a = , b = ⊥ in (¬a ∨ b ∨ c) triggers c = .
Otherwise the clause cannot be satisfied
• A set of unit propagations may result in a conflict . E.g. a = ,
b = ⊥
(¬a ∨ b ∨ c), (¬a ∨ ¬c)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
The Enhanced DPLL Procedure
Enhancements
• Splitting heuristics : choosing the “right” variable to split upon can
make a great difference
• Unit propagation : if a clause has all literals but one to ⊥, assign
the remaining literal to
• E.g.: the assignment a = , b = ⊥ in (¬a ∨ b ∨ c) triggers c = .
Otherwise the clause cannot be satisfied
• A set of unit propagations may result in a conflict . E.g. a = ,
b = ⊥
(¬a ∨ b ∨ c), (¬a ∨ ¬c)
• Conflict-Driven Clause Learning (mid ’90s): conflict is analyzed
and a new (implied) clause is derived and added to the problem.
Huge impact on SAT-Solvers performance
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
a =
Splitting on a =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b)
b =
a =
Unit Propagation on b =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a)
b =
a =
Conflict analysis: (¬a ∨ b) ⊗ (¬a ∨ ¬b) ⇒ (¬a)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a)
a = ⊥
b =
a =
Unit Propagation on a = ⊥
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a)
b =
a = ⊥
b =
a =
Unit Propagation on b =
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure
Splitting and Backtracking
(a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a)
b =
a = ⊥
b =
a =
Conflict without splitting: formula unsatisfiable
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
The Enhanced DPLL Procedure (simplified)
while( not all variables assigned )
{
if ( UnitPropagation( ) == CONFLICT ) // DEDUCTION PHASE
{
level = ConflictAnalysisAndLearning( ) // DIAGNOSE+LEARN PHASE
if ( level == 0 )
return UNSAT
else
Backtrack( level )
}
else
Split( ) // DECIDE PHASE
}
return SAT
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 10 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
(¬e ∨ ¬f )
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
(¬e ∨ ¬f ) (¬d ∨ f ∨ k)
f
(¬e ∨ ¬d ∨ k)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
(¬e ∨ ¬f ) (¬d ∨ f ∨ k)
f
(¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j)
e
(¬d ∨ j ∨ k)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
(¬e ∨ ¬f ) (¬d ∨ f ∨ k)
f
(¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j)
e
(¬d ∨ j ∨ k) (¬b ∨ ¬c ∨ d)
d
(¬b ∨ ¬c ∨ j ∨ k)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
(¬e ∨ ¬f ) (¬d ∨ f ∨ k)
f
(¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j)
e
(¬d ∨ j ∨ k) (¬b ∨ ¬c ∨ d)
d
(¬b ∨ ¬c ∨ j ∨ k) (¬a ∨ c ∨ i)
c
(¬b ∨ ¬a ∨ j ∨ k ∨ i)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
l = . . .
m = . . .
a = SPLIT
b = (¬a ∨ b)
c = (¬a ∨ c ∨ i)
d = (¬b ∨ ¬c ∨ d)
e = (¬d ∨ e ∨ j)
f = (¬d ∨ f ∨ k)
(¬e ∨ ¬f ) (¬d ∨ f ∨ k)
f
(¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j)
e
(¬d ∨ j ∨ k) (¬b ∨ ¬c ∨ d)
d
(¬b ∨ ¬c ∨ j ∨ k) (¬a ∨ c ∨ i)
c
(¬b ∨ ¬a ∨ j ∨ k ∨ i) (¬a ∨ b)
b
(¬a ∨ j ∨ k ∨ i)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
(¬a ∨ j ∨ k ∨ i)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 12 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
(¬a ∨ j ∨ k ∨ i)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
a = ⊥ (¬a ∨ j ∨ k ∨ i)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 12 / 32
Conflict Analysis and Learning
. . . after a shot of UnitPropagation( )
Clause set
(¬a ∨ b)
(¬a ∨ c ∨ i)
(¬b ∨ ¬c ∨ d)
(¬d ∨ e ∨ j)
(¬d ∨ f ∨ k)
(¬e ∨ ¬f )
(a ∨ g ∨ ¬l)
(a ∨ h)
(¬g ∨ ¬h ∨ ¬m)
(¬a ∨ j ∨ k ∨ i)
Assignment Reason
i = ⊥ . . .
j = ⊥ . . .
k = ⊥ . . .
a = ⊥ (¬a ∨ j ∨ k ∨ i)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 12 / 32
Importance of Learning
• Conflict analysis is important to understand where to backtrack in the
search
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
Importance of Learning
• Conflict analysis is important to understand where to backtrack in the
search
• Learning a clause (a ∨ b ∨ ¬c) prevents the SAT-Solver to search all
the assignments of the form {a = ⊥, b = ⊥, c = , . . .}
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
Importance of Learning
• Conflict analysis is important to understand where to backtrack in the
search
• Learning a clause (a ∨ b ∨ ¬c) prevents the SAT-Solver to search all
the assignments of the form {a = ⊥, b = ⊥, c = , . . .}
• It is an exponential pruning of the search space ! There are 2n−3
such assignments, where n is the number of variables in the problem
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
Importance of Learning
• Conflict analysis is important to understand where to backtrack in the
search
• Learning a clause (a ∨ b ∨ ¬c) prevents the SAT-Solver to search all
the assignments of the form {a = ⊥, b = ⊥, c = , . . .}
• It is an exponential pruning of the search space ! There are 2n−3
such assignments, where n is the number of variables in the problem
• We can refer to a learnt clause as to a blocking clause .
Understanding this mechanism is crucial to understand SMT as well
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
SMT: Satisfiability Modulo Theories
In SMT we have
• A (decidable) theory T (e.g. linear integer arithmetic), over a
signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .})
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
SMT: Satisfiability Modulo Theories
In SMT we have
• A (decidable) theory T (e.g. linear integer arithmetic), over a
signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .})
• A set of Boolean variables a, b, . . ., with values in {⊥, } and a set
Theory variables x, y, . . . that may assume values in the domain of
T (e.g. Z)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
SMT: Satisfiability Modulo Theories
In SMT we have
• A (decidable) theory T (e.g. linear integer arithmetic), over a
signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .})
• A set of Boolean variables a, b, . . ., with values in {⊥, } and a set
Theory variables x, y, . . . that may assume values in the domain of
T (e.g. Z)
• A theory atom is a predicate in T (e.g. x + y < 3)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
SMT: Satisfiability Modulo Theories
In SMT we have
• A (decidable) theory T (e.g. linear integer arithmetic), over a
signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .})
• A set of Boolean variables a, b, . . ., with values in {⊥, } and a set
Theory variables x, y, . . . that may assume values in the domain of
T (e.g. Z)
• A theory atom is a predicate in T (e.g. x + y < 3)
• Given a formula ϕ in T, is there an assignment to the Boolean and
Theory variables such that ϕ evaluates to ?
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
SMT: Satisfiability Modulo Theories
In SMT we have
• A (decidable) theory T (e.g. linear integer arithmetic), over a
signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .})
• A set of Boolean variables a, b, . . ., with values in {⊥, } and a set
Theory variables x, y, . . . that may assume values in the domain of
T (e.g. Z)
• A theory atom is a predicate in T (e.g. x + y < 3)
• Given a formula ϕ in T, is there an assignment to the Boolean and
Theory variables such that ϕ evaluates to ?
• E.g. ((x + y = 3 ∨ ¬a) ∧ y ≤ 1), is satisfied, for instance, by the
assignment {x = 2, y = 1, a = }
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(x − y ≤ 3 ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(x − y ≤ 3 ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
a ≡ x − y ≤ 3
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
a ≡ x − y ≤ 3
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
Consider
(a) x − y ≤ 3
(c) y − z ≤ 5
(e) z − x ≤ −15
0 ≤ −7
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
(¬a ∨ ¬c ∨ ¬e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
Consider
(a) x − y ≤ 3
(c) y − z ≤ 5
(e) z − x ≤ −15
0 ≤ −7
i.e. a ∧ c ∧ e is unsatisfiable in T
i.e. (¬a ∨ ¬c ∨ ¬e) is valid in T
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
(¬a ∨ ¬c ∨ ¬e)
(¬a ∨ ¬d ∨ ¬e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
(¬a ∨ ¬c ∨ ¬e)
(¬a ∨ ¬d ∨ ¬e)
. . .
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
(¬a ∨ ¬c ∨ ¬e)
(¬a ∨ ¬d ∨ ¬e)
. . .
(a ∨ ¬b)
. . .
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
• Reduce the SMT problem to a purely SAT problem
• Step 1: compute the Boolean abstraction of the problem
• Step 2: exhaustively add blocking clauses representing theory incompatibilities
• Step 3: send the formula to a SAT-Solver
(a ∨ b)
(c ∨ d)
(e)
(¬a ∨ ¬c ∨ ¬e)
(¬a ∨ ¬d ∨ ¬e)
. . .
(a ∨ ¬b)
. . .
The SAT formula is satisfiable iff the original
SMT formula is.
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
The Eager Approach
Drawbacks
• Inconsistencies between theory atoms have to be computed upfront
• There are exponentially many potential inconsistencies to test
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 16 / 32
The Eager Approach
Drawbacks
• Inconsistencies between theory atoms have to be computed upfront
• There are exponentially many potential inconsistencies to test
• However in general only a small subset of all inconsistencies is
sufficient to determine the satisfiability of an SMT formula
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 16 / 32
The Eager Approach
Drawbacks
• Inconsistencies between theory atoms have to be computed upfront
• There are exponentially many potential inconsistencies to test
• However in general only a small subset of all inconsistencies is
sufficient to determine the satisfiability of an SMT formula
• From eager to lazy: try to add clauses “lazily” to the Boolean
abstraction
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 16 / 32
The Lazy or DPLL(T) approach
((x + y = 3 ∨ ¬a) ∧ y ≤ 1)
• Decision procedures for T are usually available for conjunctions
of constraints. Examples
• Union-find for Equality with Uninterpreted Functions
• Simplex algorithm for Linear Rational Arithmetic
• . . .
• However disjunction has to be taken into account . . .
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 17 / 32
The Lazy or DPLL(T) approach
((x + y = 3 ∨ ¬a) ∧ y ≤ 1)
• Decision procedures for T are usually available for conjunctions
of constraints. Examples
• Union-find for Equality with Uninterpreted Functions
• Simplex algorithm for Linear Rational Arithmetic
• . . .
• However disjunction has to be taken into account . . .
• Idea: use a SAT-Solver to enumerate potential propositional
assignments, and use Theory-Solver to check feasibility in T
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 17 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(x − y ≤ 3 ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
SAT-Solver Theory-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(x − y ≤ 3 ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
SAT-Solver Theory-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
a ≡ x − y ≤ 3
SAT-Solver Theory-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ x − y ≤ −1)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
a ≡ x − y ≤ 3
SAT-Solver Theory-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(y − z ≤ 5 ∨ y − z ≤ 4)
(z − x ≤ −15)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
SAT-Solver Theory-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
SAT-Solver Theory-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
SAT-Solver
e =
Theory-Solver
z − x ≤ −15
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
SAT-Solver
a =
e =
Theory-Solver
z − x ≤ −15
x − y ≤ 3
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
SAT-Solver
c =
a =
e =
Theory-Solver
z − x ≤ −15
x − y ≤ 3
y − z ≤ 5
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(c ∨ d)
(e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
SAT-Solver
c =
a =
e =
Theory-Solver
z − x ≤ −15
x − y ≤ 3
y − z ≤ 5
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Lazy Approach
• Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T
• Step 1: compute the Boolean abstraction of the problem
• Repeat
• Step 2: guess a Boolean assignment
• Step 3: check the assignment w.r.t. T
• Step 4: add a blocking clause if the assignemt is not consistent in T
(a ∨ b)
(c ∨ d)
(e)
(¬a ∨ ¬c ∨ ¬e)
a ≡ x − y ≤ 3
b ≡ x − y ≤ −1
c ≡ y − z ≤ 5
d ≡ y − z ≤ 4
e ≡ z − x ≤ −15
SAT-Solver
c =
a =
e =
Theory-Solver
z − x ≤ −15
x − y ≤ 3
y − z ≤ 5
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
The Enhanced DPLL Procedure (simplified)
while( not all variables assigned )
{
if ( UnitPropagation( ) == CONFLICT ) // DEDUCTION PHASE
{
level = ConflictAnalysisAndLearning( ) // DIAGNOSE+LEARN PHASE
if ( level == 0 )
return UNSAT
else
Backtrack( level )
}
else
Split( ) // DECIDE PHASE
}
return SAT
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 19 / 32
The Enhanced DPLL Procedure (simplified)
while( not all variables assigned )
{
if ( UnitPropagation( ) == CONFLICT // DEDUCTION PHASE
|| CheckTheory( ) == CONFLICT ) // CALLS THEORY SOLVER
{
level = ConflictAnalysisAndLearning( ) // DIAGNOSE+LEARN PHASE
if ( level == 0 )
return UNSAT
else
Backtrack( level )
}
else
Split( ) // DECIDE PHASE
}
return SAT
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 20 / 32
The Theory Solver
• Keeps a set of active constraints, that are received and dropped in a
stack-based manner
• From time to time checks whether the set is theory-consistent
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 21 / 32
The Theory Solver
• Keeps a set of active constraints, that are received and dropped in a
stack-based manner
• From time to time checks whether the set is theory-consistent
• The Theory Solver performance is crucial for the overall SMT-Solver
performance
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 21 / 32
The Theory Solver
• Keeps a set of active constraints, that are received and dropped in a
stack-based manner
• From time to time checks whether the set is theory-consistent
• The Theory Solver performance is crucial for the overall SMT-Solver
performance
• (Some) Desirable features:
• Incrementality & Backtrackability
• Conflict Producing
• Theory Propagation
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 21 / 32
A Theory Solver for Difference Logics
• In Difference Logic theory atoms are of the form
x − y ≤ c
where x and y are integer or rational variables, and c is a constant
• Useful to encode, for instance, scheduling problems and timed
automata
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 22 / 32
A Theory Solver for Difference Logics
• In Difference Logic theory atoms are of the form
x − y ≤ c
where x and y are integer or rational variables, and c is a constant
• Useful to encode, for instance, scheduling problems and timed
automata
• The problem of checking satisfiability can be turned into finding
negative cycles in a directed weighted graph
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 22 / 32
A Theory Solver for Difference Logics
• In Difference Logic theory atoms are of the form
x − y ≤ c
where x and y are integer or rational variables, and c is a constant
• Useful to encode, for instance, scheduling problems and timed
automata
• The problem of checking satisfiability can be turned into finding
negative cycles in a directed weighted graph
• Each variable is encoded as a node. A constraint x − y ≤ c is
encoded into the arc
y
c
x
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 22 / 32
A Theory Solver for Difference Logics
Example:
x − y ≤ 8
y − z ≤ −1
x − z ≤ −6
z − w ≤ 2
w − x ≤ −10
w − t ≤ 0
t − x ≤ 3
yx
−1
2
8
−6
z
wt
0
3 −10
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 23 / 32
A Theory Solver for Difference Logics
Example:
x − y ≤ 8
y − z ≤ −1
x − z ≤ −6
z − w ≤ 2
w − x ≤ −10
w − t ≤ 0
t − x ≤ 3
————–
0 ≤ −1
yx
−1
2
8
−6
z
wt
0
3 −10
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 23 / 32
Incremental Solving
• The ability of solving theory atoms incrementally, is extremely
important for efficiency
• The Theory-Solver “receives” theory atoms from the SAT-Solver
incrementally. A set of successful theory consistency checks is
therefore performed on a growing set of constraints
S0 ⊂ S1 ⊂ . . . ⊂ Sn
• When checking the consistency of Si we want the solver to reuse the
effort of step Si−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 24 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
y
−1
2
8
−6
z
−9
x
w
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
?0
−1
2
8
−6
?
?
−9
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
?
?
−9
8
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
?
−9
8
7
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
?
−9
8
7
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
?
−9
8
7
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
−9
8
7
9
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
−9
8
7
9
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
0
−1
2
8
−6
−9
8
7
9
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
?
0
−10
0
−1
2
8
−6
−9
8
7
9
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
0
−1
2
8
−6
−9
8
7
9
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
8
7
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
7
6
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
7
6
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Incremental Solving in Difference Logic
• In Difference Logic incremental consistency check can be performed
with a SSSP algorithm (single source shortest path), such as the
Bellman-Ford algorithm or its variations
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
7
6
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
Retrieving Conflict
• The set of conflicting atoms is usually a small subset of all the set of
atoms under consideration
• The smaller the confict, the better (more search space is pruned away)
• In Difference Logic it is sufficient to keep track of a parent
information in the graph
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
7
6
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 26 / 32
Retrieving Conflict
• The set of conflicting atoms is usually a small subset of all the set of
atoms under consideration
• The smaller the confict, the better (more search space is pruned away)
• In Difference Logic it is sufficient to keep track of a parent
information in the graph
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
7
6
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 26 / 32
Retrieving Conflict
• The set of conflicting atoms is usually a small subset of all the set of
atoms under consideration
• The smaller the confict, the better (more search space is pruned away)
• In Difference Logic it is sufficient to keep track of a parent
information in the graph
x − y ≤ 8
y − z ≤ −1
z − x ≤ −6
z − w ≤ 2
w − x ≤ −9
w − t ≤ 0
t − x ≤ −10
0
−10
9
−1
2
8
−6
−9
7
6
9
−1
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 26 / 32
Theory Propagation
• We use the current state of the Theory Solver to infer the truth of
other theory atoms
• (it is the “theory” counterpart of UnitPropagation for Booleans)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
Theory Propagation
• We use the current state of the Theory Solver to infer the truth of
other theory atoms
• (it is the “theory” counterpart of UnitPropagation for Booleans)
• Suppose we have the following situation:
• x − y ≤ 1 and y − z ≤ 2 are both assigned to
• x − z ≤ 5 is part of the initial formula but is currently not assigned a
value by the SAT-Solver
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
Theory Propagation
• We use the current state of the Theory Solver to infer the truth of
other theory atoms
• (it is the “theory” counterpart of UnitPropagation for Booleans)
• Suppose we have the following situation:
• x − y ≤ 1 and y − z ≤ 2 are both assigned to
• x − z ≤ 5 is part of the initial formula but is currently not assigned a
value by the SAT-Solver
• However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
Theory Propagation
• We use the current state of the Theory Solver to infer the truth of
other theory atoms
• (it is the “theory” counterpart of UnitPropagation for Booleans)
• Suppose we have the following situation:
• x − y ≤ 1 and y − z ≤ 2 are both assigned to
• x − z ≤ 5 is part of the initial formula but is currently not assigned a
value by the SAT-Solver
• However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5)
• (or, in clausal form (¬(x − y ≤ 1) ∨ ¬(y − z ≤ 2) ∨ (x − z ≤ 5)))
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
Theory Propagation
• We use the current state of the Theory Solver to infer the truth of
other theory atoms
• (it is the “theory” counterpart of UnitPropagation for Booleans)
• Suppose we have the following situation:
• x − y ≤ 1 and y − z ≤ 2 are both assigned to
• x − z ≤ 5 is part of the initial formula but is currently not assigned a
value by the SAT-Solver
• However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5)
• (or, in clausal form (¬(x − y ≤ 1) ∨ ¬(y − z ≤ 2) ∨ (x − z ≤ 5)))
• Adding the clause to the SAT-Solver will cause the atom (x − z ≤ 5)
to be assigned to
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
Theory Propagation
• We use the current state of the Theory Solver to infer the truth of
other theory atoms
• (it is the “theory” counterpart of UnitPropagation for Booleans)
• Suppose we have the following situation:
• x − y ≤ 1 and y − z ≤ 2 are both assigned to
• x − z ≤ 5 is part of the initial formula but is currently not assigned a
value by the SAT-Solver
• However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5)
• (or, in clausal form (¬(x − y ≤ 1) ∨ ¬(y − z ≤ 2) ∨ (x − z ≤ 5)))
• Adding the clause to the SAT-Solver will cause the atom (x − z ≤ 5)
to be assigned to
constraint is not assigned
y
z
1 2
5
x
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
Summing up
• Lazy SMT is the efficient combination of
• SAT-Solving techniques (DPLL procedure)
• Decision procedures for decidable first order theories
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
Summing up
• Lazy SMT is the efficient combination of
• SAT-Solving techniques (DPLL procedure)
• Decision procedures for decidable first order theories
• Intuitively, the SAT-Solver guesses a particular assignment of theory
atoms
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
Summing up
• Lazy SMT is the efficient combination of
• SAT-Solving techniques (DPLL procedure)
• Decision procedures for decidable first order theories
• Intuitively, the SAT-Solver guesses a particular assignment of theory
atoms
• while the Theory-Solver checks whether the assignment is correct in
the theory
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
Summing up
• Lazy SMT is the efficient combination of
• SAT-Solving techniques (DPLL procedure)
• Decision procedures for decidable first order theories
• Intuitively, the SAT-Solver guesses a particular assignment of theory
atoms
• while the Theory-Solver checks whether the assignment is correct in
the theory
• The Theory-Solver can communicate with SAT by means of clauses
that represent valid statements in the theory
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
Summing up
The Theory-Solver is required to
• Solve theory atoms incrementally
• Produce conflicts
• Produce theory propagations (deduce thruth value of unassigned
theory atoms, based on the currently assigned ones)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 29 / 32
Some theories of interest in Formal Verification
• Equality and Uninterpreted Functions [19, 15]
• Difference Logics [18, 12, 6]
• Linear Rational Arithmetic [6, 16]
• Linear Integer Arithmetic [6, 16]
• Bit-Vectors [17, 2, 7, 11]
• Arrays [4, 2, 14]
• Combination of Theories [15, 5, 9]
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 30 / 32
Some available SMT-Solvers
• Barcelogic, (Barcelona, Spain) [3]
• CVC3, (NYU, New York, USA) [1]
• MathSAT, (FBK, Trento (Italy) [8]
• OpenSMT, (Lugano, Switzerland) [10]
• Yices, (SRI International, USA)
• Z3, (Microsoft Research, Redmond, USA) [13]
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 31 / 32
SMT-LIB
• The SMT-LIB (www.smtlib.org) is an initiative that
promotes the collection of SMT benchmarks, and the
definition of a common input language for SMT-Solvers
• The SMT-COMP is an annual competition of SMT-Solvers on
a common set of benchmarks. Usually affiliated with
CAV or CADE conferences (www.smtcomp.org)
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
C. Barrett and C. Tinelli.
CVC3.
In CAV’07, 2007.
A. Biere and R. Brummayer.
The Boolector SMT Solver.
In TACAS, 2009.
M. Bofill, R. Nieuwenhuis, A. Oliveras, E. Rodr´ıguez Carbonell, and
A. Rubio.
The Barcelogic SMT Solver.
In A. Gupta and S. Malik, editors, CAV’08, volume 5123 of Lecture
Notes in Computer Science, pages 294–298. Springer, 2008.
M. Bofill, R. Nieuwenhuis, A. Oliveras, E. Rodrguez-Carbonell, and
A. Rubio.
A Write-Based Solver for SAT Modulo the Theory of Arrays.
In FMCAD, pages 101–108, 2008.
M. Bozzano, R. Bruttomesso, A. Cimatti, T. Junttila, S. Ranise,
P. van Rossum, and R. Sebastiani.
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
Efficient Theory Combination via Boolean Search.
Information Computation, 204(10):1493–1525, 2006.
M. Bozzano, R. Bruttomesso, A. Cimatti, T. Junttila, P. van Rossum,
S. Schulz, and R. Sebastiani.
MathSAT: Tight Integration of SAT and Mathematical Decision
Procedures.
JAR, 35(1-3):265–293, 2005.
R. Bruttomesso, A. Cimatti, A. Franzen, A. Griggio, Z. Hanna,
A. Nadel, A. Palti, and R. Sebastiani.
A Lazy and Layered SMT(BV) Solver for Hard Industrial Verification
Problems.
In CAV, pages 247–260, 2007.
R. Bruttomesso, A. Cimatti, A. Franz´en, A. Griggio, and
R. Sebastiani.
The MathSAT 4 SMT Solver.
In CAV, pages 299–303, 2008.
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
R. Bruttomesso, A. Cimatti, A. Franzen, A. Griggio, and
R. Sebastiani.
Delayed theory combination vs. Nelson-Oppen for satisfiability modulo
theories: a comparative analysis.
Annals of Mathematics and Artificial Intelligence, 2009.
R. Bruttomesso, E. Pek, N. Sharygina, and A. Tsitovich.
The OpenSMT Solver.
In TACAS, 2010.
R. Bruttomesso and N. Sharygina.
A Scalable Decision Procedure for Fixed-Width Bit-Vectors.
In ICCAD, 2009.
S. Cotton and O. Maler.
Fast and Flexible Difference Constraint Propagation for DPLL(T).
In SAT’06, pages 170–183, 2006.
L. de Moura and N. Bjørner.
Z3: An Efficient SMT Solver.
In TACAS’08, pages 337–340, 2008.
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
L. de Moura and N. Bjørner.
Generalized, Efficient Array Decision Procedures.
In FMCAD, 2009.
D. Detlefs, G. Nelson, and J. B. Saxe.
Simplify: a theorem prover for program checking.
Journal of ACM, 52(3):365–473, 2005.
B. Dutertre and L. M. de Moura.
A Fast Linear-Arithmetic Solver for DPLL(T).
In CAV’06, pages 81–94, 2006.
V. Ganesh and D. L. Dill.
A Decision Procedure for Bit-Vectors and Arrays.
In CAV, pages 519–531, 2007.
R. Nieuwenhuis and A. Oliveras.
DPLL(T) with Exhaustive Theory Propagation and Its Application to
Difference Logic.
In CAV’05, pages 321–334, 2005.
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
R. Nieuwenhuis and A. Oliveras.
Proof-Producing Congruence Closure.
In RTA’05, pages 453–468, 2005.
Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32

More Related Content

Similar to satandsmt.stpetersburg

Monte Carlo Tree Search in 2014 (MCMC days in Marseille)
Monte Carlo Tree Search in 2014 (MCMC days in Marseille)Monte Carlo Tree Search in 2014 (MCMC days in Marseille)
Monte Carlo Tree Search in 2014 (MCMC days in Marseille)Olivier Teytaud
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationMasahiro Sakai
 
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...robocupathomeedu
 
Top quark physics at the LHC
Top quark physics at the LHCTop quark physics at the LHC
Top quark physics at the LHCAkira Shibata
 
Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...
Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...
Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...Mokhtar SELLAMI
 
A Matrix Based Approach for Weighted Argumentation Frameworks
A Matrix Based Approach for Weighted Argumentation FrameworksA Matrix Based Approach for Weighted Argumentation Frameworks
A Matrix Based Approach for Weighted Argumentation FrameworksCarlo Taticchi
 
TATI - A Logo-like interface for microworlds and simulations for physics teac...
TATI - A Logo-like interface for microworlds and simulations for physics teac...TATI - A Logo-like interface for microworlds and simulations for physics teac...
TATI - A Logo-like interface for microworlds and simulations for physics teac...Renato P. dos Santos
 
Guaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTsGuaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTsSun-Li Beatteay
 
Seminar for verkehr
Seminar for verkehrSeminar for verkehr
Seminar for verkehrBruno Fiss
 
Which transient when? - A utility function for transient follow-up scheduling
Which transient when? - A utility function for transient follow-up schedulingWhich transient when? - A utility function for transient follow-up scheduling
Which transient when? - A utility function for transient follow-up schedulingTim Staley
 
Writing a SAT solver as a hobby project
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby projectMasahiro Sakai
 
Track Finding in LHCb's 2020 Trigger
Track Finding in LHCb's 2020 TriggerTrack Finding in LHCb's 2020 Trigger
Track Finding in LHCb's 2020 TriggerTimothy Head
 

Similar to satandsmt.stpetersburg (20)

20100822 opensmt bruttomesso
20100822 opensmt bruttomesso20100822 opensmt bruttomesso
20100822 opensmt bruttomesso
 
smtlecture.3
smtlecture.3smtlecture.3
smtlecture.3
 
Monte Carlo Tree Search in 2014 (MCMC days in Marseille)
Monte Carlo Tree Search in 2014 (MCMC days in Marseille)Monte Carlo Tree Search in 2014 (MCMC days in Marseille)
Monte Carlo Tree Search in 2014 (MCMC days in Marseille)
 
smtlecture.4
smtlecture.4smtlecture.4
smtlecture.4
 
smtlectures.1
smtlectures.1smtlectures.1
smtlectures.1
 
smtlecture.10
smtlecture.10smtlecture.10
smtlecture.10
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT Evaluation
 
5 csp
5 csp5 csp
5 csp
 
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...
 
Top quark physics at the LHC
Top quark physics at the LHCTop quark physics at the LHC
Top quark physics at the LHC
 
Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...
Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...
Cari2020 Parallel Hybridization for SAT: An Efficient Combination of Search S...
 
Fine Grained Complexity
Fine Grained ComplexityFine Grained Complexity
Fine Grained Complexity
 
A Matrix Based Approach for Weighted Argumentation Frameworks
A Matrix Based Approach for Weighted Argumentation FrameworksA Matrix Based Approach for Weighted Argumentation Frameworks
A Matrix Based Approach for Weighted Argumentation Frameworks
 
TATI - A Logo-like interface for microworlds and simulations for physics teac...
TATI - A Logo-like interface for microworlds and simulations for physics teac...TATI - A Logo-like interface for microworlds and simulations for physics teac...
TATI - A Logo-like interface for microworlds and simulations for physics teac...
 
Guaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTsGuaranteeing Consensus in Distriubuted Systems with CRDTs
Guaranteeing Consensus in Distriubuted Systems with CRDTs
 
Seminar for verkehr
Seminar for verkehrSeminar for verkehr
Seminar for verkehr
 
Which transient when? - A utility function for transient follow-up scheduling
Which transient when? - A utility function for transient follow-up schedulingWhich transient when? - A utility function for transient follow-up scheduling
Which transient when? - A utility function for transient follow-up scheduling
 
1notes
1notes1notes
1notes
 
Writing a SAT solver as a hobby project
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby project
 
Track Finding in LHCb's 2020 Trigger
Track Finding in LHCb's 2020 TriggerTrack Finding in LHCb's 2020 Trigger
Track Finding in LHCb's 2020 Trigger
 

More from Roberto Bruttomesso (6)

smtlecture.9
smtlecture.9smtlecture.9
smtlecture.9
 
smtlecture.8
smtlecture.8smtlecture.8
smtlecture.8
 
smtlecture.7
smtlecture.7smtlecture.7
smtlecture.7
 
smtlecture.6
smtlecture.6smtlecture.6
smtlecture.6
 
smtlecture.5
smtlecture.5smtlecture.5
smtlecture.5
 
smtlectures.2
smtlectures.2smtlectures.2
smtlectures.2
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 

satandsmt.stpetersburg

  • 1. SAT and Satisfiability Modulo Theories Roberto Bruttomesso roberto.bruttomesso@gmail.com University of Lugano, Switzerland (Universit`a della Svizzera Italiana) St.Petersburg September 18, 2010 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 1 / 32
  • 2. Outline 1 Introduction 2 SAT SAT and SAT-Solvers The DPLL Procedure The Enhanced DPLL Procedure Conflict Analysis and Learning 3 SMT From SAT to SMT The Eager Approach The Lazy Approach The Theory Solver 4 Conclusive Remarks Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 2 / 32
  • 3. Efficient Solvers as Core Engines SAT SMT Theorem Proving BDDs Testing Automated Model Checking Checking Equiv. Planning Dependency Analysis Security Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 3 / 32
  • 4. Bird’s Eye View expressiveness efficiency decidable undecidable BDDs SAT−Solvers SMT−Solvers First Order Theorem Provers Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 4 / 32
  • 5. SAT • SAT is the Boolean Satisfiability Problem Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 6. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 7. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } • A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g. ∧ ⊥ is ⊥) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 8. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } • A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g. ∧ ⊥ is ⊥) • Given a formula ϕ, is there an assignment to the variables such that ϕ evaluates to ? Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 9. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } • A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g. ∧ ⊥ is ⊥) • Given a formula ϕ, is there an assignment to the variables such that ϕ evaluates to ? • E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥ Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 10. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } • A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g. ∧ ⊥ is ⊥) • Given a formula ϕ, is there an assignment to the variables such that ϕ evaluates to ? • E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥ • Simple formulation, but enormous relevance in computer science Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 11. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } • A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g. ∧ ⊥ is ⊥) • Given a formula ϕ, is there an assignment to the variables such that ϕ evaluates to ? • E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥ • Simple formulation, but enormous relevance in computer science • “Classical” NP-Complete problem Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 12. SAT • SAT is the Boolean Satisfiability Problem • A set of Boolean variables {a, b, . . .} which may assume values in {⊥, } • A set of Boolean operators {∧, ∨, ¬, . . .} with known semantic (e.g. ∧ ⊥ is ⊥) • Given a formula ϕ, is there an assignment to the variables such that ϕ evaluates to ? • E.g. (a ∨ b) ∧ (¬a ∨ ¬b) is satisfied by the assignment a = , b = ⊥ • Simple formulation, but enormous relevance in computer science • “Classical” NP-Complete problem • A lot of practical problems can be encoded in SAT Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 5 / 32
  • 13. The DPLL Procedure • Remember SAT is NP-Complete Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
  • 14. The DPLL Procedure • Remember SAT is NP-Complete • Still, SAT-Solvers are extremely efficient tools (nowadays), and can handle (within reasonable time) hundred thousands of variables and clauses∗ Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
  • 15. The DPLL Procedure • Remember SAT is NP-Complete • Still, SAT-Solvers are extremely efficient tools (nowadays), and can handle (within reasonable time) hundred thousands of variables and clauses∗ • SOTA Solvers are based on the DPLL procedure (Davis Putnam Loveland Longman, ∼1960) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
  • 16. The DPLL Procedure • Remember SAT is NP-Complete • Still, SAT-Solvers are extremely efficient tools (nowadays), and can handle (within reasonable time) hundred thousands of variables and clauses∗ • SOTA Solvers are based on the DPLL procedure (Davis Putnam Loveland Longman, ∼1960) • DPLL assumes the input as a CNF , i.e. a set of clauses , each clause being a disjuntion of variables or negated variables (a ∨ ¬b) (c ∨ ¬a ∨ b) . . . Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 6 / 32
  • 17. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 18. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) a = Splitting on a = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 19. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = a = Splitting on b = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 20. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = a = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 21. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = ⊥b = a = Backtracking on b = ⊥ Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 22. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = ⊥b = a = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 23. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) a = ⊥ b = ⊥b = a = Backtracking on a = ⊥ Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 24. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = a = ⊥ b = ⊥b = a = Splitting on b = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 25. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = a = ⊥ b = ⊥b = a = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 26. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = ⊥b = a = ⊥ b = ⊥b = a = Backtracking on b = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 27. The DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = ⊥b = a = ⊥ b = ⊥b = a = No more paths to explore: formula unsatisfiable Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 7 / 32
  • 28. The Enhanced DPLL Procedure Enhancements • Splitting heuristics : choosing the “right” variable to split upon can make a great difference Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
  • 29. The Enhanced DPLL Procedure Enhancements • Splitting heuristics : choosing the “right” variable to split upon can make a great difference • Unit propagation : if a clause has all literals but one to ⊥, assign the remaining literal to Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
  • 30. The Enhanced DPLL Procedure Enhancements • Splitting heuristics : choosing the “right” variable to split upon can make a great difference • Unit propagation : if a clause has all literals but one to ⊥, assign the remaining literal to • E.g.: the assignment a = , b = ⊥ in (¬a ∨ b ∨ c) triggers c = . Otherwise the clause cannot be satisfied Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
  • 31. The Enhanced DPLL Procedure Enhancements • Splitting heuristics : choosing the “right” variable to split upon can make a great difference • Unit propagation : if a clause has all literals but one to ⊥, assign the remaining literal to • E.g.: the assignment a = , b = ⊥ in (¬a ∨ b ∨ c) triggers c = . Otherwise the clause cannot be satisfied • A set of unit propagations may result in a conflict . E.g. a = , b = ⊥ (¬a ∨ b ∨ c), (¬a ∨ ¬c) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
  • 32. The Enhanced DPLL Procedure Enhancements • Splitting heuristics : choosing the “right” variable to split upon can make a great difference • Unit propagation : if a clause has all literals but one to ⊥, assign the remaining literal to • E.g.: the assignment a = , b = ⊥ in (¬a ∨ b ∨ c) triggers c = . Otherwise the clause cannot be satisfied • A set of unit propagations may result in a conflict . E.g. a = , b = ⊥ (¬a ∨ b ∨ c), (¬a ∨ ¬c) • Conflict-Driven Clause Learning (mid ’90s): conflict is analyzed and a new (implied) clause is derived and added to the problem. Huge impact on SAT-Solvers performance Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 8 / 32
  • 33. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 34. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) a = Splitting on a = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 35. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) b = a = Unit Propagation on b = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 36. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a) b = a = Conflict analysis: (¬a ∨ b) ⊗ (¬a ∨ ¬b) ⇒ (¬a) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 37. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a) a = ⊥ b = a = Unit Propagation on a = ⊥ Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 38. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a) b = a = ⊥ b = a = Unit Propagation on b = Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 39. The Enhanced DPLL Procedure Splitting and Backtracking (a ∨ b) (¬a ∨ b) (a ∨ ¬b) (¬a ∨ ¬b) (¬a) b = a = ⊥ b = a = Conflict without splitting: formula unsatisfiable Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 9 / 32
  • 40. The Enhanced DPLL Procedure (simplified) while( not all variables assigned ) { if ( UnitPropagation( ) == CONFLICT ) // DEDUCTION PHASE { level = ConflictAnalysisAndLearning( ) // DIAGNOSE+LEARN PHASE if ( level == 0 ) return UNSAT else Backtrack( level ) } else Split( ) // DECIDE PHASE } return SAT Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 10 / 32
  • 41. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 42. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 43. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 44. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 45. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 46. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 47. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 48. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) (¬e ∨ ¬f ) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 49. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (¬d ∨ f ∨ k) f (¬e ∨ ¬d ∨ k) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 50. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (¬d ∨ f ∨ k) f (¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j) e (¬d ∨ j ∨ k) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 51. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (¬d ∨ f ∨ k) f (¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j) e (¬d ∨ j ∨ k) (¬b ∨ ¬c ∨ d) d (¬b ∨ ¬c ∨ j ∨ k) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 52. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (¬d ∨ f ∨ k) f (¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j) e (¬d ∨ j ∨ k) (¬b ∨ ¬c ∨ d) d (¬b ∨ ¬c ∨ j ∨ k) (¬a ∨ c ∨ i) c (¬b ∨ ¬a ∨ j ∨ k ∨ i) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 53. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . l = . . . m = . . . a = SPLIT b = (¬a ∨ b) c = (¬a ∨ c ∨ i) d = (¬b ∨ ¬c ∨ d) e = (¬d ∨ e ∨ j) f = (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (¬d ∨ f ∨ k) f (¬e ∨ ¬d ∨ k) (¬d ∨ e ∨ j) e (¬d ∨ j ∨ k) (¬b ∨ ¬c ∨ d) d (¬b ∨ ¬c ∨ j ∨ k) (¬a ∨ c ∨ i) c (¬b ∨ ¬a ∨ j ∨ k ∨ i) (¬a ∨ b) b (¬a ∨ j ∨ k ∨ i) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 11 / 32
  • 54. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) (¬a ∨ j ∨ k ∨ i) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 12 / 32
  • 55. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) (¬a ∨ j ∨ k ∨ i) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . a = ⊥ (¬a ∨ j ∨ k ∨ i) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 12 / 32
  • 56. Conflict Analysis and Learning . . . after a shot of UnitPropagation( ) Clause set (¬a ∨ b) (¬a ∨ c ∨ i) (¬b ∨ ¬c ∨ d) (¬d ∨ e ∨ j) (¬d ∨ f ∨ k) (¬e ∨ ¬f ) (a ∨ g ∨ ¬l) (a ∨ h) (¬g ∨ ¬h ∨ ¬m) (¬a ∨ j ∨ k ∨ i) Assignment Reason i = ⊥ . . . j = ⊥ . . . k = ⊥ . . . a = ⊥ (¬a ∨ j ∨ k ∨ i) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 12 / 32
  • 57. Importance of Learning • Conflict analysis is important to understand where to backtrack in the search Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
  • 58. Importance of Learning • Conflict analysis is important to understand where to backtrack in the search • Learning a clause (a ∨ b ∨ ¬c) prevents the SAT-Solver to search all the assignments of the form {a = ⊥, b = ⊥, c = , . . .} Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
  • 59. Importance of Learning • Conflict analysis is important to understand where to backtrack in the search • Learning a clause (a ∨ b ∨ ¬c) prevents the SAT-Solver to search all the assignments of the form {a = ⊥, b = ⊥, c = , . . .} • It is an exponential pruning of the search space ! There are 2n−3 such assignments, where n is the number of variables in the problem Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
  • 60. Importance of Learning • Conflict analysis is important to understand where to backtrack in the search • Learning a clause (a ∨ b ∨ ¬c) prevents the SAT-Solver to search all the assignments of the form {a = ⊥, b = ⊥, c = , . . .} • It is an exponential pruning of the search space ! There are 2n−3 such assignments, where n is the number of variables in the problem • We can refer to a learnt clause as to a blocking clause . Understanding this mechanism is crucial to understand SMT as well Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 13 / 32
  • 61. SMT: Satisfiability Modulo Theories In SMT we have • A (decidable) theory T (e.g. linear integer arithmetic), over a signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .}) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
  • 62. SMT: Satisfiability Modulo Theories In SMT we have • A (decidable) theory T (e.g. linear integer arithmetic), over a signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .}) • A set of Boolean variables a, b, . . ., with values in {⊥, } and a set Theory variables x, y, . . . that may assume values in the domain of T (e.g. Z) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
  • 63. SMT: Satisfiability Modulo Theories In SMT we have • A (decidable) theory T (e.g. linear integer arithmetic), over a signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .}) • A set of Boolean variables a, b, . . ., with values in {⊥, } and a set Theory variables x, y, . . . that may assume values in the domain of T (e.g. Z) • A theory atom is a predicate in T (e.g. x + y < 3) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
  • 64. SMT: Satisfiability Modulo Theories In SMT we have • A (decidable) theory T (e.g. linear integer arithmetic), over a signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .}) • A set of Boolean variables a, b, . . ., with values in {⊥, } and a set Theory variables x, y, . . . that may assume values in the domain of T (e.g. Z) • A theory atom is a predicate in T (e.g. x + y < 3) • Given a formula ϕ in T, is there an assignment to the Boolean and Theory variables such that ϕ evaluates to ? Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
  • 65. SMT: Satisfiability Modulo Theories In SMT we have • A (decidable) theory T (e.g. linear integer arithmetic), over a signature Σ (e.g. {+, −, ≤, =, 0, 1, . . .}) • A set of Boolean variables a, b, . . ., with values in {⊥, } and a set Theory variables x, y, . . . that may assume values in the domain of T (e.g. Z) • A theory atom is a predicate in T (e.g. x + y < 3) • Given a formula ϕ in T, is there an assignment to the Boolean and Theory variables such that ϕ evaluates to ? • E.g. ((x + y = 3 ∨ ¬a) ∧ y ≤ 1), is satisfied, for instance, by the assignment {x = 2, y = 1, a = } Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 14 / 32
  • 66. The Eager Approach • Reduce the SMT problem to a purely SAT problem Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 67. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 68. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 69. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 70. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (x − y ≤ 3 ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 71. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (x − y ≤ 3 ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 72. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) a ≡ x − y ≤ 3 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 73. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) a ≡ x − y ≤ 3 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 74. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 75. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 76. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 Consider (a) x − y ≤ 3 (c) y − z ≤ 5 (e) z − x ≤ −15 0 ≤ −7 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 77. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) (¬a ∨ ¬c ∨ ¬e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 Consider (a) x − y ≤ 3 (c) y − z ≤ 5 (e) z − x ≤ −15 0 ≤ −7 i.e. a ∧ c ∧ e is unsatisfiable in T i.e. (¬a ∨ ¬c ∨ ¬e) is valid in T Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 78. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) (¬a ∨ ¬c ∨ ¬e) (¬a ∨ ¬d ∨ ¬e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 79. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) (¬a ∨ ¬c ∨ ¬e) (¬a ∨ ¬d ∨ ¬e) . . . a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 80. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) (¬a ∨ ¬c ∨ ¬e) (¬a ∨ ¬d ∨ ¬e) . . . (a ∨ ¬b) . . . a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 81. The Eager Approach • Reduce the SMT problem to a purely SAT problem • Step 1: compute the Boolean abstraction of the problem • Step 2: exhaustively add blocking clauses representing theory incompatibilities • Step 3: send the formula to a SAT-Solver (a ∨ b) (c ∨ d) (e) (¬a ∨ ¬c ∨ ¬e) (¬a ∨ ¬d ∨ ¬e) . . . (a ∨ ¬b) . . . The SAT formula is satisfiable iff the original SMT formula is. Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 15 / 32
  • 82. The Eager Approach Drawbacks • Inconsistencies between theory atoms have to be computed upfront • There are exponentially many potential inconsistencies to test Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 16 / 32
  • 83. The Eager Approach Drawbacks • Inconsistencies between theory atoms have to be computed upfront • There are exponentially many potential inconsistencies to test • However in general only a small subset of all inconsistencies is sufficient to determine the satisfiability of an SMT formula Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 16 / 32
  • 84. The Eager Approach Drawbacks • Inconsistencies between theory atoms have to be computed upfront • There are exponentially many potential inconsistencies to test • However in general only a small subset of all inconsistencies is sufficient to determine the satisfiability of an SMT formula • From eager to lazy: try to add clauses “lazily” to the Boolean abstraction Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 16 / 32
  • 85. The Lazy or DPLL(T) approach ((x + y = 3 ∨ ¬a) ∧ y ≤ 1) • Decision procedures for T are usually available for conjunctions of constraints. Examples • Union-find for Equality with Uninterpreted Functions • Simplex algorithm for Linear Rational Arithmetic • . . . • However disjunction has to be taken into account . . . Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 17 / 32
  • 86. The Lazy or DPLL(T) approach ((x + y = 3 ∨ ¬a) ∧ y ≤ 1) • Decision procedures for T are usually available for conjunctions of constraints. Examples • Union-find for Equality with Uninterpreted Functions • Simplex algorithm for Linear Rational Arithmetic • . . . • However disjunction has to be taken into account . . . • Idea: use a SAT-Solver to enumerate potential propositional assignments, and use Theory-Solver to check feasibility in T Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 17 / 32
  • 87. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 88. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 89. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 90. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 91. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (x − y ≤ 3 ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) SAT-Solver Theory-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 92. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (x − y ≤ 3 ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) SAT-Solver Theory-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 93. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) a ≡ x − y ≤ 3 SAT-Solver Theory-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 94. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ x − y ≤ −1) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) a ≡ x − y ≤ 3 SAT-Solver Theory-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 95. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (y − z ≤ 5 ∨ y − z ≤ 4) (z − x ≤ −15) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 SAT-Solver Theory-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 96. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 SAT-Solver Theory-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 97. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 SAT-Solver e = Theory-Solver z − x ≤ −15 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 98. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 SAT-Solver a = e = Theory-Solver z − x ≤ −15 x − y ≤ 3 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 99. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 SAT-Solver c = a = e = Theory-Solver z − x ≤ −15 x − y ≤ 3 y − z ≤ 5 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 100. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (c ∨ d) (e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 SAT-Solver c = a = e = Theory-Solver z − x ≤ −15 x − y ≤ 3 y − z ≤ 5 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 101. The Lazy Approach • Enumerate Boolean combinations of theory atoms and check them w.r.t. the theory T • Step 1: compute the Boolean abstraction of the problem • Repeat • Step 2: guess a Boolean assignment • Step 3: check the assignment w.r.t. T • Step 4: add a blocking clause if the assignemt is not consistent in T (a ∨ b) (c ∨ d) (e) (¬a ∨ ¬c ∨ ¬e) a ≡ x − y ≤ 3 b ≡ x − y ≤ −1 c ≡ y − z ≤ 5 d ≡ y − z ≤ 4 e ≡ z − x ≤ −15 SAT-Solver c = a = e = Theory-Solver z − x ≤ −15 x − y ≤ 3 y − z ≤ 5 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 18 / 32
  • 102. The Enhanced DPLL Procedure (simplified) while( not all variables assigned ) { if ( UnitPropagation( ) == CONFLICT ) // DEDUCTION PHASE { level = ConflictAnalysisAndLearning( ) // DIAGNOSE+LEARN PHASE if ( level == 0 ) return UNSAT else Backtrack( level ) } else Split( ) // DECIDE PHASE } return SAT Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 19 / 32
  • 103. The Enhanced DPLL Procedure (simplified) while( not all variables assigned ) { if ( UnitPropagation( ) == CONFLICT // DEDUCTION PHASE || CheckTheory( ) == CONFLICT ) // CALLS THEORY SOLVER { level = ConflictAnalysisAndLearning( ) // DIAGNOSE+LEARN PHASE if ( level == 0 ) return UNSAT else Backtrack( level ) } else Split( ) // DECIDE PHASE } return SAT Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 20 / 32
  • 104. The Theory Solver • Keeps a set of active constraints, that are received and dropped in a stack-based manner • From time to time checks whether the set is theory-consistent Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 21 / 32
  • 105. The Theory Solver • Keeps a set of active constraints, that are received and dropped in a stack-based manner • From time to time checks whether the set is theory-consistent • The Theory Solver performance is crucial for the overall SMT-Solver performance Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 21 / 32
  • 106. The Theory Solver • Keeps a set of active constraints, that are received and dropped in a stack-based manner • From time to time checks whether the set is theory-consistent • The Theory Solver performance is crucial for the overall SMT-Solver performance • (Some) Desirable features: • Incrementality & Backtrackability • Conflict Producing • Theory Propagation Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 21 / 32
  • 107. A Theory Solver for Difference Logics • In Difference Logic theory atoms are of the form x − y ≤ c where x and y are integer or rational variables, and c is a constant • Useful to encode, for instance, scheduling problems and timed automata Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 22 / 32
  • 108. A Theory Solver for Difference Logics • In Difference Logic theory atoms are of the form x − y ≤ c where x and y are integer or rational variables, and c is a constant • Useful to encode, for instance, scheduling problems and timed automata • The problem of checking satisfiability can be turned into finding negative cycles in a directed weighted graph Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 22 / 32
  • 109. A Theory Solver for Difference Logics • In Difference Logic theory atoms are of the form x − y ≤ c where x and y are integer or rational variables, and c is a constant • Useful to encode, for instance, scheduling problems and timed automata • The problem of checking satisfiability can be turned into finding negative cycles in a directed weighted graph • Each variable is encoded as a node. A constraint x − y ≤ c is encoded into the arc y c x Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 22 / 32
  • 110. A Theory Solver for Difference Logics Example: x − y ≤ 8 y − z ≤ −1 x − z ≤ −6 z − w ≤ 2 w − x ≤ −10 w − t ≤ 0 t − x ≤ 3 yx −1 2 8 −6 z wt 0 3 −10 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 23 / 32
  • 111. A Theory Solver for Difference Logics Example: x − y ≤ 8 y − z ≤ −1 x − z ≤ −6 z − w ≤ 2 w − x ≤ −10 w − t ≤ 0 t − x ≤ 3 ————– 0 ≤ −1 yx −1 2 8 −6 z wt 0 3 −10 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 23 / 32
  • 112. Incremental Solving • The ability of solving theory atoms incrementally, is extremely important for efficiency • The Theory-Solver “receives” theory atoms from the SAT-Solver incrementally. A set of successful theory consistency checks is therefore performed on a growing set of constraints S0 ⊂ S1 ⊂ . . . ⊂ Sn • When checking the consistency of Si we want the solver to reuse the effort of step Si−1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 24 / 32
  • 113. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 y −1 2 8 −6 z −9 x w Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 114. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 ?0 −1 2 8 −6 ? ? −9 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 115. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 ? ? −9 8 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 116. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 ? −9 8 7 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 117. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 ? −9 8 7 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 118. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 ? −9 8 7 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 119. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 −9 8 7 9 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 120. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 −9 8 7 9 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 121. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 0 −1 2 8 −6 −9 8 7 9 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 122. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 ? 0 −10 0 −1 2 8 −6 −9 8 7 9 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 123. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 0 −1 2 8 −6 −9 8 7 9 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 124. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 8 7 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 125. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 7 6 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 126. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 7 6 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 127. Incremental Solving in Difference Logic • In Difference Logic incremental consistency check can be performed with a SSSP algorithm (single source shortest path), such as the Bellman-Ford algorithm or its variations x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 7 6 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 25 / 32
  • 128. Retrieving Conflict • The set of conflicting atoms is usually a small subset of all the set of atoms under consideration • The smaller the confict, the better (more search space is pruned away) • In Difference Logic it is sufficient to keep track of a parent information in the graph x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 7 6 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 26 / 32
  • 129. Retrieving Conflict • The set of conflicting atoms is usually a small subset of all the set of atoms under consideration • The smaller the confict, the better (more search space is pruned away) • In Difference Logic it is sufficient to keep track of a parent information in the graph x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 7 6 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 26 / 32
  • 130. Retrieving Conflict • The set of conflicting atoms is usually a small subset of all the set of atoms under consideration • The smaller the confict, the better (more search space is pruned away) • In Difference Logic it is sufficient to keep track of a parent information in the graph x − y ≤ 8 y − z ≤ −1 z − x ≤ −6 z − w ≤ 2 w − x ≤ −9 w − t ≤ 0 t − x ≤ −10 0 −10 9 −1 2 8 −6 −9 7 6 9 −1 Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 26 / 32
  • 131. Theory Propagation • We use the current state of the Theory Solver to infer the truth of other theory atoms • (it is the “theory” counterpart of UnitPropagation for Booleans) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
  • 132. Theory Propagation • We use the current state of the Theory Solver to infer the truth of other theory atoms • (it is the “theory” counterpart of UnitPropagation for Booleans) • Suppose we have the following situation: • x − y ≤ 1 and y − z ≤ 2 are both assigned to • x − z ≤ 5 is part of the initial formula but is currently not assigned a value by the SAT-Solver Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
  • 133. Theory Propagation • We use the current state of the Theory Solver to infer the truth of other theory atoms • (it is the “theory” counterpart of UnitPropagation for Booleans) • Suppose we have the following situation: • x − y ≤ 1 and y − z ≤ 2 are both assigned to • x − z ≤ 5 is part of the initial formula but is currently not assigned a value by the SAT-Solver • However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
  • 134. Theory Propagation • We use the current state of the Theory Solver to infer the truth of other theory atoms • (it is the “theory” counterpart of UnitPropagation for Booleans) • Suppose we have the following situation: • x − y ≤ 1 and y − z ≤ 2 are both assigned to • x − z ≤ 5 is part of the initial formula but is currently not assigned a value by the SAT-Solver • However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5) • (or, in clausal form (¬(x − y ≤ 1) ∨ ¬(y − z ≤ 2) ∨ (x − z ≤ 5))) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
  • 135. Theory Propagation • We use the current state of the Theory Solver to infer the truth of other theory atoms • (it is the “theory” counterpart of UnitPropagation for Booleans) • Suppose we have the following situation: • x − y ≤ 1 and y − z ≤ 2 are both assigned to • x − z ≤ 5 is part of the initial formula but is currently not assigned a value by the SAT-Solver • However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5) • (or, in clausal form (¬(x − y ≤ 1) ∨ ¬(y − z ≤ 2) ∨ (x − z ≤ 5))) • Adding the clause to the SAT-Solver will cause the atom (x − z ≤ 5) to be assigned to Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
  • 136. Theory Propagation • We use the current state of the Theory Solver to infer the truth of other theory atoms • (it is the “theory” counterpart of UnitPropagation for Booleans) • Suppose we have the following situation: • x − y ≤ 1 and y − z ≤ 2 are both assigned to • x − z ≤ 5 is part of the initial formula but is currently not assigned a value by the SAT-Solver • However we know that (x − y ≤ 1 ∧ y − z ≤ 2) → (x − z ≤ 5) • (or, in clausal form (¬(x − y ≤ 1) ∨ ¬(y − z ≤ 2) ∨ (x − z ≤ 5))) • Adding the clause to the SAT-Solver will cause the atom (x − z ≤ 5) to be assigned to constraint is not assigned y z 1 2 5 x Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 27 / 32
  • 137. Summing up • Lazy SMT is the efficient combination of • SAT-Solving techniques (DPLL procedure) • Decision procedures for decidable first order theories Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
  • 138. Summing up • Lazy SMT is the efficient combination of • SAT-Solving techniques (DPLL procedure) • Decision procedures for decidable first order theories • Intuitively, the SAT-Solver guesses a particular assignment of theory atoms Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
  • 139. Summing up • Lazy SMT is the efficient combination of • SAT-Solving techniques (DPLL procedure) • Decision procedures for decidable first order theories • Intuitively, the SAT-Solver guesses a particular assignment of theory atoms • while the Theory-Solver checks whether the assignment is correct in the theory Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
  • 140. Summing up • Lazy SMT is the efficient combination of • SAT-Solving techniques (DPLL procedure) • Decision procedures for decidable first order theories • Intuitively, the SAT-Solver guesses a particular assignment of theory atoms • while the Theory-Solver checks whether the assignment is correct in the theory • The Theory-Solver can communicate with SAT by means of clauses that represent valid statements in the theory Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 28 / 32
  • 141. Summing up The Theory-Solver is required to • Solve theory atoms incrementally • Produce conflicts • Produce theory propagations (deduce thruth value of unassigned theory atoms, based on the currently assigned ones) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 29 / 32
  • 142. Some theories of interest in Formal Verification • Equality and Uninterpreted Functions [19, 15] • Difference Logics [18, 12, 6] • Linear Rational Arithmetic [6, 16] • Linear Integer Arithmetic [6, 16] • Bit-Vectors [17, 2, 7, 11] • Arrays [4, 2, 14] • Combination of Theories [15, 5, 9] Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 30 / 32
  • 143. Some available SMT-Solvers • Barcelogic, (Barcelona, Spain) [3] • CVC3, (NYU, New York, USA) [1] • MathSAT, (FBK, Trento (Italy) [8] • OpenSMT, (Lugano, Switzerland) [10] • Yices, (SRI International, USA) • Z3, (Microsoft Research, Redmond, USA) [13] Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 31 / 32
  • 144. SMT-LIB • The SMT-LIB (www.smtlib.org) is an initiative that promotes the collection of SMT benchmarks, and the definition of a common input language for SMT-Solvers • The SMT-COMP is an annual competition of SMT-Solvers on a common set of benchmarks. Usually affiliated with CAV or CADE conferences (www.smtcomp.org) Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
  • 145. C. Barrett and C. Tinelli. CVC3. In CAV’07, 2007. A. Biere and R. Brummayer. The Boolector SMT Solver. In TACAS, 2009. M. Bofill, R. Nieuwenhuis, A. Oliveras, E. Rodr´ıguez Carbonell, and A. Rubio. The Barcelogic SMT Solver. In A. Gupta and S. Malik, editors, CAV’08, volume 5123 of Lecture Notes in Computer Science, pages 294–298. Springer, 2008. M. Bofill, R. Nieuwenhuis, A. Oliveras, E. Rodrguez-Carbonell, and A. Rubio. A Write-Based Solver for SAT Modulo the Theory of Arrays. In FMCAD, pages 101–108, 2008. M. Bozzano, R. Bruttomesso, A. Cimatti, T. Junttila, S. Ranise, P. van Rossum, and R. Sebastiani. Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
  • 146. Efficient Theory Combination via Boolean Search. Information Computation, 204(10):1493–1525, 2006. M. Bozzano, R. Bruttomesso, A. Cimatti, T. Junttila, P. van Rossum, S. Schulz, and R. Sebastiani. MathSAT: Tight Integration of SAT and Mathematical Decision Procedures. JAR, 35(1-3):265–293, 2005. R. Bruttomesso, A. Cimatti, A. Franzen, A. Griggio, Z. Hanna, A. Nadel, A. Palti, and R. Sebastiani. A Lazy and Layered SMT(BV) Solver for Hard Industrial Verification Problems. In CAV, pages 247–260, 2007. R. Bruttomesso, A. Cimatti, A. Franz´en, A. Griggio, and R. Sebastiani. The MathSAT 4 SMT Solver. In CAV, pages 299–303, 2008. Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
  • 147. R. Bruttomesso, A. Cimatti, A. Franzen, A. Griggio, and R. Sebastiani. Delayed theory combination vs. Nelson-Oppen for satisfiability modulo theories: a comparative analysis. Annals of Mathematics and Artificial Intelligence, 2009. R. Bruttomesso, E. Pek, N. Sharygina, and A. Tsitovich. The OpenSMT Solver. In TACAS, 2010. R. Bruttomesso and N. Sharygina. A Scalable Decision Procedure for Fixed-Width Bit-Vectors. In ICCAD, 2009. S. Cotton and O. Maler. Fast and Flexible Difference Constraint Propagation for DPLL(T). In SAT’06, pages 170–183, 2006. L. de Moura and N. Bjørner. Z3: An Efficient SMT Solver. In TACAS’08, pages 337–340, 2008. Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
  • 148. L. de Moura and N. Bjørner. Generalized, Efficient Array Decision Procedures. In FMCAD, 2009. D. Detlefs, G. Nelson, and J. B. Saxe. Simplify: a theorem prover for program checking. Journal of ACM, 52(3):365–473, 2005. B. Dutertre and L. M. de Moura. A Fast Linear-Arithmetic Solver for DPLL(T). In CAV’06, pages 81–94, 2006. V. Ganesh and D. L. Dill. A Decision Procedure for Bit-Vectors and Arrays. In CAV, pages 519–531, 2007. R. Nieuwenhuis and A. Oliveras. DPLL(T) with Exhaustive Theory Propagation and Its Application to Difference Logic. In CAV’05, pages 321–334, 2005. Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32
  • 149. R. Nieuwenhuis and A. Oliveras. Proof-Producing Congruence Closure. In RTA’05, pages 453–468, 2005. Roberto Bruttomesso (USI) SAT and SMT St. Petersburg 18/09/10 32 / 32