@@ -112,45 +112,67 @@ std::vector<std::pair<exprt, exprt>> get_shadow_dereference_candidates(
112
112
const typet &lhs_type,
113
113
bool &exact_match);
114
114
115
- // TODO: doxygen
115
+ // / Retrieves the value of the initialising expression.
116
+ // / \param field_name The name of the field whose value type we want to query.
117
+ // / \param state The symex_state within which the query is executed (the field's
118
+ // / value is looked up).
119
+ // / \returns The type of the value the field was initialised with (actually,
120
+ // / the type of the value the field currently is associated with, but it's
121
+ // / invariant since the declaration).
116
122
const typet &
117
123
get_field_init_type (const irep_idt &field_name, const goto_symex_statet &state);
118
124
119
- // TODO: doxygen
125
+ // / Given a pointer expression check to see if it can be a null pointer or an
126
+ // / invalid object within value_set.
127
+ // / \param address A pointer expressions that we are using as the query.
128
+ // / \param value_set The search space for the query.
129
+ // / \returns true if the object can be null or invalid in the value set, false
130
+ // / otherwise.
120
131
bool contains_null_or_invalid (
121
132
const std::vector<exprt> &value_set,
122
133
const exprt &address);
123
134
124
- // TODO: doxygen
135
+ // / Performs aggregation of the shadow memory field value over multiple cells
136
+ // / for fields whose type is _Bool.
125
137
exprt compute_or_over_cells (
126
138
const exprt &expr,
127
139
const typet &field_type,
128
140
const namespacet &ns,
129
141
const messaget &log,
130
142
const bool is_union);
131
143
132
- // TODO: doxygen
144
+ // / Performs aggregation of the shadow memory field value over multiple cells
145
+ // / for fields whose type is a signed/unsigned bitvector (where the value is
146
+ // / arbitrary up until the max represented by the bitvector size).
133
147
exprt compute_max_over_cells (
134
148
const exprt &expr,
135
149
const typet &field_type,
136
150
const namespacet &ns,
137
151
const messaget &log,
138
152
const bool is_union);
139
153
140
- // TODO: doxygen?
154
+ // / Build an if-then-else chain from a vector containing pairs of expressions.
155
+ // / \param conds_values Contains pairs <e1, e2>, where `e1` is going to be
156
+ // / used as an antecedent for an if_expr, and `e2` is going to be used
157
+ // / as the consequent.
158
+ // / \returns An if_exprt of the form `if e1 then e2 else <if e3 then e4 else ...`
141
159
exprt build_if_else_expr (
142
160
const std::vector<std::pair<exprt, exprt>> &conds_values);
143
161
144
- // TODO: improve?
145
- // / returns true if we attempt to set/get a field on a NULL pointer
162
+ // / Checks if given expression is a null pointer.
163
+ // / \ returns true if expr is a a NULL pointer within value_set.
146
164
bool set_field_check_null (
147
165
const namespacet &ns,
148
166
const messaget &log,
149
167
const std::vector<exprt> &value_set,
150
168
const exprt &expr);
151
169
152
- // TODO: improve?
153
- // / Used for set_field and shadow memory copy
170
+ // / Get shadow memory values for a given expression within a specified value
171
+ // / set.
172
+ // / \returns if potential values are present for that object inside the value
173
+ // / set, then we get back an `if e1 then e2 else (if e3 else e4...` expression,
174
+ // / where `e1`, `e3`, ... are guards (conditions) and `e2`, `e4`, etc are
175
+ // / the possible values of the object within the value set.
154
176
optionalt<exprt> get_shadow_memory (
155
177
const exprt &expr,
156
178
const std::vector<exprt> &value_set,
0 commit comments