-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new bounds heuristic: one larger than the largest index accessed in the function? #599
Comments
I'd appreciate meaningful issue titles. I've tried to improve this one.
I assume you mean Do you have a realistic example program in which this feature would be useful so that we can prioritize it appropriately? (Has this been discussed somewhere else that I'm not aware of?) |
For
That further added bounds to other functions:
|
Thanks for posting the example. Mike forwarded it to me earlier, and we discussed it a bit; I'll restate my thoughts here. In short, this example by itself doesn't overcome my skepticism that the Based on my brief look at the yacr2 code, it looks like the size of Note that this issue is independent of the weird thing yacr2 does with indexing arrays from 1 to N. If yacr2 used the usual 0 to N-1, then the size would be just Thinking about the general phenomenon illustrated by this example: As long as the actual array size is in scope and valid to use as a bound, I propose that 3C should prefer the size, so we wouldn't need this new "i + 1" heuristic. If we think cases in which the full array size isn't usable as a bound will be common enough, that could justify adding the heuristic. That may be true in this yacr2 example, but I claim that the example is unconventional: the size is stored only in the |
Agree that |
Can you give a more convincing example then?
It's an area of ongoing work. For example, |
For this code
You might imagine that we could infer the bound should be at least as much as the largest index, so the first bound would be
count(1)
and the second would becount(i)
, but that doesn't happen. If we add a conditional, as in the third function, heuristics pick up the bound:The text was updated successfully, but these errors were encountered: