Repository navigation
An indexed union or intersection binds its index - #2464
Merged
Merged
Conversation
FreeVariables of union(A_k, k in I) and intersection(A_k, k in I) listed k, though the family binds it as a quantifier does and Substitute already left it alone. It is now bound throughout the family and the index set. DomainCondition is the other binder-aware question, and the same sweep found three leaks of a bound name into it: the indexed family's condition on k is now required over the index set, as a sum's is over its range; a set builder's condition mentioned the placeholder %1 its published predicate is renamed to (so ASetBuildersOwnConditionIsMembership held vacuously), and a lambda's its parameter. Both are dropped, as the set builder's own name already was meant to be. A limit's condition is left as it was, as documented. Fixes #2458 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2464 +/- ##
=======================================
Coverage 87.00% 87.00%
=======================================
Files 320 320
Lines 71216 71229 +13
Branches 20774 20774
=======================================
+ Hits 61959 61973 +14
Misses 4967 4967
+ Partials 4290 4289 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
FreeVariablesnow reads the index of an indexed union or intersection as bound, over both the family and the index set, as a quantifier's:x in union(A_k, k in I)isexists k in I : x in A_k. Checking the other binder-aware API,DomainCondition, found the same leak in three more places, fixed here too:%1, the name its predicate is renamed to internally (now an internalPlaceholder). The existingASetBuildersOwnConditionIsMembershippassed only because it looked for the user's name while the leaked one was%1;union({2*pi*k + y}, k in ZZ)k, pi, ypi, yintersection({k, y}, k in ZZ)k, yyunion({k*y}, k in {k, n})k, n, yy, nunion({1/k}, k in ZZ)not k = 0Falseunion({1/k}, k in ZZ+)not k = 0True{ k : 1/k > y }1 / %1 in RR and y in RR and not %1 = 0y in RRlambda(k, 1/(k - y))not k - y = 0TrueVarsandVarsAndConstsstill list the index, as they do forsum. An index used outside its family (union(...) + k) is still free.Binders checked, every node built through
Binding.Of: sum, product, sum over a set, max/min/argmax/argmin, the definite integral, limit and the quantifiers were already right; the indexed union and intersection were wrong in both APIs; the set builder and lambda inDomainConditiononly. One left as it is: a limit's domain condition still names its bound variable (domain(limit(1/(k-y), k, 0))isnot k - y = 0), which the code keeps deliberately since #1632.FreeVariablesis read inside the library in three places (lambda eta-reduction, a constant check in the limit transformations, and the binder scoping above), and each gets the right answer from the change; no solver code reads it.Tests:
Issue2458_*inFreeVariablesTest.csandBinderConditionTest.cs; 14 fail on master. Full check on this commit before the rebase onto e4f84aa (clean): 20,001 unit tests, 0 failed; MCP 441, Terminal 69, F# 134, Interactive 19; AOT OK; BoundCheck 0 disagreements, RootCheck 596/596, CasBench 120/121 with 0 wrong, SimpSweep 10463/10463, RuleCheck clean, CanonCheck and Confluence at their baselines.Closes #2458.
🤖 Generated with Claude Code