-
Notifications
You must be signed in to change notification settings - Fork 274
Refactor in symex #3371
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 in symex #3371
Changes from all commits
3b24f35
0d17753
1b22eae
0fed6c8
6f034fa
5490735
d74f55d
1b78ec5
da94813
c0bc638
529fbc9
9e049ba
0157d77
3598f68
584db18
91b23f4
1f9aa83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,24 +80,12 @@ class goto_symext | |
{ | ||
} | ||
|
||
virtual ~goto_symext() | ||
{ | ||
} | ||
virtual ~goto_symext() = default; | ||
|
||
typedef | ||
std::function<const goto_functionst::goto_functiont &(const irep_idt &)> | ||
get_goto_functiont; | ||
|
||
/// \brief symex entire program starting from entry point | ||
/// | ||
/// The state that goto_symext maintains has a large memory footprint. | ||
/// This method deallocates the state as soon as symbolic execution | ||
/// has completed, so use it if you don't care about having the state | ||
/// around afterwards. | ||
virtual void symex_from_entry_point_of( | ||
const goto_functionst &goto_functions, | ||
symbol_tablet &new_symbol_table); | ||
|
||
/// \brief symex entire program starting from entry point | ||
/// | ||
/// The state that goto_symext maintains has a large memory footprint. | ||
|
@@ -115,7 +103,7 @@ class goto_symext | |
virtual void resume_symex_from_saved_state( | ||
const get_goto_functiont &get_goto_function, | ||
const statet &saved_state, | ||
symex_target_equationt *const saved_equation, | ||
symex_target_equationt *saved_equation, | ||
symbol_tablet &new_symbol_table); | ||
|
||
//// \brief symex entire program starting from entry point | ||
|
@@ -142,38 +130,6 @@ class goto_symext | |
const get_goto_functiont &, | ||
symbol_tablet &); | ||
|
||
/// Symexes from the first instruction and the given state, terminating as | ||
/// soon as the last instruction is reached. This is useful to explicitly | ||
/// symex certain ranges of a program, e.g. in an incremental decision | ||
/// procedure. | ||
/// \param state Symex state to start with. | ||
/// \param goto_functions GOTO model to symex. | ||
/// \param function_identifier The function with the instruction range | ||
/// \param first Entry point in form of a first instruction. | ||
/// \param limit Final instruction, which itself will not be symexed. | ||
virtual void symex_instruction_range( | ||
statet &, | ||
const goto_functionst &, | ||
const irep_idt &function_identifier, | ||
goto_programt::const_targett first, | ||
goto_programt::const_targett limit); | ||
|
||
/// Symexes from the first instruction and the given state, terminating as | ||
/// soon as the last instruction is reached. This is useful to explicitly | ||
/// symex certain ranges of a program, e.g. in an incremental decision | ||
/// procedure. | ||
/// \param state Symex state to start with. | ||
/// \param get_goto_function retrieves a function body | ||
/// \param function_identifier The function with the instruction range | ||
/// \param first Entry point in form of a first instruction. | ||
/// \param limit Final instruction, which itself will not be symexed. | ||
virtual void symex_instruction_range( | ||
statet &state, | ||
const get_goto_functiont &get_goto_function, | ||
const irep_idt &function_identifier, | ||
goto_programt::const_targett first, | ||
goto_programt::const_targett limit); | ||
|
||
/// \brief Have states been pushed onto the workqueue? | ||
/// | ||
/// If this flag is set at the end of a symbolic execution run, it means that | ||
|
@@ -215,8 +171,6 @@ class goto_symext | |
const bool allow_pointer_unsoundness; | ||
|
||
public: | ||
// these bypass the target maps | ||
virtual void symex_step_goto(statet &, bool taken); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the commit message could be made to include the names of functions being removed? These have likely been used elsewhere (Satabs comes to mind), and if we ever want to resurrect them, the git history is vital. |
||
|
||
/// language_mode: ID_java, ID_C or another language identifier | ||
/// if we know the source language in use, irep_idt() otherwise. | ||
|
@@ -263,13 +217,9 @@ class goto_symext | |
void initialize_auto_object(const exprt &, statet &); | ||
void process_array_expr(exprt &); | ||
exprt make_auto_object(const typet &, statet &); | ||
virtual void dereference(exprt &, statet &, const bool write); | ||
virtual void dereference(exprt &, statet &, bool write); | ||
|
||
void dereference_rec( | ||
exprt &, | ||
statet &, | ||
guardt &, | ||
const bool write); | ||
void dereference_rec(exprt &, statet &, guardt &, bool write); | ||
|
||
void dereference_rec_address_of( | ||
exprt &, | ||
|
@@ -292,13 +242,13 @@ class goto_symext | |
virtual void symex_transition( | ||
statet &, | ||
goto_programt::const_targett to, | ||
bool is_backwards_goto=false); | ||
bool is_backwards_goto); | ||
|
||
virtual void symex_transition(statet &state) | ||
{ | ||
goto_programt::const_targett next=state.source.pc; | ||
++next; | ||
symex_transition(state, next); | ||
symex_transition(state, next, false); | ||
} | ||
|
||
virtual void symex_goto(statet &); | ||
|
@@ -334,7 +284,7 @@ class goto_symext | |
|
||
// determine whether to unwind a loop -- true indicates abort, | ||
// with false we continue. | ||
virtual bool get_unwind( | ||
virtual bool should_stop_unwind( | ||
const symex_targett::sourcet &source, | ||
const goto_symex_statet::call_stackt &context, | ||
unsigned unwind); | ||
|
@@ -369,24 +319,20 @@ class goto_symext | |
|
||
virtual bool get_unwind_recursion( | ||
const irep_idt &identifier, | ||
const unsigned thread_nr, | ||
unsigned thread_nr, | ||
unsigned unwind); | ||
|
||
void parameter_assignments( | ||
const irep_idt function_identifier, | ||
const irep_idt &function_identifier, | ||
const goto_functionst::goto_functiont &, | ||
statet &, | ||
const exprt::operandst &arguments); | ||
|
||
void locality( | ||
const irep_idt function_identifier, | ||
const irep_idt &function_identifier, | ||
statet &, | ||
const goto_functionst::goto_functiont &); | ||
|
||
void add_end_of_function( | ||
exprt &code, | ||
const irep_idt &identifier); | ||
|
||
nondet_symbol_exprt build_symex_nondet(typet &type); | ||
|
||
// exceptions | ||
|
@@ -471,7 +417,6 @@ class goto_symext | |
static unsigned nondet_count; | ||
static unsigned dynamic_counter; | ||
|
||
void read(exprt &); | ||
void replace_nondet(exprt &); | ||
void rewrite_quantifiers(exprt &, statet &); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,8 +177,8 @@ void goto_symext::symex_allocate( | |
} | ||
else | ||
{ | ||
exprt nondet = build_symex_nondet(object_type); | ||
code_assignt assignment(value_symbol.symbol_expr(), nondet); | ||
const exprt nondet = build_symex_nondet(object_type); | ||
const code_assignt assignment(value_symbol.symbol_expr(), nondet); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this change works in here, given the comments that have been removed from the PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes thanks, it wasn't caught while rebasing. |
||
symex_assign(state, assignment); | ||
} | ||
|
||
|
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.
This should be squash with the preceding commit.