@@ -36,8 +36,8 @@ Function: full_struct_abstract_objectt::struct_abstract_objectt
36
36
full_struct_abstract_objectt::full_struct_abstract_objectt (const typet &t):
37
37
struct_abstract_objectt(t)
38
38
{
39
- assert (t.id ()==ID_struct);
40
- assert (verify ());
39
+ PRECONDITION (t.id ()==ID_struct);
40
+ DATA_INVARIANT (verify (), " Structural invariants maintained " );
41
41
}
42
42
43
43
/* ******************************************************************\
@@ -60,8 +60,8 @@ full_struct_abstract_objectt::full_struct_abstract_objectt(
60
60
const typet &t, bool top, bool bottom):
61
61
struct_abstract_objectt(t, top, bottom)
62
62
{
63
- assert (t.id ()==ID_struct);
64
- assert (verify ());
63
+ PRECONDITION (t.id ()==ID_struct);
64
+ DATA_INVARIANT (verify (), " Structural invariants maintained " );
65
65
}
66
66
67
67
/* ******************************************************************\
@@ -84,7 +84,7 @@ full_struct_abstract_objectt::full_struct_abstract_objectt(
84
84
const namespacet &ns):
85
85
struct_abstract_objectt(e, environment, ns)
86
86
{
87
- assert (verify ());
87
+ DATA_INVARIANT (verify (), " Structural invariants maintained " );
88
88
}
89
89
90
90
/* ******************************************************************\
@@ -122,7 +122,7 @@ abstract_object_pointert full_struct_abstract_objectt::read_component(
122
122
}
123
123
else
124
124
{
125
- assert (!is_bottom ());
125
+ PRECONDITION (!is_bottom ());
126
126
127
127
irep_idt c=member_expr.get_component_name ();
128
128
@@ -203,7 +203,7 @@ sharing_ptrt<struct_abstract_objectt>
203
203
copy->map [c]=
204
204
environment.write (starting_value, value, stack, ns, merging_write);
205
205
copy->clear_top ();
206
- assert (copy->verify ()) ;
206
+ DATA_INVARIANT (copy->verify (), " Structural invariants maintained " ); ;
207
207
return copy;
208
208
}
209
209
else
@@ -219,19 +219,19 @@ sharing_ptrt<struct_abstract_objectt>
219
219
{
220
220
if (is_top ()) // struct is top
221
221
{
222
- assert (copy->verify ()) ;
222
+ DATA_INVARIANT (copy->verify (), " Structural invariants maintained " ); ;
223
223
return copy;
224
224
}
225
225
226
- assert (!copy->map .empty ());
226
+ INVARIANT (!copy->map .empty (), " If not top, map cannot be empty " );
227
227
228
228
struct_mapt &m=copy->map ;
229
229
230
230
struct_mapt::iterator it=m.find (c);
231
231
232
232
if (it==m.end ()) // component is top
233
233
{
234
- assert (copy->verify ()) ;
234
+ DATA_INVARIANT (copy->verify (), " Structural invariants maintained " ); ;
235
235
return copy;
236
236
}
237
237
@@ -243,10 +243,10 @@ sharing_ptrt<struct_abstract_objectt>
243
243
{
244
244
copy->map [c]=value;
245
245
copy->clear_top ();
246
- assert (!copy->is_bottom ());
246
+ INVARIANT (!copy->is_bottom (), " top != bottom " );
247
247
}
248
248
249
- assert (copy->verify ()) ;
249
+ DATA_INVARIANT (copy->verify (), " Structural invariants maintained " ); ;
250
250
return copy;
251
251
}
252
252
}
@@ -367,7 +367,7 @@ abstract_object_pointert full_struct_abstract_objectt::merge_constant_structs(
367
367
abstract_objectt::merge_maps<irep_idt>(map, other->map , merged_map);
368
368
if (!modified)
369
369
{
370
- assert (verify ());
370
+ DATA_INVARIANT (verify (), " Structural invariants maintained " );
371
371
return shared_from_this ();
372
372
}
373
373
else
@@ -378,9 +378,9 @@ abstract_object_pointert full_struct_abstract_objectt::merge_constant_structs(
378
378
379
379
result->map =merged_map;
380
380
381
- assert (!result->is_top ());
382
- assert (!result->is_bottom ());
383
- assert (result->verify ());
381
+ INVARIANT (!result->is_top (), " Merge of maps will not generate top " );
382
+ INVARIANT (!result->is_bottom (), " Merge of maps will not generate bottom " );
383
+ DATA_INVARIANT (result->verify (), " Structural invariants maintained " );
384
384
return result;
385
385
}
386
386
}
0 commit comments