Repository navigation
fix(verdict): preserve Base-free large Nat literals - #1337
Conversation
|
Strengthened the permanent regression: claim now compares id(~4097n) with Succ{grow(12n, Zero{})}, where grow constructs 2^12 successors without any large literal or Nat arithmetic. The actual Lean 4.34.0-built kernel accepts this independent 4097 value oracle, and the CLI still prints 4097n. This avoids relying on equality between two literals that could both be mistranslated. |
|
Joint local verification of #1337–#1341 against main 565d7fd, including the constructor-model correction in #1338:
No physical GPU, macOS/Metal runtime, or mini-cluster gate was exercised. Separate PR source branches remain independent; the integration branch is local verification only. |
…eads ctr_term took a bare Ctr term where it expects the Ctr variant (a new tsc error), and Zero has no fields, so pack_ctr builds the same tuple. nat_literal reads no scope and emits no live-dependent term, so its scope and live parameters go. Co-Authored-By: Claude Opus 5.5 <[email protected]>
71ad49e to
1b701da
Compare
|
Thanks for this! I rebased the branch onto current Checked on the rebased branch:
|
|
Thanks @nicolas-abril. I kept your rebase and pack_ctr fix, rebuilt the kernel from this branch with Lean 4.34.0, and checked both new fixtures: --verdict passes and execution prints 4097n. The repository gate passes 50/50. Commit a41f605 only removes our Unreleased entry, following the release-note convention clarified in the rest of the batch; no evaluator change or force-push. Future PRs will leave CHANGELOG.md to releases. |
…ne vouches for Nat.mul and Nat.add, as a build trusts base's names Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…g one of a file's own Nat takes nat_literal Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tays base's Nat.mul and Nat.add: the chain is what lit_step builds, without a recursion per unit Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… only when it builds one Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e's; a file's own Nat unfolds like any literal, so nat_literal and pack_ctr go Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Thanks again, @oxura! Before merging I cut this down to the core fix, which is now one line in - if (x.k === "Nat" && x.v > NAT_MAX) {
+ if (x.k === "Nat" && x.v > NAT_MAX && e.book.tlds.Nat?.b === true) {Why:
Very large literals of a user-defined Nat (and very long strings) still overflow the stack. That's a separate issue: some recursions in the checker and in Checked: both new tests and |
|
Thanks for reducing this to the Base-Nat guard and retaining the two behavioral regressions. Agreed that user literals should keep the existing constructor-lowering path; I will preserve the merged simplification. I have recorded the remaining large-user-Nat/long-string stack overflow as a separate checker/traversal limitation, not as something this PR fixes. |
Fixes #1330.
Verification (local, Bun 1.3.13; real BendTT kernel built with Lean 4.34.0):