28 auto p = std::make_unique<invariant_set_domaint>(
32 return std::unique_ptr<statet>(p.release());
45 value_sets(_value_sets),
78 typedef std::unordered_map<irep_idt, object_listt> object_cachet;
79 object_cachet object_cache;
86 is.add_objects(globals);
89 for(
const auto &local : locals)
92 object_cachet::const_iterator e_it=object_cache.find(local);
94 if(e_it==object_cache.end())
101 is.add_objects(objects);
106 is.add_objects(e_it->second);
116 std::list<exprt> object_list;
120 for(
const auto &expr : object_list)
126 std::list<exprt> &dest)
131 t.
id() == ID_struct || t.
id() == ID_union || t.
id() == ID_struct_tag ||
132 t.
id() == ID_union_tag)
135 (t.
id() == ID_struct_tag || t.
id() == ID_union_tag)
147 else if(t.
id()==ID_array)
168 std::set<irep_idt> locals;
174 typedef std::unordered_map<irep_idt, object_listt> object_cachet;
175 object_cachet object_cache;
182 is.add_objects(globals);
185 for(
const auto &local : locals)
188 object_cachet::const_iterator e_it=object_cache.find(local);
190 if(e_it==object_cache.end())
197 is.add_objects(objects);
202 is.add_objects(e_it->second);
215 if(symbol_pair.second.is_lvalue && symbol_pair.second.is_static_lifetime)
224 if(type.
id()==ID_pointer)
227 type.
id() == ID_struct || type.
id() == ID_union ||
228 type.
id() == ID_struct_tag || type.
id() == ID_union_tag)
232 else if(type.
id()==ID_array)
234 else if(type.
id()==ID_unsignedbv ||
235 type.
id()==ID_signedbv)
237 else if(type.
id()==ID_bool)
262 if(!i_it->is_assert())
266 const auto &d = (*this)[i_it];
272 exprt simplified_guard(i_it->condition());
274 invariant_set.
simplify(simplified_guard);
virtual void initialize(const irep_idt &function_id, const goto_programt &goto_program)
Initialize all the abstract states for a single function.
ai_domain_baset::locationt locationt
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
A collection of goto functions.
function_mapt function_map
A generic container class for the GOTO intermediate representation of one function.
std::set< irep_idt > decl_identifierst
void get_decl_identifiers(decl_identifierst &decl_identifiers) const
get the variables in decl statements
unsigned add(const exprt &expr)
void add_objects(const goto_programt &goto_program)
void simplify(goto_programt &goto_program)
void get_objects(const symbolt &symbol, object_listt &dest)
void initialize(const irep_idt &function, const goto_programt &goto_program) override
Initialize all the abstract states for a single function.
void get_objects_rec(const exprt &src, std::list< exprt > &dest)
std::list< unsigned > object_listt
inv_object_storet object_store
bool check_type(const typet &type) const
void get_globals(object_listt &globals)
invariant_propagationt(const namespacet &_ns, value_setst &_value_sets)
Pass the necessary arguments to the invariant_set_domaint's when constructed.
std::unique_ptr< statet > make(locationt l) const override
invariant_set_domain_factoryt(invariant_propagationt &_ip)
invariant_propagationt & ip
invariant_sett invariant_set
void simplify(exprt &expr) const
tvt implies(const exprt &expr) const
const irep_idt & id() const
The most conventional storage; one domain per location.
state_mapt & internal(void)
Extract member of struct or union.
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
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().
const symbol_table_baset & get_symbol_table() const
Return first symbol table registered with the namespace.
Base type for structs and unions.
const componentst & components() const
const symbolst & symbols
Read-only field, used to look up symbols given their names.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
The Boolean constant true.
The type of an expression, extends irept.
void get_local_identifiers(const goto_functiont &goto_function, std::set< irep_idt > &dest)
Return in dest the identifiers of the local variables declared in the goto_function and the identifie...
#define forall_goto_program_instructions(it, program)
#define Forall_goto_program_instructions(it, program)
#define CHECK_RETURN(CONDITION)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
API to expression classes.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const struct_or_union_tag_typet & to_struct_or_union_tag_type(const typet &type)
Cast a typet to a struct_or_union_tag_typet.