Skip to content
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

Symex-driven lazy loading uses goto-checker [blocks: #2212] #4541

Merged

Conversation

peterschrammel
Copy link
Member

@peterschrammel peterschrammel commented Apr 16, 2019

Most of this PR are incremental clean-ups of jbmc_parse_optionst. Review commit by commit.

  • [almost] 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.

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.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: aa3dda9).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108567170
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

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.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 1ce9697).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108568076
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

@tautschnig tautschnig changed the title Symex-driven lazy loading uses goto-checker Symex-driven lazy loading uses goto-checker [blocks: #2212] Apr 17, 2019
@@ -829,7 +827,7 @@ void jbmc_parse_optionst::process_goto_function(
function.get_function_id(),
goto_function,
symbol_table,
get_message_handler());
log.get_message_handler());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit pick: I think this change is in the wrong commit as it is a fix-up for the previous change.

{
// We can only output these after goto-symex has run.
(void)show_loaded_symbols(*goto_model_ptr);
(void)show_loaded_functions(*goto_model_ptr);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand this bit of code: the comment says that we cannot do any of this output, but then invokes two output functions, which seems like a contradiction. And then why does it do any output at all here, where has this been requested?

Copy link
Contributor

Choose a reason for hiding this comment

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

It says we needed to wait until after symex, which we just ran (the verifier() call above)

Copy link
Contributor

Choose a reason for hiding this comment

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

(normally of course we can --show-goto-functions before symex, but not when symex itself is deciding what gets loaded)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, but why are we doing this output at all?

// have we got anything to check? otherwise we return PASS
if(!has_properties_to_check(properties))
return resultt::PASS;

Copy link
Collaborator

Choose a reason for hiding this comment

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

The commit message suggests that this code must be put somewhere else, but then the commit only removes code?

Copy link
Member Author

Choose a reason for hiding this comment

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

incremental_goto_checker is already doing that.

@@ -557,7 +557,7 @@ int jbmc_parse_optionst::doit()
if(get_goto_program_ret != -1)
return get_goto_program_ret;

if(!cmdline.isset("symex-driven-lazy-loading"))
if(!options.get_bool_option("symex-driven-lazy-loading"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there anything we could do to completely hide cmdline from such code so that it cannot wrongly be reintroduced?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will come with progress on #4404

propertiest initialize_properties(const abstract_goto_modelt &goto_model)
{
propertiest properties;
update_properties_from_goto_model(properties, goto_model);
Copy link
Contributor

Choose a reason for hiding this comment

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

@tautschnig I believe this might be the resolution to your complain about check-properties code being deleted? (perhaps these two commits should be merged?)

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-properties code being deleted" - what is this about?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Where you said "incremental_goto_checker is already doing that."

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah... ok

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

Thankyou, this factors the symex-driven stuff much better than I managed back when I first wrote this!

reduces code duplication
set_properties has no return value.
With symex-driven-lazy-loading there might not be any
properties initially. Incremental_goto_checker is already
doing that check anyway.
With symex-driven-lazy-loading we know the full set
of properties only after goto-symex has finished.
Only use options after cmdline has been parsed into options.
goes now through goto-checker classes instead of
bmct/all_propertiest.
reduces indentation
These have now been entirely replaced by goto-checker.
@peterschrammel peterschrammel force-pushed the goto-checker-symex-driven branch from 1ce9697 to f96818d Compare April 17, 2019 08:56
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.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: f96818d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108667061
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

@peterschrammel peterschrammel merged commit 6c8954b into diffblue:develop Apr 17, 2019
@peterschrammel peterschrammel deleted the goto-checker-symex-driven branch April 17, 2019 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants