Skip to content

Commit f950ffc

Browse files
Documentation for json_goto_trace in doxygen format
1 parent 5cfa413 commit f950ffc

File tree

1 file changed

+23
-73
lines changed

1 file changed

+23
-73
lines changed

src/goto-programs/json_goto_trace.cpp

+23-73
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,9 @@ Author: Daniel Kroening
2020

2121
#include "json_goto_trace.h"
2222

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
3526
void remove_pointer_offsets(exprt &src)
3627
{
3728
if(src.id()==ID_pointer_offset && src.op0().id()==ID_constant)
@@ -41,20 +32,10 @@ void remove_pointer_offsets(exprt &src)
4132
remove_pointer_offsets(op);
4233
}
4334

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
5839
void remove_pointer_offsets(exprt &src, const symbol_exprt &array_symbol)
5940
{
6041
if(src.id()==ID_pointer_offset &&
@@ -74,23 +55,13 @@ void remove_pointer_offsets(exprt &src, const symbol_exprt &array_symbol)
7455
remove_pointer_offsets(op, array_symbol);
7556
}
7657

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.
9465
bool simplify_index(const exprt &idx, std::size_t &out)
9566
{
9667
if(idx.id()==ID_constant)
@@ -115,20 +86,10 @@ bool simplify_index(const exprt &idx, std::size_t &out)
11586
return true;
11687
}
11788

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
13293
exprt simplify_array_access(const exprt &src)
13394
{
13495
if(src.id()==ID_index && to_index_expr(src).array().id()==ID_symbol)
@@ -154,22 +115,11 @@ exprt simplify_array_access(const exprt &src)
154115
return src;
155116
}
156117

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
173123
void convert(
174124
const namespacet &ns,
175125
const goto_tracet &goto_trace,

0 commit comments

Comments
 (0)