Formal legal verification just went fully Pure Rust.
Today we released Legalis-RS 0.1.2 — the legal verifier swaps its C++ Z3 dependency for OxiZ, the Pure-Rust SMT solver, so rigorous proofs now build like any other Rust crate, alongside a zero-warning hardening pass across the whole workspace.
No C. No C++. No Fortran. Legalis-RS is a Pure Rust framework for parsing, analyzing, and simulating legal statutes — Legal DX — cleanly separating Deterministic Logic from Judicial Discretion. The whole stack compiles to a single static binary or to WASM, with no native toolchain in the way. Until now, one optional path broke that promise: the formal verifier’s SMT backend leaned on the C++ Z3 library. As of 0.1.2 that last non-Pure-Rust dependency is gone, replaced by OxiZ — which means even the rigorous proofs are sovereign Pure Rust, end to end.
In a world of closed legal SaaS, Java/Python legal stacks, and verification engines bolted to a C++ solver, Legalis-RS stays small, inspectable, and yours: one binary, one toolchain, no surprises at deploy time.
Why 0.1.2 is a milestone
Formal legal verification with Z3 always came with a tax. To prove that a body of statutes contained no contradictions — no unsatisfiable conditions, no logical dead ends — you had to bring in the C++ Z3 library: brew install z3, then source setup-z3-env.sh to wire up the environment, then hope the system solver matched what your build expected. It was fragile, platform-specific, and effectively un-shippable as a clean Rust artifact.
0.1.2 removes that tax. OxiZ delivers the same SMT-backed contradiction and unsatisfiability checking with a plain cargo build. The concrete wins:
- No native dependencies. No system Z3, no
brew install z3, nosetup-z3-env.sh. Enabling the SMT backend is now 100% Pure Rust. - One flag. Rigorous proofs are a single
--features smt-solveraway. - Reproducible builds. No environment variables or out-of-band system state — the proof engine ships in your
Cargo.locklike everything else. - Zero warnings across 25 crates under
-D warnings. - 11,365 tests passing across all features.
Technical Deep Dive: from Z3 to OxiZ
In 0.1.0 and 0.1.1, the legalis-verifier crate’s optional SMT backend was the C++ Z3 library. Its Cargo.toml pulled z3 = "0.12" behind a z3-solver feature, and using it required a system Z3 install plus an environment setup script.
In 0.1.2, that z3 dependency is removed and replaced with OxiZ — the COOLJAPAN Pure-Rust Z3 alternative — via oxiz-solver = "0.1.1" and oxiz-core = "0.1.1". The verifier’s feature is now:
smt-solver = ["oxiz-solver", "oxiz-core", "num-bigint"]
The old z3-solver feature is gone.
What the verifier does is unchanged. It still performs circular-reference detection, dead-statute and unsatisfiable-condition detection, and constitutional-compliance checking. Only the proof engine underneath changed — and it’s now Pure Rust. The default build still ships with no SMT backend at all, keeping it lean; enabling smt-solver stays entirely C/C++-free.
OxiZ is a COOLJAPAN sibling that first shipped on 2026-01-12, just five days before this release. It is the Pure-Rust SMT solver that makes this migration possible — a drop-in spirit replacement for Z3 that fits the Pure Rust deployment model rather than fighting it.
Getting Started
Add the core library:
cargo add legalis-core
This also provides the legalis CLI binary.
To opt into rigorous, SMT-backed proofs (no system Z3 required anymore):
cargo add legalis-verifier --features smt-solver
Then build and verify a statute:
use legalis_core::{Statute, Condition, Effect, EffectType, ComparisonOp};
use legalis_verifier::StatuteVerifier;
let statute = Statute::new(
"voting-rights",
"Voting Rights Act",
Effect::new(EffectType::Grant, "Right to vote in elections"),
)
.with_precondition(Condition::Age {
operator: ComparisonOp::GreaterOrEqual,
value: 18,
});
let verifier = StatuteVerifier::new();
let result = verifier.verify(&[statute]);
if !result.passed {
for error in result.errors {
eprintln!("Verification error: {}", error);
}
}
What’s New in 0.1.2
- Z3 → OxiZ SMT migration. The
legalis-verifierSMT backend moved from the C++z3crate to Pure-Rustoxiz-solver/oxiz-core. The feature was renamed fromz3-solvertosmt-solver. Rigorous proofs are now C/C++-free. - Zero warnings across all 25 crates under
-D warnings. - 11,365 tests passing across all features.
- Code-quality cleanup — fixed 50+ clippy warnings across 16 files:
legalis-interop: push_str and manual-pattern fixes in 7 files (blockchain_docs, cadence, move_lang, solidity, universal_format, vyper).legalis-llm: removed needless borrows and collapsed nested-if statements (document_intelligence, simulation).legalis-viz: 11 push_str / format fixes.legalis-chain: 4 push_str fixes.legalis-api: fixed a mutex guard held across an await, plus useless format calls (changelog, cqrs, event_schema, playground).legalis-dsl: derived theDefaulttrait; updated benchmarks tostd::hint::black_box.
- Documentation — README.md and TODO.md version references updated to 0.1.2.
- Canada (
legalis-ca) and Australia (legalis-au) jurisdiction crates are now present in the workspace.
Tips
-
Enable rigorous proofs with one flag. Add
--features smt-solvertolegalis-verifierand you get full SMT-backed verification — nobrew install z3, no setup script anymore:cargo add legalis-verifier --features smt-solver -
Keep the default build lean. Out of the box, the verifier ships no SMT backend at all. Only opt in when you actually need unsatisfiability or contradiction proofs.
-
Migrating from 0.1.1? Rename your
z3-solverfeature tosmt-solver, and delete anysetup-z3-env.shusage — it’s no longer needed. -
Catch problems before enactment. Use the verifier to flag dead statutes (unsatisfiable conditions) and circular references while a body of law is still a draft.
-
Wire the clean build into CI. The whole workspace now compiles under
-D warnings, so add it to your pipeline:cargo build --workspace --all-features
Part of the COOLJAPAN ecosystem
Legalis-RS 0.1.2 builds directly on OxiZ, the COOLJAPAN Pure-Rust SMT solver, joining a family of sovereign Pure-Rust libraries — including SciRS2 for scientific computing — that share one principle: no C, no C++, no Fortran in the default path.
Repository: https://github.com/cool-japan/legalis
Star the repo if you believe legal technology — even the formal proofs — belongs in Pure Rust. Pure Rust legal-tech is here: fast, safe, and sovereign.
— KitaSan at COOLJAPAN OÜ January 17, 2026