9 #ifndef CPROVER_UTIL_GOTO_INSTRUCTION_CODE_H
10 #define CPROVER_UTIL_GOTO_INSTRUCTION_CODE_H
37 {std::move(
lhs), std::move(
rhs)},
67 vm, code.
operands().size() == 2,
"assignment must have two operands");
80 "lhs and rhs of assignment must have same type");
160 "removal (code_deadt) must have one operand");
163 code.
op0().
id() == ID_symbol,
164 "removing a non-symbol: " +
id2string(code.
op0().
id()) +
"from scope");
231 vm, code.
operands().size() == 1,
"declaration must have one operand");
234 code.
op0().
id() == ID_symbol,
235 "declaring a non-symbol: " +
285 {std::move(_lhs), std::move(_function),
exprt(ID_arguments)})
333 "function calls must have three operands:\n1) expression to store the "
334 "returned values\n2) the function being called\n3) the vector of "
345 if(code.
op0().
id() != ID_nil)
349 "function returns expression of wrong type");
413 std::vector<exprt> arguments,
414 std::optional<source_locationt> location = {});
427 std::optional<source_locationt> location = {});
460 std::vector<exprt> arguments,
461 std::optional<source_locationt> location = {});
473 std::optional<source_locationt> location = {});
A goto_instruction_codet representing an assignment in the program.
const exprt & rhs() const
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const exprt & lhs() const
static void validate_full(const goto_instruction_codet &code, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
code_assignt(exprt lhs, exprt rhs, source_locationt loc)
code_assignt(exprt lhs, exprt rhs)
static void validate(const goto_instruction_codet &code, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
A goto_instruction_codet representing the removal of a local variable going out of scope.
code_deadt(symbol_exprt symbol)
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const irep_idt & get_identifier() const
const symbol_exprt & symbol() const
A goto_instruction_codet representing the declaration of a local variable.
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const irep_idt & get_identifier() const
code_declt(symbol_exprt symbol)
const symbol_exprt & symbol() const
goto_instruction_codet representation of a function call statement.
const argumentst & arguments() const
static void validate(const goto_instruction_codet &code, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
static void validate_full(const goto_instruction_codet &code, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
code_function_callt(exprt _function)
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const exprt & lhs() const
code_function_callt(exprt _function, argumentst _arguments)
code_function_callt(exprt _lhs, exprt _function, argumentst _arguments)
exprt::operandst argumentst
A goto_instruction_codet representing the declaration that an output of a particular description has ...
code_outputt(std::vector< exprt > arguments, std::optional< source_locationt > location={})
This constructor is for support of calls to __CPROVER_output in user code.
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
goto_instruction_codet representation of a "return from a function" statement.
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const exprt & return_value() const
const typet & return_type() const
Data structure for representing an arbitrary statement in a program.
const irep_idt & get_statement() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
typet & type()
Return the type of the expression.
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
bool can_cast_expr< code_function_callt >(const exprt &base)
const code_returnt & to_code_return(const goto_instruction_codet &code)
bool can_cast_expr< code_inputt >(const exprt &base)
bool can_cast_expr< code_outputt >(const exprt &base)
bool can_cast_expr< code_assignt >(const exprt &base)
bool can_cast_expr< code_declt >(const exprt &base)
void validate_expr(const code_assignt &x)
const code_assignt & to_code_assign(const goto_instruction_codet &code)
const code_deadt & to_code_dead(const goto_instruction_codet &code)
bool can_cast_expr< code_returnt >(const exprt &base)
const code_function_callt & to_code_function_call(const goto_instruction_codet &code)
bool can_cast_expr< code_deadt >(const exprt &base)
const code_declt & to_code_decl(const goto_instruction_codet &code)
code_function_callt havoc_slice_call(const exprt &p, const exprt &size, const namespacet &ns)
Builds a code_function_callt to __CPROVER_havoc_slice(p, size).
const std::string & id2string(const irep_idt &d)
bool can_cast_code_impl(const exprt &expr, const Tag &tag)
#define PRECONDITION(CONDITION)
API to expression classes.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
#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...