Repository navigation
fix(safe): consume the full shared group prefix - #1704
Open
sebastian-griego wants to merge 1 commit into
Open
sebastian-griego wants to merge 1 commit into
sebastian-griego wants to merge 1 commit into
Conversation
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.
A recursion group can share an argument bound by a returned lambda beyond a member's declared parameters. For
g(n: Nat) -> Nat -> Nat, the group can consume bothnandxbefore its selector.group_emitpreviously consumed only the declaredn. The generatedgmode still returnedNat -> Nat, so--verdictrejected the book when the call expectedNat.Consume
max(declared parameters, shared parameters)when constructing each member's remaining type and body. Require the same lower bound at group calls. This prevents a call from receiving the selector in a missing shared argument slot. Calls that reachgroup_callwithout the full prefix remain out of scope.The five tests cover a returned helper lambda, a structural decrease in that lambda's argument, a helper with no declared parameters, a returned lambda in the leading member, and a dependent result. They use a forward law in an erased lambda. All five source programs check and run on main, but their BendTT books fail. This change makes all five pass the unchanged kernel and
--verdict.Validation:
--checkup, interpretation, JavaScript, C, and the unchanged kernel. Source checking, interpretation, export, kernel checking, and--verdictwere also rerun on the final branch.gates/safe_node.tssweep preserves every result across 1,733 existing test, demo, and benchmark files. There are no timeouts or infrastructure errors. Existing rejections remain rejections.safe.tsadds six tokens and uses 23,992 / 24,000ttoktokens.The patch changes two lines in
safe.ts. It does not change the source checker or the kernel.