Repository navigation
fix(verdict): a bare constructor in a type goes to the kernel at its goal (#1619) - #1620
Merged
Lorenzobattistela merged 2 commits intoOct 16, 2026
Merged
Conversation
… function in a parameter field goes η-long (bendlang#1619) arg_term gives a bare λ or match its goal A but returned a bare constructor without it, so ctr_term could not fill a parameterized datatype's arguments and left a function-typed field (a pair's, Some's) bare, while the call side sent the same function η-long. The kernel converts without η, so --verdict reported a mismatch for proofs bend2 accepts. tests/check/ctr_param_field_eta.bend covers a pair and a template's Some. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
I closed #1621 as a duplicate of this PR. I reached the same one-line fix independently. I missed your earlier PR before I opened mine. My two additional tests cover different field types and may be useful here:
Both tests pass source checking before and after the fix. Both fail Please use either or both tests in this PR. They have no dependency on other changes. |
…function type (bendlang#1619) Two more tests for a bare constructor in a type losing its goal: a lambda in a generic Box at @-x: Type -> Type (the kernel reported "a λ of its binder's liveness"), and a field whose type depends on an earlier field (export reported "an application past its head's known type" and --verdict rejected the file). Both pass with the fix in this PR. Written by Sebastian Griego in bendlang#1621. Co-authored-by: Sebastian Griego <177274079+sebastian-griego@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Thank you - your tests caught the binder-liveness and out-of-scope failures, which mine didn't, so I've added both and attributed you. |
Lorenzobattistela
approved these changes
Oct 16, 2026
This was referenced Oct 19, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1619.
--verdictreported a mismatch for a proof bend2 accepts when a function sits in a field whose type is a parameter (a pair's component,Some's value):Cause.
arg_termsends the call's function-typed argument η-long.(v, False{})is a term in a type, so it arrives bare.arg_termgives a bare λ or match its goalA, but not a bare constructor.ctr_termgetsT === null, cannot fill the pair's parameters, and leavesvbare.λx1 => (x0 x1)never meetsx0.Fix. Give a bare constructor its goal too:
The same cause, two more symptoms. Sebastian Griego reached the same fix independently (#1621). His two tests show that a bare constructor losing its goal breaks more than η:
tests/proof/generic_constructor_erased_lambda.bend: a lambda in a genericBoxat@-x: Type -> Type. The kernel reporteda λ of its binder's liveness.tests/proof/generic_constructor_dependent_function.bend: a field whose type depends on an earlier field. Export reportedan application past its head's known type, and--verdictrejected the file.They are added here unchanged, with him as co-author.
Tests.
tests/check/ctr_param_field_eta.bendcovers the pair and a template'sSome{v}.All three check as before. On
main(234cb9b),--verdictrejects each; with the fix, each prints ALL PROOFS CHECK. Sogates/safe.ts testsfails without the fix.What I ran (Linux x86_64 under WSL2; I can't run the minis):
bend2's check and--verdicton the three tests: rejected onmain, ALL PROOFS CHECK with the fix.gates/safe_node.tslocally over all oftests/anddemos/*/PROOF.bend: every file keeps its verdict class (1,071 agree, 492 bend2-rejects, 99 unsafe, 4 out of scope).bend-collections-laws-containers@1.0.0.0dynamic_array/{proof,owned_instances}.bendgoes from mismatch to agree;Not run:
gates/test.tsandgates/perf.ts(the minis).Size.
safe.tsis 23,978 ttok onmainby my localttok==0.3, and 23,986 with this change, under the 24,000 cap. My local count also readscomp.tson unmodifiedmainas 64,092, over its cap, so it differs a little from CI's. The repo gate here will say.Found and tested with Claude Code, running Claude Opus 5.5, during an audit of
--verdict.