@@ -169,11 +169,11 @@ void recursive_initializationt::initialize(
169
169
goto_model.symbol_table .lookup_ref (fun_name);
170
170
const auto proper_init_case = code_function_callt{
171
171
fun_symbol.symbol_expr (), {depth, address_of_exprt{lhs}}};
172
-
172
+ const auto should_make_equal =
173
+ get_fresh_local_typed_symexpr (" should_make_equal" , bool_typet{});
174
+ body.add (code_declt{should_make_equal});
173
175
body.add (code_ifthenelset{
174
- side_effect_expr_nondett{bool_typet{}, source_locationt{}},
175
- set_equal_case,
176
- proper_init_case});
176
+ should_make_equal, set_equal_case, proper_init_case});
177
177
}
178
178
else
179
179
{
@@ -693,9 +693,12 @@ code_blockt recursive_initializationt::build_pointer_constructor(
693
693
code_blockt null_and_return{{assign_null, code_returnt{}}};
694
694
body.add (code_ifthenelset{conjunction (should_not_recurse), null_and_return});
695
695
696
+ const auto should_recurse_nondet =
697
+ get_fresh_local_typed_symexpr (" should_recurse_nondet" , bool_typet{});
698
+ body.add (code_declt{should_recurse_nondet});
696
699
exprt::operandst should_recurse_ops{
697
700
binary_predicate_exprt{depth, ID_lt, get_symbol_expr (min_depth_var_name)},
698
- side_effect_expr_nondett{bool_typet{}, source_locationt{}} };
701
+ should_recurse_nondet };
699
702
code_blockt then_case{};
700
703
701
704
code_assignt seen_assign_prev{};
@@ -753,8 +756,10 @@ code_blockt recursive_initializationt::build_array_string_constructor(
753
756
{
754
757
index_exprt index_expr{dereference_exprt{result},
755
758
from_integer (index , size_type ())};
756
- body.add (code_assignt{
757
- index_expr, side_effect_expr_nondett{char_type (), source_locationt{}}});
759
+ auto const nondet_char =
760
+ get_fresh_local_typed_symexpr (" nondet_char" , char_type ());
761
+ body.add (code_declt{nondet_char});
762
+ body.add (code_assignt{index_expr, nondet_char});
758
763
body.add (code_assumet{
759
764
notequal_exprt{index_expr, from_integer (0 , array_type.subtype ())}});
760
765
}
@@ -830,9 +835,10 @@ code_blockt recursive_initializationt::build_nondet_constructor(
830
835
{
831
836
PRECONDITION (result.type ().id () == ID_pointer);
832
837
code_blockt body{};
833
- body.add (code_assignt{
834
- dereference_exprt{result},
835
- side_effect_expr_nondett{result.type ().subtype (), source_locationt{}}});
838
+ auto const nondet_symbol =
839
+ get_fresh_local_typed_symexpr (" nondet" , result.type ().subtype ());
840
+ body.add (code_declt{nondet_symbol});
841
+ body.add (code_assignt{dereference_exprt{result}, nondet_symbol});
836
842
return body;
837
843
}
838
844
@@ -1029,10 +1035,6 @@ code_blockt recursive_initializationt::build_function_pointer_constructor(
1029
1035
const auto function_pointer_selector =
1030
1036
get_fresh_local_symexpr (" function_pointer_selector" );
1031
1037
body.add (code_declt{function_pointer_selector});
1032
- body.add (
1033
- code_assignt{function_pointer_selector,
1034
- side_effect_expr_nondett{function_pointer_selector.type (),
1035
- source_locationt{}}});
1036
1038
auto function_pointer_index = std::size_t {0 };
1037
1039
1038
1040
for (const auto &target : targets)
0 commit comments