Go to the documentation of this file.
9 #ifndef CPROVER_UTIL_GOTO_INSTRUCTION_CODE_H
10 #define CPROVER_UTIL_GOTO_INSTRUCTION_CODE_H
38 {std::move(
lhs), std::move(
rhs)},
68 vm, code.
operands().size() == 2,
"assignment must have two operands");
81 "lhs and rhs of assignment must have same type");
161 "removal (code_deadt) must have one operand");
164 code.
op0().
id() == ID_symbol,
165 "removing a non-symbol: " +
id2string(code.
op0().
id()) +
"from scope");
232 vm, code.
operands().size() == 1,
"declaration must have one operand");
235 code.
op0().
id() == ID_symbol,
236 "declaring a non-symbol: " +
286 {std::move(_lhs), std::move(_function),
exprt(ID_arguments)})
334 "function calls must have three operands:\n1) expression to store the "
335 "returned values\n2) the function being called\n3) the vector of "
346 if(code.
op0().
id() != ID_nil)
350 "function returns expression of wrong type");
414 std::vector<exprt> arguments,
461 std::vector<exprt> arguments,
565 #endif // CPROVER_GOTO_PROGRAMS_GOTO_INSTRUCTION_CODE_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...
const code_function_callt & to_code_function_call(const goto_instruction_codet &code)
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const symbol_exprt & symbol() const
code_function_callt(exprt _function, argumentst _arguments)
code_assignt(exprt lhs, exprt rhs)
const exprt & lhs() const
const code_deadt & to_code_dead(const goto_instruction_codet &code)
A goto_instruction_codet representing the declaration of a local variable.
Base class for all expressions.
const code_declt & to_code_decl(const goto_instruction_codet &code)
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
static void validate(const goto_instruction_codet &code, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
A goto_instruction_codet representing the declaration that an output of a particular description has ...
code_deadt(symbol_exprt symbol)
typet & type()
Return the type of the expression.
goto_instruction_codet representation of a function call statement.
code_outputt(std::vector< exprt > arguments, optionalt< source_locationt > location={})
This constructor is for support of calls to __CPROVER_output in user code.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const std::string & id2string(const irep_idt &d)
#define PRECONDITION(CONDITION)
const irep_idt & get_identifier() const
bool can_cast_expr< code_function_callt >(const exprt &base)
void validate_expr(const code_assignt &x)
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const argumentst & arguments() const
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
code_assignt(exprt lhs, exprt rhs, source_locationt loc)
std::vector< exprt > operandst
exprt::operandst argumentst
static void validate(const goto_instruction_codet &code, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
bool can_cast_expr< code_assignt >(const exprt &base)
bool can_cast_expr< code_returnt >(const exprt &base)
A goto_instruction_codet representing the removal of a local variable going out of scope.
code_function_callt(exprt _lhs, exprt _function, argumentst _arguments)
nonstd::optional< T > optionalt
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
code_function_callt(exprt _function)
bool can_cast_expr< code_outputt >(const exprt &base)
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
code_declt(symbol_exprt symbol)
goto_instruction_codet representation of a "return from a function" statement.
bool can_cast_expr< code_deadt >(const exprt &base)
const symbol_exprt & symbol() const
bool can_cast_expr< code_declt >(const exprt &base)
bool can_cast_expr< code_inputt >(const exprt &base)
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...
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const typet & return_type() const
static void validate_full(const goto_instruction_codet &code, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
const irep_idt & get_identifier() const
const exprt & return_value() const
A goto_instruction_codet representing an assignment in the program.
const irep_idt & get_statement() const
const exprt & lhs() const
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).
static void check(const goto_instruction_codet &code, const validation_modet vm=validation_modet::INVARIANT)
const code_returnt & to_code_return(const goto_instruction_codet &code)
const exprt & rhs() const
bool can_cast_code_impl(const exprt &expr, const Tag &tag)
const code_assignt & to_code_assign(const goto_instruction_codet &code)
static void validate_full(const goto_instruction_codet &code, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
Data structure for representing an arbitrary statement in a program.