1 / 45

Introduction to SMT Lecture 2, 2012

Introduction to SMT Lecture 2, 2012. Nikolaj Bjørner Microsoft Research DTU Winter course January 3 rd 2012 Organized by Hanne Riis Nielson, Flemming Nielson. Background Reading. September 2011. Plan. General overview of what is SMT Compare with SAT, first-order theorem proving,..

telma
Download Presentation

Introduction to SMT Lecture 2, 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to SMT Lecture 2, 2012 Nikolaj Bjørner Microsoft Research DTU Winter course January 3rd2012 Organized by Hanne Riis Nielson, Flemming Nielson

  2. Background Reading September 2011

  3. Plan • General overview of what is SMT • Compare with SAT, first-order theorem proving,.. • Refresher on SAT and modern DPLL • Introduction to SMT solving techniques • Selected SMT applications (more Jan 4,5th)

  4. Takeaways - this section should teach: • The syntax and semantics of SAT/SMT. • Algorithmic principles of modern SAT solvers • Algorithmic principles of modern SMT solvers

  5. Some context On Theorem Proving

  6. Symbolic Engines: SAT, FTP and SMT • SAT: Propositional Satisfiability. (Tie  Shirt)  (Tie Shirt)  (Tie  Shirt) • FTP: First-order Theorem Proving. X,Y,Z [X*(Y*Z) = (X*Y)*Z] X [X*inv(X) = e] X [X*e = e] • SMT: Satisfiability Modulo background Theoriesb + 2 = c  A[3]≠ A[c-b+1]

  7. SAT - Milestones Problems impossible 10 years ago are trivial today Concept 2002 2010 Millions of variables from HW designs Courtesy Daniel le Berre

  8. FTP - Milestones • Some successstories: • Open Problems (of 25 years):XCB: X  ((X  Y)  (Z  Y))  Z)is a single axiom for equivalence • Knowledge Ontologies GBs of formulas Courtesy Andrei Voronkov, Manchester U

  9. SMT - Milestones Z3 (of ’07) Time On BoogieRegression 1sec Simplify (of ’01) time Z3 Time On VCC Regression Includes progress from SAT: 15KLOC + 285KLOC = Z3 Nov 08 March 09

  10. Introducing SMT by examples

  11. Satisfiability Modulo Theories (SMT) • Is formula satisfiable modulo theory T ? SMT solvers have specialized algorithms for T

  12. Satisfiability Modulo Theories (SMT) Array Theory Arithmetic Uninterpreted Functions

  13. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), c-2)) ≠ f(c-b+1)

  14. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), c-2)) ≠ f(c-b+1) Arithmetic

  15. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), c-2)) ≠ f(c-b+1) Array Theory Arithmetic

  16. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), c-2)) ≠ f(c-b+1) Uninterpreted Functions Array Theory Arithmetic

  17. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), c-2)) ≠ f(c-b+1) • Substituting c by b+2

  18. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), b+2-2)) ≠ f(b+2-b+1) • Simplifying

  19. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), b)) ≠ f(3)

  20. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(select(store(a,b,3), b)) ≠ f(3) • Applying array theory axiom

  21. Satisfiability Modulo Theories (SMT) • b + 2 = c and f(3) ≠ f(3) • Inconsistent/Unsatisfiable

  22. Job Shop Scheduling Machines Tasks Jobs P = NP? Laundry

  23. Job Shop Scheduling Constraints: Precedence: between two tasks of the same job Resource: Machines execute at most one job at a time 3 1 2 4

  24. Job Shop Scheduling Constraints: Encoding: Precedence: - start time of job 2 on mach 3 - duration of job 2 on mach 3 Resource: 3 1 2 4 Notconvex

  25. Job Shop Scheduling

  26. Job Shop Scheduling Efficient solvers: - Floyd-Warshal algorithm - Ford-Fulkerson algorithm case split case split

  27. SAT solving

  28. Modern DPLL in a nutshell Adapted and modified from [Nieuwenhuis, Oliveras, Tinelli J.ACM 06]

  29. SMT solving

  30. DPLL(T) solver interaction T- Propagate T- Conflict

  31. Main components of modern SMT Solvers Purification Note: read is just another name for select, write is just another name for store

  32. Main components of modern SMT Solvers Purification

  33. Main components of modern SMT Solvers Purification Arithmetic Arrrays Functions

  34. Main components of modern SMT Solvers Propositional Abstraction

  35. Main components of modern SMT Solvers Propositional Assignment Using SAT solver

  36. Main components of modern SMT Solvers Theory Solving Arithmetic Arrays Theories exchange equalities between shared variables. But how? Free functions 

  37. Model-based Combination The running example was easy. But what about: Either or . or (are integers) Arithmetic module needs to somehow learn that . - Integer linear arithmetic is non-convex.

  38. Model-based combination • Delayed Theory Combination solution [2006 Bruttomesso et.al.] Add equality literals for every pair of shared variables: : Solvers work completely independently. : Works with non-convex theories. : O(n2) up-front cost. No use of propagation.

  39. Model-based combination Idea: • Have solvers produce models. • Use models to introduce equalities on demand. If Then guess : No up-front O(n2) cost of adding equalities : Works with non-convex theories : Models are conservative approximations then

  40. Model-based - Example

  41. Model-based - Example

  42. Model-based - Example

  43. Model-based - Example

  44. Model-based - Example

  45. Model-based - Example

More Related