ArghDA M9: Isabelle/HOL adapter — second heavy-tail backend (foundation-first)#45
Merged
Merged
Conversation
…on-first) Provisioned Isabelle2025 (1.08 GB tarball, HOL heap prebuilt) BEFORE the adapter, ground-truthed the invocation, then built and dogfooded against the real tool. arghda is now an eight-backend prover-parametric workspace. Adapter (src/prover/isabelle.rs, `Isabelle`): - Assistant kind, extensions [thy], command `isabelle`. - Isabelle is session-based (no single-file --check), so check_file generates a throwaway session: copies the target .thy + sibling .thy files into a temp dir, writes a ROOT (`session ArghdaCheck = HOL + theories <T>`), and runs `isabelle build -o quick_and_dirty -d <dir> ArghdaCheck`. Heaps land in ~/.isabelle, so the source tree stays clean (~6 s/theory). - Verdict, ground-truthed vs Isabelle2025: exit≠0 → Error; exit 0 + sorry/oops → Admitted (sorry compiles under quick_and_dirty, so it is caught at the source, not hidden by the exit code); exit 0 + axiomatization → Postulated; exit 0 clean → Proven. Never fabricated. - Imports: the header `imports … begin` clause (bare names + quoted-path final segment; stdlib Main dropped as external). Roots: a ROOT file's `theories` section — the genuine Isabelle entry-point convention (analogue of All.agda), parsed tolerantly (option groups skipped). - probe() overridden to `isabelle version` (not `--version`, which errors "Unknown Isabelle tool" — `doctor` caught this); added a pub(crate) probe_tool_arg helper for the custom version query. Lint (src/lint/isabelle.rs, `IsabelleEscapeHatch`): warn under the shared `escape-hatch` name (amber cap); flags sorry/oops/axiomatization. Provisioning fix at source: the script's Isabelle URL was stale (`/dist/Isabelle2024…` 404s once a newer release is current) — switched to the archived `/website-<VER>/dist/` path and bumped to Isabelle2025. Wired: backend_for "isabelle", KNOWN_BACKENDS, all four `--backend` help strings, the CLI about line. Verification (actually run): cargo fmt --check, clippy -D warnings, cargo test (159 pass: +6 isabelle unit, +4 isabelle lint unit, +3 isabelle integration; graph tests hermetic — text/ROOT only, run tool-less), check-spdx.sh — all green. Dogfooded vs real Isabelle2025: `check` → Good=proven / Admits=admitted / Postulate=postulated / Broken=error; `reason --check --backend isabelle` reproduces those; imports All→Base / All→Util / Util→Base parsed; ROOT theories=All → crt_root All, Base+Util wired, Orphan unwired; `doctor` → [OK] isabelle assistant Isabelle2025. Remaining (M9 at 90%): session-qualified / relative-path imports + dependency-ordered multi-session builds. 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 12:20
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
The second heavy-tail backend. arghda is now an eight-backend prover-parametric workspace (agda, agda-cubical, idris2, lean4, coq, isabelle as Assistants; z3, cvc5 as Solvers).
Foundation-first again: provisioned Isabelle2025 (1.08 GB tarball, HOL heap ships prebuilt), ground-truthed the invocation against the real tool, then built and dogfooded the adapter.
How
Adapter —
src/prover/isabelle.rs(Isabelle)[thy], commandisabelle.--check), socheck_filegenerates a throwaway session: copies the target.thy+ sibling.thyfiles into a temp dir, writes aROOT(session ArghdaCheck = HOL + theories <T>), and runsisabelle build -o quick_and_dirty -d <dir> ArghdaCheck. Heaps land in~/.isabelle, so the source tree stays clean (~6 s/theory).Error; exit 0 +sorry/oops→Admitted(sorrycompiles underquick_and_dirty, so it is caught at the source, not hidden by the exit code); exit 0 +axiomatization→Postulated; exit 0 clean →Proven.imports … beginclause (bare names + quoted-path final segment; stdlibMaindropped as external). Roots: aROOTfile'stheoriessection — the genuine Isabelle entry-point convention (analogue ofAll.agda), parsed tolerantly.probe()overridden toisabelle version(not--version, which errorsUnknown Isabelle tool—doctorcaught this); added apub(crate) probe_tool_arghelper for the custom version query.Lint —
src/lint/isabelle.rs(IsabelleEscapeHatch): warn under the sharedescape-hatchname (amber cap); flagssorry/oops/axiomatization.Provisioning fix at source: the script's Isabelle URL was stale (
/dist/Isabelle2024…404s once a newer release is current) — switched to the archived/website-<VER>/dist/path and bumped to Isabelle2025.Wired:
backend_for "isabelle",KNOWN_BACKENDS, all four--backendhelp strings, the CLI about line.Verification (actually run)
cargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleancargo test— 159 pass (+6 isabelle unit, +4 isabelle lint unit, +3 isabelle integration; the graph tests are hermetic — text/ROOT only, run tool-less)bash scripts/check-spdx.sh .— OKDogfooded against real Isabelle2025:
arghda check --backend isabelleGood.thy(by simp)provenAdmits.thy(sorry)admittedPostulate.thy(axiomatization)postulatedBroken.thy(false lemma)errorreason --check --backend isabellereproduces those verdictsAll → Base/All → Util/Util → Baseparsed;ROOTtheories = All→crt_rootAll;Base+Utilwired;Orphanunwiredarghda doctor→[OK] isabelle assistant Isabelle2025Scope
M9 at 90%. Remaining: session-qualified / relative-path imports + dependency-ordered multi-session builds.
🤖 Generated with Claude Code
https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7
Generated by Claude Code