-
Notifications
You must be signed in to change notification settings - Fork 273
/
Copy pathadjust_float_expressions.h
63 lines (49 loc) · 2.31 KB
/
adjust_float_expressions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************************\
Module: Symbolic Execution
Author: Daniel Kroening, [email protected]
\*******************************************************************/
/// \file
/// Symbolic Execution
#ifndef CPROVER_GOTO_PROGRAMS_ADJUST_FLOAT_EXPRESSIONS_H
#define CPROVER_GOTO_PROGRAMS_ADJUST_FLOAT_EXPRESSIONS_H
#include <goto-programs/goto_functions.h>
class exprt;
class namespacet;
class goto_modelt;
/// Adjust floating point subexpressions in the passed \p expr with the rounding
/// mode from the \p ns. \see adjust_float_expressions(exprt &,
/// const namespacet &)
void adjust_float_expressions(
exprt &expr,
const namespacet &ns);
/// Replaces arithmetic operations and typecasts involving floating point
/// numbers with their equivalent `floatbv` version, for example a plus
/// expression (`ID_plus`) turns into a floatbv_plus expression
/// (`ID_floatbv_plus`). These versions of the operators hold the current
/// rounding mode as an additional operand, which affects how these expressions
/// have to be evaluated. (Note that these floating point versions of arithmetic
/// operators do not have corresponding \ref exprt classes at the moment).
///
/// \param expr: The expression to adjust
/// \param rounding_mode: The rounding mode to set on floating point
/// subexpressions of this expression.
void adjust_float_expressions(exprt &expr, const exprt &rounding_mode);
/// Adjust floating point expressions in the body of a given function.
/// \see adjust_float_expressions(exprt &, namespacet &)
/// \see adjust_float_expressions(exprt &, const exprt &)
void adjust_float_expressions(
goto_functionst::goto_functiont &goto_function,
const namespacet &ns);
/// Adjust float expressions in all goto function bodies.
/// \see adjust_float_expressions(
/// goto_functionst::goto_functiont &, const namespacet &)
void adjust_float_expressions(
goto_functionst &goto_functions,
const namespacet &ns);
/// Adjust float expressions in a given goto_model.
/// \see adjust_float_expressions(goto_functionst &, const namespacet &)
void adjust_float_expressions(goto_modelt &goto_model);
/// Return the identifier of the program symbol used to
/// store the current rounding mode.
irep_idt rounding_mode_identifier();
#endif // CPROVER_GOTO_PROGRAMS_ADJUST_FLOAT_EXPRESSIONS_H