Skip to content

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

Merged

Conversation

peterschrammel
Copy link
Member

Removes 70 lines and a lot of complexity from the single-path symex checker.

Fixes #4071

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@peterschrammel peterschrammel force-pushed the refactor-path-storage branch 3 times, most recently from 0115d24 to 792d854 Compare February 6, 2019 22:30
Copy link
Contributor

@allredj allredj left a 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

@peterschrammel peterschrammel self-assigned this Feb 7, 2019
auto get_goto_function =
[this](const irep_idt &id) -> const goto_functionst::goto_functiont & {
return goto_model.get_goto_function(id);
};
Copy link
Collaborator

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...

Copy link
Member Author

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...

Copy link
Collaborator

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?

Copy link
Member Author

@peterschrammel peterschrammel Feb 7, 2019

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.

Copy link
Collaborator

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.

Copy link
Member Author

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);
};
Copy link
Collaborator

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);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy nr#4

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.
Copy link
Contributor

@allredj allredj left a 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

Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a 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.

@peterschrammel peterschrammel merged commit e343604 into diffblue:develop Feb 7, 2019
@peterschrammel peterschrammel deleted the refactor-path-storage branch February 7, 2019 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor handling of entry point in goto-symex
4 participants