CBMC
frame.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Symbolic Execution
4 
5 Author: Romain Brenguier, romain.brenguier@diffblue.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_SYMEX_FRAME_H
13 #define CPROVER_GOTO_SYMEX_FRAME_H
14 
15 #include "goto_state.h"
16 #include "symex_target.h"
17 
18 #include <analyses/lexical_loops.h>
19 
21 struct framet
22 {
23  // gotos
25  std::list<std::pair<symex_targett::sourcet, goto_statet>>;
26 
27  // function calls
29  std::map<
35  std::vector<irep_idt> parameter_names;
38  exprt call_lhs = nil_exprt(); // cleaned, but not renamed
39  std::optional<symbol_exprt> return_value_symbol; // not renamed
40  bool hidden_function = false;
41 
43 
44  std::set<irep_idt> local_objects;
45 
46  // exceptions
47  std::map<irep_idt, goto_programt::targett> catch_map;
48 
49  // loop and recursion unwinding
50  struct loop_infot
51  {
52  unsigned count = 0;
53  bool is_recursion = false;
54  };
55 
57  {
58  public:
59  explicit active_loop_infot(lexical_loopst::loopt &_loop) : loop(_loop)
60  {
61  }
62 
64  std::size_t children_too_complex = 0;
65 
67  std::vector<std::reference_wrapper<lexical_loopst::loopt>>
69 
70  // Loop information.
72  };
73 
74  std::shared_ptr<lexical_loopst> loops_info;
75  std::vector<active_loop_infot> active_loops;
76 
77  std::unordered_map<irep_idt, loop_infot> loop_iterations;
78 
79  framet(symex_targett::sourcet _calling_location, const guardt &state_guard)
80  : calling_location(std::move(_calling_location)),
81  guard_at_function_start(state_guard)
82  {
83  }
84 };
85 
86 #endif // CPROVER_GOTO_SYMEX_FRAME_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
Base class for all expressions.
Definition: expr.h:56
active_loop_infot(lexical_loopst::loopt &_loop)
Definition: frame.h:59
std::size_t children_too_complex
Incremental counter on how many branches this loop has had killed.
Definition: frame.h:64
lexical_loopst::loopt & loop
Definition: frame.h:71
std::vector< std::reference_wrapper< lexical_loopst::loopt > > blacklisted_loops
Set of loop ID's that have been blacklisted.
Definition: frame.h:68
Stack frames – these are used for function calls and for exceptions.
Definition: solver_types.h:41
std::map< irep_idt, goto_programt::targett > catch_map
Definition: frame.h:47
std::vector< active_loop_infot > active_loops
Definition: frame.h:75
guardt guard_at_function_start
Definition: frame.h:36
std::list< std::pair< symex_targett::sourcet, goto_statet > > goto_state_listt
Definition: frame.h:25
std::optional< symbol_exprt > return_value_symbol
Definition: frame.h:39
exprt call_lhs
Definition: frame.h:38
symex_targett::sourcet calling_location
Definition: frame.h:34
std::unordered_map< irep_idt, loop_infot > loop_iterations
Definition: frame.h:77
bool hidden_function
Definition: frame.h:40
std::vector< irep_idt > parameter_names
Definition: frame.h:35
symex_level1t old_level1
Definition: frame.h:42
goto_programt::const_targett end_of_function
Definition: frame.h:37
std::map< goto_programt::const_targett, goto_state_listt, goto_programt::target_less_than > goto_state_map
Definition: frame.h:33
std::set< irep_idt > local_objects
Definition: frame.h:44
framet(symex_targett::sourcet _calling_location, const guardt &state_guard)
Definition: frame.h:79
irep_idt function_identifier
Definition: frame.h:28
std::shared_ptr< lexical_loopst > loops_info
Definition: frame.h:74
instructionst::const_iterator const_targett
Definition: goto_program.h:615
A loop, specified as a set of instructions.
Definition: loop_analysis.h:24
The NIL expression.
Definition: std_expr.h:3073
goto_statet class definition
Compute lexical loops in a goto_function.
unsigned count
Definition: frame.h:52
bool is_recursion
Definition: frame.h:53
A total order over targett and const_targett.
Definition: goto_program.h:392
Functor to set the level 1 renaming of SSA expressions.
Identifies source in the context of symbolic execution.
Definition: symex_target.h:37
Generate Equation using Symbolic Execution.