Skip to content

Commit 756279a

Browse files
author
Owen Jones
committed
Address more review comments
1 parent b2f3157 commit 756279a

File tree

3 files changed

+45
-42
lines changed

3 files changed

+45
-42
lines changed

src/analyses/ai.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jsont ai_baset::output_json(
8585
/// Output the domains for a single function as JSON
8686
/// \param ns: The namespace
8787
/// \param goto_program: The goto program
88-
/// \param identifier: the identifier used to find a symbol to identify the
88+
/// \param identifier: The identifier used to find a symbol to identify the
8989
/// source language
9090
/// \return The JSON object
9191
jsont ai_baset::output_json(
@@ -144,7 +144,7 @@ xmlt ai_baset::output_xml(
144144
/// Output the domains for a single function as XML
145145
/// \param ns: The namespace
146146
/// \param goto_program: The goto program
147-
/// \param identifier: the identifier used to find a symbol to identify the
147+
/// \param identifier: The identifier used to find a symbol to identify the
148148
/// source language
149149
/// \return The XML object
150150
xmlt ai_baset::output_xml(
@@ -341,7 +341,7 @@ bool ai_baset::do_function_call(
341341

342342
if(!goto_function.body_available())
343343
{
344-
// if we don't have a body, we just do an edge call -> return
344+
// If we don't have a body, we just do an edge call -> return
345345
std::unique_ptr<statet> tmp_state(make_temporary_state(get_state(l_call)));
346346
tmp_state->transform(
347347
calling_function_identifier,

src/analyses/ai.h

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,21 @@ class ai_baset
9696
/// use \ref get_state or \ref find_state to access the actual underlying
9797
/// state.
9898
/// PRECONDITION(l is dereferenceable)
99-
/// \param l: The location we want the domain before
100-
/// \return The domain before `l`. We return a pointer to a copy as the method
101-
/// should be const and there are some non-trivial cases including merging
102-
/// domains, etc.
99+
/// \param l: The location before which we want the abstract state
100+
/// \return The abstract state before `l`. We return a pointer to a copy as
101+
/// the method should be const and there are some non-trivial cases
102+
/// including merging abstract states, etc.
103103
virtual std::unique_ptr<statet> abstract_state_before(locationt l) const = 0;
104104

105105
/// Get a copy of the abstract state after the given instruction, without
106106
/// needing to know what kind of domain or history is used. Note: intended
107107
/// for users of the abstract interpreter; derived classes should
108108
/// use \ref get_state or \ref find_state to access the actual underlying
109109
/// state.
110-
/// \param l: The location we want the domain after
111-
/// \return The domain after `l`. We return a pointer to a copy as the method
112-
/// should be const and there are some non-trivial cases including merging
113-
/// domains, etc.
110+
/// \param l: The location before which we want the abstract state
111+
/// \return The abstract state after `l`. We return a pointer to a copy as
112+
/// the method should be const and there are some non-trivial cases
113+
/// including merging abstract states, etc.
114114
virtual std::unique_ptr<statet> abstract_state_after(locationt l) const
115115
{
116116
/// PRECONDITION(l is dereferenceable && std::next(l) is dereferenceable)
@@ -119,18 +119,18 @@ class ai_baset
119119
return abstract_state_before(std::next(l));
120120
}
121121

122-
/// Reset the domain
122+
/// Reset the abstract state
123123
virtual void clear()
124124
{
125125
}
126126

127-
/// Output the domains for a whole program
127+
/// Output the abstract states for a whole program
128128
virtual void output(
129129
const namespacet &ns,
130130
const goto_functionst &goto_functions,
131131
std::ostream &out) const;
132132

133-
/// Output the domains for a whole program
133+
/// Output the abstract states for a whole program
134134
void output(
135135
const goto_modelt &goto_model,
136136
std::ostream &out) const
@@ -139,7 +139,7 @@ class ai_baset
139139
output(ns, goto_model.goto_functions, out);
140140
}
141141

142-
/// Output the domains for a function
142+
/// Output the abstract states for a function
143143
void output(
144144
const namespacet &ns,
145145
const goto_programt &goto_program,
@@ -148,7 +148,7 @@ class ai_baset
148148
output(ns, goto_program, "", out);
149149
}
150150

151-
/// Output the domains for a function
151+
/// Output the abstract states for a function
152152
void output(
153153
const namespacet &ns,
154154
const goto_functionst::goto_functiont &goto_function,
@@ -157,57 +157,57 @@ class ai_baset
157157
output(ns, goto_function.body, "", out);
158158
}
159159

160-
/// Output the domains for the whole program as JSON
160+
/// Output the abstract states for the whole program as JSON
161161
virtual jsont output_json(
162162
const namespacet &ns,
163163
const goto_functionst &goto_functions) const;
164164

165-
/// Output the domains for a whole program as JSON
165+
/// Output the abstract states for a whole program as JSON
166166
jsont output_json(
167167
const goto_modelt &goto_model) const
168168
{
169169
const namespacet ns(goto_model.symbol_table);
170170
return output_json(ns, goto_model.goto_functions);
171171
}
172172

173-
/// Output the domains for a single function as JSON
173+
/// Output the abstract states for a single function as JSON
174174
jsont output_json(
175175
const namespacet &ns,
176176
const goto_programt &goto_program) const
177177
{
178178
return output_json(ns, goto_program, "");
179179
}
180180

181-
/// Output the domains for a single function as JSON
181+
/// Output the abstract states for a single function as JSON
182182
jsont output_json(
183183
const namespacet &ns,
184184
const goto_functionst::goto_functiont &goto_function) const
185185
{
186186
return output_json(ns, goto_function.body, "");
187187
}
188188

189-
/// Output the domains for the whole program as XML
189+
/// Output the abstract states for the whole program as XML
190190
virtual xmlt output_xml(
191191
const namespacet &ns,
192192
const goto_functionst &goto_functions) const;
193193

194-
/// Output the domains for the whole program as XML
194+
/// Output the abstract states for the whole program as XML
195195
xmlt output_xml(
196196
const goto_modelt &goto_model) const
197197
{
198198
const namespacet ns(goto_model.symbol_table);
199199
return output_xml(ns, goto_model.goto_functions);
200200
}
201201

202-
/// Output the domains for a single function as XML
202+
/// Output the abstract states for a single function as XML
203203
xmlt output_xml(
204204
const namespacet &ns,
205205
const goto_programt &goto_program) const
206206
{
207207
return output_xml(ns, goto_program, "");
208208
}
209209

210-
/// Output the domains for a single function as XML
210+
/// Output the abstract states for a single function as XML
211211
xmlt output_xml(
212212
const namespacet &ns,
213213
const goto_functionst::goto_functiont &goto_function) const
@@ -216,30 +216,33 @@ class ai_baset
216216
}
217217

218218
protected:
219-
/// Initialize all the domains for a single function. Override this to do
220-
/// custom per-domain initialization.
219+
/// Initialize all the abstract states for a single function. Override this to
220+
/// do custom per-domain initialization.
221221
virtual void initialize(const goto_programt &goto_program);
222222

223-
/// Initialize all the domains for a single function.
223+
/// Initialize all the abstract states for a single function.
224224
virtual void initialize(const goto_functionst::goto_functiont &goto_function);
225225

226-
/// Initialize all the domains for a whole program. Override this to do custom
227-
/// per-analysis initialization.
226+
/// Initialize all the abstract states for a whole program. Override this to
227+
/// do custom per-analysis initialization.
228228
virtual void initialize(const goto_functionst &goto_functions);
229229

230-
/// Override this to add a cleanup step after fixedpoint has run
230+
/// Override this to add a cleanup or post-processing step after fixedpoint
231+
/// has run
231232
virtual void finalize();
232233

233-
/// Ensure the entry point to a single function has a reasonable state
234-
void entry_state(const goto_programt &goto_functions);
234+
/// Set the abstract state of the entry location of a single function to the
235+
/// entry state required by the analysis
236+
void entry_state(const goto_programt &goto_program);
235237

236-
/// Ensure the entry point to a whole program has a reasonable state
237-
void entry_state(const goto_functionst &goto_program);
238+
/// Set the abstract state of the entry location of a whole program to the
239+
/// entry state required by the analysis
240+
void entry_state(const goto_functionst &goto_functions);
238241

239-
/// Output the domains for a single function
242+
/// Output the abstract states for a single function
240243
/// \param ns: The namespace
241244
/// \param goto_program: The goto program
242-
/// \param identifier: the identifier used to find a symbol to identify the
245+
/// \param identifier: The identifier used to find a symbol to identify the
243246
/// source language
244247
/// \param out: The ostream to direct output to
245248
virtual void output(
@@ -248,21 +251,21 @@ class ai_baset
248251
const irep_idt &identifier,
249252
std::ostream &out) const;
250253

251-
/// Output the domains for a single function as JSON
254+
/// Output the abstract states for a single function as JSON
252255
/// \param ns: The namespace
253256
/// \param goto_program: The goto program
254-
/// \param identifier: the identifier used to find a symbol to identify the
257+
/// \param identifier: The identifier used to find a symbol to identify the
255258
/// source language
256259
/// \return The JSON object
257260
virtual jsont output_json(
258261
const namespacet &ns,
259262
const goto_programt &goto_program,
260263
const irep_idt &identifier) const;
261264

262-
/// Output the domains for a single function as XML
265+
/// Output the abstract states for a single function as XML
263266
/// \param ns: The namespace
264267
/// \param goto_program: The goto program
265-
/// \param identifier: the identifier used to find a symbol to identify the
268+
/// \param identifier: The identifier used to find a symbol to identify the
266269
/// source language
267270
/// \return The XML object
268271
virtual xmlt output_xml(

src/analyses/ai_domain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ xmlt ai_domain_baset::output_xml(const ai_baset &ai, const namespacet &ns) const
3535
/// an assignment. This for example won't simplify symbols to their values, but
3636
/// does simplify indices in arrays, members of structs and dereferencing of
3737
/// pointers
38-
/// \param condition: the expression to simplify
39-
/// \param ns: the namespace
38+
/// \param condition: The expression to simplify
39+
/// \param ns: The namespace
4040
/// \return True if condition did not change. False otherwise. condition will be
4141
/// updated with the simplified condition if it has worked
4242
bool ai_domain_baset::ai_simplify_lhs(exprt &condition, const namespacet &ns)

0 commit comments

Comments
 (0)