Skip to content

Commit afc4663

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 1f6ca60 commit afc4663

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/goto-symex/goto_symex.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,42 @@ class goto_symext
275275

276276
virtual void loop_bound_exceeded(statet &, const exprt &guard);
277277

278-
// function calls
278+
/// Assuming the program counter of \p state is currently pointing to a return
279+
/// instruction, assign the value in that return to the top frame's
280+
/// \p return_value field.
279281
void return_assignment(statet &);
280282

281283
virtual void no_body(const irep_idt &)
282284
{
283285
}
284286

287+
/// Symbolic execution of a function call.
288+
/// Only functions that are symbols are supported, see
289+
/// \ref goto_symext::symex_function_call_symbol
285290
virtual void symex_function_call(
286291
const get_goto_functiont &,
287292
statet &,
288293
const code_function_callt &);
289294

290295
virtual void symex_end_of_function(statet &);
291296

297+
/// Symbolic execution of a call to a function call.
298+
/// For functions \c CBMC_trace and functions starting with \c __CPROVER_fkt
299+
/// see \ref goto_symext::symex_trace and
300+
/// \ref goto_symext::symex_fkt
301+
/// For non-special functions see
302+
/// \ref goto_symext::symex_function_call_code
292303
virtual void symex_function_call_symbol(
293304
const get_goto_functiont &,
294305
statet &,
295306
const code_function_callt &);
296307

308+
/// Symbolic execution of a function call by inlining.
309+
/// Records the call in \p target by appending a function call step and:
310+
/// - if the body is available create a new frame, assigns the parameters,
311+
/// and proceed to executing the code of the function.
312+
/// - otherwise assign a nondetministic value to the left-hand-side of the
313+
/// call when there is one
297314
virtual void symex_function_call_code(
298315
const get_goto_functiont &,
299316
statet &,
@@ -304,6 +321,12 @@ class goto_symext
304321
unsigned thread_nr,
305322
unsigned unwind);
306323

324+
/// Iterates over \p arguments and assigns them to the parameters, which are
325+
/// symbols whose name and type are deduced from the type of \p goto_function.
326+
/// \param function_identifier: name of the function
327+
/// \param goto_function: function whose parameters we want to assign
328+
/// \param [out] state: state of the goto program
329+
/// \param arguments: arguments that are passed to the function
307330
void parameter_assignments(
308331
const irep_idt &function_identifier,
309332
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)