@@ -488,35 +488,6 @@ static union_find_replacet generate_symbol_resolution_from_equations(
488
488
return solver;
489
489
}
490
490
491
- // / Maps equation to expressions contained in them and conversely expressions to
492
- // / equations that contain them. This can be used on a subset of expressions
493
- // / which interests us, in particular strings. Equations are identified by an
494
- // / index of type `std::size_t` for more efficient insertion and lookup.
495
- class equation_symbol_mappingt
496
- {
497
- public:
498
- // Record index of the equations that contain a given expression
499
- std::map<exprt, std::vector<std::size_t >> equations_containing;
500
- // Record expressions that are contained in the equation with the given index
501
- std::unordered_map<std::size_t , std::vector<exprt>> strings_in_equation;
502
-
503
- void add (const std::size_t i, const exprt &expr)
504
- {
505
- equations_containing[expr].push_back (i);
506
- strings_in_equation[i].push_back (expr);
507
- }
508
-
509
- std::vector<exprt> find_expressions (const std::size_t i)
510
- {
511
- return strings_in_equation[i];
512
- }
513
-
514
- std::vector<std::size_t > find_equations (const exprt &expr)
515
- {
516
- return equations_containing[expr];
517
- }
518
- };
519
-
520
491
// / This is meant to be used on the lhs of an equation with string subtype.
521
492
// / \param lhs: expression which is either of string type, or a symbol
522
493
// / representing a struct with some string members
@@ -1219,68 +1190,6 @@ void debug_model(
1219
1190
stream << messaget::eom;
1220
1191
}
1221
1192
1222
- sparse_arrayt::sparse_arrayt (const with_exprt &expr)
1223
- {
1224
- auto ref = std::ref (static_cast <const exprt &>(expr));
1225
- while (can_cast_expr<with_exprt>(ref.get ()))
1226
- {
1227
- const auto &with_expr = expr_dynamic_cast<with_exprt>(ref.get ());
1228
- const auto current_index = numeric_cast_v<std::size_t >(with_expr.where ());
1229
- entries.emplace_back (current_index, with_expr.new_value ());
1230
- ref = with_expr.old ();
1231
- }
1232
-
1233
- // This function only handles 'with' and 'array_of' expressions
1234
- PRECONDITION (ref.get ().id () == ID_array_of);
1235
- default_value = expr_dynamic_cast<array_of_exprt>(ref.get ()).what ();
1236
- }
1237
-
1238
- exprt sparse_arrayt::to_if_expression (const exprt &index) const
1239
- {
1240
- return std::accumulate (
1241
- entries.begin (),
1242
- entries.end (),
1243
- default_value,
1244
- [&](
1245
- const exprt if_expr,
1246
- const std::pair<std::size_t , exprt> &entry) { // NOLINT
1247
- const exprt entry_index = from_integer (entry.first , index .type ());
1248
- const exprt &then_expr = entry.second ;
1249
- CHECK_RETURN (then_expr.type () == if_expr.type ());
1250
- const equal_exprt index_equal (index , entry_index);
1251
- return if_exprt (index_equal, then_expr, if_expr, if_expr.type ());
1252
- });
1253
- }
1254
-
1255
- interval_sparse_arrayt::interval_sparse_arrayt (const with_exprt &expr)
1256
- : sparse_arrayt(expr)
1257
- {
1258
- // Entries are sorted so that successive entries correspond to intervals
1259
- std::sort (
1260
- entries.begin (),
1261
- entries.end (),
1262
- [](
1263
- const std::pair<std::size_t , exprt> &a,
1264
- const std::pair<std::size_t , exprt> &b) { return a.first < b.first ; });
1265
- }
1266
-
1267
- exprt interval_sparse_arrayt::to_if_expression (const exprt &index) const
1268
- {
1269
- return std::accumulate (
1270
- entries.rbegin (),
1271
- entries.rend (),
1272
- default_value,
1273
- [&](
1274
- const exprt if_expr,
1275
- const std::pair<std::size_t , exprt> &entry) { // NOLINT
1276
- const exprt entry_index = from_integer (entry.first , index .type ());
1277
- const exprt &then_expr = entry.second ;
1278
- CHECK_RETURN (then_expr.type () == if_expr.type ());
1279
- const binary_relation_exprt index_small_eq (index , ID_le, entry_index);
1280
- return if_exprt (index_small_eq, then_expr, if_expr, if_expr.type ());
1281
- });
1282
- }
1283
-
1284
1193
// / Create a new expression where 'with' expressions on arrays are replaced by
1285
1194
// / 'if' expressions. e.g. for an array access arr[index], where: `arr :=
1286
1195
// / array_of(12) with {0:=24} with {2:=42}` the constructed expression will be:
0 commit comments