![Page 1: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/1.jpg)
Accelerating lemma learning using joins LPAR 2008 – Doha, Qatar
Nikolaj Bjørner, Leonardo de MouraMicrosoft Research
Bruno DutertreSRI International
![Page 2: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/2.jpg)
Satisfiability Modulo Theories (SMT)
Accelerating lemma learning using joins
SAT
Theories
SMT
ArithmeticBit-vectorsArrays…
![Page 3: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/3.jpg)
Satisfiability Modulo Theories (SMT)
Accelerating lemma learning using joins
)1()2),3,,(((2 xyfyxawritereadfyx
Arithmetic
![Page 4: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/4.jpg)
Satisfiability Modulo Theories (SMT)
Accelerating lemma learning using joins
)1()2),3,,(((2 xyfyxawritereadfyx
ArithmeticArray Theory
![Page 5: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/5.jpg)
Satisfiability Modulo Theories (SMT)
Accelerating lemma learning using joins
)1()2),3,,(((2 xyfyxawritereadfyx
ArithmeticArray TheoryUninterpreted
Functions
![Page 6: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/6.jpg)
SMT: Some Applications @ Microsoft
Accelerating lemma learning using joins
VCC
Hyper-V Terminator T-2
NModel
HAVOC
F7SAGE
Vigilante
![Page 7: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/7.jpg)
SMT@Microsoft: Solver
Accelerating lemma learning using joins
Z3 is a new solver developed at Microsoft Research.Development/Research driven by internal customers.Free for academic research.Interfaces:
http://research.microsoft.com/projects/z3
Z3
TextC/C++.NET
OCaml
![Page 8: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/8.jpg)
SMT = DPLL + Theories
Guessing (case-splitting)Deducing (BCP + Theory propagation)Conflict resolution Backtracking + Lemma
Accelerating lemma learning using joins
a=b f(a)=f(b), a < 5 a > 10, a > 6 b = 2
Most SMT solvers use only the literals from the given
formula!
![Page 9: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/9.jpg)
Is SMT fast???
Accelerating lemma learning using joins
a[0] = 0if (c1) { a[1] = 0; } else { a[1] = 1; }…if (cn) { a[n] = 0; } else { a[n] = 1; }assert(a[0] == 0);
![Page 10: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/10.jpg)
Is SMT fast???
Accelerating lemma learning using joins
a1= write(a0, 0, 0)(c1 a2 = write(a1,1,0))(c1 a2 = write(a1,1,1))…(cn an+1 = write(an,n,0))(cn an+1 = write(an,n,1))read(an+1,0) 0 It takes O(2n) time if
lemmas do not use new literals!
![Page 11: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/11.jpg)
“Diamonds are eternal”
Accelerating lemma learning using joins
![Page 12: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/12.jpg)
SP(E) calculus
Accelerating lemma learning using joins
Very slow in practice!
It can solve “diamonds” in polynomial time.
![Page 13: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/13.jpg)
DPLL (E + )
New literals can be createdCase-splitting (guessing)Lemma Learning
Any SP(E) inference can be simulated by DPLL(E+)
Accelerating lemma learning using joins
![Page 14: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/14.jpg)
How do we create ?
Accelerating lemma learning using joins
![Page 15: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/15.jpg)
Look ahead
Accelerating lemma learning using joins
S
p
p
l
New literal
l
![Page 16: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/16.jpg)
Look ahead
Accelerating lemma learning using joins
SS,
l
![Page 17: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/17.jpg)
“The plan”
Accelerating lemma learning using joins
Define language L (of new literals). Examples:(Bounds) x > 5(Equality) x = y(Difference) x – y < 3
Theory propagation for LJoin operator for L
S
p
p
S1
S2
S1 S2
![Page 18: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/18.jpg)
Join: Examples (Bounds)
Accelerating lemma learning using joins
p q, q x>5, p x>y, y > 4
![Page 19: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/19.jpg)
Join: Examples (Bounds)
Accelerating lemma learning using joins
p
{ x > 5 }
p q, q x>5, p x>y, y > 4
![Page 20: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/20.jpg)
Join: Examples (Bounds)
Accelerating lemma learning using joins
p
{ x > 5 }
p
{ x > 4 }
p q, q x>5, p x>y, y > 4
![Page 21: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/21.jpg)
Join: Examples (Bounds)
Accelerating lemma learning using joins
{ x > 5 } { x > 4 } = {x > 4}
p q, q x>5, p x>y, y > 4
p
{ x > 5 }
p
{ x > 4 }
![Page 22: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/22.jpg)
Join: Examples (Equalities)
Accelerating lemma learning using joins
{ x = y, y = z, x = z } { x = z, z = w, x = w } = {x = z}
![Page 23: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/23.jpg)
Join: Examples (Difference constraints)
Accelerating lemma learning using joins
{ x - y < 3 } { x - y < 2, y - z < 1, x - z < 3} = {x - y < 3}
![Page 24: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/24.jpg)
Join
Accelerating lemma learning using joins
Other examples:Linear arithmetic: polyhedral.Array partial equalities: a =i b (forall x: x = i a[x] = b[x])
k-look ahead.
![Page 25: Nikolaj Bjørner, Leonardo de Moura Microsoft Research Bruno Dutertre SRI International](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5d5503460f94b557f7/html5/thumbnails/25.jpg)
Conclusion
Accelerating lemma learning using joins
SMT solvers are fast, but they may choke in simple formulas.DPLL(join) = SMT + “Abstract Interpretation”.Future work: new literals during conflict resolution.http://research.microsoft.com/projects/z3
Thank You!