@@ -987,42 +987,41 @@ static exprt get_char_array_and_concretize(
987
987
const array_string_exprt &arr)
988
988
{
989
989
const auto &eom = messaget::eom;
990
- static const std::string indent (" " );
991
990
stream << " - " << format (arr) << " :\n " ;
992
- stream << indent << indent << " - type: " << format (arr.type ()) << eom;
991
+ stream << std::string ( 4 , ' ' ) << " - type: " << format (arr.type ()) << eom;
993
992
const auto arr_model_opt =
994
993
get_array (super_get, ns, max_string_length, stream, arr);
995
994
if (arr_model_opt)
996
995
{
997
- stream << indent << indent << " - char_array: " << format (*arr_model_opt)
996
+ stream << std::string ( 4 , ' ' ) << " - char_array: " << format (*arr_model_opt)
998
997
<< ' \n ' ;
999
- stream << indent << indent << " - type : " << format (arr_model_opt->type ())
998
+ stream << std::string ( 4 , ' ' ) << " - type : " << format (arr_model_opt->type ())
1000
999
<< eom;
1001
1000
const exprt simple = simplify_expr (*arr_model_opt, ns);
1002
- stream << indent << indent << " - simplified_char_array: " << format (simple)
1001
+ stream << std::string ( 4 , ' ' ) << " - simplified_char_array: " << format (simple)
1003
1002
<< eom;
1004
1003
if (
1005
1004
const auto concretized_array = get_array (
1006
1005
super_get, ns, max_string_length, stream, to_array_string_expr (simple)))
1007
1006
{
1008
- stream << indent << indent
1007
+ stream << std::string ( 4 , ' ' )
1009
1008
<< " - concretized_char_array: " << format (*concretized_array)
1010
1009
<< eom;
1011
1010
1012
1011
if (
1013
1012
const auto array_expr =
1014
1013
expr_try_dynamic_cast<array_exprt>(*concretized_array))
1015
1014
{
1016
- stream << indent << indent << " - as_string: \" "
1015
+ stream << std::string ( 4 , ' ' ) << " - as_string: \" "
1017
1016
<< string_of_array (*array_expr) << " \"\n " ;
1018
1017
}
1019
1018
else
1020
- stream << indent << " - warning: not an array" << eom;
1019
+ stream << std::string ( 2 , ' ' ) << " - warning: not an array" << eom;
1021
1020
return *concretized_array;
1022
1021
}
1023
1022
return simple;
1024
1023
}
1025
- stream << indent << indent << " - incomplete model" << eom;
1024
+ stream << std::string ( 4 , ' ' ) << " - incomplete model" << eom;
1026
1025
return arr;
1027
1026
}
1028
1027
@@ -1037,8 +1036,6 @@ void debug_model(
1037
1036
const std::vector<symbol_exprt> &boolean_symbols,
1038
1037
const std::vector<symbol_exprt> &index_symbols)
1039
1038
{
1040
- static const std::string indent (" " );
1041
-
1042
1039
stream << " debug_model:" << ' \n ' ;
1043
1040
for (const auto &pointer_array : generator.array_pool .get_arrays_of_pointers ())
1044
1041
{
@@ -1047,8 +1044,8 @@ void debug_model(
1047
1044
super_get, ns, max_string_length, stream, arr);
1048
1045
1049
1046
stream << " - " << format (arr) << " :\n "
1050
- << indent << " - pointer: " << format (pointer_array.first ) << " \n "
1051
- << indent << " - model: " << format (model) << messaget::eom;
1047
+ << " - pointer: " << format (pointer_array.first ) << " \n "
1048
+ << " - model: " << format (model) << messaget::eom;
1052
1049
}
1053
1050
1054
1051
for (const auto &symbol : boolean_symbols)
@@ -1249,16 +1246,15 @@ static void debug_check_axioms_step(
1249
1246
const exprt &negaxiom,
1250
1247
const exprt &with_concretized_arrays)
1251
1248
{
1252
- static const std::string indent = " " ;
1253
- static const std::string indent2 = " " ;
1254
- stream << indent2 << " - axiom:\n " << indent2 << indent;
1249
+ stream << std::string (4 , ' ' ) << " - axiom:\n " << std::string (6 , ' ' );
1255
1250
stream << to_string (axiom);
1256
- stream << ' \n ' << indent2 << " - axiom_in_model:\n " << indent2 << indent;
1251
+ stream << ' \n ' << std::string (4 , ' ' ) << " - axiom_in_model:\n "
1252
+ << std::string (6 , ' ' );
1257
1253
stream << to_string (axiom_in_model) << ' \n '
1258
- << indent2 << " - negated_axiom:\n "
1259
- << indent2 << indent << format (negaxiom) << ' \n ' ;
1260
- stream << indent2 << " - negated_axiom_with_concretized_arrays:\n "
1261
- << indent2 << indent << format (with_concretized_arrays) << ' \n ' ;
1254
+ << std::string ( 4 , ' ' ) << " - negated_axiom:\n "
1255
+ << std::string ( 6 , ' ' ) << format (negaxiom) << ' \n ' ;
1256
+ stream << std::string ( 4 , ' ' ) << " - negated_axiom_with_concretized_arrays:\n "
1257
+ << std::string ( 6 , ' ' ) << format (with_concretized_arrays) << ' \n ' ;
1262
1258
}
1263
1259
1264
1260
// / \return true if the current model satisfies all the axioms
@@ -1275,8 +1271,6 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1275
1271
const union_find_replacet &symbol_resolve)
1276
1272
{
1277
1273
const auto eom=messaget::eom;
1278
- static const std::string indent = " " ;
1279
- static const std::string indent2 = " " ;
1280
1274
// clang-format off
1281
1275
const auto gen_symbol = [&](const irep_idt &id, const typet &type)
1282
1276
{
@@ -1320,7 +1314,7 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1320
1314
exprt negaxiom = axiom_in_model.negation ();
1321
1315
negaxiom = simplify_expr (negaxiom, ns);
1322
1316
1323
- stream << indent << i << " .\n " ;
1317
+ stream << std::string ( 2 , ' ' ) << i << " .\n " ;
1324
1318
const exprt with_concretized_arrays =
1325
1319
substitute_array_access (negaxiom, gen_symbol, true );
1326
1320
debug_check_axioms_step (
@@ -1330,12 +1324,12 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1330
1324
const auto &witness =
1331
1325
find_counter_example (ns, ui, with_concretized_arrays, axiom.univ_var ))
1332
1326
{
1333
- stream << indent2 << " - violated_for: " << format (axiom. univ_var ) << " = "
1334
- << format (*witness) << eom;
1327
+ stream << std::string ( 4 , ' ' ) << " - violated_for: "
1328
+ << format (axiom. univ_var ) << " = " << format ( *witness) << eom;
1335
1329
violated[i]=*witness;
1336
1330
}
1337
1331
else
1338
- stream << indent2 << " - correct" << eom;
1332
+ stream << std::string ( 4 , ' ' ) << " - correct" << eom;
1339
1333
}
1340
1334
1341
1335
// Maps from indexes of violated not_contains axiom to a witness of violation
@@ -1352,16 +1346,16 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1352
1346
nc_axiom, univ_var, [&](const exprt &expr) {
1353
1347
return simplify_expr (get (expr), ns); });
1354
1348
1355
- stream << indent << i << " .\n " ;
1349
+ stream << std::string ( 2 , ' ' ) << i << " .\n " ;
1356
1350
debug_check_axioms_step (
1357
1351
stream, ns, nc_axiom, nc_axiom, negated_axiom, negated_axiom);
1358
1352
1359
1353
if (
1360
1354
const auto witness =
1361
1355
find_counter_example (ns, ui, negated_axiom, univ_var))
1362
1356
{
1363
- stream << indent2 << " - violated_for: " << univ_var. get_identifier ()
1364
- << " =" << format (*witness) << eom;
1357
+ stream << std::string ( 4 , ' ' ) << " - violated_for: "
1358
+ << univ_var. get_identifier () << " =" << format (*witness) << eom;
1365
1359
violated_not_contains[i]=*witness;
1366
1360
}
1367
1361
}
0 commit comments