Z3 Theorem Prover


Z3 Theorem Prover is a cross-platform satisfiability modulo theories solver by Microsoft.

Overview

Z3 was developed in the Research in Software Engineering group at Microsoft Research and is targeted at solving problems that arise in software verification and software analysis. Z3 supports arithmetic, fixed-size bit-vectors, extensional arrays, datatypes, uninterpreted functions, and quantifiers. Its main applications are extended static checking, test case generation, and predicate abstraction.
In 2015, it received the Programming Languages Software Award from ACM SIGPLAN. In 2018, Z3 received the Test of Time Award from the European Joint Conferences on Theory and Practice of Software. Microsoft researchers Nikolaj Bjørner and Leonardo de Moura received the 2019 Herbrand Award for Distinguished Contributions to Automated Reasoning in recognition of their work in advancing theorem proving with Z3.
Z3 was open sourced in the beginning of 2015. The source code is licensed under MIT License and hosted on GitHub.
The solver can be built using Visual Studio, a Makefile or using CMake and runs on Windows, FreeBSD, Linux, and macOS.
It has bindings for various programming languages including C, C++, Java, Haskell, OCaml, Python, WebAssembly, and.NET/Mono. The default input format is SMTLIB2.

Examples

Propositional and predicate logic

In this example propositional logic assertions are checked using functions to represent the propositions a and b. The following Z3 script checks to see if ¬ ≡ :


)))

Result:
sat

Solving equations

The following script solves the two given equations, finding suitable values for the variables a and b:



)


Result:
sat
Int
-10)
Int
30)
)