File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ exprt boolbvt::bv_get_unbounded_array(const exprt &expr) const
375
375
376
376
if (size_mpint>100 || size.id ()==ID_infinity)
377
377
{
378
- result = exprt (ID_array_list, type);
378
+ result = array_list_exprt ( to_array_type ( type) );
379
379
result.type ().set (ID_size, integer2string (size_mpint));
380
380
381
381
result.operands ().reserve (values.size ()*2 );
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ exprt smt1_convt::ce_value(
219
219
if (index_expr.is_nil ())
220
220
return nil_exprt ();
221
221
222
- exprt array_list (ID_array_list, type );
222
+ array_list_exprt array_list (array_type );
223
223
array_list.copy_to_operands (index_expr, value_expr);
224
224
225
225
return array_list;
Original file line number Diff line number Diff line change @@ -1649,6 +1649,27 @@ template<> inline bool can_cast_expr<array_exprt>(const exprt &base)
1649
1649
return base.id ()==ID_array;
1650
1650
}
1651
1651
1652
+ // / Array constructor from a list of index-element pairs
1653
+ // / Operands are index/value pairs, alternating.
1654
+ class array_list_exprt : public exprt
1655
+ {
1656
+ public:
1657
+ explicit array_list_exprt (const array_typet &_type)
1658
+ : exprt(ID_array_list, _type)
1659
+ {
1660
+ }
1661
+ };
1662
+
1663
+ template <>
1664
+ inline bool can_cast_expr<array_list_exprt>(const exprt &base)
1665
+ {
1666
+ return base.id () == ID_array_list;
1667
+ }
1668
+
1669
+ inline void validate_expr (const array_list_exprt &value)
1670
+ {
1671
+ PRECONDITION (value.operands ().size () % 2 == 0 );
1672
+ }
1652
1673
1653
1674
/* ! \brief vector constructor from list of elements
1654
1675
*/
You can’t perform that action at this time.
0 commit comments