1 / 24

The SMT solver Z3 Lecture 3, 2012

The SMT solver Z3 Lecture 3, 2012. Nikolaj Bjørner Microsoft Research DTU Winter course January 4 th 2012 Organized by Hanne Riis Nielson, Flemming Nielson. Plan. Overview and architecture of Z3 What is Z3 How to use Z3. Takeaways :.

luka
Download Presentation

The SMT solver Z3 Lecture 3, 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. The SMT solver Z3 Lecture 3, 2012 Nikolaj Bjørner Microsoft Research DTU Winter course January 4th 2012 Organized by Hanne Riis Nielson, Flemming Nielson

  2. Plan • Overview and architecture of Z3 • What is Z3 • How to use Z3

  3. Takeaways: • You will have an idea of what Z3 is and ways of using it

  4. Follow-on questions

  5. What is Z3? Theories Simplify OCaml Arrays Bit-Vectors .NET SMT-LIB Lin-arithmetic Groebner basis C Recursive Datatypes Comb. Array Logic Native Free (uninterpreted) functions F# quote Quantifiers: E-matching Model Generation: Finite Models Quantifiers: Super-position Proof objects Assumption tracking Parallel Z3 By Leonardo de Moura & Nikolaj Bjørner http://research.microsoft.com/projects/z3

  6. Z3: Little Engines of Proof Freely available from http://research.microsoft.com/projects/z3

  7. Input Formats

  8. Input Formats • Text: • SMT-LIB2 - main exchange format for SMT solvers • Simplify - legacy format by Simplify Theorem Prover • Native Z3 - low-level for storing formulas (and replay) • Log - low-level log for replay • TPTP - format used for first-order theorem provers • Programmatic: • C - API functions exposed for C • Ocaml - Ocaml wrapper around C API • .NET - .NET wrapper around C API • Scala, Python - by Phillip Suter and Sascha Böhme

  9. A Primer on SMT-LIB2 • See online Interactive tutorial • http://rise4fun.com/z3tutorial

  10. LINQ/F#: Sample layer on top of API Create Quoted Expression open Microsoft.Z3 open Microsoft.Z3.Quotations do Solver.prove <@ Logic.declare (fun t11 t12 t21 t22 t31 t32 -> not ((t11 >= 0I) && (t12 >= t11 + 2I) && (t12 + 1I <= 8I) && (t21 >= 0I) && (t22 >= t21 + 3I) && (t32 + 1I <= 8I) && (t31 >= 0I) && (t32 >= t31 + 2I) && (t32 + 3I <= 8I) && (t11 >= t21 + 3I || t21 >= t11 + 2I) && (t11 >= t31 + 2I || t31 >= t11 + 2I) && (t21 >= t31 + 2I || t31 >= t21 + 3I) && (t12 >= t22 + 1I || t22 >= t12 + 1I) && (t12 >= t32 + 3I || t32 >= t12 + 1I) && (t22 >= t32 + 3I || t32 >= t22 + 1I) ) ) @> SMT@Microsoft

  11. Theories

  12. Theories • Uninterpretedfunctions • Arithmetic (linear) • Bit-vectors • Algebraic data-types • Arrays • User-defined

  13. Theories • Uninterpreted functions • Arithmetic (linear) • Bit-vectors • Algebraic data-types • Arrays • User-defined

  14. Theories • Uninterpreted functions • Arithmetic (linear) • Bit-vectors • Algebraic data-types • Arrays • User-defined

  15. Theories • Uninterpreted functions • Arithmetic (linear) • Bit-vectors • Algebraic data-types • Arrays • User-defined

  16. Theories • Uninterpreted functions • Arithmetic (linear) • Bit-vectors • Algebraic data-types • Arrays • User-defined

  17. User-interaction and Guidance

  18. Interaction models • Text: SMT-LIB, SMT-LIB2, Native Yices (high-level), Native Z3 (low-level), Simplify • Programmatic APIs: C, Ocaml, .NET, LINQ,

  19. Interaction Logical Formula Sat/Model

  20. Interaction Logical Formula Unsat/Proof

  21. Interaction Logical Formula Simplify

  22. Interaction Logical Formula • x and y are equal • z + y and x + z are equal Implied Equalities

  23. Interaction Logical Formula Quantifier Elimination

  24. Interaction Logical Formula Unsat. Core

More Related