@@ -1208,6 +1208,9 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1208
1208
const union_find_replacet &symbol_resolve)
1209
1209
{
1210
1210
const auto eom=messaget::eom;
1211
+ static const std::string indent = " " ;
1212
+ static const std::string indent2 = " " ;
1213
+
1211
1214
stream << " string_refinementt::check_axioms:" << eom;
1212
1215
1213
1216
stream << " symbol_resolve:" << eom;
@@ -1245,36 +1248,37 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1245
1248
1246
1249
exprt negaxiom=negation_of_constraint (axiom_in_model);
1247
1250
1248
- stream << " " << i << " .\n "
1249
- << " - axiom:\n "
1250
- << " " << from_expr (ns, " " , axiom) << ' \n ' ;
1251
- stream << " - axiom_in_model:\n "
1252
- << " " << from_expr (ns, " " , axiom_in_model) << ' \n ' ;
1253
- stream << " - negated_axiom:\n "
1254
- << " " << from_expr (ns, " " , negaxiom) << ' \n ' ;
1251
+ stream << indent << i << " .\n "
1252
+ << indent2 << " - axiom:\n "
1253
+ << indent2 << indent << from_expr (ns, " " , axiom) << ' \n ' ;
1254
+ stream << indent2 << " - axiom_in_model:\n "
1255
+ << indent2 << indent << from_expr (ns, " " , axiom_in_model) << ' \n ' ;
1256
+ stream << indent2 << " - negated_axiom:\n "
1257
+ << indent2 << indent << from_expr (ns, " " , negaxiom) << ' \n ' ;
1255
1258
negaxiom = simplify_expr (negaxiom, ns);
1256
- stream << " - simplified_negaxiom:\n "
1257
- << " " << from_expr (ns, " " , negaxiom) << ' \n ' ;
1259
+ stream << indent2 << " - simplified_negaxiom:\n "
1260
+ << indent2 << indent << from_expr (ns, " " , negaxiom) << ' \n ' ;
1258
1261
1259
1262
exprt with_concretized_arrays =
1260
1263
concretize_arrays_in_expression (negaxiom, max_string_length, ns);
1261
- stream << " - negated_axiom_with_concretized_array_access:\n "
1262
- << " " << from_expr (ns, " " , with_concretized_arrays) << ' \n ' ;
1264
+ stream << indent2 << " - negated_axiom_with_concretized_array_access:\n "
1265
+ << indent2 << indent << from_expr (ns, " " , with_concretized_arrays)
1266
+ << ' \n ' ;
1263
1267
1264
1268
substitute_array_access (with_concretized_arrays);
1265
- stream << " - negated_axiom_without_array_access:\n "
1266
- << " " << from_expr (ns, " " , with_concretized_arrays) << ' \n ' ;
1269
+ stream << indent2 << " - negated_axiom_without_array_access:\n "
1270
+ << indent2 << indent << from_expr (ns, " " , with_concretized_arrays)
1271
+ << eom;
1267
1272
1268
1273
if (const auto &witness=
1269
1274
find_counter_example (ns, ui, with_concretized_arrays, univ_var))
1270
1275
{
1271
- stream << " - violated_for: "
1272
- << univ_var.get_identifier ()
1273
- << " =" << from_expr (ns, " " , *witness) << ' \n ' ;
1276
+ stream << indent2 << " - violated_for: " << univ_var.get_identifier ()
1277
+ << " =" << from_expr (ns, " " , *witness) << eom;
1274
1278
violated[i]=*witness;
1275
1279
}
1276
1280
else
1277
- stream << " - correct" << ' \n ' ;
1281
+ stream << indent2 << " - correct" << eom ;
1278
1282
}
1279
1283
1280
1284
// Maps from indexes of violated not_contains axiom to a witness of violation
@@ -1304,21 +1308,31 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1304
1308
to_array_string_expr (get (s0)),
1305
1309
to_array_string_expr (get (s1)));
1306
1310
1307
- exprt negaxiom = negation_of_not_contains_constraint (
1308
- to_string_not_contains_constraint (simplify_expr (nc_axiom_in_model, ns)),
1309
- univ_var);
1310
- stream << " " << i << " .\n "
1311
- << " - axiom: " << from_expr (ns, " " , nc_axiom) << " \n " ;
1312
- stream << " - axiom_in_model: " << from_expr (ns, " " , nc_axiom_in_model)
1313
- << " \n " ;
1314
- stream << " - negated_constraint: " << from_expr (ns, " " , negaxiom) << eom;
1311
+ exprt negaxiom =
1312
+ negation_of_not_contains_constraint (nc_axiom_in_model, univ_var);
1313
+ stream << indent << i << " .\n "
1314
+ << indent2 << " - axiom:\n "
1315
+ << indent2 << indent << from_expr (ns, " " , nc_axiom) << ' \n ' ;
1316
+ stream << indent2 << " - axiom_in_model:\n "
1317
+ << indent2 << indent << from_expr (ns, " " , nc_axiom_in_model) << ' \n ' ;
1318
+ stream << indent2 << " - negated_axiom:\n "
1319
+ << indent2 << indent << from_expr (ns, " " , negaxiom) << ' \n ' ;
1320
+
1321
+ negaxiom = simplify_expr (negaxiom, ns);
1322
+ stream << indent2 << " - simplified_negaxiom:\n "
1323
+ << indent2 << indent << from_expr (ns, " " , negaxiom) << ' \n ' ;
1324
+ negaxiom = concretize_arrays_in_expression (negaxiom, max_string_length, ns);
1325
+ stream << indent2 << " - negated_axiom_with_concretized_array_access:\n "
1326
+ << indent2 << indent << from_expr (ns, " " , negaxiom) << ' \n ' ;
1327
+
1315
1328
substitute_array_access (negaxiom);
1329
+ stream << indent2 << " - negated_axiom_without_array_access:\n "
1330
+ << indent2 << indent << from_expr (ns, " " , negaxiom) << eom;
1316
1331
1317
1332
if (const auto witness = find_counter_example (ns, ui, negaxiom, univ_var))
1318
1333
{
1319
- stream << " string constraint can be violated for "
1320
- << univ_var.get_identifier () << " =" << from_expr (ns, " " , *witness)
1321
- << eom;
1334
+ stream << indent2 << " - violated_for: " << univ_var.get_identifier ()
1335
+ << " =" << from_expr (ns, " " , *witness) << eom;
1322
1336
violated_not_contains[i]=*witness;
1323
1337
}
1324
1338
}
0 commit comments