-
Notifications
You must be signed in to change notification settings - Fork 277
Assume relation between two symbols #5362
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
Conversation
This doesn't fix #179. but a different issue on a private fork - adding a test now |
Codecov Report
@@ Coverage Diff @@
## develop #5362 +/- ##
============================================
+ Coverage 31.81% 68.17% +36.35%
============================================
Files 919 1170 +251
Lines 80404 96559 +16155
============================================
+ Hits 25584 65832 +40248
+ Misses 54820 30727 -24093
Continue to review full report at Codecov.
|
5d97f74
to
f3e5eb9
Compare
\[main\.assertion\.1\] line 8 assertion 0: UNKNOWN | ||
\[main\.assertion\.2\] line 13 assertion 0: UNKNOWN | ||
-- | ||
Test comparision between two symbols does not mark the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a do-not-match line, not a comment
|
||
bool is_less_than_eq(const interval_templatet &i) | ||
{ | ||
if(i.lower_set && upper_set && upper <= i.lower) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x) return true; else return false; --> return x
|
||
bool is_less_than_eq(const interval_templatet &i) | ||
{ | ||
if(i.lower_set && upper_set && upper <= i.lower) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cross-check since there are no comments to this effect in interval_template.h
: these intervals are inclusive at both ends?
|
||
void make_less_than_eq(interval_templatet &i) | ||
{ | ||
if(upper_set && i.upper_set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my own upper bound is not set but i's is, shouldn't it now become set, and the same for i's lower bound inheriting mine?
void make_less_than(interval_templatet &i) | ||
{ | ||
make_less_than_eq(i); | ||
if(singleton() && i.singleton() && lower == i.lower) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this do more, too? For example, if i has max 5 and this is now always less than it, this should have max value 4, and similarly i's lower bound should be max(i.lower, lower + 1)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smowton It can do a lot more, but the nice thing about AI is that as long as we don’t add impossible behaviour we don’t necessarily have to do everything as precise as possible from the start (we should make it as precise as reasonable obviously, and there’s a lot of things that still could be done here).
@smowton all your comments seem correct, but are a question of precision. I'm reluctant to apply since:
Will fix the test desc problem |
IIRC this wasn’t a bug fix, this was there to implement some amount of narrowing for intervals. |
@hannes-steffenhagen-diffblue I believe it is a bug - previously that assert in there would be marked as success (unreachable) which is not true! |
Pulled out of #5361 as appears to be an unrelated bug fix. Not sure what bug it is fixing yet - will try and add a test!