@@ -112,45 +112,67 @@ std::vector<std::pair<exprt, exprt>> get_shadow_dereference_candidates(
112112 const typet &lhs_type,
113113 bool &exact_match);
114114
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).
116122const typet &
117123get_field_init_type (const irep_idt &field_name, const goto_symex_statet &state);
118124
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.
120131bool contains_null_or_invalid (
121132 const std::vector<exprt> &value_set,
122133 const exprt &address);
123134
124- // TODO: doxygen
135+ // / Performs aggregation of the shadow memory field value over multiple cells
136+ // / for fields whose type is _Bool.
125137exprt compute_or_over_cells (
126138 const exprt &expr,
127139 const typet &field_type,
128140 const namespacet &ns,
129141 const messaget &log,
130142 const bool is_union);
131143
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).
133147exprt compute_max_over_cells (
134148 const exprt &expr,
135149 const typet &field_type,
136150 const namespacet &ns,
137151 const messaget &log,
138152 const bool is_union);
139153
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 ...`
141159exprt build_if_else_expr (
142160 const std::vector<std::pair<exprt, exprt>> &conds_values);
143161
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.
146164bool set_field_check_null (
147165 const namespacet &ns,
148166 const messaget &log,
149167 const std::vector<exprt> &value_set,
150168 const exprt &expr);
151169
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.
154176optionalt<exprt> get_shadow_memory (
155177 const exprt &expr,
156178 const std::vector<exprt> &value_set,
0 commit comments