1#ifndef CPROVER_GOTO_SYMEX_GOTO_SYMEX_STATE_H
2#define CPROVER_GOTO_SYMEX_GOTO_SYMEX_STATE_H
78 typedef std::map<goto_programt::const_targett, merge_state_listt>
187 std::list<std::pair<goto_programt::const_targett, expr2tc>>
252 level1.thread_id = thread_id;
335 "activation record popped with unmerged path snapshots");
347 call_stack.size() >= 2,
"no caller frame beneath the current one");
366 unsigned int thread_id);
Thread-aware symex state explored by reachability_treet.
Definition execution_state.h:46
A generic container class for a control flow graph for one function, in the form of a goto-program.
Definition goto_program.h:63
instructionst::const_iterator const_targett
Definition goto_program.h:591
Stack frame tracking class.
Definition goto_symex_state.h:161
void decrease_stack_frame_size(const expr2tc &expr)
Decrease the stack frame size when the variables go out of scope.
Definition symex_stack.cpp:10
BigInt stack_frame_total
The stack size of the frame.
Definition goto_symex_state.h:243
framet(unsigned int thread_id, const namespacet *ns=nullptr)
Definition goto_symex_state.h:245
irep_idt function_identifier
Name of function called to make this stack frame.
Definition goto_symex_state.h:164
symex_targett::sourcet calling_location
Record of source of function call.
Definition goto_symex_state.h:173
goto_programt::const_targett function_ptr_combine_target
Function pointer call merge point.
Definition goto_symex_state.h:195
merge_state_mapt merge_state_map
Map of symbolic snapshots to merge in the future.
Definition goto_symex_state.h:168
variable_name_sett declaration_history
Set of variables names that have been declared.
Definition goto_symex_state.h:217
std::list< std::pair< goto_programt::const_targett, expr2tc > > cur_function_ptr_targets
List of function pointer targets.
Definition goto_symex_state.h:188
unsigned int va_index
Record the first va_args index used in this function call, if any, otherwise UINT_MAX.
Definition goto_symex_state.h:227
variable_name_sett local_variables
Set of local variable l1 names.
Definition goto_symex_state.h:219
bool hidden
Record if the function body is hidden.
Definition goto_symex_state.h:240
unsigned int va_cursor
Cursor into this activation's va_args, advanced by each va_arg use.
Definition goto_symex_state.h:234
renaming::level1t level1
Renaming context for L1 names.
Definition goto_symex_state.h:170
expr2tc return_value
Expression to assign return values to.
Definition goto_symex_state.h:180
goto_programt::const_targett function_ptr_call_loc
Instruction where function pointer calls should seem to originate from.
Definition goto_symex_state.h:191
std::vector< expr2tc > alloca_objects
Pointers returned by alloca in this frame; their objects die when the frame returns,...
Definition goto_symex_state.h:222
expr2tc orig_func_ptr_call
Original function pointer call code.
Definition goto_symex_state.h:198
void grow_stack_frame(const expr2tc &expr)
Add the storage expr occupies, in bits, to this frame's running total.
Definition symex_stack.cpp:5
goto_programt::const_targett end_of_function
End of function instruction location.
Definition goto_symex_state.h:177
guard2tc entry_guard
Record the entry guard of the function.
Definition goto_symex_state.h:237
Snapshot of the symbolic data needed to merge a deferred path.
Definition goto_symex_state.h:100
variable_name_sett local_variables
Definition goto_symex_state.h:109
unsigned int thread_id
Definition goto_symex_state.h:107
std::shared_ptr< renaming::level2t > level2_ptr
Definition goto_symex_state.h:103
merge_statet & operator=(const merge_statet &)
Definition goto_symex_state.h:141
unsigned num_instructions
Definition goto_symex_state.h:102
value_sett value_set
Definition goto_symex_state.h:105
merge_statet(const goto_symex_statet &s)
Definition goto_symex_state.h:114
BigInt stack_frame_total
Definition goto_symex_state.h:112
std::shared_ptr< void > interval_snapshot
Definition goto_symex_state.h:111
renaming::level2t & level2
Definition goto_symex_state.h:104
renaming::level1t::current_namest level1_names
Definition goto_symex_state.h:108
guard2tc guard
Definition goto_symex_state.h:106
merge_statet(const merge_statet &s)
Definition goto_symex_state.h:127
expr2tc shallow_array_update(const expr2tc &rhs, const expr2tc &l1_lhs) const
rhs with the earlier writes under its top-level array with replaced by l1_lhs, when they all write th...
Definition goto_symex_state.cpp:957
bool thread_ended
Flag indicating this thread has stopped executing.
Definition goto_symex_state.h:483
void current_name(expr2tc &symirep) const
Perform both levels of renaming.
Definition goto_symex_state.h:262
std::unordered_map< unsigned, BigInt > loop_iterationst
Record of how many loop unwinds we've performed.
Definition goto_symex_state.h:499
bool no_propagation
Flag saying constant propagation was disabled with –no-propagation.
Definition goto_symex_state.h:509
std::map< irep_idt, unsigned > variable_instance_nums
Counter for how many times a particular variable has been declared: becomes the l1 renaming number in...
Definition goto_symex_state.h:495
std::list< merge_statet > merge_state_listt
Definition goto_symex_state.h:77
void rename_type(expr2tc &expr)
Definition goto_symex_state.cpp:980
void current_name(const renaming::level2t &plevel2, expr2tc &symirep) const
Perform both levels of renaming.
Definition goto_symex_state.h:272
size_t cur_seg
Definition goto_symex_state.h:530
void rename(expr2tc &expr)
Perform both levels of renaming on an expression.
Definition goto_symex_state.cpp:1078
std::vector< framet > call_stackt
Definition goto_symex_state.h:80
void current_name(const merge_statet &merge_state, expr2tc &symirep) const
Perform both levels of renaming.
Definition goto_symex_state.h:284
void advance_witness_position()
Definition goto_symex_state.cpp:1320
framet & new_frame(unsigned int thread_id)
Push a new fresh stack frame on the stack.
Definition goto_symex_state.h:320
std::unordered_map< irep_idt, bool > cycle_branch_map
Pre-built O(1) lookup for branching(cycle) waypoints.
Definition goto_symex_state.h:540
unsigned num_instructions
Number of instructions executed in this thread.
Definition goto_symex_state.h:480
goto_symex_statet(renaming::level2t &l2, value_sett &vs, const namespacet &_ns, bool no_propagation)
Default constructor.
Definition goto_symex_state.cpp:17
bool witness_target_reached
Set to true the first time the target assertion is allowed through.
Definition goto_symex_state.h:534
persistent_set< renaming::level2t::name_record, renaming::level2t::name_rec_hash > variable_name_sett
Definition goto_symex_state.h:84
const framet & previous_frame()
Return stack frame of previous function call.
Definition goto_symex_state.h:342
bool constant_propagation_reference(const expr2tc &expr) const
Decide whether to constant_propagate an address_of.
Definition goto_symex_state.cpp:877
framet & top()
Fetch topmost stack frame.
Definition goto_symex_state.h:295
call_stackt call_stack
Stack of framet's recording current function call stack.
Definition goto_symex_state.h:516
guard2tc guard
Current state guard of this thread.
Definition goto_symex_state.h:486
loop_iterationst loop_iterations
Definition goto_symex_state.h:500
void rename_array_sizes(type2tc &type)
Definition goto_symex_state.cpp:1006
std::vector< stack_framet > gen_stack_trace() const
Generate a stack trace as a vector of stack_framet, one per function invocation on the current call s...
Definition goto_symex_state.cpp:1291
void pop_frame()
Clear topmost stackframe from the stack.
Definition goto_symex_state.h:329
bool constant_propagation(const expr2tc &expr) const
Determine whether to constant propagate the value of an expression.
Definition goto_symex_state.cpp:382
goto_symex_statet(goto_symex_statet const &)=default
renaming::level2t & level2
Reference to global l2 state.
Definition goto_symex_state.h:511
std::vector< std::vector< waypoint > > witness_segs
witness_segs[seg]: all actionable waypoints per segment
Definition goto_symex_state.h:529
goto_symex_statet & operator=(const goto_symex_statet &state)
Definition goto_symex_state.cpp:41
guard2tc global_guard
Guard of global context.
Definition goto_symex_state.h:488
BigInt total_stack_size() const
Storage, in bits, held by every activation record currently on the call stack.
Definition symex_stack.cpp:19
expr2tc pin_symbolic_updates(const expr2tc &rhs, const expr2tc &l2_lhs) const
Re-offer the with updates of rhs that constant_propagation refuses as reads of l2_lhs,...
Definition goto_symex_state.cpp:841
void print_stack_trace(unsigned int indent, std::ostream &os) const
Print stack trace of state to an output stream.
Definition goto_symex_state.cpp:1252
const namespacet & ns
Namespace to work with.
Definition goto_symex_state.h:519
const framet & top() const
Definition goto_symex_state.h:301
void assignment(expr2tc &lhs, const expr2tc &rhs)
Make an L2 and value set assignment.
Definition goto_symex_state.cpp:898
void rename_address(expr2tc &expr)
Perform renaming of contents of an address_of operation.
Definition goto_symex_state.cpp:1110
symex_targett::sourcet source
Current program location of this thread.
Definition goto_symex_state.h:490
std::map< irep_idt, BigInt > function_unwind
Record of how many times we've unwound function recursion.
Definition goto_symex_state.h:502
void rename_quantified(expr2tc &expr, const std::set< irep_idt > &bound)
Rename an expression occurring under quantifiers, stopping at L1 for the variables they bind so those...
Definition goto_symex_state.cpp:1023
std::map< goto_programt::const_targett, merge_state_listt > merge_state_mapt
Definition goto_symex_state.h:79
bool use_value_set
Flag saying whether to maintain pointer value set tracking.
Definition goto_symex_state.h:505
std::map< expr2tc, unsigned > realloc_map
Map of what pointer values have been realloc'd, and what their new realloc number is.
Definition goto_symex_state.h:524
void get_original_name(expr2tc &expr) const
Fetch an original l0 identifer.
Definition goto_symex_state.cpp:1238
value_sett & value_set
Reference to global pointer tracking state.
Definition goto_symex_state.h:513
void fixup_renamed_type(expr2tc &expr, const type2tc &orig_type)
Fixup types after renaming: we might rename a symbol that we believe to be a uint32_t ptr,...
Definition goto_symex_state.cpp:1178
Path-condition guard container.
Definition irep2_guard.h:32
Definition namespace.h:10
Persistent set with O(1) copy, the value-less analogue of persistent_map.
Definition persistent_map.h:145
Definition renaming.h:147
Definition value_set.h:64
Classes and definitions for non-stringy internal representation.
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
@ level1
Definition irep2_expr.h:56
#define UINT_MAX
Definition limits.h:32
@ l2
Definition numpy_call_expr.cpp:2086
void initialize()
Definition solidity_misc.c:90
#define false
Definition stdbool.h:10
void abort(void)
Definition stdlib.c:77
persistent_map< name_record, unsigned, name_rec_hash > current_namest
Definition renaming.h:98
void get_ident_name(expr2tc &symbol) const override
Definition renaming.cpp:43
Definition renaming.h:230
Definition renaming.h:140
void get_ident_name(expr2tc &symbol) const override
Definition renaming.cpp:71
Definition symex_target.h:31
#define SYMEX_INVARIANT(condition, reason)
Definition symex_invariant.h:18