Skip to content

proof(ir): switch support — full loop-free splice simulation (lane 2.2) - #2295

Merged
Th0rgal merged 1 commit into
mainfrom
proof/2087-switch-simulation
Aug 12, 2026
Merged

proof(ir): switch support — full loop-free splice simulation (lane 2.2)#2295
Th0rgal merged 1 commit into
mainfrom
proof/2087-switch-simulation

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Aug 12, 2026

Copy link
Copy Markdown
Member

Removes the switch exclusion from #2291's fragment: SpliceSim now covers switch (cases + default), with the find?-vs-splice commutation, bound domination by membership, spliced_cons_switch, and structurally-static companion recursions (execIRStmts_splicedCases/_splicedDflt) in the main mutual induction. The end-to-end guardedUnit theorems (#2294) inherit the widened fragment with no change — the guarded correspondence now covers every loop-free compiled body with modeled exits.

Validation: full lake build OK, make check all passed, no sorry/admit/new axiom.


Note

Medium Risk
Changes are proof-only but extend a critical IR correctness chain (non-reentrant guard / guardedUnit); errors would be in formal reasoning, not runtime code.

Overview
Extends the lock-release splice simulation fragment so switch (case arms and default) is no longer excluded: SpliceSim now mirrors LoopFree with SpliceSimCases / SpliceSimDflt, and SpliceSim.loopFree proves the fragment still implies loop-freedom.

Adds the switch cons-step machinery for execIRStmts_spliced: find?_spliceCases (branch lookup commutes with splicing), spliced_case_bound_le (fuel bounds for spliced arms), spliced_cons_switch, and mutual companion lemmas execIRStmts_splicedCases / execIRStmts_splicedDflt with explicit termination_by / decreasing_by on the main induction.

Registers the new lemmas in PrintAxioms.lean and allowlists spliced_cons_switch in check_proof_length.py (theorem count 6239 → 6247).

Reviewed by Cursor Bugbot for commit 6474250. Bugbot is set up for automated code reviews on this repo. Configure here.

…ee fragment (lane 2.2)

Extend SpliceSim with switch (cases/default sub-fragments and LoopFree
bridges), prove the find? commutation with the key-preserving case
splice, membership bound domination, and spliced_cons_switch (selected
case via find?, default, and no-default branches, each propagating
through the list step). The main induction gains structurally-static
companion recursions over case lists and defaults
(execIRStmts_splicedCases/_splicedDflt), avoiding membership-based
termination measures. The end-to-end guardedUnit theorems inherit the
widened fragment unchanged.
@Th0rgal
Th0rgal merged commit 66a5261 into main Aug 12, 2026
1 of 2 checks passed
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
verity Building Building Preview Aug 12, 2026 4:47pm

Request Review

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_aeb2a88d-48be-4bff-83b7-02a36a28c824)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCodeReview first-pass review

OCR did not run — this diff has no OCR-supported files. Not a review outcome.

No changed files matched OCR include rules.

OCR pilot metrics & packet coverage

OCR pilot metrics

  • Routing: no-supported (router-v10)
  • Changed files: 0 supported / 0 total; Lean 0, trust docs 0, workflow/scripts 0, contracts 0, docs 0
  • Changed lines: 0 supported; thresholds large Lean >=3 files or >800 lines
  • OCR: status no-supported; comments 0; files 0; tokens 0; tool calls 0; warnings 0; duration 0s

Pilot mode: advisory only. Codex Review remains the merge gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant