28 for(std::size_t i=0; i<
entries.size(); i++)
29 out <<
"STORE " << i <<
": " <<
map[i] <<
'\n';
182 const std::pair<unsigned, unsigned> &p,
198 dest.insert(std::pair<unsigned, unsigned>(f, s));
242 const std::pair<unsigned, unsigned> &
eq,
243 const std::pair<unsigned, unsigned> &
ineq)
245 std::pair<unsigned, unsigned>
n;
270 if(
eq.second==
ineq.second)
280 std::pair<unsigned, unsigned> s=p;
281 std::swap(s.first, s.second);
294 std::pair<unsigned, unsigned> s=p;
295 std::swap(s.first, s.second);
355 if(expr.
type()==type)
385 throw "non-Boolean argument to strengthen()";
412 for(
const auto &op : expr.
operands())
427 for(
const auto &op :
bitand_op.operands())
437 std::pair<unsigned, unsigned> p;
449 else if(
i1.has_value())
458 else if(
i1.has_value())
504 for(
const auto &op :
bitand_op.operands())
517 std::swap(
tmp.op0(),
tmp.op1());
534 std::pair<unsigned, unsigned> p, s;
547 else if(
i1.has_value())
551 std::swap(s.first, s.second);
563 std::pair<unsigned, unsigned> p;
590 throw "implies: non-Boolean expression";
607 for(
const auto &op : expr.
operands())
617 for(
const auto &op : expr.
operands())
630 std::pair<unsigned, unsigned> p;
640 if(rel.id() ==
ID_le)
652 else if(rel.id() ==
ID_lt)
702 throw "nnf: non-Boolean expression";
762 std::swap(rel.lhs(), rel.rhs());
772 std::swap(rel.lhs(), rel.rhs());
783 std::swap(rel.lhs(), rel.rhs());
794 std::swap(rel.lhs(), rel.rhs());
842 if(it->second.singleton())
945 for(bounds_mapt::iterator
950 bounds_mapt::const_iterator
o_it=other.find(it->first);
952 if(
o_it==other.end())
954 bounds_mapt::iterator next(it);
963 it->second.approx_union_with(
o_it->second);
999 else if(lhs.
id()==
"object_value")
1015 else if(lhs.
id()==
"valid_object")
1025 lhs.
id() ==
"is_zero_string" ||
1026 lhs.
id() ==
"zero_string" ||
1027 lhs.
id() ==
"zero_string_length")
1032 throw "modifies: unexpected lhs: "+lhs.
id_string();
1058 for(
const auto &op : code.
operands())
1064 throw "assignment expected to have two operands";
1093 else if(statement==
"lock" ||
1094 statement==
"unlock" ||
1101 std::cerr << code.
pretty() <<
'\n';
1102 throw "invariant_sett: unexpected statement: "+
id2string(statement);
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a typet to an unsignedbv_typet.
Expression classes for byte-level operators.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Data structure for representing an arbitrary statement in a program.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
bool is_true() const
Return whether the expression is a constant representing true.
bool is_boolean() const
Return whether the expression represents a Boolean.
bool is_false() const
Return whether the expression is a constant representing false.
bool is_constant() const
Return whether the expression is a constant.
typet & type()
Return the type of the expression.
The Boolean constant false.
const exprt & get_expr(unsigned n) const
void output(std::ostream &out) const
static bool is_constant_address_rec(const exprt &expr)
static bool is_constant_address(const exprt &expr)
std::string build_string(const exprt &expr) const
std::string to_string(unsigned n) const
unsigned add(const exprt &expr)
std::vector< entryt > entries
bool is_constant(unsigned n) const
bool get(const exprt &expr, unsigned &n)
inv_object_storet & object_store
tvt is_lt(std::pair< unsigned, unsigned > p) const
tvt is_le(std::pair< unsigned, unsigned > p) const
void add_ne(const std::pair< unsigned, unsigned > &p)
bool has_le(const std::pair< unsigned, unsigned > &p) const
tvt implies_rec(const exprt &expr) const
void apply_code(const codet &code)
unsigned_union_find eq_set
std::map< unsigned, boundst > bounds_mapt
exprt get_constant(const exprt &expr) const
tvt is_ne(std::pair< unsigned, unsigned > p) const
interval_templatet< mp_integer > boundst
void simplify(exprt &expr) const
void output(std::ostream &out) const
void add_bounds(unsigned a, const boundst &bound)
bool make_union(const invariant_sett &other_invariants)
void strengthen(const exprt &expr)
void assignment(const exprt &lhs, const exprt &rhs)
void add_eq(const std::pair< unsigned, unsigned > &eq)
static void intersection(ineq_sett &dest, const ineq_sett &other)
std::set< std::pair< unsigned, unsigned > > ineq_sett
static void nnf(exprt &expr, bool negate=false)
void get_bounds(unsigned a, boundst &dest) const
static void remove(ineq_sett &dest, unsigned a)
tvt implies(const exprt &expr) const
void add(const std::pair< unsigned, unsigned > &p, ineq_sett &dest)
void add_type_bounds(const exprt &expr, const typet &type)
void add_le(const std::pair< unsigned, unsigned > &p)
bool has_ne(const std::pair< unsigned, unsigned > &p) const
bool get_object(const exprt &expr, unsigned &n) const
bool make_union_bounds_map(const bounds_mapt &other)
std::string to_string(unsigned a) const
void modifies(const exprt &lhs)
void strengthen_rec(const exprt &expr)
bool has_eq(const std::pair< unsigned, unsigned > &p) const
tvt is_eq(std::pair< unsigned, unsigned > p) const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irep_idt & get(const irep_idt &name) const
const std::string & id_string() const
const irep_idt & id() const
const std::string & get_string(const irep_idt &name) const
Extract member of struct or union.
The null pointer constant.
number_type number(const key_type &a)
std::optional< number_type > get_number(const key_type &a) const
Structure type, corresponds to C style structs.
The Boolean constant true.
Semantic type conversion.
The type of an expression, extends irept.
void intersection(const unsigned_union_find &other)
void check_index(size_type a)
size_type find(size_type a) const
size_type count(size_type a) const
size_type count_roots() const
bool is_root(size_type a) const
void make_union(size_type a, size_type b)
void isolate(size_type a)
#define Forall_operands(it, expr)
exprt boolean_negate(const exprt &src)
negate a Boolean expression, possibly removing a not_exprt, and swapping false and true
bool is_null_pointer(const constant_exprt &expr)
Returns true if expr has a pointer type and a value NULL; it also returns true when expr has value ze...
Deprecated expression utility functions.
interval_templatet< T > lower_interval(const T &l)
interval_templatet< T > upper_interval(const T &u)
const irept & get_nil_irep()
const std::string & id2string(const irep_idt &d)
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
const std::string integer2string(const mp_integer &n, unsigned base)
API to expression classes for Pointers.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
#define CHECK_RETURN(CONDITION)
#define UNREACHABLE
This should be used to mark dead code.
#define PRECONDITION(CONDITION)
const codet & to_code(const exprt &expr)
const binary_relation_exprt & to_binary_relation_expr(const exprt &expr)
Cast an exprt to a binary_relation_exprt.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const notequal_exprt & to_notequal_expr(const exprt &expr)
Cast an exprt to an notequal_exprt.
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const not_exprt & to_not_expr(const exprt &expr)
Cast an exprt to an not_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const equal_exprt & to_equal_expr(const exprt &expr)
Cast an exprt to an equal_exprt.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.