@@ -123,8 +123,11 @@ void arrayst::collect_arrays(const exprt &a)
123
123
collect_arrays (with_expr.old ());
124
124
125
125
// make sure this shows as an application
126
- index_exprt index_expr (with_expr.old (), with_expr.where ());
127
- record_array_index (index_expr);
126
+ for (std::size_t i = 1 ; i < with_expr.operands ().size (); i += 2 )
127
+ {
128
+ index_exprt index_expr (with_expr.old (), with_expr.operands ()[i]);
129
+ record_array_index (index_expr);
130
+ }
128
131
}
129
132
else if (a.id ()==ID_update)
130
133
{
@@ -501,13 +504,21 @@ void arrayst::add_array_constraints(
501
504
void arrayst::add_array_constraints_with (
502
505
const index_sett &index_set,
503
506
const with_exprt &expr)
507
+ {
508
+ const exprt::operandst &operands = expr.operands ();
509
+ for (std::size_t i = 1 ; i + 1 < operands.size (); i += 2 )
510
+ add_array_constraints_with (index_set, expr, operands[i], operands[i + 1 ]);
511
+ }
512
+
513
+ void arrayst::add_array_constraints_with (
514
+ const index_sett &index_set,
515
+ const with_exprt &expr,
516
+ const exprt &index,
517
+ const exprt &value)
504
518
{
505
519
// we got x=(y with [i:=v])
506
520
// add constraint x[i]=v
507
521
508
- const exprt &index =expr.where ();
509
- const exprt &value=expr.new_value ();
510
-
511
522
{
512
523
index_exprt index_expr (expr, index , expr.type ().subtype ());
513
524
0 commit comments