Skip to content

Commit 4d0e23b

Browse files
author
svorenova
committed
Document nondet-static functions
1 parent 4fff463 commit 4d0e23b

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

src/goto-instrument/nondet_static.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/*******************************************************************\
22
3-
Module: Nondeterministic initialization of certain global scope
4-
variables
3+
Module: Nondeterministically initializes global scope variables, except for
4+
constants (such as string literals, final fields) and internal variables
5+
(such as CPROVER and symex variables, language specific internal
6+
variables).
57
68
Author: Daniel Kroening, Michael Tautschnig
79
@@ -10,7 +12,7 @@ Date: November 2011
1012
\*******************************************************************/
1113

1214
/// \file
13-
/// Nondeterministic initialization of certain global scope variables
15+
/// Nondeterministic initialization of global scope variables
1416

1517
#include "nondet_static.h"
1618

@@ -50,7 +52,13 @@ bool is_nondet_initializable_static(
5052
!is_constant_or_has_constant_components(ns.lookup(id).type, ns);
5153
}
5254

53-
55+
/// Nondeterministically initializes global scope variables in a goto-function.
56+
/// Iterates over instructions in the specified function and replaces all values
57+
/// assigned to nondet-initializable static variables with nondeterministic
58+
/// values.
59+
/// \param ns Namespace for resolving type information.
60+
/// \param [out] goto_functions Existing goto-functions to be updated.
61+
/// \param fct_name Name of the goto-function to be updated.
5462
void nondet_static(
5563
const namespacet &ns,
5664
goto_functionst &goto_functions,
@@ -94,6 +102,10 @@ void nondet_static(
94102
}
95103
}
96104

105+
/// Nondeterministically initializes global scope variables in
106+
/// CPROVER_initialize function.
107+
/// \param ns Namespace for resolving type information.
108+
/// \param [out] goto_functions Existing goto-functions to be updated.
97109
void nondet_static(
98110
const namespacet &ns,
99111
goto_functionst &goto_functions)
@@ -104,6 +116,11 @@ void nondet_static(
104116
goto_functions.update();
105117
}
106118

119+
/// Main entry point of the module. Nondeterministically initializes global
120+
/// scope variables, except for constants (such as string literals, final
121+
/// fields) and internal variables (such as CPROVER and symex variables,
122+
/// language specific internal variables).
123+
/// \param [out] goto_model Existing goto-model to be updated.
107124
void nondet_static(goto_modelt &goto_model)
108125
{
109126
const namespacet ns(goto_model.symbol_table);

src/goto-instrument/nondet_static.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/*******************************************************************\
22
3-
Module: Nondeterministic initialization of certain global scope
4-
variables
3+
Module: Nondeterministically initializes global scope variables, except for
4+
constants (such as string literals, final fields) and internal variables
5+
(such as CPROVER and symex variables, language specific internal
6+
variables).
57
68
Author: Daniel Kroening, Michael Tautschnig
79
@@ -10,7 +12,7 @@ Date: November 2011
1012
\*******************************************************************/
1113

1214
/// \file
13-
/// Nondeterministic initialization of certain global scope variables
15+
/// Nondeterministic initialization of global scope variables
1416

1517
#ifndef CPROVER_GOTO_INSTRUMENT_NONDET_STATIC_H
1618
#define CPROVER_GOTO_INSTRUMENT_NONDET_STATIC_H

0 commit comments

Comments
 (0)