Skip to content

Commit a3f9591

Browse files
Remove obsolete variant of symex_with_state
This variant did not support lazy loading and was only used by scratch_program, which can as well use the more general variant.
1 parent 2df39b1 commit a3f9591

File tree

3 files changed

+19
-34
lines changed

3 files changed

+19
-34
lines changed

src/goto-instrument/accelerate/scratch_program.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ bool scratch_programt::check_sat(bool do_slice)
3535
output(ns, "scratch", std::cout);
3636
#endif
3737

38-
symex.symex_with_state(symex_state, functions, symex_symbol_table);
38+
symex.symex_with_state(
39+
symex_state,
40+
[this](const irep_idt &key) -> const goto_functionst::goto_functiont & {
41+
return functions.function_map.at(key);
42+
},
43+
symex_symbol_table);
3944

4045
if(do_slice)
4146
{

src/goto-symex/goto_symex.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Author: Daniel Kroening, [email protected]
1515
#include <util/options.h>
1616
#include <util/message.h>
1717

18-
#include <goto-programs/goto_functions.h>
18+
#include <goto-programs/abstract_goto_model.h>
1919

2020
#include "goto_symex_state.h"
2121
#include "path_storage.h"
@@ -97,6 +97,9 @@ class goto_symext
9797
std::function<const goto_functionst::goto_functiont &(const irep_idt &)>
9898
get_goto_functiont;
9999

100+
/// Return a function to get/load a goto function from the given goto model
101+
static get_goto_functiont get_goto_function(abstract_goto_modelt &);
102+
100103
/// \brief symex entire program starting from entry point
101104
///
102105
/// The state that goto_symext maintains has a large memory footprint.
@@ -117,18 +120,6 @@ class goto_symext
117120
symex_target_equationt *saved_equation,
118121
symbol_tablet &new_symbol_table);
119122

120-
//// \brief symex entire program starting from entry point
121-
///
122-
/// This method uses the `state` argument as the symbolic execution
123-
/// state, which is useful for examining the state after this method
124-
/// returns. The state that goto_symext maintains has a large memory
125-
/// footprint, so if keeping the state around is not necessary,
126-
/// clients should instead call goto_symext::symex_from_entry_point_of().
127-
virtual void symex_with_state(
128-
statet &,
129-
const goto_functionst &,
130-
symbol_tablet &);
131-
132123
//// \brief symex entire program starting from entry point
133124
///
134125
/// This method uses the `state` argument as the symbolic execution

src/goto-symex/symex_main.cpp

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -229,26 +229,6 @@ void goto_symext::symex_threaded_step(
229229
}
230230
}
231231

232-
static goto_symext::get_goto_functiont get_function_from_goto_functions(
233-
const goto_functionst &goto_functions)
234-
{
235-
return [&goto_functions](
236-
const irep_idt &key) -> const goto_functionst::goto_functiont & {
237-
return goto_functions.function_map.at(key);
238-
};
239-
}
240-
241-
void goto_symext::symex_with_state(
242-
statet &state,
243-
const goto_functionst &goto_functions,
244-
symbol_tablet &new_symbol_table)
245-
{
246-
symex_with_state(
247-
state,
248-
get_function_from_goto_functions(goto_functions),
249-
new_symbol_table);
250-
}
251-
252232
void goto_symext::symex_with_state(
253233
statet &state,
254234
const get_goto_functiont &get_goto_function,
@@ -354,6 +334,15 @@ void goto_symext::symex_from_entry_point_of(
354334
state, get_goto_function, new_symbol_table);
355335
}
356336

337+
goto_symext::get_goto_functiont
338+
goto_symext::get_goto_function(abstract_goto_modelt &goto_model)
339+
{
340+
return [&goto_model](
341+
const irep_idt &id) -> const goto_functionst::goto_functiont & {
342+
return goto_model.get_goto_function(id);
343+
};
344+
}
345+
357346
/// do just one step
358347
void goto_symext::symex_step(
359348
const get_goto_functiont &get_goto_function,

0 commit comments

Comments
 (0)