Repository navigation
fix(proofs): check Idris proofs with --total; give parser determinism content - #1243
hyperpolymath wants to merge 2 commits into
Conversation
… content verify-proofs.yml checked each standalone .idr file with `idris2 --check` alone, while every Idris row of the ledger records `--total`. A file that dropped `%default total` would still have passed. The loop now passes --total, matching both ipkgs (opts = "--total"). parseFromDeterministic stated `parseFrom ts = parseFrom ts`, which holds for any function and says nothing about the parser. It now states that the FROM-clause grammar is deterministic: two parses of the same tokens give the same source and remainder. The grammar is a relation, Parses, written apart from parseFrom with one constructor per production. parsesComplete shows that every parse it admits is the one parseFrom returns, and determinism follows. If two productions could read the same tokens, this would not check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CYR5bf5FBLS7cXQK72aVNM
|
Review these changes at https://app.gitnotebooks.com/hyperpolymath/hypatia/pull/1243 |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af7a57c143
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…does Codex on #1243: verification/README.adoc says its loop type-checks exactly as verify-proofs.yml does, but still ran idris2 --check without --total, so a file that lost %default total could pass locally and fail in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CYR5bf5FBLS7cXQK72aVNM
|



Summary
Two holes in how hypatia checks its Idris proofs. Both are in the claims the proof ledger makes, not in the parser itself.
1. The per-file check did not pass
--total.verify-proofs.ymlchecked each standalone file underverification/proofs/idris2/withidris2 --checkalone. Every Idris row inverification/proof-ledger.jsonlrecords the checker asidris2 --check (--total). Every file declares%default totaltoday, but a file that dropped that line would still pass. The loop now runsidris2 --check --total. That matches both packages, whose.ipkgfiles already setopts = "--total".2.
parseFromDeterministicproved nothing about the parser. It statedparseFrom ts = parseFrom ts, which holds for any function. It now states that the FROM-clause grammar is deterministic:Parsesis the grammar as a relation, written apart fromparseFrom, with one constructor per production.parsesComplete: every parse the grammar allows is the oneparseFromreturns.parseFromDeterministic: two parses of the same tokens give the same source and leave the same tokens. It is derived fromparsesComplete.If two productions could read the same tokens,
parsesCompletewould not check. The theorem name, the ledger row and its status do not change.Evidence
Idris 2 0.7.0, built from the v0.7.0 tag on Chez Scheme 9.5.8.
verification/proofs/idris2/check withidris2 --check --total.%default totalholdingloop n = loop n:idris2 --check: exit 0.idris2 --check --total: exit 1,Error: loop is not total, possibly not terminating due to recursive path Planted.loop.PAmbiguous : Parses (KwFrom :: KwStore :: Ident v :: rest) (Hexad v) rest, makesparsesCompletefail:Mismatch between: Hexad v and Store v.mainat 3e2b800) and after (this branch). Identical on both:scripts/proof-ledger.sh check: "57 rows valid; 35 proven of 57; 0 proven-with-postulates, 13 tested-only, 2 argued, 7 open."render --check: the block is current.claims: 4 quoted censuses agree.tests/proof-ledger-test.sh: 53 passed, 0 failed.scripts/check-proof-status.sh,scripts/check-trusted-base.shandscripts/check-readme-claims.shpass.verify-proofs.yml: clean.Not run: the CI workflow itself. This PR's Verify Proofs run is the first run of the new flag.
Relation to the open stack
This PR is separate from #1189, #1190 and #1191, and is based on
main. #1189 also editsParserTotality.idr, but only after line 146. This PR changes lines 72 to 107, so the two merge without conflict.Generated by Claude Code