@@ -20,18 +20,9 @@ Author: Daniel Kroening
20
20
21
21
#include " json_goto_trace.h"
22
22
23
- /* ******************************************************************\
24
-
25
- Function: remove_pointer_offsets
26
-
27
- Inputs:
28
- src - an expression
29
-
30
- Purpose: Replaces in src, expressions of the form pointer_offset(constant)
31
- by that constant.
32
-
33
- \*******************************************************************/
34
-
23
+ // / Replaces in src, expressions of the form pointer_offset(constant) by that
24
+ // / constant.
25
+ // / \param src: an expression
35
26
void remove_pointer_offsets (exprt &src)
36
27
{
37
28
if (src.id ()==ID_pointer_offset && src.op0 ().id ()==ID_constant)
@@ -41,20 +32,10 @@ void remove_pointer_offsets(exprt &src)
41
32
remove_pointer_offsets (op);
42
33
}
43
34
44
- /* ******************************************************************\
45
-
46
- Function: remove_pointer_offsets
47
-
48
- Inputs:
49
- src - an expression
50
- array_symbol - a symbol expression representing an array
51
-
52
- Purpose: Replaces in src, expressions of the form
53
- pointer_offset(array_symbol) by a constant value of 0.
54
- This is meant to simplify array expressions.
55
-
56
- \*******************************************************************/
57
-
35
+ // / Replaces in src, expressions of the form pointer_offset(array_symbol) by a
36
+ // / constant value of 0. This is meant to simplify array expressions.
37
+ // / \param src: an expression
38
+ // / \param array_symbol: a symbol expression representing an array
58
39
void remove_pointer_offsets (exprt &src, const symbol_exprt &array_symbol)
59
40
{
60
41
if (src.id ()==ID_pointer_offset &&
@@ -74,23 +55,13 @@ void remove_pointer_offsets(exprt &src, const symbol_exprt &array_symbol)
74
55
remove_pointer_offsets (op, array_symbol);
75
56
}
76
57
77
- /* ******************************************************************\
78
-
79
- Function: simplify_index
80
-
81
- Inputs:
82
- idx - an expression representing an index in an array
83
- out - a reference to an unsigned value of type size_t, which will
84
- hold the result of the simplification if it is successful
85
-
86
- Outputs: Boolean flag that is true if the `idx` expression could not be
87
- simplified into a unsigned constant value.
88
-
89
- Purpose: Simplify the expression in index as much as possible to try
90
- to get an unsigned constant.
91
-
92
- \*******************************************************************/
93
-
58
+ // / Simplify the expression in index as much as possible to try to get an
59
+ // / unsigned constant.
60
+ // / \param idx: an expression representing an index in an array
61
+ // / \param out: a reference to an unsigned value of type size_t, which will hold
62
+ // / the result of the simplification if it is successful
63
+ // / \return Boolean flag that is true if the `idx` expression could not be
64
+ // / simplified into a unsigned constant value.
94
65
bool simplify_index (const exprt &idx, std::size_t &out)
95
66
{
96
67
if (idx.id ()==ID_constant)
@@ -115,20 +86,10 @@ bool simplify_index(const exprt &idx, std::size_t &out)
115
86
return true ;
116
87
}
117
88
118
- /* ******************************************************************\
119
-
120
- Function: simplify_array_access
121
-
122
- Inputs:
123
- src - an expression potentialy containing array accesses (index_expr)
124
-
125
- Outputs: an expression similar in meaning to src but where array accesses
126
- have been simplified
127
-
128
- Purpose: Simplify an expression before putting it in the json format
129
-
130
- \*******************************************************************/
131
-
89
+ // / Simplify an expression before putting it in the json format
90
+ // / \param src: an expression potentialy containing array accesses (index_expr)
91
+ // / \return an expression similar in meaning to src but where array accesses
92
+ // / have been simplified
132
93
exprt simplify_array_access (const exprt &src)
133
94
{
134
95
if (src.id ()==ID_index && to_index_expr (src).array ().id ()==ID_symbol)
@@ -154,22 +115,11 @@ exprt simplify_array_access(const exprt &src)
154
115
return src;
155
116
}
156
117
157
- /* ******************************************************************\
158
-
159
- Function: convert
160
-
161
- Inputs:
162
- ns - a namespace
163
- goto_trace - a trace in a goto program
164
- dest - referecence to a json object in which the goto trace will
165
- be added
166
-
167
- Outputs: none
168
-
169
- Purpose: Produce a json representation of a trace.
170
-
171
- \*******************************************************************/
172
-
118
+ // / Produce a json representation of a trace.
119
+ // / \param ns: a namespace
120
+ // / \param goto_trace: a trace in a goto program
121
+ // / \param dest: referecence to a json object in which the goto trace will be
122
+ // / added
173
123
void convert (
174
124
const namespacet &ns,
175
125
const goto_tracet &goto_trace,
0 commit comments