Skip to content

ArghDA M9 follow-on: Isabelle session-qualified imports (M9 → 98%)#52

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

ArghDA M9 follow-on: Isabelle session-qualified imports (M9 → 98%)#52
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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 test176 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.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7


Generated by Claude Code

A theory that imports from another session — `imports "HOL-Library.FuncSet"` —
is now checkable. (Flat sibling imports already worked: the adapter stages every
sibling `.thy` into the session, so `imports Main Foo` on a sibling `Foo`
already resolved — verified before touching anything.)

The gap was session-qualified imports: 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, cargo test
(176 pass, +1 `session_prefixes` unit), check-spdx.sh — all green. Dogfooded vs
real Isabelle2025: `Q.thy` importing `"HOL-Library.FuncSet"` and using its
Pi-notation → proven (was an error pre-fix); flat-sibling regression (`Bar`
imports sibling `Foo`) → still proven.

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 dep-ordering, Mizar
cross-refs, Isabelle session-qualified imports).

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 05:04
@hyperpolymath
hyperpolymath merged commit 3fb48ed into main Jul 17, 2026
3 checks passed
@hyperpolymath
hyperpolymath deleted the claude/arghda-roadmap-planning-p5mu93 branch July 17, 2026 05:04
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