Skip to content

fix(verdict): build inlined recursive let arguments at each use - #1368

Merged
Lorenzobattistela merged 1 commit into
bendlang:mainfrom
oxura:fix/let-use-site-depth
Oct 7, 2026
Merged

Lorenzobattistela merged 1 commit into
bendlang:mainfrom
oxura:fix/let-use-site-depth

Conversation

@oxura

@oxura oxura commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #1326.

A let inlined into a recursive call kept kernel binders allocated where the let was declared. A later convoy could rename those levels and certify a different value. Store its original Bend term using the existing specialized-argument mechanism, then elaborate it at each use's depth and mode.

  • No parser/kernel/core-language change or compatibility shim.
  • Update Bind/scope/let documentation and add a regression covering both bound-variable capture and free-variable collision, with an independent law that the result is 9n.

Local verification (Linux x64, Bun1.3.13, Node22, Clang22, real current Lean4.34.0 kernel):

  • New regression before fix: --verdict fails with the mismatch banner. After: ALL PROOFS CHECK.
  • Actual source interpreter, emitted JS under Bun/Node, native CPU1/4threads: all9n.
  • Repository gate: PASS50/50, unchanged caps/gates.

No cluster, CUDA or Metal gates were run. CHANGELOG.md is intentionally unchanged: release commits own release notes.

@Lorenzobattistela Lorenzobattistela self-assigned this Oct 7, 2026
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.

--verdict certifies a different main (kernel 1, bend2 0n): a let passed to a self-call is built at the let, so a convoy captures it (#1168 via let_term)

2 participants