@@ -67,6 +67,10 @@ class goto_symext
67
67
68
68
typedef goto_symex_statet statet;
69
69
70
+ typedef
71
+ std::function<const goto_functionst::goto_functiont &(const irep_idt &)>
72
+ get_goto_functiont;
73
+
70
74
// / \brief symex entire program starting from entry point
71
75
// /
72
76
// / The state that goto_symext maintains has a large memory footprint.
@@ -76,6 +80,15 @@ class goto_symext
76
80
virtual void symex_from_entry_point_of (
77
81
const goto_functionst &goto_functions);
78
82
83
+ // / \brief symex entire program starting from entry point
84
+ // /
85
+ // / The state that goto_symext maintains has a large memory footprint.
86
+ // / This method deallocates the state as soon as symbolic execution
87
+ // / has completed, so use it if you don't care about having the state
88
+ // / around afterwards.
89
+ virtual void symex_from_entry_point_of (
90
+ const get_goto_functiont &get_goto_function);
91
+
79
92
// // \brief symex entire program starting from entry point
80
93
// /
81
94
// / This method uses the `state` argument as the symbolic execution
@@ -88,6 +101,18 @@ class goto_symext
88
101
const goto_functionst &,
89
102
const goto_programt &);
90
103
104
+ // // \brief symex entire program starting from entry point
105
+ // /
106
+ // / This method uses the `state` argument as the symbolic execution
107
+ // / state, which is useful for examining the state after this method
108
+ // / returns. The state that goto_symext maintains has a large memory
109
+ // / footprint, so if keeping the state around is not necessary,
110
+ // / clients should instead call goto_symext::symex_from_entry_point_of().
111
+ virtual void symex_with_state (
112
+ statet &,
113
+ const get_goto_functiont &,
114
+ const goto_programt &);
115
+
91
116
// / Symexes from the first instruction and the given state, terminating as
92
117
// / soon as the last instruction is reached. This is useful to explicitly
93
118
// / symex certain ranges of a program, e.g. in an incremental decision
@@ -102,6 +127,20 @@ class goto_symext
102
127
goto_programt::const_targett first,
103
128
goto_programt::const_targett limit);
104
129
130
+ // / Symexes from the first instruction and the given state, terminating as
131
+ // / soon as the last instruction is reached. This is useful to explicitly
132
+ // / symex certain ranges of a program, e.g. in an incremental decision
133
+ // / procedure.
134
+ // / \param state Symex state to start with.
135
+ // / \param get_goto_function retrieves a function body
136
+ // / \param first Entry point in form of a first instruction.
137
+ // / \param limit Final instruction, which itself will not be symexed.
138
+ virtual void symex_instruction_range (
139
+ statet &state,
140
+ const get_goto_functiont &get_goto_function,
141
+ goto_programt::const_targett first,
142
+ goto_programt::const_targett limit);
143
+
105
144
protected:
106
145
// / Initialise the symbolic execution and the given state with <code>pc</code>
107
146
// / as entry point.
@@ -111,21 +150,21 @@ class goto_symext
111
150
// / \param limit final instruction, which itself will not
112
151
// / be symexed.
113
152
void initialize_entry_point (
114
- statet &,
115
- const goto_functionst & ,
153
+ statet &state ,
154
+ const get_goto_functiont &get_goto_function ,
116
155
goto_programt::const_targett pc,
117
156
goto_programt::const_targett limit);
118
157
119
158
// / Invokes symex_step and verifies whether additional threads can be
120
159
// / executed.
121
160
// / \param state Current GOTO symex step.
122
- // / \param goto_functions GOTO model to symex.
161
+ // / \param get_goto_function function that retrieves function bodies
123
162
void symex_threaded_step (
124
- statet &, const goto_functionst &);
163
+ statet &, const get_goto_functiont &);
125
164
126
165
/* * execute just one step */
127
166
virtual void symex_step (
128
- const goto_functionst &,
167
+ const get_goto_functiont &,
129
168
statet &);
130
169
131
170
public:
@@ -213,7 +252,7 @@ class goto_symext
213
252
virtual void symex_decl (statet &);
214
253
virtual void symex_decl (statet &, const symbol_exprt &expr);
215
254
virtual void symex_dead (statet &);
216
- virtual void symex_other (const goto_functionst &, statet &);
255
+ virtual void symex_other (statet &);
217
256
218
257
virtual void vcc (
219
258
const exprt &,
@@ -255,19 +294,19 @@ class goto_symext
255
294
}
256
295
257
296
virtual void symex_function_call (
258
- const goto_functionst &,
297
+ const get_goto_functiont &,
259
298
statet &,
260
299
const code_function_callt &);
261
300
262
301
virtual void symex_end_of_function (statet &);
263
302
264
303
virtual void symex_function_call_symbol (
265
- const goto_functionst &,
304
+ const get_goto_functiont &,
266
305
statet &,
267
306
const code_function_callt &);
268
307
269
308
virtual void symex_function_call_code (
270
- const goto_functionst &,
309
+ const get_goto_functiont &,
271
310
statet &,
272
311
const code_function_callt &);
273
312
0 commit comments