@@ -37,8 +37,7 @@ class side_effect_exprt;
37
37
class symex_targett ;
38
38
class typecast_exprt ;
39
39
40
- /* ! \brief The main class for the forward symbolic simulator
41
- */
40
+ // / \brief The main class for the forward symbolic simulator
42
41
class goto_symext
43
42
{
44
43
public:
@@ -68,17 +67,23 @@ class goto_symext
68
67
69
68
typedef goto_symex_statet statet;
70
69
71
- /* * symex all at once, starting from entry point */
72
- virtual void operator ()(
70
+ // / \brief symex entire program starting from entry point
71
+ // /
72
+ // / The state that goto_symext maintains has a large memory footprint.
73
+ // / This method deallocates the state as soon as symbolic execution
74
+ // / has completed, so use it if you don't care about having the state
75
+ // / around afterwards.
76
+ virtual void symex_from_entry_point_of (
73
77
const goto_functionst &goto_functions);
74
78
75
- /* * symex starting from given goto program */
76
- virtual void operator ()(
77
- const goto_functionst &goto_functions,
78
- const goto_programt &goto_program);
79
-
80
- /* * start symex in a given state */
81
- virtual void operator ()(
79
+ // // \brief symex entire program starting from entry point
80
+ // /
81
+ // / This method uses the `state` argument as the symbolic execution
82
+ // / state, which is useful for examining the state after this method
83
+ // / returns. The state that goto_symext maintains has a large memory
84
+ // / footprint, so if keeping the state around is not necessary,
85
+ // / clients should instead call goto_symext::symex_from_entry_point_of().
86
+ virtual void symex_with_state (
82
87
statet &state,
83
88
const goto_functionst &goto_functions,
84
89
const goto_programt &goto_program);
@@ -91,20 +96,21 @@ class goto_symext
91
96
// / \param goto_functions GOTO model to symex.
92
97
// / \param first Entry point in form of a first instruction.
93
98
// / \param limit Final instruction, which itself will not be symexed.
94
- virtual void operator () (
99
+ virtual void symex_instruction_range (
95
100
statet &state,
96
101
const goto_functionst &goto_functions,
97
102
goto_programt::const_targett first,
98
103
goto_programt::const_targett limit);
99
104
105
+ protected:
100
106
// / Initialise the symbolic execution and the given state with <code>pc</code>
101
107
// / as entry point.
102
108
// / \param state Symex state to initialise.
103
109
// / \param goto_functions GOTO model to symex.
104
110
// / \param pc first instruction to symex
105
111
// / \param limit final instruction, which itself will not
106
112
// / be symexed.
107
- void symex_entry_point (
113
+ void initialize_entry_point (
108
114
statet &state,
109
115
const goto_functionst &goto_functions,
110
116
goto_programt::const_targett pc,
@@ -122,6 +128,7 @@ class goto_symext
122
128
const goto_functionst &goto_functions,
123
129
statet &state);
124
130
131
+ public:
125
132
// these bypass the target maps
126
133
virtual void symex_step_goto (statet &state, bool taken);
127
134
0 commit comments