@@ -15,6 +15,7 @@ Author: Diffblue Ltd.
1515#include < util/c_types.h>
1616#include < util/fresh_symbol.h>
1717#include < util/namespace.h>
18+ #include < util/nondet_bool.h>
1819#include < util/std_expr.h>
1920#include < util/std_types.h>
2021#include < util/string_constant.h>
@@ -42,15 +43,6 @@ static const symbolt &c_new_tmp_symbol(
4243 return tmp_symbol;
4344}
4445
45- // / \param type: Desired type (C_bool or plain bool)
46- // / \param loc: source location
47- // / \return nondet expr of that type
48- static exprt c_get_nondet_bool (const typet &type, const source_locationt &loc)
49- {
50- // We force this to 0 and 1 and won't consider other values
51- return typecast_exprt (side_effect_expr_nondett (bool_typet (), loc), type);
52- }
53-
5446class symbol_factoryt
5547{
5648 std::vector<const symbolt *> &symbols_created;
@@ -188,7 +180,7 @@ void symbol_factoryt::gen_nondet_init(
188180 // <expr> = NONDET(_BOOL);
189181 // Else add the following code to assignments:
190182 // <expr> = NONDET(type);
191- exprt rhs = type.id () == ID_c_bool ? c_get_nondet_bool (type, loc)
183+ exprt rhs = type.id () == ID_c_bool ? get_nondet_bool (type, loc)
192184 : side_effect_expr_nondett (type, loc);
193185 code_assignt assign (expr, rhs);
194186 assign.add_source_location ()=loc;
0 commit comments