-
Notifications
You must be signed in to change notification settings - Fork 274
Refactor path storage #4109
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
Refactor path storage #4109
Conversation
0115d24
to
792d854
Compare
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: 792d854).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100012351
auto get_goto_function = | ||
[this](const irep_idt &id) -> const goto_functionst::goto_functiont & { | ||
return goto_model.get_goto_function(id); | ||
}; |
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.
Could this also be refactored? Code copies are undesirable...
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.
Yes... unfortunately, C++ lambdas are so clumsy that a one-line lambda feels like code duplication...
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 we really have an interface that doesn't require passing this parameter? I believe that in fact we already do, in goto_symext::symex_with_state
, which has a variant with and without that function. So maybe we could also do that for those other functions?
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.
variant without that function
That one should actually be removed.
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.
Ok, then maybe that could happen here as well? I dislike code copies, but I even more dislike almost-code-copies which we currently have with get_function_from_goto_functions
.
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.
Check the changes, please.
auto get_goto_function = | ||
[this](const irep_idt &id) -> const goto_functionst::goto_functiont & { | ||
return goto_model.get_goto_function(id); | ||
}; |
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.
The third copy?
auto get_goto_function = | ||
[this](const irep_idt &id) -> const goto_functionst::goto_functiont & { | ||
return goto_model.get_goto_function(id); | ||
}; |
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.
Copy nr#4
792d854
to
76adfff
Compare
This variant did not support lazy loading and was only used by scratch_program, which can as well use the more general variant.
Allows us to perform the actual pathwise symex work in a uniform way. Required making path_storaget::push accept a single state.
Will allow us to remove perform_symex utilities later
Instead of handling the first symex run differently: Push initial state into the worklist, then iterate symex until done.
Only used once resp. obsolete.
76adfff
to
5281fa6
Compare
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: 5281fa6).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100093034
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.
Looks good to me.
Removes 70 lines and a lot of complexity from the single-path symex checker.
Fixes #4071