Scaffold proven forEach loop fragment#1935
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9f43e04 to
221d369
Compare
| \n### CI Failure Hints\n\nFailed jobs: `checks`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
|
Temporarily closing and reopening to clear a wedged GitHub Actions run for this PR. No code change is being abandoned. |
|
CI update: the proof/code changes are pushed at Observed from the API:
GitHub status currently reports an active incident with Actions and Pages, with Actions in major outage. I will leave the branch as-is; local proof verification has passed and this is waiting on GitHub Actions to recover or the stuck run to clear. |
…agment # Conflicts: # PrintAxioms.lean
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 85493d3. Configure here.

End goal
Expand Verity's proven compiler fragment so
Stmt.forEachloops have a real, documented proof path through compiler preservation instead of being treated as entirely unsupported.This PR now proves the generic empty-body literal-bound fragment end to end:
for arbitrary natural literal bounds
n.What is proven
Admitted/proven
forEachcases:Stmt.forEach varName (.literal 0) body, wherebodyis supported undervarName :: scope.Stmt.forEach varName (.literal n) [], for any literal natural boundn.The positive empty-body case is no longer staged as separate literal-
1and literal-2support. It is admitted by the genericforEachLiteralEmpty nconstructor and wired through the actualCompiledStmtStep/Compiler.Proofs.EndToEndpreservation path.What changed
execForEachLoopsemantics and helper lemmas for loop execution.forEachusing an internal cached bound and index counter, assigning the user loop variable at the start of each iteration.for_execution lemmas.GenericInductionandEndToEnd.Still intentionally unsupported
This PR does not prove general positive
forEachloops with non-empty bodies.Unsupported/fail-closed cases include:
Stmt.forEach varName count []whencountis not a literal.Stmt.forEach varName (.literal n) bodyfor positivenand non-emptybody, unless covered by the separate zero-bound rule.So
forEachremains documented as partial: arbitrary literal-bound empty-body loops are proven, zero-bound supported-body loops are proven, and positive non-empty bodies remain future work.Validation
Local validation on the pushed branch:
lake build Compiler.Proofs.IRGeneration.GenericInductionpassed.lake build Compiler.Proofs.EndToEndpassed.lake build PrintAxiomspassed.npm run check:highlightingpassed indocs-site.npm run buildpassed indocs-site.sorry,admit, or new unsoundaxiom; remaining hits are prose/comment text or standard Lean axioms reported byPrintAxioms.Current PR head:
417abe2f2394fb78332b41fe46f6dc4158898624.Review focus
Please review this as a staged proof PR:
execForEachLoopand compiled Yulfor_semantics?