1313#include < util/ieee_float.h>
1414#include < util/arith_tools.h>
1515
16+ #include < goto-programs/goto_model.h>
17+
1618#include " adjust_float_expressions.h"
1719
1820/* ******************************************************************\
@@ -32,6 +34,15 @@ void adjust_float_expressions(
3234 exprt &expr,
3335 const namespacet &ns)
3436{
37+ if (expr.id ()==ID_floatbv_plus ||
38+ expr.id ()==ID_floatbv_minus ||
39+ expr.id ()==ID_floatbv_mult ||
40+ expr.id ()==ID_floatbv_div ||
41+ expr.id ()==ID_floatbv_div ||
42+ expr.id ()==ID_floatbv_rem ||
43+ expr.id ()==ID_floatbv_typecast)
44+ return ;
45+
3546 Forall_operands (it, expr)
3647 adjust_float_expressions (*it, ns);
3748
@@ -126,3 +137,64 @@ void adjust_float_expressions(
126137 }
127138 }
128139}
140+
141+ /* ******************************************************************\
142+
143+ Function: adjust_float_expressions
144+
145+ Inputs:
146+
147+ Outputs:
148+
149+ Purpose:
150+
151+ \*******************************************************************/
152+
153+ static void adjust_float_expressions (
154+ goto_functionst::goto_functiont &goto_function,
155+ const namespacet &ns)
156+ {
157+ Forall_goto_program_instructions (it, goto_function.body )
158+ {
159+ adjust_float_expressions (it->code , ns);
160+ adjust_float_expressions (it->guard , ns);
161+ }
162+ }
163+
164+ /* ******************************************************************\
165+
166+ Function: adjust_float_expressions
167+
168+ Inputs:
169+
170+ Outputs:
171+
172+ Purpose:
173+
174+ \*******************************************************************/
175+
176+ void adjust_float_expressions (
177+ goto_functionst &goto_functions,
178+ const namespacet &ns)
179+ {
180+ Forall_goto_functions (it, goto_functions)
181+ adjust_float_expressions (it->second , ns);
182+ }
183+
184+ /* ******************************************************************\
185+
186+ Function: adjust_float_expressions
187+
188+ Inputs:
189+
190+ Outputs:
191+
192+ Purpose:
193+
194+ \*******************************************************************/
195+
196+ void adjust_float_expressions (goto_modelt &goto_model)
197+ {
198+ namespacet ns (goto_model.symbol_table );
199+ adjust_float_expressions (goto_model.goto_functions , ns);
200+ }
0 commit comments