Skip to content

SVL v0.2.0 — contract-prover soundness pass

Choose a tag to compare

@sudo-ai-git sudo-ai-git released this 13 Nov 04:29
· 17 commits to main since this release

What is in this release

The contract prover no longer proves false theorems. svl/contract_prover.py
lowers requires / ensures / loop-invariant to Z3 obligations and runs inside
verify_gate.verify_program. The first cut reported proven for programs whose
contracts were false. Six defects, each reproduced before the fix and each pinned
by a test that fails when the defect is reintroduced (6/6 mutations falsified):

# Defect Effect
1 Driver breaked after the first function with a contract a broken ensures in function two was invisible
2 Post-state bindings asserted into the antecedent instead of substituted into the clause x == 0 && x == 5 is unsat ⇒ every obligation discharged vacuously
3 Sequencing was a flat "last RHS wins" map of evaluated terms x = x + 1 lost its dependency on the previous value
4 i += 1 on a name with no prior binding marked tainted loop invariants silently declined instead of checked
5 Invariant preservation guarded by !cond instead of cond sound invariants refuted at states the body never executes
6 Returns paired with the joined branch states false counterexample on a correct program — the gate refused it at compile time

Plus a latent crash the path pairing exposed: _model_block fed raw AST nodes to
z3 (Z3Exception: parser error).

The governing rule: substitute the body's state into the clause, never assert
it into the antecedent.

Verification

Gate Result
pytest 176 passed (was 166; +10 soundness regression tests)
spike suite 41/43 (the 2 are the self-declared stubs H36/H37)
golden references 2/2 True
s17 wasm determinism assembly ok, text deterministic
feature registry (True, [], [])
corpus 22 compiled, 0 refused, 0 AI findings
verifier suite 0 disagreements
mutation check 6/6 reintroduced defects falsified the pinned test

Requires/ensures/invariant outside QF_LIA still report unverified, never proven;
the gate refuses only on a real counterexample.

Asset

svl-sieve-v0.2.0.wasm — the attested examples/sieve.svl build. Verify it:

python3 examples/attest.py --verify svl-sieve-v0.2.0.wasm

Formal rating

Unchanged at 6.00/10 (6th of 9). The fixes make the existing D4 = 8 claim true
rather than adding a capability — before this pass, the prover's proven verdicts
were not trustworthy. See SVL_FORMAL_RATING.md §14.5.