proof: lift expr helper result through let head#2104
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_a20856f6-88ca-40a6-b418-bfe9ffd71ce7) |
| \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``` |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_13184542-4762-4977-b254-0ac6865764e9) |
|
Reviewed this PR's isolated contribution (2 commits over
Not merging yet: base PR #2103 ( |
e168b30 to
8a973ce
Compare
8bc3ff2 to
8d1e6d1
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9667ffa7-c348-45b2-b816-7cc6f31acb43) |
Continues #2080 after phase 9 / #2103.
Stacking: this PR targets
paloma/issue-2080-constructor-expr-bridgeand depends on #2103, which remains stacked on #2102 and #2101.What changed
ExprInternalHelperHeadStepBridge, so concrete statement-head adapters can line upexecIRStmtsWithInternalsfuel with expression evaluation fuel.compileStmt_letVar_of_compileExprWithInternalsfor singletonStmt.letVarcompilation.exprInternalHelperHeadStepBridge_letVar_of_exprCompositionalResult, the first concrete adapter from anExprInternalHelperCompositionalContextResultinto anExprInternalHelperHeadStepBridgefor an expression-bearing statement head.Non-vacuous status
This is a concrete statement-head lift for
Stmt.letVar: the theorem consumes the phase 6-9 compositional expression payload, preserves the helper payload existential, evaluates source and helper-aware IR for the statement head, and proves the resultingstmtStepMatchesIRExecWithInternalscontinue case.Remaining proof/API gaps
The adapter keeps two obligations explicit instead of faking them:
CompiledStmtStepWithHelpersAndHelperIR.compileOkstill records the legacycompileStmt ... stmtshape with the default empty internal-function list, while expression helper payloads compile withspec.functions; callers must currently provide the statement-side compile shape separately.ExprInternalHelperCompositionalContextResultdoes not yet record post-expression IR/source state preservation or old-scope binding preservation, so theletVaradapter requires those facts explicitly.Recommended next dispatch: close those two API gaps by enriching the expression compositional result with final-state relation facts and aligning helper-aware statement compilation witnesses with
spec.functions; then instantiate thisletVarbridge with the phase-9Expr.addright-helper result.Validation
lean-slot lake build Compiler.Proofs.HelperStepProofspassed.rg -n "\\bsorry\\b|\\badmit\\b|\\baxiom\\b" Compiler/Proofs/HelperStepProofs.leanfound no matches.git diff --checkpassed.lean-slot make checkwas attempted, but the offloaded workspace used bylean-slotis not a git repository forgit ls-files; it passed property manifest/coverage/sync and contract structure checks before failing inscripts/check_paths.pywithfatal: not a git repository.Note
Low Risk
Lean proof-only changes in helper-step infrastructure; no runtime, auth, or deployment impact. Residual API mismatches (empty vs
spec.functionscompile witnesses) are documented and left for follow-up.Overview
Continues #2080 phase 10 by wiring expression-position helper proofs up to statement heads, starting with
Stmt.letVar.ExprInternalHelperHeadStepBridgenow requires IR fuel slack (sizeOf compiledIR - compiledIR.length ≤ irFuel) so statement-head adapters can alignexecIRStmtsWithInternalsfuel with inner expression evaluation.compiledStmtStepWithHelpersAndHelperIR_of_exprHeadStepBridgeforwards that hypothesis into the bridge.New lemmas:
compileStmt_letVar_of_compileExprWithInternals(singletonletcompile shape from a helper-aware expression compile) andexprInternalHelperHeadStepBridge_letVar_of_exprCompositionalResult, which consumes anExprInternalHelperCompositionalContextResult(plus explicit post-expression runtime/scope facts and name-in-scope side conditions) and proves sourceexecStmtWithHelpersand IR execution both continue with the bound value while re-establishing scope/runtime invariants.PrintAxioms.leanandscripts/check_proof_length.pyregister the new theorems (allowlist entry for the longletVaradapter proof).Reviewed by Cursor Bugbot for commit 8d1e6d1. Bugbot is set up for automated code reviews on this repo. Configure here.