ArghDA M8: Coq/Rocq adapter — first heavy-tail backend (foundation-first)#44
Merged
Merged
Conversation
…rst) Provisioned the toolchain BEFORE the adapter (opam 2.1.5 → coq.8.18.0), then built and dogfooded the backend against the real `coqc`. arghda is now a seven-backend prover-parametric workspace. Adapter (src/prover/rocq.rs, `Coq`): - Assistant kind, extensions [v], command `coqc`. - Verdict logic ground-truthed vs Coq 8.18.0: exit≠0 → Error; exit 0 + Admitted/admit → Admitted; exit 0 + genuine postulate → Postulated; exit 0 clean → Proven. `coqc` kernel-checks every `Qed` at compile, so a clean compile with no escape hatch is an honest Proven (stronger than Lean, which needs a #print axioms audit). Never fabricates a verdict. - `count_genuine_postulates`: the Section-aware classifier ported from panic-attack's `count_rocq_unverified_postulates` — Section-scoped Variable/Hypothesis/Parameter discharge at End; module-level Parameter of carrier / decidability-witness / non-Prop-function type are abstractions; Prop-valued Axiom/Parameter are counted. - check_file redirects the `.vo` into a temp dir keeping the source stem (coqc `-o` requires target basename == source; a real-coqc dogfood caught the first attempt renaming it). - Imports: `Require [Import|Export]` + `From P Require …`; bare Import/Export is a namespace directive, not an edge (as Lean `open` is). Roots: the `All.v` aggregator convention. Lint (src/lint/coq.rs, `CoqEscapeHatch`): warn under the shared `escape-hatch` name (caps at amber in the reasoning graph); flags Admitted/admit/Axiom/ Conjecture. Parameter is left to the backend's Section-aware classifier. Wired: backend_for "coq", KNOWN_BACKENDS, all four `--backend` help strings, the CLI about line. Verification (actually run): cargo fmt --check, clippy -D warnings, cargo test (146 pass: +7 rocq unit, +5 coq lint unit, +3 coq integration; graph tests hermetic — text only, run tool-less), check-spdx.sh — all green. Dogfooded vs real coqc 8.18.0: `check` → Clean=proven / Admits=admitted / Postulate= postulated / Broken=error; `reason --check --backend coq` reproduces those; import edge All→Base parsed, All.v discovered as crt_root, Base+Util wired, Orphan unwired; `doctor` → [OK] coq assistant 8.18.0. Remaining (M8 at 90%): _CoqProject-driven logical-path resolution + dependency-ordered compilation (a bare single-file coqc reports Error when an uncompiled dependency is Required — documented limitation, same class as Lean's lake-env gap). 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 11:48
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 first of the heavy-tail backends. arghda is now a seven-backend prover-parametric workspace (agda, agda-cubical, idris2, lean4, coq as Assistants; z3, cvc5 as Solvers).
Done foundation-first: provisioned the toolchain before writing the adapter (opam 2.1.5 →
coq.8.18.0), then built and dogfooded the backend against the realcoqc.How
Adapter —
src/prover/rocq.rs(Coq)[v], commandcoqc.ErrorAdmitted/admit→AdmittedPostulatedProven(coqckernel-checks everyQedat compile, so a clean compile with no escape hatch is honestly proven — stronger than Lean, which needs a#print axiomsaudit)count_genuine_postulates— the Section-aware classifier ported from panic-attack'scount_rocq_unverified_postulates: Section-scopedVariable/Hypothesis/Parameterdischarge atEnd; module-levelParameterof carrier / decidability-witness / non-Prop-function type are abstractions;Prop-valuedAxiom/Parameterare counted.check_fileredirects the.vointo a temp dir keeping the source stem (coqc -orequires target basename == source; a real-coqc dogfood caught the first attempt renaming it).Require [Import|Export]+From P Require …; bareImport/Exportis a namespace directive, not an edge (as Leanopenis). Roots: theAll.vaggregator convention.Lint —
src/lint/coq.rs(CoqEscapeHatch): warn under the sharedescape-hatchname (caps at amber in the reasoning graph); flagsAdmitted/admit/Axiom/Conjecture.Parameteris left to the backend's Section-aware classifier.Wired:
backend_for "coq",KNOWN_BACKENDS, all four--backendhelp strings, the CLI about line.Verification (actually run)
cargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleancargo test— 146 pass (+7 rocq unit, +5 coq lint unit, +3 coq integration; the graph tests are hermetic — text only, run tool-less)bash scripts/check-spdx.sh .— OKDogfooded against real coqc 8.18.0:
arghda check --backend coqClean.v(Qed)provenAdmits.v(Admitted)admittedPostulate.v(Prop Axiom)postulatedBroken.v(type error)errorreason --check --backend coqreproduces those verdictsAll → Baseparsed;All.vdiscovered ascrt_root;Base+Utilwired;Orphanunwiredarghda doctor→[OK] coq assistant The Coq Proof Assistant, version 8.18.0Scope
M8 at 90%. Remaining:
_CoqProject-driven logical-path resolution + dependency-ordered compilation (a bare single-filecoqcreportsErrorwhen an uncompiled dependency isRequired — a documented limitation, the same class as Lean's lake-env gap).🤖 Generated with Claude Code
https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7
Generated by Claude Code