34 if(expr.
id()==ID_floatbv_plus ||
35 expr.
id()==ID_floatbv_minus ||
36 expr.
id()==ID_floatbv_mult ||
37 expr.
id()==ID_floatbv_div ||
38 expr.
id()==ID_floatbv_div ||
39 expr.
id()==ID_floatbv_rem ||
40 expr.
id()==ID_floatbv_typecast)
46 type.
id() == ID_floatbv ||
47 (type.
id() == ID_complex &&
51 expr.
id() == ID_plus || expr.
id() == ID_minus || expr.
id() == ID_mult ||
56 if(expr.
id()==ID_typecast)
61 const typet &dest_type=typecast_expr.
type();
63 if(dest_type.
id()==ID_floatbv &&
64 src_type.
id()==ID_floatbv)
67 dest_type.
id() == ID_floatbv &&
68 (src_type.
id() == ID_c_bit_field || src_type.
id() == ID_signedbv ||
69 src_type.
id() == ID_unsignedbv || src_type.
id() == ID_c_enum_tag))
72 (dest_type.
id() == ID_signedbv || dest_type.
id() == ID_unsignedbv ||
73 dest_type.
id() == ID_c_enum_tag || dest_type.
id() == ID_c_bit_field) &&
74 src_type.
id() == ID_floatbv)
78 for(
const auto &op : expr.
operands())
103 type.
id() == ID_floatbv ||
104 (type.
id() == ID_complex &&
108 expr.
id() == ID_plus || expr.
id() == ID_minus || expr.
id() == ID_mult ||
113 "arithmetic operations must have two or more operands");
123 expr.
id(expr.
id()==ID_plus?ID_floatbv_plus:
124 expr.
id()==ID_minus?ID_floatbv_minus:
125 expr.
id()==ID_mult?ID_floatbv_mult:
126 expr.
id()==ID_div?ID_floatbv_div:
134 if(expr.
id()==ID_typecast)
139 const typet &dest_type=typecast_expr.
type();
141 if(dest_type.
id()==ID_floatbv &&
142 src_type.
id()==ID_floatbv)
148 expr.
id(ID_floatbv_typecast);
153 dest_type.
id() == ID_floatbv &&
154 (src_type.
id() == ID_signedbv || src_type.
id() == ID_unsignedbv ||
155 src_type.
id() == ID_c_enum_tag || src_type.
id() == ID_c_bit_field))
158 expr.
id(ID_floatbv_typecast);
163 dest_type.
id() == ID_floatbv &&
164 (src_type.
id() == ID_c_bool || src_type.
id() == ID_bool))
169 (dest_type.
id() == ID_signedbv || dest_type.
id() == ID_unsignedbv ||
170 dest_type.
id() == ID_c_enum_tag || dest_type.
id() == ID_c_bit_field) &&
171 src_type.
id() == ID_floatbv)
184 expr.
id(ID_floatbv_typecast);
209 for(
auto &i : goto_function.body.instructions)
210 i.transform([&ns](
exprt expr) -> std::optional<exprt> {
static bool have_to_adjust_float_expressions(const exprt &expr)
Iterate over an expression and check it or any of its subexpressions are floating point operations th...
irep_idt rounding_mode_identifier()
Return the identifier of the program symbol used to store the current rounding mode.
void adjust_float_expressions(exprt &expr, const exprt &rounding_mode)
Replaces arithmetic operations and typecasts involving floating point numbers with their equivalent f...
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
source_locationt & add_source_location()
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
A collection of goto functions.
function_mapt function_map
::goto_functiont goto_functiont
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Expression to hold a symbol (variable)
Semantic type conversion.
The type of an expression, extends irept.
exprt make_binary(const exprt &expr)
splits an expression with >=3 operands into nested binary expressions
Deprecated expression utility functions.
API to expression classes for floating-point arithmetic.
const ieee_float_op_exprt & to_ieee_float_op_expr(const exprt &expr)
Cast an exprt to an ieee_float_op_exprt.
const floatbv_typecast_exprt & to_floatbv_typecast_expr(const exprt &expr)
Cast an exprt to a floatbv_typecast_exprt.
#define CHECK_RETURN(CONDITION)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
API to expression classes.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const complex_typet & to_complex_type(const typet &type)
Cast a typet to a complex_typet.