Skip to content

Commit 0b5725d

Browse files
ci(proofs): weekly cron gating the Isabelle + Mizar self-proof corpora (#277)
## What Adds a **weekly cron** gating the two remaining ungated self-proof corpora — **Isabelle/HOL** (`proofs/isabelle`, 5 `.thy`) and **Mizar** (`proofs/mizar`, 4 `.miz`). Completes the proof-CI sweep after #275 (Lean) and #276 (Idris2). - **`.github/workflows/verification-proofs-cron.yml`** — `isabelle` + `mizar` jobs on a weekly schedule (`Mon 04:17 UTC`) + `workflow_dispatch`. Isabelle reuses `live-provers.yml`'s proven Isabelle2024 install; Mizar discovers the newest linux tarball from `mizar.org` at runtime. - **`proofs/isabelle/ROOT`** — two sessions: `Echidna_Isabelle` (base HOL: Basic, List, Nat, Propositional) and `Echidna_Isabelle_Algebra` (GroupTheory, on HOL-Algebra). - **`just proofs-isabelle`** (`isabelle build`) and **`just proofs-mizar`** (`makeenv` + `verifier` per file, failing on a non-empty `.err` since the verifier's exit code is unreliable). Kept **out** of the per-PR `proofs` rollup — these toolchains are too heavy for per-PR. ## Why a weekly cron (not per-PR) Both toolchains are large, non-apt downloads (Isabelle ~500MB + the HOL-Algebra image build; Mizar's system + full MML). Mizar is additionally **Tier-4 "mock-only"** in this project. Gating them per-PR would bloat every PR; a weekly schedule (mirroring `container-ci.yml`) is the right cadence. ## Verification status — please read `isabelle.in.tum.de` **and** `mizar.org` both return `403 host_not_allowed` from the dev sandbox, and neither tool is in apt or has a GitHub mirror — so these recipes **cannot be run locally here**. They are being validated by **dispatching this workflow on GitHub's runners** (where `live-provers.yml` already downloads Isabelle successfully) and iterating on the real run output. I will report the dispatch results on this PR. Known risk areas the first runs will confirm: - Isabelle theory-name vs HOL-name handling (`List.thy`/`Nat.thy` share names with HOL theories). - The exact Mizar archive layout / `MIZFILES` + `makeenv`/`verifier` invocation. Holding as **draft** until the dispatched runs are green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01UAqDQaMwpUqWHUSZekGZWv)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9969ff0 commit 0b5725d

4 files changed

Lines changed: 200 additions & 1 deletion

File tree

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Weekly verification of the heavier self-proof corpora that are too slow and too
3+
# network-heavy to gate on every PR: Isabelle/HOL (proofs/isabelle) and Mizar
4+
# (proofs/mizar). Both toolchains are large, non-apt downloads -- Isabelle is a
5+
# ~500MB tarball and additionally builds the HOL-Algebra image; Mizar ships only
6+
# from mizar.org (Tier-4 in this project, see live-provers.yml) with its full MML.
7+
# So this runs on a weekly schedule plus manual dispatch, mirroring container-ci.
8+
# `just` stays the single source of truth for the commands (RSR-H14): CI installs
9+
# the toolchains, then calls the same recipes a developer runs locally.
10+
name: Verification Proof Corpora (weekly)
11+
12+
on:
13+
schedule:
14+
- cron: '17 4 * * 1' # Mondays 04:17 UTC
15+
workflow_dispatch:
16+
# Tightly path-filtered: a PR that actually touches these proof corpora (or this
17+
# workflow) gets one confirmation run, but unrelated PRs never trigger the heavy
18+
# toolchains. The weekly schedule above is the primary gate; this just catches
19+
# direct edits to the .thy/.miz sources before they land.
20+
pull_request:
21+
paths:
22+
- 'proofs/isabelle/**'
23+
- 'proofs/mizar/**'
24+
- '.github/workflows/verification-proofs-cron.yml'
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
permissions:
31+
contents: read
32+
33+
jobs:
34+
isabelle:
35+
name: Isabelle/HOL
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 60
38+
steps:
39+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
40+
41+
- name: Install Isabelle
42+
run: |
43+
set -euo pipefail
44+
# Resolve the current Isabelle linux x86_64 tarball from the website. A
45+
# pinned /dist/IsabelleYYYY URL 404s once a newer release supersedes it
46+
# (live-provers.yml's Isabelle2024 pin has rotted), so discover the link
47+
# from the homepage, then fall back to the dist/ directory listing.
48+
url=""
49+
for src in "https://isabelle.in.tum.de/" "https://isabelle.in.tum.de/dist/"; do
50+
page="$(curl -fsSL --max-time 120 --retry 3 "$src" || true)"
51+
echo "--- candidates from $src ---"
52+
printf '%s\n' "$page" | grep -oE '(dist/)?Isabelle[0-9][0-9-]*_linux\.tar\.gz' | sort -V | uniq | tail -5 || true
53+
rel="$(printf '%s\n' "$page" | grep -oE '(dist/)?Isabelle[0-9][0-9-]*_linux\.tar\.gz' | sort -V | uniq | tail -1)"
54+
if [ -n "$rel" ]; then
55+
case "$rel" in dist/*) url="https://isabelle.in.tum.de/$rel" ;; *) url="https://isabelle.in.tum.de/dist/$rel" ;; esac
56+
break
57+
fi
58+
done
59+
[ -n "$url" ] || { echo "could not resolve Isabelle linux tarball URL" >&2; exit 1; }
60+
echo "Resolved Isabelle URL: $url"
61+
curl -fsSL --max-time 900 --retry 3 --retry-delay 15 -o /tmp/isabelle.tar.gz "$url"
62+
sudo mkdir -p /opt/isabelle
63+
sudo tar xzf /tmp/isabelle.tar.gz -C /opt/isabelle
64+
ISABELLE_BIN="$(find /opt/isabelle -type f -name isabelle | head -n 1)"
65+
[ -n "$ISABELLE_BIN" ] || { echo "isabelle launcher not found after extract" >&2; exit 1; }
66+
sudo ln -sf "$ISABELLE_BIN" /usr/local/bin/isabelle
67+
isabelle version
68+
69+
- name: Install just
70+
run: |
71+
set -euo pipefail
72+
curl -fsSL --retry 3 \
73+
"https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \
74+
-o /tmp/just.tar.gz
75+
mkdir -p "$HOME/.local/bin"
76+
tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just
77+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
78+
79+
- name: Verify Isabelle corpus
80+
run: just proofs-isabelle
81+
82+
mizar:
83+
name: Mizar
84+
runs-on: ubuntu-latest
85+
timeout-minutes: 60
86+
steps:
87+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
88+
89+
- name: Install Mizar (system + MML)
90+
run: |
91+
set -euo pipefail
92+
# Mizar ships only from mizar.org with no stable, documented path (the
93+
# /system/i386-linux/ guess 404s). Discover the linux tarball by scraping
94+
# the system index; dump candidate hrefs so one run reveals the layout if
95+
# discovery misses.
96+
# Two-stage discovery: mizar.org/system/ only links to per-arch *directories*
97+
# on the upstream host (http://mizar.uwb.edu.pl/.../i386-linux/); the actual
98+
# tarball lives inside that directory.
99+
sys="$(curl -fsSL --max-time 120 --retry 3 "http://mizar.org/system/" || true)"
100+
dir="$(printf '%s\n' "$sys" | grep -oiE 'href="http://[^"]*i386-linux/?"' \
101+
| sed -E 's/^href="//I; s/"$//' | head -1)"
102+
[ -n "$dir" ] || dir="http://mizar.uwb.edu.pl/~softadm/pub/system/i386-linux/"
103+
dir="${dir%/}/"
104+
echo "Mizar i386-linux dir: $dir"
105+
idx="$(curl -fsSL --max-time 120 --retry 3 "$dir" || true)"
106+
echo "=== .tar candidates in $dir ==="
107+
printf '%s\n' "$idx" | grep -oiE 'href="[^"]+"' | grep -iE '\.tar' | head -40 || true
108+
rel="$(printf '%s\n' "$idx" | grep -oiE 'href="[^"]*mizar-[^"]*i386-linux\.tar"' \
109+
| sed -E 's/^href="//I; s/"$//' | sort -V | uniq | tail -1)"
110+
[ -n "$rel" ] || rel="$(printf '%s\n' "$idx" | grep -oiE 'href="[^"]*\.tar"' \
111+
| sed -E 's/^href="//I; s/"$//' | sort -V | uniq | tail -1)"
112+
[ -n "$rel" ] || { echo "no Mizar .tar found in $dir" >&2; exit 1; }
113+
case "$rel" in http*) found="$rel" ;; /*) found="http://mizar.uwb.edu.pl$rel" ;; *) found="$dir$rel" ;; esac
114+
echo "Resolved Mizar URL: $found"
115+
curl -fsSL --max-time 600 --retry 3 -o /tmp/mizar.tar "$found"
116+
mkdir -p "$HOME/mizar"
117+
tar xf /tmp/mizar.tar -C "$HOME/mizar"
118+
echo "=== outer archive contents ==="; ls -la "$HOME/mizar" | head -30
119+
cd "$HOME/mizar"
120+
for inner in mizbin mizshare mizdoc; do
121+
for ext in tar.gz tgz tar; do
122+
[ -f "$inner.$ext" ] && { echo "extracting $inner.$ext"; tar xf "$inner.$ext"; }
123+
done
124+
done
125+
echo "=== after inner extraction ==="; ls -la "$HOME/mizar" | head -40
126+
# mizbin.tar.gz extracts the binaries (makeenv, accom, verifier, ...) flat
127+
# into $HOME/mizar alongside the MML share, so both PATH and MIZFILES point
128+
# at $HOME/mizar -- there is no bin/ subdir.
129+
echo "MIZFILES=$HOME/mizar" >> "$GITHUB_ENV"
130+
echo "$HOME/mizar" >> "$GITHUB_PATH"
131+
ls -l "$HOME/mizar/makeenv" "$HOME/mizar/verifier" "$HOME/mizar/accom"
132+
133+
- name: Install just
134+
run: |
135+
set -euo pipefail
136+
curl -fsSL --retry 3 \
137+
"https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \
138+
-o /tmp/just.tar.gz
139+
mkdir -p "$HOME/.local/bin"
140+
tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just
141+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
142+
143+
- name: Verify Mizar corpus
144+
run: just proofs-mizar

Justfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,38 @@ proofs-verif-idris:
311311
fi
312312
echo "Idris2 verification corpus: all files type-check"
313313
314+
# Heavy (downloads the ~500MB Isabelle release), so this is gated by the weekly
315+
# verification-proofs-cron workflow, not the per-PR `proofs` rollup. Covers the
316+
# base-HOL theories; algebra/GroupTheory.thy is excluded (see proofs/isabelle/ROOT).
317+
# Verify the Isabelle/HOL self-proof corpus (proofs/isabelle) via `isabelle build`.
318+
proofs-isabelle:
319+
cd proofs/isabelle && isabelle build -d . -v Echidna_Isabelle
320+
321+
# Mizar is not packaged for apt and ships only from mizar.org (Tier-4 in this
322+
# project); like Isabelle it is gated by the weekly cron, not per-PR. MIZFILES
323+
# must point at the Mizar share dir. Errors are reported in a per-file .err file
324+
# (the verifier's exit code is not reliable), so a non-empty .err fails the recipe.
325+
# Verify the Mizar self-proof corpus (proofs/mizar) with the Mizar verifier.
326+
proofs-mizar:
327+
#!/usr/bin/env bash
328+
set -euo pipefail
329+
: "${MIZFILES:?MIZFILES must point at the Mizar share dir}"
330+
cd proofs/mizar
331+
rc=0
332+
for f in *.miz; do
333+
echo "=== makeenv + verifier $f ==="
334+
makeenv "$f"
335+
verifier "$f" || rc=1
336+
errfile="${f%.miz}.err"
337+
if [ -s "$errfile" ]; then
338+
echo "Mizar errors in $f:" >&2
339+
cat "$errfile" >&2
340+
rc=1
341+
fi
342+
done
343+
if [ "$rc" -ne 0 ]; then echo "Mizar corpus: VERIFICATION ERRORS" >&2; exit 1; fi
344+
echo "Mizar corpus: all files verify"
345+
314346
# Format code
315347
fmt:
316348
cargo fmt

proofs/isabelle/ROOT

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(* SPDX-License-Identifier: MPL-2.0 *)
2+
(*
3+
ROOT - Isabelle session for the ECHIDNA self-proof corpus.
4+
5+
Gated by `just proofs-isabelle` and the weekly verification-proofs-cron
6+
workflow. Covers the base-HOL theories that type-check on the current
7+
Isabelle release (confirmed green on Isabelle2025-2).
8+
9+
NOTE: algebra/GroupTheory.thy is intentionally NOT in a gated session. It is
10+
"ML training corpus" material (per its own header) that does not verify on
11+
Isabelle2025-2: several lemmas omit their `assumes "group G"` while using
12+
`assms`, and `center_closed` invokes `group.m_comm` which does not hold for a
13+
bare `group` locale (only `comm_group`). Gating it would make the weekly cron
14+
permanently red; it should be repaired as a separate task before being added.
15+
*)
16+
17+
session "Echidna_Isabelle" = "HOL" +
18+
description \<open>ECHIDNA Isabelle/HOL self-proof corpus (base HOL).\<close>
19+
theories
20+
Basic
21+
List
22+
Nat
23+
Propositional

proofs/isabelle/algebra/GroupTheory.thy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Group Theory Examples for ML Training Corpus *)
44

55
theory GroupTheory
6-
imports Main "~~/src/HOL/Algebra/Group"
6+
imports Main "HOL-Algebra.Group"
77
begin
88

99
(** Basic group axioms *)

0 commit comments

Comments
 (0)