29 const irep_idt identifier=
"$stack_depth";
32 symbolt new_symbol{identifier, type, ID_C};
33 new_symbol.base_name=identifier;
34 new_symbol.pretty_name=identifier;
35 new_symbol.is_static_lifetime=
true;
37 new_symbol.is_thread_local=
true;
38 new_symbol.is_lvalue=
true;
46 return new_symbol.symbol_expr();
52 const std::size_t i_depth,
53 const exprt &max_depth)
74 DATA_INVARIANT(last->is_end_function(),
"must be end of function");
85 const std::size_t depth,
95 gf_entry.second.body_available() &&
99 stack_depth(gf_entry.second.body, sym, depth, depth_expr);
Pre-defined bitvector types.
static exprt guard(const exprt::operandst &guards, exprt cond)
A base class for relations, i.e., binary predicates whose two operands have the same type.
A goto_instruction_codet representing an assignment in the program.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
function_mapt function_map
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
bool can_produce_function(const irep_idt &id) const override
Determines if this model can produce a body for the given function.
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
This class represents an instruction in the GOTO intermediate representation.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
instructionst::iterator targett
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
targett insert_before(const_targett target)
Insertion before the instruction pointed-to by the given instruction iterator target.
The plus expression Associativity is not specified.
void set_comment(const irep_idt &comment)
void set_property_class(const irep_idt &property_class)
Expression to hold a symbol (variable)
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
The type of an expression, extends irept.
Goto Programs with Functions.
#define CHECK_RETURN(CONDITION)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)
static void stack_depth(goto_programt &goto_program, const symbol_exprt &symbol, const std::size_t i_depth, const exprt &max_depth)
static symbol_exprt add_stack_depth_symbol(goto_modelt &goto_model, message_handlert &message_handler)
void recreate_initialize_function(goto_modelt &goto_model, message_handlert &message_handler)
Regenerates the CPROVER_INITIALIZE function, which initializes all non-function symbols of the goto m...
#define INITIALIZE_FUNCTION
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
static bool failed(bool error_indicator)