-
Notifications
You must be signed in to change notification settings - Fork 273
Move exprt::bounded_size to complexity_limitert #5988
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
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.
Minor tweaks on text matching new names noted.
Outside of this, there were many experiments with CSE (some info #5964) that used the expression size and these showed that this could be a useful parameter to manipulate. I note this because if we want to have a bounded size for expressions later this would involve a refactor to return this to expr and not be in complexity_limiter.
#include <goto-symex/complexity_limiter.h> | ||
|
||
TEST_CASE( | ||
"Bounded size is computed correctly", |
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.
"Bounded size" -> "Bounded expr[ession] size"
} | ||
|
||
TEST_CASE( | ||
"Bounded size versus pathological example", |
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.
"Bounded size" -> "Bounded expr[ession] size"
exprt pathology = plus_exprt(from_integer(1, type), from_integer(1, type)); | ||
// Create an infinite exprt by self reference! | ||
pathology.add_to_operands(pathology); | ||
// If bounded size is not checking the bound this will never terminate. |
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.
"Bounded size" -> "Bounded expr[ession] size"
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 an improvement. I'd rather we didn't have the for/recurse without caching but this is an improvement.
{ | ||
return count; | ||
} | ||
count = bounded_expr_size(op, count, limit); |
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 we aren't going to fix this, can we at least have a comment saying this is potentially risky?
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.
Comment now added to the public member function.
a1dd075
to
bad8e11
Compare
Thanks a lot for the comments, text changes implemented. As far as re-use is concerned: if it turns out to be useful, then we could certainly consider moving this elsewhere. If we do, however, then IMHO it should be somewhere around |
complexity_limitert is really the only user of this method, and may be fine with its implementation details (cf. discussion in diffblue#5914). For other potential users such assumptions might not be safe.
bad8e11
to
8f61a22
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5988 +/- ##
===========================================
+ Coverage 75.12% 75.13% +0.01%
===========================================
Files 1435 1445 +10
Lines 156301 157261 +960
===========================================
+ Hits 117416 118165 +749
- Misses 38885 39096 +211
Continue to review full report at Codecov.
|
complexity_limitert is really the only user of this method, and may be
fine with its implementation details (cf. discussion in #5914). For
other potential users such assumptions might not be safe.