Skip to content

ArghDA M5: SMT solver backends (Z3, CVC5) — the Solver kind goes live#35

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93
Jul 1, 2026
Merged

ArghDA M5: SMT solver backends (Z3, CVC5) — the Solver kind goes live#35
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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 — 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):
    • unsatProven (VC discharged: ¬P has no model, so P holds)
    • satRefuted (a model/counterexample exists)
    • unknownUnknown; (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 isn't 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 (Agda, Idris2, Z3, CVC5).

Verified (ran, not inferred)

  • cargo test100 passing, 0 failed (75 lib + 25 integration; +5 SMT unit incl. the verdict-mapping table and the satunsat token trap, +2 SMT integration — hermetic, no solver needed for the graph path).
  • cargo clippy -D warnings clean · cargo fmt --check clean · check-spdx.sh OK.
  • Dogfooded real Z3 + CVC5:
    • check --backend z3 unsat.smt2proven-eligible
    • check --backend z3 sat.smt2rejected (exit 0 but verdict Refuted — honest)
    • reason --backend cvc5 --checksat=refuted/unsound, unsat=proven/sound

Milestone 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

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
hyperpolymath marked this pull request as ready for review July 1, 2026 08:55
@hyperpolymath
hyperpolymath merged commit 21f306b into main Jul 1, 2026
2 checks passed
@hyperpolymath
hyperpolymath deleted the claude/arghda-roadmap-planning-p5mu93 branch July 1, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants