Commit 275f97f
feat(provers): Phase 5 — GNATprove + Stainless + Liquid Haskell + ffi cleanup
Three refinement-types / SPARK auto-active verifier backends. Wires the
SPARK leg of the standing "Rust always means Rust/SPARK" rule — ECHIDNA
can now drive the SPARK toolchain that the existing Phase 0 axiom-policy
+ coprocessor-tier proofs already use.
GNATprove (src/rust/provers/gnatprove.rs):
- Tier 4 prover-side (small-kernel via Why3 + Z3/CVC5/Alt-Ergo).
- Invokes `gnatprove -P <project.gpr> --mode=prove --report=fail --level=2`.
- Auto-detection: .ads / .adb / .gpr file extensions.
- For raw SPARK source via parse_string, generates minimal .ads/.adb/.gpr
trio in a tempdir alongside the source.
- Tactics: Pre, Post, Loop_Invariant, Loop_Variant, Type_Invariant, Ghost.
- Output parser handles "0 unproved", "everything proved", "unproved",
"medium:", "severe:", "error:".
Stainless (src/rust/provers/stainless.rs):
- Tier 3 (Scala/Inox refinement types).
- Invokes `stainless <file.scala>`.
- Goal-counting heuristic: `def` declarations + `ensuring(` blocks.
- Tactics: require / ensuring / decreases / invariant.
- Output parser handles "valid" / "invalid" / "counter-example" /
"verification successful" / "verification failed".
Liquid Haskell (src/rust/provers/liquid_haskell.rs):
- Tier 3 (GHC refinement-types plugin).
- Invokes `liquid <file.hs>`.
- Goal-counting heuristic: `{-@ ... @-}` annotation blocks.
- Tactics: measure / data / type / predicate.
- Output parser handles RESULT: SAFE / UNSAFE / counter-example /
ghc: errors (returned as Err — inconclusive, GHC compile failed
before LH ran).
Wiring:
- ProverKind: + GNATprove, Stainless, LiquidHaskell.
- ProverFactory::create: 3 new match arms.
- complexity / tier / implementation_time tables updated.
- default_executable: gnatprove / stainless / liquid.
- FromStr: gnatprove / spark / ada / stainless / scala-stainless /
liquid / liquid-haskell / liquidhaskell / lh.
- Auto-detect: .ads / .adb / .gpr → GNATprove. .scala / .hs left
explicit (not all such files are refinement-typed).
- ffi/mod.rs: + 125 (GNATprove), 126 (Stainless), 127 (LiquidHaskell).
Also fixes two pre-existing bugs from cbd9449:
1. kind_from_u8 had only the comment for codes 115-124 — entries
for Leo3/Satallax/Lash/AgsyHOL/IProver/Princess/Twee/MetiTarski/
CSI/AProVE were missing; calls with those codes returned None.
2. kind_to_u8 had a duplicate block for the same 10 variants
(rust accepts but generates unreachable_patterns warnings).
Both replaced with single canonical block.
Tests: 15 new tests (4 GNATprove + 5 Stainless + 6 Liquid Haskell), all
green. panic-attack assail clean (0 weak points across all 3 files).
Lib compiles cleanly. Pre-existing 700+ tests unchanged.
This closes Phase 5 of the original 8-phase expansion plan. Remaining:
Phase 2B (CAS subprocess: PARI/Maxima/Singular/GAP/Macaulay2), Phase 3
(QEPCAD/Redlog/KeYmaeraX/leanCoP family), Phase 4 (DL/probabilistic/
comp-crypto). Phases 0/1/2A/5/6A/6B/7 all complete.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 83bc21b commit 275f97f
6 files changed
Lines changed: 1003 additions & 12 deletions
File tree
- .machine_readable/6a2
- src/rust
- ffi
- provers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
528 | 532 | | |
529 | 533 | | |
530 | 534 | | |
| |||
1250 | 1254 | | |
1251 | 1255 | | |
1252 | 1256 | | |
1253 | | - | |
| 1257 | + | |
1254 | 1258 | | |
1255 | 1259 | | |
1256 | 1260 | | |
1257 | 1261 | | |
1258 | | - | |
| 1262 | + | |
1259 | 1263 | | |
1260 | 1264 | | |
1261 | 1265 | | |
1262 | 1266 | | |
1263 | 1267 | | |
1264 | 1268 | | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1265 | 1273 | | |
1266 | 1274 | | |
1267 | 1275 | | |
| |||
0 commit comments