@@ -37,8 +37,7 @@ class side_effect_exprt;
3737class symex_targett ;
3838class typecast_exprt ;
3939
40- /* ! \brief The main class for the forward symbolic simulator
41- */
40+ // / \brief The main class for the forward symbolic simulator
4241class goto_symext
4342{
4443public:
@@ -68,17 +67,23 @@ class goto_symext
6867
6968 typedef goto_symex_statet statet;
7069
71- /* * symex all at once, starting from entry point */
72- virtual void operator ()(
70+ // / \brief symex entire program starting from entry point
71+ // /
72+ // / The state that goto_symext maintains has a large memory footprint.
73+ // / This method deallocates the state as soon as symbolic execution
74+ // / has completed, so use it if you don't care about having the state
75+ // / around afterwards.
76+ virtual void symex_from_entry_point_of (
7377 const goto_functionst &goto_functions);
7478
75- /* * symex starting from given goto program */
76- virtual void operator ()(
77- const goto_functionst &goto_functions,
78- const goto_programt &goto_program);
79-
80- /* * start symex in a given state */
81- virtual void operator ()(
79+ // // \brief symex entire program starting from entry point
80+ // /
81+ // / This method uses the `state` argument as the symbolic execution
82+ // / state, which is useful for examining the state after this method
83+ // / returns. The state that goto_symext maintains has a large memory
84+ // / footprint, so if keeping the state around is not necessary,
85+ // / clients should instead call goto_symext::symex_from_entry_point_of().
86+ virtual void symex_with_state (
8287 statet &state,
8388 const goto_functionst &goto_functions,
8489 const goto_programt &goto_program);
@@ -91,20 +96,21 @@ class goto_symext
9196 // / \param goto_functions GOTO model to symex.
9297 // / \param first Entry point in form of a first instruction.
9398 // / \param limit Final instruction, which itself will not be symexed.
94- virtual void operator () (
99+ virtual void symex_instruction_range (
95100 statet &state,
96101 const goto_functionst &goto_functions,
97102 goto_programt::const_targett first,
98103 goto_programt::const_targett limit);
99104
105+ protected:
100106 // / Initialise the symbolic execution and the given state with <code>pc</code>
101107 // / as entry point.
102108 // / \param state Symex state to initialise.
103109 // / \param goto_functions GOTO model to symex.
104110 // / \param pc first instruction to symex
105111 // / \param limit final instruction, which itself will not
106112 // / be symexed.
107- void symex_entry_point (
113+ void initialize_entry_point (
108114 statet &state,
109115 const goto_functionst &goto_functions,
110116 goto_programt::const_targett pc,
@@ -122,6 +128,7 @@ class goto_symext
122128 const goto_functionst &goto_functions,
123129 statet &state);
124130
131+ public:
125132 // these bypass the target maps
126133 virtual void symex_step_goto (statet &state, bool taken);
127134
0 commit comments