@@ -137,7 +137,9 @@ void goto_symext::symex_other(
137
137
// 3. build an assignment where the type on lhs and rhs is:
138
138
// - array_copy: the type of the first array (even if the second is smaller)
139
139
// - array_replace: the type of the second array (even if it is smaller)
140
- PRECONDITION (code.operands ().size () == 2 );
140
+ DATA_INVARIANT (
141
+ code.operands ().size () == 2 ,
142
+ " expected statement to have two operands at this point" );
141
143
142
144
// we need to add dereferencing for both operands
143
145
dereference_exprt dest_array (code.op0 ());
@@ -185,7 +187,9 @@ void goto_symext::symex_other(
185
187
// process_array_expr)
186
188
// 3. use the type of the resulting array to construct an array_of
187
189
// expression
188
- PRECONDITION (code.operands ().size () == 2 );
190
+ DATA_INVARIANT (
191
+ code.operands ().size () == 2 ,
192
+ " expected statement to have two operands at this point" );
189
193
190
194
// we need to add dereferencing for the first operand
191
195
exprt array_expr = dereference_exprt (code.op0 ());
@@ -230,7 +234,9 @@ void goto_symext::symex_other(
230
234
// 3. build an assignment where the lhs is the previous third argument, and
231
235
// the right-hand side is an equality over the arrays, if their types match;
232
236
// if the types don't match the result trivially is false
233
- PRECONDITION (code.operands ().size () == 3 );
237
+ DATA_INVARIANT (
238
+ code.operands ().size () == 3 ,
239
+ " expected statement to have three operands at this point" );
234
240
235
241
// we need to add dereferencing for the first two
236
242
dereference_exprt array1 (code.op0 ());
@@ -262,7 +268,9 @@ void goto_symext::symex_other(
262
268
}
263
269
else if (statement==ID_havoc_object)
264
270
{
265
- PRECONDITION (code.operands ().size ()==1 );
271
+ DATA_INVARIANT (
272
+ code.operands ().size () == 1 ,
273
+ " expected statement to have one operand at this point" );
266
274
267
275
// we need to add dereferencing for the first operand
268
276
dereference_exprt object (code.op0 (), empty_typet ());
0 commit comments