@@ -3097,7 +3097,7 @@ void smt2_convt::flatten_array(const exprt &expr)
30973097 if (i!=1 )
30983098 out << " (concat " ;
30993099 out << " (select ?far " ;
3100- convert_expr (from_integer (i- 1 , array_type.size (). type ()));
3100+ convert_expr (from_integer (i - 1 , array_type.index_type ()));
31013101 out << " )" ;
31023102 if (i!=1 )
31033103 out << " " ;
@@ -4041,7 +4041,7 @@ void smt2_convt::convert_with(const with_exprt &expr)
40414041 out << " (store " ;
40424042 convert_expr (expr.old ());
40434043 out << " " ;
4044- convert_expr (typecast_exprt (expr.where (), array_type.size (). type ()));
4044+ convert_expr (typecast_exprt (expr.where (), array_type.index_type ()));
40454045 out << " " ;
40464046 convert_expr (expr.new_value ());
40474047 out << " )" ;
@@ -4267,7 +4267,7 @@ void smt2_convt::convert_index(const index_exprt &expr)
42674267 out << " (select " ;
42684268 convert_expr (expr.array ());
42694269 out << " " ;
4270- convert_expr (typecast_exprt (expr.index (), array_type.size (). type ()));
4270+ convert_expr (typecast_exprt (expr.index (), array_type.index_type ()));
42714271 out << " )" ;
42724272 out << " #b1)" ;
42734273 }
@@ -4276,7 +4276,7 @@ void smt2_convt::convert_index(const index_exprt &expr)
42764276 out << " (select " ;
42774277 convert_expr (expr.array ());
42784278 out << " " ;
4279- convert_expr (typecast_exprt (expr.index (), array_type.size (). type ()));
4279+ convert_expr (typecast_exprt (expr.index (), array_type.index_type ()));
42804280 out << " )" ;
42814281 }
42824282 }
@@ -4891,7 +4891,7 @@ void smt2_convt::find_symbols(const exprt &expr)
48914891
48924892 // use a quantifier-based initialization instead of lambda
48934893 out << " (assert (forall ((i " ;
4894- convert_type (array_type.size (). type ());
4894+ convert_type (array_type.index_type ());
48954895 out << " )) (= (select " << id << " i) " ;
48964896 if (array_type.element_type ().id () == ID_bool && !use_array_of_bool)
48974897 {
@@ -4972,7 +4972,7 @@ void smt2_convt::find_symbols(const exprt &expr)
49724972 for (std::size_t i=0 ; i<expr.operands ().size (); i++)
49734973 {
49744974 out << " (assert (= (select " << id << " " ;
4975- convert_expr (from_integer (i, array_type.size (). type ()));
4975+ convert_expr (from_integer (i, array_type.index_type ()));
49764976 out << " ) " ; // select
49774977 if (array_type.element_type ().id () == ID_bool && !use_array_of_bool)
49784978 {
@@ -5008,7 +5008,7 @@ void smt2_convt::find_symbols(const exprt &expr)
50085008 for (std::size_t i=0 ; i<tmp.operands ().size (); i++)
50095009 {
50105010 out << " (assert (= (select " << id << ' ' ;
5011- convert_expr (from_integer (i, array_type.size (). type ()));
5011+ convert_expr (from_integer (i, array_type.index_type ()));
50125012 out << " ) " ; // select
50135013 convert_expr (tmp.operands ()[i]);
50145014 out << " ))" << " \n " ;
@@ -5127,8 +5127,9 @@ void smt2_convt::convert_type(const typet &type)
51275127 // we always use array theory for top-level arrays
51285128 const typet &subtype = array_type.element_type ();
51295129
5130+ // Arrays map the index type to the element type.
51305131 out << " (Array " ;
5131- convert_type (array_type.size (). type ());
5132+ convert_type (array_type.index_type ());
51325133 out << " " ;
51335134
51345135 if (subtype.id ()==ID_bool && !use_array_of_bool)
0 commit comments