@@ -74,7 +74,8 @@ class bmct:public safety_checkert
74
74
const symbol_tablet &outer_symbol_table,
75
75
message_handlert &_message_handler,
76
76
prop_convt &_prop_conv,
77
- goto_symext::branch_worklistt &_branch_worklist)
77
+ goto_symext::branch_worklistt &_branch_worklist,
78
+ std::function<bool (void )> callback_after_symex)
78
79
: safety_checkert(ns, _message_handler),
79
80
options (_options),
80
81
outer_symbol_table(outer_symbol_table),
@@ -83,7 +84,8 @@ class bmct:public safety_checkert
83
84
branch_worklist(_branch_worklist),
84
85
symex(_message_handler, outer_symbol_table, equation, branch_worklist),
85
86
prop_conv(_prop_conv),
86
- ui(ui_message_handlert::uit::PLAIN)
87
+ ui(ui_message_handlert::uit::PLAIN),
88
+ driver_callback_after_symex(callback_after_symex)
87
89
{
88
90
symex.constant_propagation =options.get_bool_option (" propagation" );
89
91
symex.record_coverage =
@@ -128,10 +130,9 @@ class bmct:public safety_checkert
128
130
abstract_goto_modelt &goto_model,
129
131
const ui_message_handlert::uit &ui,
130
132
messaget &message,
131
- std::function<void (bmct &, const symbol_tablet &)> frontend_configure_bmc =
132
- [](bmct &_bmc, const symbol_tablet &) { // NOLINT (*)
133
- // Empty default implementation
134
- });
133
+ std::function<void (bmct &, const symbol_tablet &)>
134
+ driver_configure_bmc = nullptr,
135
+ std::function<bool(void )> callback_after_symex = nullptr);
135
136
136
137
protected:
137
138
// / \brief Constructor for path exploration from saved state
@@ -147,7 +148,8 @@ class bmct:public safety_checkert
147
148
message_handlert &_message_handler,
148
149
prop_convt &_prop_conv,
149
150
symex_target_equationt &_equation,
150
- goto_symext::branch_worklistt &_branch_worklist)
151
+ goto_symext::branch_worklistt &_branch_worklist,
152
+ std::function<bool (void )> callback_after_symex)
151
153
: safety_checkert(ns, _message_handler),
152
154
options (_options),
153
155
outer_symbol_table(outer_symbol_table),
@@ -156,7 +158,8 @@ class bmct:public safety_checkert
156
158
branch_worklist(_branch_worklist),
157
159
symex(_message_handler, outer_symbol_table, equation, branch_worklist),
158
160
prop_conv(_prop_conv),
159
- ui(ui_message_handlert::uit::PLAIN)
161
+ ui(ui_message_handlert::uit::PLAIN),
162
+ driver_callback_after_symex(callback_after_symex)
160
163
{
161
164
symex.constant_propagation = options.get_bool_option (" propagation" );
162
165
symex.record_coverage =
@@ -238,6 +241,12 @@ class bmct:public safety_checkert
238
241
// / full-program model-checking from the entry point of the program.
239
242
virtual void perform_symbolic_execution (
240
243
goto_symext::get_goto_functiont get_goto_function);
244
+
245
+ // / Optional callback, to be run after symex but before handing the resulting
246
+ // / equation to the solver. If it returns true then we will skip the solver
247
+ // / stage and return "safe" (no assertions violated / coverage goals reached),
248
+ // / similar to the behaviour when 'show-vcc' or 'program-only' are specified.
249
+ std::function<bool (void )> driver_callback_after_symex;
241
250
};
242
251
243
252
// / \brief Symbolic execution from a saved branch point
@@ -260,14 +269,16 @@ class path_explorert : public bmct
260
269
prop_convt &_prop_conv,
261
270
symex_target_equationt &saved_equation,
262
271
const goto_symex_statet &saved_state,
263
- goto_symext::branch_worklistt &branch_worklist)
272
+ goto_symext::branch_worklistt &branch_worklist,
273
+ std::function<bool (void )> callback_after_symex)
264
274
: bmct(
265
275
_options,
266
276
outer_symbol_table,
267
277
_message_handler,
268
278
_prop_conv,
269
279
saved_equation,
270
- branch_worklist),
280
+ branch_worklist,
281
+ callback_after_symex),
271
282
saved_state (saved_state)
272
283
{
273
284
}
0 commit comments