Go to the documentation of this file.
23 for(
const auto &name_value : view)
25 out << name_value.first <<
" <- " <<
format(name_value.second) <<
"\n";
43 const exprt &condition,
47 if(
auto and_expr = expr_try_dynamic_cast<and_exprt>(condition))
52 for(
const auto &op : and_expr->operands())
55 else if(
auto not_expr = expr_try_dynamic_cast<not_exprt>(condition))
57 const exprt &operand = not_expr->op();
58 if(
auto notequal_expr = expr_try_dynamic_cast<notequal_exprt>(operand))
68 else if(
auto equal_expr = expr_try_dynamic_cast<equal_exprt>(operand))
86 else if(
auto equal_expr = expr_try_dynamic_cast<equal_exprt>(condition))
89 exprt lhs = equal_expr->lhs();
90 exprt rhs = equal_expr->rhs();
99 "apply_condition operand should be L2 renamed");
102 previous_state.
threads.size() == 1 ||
112 const auto propagation_entry =
propagation.find(l1_identifier);
113 if(!propagation_entry.has_value())
115 else if(propagation_entry->get() != rhs)
132 expr_checked_cast<notequal_exprt>(condition).lhs().type() ==
bool_typet{})
138 expr_dynamic_cast<notequal_exprt>(condition);
#define UNREACHABLE
This should be used to mark dead code.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
bool can_cast_expr< symbol_exprt >(const exprt &base)
void apply_condition(const exprt &condition, const goto_symex_statet &previous_state, const namespacet &ns)
Given a condition that must hold on this path, propagate as much knowledge as possible.
void assign(const exprt &lhs, const exprt &rhs, const namespacet &ns, bool is_simplified, bool add_to_sets)
Transforms this value-set by executing executing the assignment lhs := rhs against it.
Central data structure: state.
Base class for all expressions.
void output_propagation_map(std::ostream &)
Print the constant propagation map in a human-friendly format.
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...
bool is_true() const
Return whether the expression is a constant representing true.
bool is_false() const
Return whether the expression is a constant representing false.
sharing_mapt< irep_idt, exprt > propagation
Expression providing an SSA-renamed symbol of expressions.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
std::vector< view_itemt > viewt
View of the key-value pairs in the map.
std::vector< threadt > threads
bool is_ssa_expr(const exprt &expr)
const ssa_exprt & to_ssa_expr(const exprt &expr)
Cast a generic exprt to an ssa_exprt.
const irep_idt & get_identifier() const
bool can_cast_expr< notequal_exprt >(const exprt &base)
const irep_idt get_level_2() const
The Boolean constant false.
write_is_shared_resultt write_is_shared(const ssa_exprt &expr, const namespacet &ns) const
ssa_exprt remove_level_2(ssa_exprt ssa)
std::function< std::size_t(const irep_idt &)> get_l2_name_provider() const
The Boolean constant true.
value_sett value_set
Uses level 1 names, and is used to do dereferencing.