Skip to content

Single-path symex checker [blocks: #3976] #3969

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

@peterschrammel peterschrammel commented Jan 27, 2019

Implements the --paths variant of using goto-symex.

  • 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 self-assigned this Jan 27, 2019
@peterschrammel peterschrammel force-pushed the single-path-symex-checker branch from 08989a3 to b59a98e Compare January 28, 2019 14:29
@peterschrammel peterschrammel changed the title [WIP] Single-path symex checker [depends: 3796] [WIP] Single-path symex checker [depends: 3968] Jan 28, 2019
@peterschrammel peterschrammel force-pushed the single-path-symex-checker branch 2 times, most recently from b9af1f9 to 0420c96 Compare January 28, 2019 17:37
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: 0420c96).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98863639
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

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

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@peterschrammel peterschrammel changed the title [WIP] Single-path symex checker [depends: 3968] Single-path symex checker [depends: 3968] Jan 29, 2019
@tautschnig tautschnig changed the title Single-path symex checker [depends: 3968] Single-path symex checker [depends-on: #3968, blocks: #3976] Feb 1, 2019
@peterschrammel peterschrammel changed the title Single-path symex checker [depends-on: #3968, blocks: #3976] Single-path symex checker [blocks: #3976] Feb 1, 2019
@peterschrammel peterschrammel force-pushed the single-path-symex-checker branch from 0420c96 to f94473b Compare February 2, 2019 15:13
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: f94473b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99520817

@@ -69,6 +69,12 @@ void slice(
const optionst &,
ui_message_handlert &);

void output_coverage_report(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Documentation would be appreciated. I think the cov_out parameter is the one needing it the most, notably the aspect that an empty string will mean that nothing happens. How about:

/// Output a coverage report as generated by \ref symex_coveraget if \p cov_out is non-empty.
/// \param cov_out: file to write the report to; no report is generated if this is empty
/// \param goto_model: goto model to build the coverage report for
/// \param symex: symbolic execution run to report coverage for
/// \param ui_message_handler: status/warning message handler

{
// add a partial ordering, if required
// We won't be able to decide any properties by adding this,
// but we'd like to see the entire SSA.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this comment still make sense? I recall requesting it, but now that this is more generic I don't think it's appropriate anymore.

return goto_model.get_goto_function(id);
};

// perform symbolic execution
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments don't always add value: I think it's pretty clear what the next line does, and this just makes it sound like something surprising would happen?

[&goto_model](
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.

Should we maybe tweak the goto_symext interface a bit? Looking at get_function_from_goto_functions (symex_main.cpp) we now define this helper function multiple times.

@@ -336,3 +336,25 @@ void perform_symex(

postprocess_equation(symex, equation, options, ns, ui_message_handler);
}

void perform_symex(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused. It seems two commits now introduce the same. They actually do, the lines above already contain the same code.

Copy link
Member Author

@peterschrammel peterschrammel Feb 2, 2019

Choose a reason for hiding this comment

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

Yes, that's exactly the problem. The goto-symex interface is broken in this respect. We should have a function that returns a path_storaget::patht for the initial state at the entry point; and then we can resume from that... and everything becomes nice and uniform.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That should be fixable?

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, but I'll go ahead with the current version for now and clean up the goto-symex interface later this week. #4071

@@ -7,6 +7,7 @@ SRC = bmc_util.cpp \
goto_verifier.cpp \
multi_path_symex_checker.cpp \
multi_path_symex_only_checker.cpp \
single_path_symex_only_checker.cpp \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lexicographic sorting, please. Applies again in a later commit (introducing single_path_symex_checker.cpp).

options, ui_message_handler, goto_model);
}

(void)(*verifier)();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like an unnecessary dance, can't we just run each of them in the branches above?

}

(void)(*verifier)();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, seems unnecessary. Just call each of them in the branches above.

}

(void)(*verifier)();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just call each of them in the branches above.

options, ui_message_handler, goto_model);
}

(void)(*verifier)();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just call each of them.

As introduced into bmct in eb0b86b.
Allows us to remove set_message_handler() calls on solvers
in other parts of the code.
Reduces code duplication across goto checkers.
Better provide it as a utility than hiding it inside a class.
Reduces code duplication across goto checkers.
Copied from bmct. Going to be used by single_path_symex_checkert.
Utility function to set all UNKNOWN properties to PASS
when the verification algorithm has finished.
Corresponds to the current behaviour of CBMC replying
'successful' when the given bounds have been reached.
Provides functionality close to solvers/prop/cover_goals but without
callbacks. It allows us to iteratively get all counterexamples
for a set of properties on a fixed equation.
This is used as a component by multi-path and single-path
symex checkers.
Replaces the path_explorert variant of bmct.
The current implementation of this is overly complicated
because path_explorert distinguishes the first run of goto-symex
from the following ones. To drastically simplify the code
goto-symex/symex_bmc needs to be refactored so that all
runs can be handled uniformly (e.g. push entry point into work list
and then 'resume' from there).
See also single_path_symex_checkert.
We can now use single_path_symex_only_checkert instead of bmct.
Extends single_path_symex_only_checkert with
calling the solver and returning traces.
@peterschrammel peterschrammel force-pushed the single-path-symex-checker branch from e9a0a6f to 96fec16 Compare February 4, 2019 18:31
We can now use single_path_symex_checkert instead of bmct.
JBMC requires further setup of symex_bmct.
We can now use single_path_symex_checkert instead of bmct.
@peterschrammel peterschrammel force-pushed the single-path-symex-checker branch from 96fec16 to 1f9f475 Compare February 4, 2019 21:54
@peterschrammel peterschrammel merged commit 4315c29 into diffblue:develop Feb 4, 2019
@peterschrammel peterschrammel deleted the single-path-symex-checker branch February 4, 2019 23:00
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: 1f9f475).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99702092

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