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
375375
376376 if (size_mpint>100 || size.id ()==ID_infinity)
377377 {
378- result = exprt (ID_array_list, type);
378+ result = array_list_exprt ( to_array_type ( type) );
379379 result.type ().set (ID_size, integer2string (size_mpint));
380380
381381 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(
219219 if (index_expr.is_nil ())
220220 return nil_exprt ();
221221
222- exprt array_list (ID_array_list, type );
222+ array_list_exprt array_list (array_type );
223223 array_list.copy_to_operands (index_expr, value_expr);
224224
225225 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)
16491649 return base.id ()==ID_array;
16501650}
16511651
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+ }
16521673
16531674/* ! \brief vector constructor from list of elements
16541675*/
You can’t perform that action at this time.
0 commit comments