@@ -1123,9 +1123,6 @@ static exprt substitute_array_access(
1123
1123
const bool left_propagate)
1124
1124
{
1125
1125
const exprt &array = index_expr.array ();
1126
-
1127
- if (array.id () == ID_symbol)
1128
- return index_expr;
1129
1126
if (auto array_of = expr_try_dynamic_cast<array_of_exprt>(array))
1130
1127
return array_of->op ();
1131
1128
if (auto array_with = expr_try_dynamic_cast<with_exprt>(array))
@@ -1138,7 +1135,12 @@ static exprt substitute_array_access(
1138
1135
return substitute_array_access (
1139
1136
*if_expr, index_expr.index (), symbol_generator, left_propagate);
1140
1137
1141
- UNREACHABLE;
1138
+ INVARIANT (
1139
+ array.is_nil () || array.id () == ID_symbol,
1140
+ std::string (
1141
+ " in case the array is unknown, it should be a symbol or nil, id: " )
1142
+ + id2string (array.id ()));
1143
+ return index_expr;
1142
1144
}
1143
1145
1144
1146
// / Auxiliary function for substitute_array_access
@@ -2121,9 +2123,11 @@ exprt string_refinementt::get(const exprt &expr) const
2121
2123
}
2122
2124
2123
2125
INVARIANT (
2124
- array.id () == ID_symbol,
2125
- " apart from symbols, array valuations can be interpreted as sparse "
2126
- " arrays" );
2126
+ array.is_nil () || array.id () == ID_symbol,
2127
+ std::string (
2128
+ " apart from symbols, array valuations can be interpreted as "
2129
+ " sparse arrays, id: " ) +
2130
+ id2string (array.id ()));
2127
2131
return index_exprt (array, index );
2128
2132
}
2129
2133
0 commit comments