@@ -9,11 +9,6 @@ Author: Daniel Kroening, kroening@kroening.com
9
9
// / \file
10
10
// / Symbolic Execution
11
11
12
- #include " goto_symex.h"
13
- #include " goto_symex_is_constant.h"
14
-
15
- #include < algorithm>
16
-
17
12
#include < util/exception_utils.h>
18
13
#include < util/expr_util.h>
19
14
#include < util/invariant.h>
@@ -22,11 +17,16 @@ Author: Daniel Kroening, kroening@kroening.com
22
17
#include < util/simplify_expr.h>
23
18
#include < util/std_expr.h>
24
19
20
+ #include < langapi/language_util.h>
25
21
#include < pointer-analysis/add_failed_symbols.h>
26
22
#include < pointer-analysis/value_set_dereference.h>
27
23
24
+ #include " goto_symex.h"
25
+ #include " goto_symex_is_constant.h"
28
26
#include " path_storage.h"
29
27
28
+ #include < algorithm>
29
+
30
30
void goto_symext::apply_goto_condition (
31
31
goto_symex_statet ¤t_state,
32
32
goto_statet &jump_taken_state,
@@ -279,10 +279,19 @@ void goto_symext::symex_goto(statet &state)
279
279
{
280
280
// generate assume(false) or a suitable negation if this
281
281
// instruction is a conditional goto
282
- if (new_guard.is_true ())
283
- symex_assume_l2 (state, false_exprt ());
284
- else
285
- symex_assume_l2 (state, not_exprt (new_guard));
282
+ exprt negated_guard = not_exprt{new_guard};
283
+ do_simplify (negated_guard);
284
+ log.statistics () << " replacing self-loop at "
285
+ << state.source .pc ->source_location () << " by assume("
286
+ << from_expr (ns, state.source .function_id , negated_guard)
287
+ << " )" << messaget::eom;
288
+ if (symex_config.unwinding_assertions )
289
+ {
290
+ log.warning ()
291
+ << " no unwinding assertion will be generated for self-loop at "
292
+ << state.source .pc ->source_location () << messaget::eom;
293
+ }
294
+ symex_assume_l2 (state, negated_guard);
286
295
287
296
// next instruction
288
297
symex_transition (state);
0 commit comments