23 const auto symbol = expr_try_dynamic_cast<symbol_exprt>(expr);
24 return symbol && !symbol->get_identifier().empty();
49 return *expr_try_dynamic_cast<symbol_exprt>(expr);
57 return symbol_operand.has_value();
99 if(
const auto sub_struct = expr_try_dynamic_cast<struct_exprt>(expr.
op0()))
108 return expr.
operands().size() == 1 ||
112 [&](
const exprt &operand) {
113 return can_cast_expr<constant_exprt>(operand) ||
114 can_cast_expr<annotated_pointer_constant_exprt>(operand);
152 "Unsupported expression.");
154 if(
const auto member = expr_try_dynamic_cast<member_exprt>(lhs))
161 "Expecting a member with nested symbol operand.");
164 else if(
const auto symbol = expr_try_dynamic_cast<symbol_exprt>(lhs))
171 "Expecting a symbol with non-empty identifier.");
174 else if(
const auto index = expr_try_dynamic_cast<index_exprt>(lhs))
181 "Expecting an index expression with a symbol array and constant or "
182 "symbol index value.");
185 else if(
const auto byte = expr_try_dynamic_cast<byte_extract_exprt>(lhs))
192 "Expecting a byte extract expression with a symbol array and constant or "
193 "symbol index value.");
202 "Expression does not meet any trace assumptions.");
216 "Unsupported expression.");
218 if(
const auto address = expr_try_dynamic_cast<address_of_exprt>(rhs))
225 "Expecting an address of with nested symbol.");
228 else if(
const auto symbol_expr = expr_try_dynamic_cast<symbol_exprt>(rhs))
235 "Expecting a symbol with non-empty identifier.");
238 else if(
const auto struct_expr = expr_try_dynamic_cast<struct_exprt>(rhs))
245 "Expecting all non-base class operands to be constants.");
258 else if(
const auto constant_expr = expr_try_dynamic_cast<constant_exprt>(rhs))
265 "Expecting a constant expression to have no operands and a non-empty "
270 const auto constant_expr =
271 expr_try_dynamic_cast<annotated_pointer_constant_exprt>(rhs))
278 "Expecting the operand of an annotated pointer constant expression "
279 "to be a constant, address_of, or plus expression.");
282 else if(
const auto byte = expr_try_dynamic_cast<byte_extract_exprt>(rhs))
290 "Expecting a byte extract with constant index.");
299 "Expression does not meet any trace assumptions.");
318 const bool run_check,
323 for(
const auto &step : trace.
steps)
Expression classes for byte-level operators.
bool can_cast_expr< byte_extract_exprt >(const exprt &base)
Operator to return the address of an object.
Pointer-typed bitvector constant annotated with the pointer expression that the bitvector is the nume...
exprt & symbolic_pointer()
A constant literal expression.
const irep_idt & get_value() const
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.
Step of the trace of a GOTO program.
bool is_assignment() const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Extract member of struct or union.
Class that provides messages with a built-in verbosity 'level'.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Struct constructor from list of elements.
const exprt & skip_typecast(const exprt &expr)
find the expression nested inside typecasts, if any
Deprecated expression utility functions.
bool valid_lhs_expr_high_level(const exprt &lhs)
static void check_step_assumptions(const goto_trace_stept &step, const namespacet &ns, const validation_modet vm)
bool check_address_structure(const address_of_exprt &address)
bool valid_rhs_expr_high_level(const exprt &rhs)
bool check_member_structure(const member_exprt &expr)
static bool check_annotated_pointer_constant_structure(const annotated_pointer_constant_exprt &constant_expr)
bool check_index_structure(const exprt &index_expr)
bool check_symbol_structure(const exprt &expr)
static bool may_be_lvalue(const exprt &expr)
void check_trace_assumptions(const goto_tracet &trace, const namespacet &ns, const messaget &log, const bool run_check, const validation_modet vm)
Checks that the structure of each step of the trace matches certain criteria.
bool check_constant_structure(const constant_exprt &constant_expr)
static void check_lhs_assumptions(const exprt &lhs, const namespacet &ns, const validation_modet vm)
static void check_rhs_assumptions(const exprt &rhs, const namespacet &ns, const validation_modet vm)
std::optional< symbol_exprt > get_inner_symbol_expr(exprt expr)
Recursively extracts the first operand of an expression until it reaches a symbol and returns it,...
bool can_evaluate_to_constant(const exprt &expression)
bool check_struct_structure(const struct_exprt &expr)
API to expression classes for Pointers.
bool can_cast_expr< annotated_pointer_constant_exprt >(const exprt &base)
bool can_cast_expr< address_of_exprt >(const exprt &base)
exprt simplify_expr(exprt src, const namespacet &ns)
API to expression classes.
bool can_cast_expr< typecast_exprt >(const exprt &base)
bool can_cast_expr< struct_exprt >(const exprt &base)
bool can_cast_expr< mult_exprt >(const exprt &base)
bool can_cast_expr< plus_exprt >(const exprt &base)
bool can_cast_expr< constant_exprt >(const exprt &base)
const multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
bool can_cast_expr< index_exprt >(const exprt &base)
bool can_cast_expr< symbol_exprt >(const exprt &base)
bool can_cast_expr< member_exprt >(const exprt &base)
bool can_cast_expr< array_list_exprt >(const exprt &base)
bool can_cast_expr< array_exprt >(const exprt &base)
#define DATA_CHECK_WITH_DIAGNOSTICS(vm, condition, message,...)