Go to the documentation of this file.
12 #ifndef CPROVER_GOTO_PROGRAMS_INTERPRETER_CLASS_H
13 #define CPROVER_GOTO_PROGRAMS_INTERPRETER_CLASS_H
35 :
output(_message_handler),
93 typedef std::list<function_assignments_contextt>
95 typedef std::map<irep_idt, std::list<function_assignments_contextt> >
118 if(lower_bound->first!=address)
144 return next_alloc_address-address;
149 auto memory_iter =
memory.
find(numeric_cast_v<std::size_t>(address));
154 while(memory_iter!=
memory.
end() && memory_iter->first<(address+alloc_size))
209 bool use_non_det=
false);
263 goto_functionst::function_mapt::const_iterator
function;
280 throw "invalid boolean value";
285 const typet &source_type,
289 const typet &source_type,
294 const typet &source_type,
308 #endif // CPROVER_GOTO_PROGRAMS_INTERPRETER_CLASS_H
Class that provides messages with a built-in verbosity 'level'.
mp_integer base_address_to_actual_size(const mp_integer &address) const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
interpretert(const symbol_tablet &_symbol_table, const goto_functionst &_goto_functions, message_handlert &_message_handler)
void show_state()
displays the current position of the pc and corresponding code
struct_typet::componentt get_component(const typet &object_type, const mp_integer &offset)
Retrieves the member at offset of an object of type object_type.
void allocate(const mp_integer &address, const mp_integer &size)
reserves memory block of size at address
friend class interpreter_testt
#define CHECK_RETURN(CONDITION)
The type of an expression, extends irept.
sparse_vectort< memory_cellt > memoryt
void execute_goto()
executes a goto instruction
goto_programt::const_targett pc
const symbol_tablet & symbol_table
void assign(const mp_integer &address, const mp_vectort &rhs)
sets the memory at address with the given rhs value (up to sizeof(rhs))
function_assignmentst param_assignments
symbol_exprt address_to_symbol(const mp_integer &address) const
bool evaluate_boolean(const exprt &expr)
bool unbounded_size(const typet &)
std::pair< exprt, exprt > diff_pairt
Base class for all expressions.
irep_idt calling_function
std::pair< irep_idt, irep_idt > assignment_idt
goto_programt::const_targett next_pc
std::vector< function_assignmentt > function_assignmentst
Expression to hold a symbol (variable)
std::map< irep_idt, typet > dynamic_typest
std::map< irep_idt, std::list< function_assignments_contextt > > list_input_varst
std::unordered_map< irep_idt, mp_integer > memory_mapt
void print_memory(bool input_flags)
Prints the current state of the memory map Since messaget mdofifies class members,...
dynamic_typest dynamic_types
void build_memory_map()
Creates a memory map of all static symbols in the program.
bool count_type_leaves(const typet &source_type, mp_integer &result)
Count the number of leaf subtypes of ty, a leaf type is a type that is not an array or a struct.
mp_integer base_address_to_alloc_size(const mp_integer &address) const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
std::map< struct_member_idt, const exprt > struct_valuest
mp_integer get_size(const typet &type)
Retrieves the actual size of the provided structured type.
void execute_other()
executes side effects of 'other' instructions
exprt get_value(const typet &type, const mp_integer &offset=0, bool use_non_det=false)
retrives the constant value at memory location offset as an object of type type
virtual void command()
reads a user command and executes it.
void step()
executes a single step and updates the program counter
std::map< mp_integer, optionalt< symbol_exprt > > inverse_memory_mapt
#define PRECONDITION(CONDITION)
function_assignmentst exception_assignments
mp_integer old_stack_pointer
void read_unbounded(const mp_integer &address, mp_vectort &dest) const
void execute_function_call()
const goto_functionst & goto_functions
const inverse_memory_mapt::value_type & address_to_object_record(const mp_integer &address) const
typet get_type(const irep_idt &id) const
returns the type object corresponding to id
std::vector< mp_integer > mp_vectort
std::pair< irep_idt, exprt > input_entryt
std::list< function_assignments_contextt > function_assignments_contextst
typet concretize_type(const typet &type)
turns a variable length array type into a fixed array type
void execute_assign()
executes the assign statement at the current pc value
std::map< assignment_idt, diff_pairt > side_effects_differencet
A collection of goto functions.
std::map< irep_idt, function_assignmentst > output_valuest
const dynamic_typest & get_dynamic_types()
bool memory_offset_to_byte_offset(const typet &source_type, const mp_integer &cell_offset, mp_integer &result)
Similarly to the above, the interpreter's memory objects contain mp_integers that represent variable-...
mp_integer return_value_address
inverse_memory_mapt inverse_memory_map
void clear_input_flags()
Clears memoy r/w flag initialization.
void read(const mp_integer &address, mp_vectort &dest) const
Reads a memory address and loads it into the dest variable.
instructionst::const_iterator const_targett
const_iteratort find(uint64_t idx)
function_assignmentst return_assignments
mp_integer address_to_offset(const mp_integer &address) const
goto_functionst::function_mapt::const_iterator return_function
std::pair< const irep_idt, const irep_idt > struct_member_idt
output_valuest output_values
std::stack< stack_framet > call_stackt
list_input_varst function_input_vars
bool byte_offset_to_memory_offset(const typet &source_type, const mp_integer &byte_offset, mp_integer &result)
Supposing the caller has an mp_vector representing a value with type 'source_type',...
mp_vectort evaluate(const exprt &)
Evaluate an expression.
std::map< irep_idt, exprt > input_valuest
std::map< std::string, const irep_idt & > parameter_sett
goto_programt::const_targett return_pc
mp_integer evaluate_address(const exprt &expr, bool fail_quietly=false)
void initialize(bool init)
Initializes the memory map of the interpreter and [optionally] runs up to the entry point (thus doing...