Skip to content

Commit b0a08cc

Browse files
hyperpolymathclaude
andcommitted
verify-all-provers: run the Print Assumptions audit and its control inside the canonical gate
`just verify` -> proofs/verify-all-provers.sh built Coq and printed ALL-PROVERS-GREEN without ever running proofs/coq/check-assumptions.sh, so the canonical gate could say GREEN on a theorem resting on an axiom: the same "guard asks a different question" defect this PR cures elsewhere (CodeRabbit's Major on the first commit). - verify-all-provers.sh: after a successful Coq build, run check-assumptions.sh and check-assumptions.sh --control; either failing sets fail=1 with its own reason line. - gate-selftest.sh: the coqc stub now answers `Print Assumptions` faithfully (Closed for every audited theorem, `Axioms: kB_positive` for the control's target), so case A exercises the audit; cases O (every theorem reports an axiom) and P (the control's target reports closed) prove the gate turns red for each. 16/16 locally; with the previous gate exactly O and P fail (meta-mutant), and I still passes after them. - PROOF-STATUS: 14 -> 16 cases; the audit is named as part of the canonical gate. Real prover, Coq 8.20.1: `just verify-coq` -> ASSUMPTIONS-CHECK OK 17/17, ASSUMPTIONS-CONTROL OK (landauer_limit_positive rejected naming kB_positive). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYY8Gp4v4x2J7iSNn1vZ57
1 parent e2a31a6 commit b0a08cc

3 files changed

Lines changed: 40 additions & 5 deletions

File tree

‎PROOF-STATUS.adoc‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ plus the *Idris 2* ABI. Both the CNO and OND pillars are covered.
2020
An absent prover is a *failure*, never a skip (since 2026-09-23 — before that Isabelle
2121
and Mizar printed "skipped" and the gate could say GREEN on four of six), and Z3
2222
verdicts are compared with the `; expect sat|unsat` annotation on every `(check-sat)`
23-
(`proofs/z3/verify.sh`). `proofs/tests/gate-selftest.sh` proves both gates turn red for
24-
each absent or failing prover and for each verdict mutant (14 cases, run in CI).
23+
(`proofs/z3/verify.sh`). Since 2026-09-23 the gate also runs the Coq `Print Assumptions` audit and
24+
its `--control` after the build, so a theorem resting on an axiom, or an audit that can no
25+
longer say no, turns it red. `proofs/tests/gate-selftest.sh` proves both gates turn red for
26+
each absent or failing prover, for each verdict mutant and for both audit mutants (16 cases, run in CI).
2527
====
2628

2729
== Coq — VERIFIED (this environment)
@@ -90,7 +92,8 @@ These are the analogue of the OND-6 research fork: openly labelled, not silently
9092
assumed. `Print Assumptions` on each of the 17 theorems this document names in backticks
9193
prints `Closed under the global context` — no stdlib axiom and no project axiom (measured
9294
2026-09-23, Coq 8.18). That is CI-gated: `proofs/coq/audit/Assumptions.v` lists the 17 and
93-
`proofs/coq/check-assumptions.sh` (Coq job of `proofs.yml`) fails on any `Axioms:` block or a
95+
`proofs/coq/check-assumptions.sh` (Coq job of `proofs.yml`, and the canonical
96+
`proofs/verify-all-provers.sh` gate since 2026-09-23) fails on any `Axioms:` block or a
9497
missing line; its `--control` mode proves the gate bites by requiring that
9598
`landauer_limit_positive`, which rests on `kB_positive`, is rejected. The wider tree is not
9699
closed — 109 of 182 top-level theorems are; the other 73 rest on stdlib classical axioms

‎proofs/tests/gate-selftest.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ for t in coqc coq_makefile make agda lake isabelle accom verifier idris2; do mks
3131
# z3_stub <verdicts>: replace the z3 stub with the supplied solver output.
3232
z3_stub() { mkstub z3 "case \"\${1:-}\" in --version) echo \"Z3 version stub\";; *) printf '$1';; esac"; }
3333
z3_stub 'sat\nunsat\nsat\n'
34+
# coqc must answer `Print Assumptions` faithfully, or the audit inside the gate
35+
# (proofs/coq/check-assumptions.sh) cannot be exercised: one "Closed under the
36+
# global context" per Print Assumptions line, except the control's target
37+
# (landauer_limit_positive), which rests on the tagged axiom kB_positive.
38+
# COQC_STUB_MODE=axioms -> every theorem reports an axiom (case O)
39+
# COQC_STUB_MODE=closed -> every theorem reports closed, control included (case P)
40+
cat > "$STUB/coqc" <<'COQC'
41+
#!/bin/sh
42+
f=""; for a in "$@"; do case "$a" in *.v) f=$a;; esac; done
43+
[ -n "$f" ] && [ -r "$f" ] || exit 0
44+
grep '^Print Assumptions' "$f" | while IFS= read -r line; do
45+
id=${line#Print Assumptions }; id=${id%.}
46+
case "${COQC_STUB_MODE:-}:$id" in
47+
axioms:*|:*landauer_limit_positive*) printf 'Axioms:\nPhysicsConstants.kB_positive : (0 < kB)%%R\n';;
48+
*) echo "Closed under the global context";;
49+
esac
50+
done
51+
exit 0
52+
COQC
53+
chmod +x "$STUB/coqc"
3454
for s in "$STUB"/*; do sh -n "$s" || { echo "FAIL: stub $s does not parse"; exit 1; }; done
3555

3656
OUT=""; RC=0
@@ -69,6 +89,13 @@ expect "G z3 unknown verdict -> fail" 1 "verdicts differ from annotations" "ALL-
6989
z3_stub 'sat\nunsat\nsat\n'
7090
# H. a prover that runs but fails must FAIL
7191
mkstub idris2 'exit 3'; run_gate; expect "H idris2 exit 3 -> fail" 1 "IDRIS FAILED" "ALL-PROVERS-GREEN"; mkstub idris2
92+
# O. Coq builds but a theorem rests on an axiom: the audit must turn the gate red
93+
# (pre-2026-09-23 the canonical gate never ran the audit, so this was green)
94+
export COQC_STUB_MODE=axioms; run_gate; unset COQC_STUB_MODE
95+
expect "O coq audit sees Axioms: -> fail" 1 "COQ ASSUMPTIONS FAILED" "ALL-PROVERS-GREEN"
96+
# P. an audit that calls EVERYTHING closed, the control's target included, must FAIL
97+
export COQC_STUB_MODE=closed; run_gate; unset COQC_STUB_MODE
98+
expect "P coq control passes wrongly -> fail" 1 "COQ ASSUMPTIONS-CONTROL FAILED" "ALL-PROVERS-GREEN"
7299
# I. after the mutants, the positive control is green again (no state leaked)
73100
run_gate; expect "I positive control repeats green" 0 "ALL-PROVERS-GREEN" "SOME PROVERS FAILED"
74101

‎proofs/verify-all-provers.sh‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ say() { printf '\n\033[1m== %s ==\033[0m\n' "$1"; }
1717
# ---- Coq (both pillars) --------------------------------------------------
1818
say "Coq — CNO + OND"
1919
if command -v coqc >/dev/null; then
20-
( cd "$HERE/coq" && coq_makefile -f _CoqProject -o Makefile.all >/dev/null 2>&1 \
21-
&& make -f Makefile.all -j"$(nproc)" ) || { echo "COQ FAILED"; fail=1; }
20+
if ( cd "$HERE/coq" && coq_makefile -f _CoqProject -o Makefile.all >/dev/null 2>&1 \
21+
&& make -f Makefile.all -j"$(nproc)" ); then
22+
# The build alone is not the gate: the 17 named theorems must be closed under
23+
# the global context, and the control must prove the audit can say no.
24+
bash "$HERE/coq/check-assumptions.sh" || { echo "COQ ASSUMPTIONS FAILED"; fail=1; }
25+
bash "$HERE/coq/check-assumptions.sh" --control || { echo "COQ ASSUMPTIONS-CONTROL FAILED"; fail=1; }
26+
else echo "COQ FAILED"; fail=1; fi
2227
else echo "coqc missing"; fail=1; fi
2328

2429
# ---- Agda (CNO + OND) ----------------------------------------------------

0 commit comments

Comments
 (0)