Commit 7c37d21
fix(provers/isabelle): de-stub parse_string + verify_proof
parse_string previously discarded its content argument and returned a
single Term::Const("True") goal, which verify_proof then short-circuited
to Ok(true) — Isabelle was never actually invoked. Combined with the
filename/theory-name mismatch in the scaffolded export path
(echidna_verify.thy contained `theory GeneratedProof`, which isabelle
build refuses), the HTTP /api/verify endpoint with prover=Isabelle was
returning success regardless of input.
Now:
- parse_string extracts the theory name and every top-level
theorem|lemma|corollary declaration via a nested-comment-aware scanner.
Raw .thy content is stashed in ProofState.metadata["raw_thy_content"].
- verify_proof writes that raw content to a unique per-invocation temp
dir as <theory_name>.thy and runs `isabelle process -l Main -e
'use_thys ["<path>"]'`. Exit status determines the verdict.
- Fallback scaffolded-export path writes GeneratedProof.thy in its own
unique temp dir, fixing the filename/theory-name mismatch.
Added 9 unit tests covering comment stripping (incl. nested blocks),
theory-name extraction (basic / commented-out / absent / prefix guard),
lemma extraction (basic / attributes / anonymous / commented-out),
and the parse_string contract. Verified end-to-end against a real
788-line Tropical.thy: extracts theory name and all 55 theorems/lemmas.
Audit of all 50 prover backends confirmed Isabelle was the only truly
stubbed one. metamath.rs and typed_wasm.rs are intentionally pure-Rust
in-process verifiers. The other 47 backends all spawn real solver
subprocesses.
Note: deployment to echidna-nesy on Fly.io requires the container to
bundle the `isabelle` binary on $PATH; otherwise Command::new fails at
runtime and verify_proof returns Ok(false) with a context error.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c0f2069 commit 7c37d21
3 files changed
Lines changed: 446 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
8 | 52 | | |
9 | 53 | | |
10 | 54 | | |
| |||
0 commit comments