22#define MAX_INTEGER_UNDERAPPROX 3
23#define MAX_FLOAT_UNDERAPPROX 10
138 std::size_t o=
a.expr.operands().size();
165 const typet &type =
a.expr.type();
185 o0.unpack(
a.op0_value);
186 o1.unpack(
a.op1_value);
201 if(result.
pack()==
a.result_value)
206 rr.unpack(
a.result_value);
208 log.
debug() <<
"S1: " <<
o0 <<
" " <<
a.expr.id() <<
" " <<
o1
211 <<
a.expr.id() <<
" "
216 <<
a.expr.id() <<
" "
248 a.over_assumptions.
clear();
256 bvt op0=
a.op0_bv, op1=
a.op1_bv,
res=
a.result_bv;
278 a.expr.operands().size() == 2,
"all (un)signedbv typed exprs are binary");
286 o0.unpack(
a.op0_value);
287 o1.unpack(
a.op1_value);
304 if(
o0.pack()==
a.result_value)
353 log.
status() <<
"Found spurious '" <<
a.as_string() <<
"' (state "
369 log.
status() <<
"Found assumption for '" <<
a.as_string()
374 a.under_assumptions.
clear();
381 a.under_assumptions.reserve(
a.op0_bv.size()+
a.op1_bv.size());
395 for(std::size_t i=0; i<
fraction0.size(); i++)
398 for(std::size_t i=0; i<
fraction1.size(); i++)
404 unsigned x=
a.under_state*
a.under_state;
427 unsigned x=
a.under_state+1;
436 a.under_assumptions.reserve(
a.op0_bv.size()+
a.op1_bv.size());
438 for(std::size_t i=
x; i<
a.op0_bv.size(); i++)
439 a.add_under_assumption(!
a.op0_bv[i]);
441 for(std::size_t i=
x; i<
a.op1_bv.size(); i++)
442 a.add_under_assumption(!
a.op1_bv[i]);
453 for(std::size_t i=0; i<
a.under_assumptions.size(); i++)
467 a.over_state=
a.under_state=0;
469 a.under_assumptions.reserve(
a.op0_bv.size()+
a.op1_bv.size());
473 for(std::size_t i=0; i<
a.op0_bv.size(); i++)
474 a.add_under_assumption(!
a.op0_bv[i]);
476 for(std::size_t i=0; i<
a.op1_bv.size(); i++)
477 a.add_under_assumption(!
a.op1_bv[i]);
500 else if(
a.no_operands==2)
507 else if(
a.no_operands==3)
528 return std::to_string(id_nr)+
"/"+
id2string(expr.id());
Pre-defined bitvector types.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
Abstraction Refinement Loop.
virtual void clear()
Reset the abstract state.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
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...
virtual bvt convert_mod(const mod_exprt &expr)
virtual bvt convert_mult(const mult_exprt &expr)
exprt get(const exprt &expr) const override
Return expr with variables replaced by values from satisfying assignment if available.
virtual bvt convert_floatbv_op(const ieee_float_op_exprt &)
virtual bvt convert_div(const div_exprt &expr)
virtual std::size_t boolbv_width(const typet &type) const
mp_integer get_value(const bvt &bv)
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
bool is_constant() const
Return whether the expression is a constant.
typet & type()
Return the type of the expression.
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
An IEEE 754 value plus a rounding mode, enabling operations with rounding on values.
const irep_idt & id() 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)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
const mult_exprt & to_mult_expr(const exprt &expr)
Cast an exprt to a mult_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 multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
bool is_constant(const typet &type)
This method tests, if the given typet is a constant.
std::vector< exprt > over_assumptions
void add_under_assumption(literalt l)
std::string as_string() const
void add_over_assumption(literalt l)
unsigned max_node_refinement
Max number of times we refine a formula node.
bool refine_arithmetic
Enable arithmetic refinement.