6
6
7
7
\*******************************************************************/
8
8
9
+ // / \file
10
+ // / Abstract Interpretation
11
+
9
12
#include < cassert>
10
13
#include < memory>
11
14
16
19
17
20
#include " ai.h"
18
21
19
- /* ******************************************************************\
20
-
21
- Function: ai_baset::output
22
-
23
- Inputs:
24
-
25
- Outputs:
26
-
27
- Purpose:
28
-
29
- \*******************************************************************/
30
-
31
22
void ai_baset::output (
32
23
const namespacet &ns,
33
24
const goto_functionst &goto_functions,
@@ -47,18 +38,6 @@ void ai_baset::output(
47
38
}
48
39
}
49
40
50
- /* ******************************************************************\
51
-
52
- Function: ai_baset::output
53
-
54
- Inputs:
55
-
56
- Outputs:
57
-
58
- Purpose:
59
-
60
- \*******************************************************************/
61
-
62
41
void ai_baset::output (
63
42
const namespacet &ns,
64
43
const goto_programt &goto_program,
@@ -79,18 +58,9 @@ void ai_baset::output(
79
58
}
80
59
}
81
60
82
- /* ******************************************************************\
83
-
84
- Function: ai_baset::output_json
85
-
86
- Inputs: The namespace and goto_functions
87
-
88
- Outputs: The JSON object
89
-
90
- Purpose: Output the domains for the whole program as JSON
91
-
92
- \*******************************************************************/
93
-
61
+ // / Output the domains for the whole program as JSON
62
+ // / \par parameters: The namespace and goto_functions
63
+ // / \return The JSON object
94
64
jsont ai_baset::output_json (
95
65
const namespacet &ns,
96
66
const goto_functionst &goto_functions) const
@@ -113,18 +83,9 @@ jsont ai_baset::output_json(
113
83
return result;
114
84
}
115
85
116
- /* ******************************************************************\
117
-
118
- Function: ai_baset::output_json
119
-
120
- Inputs: The namespace, goto_program and it's identifier
121
-
122
- Outputs: The JSON object
123
-
124
- Purpose: Output the domains for a single function as JSON
125
-
126
- \*******************************************************************/
127
-
86
+ // / Output the domains for a single function as JSON
87
+ // / \par parameters: The namespace, goto_program and it's identifier
88
+ // / \return The JSON object
128
89
jsont ai_baset::output_json (
129
90
const namespacet &ns,
130
91
const goto_programt &goto_program,
@@ -152,18 +113,9 @@ jsont ai_baset::output_json(
152
113
return contents;
153
114
}
154
115
155
- /* ******************************************************************\
156
-
157
- Function: ai_baset::output_xml
158
-
159
- Inputs: The namespace and goto_functions
160
-
161
- Outputs: The XML object
162
-
163
- Purpose: Output the domains for the whole program as XML
164
-
165
- \*******************************************************************/
166
-
116
+ // / Output the domains for the whole program as XML
117
+ // / \par parameters: The namespace and goto_functions
118
+ // / \return The XML object
167
119
xmlt ai_baset::output_xml (
168
120
const namespacet &ns,
169
121
const goto_functionst &goto_functions) const
@@ -189,18 +141,9 @@ xmlt ai_baset::output_xml(
189
141
return program;
190
142
}
191
143
192
- /* ******************************************************************\
193
-
194
- Function: ai_baset::output_xml
195
-
196
- Inputs: The namespace, goto_program and it's identifier
197
-
198
- Outputs: The XML object
199
-
200
- Purpose: Output the domains for a single function as XML
201
-
202
- \*******************************************************************/
203
-
144
+ // / Output the domains for a single function as XML
145
+ // / \par parameters: The namespace, goto_program and it's identifier
146
+ // / \return The XML object
204
147
xmlt ai_baset::output_xml (
205
148
const namespacet &ns,
206
149
const goto_programt &goto_program,
@@ -231,18 +174,6 @@ xmlt ai_baset::output_xml(
231
174
return function_body;
232
175
}
233
176
234
- /* ******************************************************************\
235
-
236
- Function: ai_baset::entry_state
237
-
238
- Inputs:
239
-
240
- Outputs:
241
-
242
- Purpose:
243
-
244
- \*******************************************************************/
245
-
246
177
void ai_baset::entry_state (const goto_functionst &goto_functions)
247
178
{
248
179
// find the 'entry function'
@@ -254,53 +185,17 @@ void ai_baset::entry_state(const goto_functionst &goto_functions)
254
185
entry_state (f_it->second .body );
255
186
}
256
187
257
- /* ******************************************************************\
258
-
259
- Function: ai_baset::entry_state
260
-
261
- Inputs:
262
-
263
- Outputs:
264
-
265
- Purpose:
266
-
267
- \*******************************************************************/
268
-
269
188
void ai_baset::entry_state (const goto_programt &goto_program)
270
189
{
271
190
// The first instruction of 'goto_program' is the entry point
272
191
get_state (goto_program.instructions .begin ()).make_entry ();
273
192
}
274
193
275
- /* ******************************************************************\
276
-
277
- Function: ai_baset::initialize
278
-
279
- Inputs:
280
-
281
- Outputs:
282
-
283
- Purpose:
284
-
285
- \*******************************************************************/
286
-
287
194
void ai_baset::initialize (const goto_functionst::goto_functiont &goto_function)
288
195
{
289
196
initialize (goto_function.body );
290
197
}
291
198
292
- /* ******************************************************************\
293
-
294
- Function: ai_baset::initialize
295
-
296
- Inputs:
297
-
298
- Outputs:
299
-
300
- Purpose:
301
-
302
- \*******************************************************************/
303
-
304
199
void ai_baset::initialize (const goto_programt &goto_program)
305
200
{
306
201
// we mark everything as unreachable as starting point
@@ -309,36 +204,12 @@ void ai_baset::initialize(const goto_programt &goto_program)
309
204
get_state (i_it).make_bottom ();
310
205
}
311
206
312
- /* ******************************************************************\
313
-
314
- Function: ai_baset::initialize
315
-
316
- Inputs:
317
-
318
- Outputs:
319
-
320
- Purpose:
321
-
322
- \*******************************************************************/
323
-
324
207
void ai_baset::initialize (const goto_functionst &goto_functions)
325
208
{
326
209
forall_goto_functions (it, goto_functions)
327
210
initialize (it->second );
328
211
}
329
212
330
- /* ******************************************************************\
331
-
332
- Function: ai_baset::get_next
333
-
334
- Inputs:
335
-
336
- Outputs:
337
-
338
- Purpose:
339
-
340
- \*******************************************************************/
341
-
342
213
ai_baset::locationt ai_baset::get_next (
343
214
working_sett &working_set)
344
215
{
@@ -351,18 +222,6 @@ ai_baset::locationt ai_baset::get_next(
351
222
return l;
352
223
}
353
224
354
- /* ******************************************************************\
355
-
356
- Function: ai_baset::fixedpoint
357
-
358
- Inputs:
359
-
360
- Outputs:
361
-
362
- Purpose:
363
-
364
- \*******************************************************************/
365
-
366
225
bool ai_baset::fixedpoint (
367
226
const goto_programt &goto_program,
368
227
const goto_functionst &goto_functions,
@@ -389,18 +248,6 @@ bool ai_baset::fixedpoint(
389
248
return new_data;
390
249
}
391
250
392
- /* ******************************************************************\
393
-
394
- Function: ai_baset::visit
395
-
396
- Inputs:
397
-
398
- Outputs:
399
-
400
- Purpose:
401
-
402
- \*******************************************************************/
403
-
404
251
bool ai_baset::visit (
405
252
locationt l,
406
253
working_sett &working_set,
@@ -459,18 +306,6 @@ bool ai_baset::visit(
459
306
return new_data;
460
307
}
461
308
462
- /* ******************************************************************\
463
-
464
- Function: ai_baset::do_function_call
465
-
466
- Inputs:
467
-
468
- Outputs:
469
-
470
- Purpose:
471
-
472
- \*******************************************************************/
473
-
474
309
bool ai_baset::do_function_call (
475
310
locationt l_call, locationt l_return,
476
311
const goto_functionst &goto_functions,
@@ -534,18 +369,6 @@ bool ai_baset::do_function_call(
534
369
}
535
370
}
536
371
537
- /* ******************************************************************\
538
-
539
- Function: ai_baset::do_function_call_rec
540
-
541
- Inputs:
542
-
543
- Outputs:
544
-
545
- Purpose:
546
-
547
- \*******************************************************************/
548
-
549
372
bool ai_baset::do_function_call_rec (
550
373
locationt l_call, locationt l_return,
551
374
const exprt &function,
@@ -630,18 +453,6 @@ bool ai_baset::do_function_call_rec(
630
453
return new_data;
631
454
}
632
455
633
- /* ******************************************************************\
634
-
635
- Function: ai_baset::sequential_fixedpoint
636
-
637
- Inputs:
638
-
639
- Outputs:
640
-
641
- Purpose:
642
-
643
- \*******************************************************************/
644
-
645
456
void ai_baset::sequential_fixedpoint (
646
457
const goto_functionst &goto_functions,
647
458
const namespacet &ns)
@@ -653,18 +464,6 @@ void ai_baset::sequential_fixedpoint(
653
464
fixedpoint (f_it->second .body , goto_functions, ns);
654
465
}
655
466
656
- /* ******************************************************************\
657
-
658
- Function: ai_baset::concurrent_fixedpoint
659
-
660
- Inputs:
661
-
662
- Outputs:
663
-
664
- Purpose:
665
-
666
- \*******************************************************************/
667
-
668
467
void ai_baset::concurrent_fixedpoint (
669
468
const goto_functionst &goto_functions,
670
469
const namespacet &ns)
0 commit comments