Skip to content

Commit f7d8891

Browse files
Document symex_function_call functions
This documents (mostly in goto_symex.h) functions that are defined in symex_function_call.cpp.
1 parent 2a5a754 commit f7d8891

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/goto-symex/goto_symex.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,25 +271,41 @@ class goto_symext
271271

272272
virtual void loop_bound_exceeded(statet &, const exprt &guard);
273273

274-
// function calls
274+
/// Assuming \p state is currently pointing on a return instruction, assign
275+
/// the value in that return to the top frame's \p return_value field.
275276
void return_assignment(statet &);
276277

277278
virtual void no_body(const irep_idt &)
278279
{
279280
}
280281

282+
/// Symbolic execution of a function call.
283+
/// Only functions that are symbols are supported, see
284+
/// \link goto_symext::symex_function_call_symbol \endlink
281285
virtual void symex_function_call(
282286
const get_goto_functiont &,
283287
statet &,
284288
const code_function_callt &);
285289

286290
virtual void symex_end_of_function(statet &);
287291

292+
/// Symbolic execution of a call to a function call.
293+
/// For functions \c CBMC_trace and functions starting with \c __CPROVER_fkt
294+
/// see \link goto_symext::symex_trace \endlink and
295+
/// \link goto_symext::symex_fkt \endlink.
296+
/// For non-special functions see
297+
/// \link goto_symext::symex_function_call_code \endlink
288298
virtual void symex_function_call_symbol(
289299
const get_goto_functiont &,
290300
statet &,
291301
const code_function_callt &);
292302

303+
/// Symbolic execution of a function call by inlining.
304+
/// Records the call in \p target by appending a function call step and:
305+
/// - if the body is available create a new frame, assigns the parameters,
306+
/// and proceed to executing the code of the function.
307+
/// - otherwise assign a nondetministic value to the left-hand-side of the
308+
/// call when there is one
293309
virtual void symex_function_call_code(
294310
const get_goto_functiont &,
295311
statet &,
@@ -300,6 +316,12 @@ class goto_symext
300316
unsigned thread_nr,
301317
unsigned unwind);
302318

319+
/// Iterates over \p arguments and assign them to the parameters, which are
320+
/// symbols whose name and type are deduce from the type of \p goto_function.
321+
/// \param function_identifier: name of the function
322+
/// \param goto_function: function whose parameters we want to assign
323+
/// \param [out] state: state of the goto program
324+
/// \param arguments: arguments that are passed to the function
303325
void parameter_assignments(
304326
const irep_idt &function_identifier,
305327
const goto_functionst::goto_functiont &,

src/goto-symex/symex_function_call.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ void goto_symext::symex_function_call_symbol(
226226
symex_function_call_code(get_goto_function, state, code);
227227
}
228228

229-
/// do function call by inlining
230229
void goto_symext::symex_function_call_code(
231230
const get_goto_functiont &get_goto_function,
232231
statet &state,

0 commit comments

Comments
 (0)