# Z3\_mojo: Z3 bindings for Mojo

**URL:** <https://forum.modular.com/t/z3-mojo-z3-bindings-for-mojo/3737>\
**Category:** Community Showcase\
**Created:** [December 2, 2026, 4:09pm UTC](https://forum.modular.com/t/z3-mojo-z3-bindings-for-mojo/3737 "2026-12-02T16:09:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatolvitold](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/anatolvitold/32/1326_2.png) [@anatolvitold](https://forum.modular.com/u/anatolvitold)\
**Post date:** [December 2, 2026, 4:09pm UTC](https://forum.modular.com/t/z3-mojo-z3-bindings-for-mojo/3737/1 "2026-12-02T16:09:22Z")

</div>

In this community, Z3 does not need an introduction. Now it has Mojo bindings 🙂

If you have used `z3-solver` in Python, the main API (`from z3_mojo import ...`) will look familiar:

```mojo
from std.testing import assert_equal
from z3_mojo import Context, Real, Solver, unsat

def main() raises:
    var ctx = Context()
    var s = Solver.from_tactic(ctx, "qfnra-nlsat")
    var x = Real("x", ctx)
    s.add(x * x < 0)
    assert_equal(s.check(), unsat)

```

When you need the low-level layer, `z3_mojo.c` exposes all 817 exported `Z3_*` C functions directly. The bindings are generated and checked against the Z3 headers.

Repo: [GitHub - Spellbound-Mojo/z3\_mojo: Mojo bindings for Z3 SMT solver · GitHub](https://github.com/Spellbound-Mojo/z3_mojo)  
Documentation: [Welcome · Z3 Mojo](https://spellbound-mojo.github.io/z3_mojo/)

Soon to appear in the `modular-community` Pixi channel ([modular-community#470](https://github.com/modular/modular-community/pull/470)).
