-
Notifications
You must be signed in to change notification settings - Fork 284
Clean-up constraint generation for insert builtin function #5063
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
Clean-up constraint generation for insert builtin function #5063
Conversation
This is now totally handled by the string_dependencies class.
| /// 4. forall i in [offset', s1.length). res[i + s2.length] = s1[i] | ||
| /// This is equivalent to | ||
| /// `res=concat(substring(s1, 0, offset'), concat(s2, substring(s1, offset')))`. | ||
| /// \param fresh_symbol: generator of fresh symbols |
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.
🚫 docs don't match signature
| } | ||
|
|
||
| protected: | ||
| explicit string_insertion_builtin_functiont( |
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.
explicit not required
5024d67 to
adfa82a
Compare
adfa82a to
9a066f1
Compare
239ae21 to
fc4baa4
Compare
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: fc4baa4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/124918171
Codecov Report
@@ Coverage Diff @@
## develop #5063 +/- ##
===========================================
+ Coverage 69.51% 69.53% +0.01%
===========================================
Files 1314 1315 +1
Lines 108980 108967 -13
===========================================
+ Hits 75760 75766 +6
+ Misses 33220 33201 -19
Continue to review full report at Codecov.
|
Put all the code related to the builtin string_insert function to a string_insertion_builtin_function file.
The string preprocessing no longer produces calls to this builtin function which would have 3 arguments (in addition to the two string arguments) so the UNIMPLEMENTED case can be made into a precondition instead.
This is the only place where it is used, and the constraint method is very short so it makes sense to inline it there.
This is only used in one place and the code of both function is very short (trivial in one case) so it is better to merge them.
fc4baa4 to
3e1096d
Compare
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 3e1096d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/124929261
No functional changes.
This is a follow-up for #5035. Some code is now unreachable and can be removed, other parts can be moved to the string_insertion_builtin_function class to improve the structure of the code.