ArghDA M5: SMT solver backends (Z3, CVC5) — the Solver kind goes live#35
Merged
Merged
Conversation
The first `Solver`-kind backends, on the M1 trait — arghda now spans both
interaction models: assistants (typecheck a file) and solvers (answer an
SMT-LIB2 query). Chosen at the CLI with `--backend z3|cvc5`.
- `src/prover/smt.rs` — one `Smt { name, cmd }` type with `Smt::z3()` /
`Smt::cvc5()`. `check_file` runs `<solver> <file.smt2>` and PARSES stdout
(never the bare exit code — both `sat` and `unsat` exit 0):
`unsat`→Proven (VC discharged), `sat`→Refuted (a model exists),
`unknown`→Unknown, `(error …)`/non-zero→Error, absent→Unavailable.
Multi-`(check-sat)` aggregate: any `sat` ⇒ Refuted; else any `unknown` ⇒
Unknown; else all `unsat` ⇒ Proven; no result token ⇒ Error (never a
silent pass). Solvers are standalone queries: no import edges (isolated
nodes — valid), no root convention (so `wired` is not meaningful), no lint
pack. Ground-truthed against Z3 4.8.12 + CVC5 1.2.0.
- `src/main.rs` — `--backend z3|cvc5` wired via `backend_for`; `about` +
help updated. CLI `about` now: Agda, Idris2, Z3, CVC5.
## Verified (ran, not inferred)
- `cargo test` → 100 passing, 0 failed (75 lib + 25 integration; +5 SMT
unit incl. the verdict-mapping table and the `sat`⊂`unsat` token trap,
+2 SMT integration — hermetic, no solver needed).
- clippy -D warnings, fmt, SPDX clean.
- Dogfooded REAL Z3 + CVC5: `check --backend z3 unsat.smt2` →
proven-eligible; `check --backend z3 sat.smt2` → rejected;
`reason --backend cvc5 --check` → sat=refuted/unsound, unsat=proven/sound.
- STATE.a2ml records M5 = 100%; both backend interaction models now real.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7
hyperpolymath
marked this pull request as ready for review
July 1, 2026 08:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The first
Solver-kind backends, on the M1 trait — arghda now spans both interaction models: assistants (typecheck a file → exit code) and solvers (answer an SMT-LIB2 query → sat/unsat/unknown). Chosen at the CLI with--backend z3|cvc5.Changes
src/prover/smt.rs— oneSmt { name, cmd }type withSmt::z3()/Smt::cvc5().check_fileruns<solver> <file.smt2>and parses stdout (never the bare exit code — bothsatandunsatexit 0):unsat→ Proven (VC discharged:¬Phas no model, soPholds)sat→ Refuted (a model/counterexample exists)unknown→ Unknown;(error …)/ non-zero → Error; absent → Unavailable(check-sat)aggregate: anysat⇒ Refuted; else anyunknown⇒ Unknown; else allunsat⇒ Proven; no result token ⇒ Error (never a silent pass)wiredisn't meaningful), no lint pack.src/main.rs—--backend z3|cvc5wired viabackend_for;about/help updated (Agda, Idris2, Z3, CVC5).Verified (ran, not inferred)
cargo test→ 100 passing, 0 failed (75 lib + 25 integration; +5 SMT unit incl. the verdict-mapping table and thesat⊂unsattoken trap, +2 SMT integration — hermetic, no solver needed for the graph path).cargo clippy -D warningsclean ·cargo fmt --checkclean ·check-spdx.shOK.check --backend z3 unsat.smt2→proven-eligiblecheck --backend z3 sat.smt2→rejected(exit 0 but verdict Refuted — honest)reason --backend cvc5 --check→sat=refuted/unsound,unsat=proven/soundMilestone status
Both backend interaction models are now real. Engine spine + four backends (Agda, Idris2, Z3, CVC5) done. Next: M2 Cubical-Agda, M6 Lean4.
Generated by Claude Code