decision methods for arithmetic third summer school on formal methods
DESCRIPTION
Decision methods for arithmetic Third summer school on formal methods. Leonardo de Moura Microsoft Research. Symbolic Reasoning. Software analysis/verification tools need some form of symbolic reasoning. Logic is “The Calculus of Computer Science” Zohar Manna. Saturation x Search. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/1.jpg)
Decision methods for arithmeticThird summer school on formal methods
Leonardo de Moura Microsoft Research
![Page 2: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/2.jpg)
Software analysis/verification tools need some form of symbolic reasoning
Symbolic Reasoning
Logic is “The Calculus of Computer Science”Zohar Manna
![Page 3: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/3.jpg)
Saturation x Search
Proof-finding Model-finding
Models
Proo
fsConflict
Resolution
![Page 4: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/4.jpg)
SAT
CNF is a set (conjunction) set of clausesClause is a disjunction of literalsLiteral is an atom or the negation of an atom
![Page 5: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/5.jpg)
Two procedures
Resolution DPLLProof-finder Model-finderSaturation Search
![Page 6: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/6.jpg)
Resolution
ImprovementsDelete tautologies Ordered ResolutionSubsumption (delete redundant clauses)
…
unsat
![Page 7: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/7.jpg)
Resolution: Example
![Page 8: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/8.jpg)
Resolution: Example
![Page 9: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/9.jpg)
Resolution: Example
![Page 10: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/10.jpg)
Resolution: Example
![Page 11: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/11.jpg)
Resolution: Example
![Page 12: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/12.jpg)
Resolution: Problem
Exponential time and space
![Page 13: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/13.jpg)
Unit Resolution
Complete for Horn Clauses
subsumes
![Page 14: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/14.jpg)
DPLL
DPLL = Unit Resolution + Split rule
Split rule
𝑆 ,𝑝 𝑆 ,¬𝑝
![Page 15: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/15.jpg)
DPLL𝑥∨ 𝑦 ,¬𝑥∨𝑦 , 𝑥∨¬ 𝑦 ,¬𝑥∨¬ 𝑦
![Page 16: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/16.jpg)
DPLL𝑥∨ 𝑦 ,¬𝑥∨𝑦 , 𝑥∨¬ 𝑦 ,¬𝑥∨¬ 𝑦
![Page 17: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/17.jpg)
DPLL𝑥∨ 𝑦 ,¬𝑥∨𝑦 , 𝑥∨¬ 𝑦 ,¬𝑥∨¬ 𝑦
![Page 18: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/18.jpg)
DPLL𝑥∨ 𝑦 ,¬𝑥∨𝑦 , 𝑥∨¬ 𝑦 ,¬𝑥∨¬ 𝑦
![Page 19: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/19.jpg)
DPLL𝑥∨ 𝑦 ,¬𝑥∨𝑦 , 𝑥∨¬ 𝑦 ,¬𝑥∨¬ 𝑦
![Page 20: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/20.jpg)
DPLL𝑥∨ 𝑦 ,¬𝑥∨𝑦 , 𝑥∨¬ 𝑦 ,¬𝑥∨¬ 𝑦
![Page 21: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/21.jpg)
CDCL: Conflict Driven Clause Learning
Resolution
DPLLConflict
Resolution
Proof
Model
![Page 22: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/22.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
![Page 23: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/23.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Propagations
![Page 24: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/24.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Propagations
𝑥≥1
![Page 25: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/25.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Propagations
𝑥≥1 𝑦 ≥1
![Page 26: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/26.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Decisions
𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1
![Page 27: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/27.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Model Assignments
𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1𝑥→2
![Page 28: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/28.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Model Assignments
𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1𝑥→2
We can’t falsify any fact in the trail.
![Page 29: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/29.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Conflict
𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1𝑥→2
We can’t find a value of s.t.
![Page 30: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/30.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Conflict
𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1𝑥→2
We can’t find a value of s.t.
Learning that = 2)is not productive
![Page 31: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/31.jpg)
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2
Conflict
𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1𝑥→2
𝑦
𝑥
𝑥2+ 𝑦2≤1 𝑥→2
−1≤ 𝑥 , 𝑥≤1
¬(𝑥2+ 𝑦2≤1)∨𝑥≤1
![Page 32: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/32.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1 𝑥≤1
¬(𝑥2+𝑦2≤1)∨𝑥≤1
![Page 33: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/33.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1 𝑥≤1
¬(𝑥2+𝑦2≤1)∨𝑥≤1Conflict¬ (𝑥≥2 )∨¬(𝑥≤1)
![Page 34: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/34.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1
¬(𝑥2+𝑦2≤1)∨𝑥≤1Learned by resolution¬ (𝑥≥2 )∨¬(𝑥2+𝑦2≤1)
![Page 35: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/35.jpg)
MCSat
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1¬(𝑥2+𝑦2≤1)
¬(𝑥2+𝑦2≤1)∨𝑥≤1¬ (𝑥≥2 )∨¬(𝑥2+𝑦2≤1)
![Page 36: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/36.jpg)
MCSat – Finite BasisEvery theory that admits quantifier elimination has a finite basis (given a fixed assignment order)
𝐹 [𝑥1 ,…,𝑥𝑛 , 𝑦1 ,…, 𝑦𝑚]
∃𝑥1 ,…, 𝑥𝑛 :𝐹 [𝑥1 ,…,𝑥𝑛 , 𝑦 ]
𝐶1[𝑦1 ,…, 𝑦𝑚]∧…∧𝐶𝑘[𝑦1 ,…, 𝑦𝑚 ]
¬𝐹 [𝑥1 ,…,𝑥𝑛 , 𝑦1 ,…, 𝑦𝑚 ]∨𝐶𝑘[𝑦1 ,…, 𝑦𝑚]
![Page 37: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/37.jpg)
MCSat – Finite Basis
𝐹 1[𝑥1]
𝐹 2[𝑥1 ,𝑥2]
𝐹 𝑛[𝑥1 ,𝑥2,…, 𝑥𝑛−1 ,𝑥𝑛]
𝐹 𝑛−1[𝑥1 ,𝑥2 ,…, 𝑥𝑛−1]…
![Page 38: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/38.jpg)
MCSat – Finite Basis
𝐹 1[𝑥1]
𝐹 2[𝑥1 ,𝑥2]
𝐹 𝑛[𝑥1 ,𝑥2,…, 𝑥𝑛−1 ,𝑥𝑛]
𝐹 𝑛−1[𝑥1 ,𝑥2 ,…, 𝑥𝑛−1]…
![Page 39: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/39.jpg)
MCSat – Finite Basis
𝐹 1[𝑥1]
𝐹 2[𝑥1 ,𝑥2]
𝐹 𝑛[𝑥1 ,𝑥2,…, 𝑥𝑛−1 ,𝑥𝑛]
𝐹 𝑛−1[𝑥1 ,𝑥2 ,…, 𝑥𝑛−1]…
![Page 40: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/40.jpg)
MCSat – Finite Basis
𝐹 1[𝑥1]
𝐹 2[𝑥1 ,𝑥2]
𝐹 𝑛[𝑥1 ,𝑥2,…, 𝑥𝑛−1 ,𝑥𝑛]
𝐹 𝑛−1[𝑥1 ,𝑥2 ,…, 𝑥𝑛−1]…
![Page 41: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/41.jpg)
MCSat – Finite BasisEvery “finite” theory has a finite basis
𝐹 [𝑥1 ,…,𝑥𝑛 , 𝑦1 ,…, 𝑦𝑚]
![Page 42: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/42.jpg)
MCSat – Finite BasisTheory 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.
![Page 43: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/43.jpg)
MCSat: Termination
Propagations
Decisions
Model Assignments
![Page 44: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/44.jpg)
MCSat
≻Propagations
Decisions
Model Assignments
![Page 45: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/45.jpg)
MCSat
≻
Propagations
Decisions
Model Assignments
![Page 46: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/46.jpg)
MCSat
¿𝐹𝑖𝑛𝑖𝑡𝑒𝐵𝑎𝑠𝑖𝑠∨¿
…Maximal Elements
![Page 47: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/47.jpg)
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1 𝑥≤1
¬(𝑥2+𝑦2≤1)∨𝑥≤1Conflict¬ (𝑥≥2 )∨¬(𝑥≤1)
![Page 48: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/48.jpg)
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1 𝑥≤1
¬(𝑥2+𝑦2≤1)∨𝑥≤1Conflict¬ (𝑥≥2 )∨¬(𝑥≤1)
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1¬(𝑥2+𝑦2≤1)
¬(𝑥2+𝑦2≤1)∨𝑥≤1¬ (𝑥≥2 )∨¬(𝑥2+𝑦2≤1)
![Page 49: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/49.jpg)
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1𝑥2+ 𝑦2≤1 𝑥≤1
¬(𝑥2+𝑦2≤1)∨𝑥≤1Conflict¬ (𝑥≥2 )∨¬(𝑥≤1)
𝑥≥2 , (¬𝑥≥1∨ 𝑦 ≥1 ) ,(𝑥2+ 𝑦2≤1∨𝑥𝑦>1)
𝑥≥2 𝑥≥1 𝑦 ≥1¬(𝑥2+𝑦2≤1)
¬(𝑥2+𝑦2≤1)∨𝑥≤1¬ (𝑥≥2 )∨¬(𝑥2+𝑦2≤1)
![Page 50: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/50.jpg)
𝑥<1∨𝑝 ,¬𝑝∨𝑥=2
𝑥→1
MCSat
![Page 51: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/51.jpg)
𝑥<1∨𝑝 ,¬𝑝∨𝑥=2
𝑥→1
MCSat
𝑝
![Page 52: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/52.jpg)
𝑥<1∨𝑝 ,¬𝑝∨𝑥=2
𝑥→1
MCSat
𝑝
Conflict (evaluates to false)
![Page 53: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/53.jpg)
𝑥<1∨𝑝 ,¬𝑝∨𝑥=2
𝑥→1
MCSat
𝑝
New clause𝑥<1∨𝑥=2
![Page 54: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/54.jpg)
𝑥<1∨𝑝 ,¬𝑝∨𝑥=2
𝑥→1
MCSat
𝑝
New clause𝑥<1∨𝑥=2
𝑥<1
![Page 55: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/55.jpg)
𝑥<1∨𝑝 ,¬𝑝∨𝑥=2
𝑥→1
MCSat
𝑝
New clause𝑥<1∨𝑥=2
𝑥<1
![Page 56: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/56.jpg)
MCSat: Architecture
Arithmetic
Boolean Lists
Arrays
![Page 57: Decision methods for arithmetic Third summer school on formal methods](https://reader035.vdocument.in/reader035/viewer/2022062521/568166fd550346895ddb61e2/html5/thumbnails/57.jpg)
MCSat: development