-
Notifications
You must be signed in to change notification settings - Fork 273
Path exploration goodies #1915
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
tautschnig
merged 7 commits into
diffblue:develop
from
karkhaz:kk-abstract-paths-worklist
May 8, 2018
Merged
Path exploration goodies #1915
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e823538
Symex paths saved onto abstract data structure
karkhaz 2a86fb4
Bugfix: always print path exploration resume point
karkhaz 685937a
Path exploration pushes both successors onto queue
karkhaz 17951c8
Add path strategy chooser class
karkhaz feef069
Doxygen uses C++ parser for .h files
karkhaz 85aba52
Make new LIFO path exploration the default
karkhaz 916eb1f
Unit tests for path exploration strategies
karkhaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ Author: Daniel Kroening, [email protected] | |
#include <goto-programs/goto_trace.h> | ||
|
||
#include <goto-symex/symex_target_equation.h> | ||
#include <goto-symex/path_storage.h> | ||
|
||
#include <goto-programs/goto_model.h> | ||
#include <goto-programs/safety_checker.h> | ||
#include <goto-symex/memory_model.h> | ||
|
@@ -49,32 +51,32 @@ class bmct:public safety_checkert | |
/// constructor is `false` (unset), an instance of this class will | ||
/// symbolically execute the entire program, performing path merging | ||
/// to build a formula corresponding to all executions of the program | ||
/// up to the unwinding limit. In this case, the `branch_worklist` | ||
/// up to the unwinding limit. In this case, the `path_storage` | ||
/// member shall not be touched; this is enforced by the assertion in | ||
/// this class' implementation of bmct::perform_symbolic_execution(). | ||
/// | ||
/// - If the `--paths` flag is `true`, this `bmct` object will explore a | ||
/// single path through the codebase without doing any path merging. | ||
/// If some paths were not taken, the state at those branch points | ||
/// will be appended to `branch_worklist`. After the single path that | ||
/// will be appended to `path_storage`. After the single path that | ||
/// this `bmct` object executed has been model-checked, you can resume | ||
/// exploring further paths by popping an element from | ||
/// `branch_worklist` and using it to construct a path_explorert | ||
/// `path_storage` and using it to construct a path_explorert | ||
/// object. | ||
bmct( | ||
const optionst &_options, | ||
const symbol_tablet &outer_symbol_table, | ||
message_handlert &_message_handler, | ||
prop_convt &_prop_conv, | ||
goto_symext::branch_worklistt &_branch_worklist, | ||
path_storaget &_path_storage, | ||
std::function<bool(void)> callback_after_symex) | ||
: safety_checkert(ns, _message_handler), | ||
options(_options), | ||
outer_symbol_table(outer_symbol_table), | ||
ns(outer_symbol_table, symex_symbol_table), | ||
equation(), | ||
branch_worklist(_branch_worklist), | ||
symex(_message_handler, outer_symbol_table, equation, branch_worklist), | ||
path_storage(_path_storage), | ||
symex(_message_handler, outer_symbol_table, equation, path_storage), | ||
prop_conv(_prop_conv), | ||
ui(ui_message_handlert::uit::PLAIN), | ||
driver_callback_after_symex(callback_after_symex) | ||
|
@@ -115,6 +117,7 @@ class bmct:public safety_checkert | |
} | ||
|
||
static int do_language_agnostic_bmc( | ||
const path_strategy_choosert &path_strategy_chooser, | ||
const optionst &opts, | ||
abstract_goto_modelt &goto_model, | ||
const ui_message_handlert::uit &ui, | ||
|
@@ -128,7 +131,7 @@ class bmct:public safety_checkert | |
/// | ||
/// This constructor exists as a delegate for the path_explorert class. | ||
/// It differs from \ref bmct's public constructor in that it actually | ||
/// does something with the branch_worklistt argument, and also takes a | ||
/// does something with the path_storaget argument, and also takes a | ||
/// symex_target_equationt. See the documentation for path_explorert for | ||
/// details. | ||
bmct( | ||
|
@@ -137,15 +140,15 @@ class bmct:public safety_checkert | |
message_handlert &_message_handler, | ||
prop_convt &_prop_conv, | ||
symex_target_equationt &_equation, | ||
goto_symext::branch_worklistt &_branch_worklist, | ||
path_storaget &_path_storage, | ||
std::function<bool(void)> callback_after_symex) | ||
: safety_checkert(ns, _message_handler), | ||
options(_options), | ||
outer_symbol_table(outer_symbol_table), | ||
ns(outer_symbol_table), | ||
equation(_equation), | ||
branch_worklist(_branch_worklist), | ||
symex(_message_handler, outer_symbol_table, equation, branch_worklist), | ||
path_storage(_path_storage), | ||
symex(_message_handler, outer_symbol_table, equation, path_storage), | ||
prop_conv(_prop_conv), | ||
ui(ui_message_handlert::uit::PLAIN), | ||
driver_callback_after_symex(callback_after_symex) | ||
|
@@ -166,7 +169,7 @@ class bmct:public safety_checkert | |
symbol_tablet symex_symbol_table; | ||
namespacet ns; | ||
symex_target_equationt equation; | ||
goto_symext::branch_worklistt &branch_worklist; | ||
path_storaget &path_storage; | ||
symex_bmct symex; | ||
prop_convt &prop_conv; | ||
std::unique_ptr<memory_model_baset> memory_model; | ||
|
@@ -257,15 +260,15 @@ class path_explorert : public bmct | |
prop_convt &_prop_conv, | ||
symex_target_equationt &saved_equation, | ||
const goto_symex_statet &saved_state, | ||
goto_symext::branch_worklistt &branch_worklist, | ||
path_storaget &path_storage, | ||
std::function<bool(void)> callback_after_symex) | ||
: bmct( | ||
_options, | ||
outer_symbol_table, | ||
_message_handler, | ||
_prop_conv, | ||
saved_equation, | ||
branch_worklist, | ||
path_storage, | ||
callback_after_symex), | ||
saved_state(saved_state) | ||
{ | ||
|
@@ -292,15 +295,17 @@ class path_explorert : public bmct | |
"(no-unwinding-assertions)" \ | ||
"(no-pretty-names)" \ | ||
"(partial-loops)" \ | ||
"(paths)" \ | ||
"(paths):" \ | ||
"(show-symex-strategies)" \ | ||
"(depth):" \ | ||
"(unwind):" \ | ||
"(unwindset):" \ | ||
"(graphml-witness):" \ | ||
"(unwindset):" | ||
|
||
#define HELP_BMC \ | ||
" --paths explore paths one at a time\n" \ | ||
" --paths [strategy] explore paths one at a time\n" \ | ||
" --show-symex-strategies list strategies for use with --paths\n" \ | ||
" --program-only only show program expression\n" \ | ||
" --show-loops show the loops in the program\n" \ | ||
" --depth nr limit search depth\n" \ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ Author: Daniel Kroening, [email protected] | |
#include <util/message.h> | ||
#include <util/threeval.h> | ||
|
||
#include <goto-symex/path_storage.h> | ||
#include <goto-symex/goto_symex.h> | ||
|
||
#include "symex_coverage.h" | ||
|
@@ -26,7 +27,7 @@ class symex_bmct: public goto_symext | |
message_handlert &mh, | ||
const symbol_tablet &outer_symbol_table, | ||
symex_target_equationt &_target, | ||
goto_symext::branch_worklistt &branch_worklist); | ||
path_storaget &path_storage); | ||
|
||
// To show progress | ||
source_locationt last_source_location; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Minor nit: This should probably have been a separate PR... but I won't block the PR :-)