Lecture 10 - SMT Solving
Real-Time Systems and Temporal Verification
COSC560
Stanley Bak
[Some Slides due to Sayan Mitra and Clark Barrett]
Goals and non-goals
Goal:
- Get intuitive understanding of the algorithms for SAT / SMT
- Be able to lookup and understand more detailed information
if desired / needed
Non-goal:
- Become a SAT / SMT Expert
What do these mean? Which one is SAT solving?
Recall: what’s a model (in first-order logic)?
Recall: what’s a model (in first-order logic)?
SAT solving
Assumption: Formulas are in Conjunctive Normal Form
DPLL Rules:
1. Decide (assign forced values)
2. Propagate (guess)
3. Backtrack (guess the other way)
State-of-the-art: hundreds of thousands of variables
CDCL (Conflict Driven Clause Learning)
Learn new clauses (lemmas) to prevent repeated lines of reasoning finding the same contradictions
Relies on building an implication graph
Demo: https://en.wikipedia.org/wiki/Conflict-driven_clause_learning
7
Satisfiability modulo theories
Decision Prodedures for a Theory
A Decision Procedure is algorithm to determine if a formula (in theory T) is satisfiable. They usually work on conjunctions of literals.
Architecture of an SMT solver
Theory solvers/decision procedures
Arithmetic
Bitvectors
DPLL
Difference logic
…
Uninterpreted functions
Core
CNF formula in
real arithmetic
solution or
counterexample
boolean skeleton of problem
assertions
What is a theory in mathematical logic?
Building up a theory
Terms to Formulas
Models for Theories
Decision procedures
Example theories
Example decision procedure: Uninterpreted functions (UF)
Example decision procedure: Uninterpreted functions (UF)
Example decision procedure 2: Difference logic
Return to SMT
Theory solvers/decision procedures
Arithmetic
Bitvectors
DPLL
Difference logic
…
Uninterpreted functions
Core
CNF formula in
real arithmetic
solution or
counterexample
boolean skeleton of problem
assertions
Theory solvers/decision procedures
Arithmetic
Bitvectors
DPLL
Difference logic
…
Uninterpreted functions
Core
CNF formula in
real arithmetic
solution or
counterexample
boolean skeleton of problem
assertions
Decidability Results
24
Decidability Results
25
Decidability Results
26
Decidability Results
27
Decidability Results
28
Decidability Results
29
30
If More Than Two Theories Are Involved?
Statement 𝝓 might contain elements from two different theories.
Solved using Nelson-Oppen procedure.