Skip to content

ArghDA M8 follow-on: dependency-ordered Coq compilation (M8 → 97%)#50

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

ArghDA M8 follow-on: dependency-ordered Coq compilation (M8 → 97%)#50
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Multi-file Coq projects are now checkable. Before this, a bare coqc B.v where B Requires an in-tree sibling A errored Cannot find a physical path bound to logical path A (ground-truthed) — so any Coq file with a local dependency verdicted Error.

How

check_file now stages the target and its in-tree transitive Require deps into a temp build tree, compiles the deps in topological order (deps before dependents; coq_transitive_deps is a cycle-safe post-order DFS) so each .vo exists, then checks the target against -R <build> "". It all happens under temp, so the source tree stays clean. External stdlib/MML requires resolve on coqc's own load path (skipped as non-in-tree).

Honesty preserved — a transitive admit is NOT whitewashed

This is the load-bearing verification. Dogfooded: a dependent whose dep contains Admitted gets a per-file check verdict of proven (the dependent's own content is sound), but the reasoning graph demotes its EFFECTIVE verdict to admitted via the And-edge to the admitted dep:

Bad      self=admitted   effective=admitted
UsesBad  self=proven     effective=admitted   (edge UsesBad → Bad)

So dep-ordering makes projects checkable without letting a transitive admit ride through green — the self/effective split does its job.

Verification (actually run)

  • cargo fmt --check / clippy -D warnings — clean
  • cargo test174 pass (+1 topo-order unit)
  • check-spdx.sh — OK

Dogfooded vs real coqc 8.18.0:

case result
check C.v in a 3-module A ← B ← C chain of real Qed proofs proven (was error before)
reason --check over the chain A / B / C all proven
dependent of an Admitted module per-file proven, effective admitted

Scope

M8 → 97%. Residual: _CoqProject-driven custom -Q/-R prefix remapping (the empty-prefix Foo.BarFoo/Bar.v convention is fully working; only non-default logical prefixes remain a follow-on).

Part of the heavy-tail completion cuts — next: Mizar prel export (M10), then Isabelle multi-session (M9).

🤖 Generated with Claude Code

https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7


Generated by Claude Code

Multi-file Coq projects are now checkable. Before this, a bare `coqc B.v` where
B `Require`s an in-tree sibling A errored "Cannot find a physical path bound to
logical path A" (ground-truthed) — so any Coq file with a local dependency
verdicted Error.

check_file now stages the target and its in-tree transitive `Require` deps into
a temp build tree, compiles the deps in topological order (deps before
dependents; `coq_transitive_deps` is a cycle-safe post-order DFS) so each `.vo`
exists, then checks the target against `-R <build> ""`. It all happens under
temp, so the source tree stays clean. External stdlib/MML requires resolve on
coqc's own load path (they're skipped as non-in-tree).

Honesty preserved — a transitive admit is NOT whitewashed. Dogfooded: a
dependent whose dep contains `Admitted` gets a per-file `check` verdict of
`proven` (the dependent's own content is sound), but the reasoning graph demotes
its EFFECTIVE verdict to `admitted` via the And-edge to the admitted dep. So
dep-ordering makes projects checkable without letting a transitive admit ride
through green — the self/effective split does its job.

Verification (actually run): cargo fmt --check, clippy -D warnings, cargo test
(174 pass, +1 topo-order unit), check-spdx.sh — all green. Dogfooded vs real
coqc 8.18.0: a 3-module A←B←C chain of real Qed proofs → `check C.v` = proven;
`reason --check` → A/B/C all proven; the admit-taint case demotes as above.

Residual (the 3%): `_CoqProject`-driven custom `-Q`/`-R` prefix remapping. The
empty-prefix convention (`Foo.Bar` ↔ `Foo/Bar.v` under the root) is fully
working; only non-default logical prefixes remain a follow-on.

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 17, 2026 04:22
@hyperpolymath
hyperpolymath merged commit ad7d949 into main Jul 17, 2026
3 checks passed
@hyperpolymath
hyperpolymath deleted the claude/arghda-roadmap-planning-p5mu93 branch July 17, 2026 04:23
hyperpolymath added a commit that referenced this pull request Jul 17, 2026
## What

A theory that imports from another session — `imports
"HOL-Library.FuncSet"` — is now checkable. This is the **last** of the
heavy-tail completion cuts.

Ground-truthed first (the important step): **flat sibling imports
already worked** — the adapter stages every sibling `.thy` into the
session, so `imports Main Foo` on a sibling `Foo` already resolved. So
the real gap was narrower than the milestone text suggested: only
*session-qualified* imports.

## How

The gap: the generated ROOT said `= HOL +` with no route to
`HOL-Library`, so the build errored "Cannot load theory". Fix:
`session_prefixes` scans all staged theories' `imports` clauses for
qualified `"Session.Theory"` forms (session = the segment before the
first `.`; Isabelle session names are dot-free) and emits a `sessions
"<S>" …` clause in the generated ROOT, so `isabelle build` pulls those
sessions' heaps. The distribution session heaps ship prebuilt, so the
build stays fast (~15 s).

## Verification (actually run)

- `cargo fmt --check` / `clippy -D warnings` — clean
- `cargo test` — **176 pass** (+1 `session_prefixes` unit)
- `check-spdx.sh` — OK

**Dogfooded vs real Isabelle2025:**

| case | result |
|---|---|
| `Q.thy` importing `"HOL-Library.FuncSet"`, using its Pi-notation |
`proven` (was `error` before) |
| flat-sibling regression (`Bar` imports sibling `Foo`) | still `proven`
|

## Scope

M9 → 98%. Residual: a project with its OWN multi-session ROOT (a
locally-defined session importing another local session's theories) —
niche; single-theory, flat-sibling and distribution-session-qualified
imports all work.

**This completes the heavy-tail completion cuts** (Coq
dependency-ordering #50, Mizar cross-refs #51, Isabelle
session-qualified imports).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7

---
_Generated by [Claude
Code](https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7)_

Co-authored-by: Claude <noreply@anthropic.com>
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