File tree Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1
- CORE broken-smt-backend
1
+ CORE
2
2
union_initialization.c
3
3
4
4
^EXIT=10$
Original file line number Diff line number Diff line change 1
- CORE broken-smt-backend
1
+ CORE broken-z3- smt-backend
2
2
union_member.c
3
3
4
4
^EXIT=10$
Original file line number Diff line number Diff line change 1
- CORE broken-smt-backend
1
+ CORE broken-z3- smt-backend
2
2
union_update.c
3
3
4
4
^EXIT=10$
Original file line number Diff line number Diff line change @@ -4556,7 +4556,31 @@ void smt2_convt::flatten2bv(const exprt &expr)
4556
4556
}
4557
4557
else if (type.id ()==ID_array)
4558
4558
{
4559
- convert_expr (expr);
4559
+ if (use_array_theory (expr))
4560
+ {
4561
+ // concatenate elements
4562
+ const array_typet &array_type = to_array_type (type);
4563
+
4564
+ mp_integer size =
4565
+ numeric_cast_v<mp_integer>(to_constant_expr (array_type.size ()));
4566
+
4567
+ out << " (let ((?aflop " ;
4568
+ convert_expr (expr);
4569
+ out << " )) " ;
4570
+
4571
+ out << " (concat" ;
4572
+
4573
+ for (mp_integer i = 0 ; i != size; ++i)
4574
+ {
4575
+ out << " (select ?aflop " ;
4576
+ convert_expr (from_integer (i, array_type.index_type ()));
4577
+ out << ' )' ;
4578
+ }
4579
+
4580
+ out << " ))" ; // concat, let
4581
+ }
4582
+ else
4583
+ convert_expr (expr);
4560
4584
}
4561
4585
else if (type.id () == ID_struct || type.id () == ID_struct_tag)
4562
4586
{
@@ -5441,7 +5465,7 @@ bool smt2_convt::use_array_theory(const exprt &expr)
5441
5465
}
5442
5466
else
5443
5467
{
5444
- // arrays inside structs get flattened
5468
+ // arrays inside structs or unions get flattened
5445
5469
if (expr.id ()==ID_with)
5446
5470
return use_array_theory (to_with_expr (expr).old ());
5447
5471
else if (expr.id ()==ID_member)
You can’t perform that action at this time.
0 commit comments