10 #ifndef CPROVER_UTIL_SSA_EXPR_H
11 #define CPROVER_UTIL_SSA_EXPR_H
35 return static_cast<const exprt &
>(
find(ID_expression));
87 vm, !expr.
has_operands(),
"SSA expression should not have operands");
89 vm, expr.
id() == ID_symbol,
"SSA expression symbols are symbols");
97 const auto expr_l0 = expr_sub.find(ID_L0);
98 const auto expr_l1 = expr_sub.find(ID_L1);
99 const auto expr_l2 = expr_sub.find(ID_L2);
102 expr_l0 == expr_sub.end() || !expr_l0->second.id().empty(),
103 "L0 must not be an empty string");
106 expr_l1 == expr_sub.end() || !expr_l1->second.id().empty(),
107 "L1 must not be an empty string");
110 expr_l2 == expr_sub.end() || !expr_l2->second.id().empty(),
111 "L2 must not be an empty string");
121 static_cast<const exprt &
>(expr.
find(ID_expression)), ns, vm);
127 return expr.
id() == ID_symbol && expr.
get_bool(ID_C_SSA_symbol);
148 return static_cast<const ssa_exprt &
>(expr);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
bool has_operands() const
Return true if there is at least one operand.
typet & type()
Return the type of the expression.
bool get_bool(const irep_idt &name) const
const irept & find(const irep_idt &name) const
const irep_idt & get(const irep_idt &name) const
named_subt & get_named_sub()
const irep_idt & id() const
irept & add(const irep_idt &name)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Expression providing an SSA-renamed symbol of expressions.
const irep_idt get_level_1() const
const irep_idt get_l1_object_identifier() const
void set_level_1(std::size_t i)
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
void set_level_2(std::size_t i)
const ssa_exprt get_l1_object() const
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
static bool can_build_identifier(const exprt &src)
Used to determine whether or not an identifier can be built before trying and getting an exception.
void set_expression(exprt expr)
Replace the underlying, original expression by expr while maintaining SSA indices.
const irep_idt get_level_2() const
const irep_idt get_level_0() const
const irep_idt get_original_name() const
void set_level_0(std::size_t i)
ssa_exprt(const exprt &expr)
Constructor.
const exprt & get_original_expr() const
irep_idt get_object_name() const
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
const ssa_exprt & to_ssa_expr(const exprt &expr)
Cast a generic exprt to an ssa_exprt.
bool is_ssa_expr(const exprt &expr)
void validate_expr(const ssa_exprt &expr)
bool can_cast_expr< ssa_exprt >(const exprt &base)
ssa_exprt remove_level_2(ssa_exprt ssa)
API to expression classes.
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...
void validate_full_expr(const exprt &expr, const namespacet &ns, const validation_modet vm)
Check that the given expression is well-formed (full check, including checks of all subexpressions an...