@@ -113,8 +113,7 @@ static optionalt<exprt> get_array(
113
113
114
114
static exprt substitute_array_access (
115
115
const index_exprt &index_expr,
116
- const std::function<symbol_exprt(const irep_idt &, const typet &)>
117
- &symbol_generator,
116
+ symbol_generatort &symbol_generator,
118
117
const bool left_propagate);
119
118
120
119
// / Convert index-value map to a vector of values. If a value for an
@@ -1183,8 +1182,7 @@ static exprt substitute_array_access(
1183
1182
static exprt substitute_array_access (
1184
1183
const array_exprt &array_expr,
1185
1184
const exprt &index,
1186
- const std::function<symbol_exprt(const irep_idt &, const typet &)>
1187
- &symbol_generator)
1185
+ symbol_generatort &symbol_generator)
1188
1186
{
1189
1187
const typet &char_type = array_expr.type ().subtype ();
1190
1188
const exprt default_val = symbol_generator (" out_of_bound_access" , char_type);
@@ -1195,8 +1193,7 @@ static exprt substitute_array_access(
1195
1193
static exprt substitute_array_access (
1196
1194
const if_exprt &if_expr,
1197
1195
const exprt &index,
1198
- const std::function<symbol_exprt(const irep_idt &, const typet &)>
1199
- &symbol_generator,
1196
+ symbol_generatort &symbol_generator,
1200
1197
const bool left_propagate)
1201
1198
{
1202
1199
// Substitute recursively in branches of conditional expressions
@@ -1210,8 +1207,7 @@ static exprt substitute_array_access(
1210
1207
1211
1208
static exprt substitute_array_access (
1212
1209
const index_exprt &index_expr,
1213
- const std::function<symbol_exprt(const irep_idt &, const typet &)>
1214
- &symbol_generator,
1210
+ symbol_generatort &symbol_generator,
1215
1211
const bool left_propagate)
1216
1212
{
1217
1213
const exprt &array = index_expr.array ();
@@ -1240,8 +1236,7 @@ static exprt substitute_array_access(
1240
1236
// / the resulting expression.
1241
1237
static void substitute_array_access_in_place (
1242
1238
exprt &expr,
1243
- const std::function<symbol_exprt(const irep_idt &, const typet &)>
1244
- &symbol_generator,
1239
+ symbol_generatort &symbol_generator,
1245
1240
const bool left_propagate)
1246
1241
{
1247
1242
if (const auto index_expr = expr_try_dynamic_cast<index_exprt>(expr))
@@ -1269,15 +1264,13 @@ static void substitute_array_access_in_place(
1269
1264
// / Note that if left_propagate is set to true, the `with` case will result in
1270
1265
// / something like: `index <= 0 ? 24 : index <= 2 ? 42 : 12`
1271
1266
// / \param expr: an expression containing array accesses
1272
- // / \param symbol_generator: function which given a prefix and a type generates
1273
- // / a fresh symbol of the given type
1267
+ // / \param symbol_generator: a symbol generator
1274
1268
// / \param left_propagate: should values be propagated to the left in with
1275
1269
// / expressions
1276
1270
// / \return an expression containing no array access
1277
1271
exprt substitute_array_access (
1278
1272
exprt expr,
1279
- const std::function<symbol_exprt(const irep_idt &, const typet &)>
1280
- &symbol_generator,
1273
+ symbol_generatort &symbol_generator,
1281
1274
const bool left_propagate)
1282
1275
{
1283
1276
substitute_array_access_in_place (expr, symbol_generator, left_propagate);
@@ -1366,13 +1359,6 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1366
1359
const std::unordered_map<string_not_contains_constraintt, symbol_exprt>
1367
1360
¬_contain_witnesses)
1368
1361
{
1369
- // clang-format off
1370
- const auto gen_symbol = [&](const irep_idt &id, const typet &type)
1371
- {
1372
- return generator.fresh_symbol (id, type);
1373
- };
1374
- // clang-format on
1375
-
1376
1362
stream << " string_refinementt::check_axioms:" << messaget::eom;
1377
1363
1378
1364
stream << " symbol_resolve:" << messaget::eom;
@@ -1410,7 +1396,7 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1410
1396
1411
1397
stream << std::string (2 , ' ' ) << i << " .\n " ;
1412
1398
const exprt with_concretized_arrays =
1413
- substitute_array_access (negaxiom, gen_symbol , true );
1399
+ substitute_array_access (negaxiom, generator. fresh_symbol , true );
1414
1400
debug_check_axioms_step (
1415
1401
stream, axiom, axiom_in_model, negaxiom, with_concretized_arrays);
1416
1402
0 commit comments