Skip to content

fix(check): a self-call that doesn't shrink shows what it received (#1632) - #2006

Merged
nicolas-abril merged 1 commit into
mainfrom
ai/1632-self-call
Nov 2, 2026
Merged

nicolas-abril merged 1 commit into
mainfrom
ai/1632-self-call

Conversation

@nicolas-abril

@nicolas-abril nicolas-abril commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Proposal 4 of #1632, in a smaller form than #1734.

#1734 named one argument as "not smaller", which was wrong for the repro: after case 1n+p: the column is 1n+p, so loop(1n+p, b) passes every argument as received. This doesn't pick an argument. It prints the call as received next to the call as written, and the reader sees why it fails:

SOME PROOFS FAIL
Error:
- expected : a call smaller than loop(1n+p, b) (arguments are read left to right: each passed unchanged until one shrinks)
- observed : loop(1n+p, b)
Context:
- p : Nat
- b : Nat
Location: loop
7 |     case 1n+p:
8>|       loop(1n+p, b)
  |       ^^^^
9 | 

Other shapes from the regenerated tests: sw(S{p}, b) against sw(b, S{p}), down(64n) against down(65n), fold(n) against fold(ndiv(n, 2n)).

  • bend2/bend.ts: 3 lines at infer-ref's self-call check, +72 ttok (45,150 → 45222 / 48k). prototype #1632.4: name the argument that doesn't shrink #1734 adds about 450.
  • The terms print as written, with no normalization, so printing can't unfold the def being rejected.
  • A def with no named parameters has no columns, so it reads a call smaller than loop against loop(a). A bit bare, but still true.
  • Not changed: the template-cycle error in def_inst has the same message but no columns to show.
  • The 29 tests with this message are regenerated.

Gates on the three PRs combined, on origin/main 3ca3df32: repo 54/54, test 1819/1819, perf 124/124. Ping fails 80/81 on the BendHub LICENSE check, the same as unchanged main on this machine.

🤖 Generated with Claude Code

@Lorenzobattistela Lorenzobattistela self-assigned this Nov 2, 2026
@nicolas-abril
nicolas-abril merged commit 468dc97 into main Nov 2, 2026
1 check passed
@nicolas-abril
nicolas-abril deleted the ai/1632-self-call branch November 2, 2026 14:58
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.

2 participants