35 const bool found_l0 = !ns.
lookup(obj_identifier, s);
52 ssa.
get().get_identifier(), std::make_pair(ssa.
get(), index));
55 std::optional<std::pair<ssa_exprt, std::size_t>>
64 std::pair<ssa_exprt, std::size_t> result = *old_value;
81 !l0_expr.
get().get_level_1().empty() ||
82 !l0_expr.
get().get_level_2().empty())
87 const irep_idt l0_name = l0_expr.
get().get_l1_object_identifier();
97 l0_expr.
value().set_level_1(r_opt->get().second);
104 if(!l1_expr.
get().get_level_2().empty())
115 for(
const auto &delta_item : delta_view)
117 if(!delta_item.is_in_both_maps())
123 if(delta_item.m != delta_item.get_other_map_value())
134 return !r_opt ? 0 : r_opt->get().second;
140 std::function<std::size_t(
const irep_idt &)> fresh_l2_name_provider)
142 const std::size_t n = fresh_l2_name_provider(l1_identifier);
146 std::pair<ssa_exprt, std::size_t> copy = r_opt->get();
176 if(type.
id() == ID_array)
179 array_type.element_type() =
183 else if(type.
id() == ID_struct || type.
id() == ID_union)
191 else if(type.
id() == ID_pointer)
201 if(type.
id() == ID_array)
203 else if(type.
id() == ID_struct || type.
id() == ID_union)
220 if(expr.
id() == ID_symbol)
222 const auto &type = expr.
type();
224 return type.
id() != ID_code && type.id() != ID_mathematical_function;
227 if(
to_ssa_expr(expr).get_original_expr().type() != type)
232 for(
const auto &op : expr.
operands())
248 expr.
id() == ID_address_of &&
254 expr.
id() == ID_address_of &&
261 else if(expr.
id() == ID_symbol)
263 const auto &type = expr.
type();
265 return type.
id() != ID_code && type.id() != ID_mathematical_function;
268 if(
to_ssa_expr(expr).get_original_expr().type() != type)
271 else if(expr.
id() == ID_nil)
277 for(
const auto &op : expr.
operands())
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.
static irep_idt guard_identifier()
bool get_bool(const irep_idt &name) const
const irep_idt & id() const
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 typet & base_type() const
The type of the data what we point to.
Wrapper for expressions or types which have been renamed up to a given level.
const underlyingt & get() const
void insert(const key_type &k, valueU &&m)
Insert element, element must not exist in map.
bool has_key(const key_type &k) const
Check if key is in map.
void replace(const key_type &k, valueU &&m)
Replace element, element must exist in map.
std::vector< delta_view_itemt > delta_viewt
Delta view of the key-value pairs in two maps.
std::optional< std::reference_wrapper< const mapped_type > > find(const key_type &k) const
Find element.
void get_delta_view(const sharing_mapt &other, delta_viewt &delta_view, const bool only_common=true) const
Get a delta view of the elements in the map.
Expression providing an SSA-renamed symbol of expressions.
const irep_idt get_level_0() const
void set_level_0(std::size_t i)
const exprt & get_original_expr() const
irep_idt get_object_name() const
Base type for structs and unions.
const componentst & components() const
std::vector< componentt > componentst
typet type
Type of symbol.
The type of an expression, extends irept.
#define Forall_operands(it, expr)
const std::string & id2string(const irep_idt &d)
API to expression classes for Pointers.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
exprt get_original_name(exprt expr)
Undo all levels of renaming.
bool check_renaming(const typet &type)
Check that type is correctly renamed to level 2 and return true in case an error is detected.
renamedt< ssa_exprt, L0 > symex_level0(ssa_exprt ssa_expr, const namespacet &ns, std::size_t thread_nr)
Set the level 0 renaming of SSA expressions.
bool check_renaming_l1(const exprt &expr)
Check that expr is correctly renamed to level 1 and return true in case an error is detected.
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
const ssa_exprt & to_ssa_expr(const exprt &expr)
Cast a generic exprt to an ssa_exprt.
bool is_ssa_expr(const exprt &expr)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
Functor to set the level 1 renaming of SSA expressions.
symex_renaming_levelt current_names
std::optional< std::pair< ssa_exprt, std::size_t > > insert_or_replace(const renamedt< ssa_exprt, L0 > &ssa, std::size_t index)
Set the index for ssa to index.
void restore_from(const symex_level1t &other)
Insert the content of other into this renaming.
renamedt< ssa_exprt, L1 > operator()(renamedt< ssa_exprt, L0 > l0_expr) const
bool has(const renamedt< ssa_exprt, L0 > &ssa) const
void insert(const renamedt< ssa_exprt, L0 > &ssa, std::size_t index)
Assume ssa is not already known.
unsigned latest_index(const irep_idt &identifier) const
Counter corresponding to an identifier.
renamedt< ssa_exprt, L2 > operator()(renamedt< ssa_exprt, L1 > l1_expr) const
Set L2 tag to correspond to the current count of the identifier of l1_expr's.
symex_renaming_levelt current_names
std::size_t increase_generation(const irep_idt &l1_identifier, const ssa_exprt &lhs, std::function< std::size_t(const irep_idt &)> fresh_l2_name_provider)
Allocates a fresh L2 name for the given L1 identifier, and makes it the latest generation on this pat...
const type_with_subtypet & to_type_with_subtype(const typet &type)