Skip to content

Commit 8230504

Browse files
author
svorenova
committed
Document nondet-static functions
1 parent cbb5fba commit 8230504

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

src/goto-instrument/nondet_static.cpp

Lines changed: 24 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,10 @@ Date: November 2011
1012
\*******************************************************************/
1113

1214
/// \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).
1419

1520
#include "nondet_static.h"
1621

@@ -50,7 +55,13 @@ bool is_nondet_initializable_static(
5055
!is_constant_or_has_constant_components(ns.lookup(id).type, ns);
5156
}
5257

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.
5465
void nondet_static(
5566
const namespacet &ns,
5667
goto_functionst &goto_functions,
@@ -94,6 +105,10 @@ void nondet_static(
94105
}
95106
}
96107

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.
97112
void nondet_static(
98113
const namespacet &ns,
99114
goto_functionst &goto_functions)
@@ -104,6 +119,11 @@ void nondet_static(
104119
goto_functions.update();
105120
}
106121

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.
107127
void nondet_static(goto_modelt &goto_model)
108128
{
109129
const namespacet ns(goto_model.symbol_table);

src/goto-instrument/nondet_static.h

Lines changed: 8 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,10 @@ Date: November 2011
1012
\*******************************************************************/
1113

1214
/// \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).
1419

1520
#ifndef CPROVER_GOTO_INSTRUMENT_NONDET_STATIC_H
1621
#define CPROVER_GOTO_INSTRUMENT_NONDET_STATIC_H

0 commit comments

Comments
 (0)