Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p4l1ly/z3-rust
High level bindings for the Microsoft's Z3 SMT solver.
https://github.com/p4l1ly/z3-rust
Last synced: 1 day ago
JSON representation
High level bindings for the Microsoft's Z3 SMT solver.
- Host: GitHub
- URL: https://github.com/p4l1ly/z3-rust
- Owner: p4l1ly
- Created: 2018-09-20T12:55:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-03T13:07:20.000Z (about 6 years ago)
- Last Synced: 2024-05-22T21:32:32.314Z (6 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - z3-rust - high level bindings for the Microsoft's Z3 SMT solver. (Projects / Libraries)
README
High level interface to the Z3 SMT solver. Currently, only support for boolean
logic is implemented. It is therefore usable only as a SAT solver. We have not
yet considered thread safety or reasonable behaviour if multiple contexts are
used at once.```
use z3::Stage;// Start to use Z3.
let mut ctx = z3::Context::new();// Create a variable.
let foo = ctx.var_from_string("foo");// Add it to the solver.
ctx.assert(foo);{
// Push Z3 solver's stack.
let mut p = ctx.push();// A basic example of combining formulae.
let foo_and_not_foo = p.and(vec![foo.inherit(), p.not(foo)]);
p.assert(foo_and_not_foo);// No way to satisfy foo && !foo.
assert!(!p.is_sat())} // Pop Z3 solver's stack.
assert!(ctx.is_sat())
```