Internals of SMT Solvers Leonardo de Moura Microsoft Research Acknowledgements • Dejan Jovanovic (SRI International, NYU) • Grant Passmore (Univ.

Download Report

Transcript Internals of SMT Solvers Leonardo de Moura Microsoft Research Acknowledgements • Dejan Jovanovic (SRI International, NYU) • Grant Passmore (Univ.

Internals of SMT Solvers
Leonardo de Moura
Microsoft Research
Acknowledgements
โ€ข Dejan Jovanovic (SRI International, NYU)
โ€ข Grant Passmore (Univ. Edinburgh)
Herbrand Award 2013
Greg Nelson
What is a SMT Solver?
Multiple Approaches
is a portfolio of solvers
Preprocessing
๐น
Modular Architecture is
a โ€œmust haveโ€
Simplify
Variable elimination
if-then-else elimination
โ€ฆ
Solver
Equivalence Preserving Simplifications
๐น
Simplify
๐นโ€ฒ
Examples:
๐‘ฅ+๐‘ฆ+1โˆ’๐‘ฅโˆ’2 โ†ฆ ๐‘ฆ โˆ’1
๐‘ โˆง ๐‘ก๐‘Ÿ๐‘ข๐‘’ โˆง ๐‘ โ†ฆ ๐‘
Preprocessor API
๐น and ๐นโ€™ may be
only equisatisfiable
๐น
Preprocessor
๐นโ€ฒ
Model
Converter
Proof
Converter
Example
Variable
Elimination
Proof
builder
Model
builder
Example
Variable
Elimination
Proof
builder
๐‘€, ๐‘€(๐‘Ž) = ๐‘€(๐‘) + 1
Model
builder
๐‘€
Example
Variable
Elimination
Proof
builder
๐‘ โ†’ 5, ๐‘Ž โ†’ 6
Model
builder
๐‘โ†’5
Model Converters
Extension
๐‘€, ๐‘€(๐‘Ž) = ๐‘€(๐‘) + 1
Model
builder
๐‘€
Filter
Model Converter: Filter
๐‘ โˆจ (๐‘ž โˆง โ„Ž)
Tseitin
CNF converter
๐‘ โˆจ ๐‘˜,
¬๐‘˜ โˆจ ๐‘ž, ¬๐‘˜ โˆจ โ„Ž, ๐‘˜ โˆจ ¬๐‘ž โˆจ ¬โ„Ž
๐‘€โˆ–๐‘˜
Model
builder
๐‘€
Model Converter: Filter
๐‘ โˆจ (๐‘ž โˆง โ„Ž)
Tseitin
CNF converter
๐‘ โ†’ ๐‘ก, ๐‘ž โ†’ ๐‘“, โ„Ž โ†’ ๐‘ก
๐‘ โˆจ ๐‘˜,
¬๐‘˜ โˆจ ๐‘ž, ¬๐‘˜ โˆจ โ„Ž, ๐‘˜ โˆจ ¬๐‘ž โˆจ ¬โ„Ž
Model
builder
๐‘ โ†’ ๐‘ก, ๐‘˜ โ†’ ๐‘“, ๐‘ž โ†’ ๐‘“, โ„Ž โ†’ ๐‘ก
Model Converter: Extension + Filter
๐‘ฅ: ๐‘๐‘–๐‘ก๐‘ฃ๐‘’๐‘ 4 ,
๐‘ฆ, ๐‘ง: ๐‘๐‘–๐‘ก๐‘ฃ๐‘’๐‘[2]
๐‘ฅ = ๐‘๐‘œ๐‘›๐‘๐‘Ž๐‘ก(๐‘ฆ, ๐‘ง)
Bit-blaster
๐‘ฅ3 โ‡” ๐‘ฆ1 , ๐‘ฅ2 โ‡” ๐‘ฆ0 ,
๐‘ฅ1 โ‡” ๐‘ง1 , ๐‘ฅ0 โ‡” ๐‘ง0
๐‘€โ€ฒ
Model
builder
๐‘€
Preprocessors
1. Produce Equivalent Formula
2. Produce Equisatisfiable Formula
3. Assume โ€œclosed worldโ€ (non-incremental)
Example: symmetry reduction
Simple QF_BV (bit-vector) solver
๐น
Simplify
Variable elimination
Bit-blasting
Tseitin CNF converter
SAT Solver
Under/Over-Approximations
Under-approximation
unsat answers cannot be trusted
Over-approximation
sat answers cannot be trusted
Under/Over-Approximations
Under-approximation
model finders
Over-approximation
proof finders
Under/Over-Approximations
Under-approximation
S ๏‚ฎ S ๏ƒˆ Sโ€™
Over-approximation
S ๏‚ฎ S \ Sโ€™
Under/Over-Approximations
Under-approximation
Example: QF_NIA model finders
add bounds to unbounded variables (and blast)
Over-approximation
Example: Boolean abstraction
Under/Over-Approximations
Combining under and over is bad!
sat and unsat answers cannot be trusted.
Tracking: under/overapproximations
Proof and Model converters can check if the
resultant models and proofs are valid.
CEGAR is your friend
Counter-Example Guided Abstract Refinement
Using over-approximation
procedure Solver(F)
Model
Fp := Abstract(F)
loop
(R, M) := Solve(Fp)
if R = UNSAT then return UNSAT
Rโ€™ := Check(F, M)
if Rโ€™ = SAT then return SAT
Fp := Refine(F, Fp, M)
CEGAR is your friend
Counter-Example Guided Abstract Refinement
Using under-approximation
procedure Solver(F)
Proof
Fp := Abstract(F)
loop
(R, Pr) := Solve(Fp)
if R = SAT then return SAT
Rโ€™ := Check(F, Pr)
if Rโ€™ = UNSAT then return UNSAT
Fp := Refine(F, Fp, M)
CEGAR is your friend
Counter-Example Guided Abstract Refinement
Refinements:
Incremental Solver
Run over and under-approximation is parallel
Uninterpreted Functions by CEGAR
Suppose we have a Solver that does not support
uninterpreted functions (example: QF_BV solver)
Congruence Rule:
๐‘ฅ1 = ๐‘ฆ1, โ€ฆ , ๐‘ฅ๐‘› = ๐‘ฆ๐‘› โ‡’ ๐‘“(๐‘ฅ1, โ€ฆ , ๐‘ฅ๐‘›) = ๐‘“(๐‘ฆ1, โ€ฆ , ๐‘ฆ๐‘›)
Uninterpreted Functions by CEGAR
Congruence Rule:
๐‘ฅ1 = ๐‘ฆ1, โ€ฆ , ๐‘ฅ๐‘› = ๐‘ฆ๐‘› โ‡’ ๐‘“(๐‘ฅ1, โ€ฆ , ๐‘ฅ๐‘›)
Abstract: replace each f-application with a fresh variable
(over-approximation)
๐‘Ž = ๐‘ + 1, ๐‘“(๐‘Ž โˆ’ 1) = ๐‘, ๐‘“(๐‘) โ‰  ๐‘
๐‘˜1 โ‰ก ๐‘“ ๐‘Ž โˆ’ 1 ,
๐‘˜2 โ‰ก ๐‘“(๐‘)
๐‘Ž = ๐‘ + 1, ๐‘˜1 = ๐‘, ๐‘˜2 โ‰  ๐‘
Uninterpreted Functions by CEGAR
Congruence Rule:
๐‘ฅ1 = ๐‘ฆ1, โ€ฆ , ๐‘ฅ๐‘› = ๐‘ฆ๐‘› โ‡’ ๐‘“(๐‘ฅ1, โ€ฆ , ๐‘ฅ๐‘›)
Check: check if congruence rule is satisfied
๐‘Ž = ๐‘ + 1, ๐‘˜1 = ๐‘, ๐‘˜2 โ‰  ๐‘
๐‘˜1 โ‰ก ๐‘“ ๐‘Ž โˆ’ 1 ,
๐‘˜2 โ‰ก ๐‘“(๐‘)
๐‘Ž โ†’ 1, ๐‘ โ†’ 0, ๐‘ โ†’ 0, ๐‘˜1 โ†’ 0, ๐‘˜2 โ†’ 1
Uninterpreted Functions by CEGAR
Congruence Rule:
๐‘ฅ1 = ๐‘ฆ1, โ€ฆ , ๐‘ฅ๐‘› = ๐‘ฆ๐‘› โ‡’ ๐‘“(๐‘ฅ1, โ€ฆ , ๐‘ฅ๐‘›)
Refine: expand congruence axiom ๐‘Ž โˆ’ 1 = ๐‘ โ‡’ ๐‘˜1 = ๐‘˜2
๐‘Ž = ๐‘ + 1, ๐‘˜1 = ๐‘, ๐‘˜2 โ‰  ๐‘
๐‘˜1 โ‰ก ๐‘“ ๐‘Ž โˆ’ 1 ,
๐‘˜2 โ‰ก ๐‘“(๐‘)
๐‘Ž โ†’ 1, ๐‘ โ†’ 0, ๐‘ โ†’ 0, ๐‘˜1 โ†’ 0, ๐‘˜2 โ†’ 1
Uninterpreted Functions by CEGAR
Congruence Rule:
๐‘ฅ1 = ๐‘ฆ1, โ€ฆ , ๐‘ฅ๐‘› = ๐‘ฆ๐‘› โ‡’ ๐‘“(๐‘ฅ1, โ€ฆ , ๐‘ฅ๐‘›)
Refine: expand congruence axiom ๐‘Ž โˆ’ 1 = ๐‘ โ‡’ ๐‘˜1 = ๐‘˜2
๐‘Ž = ๐‘ + 1, ๐‘˜1 = ๐‘, ๐‘˜2 โ‰  ๐‘, (๐‘Ž โˆ’ 1 = ๐‘ โ‡’ ๐‘˜1 = ๐‘˜2 )
๐‘Ž โˆ’ 1 โ‰  ๐‘ โˆจ ๐‘˜1 = ๐‘˜2
unsat
Simple QF_UFBV Solver
UF by CEGAR
QF_BV
solver
Simple QF_AUFBV Solver
arrays on top of UF
AUF by CEGAR
QF_BV
solver
Lemmas on Demand For Theory of Arrays [Brummayer-Biere 2009]
Simple UFBV Solver
model-based quantifier instantiation
MBQI
UF by CEGAR
QF_BV
solver
Efficiently solving quantified bit-vector formulas [Wintersteiger at al 2010]
Simple QF_NIA โ€œsolverโ€ by CEGAR
nonlinear integer arithmetic
Hilbertโ€™s 10th Problem
DPRM theorem: QF_NIA is undecidable
Idea: use (under-approximation) CEGAR
1. Add lower/upper bounds to all variables, and convert
into QF_BV
2. If SAT ๏ƒ  done
3. Otherwise, refine: increase lower/upper bounds
Lazy SMT as CEGAR
Suppose we have a Solver that can only process a conjunction of
literals.
Examples:
Congurence Closure (UF),
Simplex (Linear Real Arithmetic)
Lazy SMT as CEGAR: 1. Abstract
Basic Idea
x ๏‚ณ 0, y = x + 1, (y > 2 ๏ƒš y < 1)
p1, p2, (p3 ๏ƒš p4)
p1 ๏‚บ (x ๏‚ณ 0), p2 ๏‚บ (y = x + 1),
p3 ๏‚บ (y > 2), p4 ๏‚บ (y < 1)
[Audemard et al - 2002], [Barrett et al - 2002], [de Moura et al - 2002]
[Flanagan et al - 2003], โ€ฆ
Lazy SMT as CEGAR: 2. Solve
Basic Idea
x ๏‚ณ 0, y = x + 1, (y > 2 ๏ƒš y < 1)
p1, p2, (p3 ๏ƒš p4)
SAT
Solver
p1 ๏‚บ (x ๏‚ณ 0), p2 ๏‚บ (y = x + 1),
p3 ๏‚บ (y > 2), p4 ๏‚บ (y < 1)
Lazy SMT as CEGAR: 2. Solve
Basic Idea
x ๏‚ณ 0, y = x + 1, (y > 2 ๏ƒš y < 1)
p1, p2, (p3 ๏ƒš p4)
SAT
Solver
p1 ๏‚บ (x ๏‚ณ 0), p2 ๏‚บ (y = x + 1),
p3 ๏‚บ (y > 2), p4 ๏‚บ (y < 1)
Assignment
p1, p2, ๏ƒ˜p3, p4
Lazy SMT as CEGAR: 3. Check
Basic Idea
x ๏‚ณ 0, y = x + 1, (y > 2 ๏ƒš y < 1)
p1, p2, (p3 ๏ƒš p4)
SAT
Solver
p1 ๏‚บ (x ๏‚ณ 0), p2 ๏‚บ (y = x + 1),
p3 ๏‚บ (y > 2), p4 ๏‚บ (y < 1)
Assignment
p1, p2, ๏ƒ˜p3, p4
x ๏‚ณ 0, y = x + 1,
๏ƒ˜(y > 2), y < 1
Lazy SMT as CEGAR: 3. Check
Basic Idea
x ๏‚ณ 0, y = x + 1, (y > 2 ๏ƒš y < 1)
p1, p2, (p3 ๏ƒš p4)
SAT
Solver
p1 ๏‚บ (x ๏‚ณ 0), p2 ๏‚บ (y = x + 1),
p3 ๏‚บ (y > 2), p4 ๏‚บ (y < 1)
Assignment
p1, p2, ๏ƒ˜p3, p4
Unsatisfiable
x ๏‚ณ 0, y = x + 1, y < 1
x ๏‚ณ 0, y = x + 1,
๏ƒ˜(y > 2), y < 1
Theory
Solver
Lazy SMT as CEGAR: 4. Refine
Basic Idea
x ๏‚ณ 0, y = x + 1, (y > 2 ๏ƒš y < 1)
p1, p2, (p3 ๏ƒš p4)
SAT
Solver
New Lemma
๏ƒ˜p1๏ƒš๏ƒ˜p2๏ƒš๏ƒ˜p4
p1 ๏‚บ (x ๏‚ณ 0), p2 ๏‚บ (y = x + 1),
p3 ๏‚บ (y > 2), p4 ๏‚บ (y < 1)
Assignment
p1, p2, ๏ƒ˜p3, p4
Unsatisfiable
x ๏‚ณ 0, y = x + 1, y < 1
x ๏‚ณ 0, y = x + 1,
๏ƒ˜(y > 2), y < 1
Theory
Solver
Lazy SMT as CEGAR: 4. Refine
Basic Idea
New Lemma
๏ƒ˜p1๏ƒš๏ƒ˜p2๏ƒš๏ƒ˜p4
Unsatisfiable
x ๏‚ณ 0, y = x + 1, y < 1
AKA
Theory conflict
Theory
Solver
Lazy SMT as CEGAR: refinements
Many refinements:
Incrementality
Efficient Backtracking
Efficient Lemma Generation
Theory propagation - DPLL(T) [Ganzinger et all โ€“ 2004]
Many SMT solvers are based on DPLL(T)
DPLL(T) weakness
Proofs
Theories are โ€œsecond-class citizensโ€.
DPLL(T) is not model-driven (key property of CDCL).
Models
CDCL: Conflict Driven Clause Learning
DPLL
Resolution
Model
Proof
DPLL(T) weakness
DPLL(T) works well only for โ€œeasyโ€ theories.
Examples:
Uninterpreted functions
Difference logic (๐‘ฅ โˆ’ ๐‘ฆ โ‰ค ๐‘)
Linear real arithmetic
โ€œHard theoriesโ€:
Linear integer arithmetic
Arrays
Nonlinear real arithmetic
Example: Nonlinear Real Arithmetic
๐‘ฅ 2 โˆ’ 4๐‘ฅ + ๐‘ฆ 2 โˆ’ ๐‘ฆ + 8 < 1
๐‘ฅ๐‘ฆ โˆ’ 2๐‘ฅ โˆ’ 2๐‘ฆ + 4 > 1
PSPACE
PSPACE membership
Canny โ€“ 1988,
Grigorโ€™ev โ€“ 1988
QF_NRA
NP
NP-hardness
x is โ€œBooleanโ€๏‚ฎ x (x-1) = 0
x or y or z
๏‚ฎ x+y+z>0
The RISE of Model-Driven
Techniques in SMT
Saturation x Search
Model-finding
Proofs
Proof-finding
Models
Two procedures
Resolution
Proof-finder
Saturation
DPLL
Model-finder
Search
CDCL is model-driven
proof search
Linear Arithmetic
Fourier-Motzkin
Proof-finder
Saturation
Simplex
Model-finder
Search
Fourier-Motzkin
๐‘ก1 โ‰ค ๐‘Ž๐‘ฅ,
๐‘๐‘ก1 โ‰ค ๐‘Ž๐‘๐‘ฅ,
๐‘๐‘ฅ โ‰ค ๐‘ก2
๐‘Ž๐‘๐‘ฅ โ‰ค ๐‘Ž๐‘ก2
๐‘๐‘ก1 โ‰ค ๐‘Ž๐‘ก2
Very similar to Resolution
Exponential time and space
Polynomial Constraints
AKA
Existential Theory of the Reals
๏€คR
๐‘ฅ 2 โˆ’ 4๐‘ฅ + ๐‘ฆ 2 โˆ’ ๐‘ฆ + 8 < 1
๐‘ฅ๐‘ฆ โˆ’ 2๐‘ฅ โˆ’ 2๐‘ฆ + 4 > 1
CAD โ€œBig Pictureโ€
1. Project/Saturate set of polynomials
2. Lift/Search: Incrementally build assignment ๐‘ฃ: ๐‘ฅ๐‘˜ โ†’ ๐›ผ๐‘˜
Isolate roots of polynomials ๐‘“๐‘– (๐œถ, ๐‘ฅ)
Select a feasible cell ๐ถ, and assign ๐‘ฅ๐‘˜ some ๐›ผ๐‘˜ โˆˆ ๐ถ
If there is no feasible cell, then backtrack
CAD โ€œBig Pictureโ€
2
๐‘ฅ4 โˆ’ ๐‘ฅ2 + 1
2
๐‘ฅ +๐‘ฆ โˆ’1<0
๐‘ฅ๐‘ฆ โˆ’1>0
1. Saturate
๐‘ฅ2 โˆ’ 1
๐‘ฅ
2. Search
(โˆ’โˆž, โˆ’๐Ÿ)
โˆ’๐Ÿ
(โˆ’๐Ÿ, ๐ŸŽ)
๐ŸŽ
(๐ŸŽ, ๐Ÿ)
๐Ÿ
(๐Ÿ, โˆž)
๐‘ฅ4 โˆ’ ๐‘ฅ2 + 1
+
+
+
+
+
+
+
๐‘ฅ2 โˆ’ 1
+
0
-
-
-
0
+
๐‘ฅ
-
-
-
0
+
+
+
CAD โ€œBig Pictureโ€
๐Ÿ
๐‘ฅ4 โˆ’ ๐‘ฅ2 + 1
๐Ÿ
๐’™ +๐’š โˆ’๐Ÿ<0
๐’™๐’š โˆ’๐Ÿ>0
1. Saturate
๐‘ฅ2 โˆ’ 1
๐‘ฅ
๐Ÿ
(โˆ’โˆž, โˆ’ )
๐Ÿ
๐Ÿ
๐Ÿ
โˆ’ (โˆ’ , โˆž)
๐Ÿ
๐Ÿ
4 + ๐‘ฆ2 โˆ’ 1
+
+
+
โˆ’2y โˆ’ 1
+
0
-
๐’™๏‚ฎ โˆ’ ๐Ÿ
2. Search
(โˆ’โˆž, โˆ’๐Ÿ)
โˆ’๐Ÿ
(โˆ’๐Ÿ, ๐ŸŽ)
๐ŸŽ
(๐ŸŽ, ๐Ÿ)
๐Ÿ
(๐Ÿ, โˆž)
๐‘ฅ4 โˆ’ ๐‘ฅ2 + 1
+
+
+
+
+
+
+
๐‘ฅ2 โˆ’ 1
+
0
-
-
-
0
+
๐‘ฅ
-
-
-
0
+
+
+
CAD โ€œBig Pictureโ€
๐Ÿ
๐‘ฅ4 โˆ’ ๐‘ฅ2 + 1
๐Ÿ
๐’™ +๐’š โˆ’๐Ÿ<๐ŸŽ
๐‘ฅ๐‘ฆ โˆ’1>0
1. Saturate
๐‘ฅ2 โˆ’ 1
๐‘ฅ
๐Ÿ
(โˆ’โˆž, โˆ’ )
๐Ÿ
๐Ÿ
๐Ÿ
โˆ’ (โˆ’ , โˆž)
๐Ÿ
๐Ÿ
๐Ÿ’ + ๐’š๐Ÿ โˆ’ ๐Ÿ
+
+
+
โˆ’2y โˆ’ 1
+
0
-
๐’™๏‚ฎ โˆ’ ๐Ÿ
CONFLICT
2. Search
(โˆ’โˆž, โˆ’๐Ÿ)
โˆ’๐Ÿ
(โˆ’๐Ÿ, ๐ŸŽ)
๐ŸŽ
(๐ŸŽ, ๐Ÿ)
๐Ÿ
(๐Ÿ, โˆž)
๐‘ฅ4 โˆ’ ๐‘ฅ2 + 1
+
+
+
+
+
+
+
๐‘ฅ2 โˆ’ 1
+
0
-
-
-
0
+
๐‘ฅ
-
-
-
0
+
+
+
Models
Static x Dynamic
Optimistic approach
Key ideas
Proofs
NLSat: Model-Driven Search
Start the Search before Saturate/Project
We saturate on demand
Model guides the saturation
Experimental Results (1)
OUR NEW ENGINE
Experimental Results (2)
OUR NEW ENGINE
Other examples
Delayed
Theory Combination
[Bruttomesso et al 2006]
X
Model-Based
Theory Combination
Other examples
Array Theory by
Axiom Instantiation
X
Lemmas on Demand
For Theory of Array
[Brummayer-Biere 2009]
โˆ€๐‘Ž, ๐‘–, ๐‘ฃ: ๐‘Ž ๐‘– โ‰” ๐‘ฃ ๐‘– = ๐‘ฃ
โˆ€๐‘Ž, ๐‘–, ๐‘—, ๐‘ฃ: ๐‘– = ๐‘— โˆจ ๐‘Ž ๐‘– โ‰” ๐‘ฃ ๐‘— = ๐‘Ž[๐‘—]
Other examples
(for linear arithmetic)
Generalizing DPLL to
richer logics
Fourier-Motzkin
X
[McMillan et al 2009]
Conflict Resolution
[Korovin et al 2009]
Saturation: successful instances
Polynomial time procedures
Gaussian Elimination
Congruence Closure
MCSat
Model-Driven SMT
Lift ideas from CDCL to SMT
Generalize ideas found in model-driven approaches
Easier to implement
Model construction is explicit
MCSat
๐‘ฅ โ‰ฅ 2,
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
MCSat
๐‘ฅ โ‰ฅ 2,
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฅโ‰ฅ2
Propagations
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฅโ‰ฅ1
Propagations
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆโ‰ฅ1
Propagations
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
Boolean Decisions
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1 ๐‘ฅ โ†’ 2
Semantic Decisions
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1 ๐‘ฅ โ†’ 2
Conflict
We canโ€™t find a value for ๐‘ฆ
s.t. 4 + ๐‘ฆ 2 โ‰ค 1
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1 ๐‘ฅ โ†’ 2
Conflict
We canโ€™t find a value for ๐‘ฆ
s.t. 4 + ๐‘ฆ 2 โ‰ค 1
Learning that
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ= 2)
is not productive
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
¬(๐‘ฅ = 2)
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ = 2)
Learning that
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ= 2)
is not productive
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
¬(๐‘ฅ = 2) ๐‘ฅ โ†’ 3
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ = 2)
Learning that
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ= 2)
is not productive
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
โ€œSameโ€ Conflict
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
¬(๐‘ฅ = 2) ๐‘ฅ โ†’ 3
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ = 2)
We canโ€™t find a value for ๐‘ฆ
s.t. 9 + ๐‘ฆ 2 โ‰ค 1
Learning that
¬ ๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ¬(๐‘ฅ= 2)
is not productive
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
๐‘ฆ
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1 ๐‘ฅ โ†’ 2
Conflict
๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
๐‘ฅ
๐‘ฅโ†’2
โˆ’1 โ‰ค ๐‘ฅ, ๐‘ฅ โ‰ค 1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
๐‘ฅโ‰ค1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
๐‘ฅโ‰ค1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
Conflict
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ โ‰ค 1)
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
Learned by resolution
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
MCSat
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
MCSat: FM Example
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 ๐‘ง โ†’ 0
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0,
โ‰ก
๐‘ง + 1 โ‰ค ๐‘ฅ,
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ฆโ†’0
๐‘ง โ†’ 0,
๐‘ฅโ‰ค๐‘ฆ
1 โ‰ค ๐‘ฅ,
๐‘ฅโ‰ค0
We canโ€™t find a value of ๐‘ฅ
๐‘ฆโ†’0
MCSat: FM Example
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 ๐‘ง โ†’ 0
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0,
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ฆโ†’0
๐‘ง โ†’ 0,
๐‘ฆโ†’0
โˆƒ๐‘ฅ: โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 โˆง ๐‘ฅ โˆ’ ๐‘ฆ โ‰ค 0
๐‘ง+1โˆ’๐‘ฆ โ‰ค0
Fourier-Motzkin
¬ โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 โˆจ ¬ ๐‘ฅ โˆ’ ๐‘ฆ โ‰ค 0 โˆจ ๐‘ง + 1 โˆ’ ๐‘ฆ โ‰ค 0
MCSat: FM Example
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 ๐‘ง โ†’ 0
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ง+1โˆ’๐‘ฆ โ‰ค0
¬ โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 โˆจ ¬ ๐‘ฅ โˆ’ ๐‘ฆ โ‰ค 0 โˆจ ๐‘ง + 1 โˆ’ ๐‘ฆ โ‰ค 0
MCSat: FM Example
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 ๐‘ง โ†’ 0
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ง+1โˆ’๐‘ฆ โ‰ค0
๐‘ฆโ†’1
¬ โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 โˆจ ¬ ๐‘ฅ โˆ’ ๐‘ฆ โ‰ค 0 โˆจ ๐‘ง + 1 โˆ’ ๐‘ฆ โ‰ค 0
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0,
โ‰ก
๐‘ง + 1 โ‰ค ๐‘ฅ,
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ง โ†’ 0,
๐‘ฅโ‰ค๐‘ฆ
1 โ‰ค ๐‘ฅ,
๐‘ฅโ‰ค1
๐‘ฆโ†’1
MCSat: FM Example
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 ๐‘ง โ†’ 0
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ง+1โˆ’๐‘ฆ โ‰ค0 ๐‘ฆ โ†’1 ๐‘ฅ โ†’1
¬ โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0 โˆจ ¬ ๐‘ฅ โˆ’ ๐‘ฆ โ‰ค 0 โˆจ ๐‘ง + 1 โˆ’ ๐‘ฆ โ‰ค 0
โˆ’๐‘ฅ + ๐‘ง + 1 โ‰ค 0,
โ‰ก
๐‘ง + 1 โ‰ค ๐‘ฅ,
๐‘ฅโˆ’๐‘ฆ โ‰ค0
๐‘ง โ†’ 0,
๐‘ฅโ‰ค๐‘ฆ
1 โ‰ค ๐‘ฅ,
๐‘ฅโ‰ค1
๐‘ฆโ†’1
MCSat: Another Example
โˆ’4๐‘ฅ๐‘ฆ โˆ’ 4๐‘ฅ + ๐‘ฆ > 1,
๐‘ฅ 2 + ๐‘ฆ 2 < 1,
๐‘ฅ 3 + 2๐‘ฅ 2 + 3๐‘ฆ 2 โˆ’ 5 < 0
MCSat: Another Example
โˆ’4๐‘ฅ๐‘ฆ โˆ’ 4๐‘ฅ + ๐‘ฆ > 1,
๐‘ฅ 2 + ๐‘ฆ 2 < 1,
Feasible Region
๐‘ฅ 3 + 2๐‘ฅ 2 + 3๐‘ฆ 2 โˆ’ 5 < 0
๐‘ฅ 3 + 2๐‘ฅ 2 + 3๐‘ฆ 2 โˆ’ 5 < 0
Starting search
Partial solution:
๐‘ฅ โ†’ 0.5
โˆ’4๐‘ฅ๐‘ฆ โˆ’ 4๐‘ฅ + ๐‘ฆ > 1
What is the core?
๐‘ฅ2 + ๐‘ฆ2 < 1
Can we extend it to ๐‘ฆ?
MCSat: Another Example
โˆ’4๐‘ฅ๐‘ฆ โˆ’ 4๐‘ฅ + ๐‘ฆ > 1,
๐‘ฅ 2 + ๐‘ฆ 2 < 1,
Feasible Region
๐‘ฅ 3 + 2๐‘ฅ 2 + 3๐‘ฆ 2 โˆ’ 5 < 0
๐‘ฅ 3 + 2๐‘ฅ 2 + 3๐‘ฆ 2 โˆ’ 5 < 0
Starting search
Partial solution:
๐‘ฅ โ†’ 0.5
โˆ’4๐‘ฅ๐‘ฆ โˆ’ 4๐‘ฅ + ๐‘ฆ > 1
What is the core?
๐‘ฅ2 + ๐‘ฆ2 < 1
Can we extend it to ๐‘ฆ?
MCSat โ€“ Finite Basis
Every theory that admits quantifier elimination has a finite
basis (given a fixed assignment order)
๐น[๐‘ฅ, ๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š ]
๐‘ฆ1 โ†’ ๐›ผ1 , โ€ฆ , ๐‘ฆ๐‘š โ†’ ๐›ผ๐‘š
โˆƒ๐‘ฅ: ๐น[๐‘ฅ, ๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š ]
๐ถ1 [๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š ] โˆง โ‹ฏ โˆง ๐ถ๐‘˜ [๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š ]
¬๐น ๐‘ฅ, ๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š โˆจ ๐ถ๐‘˜ [๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š ]
MCSat โ€“ Finite Basis
๐น๐‘› [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 , ๐‘ฅ๐‘› ]
๐น๐‘›โˆ’1 [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 ]
โ€ฆ
๐น2 [๐‘ฅ1, ๐‘ฅ2 ]
๐น1 [๐‘ฅ1 ]
MCSat โ€“ Finite Basis
๐น๐‘› [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 , ๐‘ฅ๐‘› ]
๐น๐‘›โˆ’1 [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 ]
โ€ฆ
๐น2 [๐‘ฅ1, ๐‘ฅ2 ]
๐น1 [๐‘ฅ1 ]
MCSat โ€“ Finite Basis
๐น๐‘› [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 , ๐‘ฅ๐‘› ]
๐น๐‘›โˆ’1 [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 ]
โ€ฆ
๐น2 [๐‘ฅ1, ๐‘ฅ2 ]
๐น1 [๐‘ฅ1 ]
MCSat โ€“ Finite Basis
๐น๐‘› [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 , ๐‘ฅ๐‘› ]
๐น๐‘›โˆ’1 [๐‘ฅ1, ๐‘ฅ2 , โ€ฆ , ๐‘ฅ๐‘›โˆ’1 ]
โ€ฆ
๐น2 [๐‘ฅ1, ๐‘ฅ2 ]
๐น1 [๐‘ฅ1 ]
MCSat โ€“ Finite Basis
Every โ€œfiniteโ€ theory has a finite basis
Example: Fixed size Bit-vectors
๐น[๐‘ฅ, ๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š ]
๐‘ฆ1 โ†’ ๐›ผ1 , โ€ฆ , ๐‘ฆ๐‘š โ†’ ๐›ผ๐‘š
¬๐น ๐‘ฅ, ๐‘ฆ1 , โ€ฆ , ๐‘ฆ๐‘š โˆจ ¬(๐‘ฆ1 = ๐›ผ1 ) โˆจ โ‹ฏ โˆจ ¬(๐‘ฆ๐‘š = ๐›ผ๐‘š )
MCSat โ€“ Finite Basis
Theory of uninterpreted functions has a finite basis
Theory of arrays has a finite basis [Brummayer- Biere 2009]
In both cases the Finite Basis is essentially composed of
equalities between existing terms.
MCSat: Uninterpreted Functions
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘Ž โˆ’ 1 < ๐‘, ๐‘“ ๐‘ > ๐‘Ž
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘˜ < ๐‘, ๐‘“ ๐‘ > ๐‘Ž, ๐‘˜ = ๐‘Ž โˆ’ 1
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘˜ < ๐‘, ๐‘“ ๐‘ > ๐‘Ž, ๐‘˜ = ๐‘Ž โˆ’ 1
Treat ๐‘“(๐‘˜) and ๐‘“(๐‘) as variables
Generalized variables
MCSat: Uninterpreted Functions
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘˜ < ๐‘, ๐‘“ ๐‘ > ๐‘Ž, ๐‘˜ = ๐‘Ž โˆ’ 1
๐‘˜ โ†’ 0 ๐‘ โ†’ 0 ๐‘“(๐‘˜) โ†’ 0 ๐‘“(๐‘) โ†’ 2
Conflict: ๐‘“ ๐‘˜ and ๐‘“ ๐‘ must be equal
¬ ๐‘˜ = ๐‘ โˆจ ๐‘“ ๐‘˜ = ๐‘“(๐‘)
MCSat: Uninterpreted Functions
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘˜ < ๐‘, ๐‘“ ๐‘ > ๐‘Ž, ๐‘˜ = ๐‘Ž โˆ’ 1
๐‘˜ โ†’ 0 ๐‘ โ†’ 0 ๐‘“(๐‘˜) โ†’ 0 ๐‘˜ = ๐‘
(Semantic) Propagation
¬ ๐‘˜ = ๐‘ โˆจ ๐‘“ ๐‘˜ = ๐‘“(๐‘)
MCSat: Uninterpreted Functions
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘˜ < ๐‘, ๐‘“ ๐‘ > ๐‘Ž, ๐‘˜ = ๐‘Ž โˆ’ 1
๐‘˜ โ†’ 0 ๐‘ โ†’ 0 ๐‘“(๐‘˜) โ†’ 0 ๐‘˜ = ๐‘
๐‘“ ๐‘˜ = ๐‘“(๐‘)
¬ ๐‘˜ = ๐‘ โˆจ ๐‘“ ๐‘˜ = ๐‘“(๐‘)
MCSat: Uninterpreted Functions
๐‘Ž = ๐‘ + 1, ๐‘“ ๐‘˜ < ๐‘, ๐‘“ ๐‘ > ๐‘Ž, ๐‘˜ = ๐‘Ž โˆ’ 1
๐‘˜ โ†’ 0 ๐‘ โ†’ 0 ๐‘“(๐‘˜) โ†’ 0 ๐‘˜ = ๐‘
๐‘“ ๐‘˜ = ๐‘“(๐‘) ๐‘“(๐‘) โ†’ 0
¬ ๐‘˜ = ๐‘ โˆจ ๐‘“ ๐‘˜ = ๐‘“(๐‘)
MCSat โ€“ Finite Basis
We can also use literals from the finite basis in decisions.
Application: simulate branch&bound for bounded linear
integer arithmetic
๐‘ฅ2 6
LP solution:
๐‘ฅ1 โ‰ค 0
๐‘ฅ1 = 0
๐‘ฅ2 = 3
๐‘ฅ1 = 0.8
๐‘ฅ2 = 2.4
๐‘ฅ1 โ‰ฅ 1
๐‘ฅ1 = 1
๐‘ฅ2 = 2
5
4
3
2
1
0
1
2
3
4
5
6
๐‘ฅ1
MCSat: Termination
Propagations
Boolean Decisions
Semantic Decisions
MCSat
โ‰ป
Propagations
Boolean Decisions
Semantic Decisions
MCSat
โ‰ป
Propagations
Boolean Decisions
Semantic Decisions
MCSat
Maximal Elements
โ€ฆ
|๐น๐‘–๐‘›๐‘–๐‘ก๐‘’๐ต๐‘Ž๐‘ ๐‘–๐‘ |
โ€ฆ
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
Conflict
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ โ‰ค 1)
๐‘ฅโ‰ค1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
Conflict
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ โ‰ค 1)
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
๐‘ฅโ‰ค1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
๐‘ฆ โ‰ฅ 1 ๐‘ฅ2 + ๐‘ฆ2 โ‰ค 1
Conflict
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ โ‰ค 1)
๐‘ฅ โ‰ฅ 2,
๐‘ฅโ‰ฅ2
๐‘ฅโ‰ค1
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
¬๐‘ฅ โ‰ฅ 1 โˆจ ๐‘ฆ โ‰ฅ 1 ,
๐‘ฅโ‰ฅ1
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1 โˆจ ๐‘ฅ๐‘ฆ > 1)
๐‘ฆ โ‰ฅ 1 ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
¬ ๐‘ฅ โ‰ฅ 2 โˆจ ¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1)
¬(๐‘ฅ 2 + ๐‘ฆ 2 โ‰ค 1) โˆจ ๐‘ฅ โ‰ค 1
MCSat
๐‘ฅ < 1 โˆจ ๐‘,
๐‘ฅโ†’1
¬๐‘ โˆจ ๐‘ฅ = 2
MCSat
๐‘ฅ < 1 โˆจ ๐‘,
๐‘ฅโ†’1
๐‘
¬๐‘ โˆจ ๐‘ฅ = 2
MCSat
๐‘ฅ < 1 โˆจ ๐‘,
๐‘ฅโ†’1
¬๐‘ โˆจ ๐‘ฅ = 2
๐‘
Conflict (evaluates to false)
MCSat
๐‘ฅ < 1 โˆจ ๐‘,
๐‘ฅโ†’1
¬๐‘ โˆจ ๐‘ฅ = 2
๐‘
New clause
๐‘ฅ <1โˆจ๐‘ฅ =2
MCSat
๐‘ฅ < 1 โˆจ ๐‘,
๐‘ฅโ†’1
¬๐‘ โˆจ ๐‘ฅ = 2
๐‘
New clause
๐‘ฅ <1โˆจ๐‘ฅ =2
๐‘ฅ<1
MCSat
๐‘ฅ < 1 โˆจ ๐‘,
๐‘ฅโ†’1
¬๐‘ โˆจ ๐‘ฅ = 2
๐‘
New clause
๐‘ฅ <1โˆจ๐‘ฅ =2
๐‘ฅ<1
MCSat: Architecture
Arithmetic
Arrays
Boolean
Lists
MCSat: development
MCSat prototype: 7k lines of code
Deduction Rules
Boolean Resolution
Fourier-Motzkin
Equality Split
Ackermann expansion
aka Congruence
Normalization
MCSat: preliminary results
prototype: 7k lines of code
QF_LRA
MCSat: preliminary results
prototype: 7k lines of code
QF_UFLRA and QF_UFLIA
Conclusion
Mode-driven techniques are very promising
Preprocessing
CEGAR
MCSat: new framework for developing SMT solvers
MCSat generalizes NLSat
Modular architecture
Resources: Papers
The Strategy Challenge in SMT Solving, L. de Moura and G. Passmore.
http://research.microsoft.com/en-us/um/people/leonardo/files/smt-strategy.pdf
Solving non-linear arithmetic, D. Jovanovic and L. de Moura
http://research.microsoft.com/en-us/um/people/leonardo/files/IJCAR2012.pdf
A Model Constructing Satisfiability Calculus, L. de Moura and D. Jovanonic
http://research.microsoft.com/en-us/um/people/leonardo/files/mcsat.pdf
The Design and Implementation of the Model Constructing Satisfiability Calculus,
D. Jovanovic, C. Barrett , L. de Moura
http://research.microsoft.com/en-us/um/people/leonardo/mcsat_design.pdf
Resources: Source Code
nlsat
https://z3.codeplex.com/SourceControl/latest#src/nlsat/
mcsat
https://github.com/dddejan/CVC4/tree/mcsat
tactic/preprocessors
https://z3.codeplex.com/SourceControl/latest#src/tactic/