22 #define MAX_INTEGER_UNDERAPPROX 3
23 #define MAX_FLOAT_UNDERAPPROX 10
42 return SUB::convert_floatbv_op(expr);
44 if(expr.
type().
id() != ID_floatbv)
45 return SUB::convert_floatbv_op(expr);
55 return SUB::convert_mult(expr);
70 if(type.
id()!=ID_floatbv)
72 return SUB::convert_mult(expr);
78 if(type.
id()==ID_signedbv ||
79 type.
id()==ID_unsignedbv)
103 return SUB::convert_div(expr);
111 return SUB::convert_div(expr);
121 return SUB::convert_mod(expr);
129 return SUB::convert_mod(expr);
167 if(type.
id()==ID_floatbv)
183 const std::size_t rounding_mode_int =
184 numeric_cast_v<std::size_t>(rounding_mode_expr);
193 if(a.
expr.
id()==ID_floatbv_plus)
195 else if(a.
expr.
id()==ID_floatbv_minus)
197 else if(a.
expr.
id()==ID_floatbv_mult)
199 else if(a.
expr.
id()==ID_floatbv_div)
229 float_utils.
spec=spec;
256 float_utils.
spec=spec;
261 if(a.
expr.
id()==ID_floatbv_plus)
262 r=float_utils.
add(op0, op1);
263 else if(a.
expr.
id()==ID_floatbv_minus)
264 r=float_utils.
sub(op0, op1);
265 else if(a.
expr.
id()==ID_floatbv_mult)
266 r=float_utils.
mul(op0, op1);
267 else if(a.
expr.
id()==ID_floatbv_div)
268 r=float_utils.
div(op0, op1);
276 else if(type.
id()==ID_signedbv ||
277 type.
id()==ID_unsignedbv)
281 a.
expr.
operands().size() == 2,
"all (un)signedbv typed exprs are binary");
300 else if(a.
expr.
id()==ID_div)
302 else if(a.
expr.
id()==ID_mod)
322 else if(a.
expr.
id()==ID_div)
330 else if(a.
expr.
id()==ID_mod)
346 else if(type.
id()==ID_fixedbv)
387 float_utils.
spec=spec;
398 for(std::size_t i=0; i<fraction0.size(); i++)
401 for(std::size_t i=0; i<fraction1.size(); i++)
419 for(std::size_t i=x; i<fraction0.size(); i++)
422 for(std::size_t i=x; i<fraction1.size(); i++)
441 for(std::size_t i=x; i<a.
op0_bv.size(); i++)
444 for(std::size_t i=x; i<a.
op1_bv.size(); i++)
476 for(std::size_t i=0; i<a.
op0_bv.size(); i++)
479 for(std::size_t i=0; i<a.
op1_bv.size(); i++)
Pre-defined bitvector types.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
Abstraction Refinement Loop.
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
exprt get(const exprt &expr) const override
Return expr with variables replaced by values from satisfying assignment if available.
virtual std::size_t boolbv_width(const typet &type) const
mp_integer get_value(const bvt &bv)
void unpack(const mp_integer &i)
bvt convert_mult(const mult_exprt &expr) override
bvt convert_div(const div_exprt &expr) override
bool conflicts_with(approximationt &approximation)
check if an under-approximation is part of the conflict
approximationt & add_approximation(const exprt &expr, bvt &bv)
void get_values(approximationt &approximation)
bvt convert_mod(const mod_exprt &expr) override
bvt convert_floatbv_op(const ieee_float_op_exprt &) override
void initialize(approximationt &approximation)
std::list< approximationt > approximations
void set_equal(const bvt &a, const bvt &b)
literalt is_zero(const bvt &op)
literalt equal(const bvt &op0, const bvt &op1)
Bit-blasting ID_equal and use in other encodings.
literalt is_one(const bvt &op)
bvt remainder(const bvt &op0, const bvt &op1, representationt rep)
bvt divider(const bvt &op0, const bvt &op1, representationt rep)
bvt multiplier(const bvt &op0, const bvt &op1, representationt rep)
A constant literal expression.
Base class for all expressions.
std::vector< exprt > operandst
typet & type()
Return the type of the expression.
bool is_constant() const
Return whether the expression is a constant.
bvt build_constant(const ieee_floatt &)
virtual bvt mul(const bvt &src1, const bvt &src2)
bvt get_fraction(const bvt &)
Gets the fraction without hidden bit in a floating-point bit-vector src.
virtual bvt div(const bvt &src1, const bvt &src2)
bvt add(const bvt &src1, const bvt &src2)
bvt sub(const bvt &src1, const bvt &src2)
rounding_mode_bitst rounding_mode_bits
Fixed-width bit-vector with IEEE floating-point interpretation.
IEEE floating-point operations These have two data operands (op0 and op1) and one rounding mode (op2)...
std::size_t width() const
void unpack(const mp_integer &i)
rounding_modet rounding_mode
const irep_idt & id() const
literalt get_literal() const
mstreamt & status() const
Modulo defined as lhs-(rhs * truncate(lhs/rhs)).
Binary multiplication Associativity is not specified.
void set_frozen(literalt)
void l_set_to_true(literalt a)
virtual literalt land(literalt a, literalt b)=0
virtual literalt limplies(literalt a, literalt b)=0
virtual bvt new_variables(std::size_t width)
generates a bitvector of given width with new variables
virtual literalt lor(literalt a, literalt b)=0
virtual bool is_in_conflict(literalt l) const =0
Returns true if an assumption is in the final conflict.
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 std::string & id2string(const irep_idt &d)
std::vector< literalt > bvt
const literal_exprt & to_literal_expr(const exprt &expr)
Cast a generic exprt to a literal_exprt.
const std::string integer2binary(const mp_integer &n, std::size_t width)
#define MAX_INTEGER_UNDERAPPROX
#define MAX_FLOAT_UNDERAPPROX
#define CHECK_RETURN(CONDITION)
#define UNREACHABLE
This should be used to mark dead code.
#define PRECONDITION(CONDITION)
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
const mult_exprt & to_mult_expr(const exprt &expr)
Cast an exprt to a mult_exprt.
bool is_constant(const typet &type)
This method tests, if the given typet is a constant.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
std::vector< exprt > over_assumptions
void add_under_assumption(literalt l)
std::string as_string() const
void add_over_assumption(literalt l)
std::vector< exprt > under_assumptions
unsigned max_node_refinement
Max number of times we refine a formula node.
bool refine_arithmetic
Enable arithmetic refinement.
void set(const ieee_floatt::rounding_modet mode)