Skip to main content

Crate z3rs

Crate z3rs 

Source
Expand description

§z3rs — a pure-Rust port of the Z3 theorem prover

z3rs is a from-scratch reimplementation of Z3 (v4.17.0) in safe, idiomatic Rust. The goal is a 1:1 behavioural port of 100% of Z3 with no third-party or native dependency — no GMP, no C. The crate is no_std (needs only alloc) by default; the optional std feature adds std-backed conveniences. Its sole dependency is our own pure-Rust, dependency-free numeric core puremp, re-exported below and used directly throughout the port.

This is a large, multi-phase effort. See ROADMAP.md for the staged plan, and PORTING.md for the porting methodology and differential-testing strategy against upstream Z3.

§Attribution

z3rs is a derivative work of Z3, Copyright (c) Microsoft Corporation, used under the MIT License. See LICENSE and NOTICE.

§Architecture

The module tree mirrors Z3’s src/ component layering. Modules are ordered bottom-up by dependency (each layer only uses layers above it in this list):

ModulePhaseUpstream z3/src/…
util0util (bignum, containers, symbols, params infra)
math1math/* (polynomial, interval, simplex, dd, lp, …)
ast1ast (terms, sorts, decls, theory decl_plugins)
params1params
rewriter2ast/rewriter, ast/euf, ast/normal_forms, …
model3model
tactic3tactic + tactic portfolio
sat4sat, sat/smt
nlsat5nlsat, math/realclosure
smt5smt (core SMT engine)
solver6solver
cmd_context6cmd_context, parsers/smt2
qe7qe, qe/mbp
muz7muz (Datalog / Spacer / Horn)
opt7opt (MaxSAT / optimization)
parsers8parsers
api9api (C ABI + safe Rust surface)

Most modules are functional (see ROADMAP.md for live phase status); a few upper-layer components remain documented scaffolds.

Re-exports§

pub use puremp;

Modules§

api
api — C-compatible API surface + safe idiomatic Rust API
ast
ast — expression / sort / decl representation and the theory decl plugins
cmd_context
cmd_context — SMT-LIB2 command interpreter
math
math — Exact math: polynomial arithmetic, intervals, simplex, decision diagrams, Groebner, linear programming
model
model — Models and model evaluation
muz
muz — Fixedpoint / Datalog / Spacer (Horn clauses)
nlsat
nlsat — Nonlinear arithmetic SAT, real closed fields
opt
opt — Optimization: MaxSAT, MaxSMT, Pareto
params
params — Parameter descriptor tables (param_descrs) for every module
parsers
parsers — the frontend parsers, gathered as one entry point
qe
qe — Quantifier elimination, model-based projection
rewriter
rewriter — term rewriting and simplification
sat
sat — propositional SAT core
smt
smt — core SMT engine
solver
solver — Solver abstraction, combined/parallel solvers
tactic
tactic — Goals, the tactic framework, probes, and the combinators
util
util — Foundation: numerals, containers, hashtables, symbols, vectors, params infra, rlimit, memory, sexpr

Constants§

VERSION
z3rs crate version.
Z3_UPSTREAM_VERSION
The upstream Z3 version this port tracks.