Repository navigation
Quod 0.1.0
The first release of Quod: a language for AI agents to write, where every program comes with its
proof, and every contract must determine its result.
Install
Download the package for your system, unpack it, and run quod from that folder. z3 4.12.1 is
inside, next to quod: nothing else to install. To generate code, Python 3.10 or later.
| System | Package |
|---|---|
| Windows x64 | quod-0.1.0-win-x64.zip |
| Linux x64 (glibc 2.35 or later: Ubuntu 22.04+, Debian 12+) | quod-0.1.0-linux-x64.tar.gz |
| macOS, Apple silicon | quod-0.1.0-osx-arm64.tar.gz |
On macOS, the binaries are not signed: after unpacking, run
xattr -d com.apple.quarantine quod z3 in the folder.
quod check examples/binary_search.quod
quod build examples/prefix_sums.quod --target python
What Quod 0.1 is
- Pure functions on integers, booleans, sequences and tuples, with
requires,ensures, loop
invariants anddecreases;lemmafor proofs, erased from the generated code. quod checkproves every obligation with z3, and checks that each contract determines its
result (or declares its freedom withloose): a contract that says too little does not compile,
and the compiler shows two results it accepts.- Before asking the solver, each function is run on small inputs that satisfy its
requires
(and on inputs the solver finds when a quantifiedrequiresmakes them rare): a broken
obligation comes with a confirmed counterexample, in milliseconds. - Diagnostics for agents: JSON with counterexamples and where they come from, the solver's reason
when it gives up, the style of each contract, eachloose, and the functions a reviewer must
read; a time budget for the whole check. quod build --target pythongenerates a Python module that keeps the complexity of the Quod
program.
The language: spec/quod-0.1.md.
The measurements (agents writing Quod, a mutant bench):
bench/quod.