1
1
/*******************************************************************\
2
2
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).
5
7
6
8
Author: Daniel Kroening, Michael Tautschnig
7
9
@@ -10,7 +12,10 @@ Date: November 2011
10
12
\*******************************************************************/
11
13
12
14
/// \file
13
- /// Nondeterministic initialization of certain global scope variables
15
+ /// Nondeterministically initializes global scope variables, except for
16
+ /// constants (such as string literals, final fields) and internal variables
17
+ /// (such as CPROVER and symex variables, language specific internal
18
+ /// variables).
14
19
15
20
#include "nondet_static.h"
16
21
@@ -50,7 +55,13 @@ bool is_nondet_initializable_static(
50
55
!is_constant_or_has_constant_components(ns.lookup(id).type, ns);
51
56
}
52
57
53
-
58
+ /// Nondeterministically initializes global scope variables in a goto-function.
59
+ /// Iterates over instructions in the specified function and replaces all values
60
+ /// assigned to nondet-initializable static variables with nondeterministic
61
+ /// values.
62
+ /// \param ns Namespace for resolving type information.
63
+ /// \param [out] goto_functions Existing goto-functions to be updated.
64
+ /// \param fct_name Name of the goto-function to be updated.
54
65
void nondet_static(
55
66
const namespacet &ns,
56
67
goto_functionst &goto_functions,
@@ -94,6 +105,10 @@ void nondet_static(
94
105
}
95
106
}
96
107
108
+ /// Nondeterministically initializes global scope variables in
109
+ /// CPROVER_initialize function.
110
+ /// \param ns Namespace for resolving type information.
111
+ /// \param [out] goto_functions Existing goto-functions to be updated.
97
112
void nondet_static(
98
113
const namespacet &ns,
99
114
goto_functionst &goto_functions)
@@ -104,6 +119,11 @@ void nondet_static(
104
119
goto_functions.update();
105
120
}
106
121
122
+ /// Main entry point of the module. Nondeterministically initializes global
123
+ /// scope variables, except for constants (such as string literals, final
124
+ /// fields) and internal variables (such as CPROVER and symex variables,
125
+ /// language specific internal variables).
126
+ /// \param [out] goto_model Existing goto-model to be updated.
107
127
void nondet_static(goto_modelt &goto_model)
108
128
{
109
129
const namespacet ns(goto_model.symbol_table);
0 commit comments