smtlib
A high-level API for interacting with SMT solvers
If you are looking for more control and less ergonomics, take a look at the low-level crate smtlib-lowlevel
for construct SMT-LIB code and talking directly with SMT solvers.
Background
Satisfiability modulo theories (SMT) is the problem of determining whether or not a mathematical formula is satisfiable. SMT solvers (such as Z3 and cvc5) are programs to automate this process. These are fantastic tools which are very powerful and can solve complex problems efficiently.
To communicate with the solvers, the SMT-LIB specification has been made to standardize the input/output language to all of the solvers.
Writing this format by-hand (or "programmatically by-hand") can at times be tedious and error prone. Even more so is interpreting the result produced by the solvers.
Thus the goal of smtlib
(and smtlib-lowlevel
) is to provide ergonomic API's for communicating with the solvers, independent of the concrete solver.
Usage
The primary way to use smtlib
is by constructing a smtlib::Solver
. A solver takes as argument a smtlib::Backend
. To see which backends are provided with the library check out the smtlib::backend
module. Each backend is behind a feature flag, so for example to use the Z3 binary backend install smtlib
by running
Now you can go ahead and use the library in your project.
use ;