@@ -972,42 +972,41 @@ static exprt get_char_array_and_concretize(
972
972
const array_string_exprt &arr)
973
973
{
974
974
const auto &eom = messaget::eom;
975
- static const std::string indent (" " );
976
975
stream << " - " << format (arr) << " :\n " ;
977
- stream << indent << indent << " - type: " << format (arr.type ()) << eom;
976
+ stream << std::string ( 4 , ' ' ) << " - type: " << format (arr.type ()) << eom;
978
977
const auto arr_model_opt =
979
978
get_array (super_get, ns, stream, arr);
980
979
if (arr_model_opt)
981
980
{
982
- stream << indent << indent << " - char_array: " << format (*arr_model_opt)
981
+ stream << std::string ( 4 , ' ' ) << " - char_array: " << format (*arr_model_opt)
983
982
<< ' \n ' ;
984
- stream << indent << indent << " - type : " << format (arr_model_opt->type ())
983
+ stream << std::string ( 4 , ' ' ) << " - type : " << format (arr_model_opt->type ())
985
984
<< eom;
986
985
const exprt simple = simplify_expr (*arr_model_opt, ns);
987
- stream << indent << indent << " - simplified_char_array: " << format (simple)
986
+ stream << std::string ( 4 , ' ' ) << " - simplified_char_array: " << format (simple)
988
987
<< eom;
989
988
if (
990
989
const auto concretized_array = get_array (
991
990
super_get, ns, stream, to_array_string_expr (simple)))
992
991
{
993
- stream << indent << indent
992
+ stream << std::string ( 4 , ' ' )
994
993
<< " - concretized_char_array: " << format (*concretized_array)
995
994
<< eom;
996
995
997
996
if (
998
997
const auto array_expr =
999
998
expr_try_dynamic_cast<array_exprt>(*concretized_array))
1000
999
{
1001
- stream << indent << indent << " - as_string: \" "
1000
+ stream << std::string ( 4 , ' ' ) << " - as_string: \" "
1002
1001
<< string_of_array (*array_expr) << " \"\n " ;
1003
1002
}
1004
1003
else
1005
- stream << indent << " - warning: not an array" << eom;
1004
+ stream << std::string ( 2 , ' ' ) << " - warning: not an array" << eom;
1006
1005
return *concretized_array;
1007
1006
}
1008
1007
return simple;
1009
1008
}
1010
- stream << indent << indent << " - incomplete model" << eom;
1009
+ stream << std::string ( 4 , ' ' ) << " - incomplete model" << eom;
1011
1010
return arr;
1012
1011
}
1013
1012
@@ -1021,8 +1020,6 @@ void debug_model(
1021
1020
const std::vector<symbol_exprt> &boolean_symbols,
1022
1021
const std::vector<symbol_exprt> &index_symbols)
1023
1022
{
1024
- static const std::string indent (" " );
1025
-
1026
1023
stream << " debug_model:" << ' \n ' ;
1027
1024
for (const auto &pointer_array : generator.array_pool .get_arrays_of_pointers ())
1028
1025
{
@@ -1031,8 +1028,8 @@ void debug_model(
1031
1028
super_get, ns, stream, arr);
1032
1029
1033
1030
stream << " - " << format (arr) << " :\n "
1034
- << indent << " - pointer: " << format (pointer_array.first ) << " \n "
1035
- << indent << " - model: " << format (model) << messaget::eom;
1031
+ << " - pointer: " << format (pointer_array.first ) << " \n "
1032
+ << " - model: " << format (model) << messaget::eom;
1036
1033
}
1037
1034
1038
1035
for (const auto &symbol : boolean_symbols)
@@ -1232,16 +1229,15 @@ static void debug_check_axioms_step(
1232
1229
const exprt &negaxiom,
1233
1230
const exprt &with_concretized_arrays)
1234
1231
{
1235
- static const std::string indent = " " ;
1236
- static const std::string indent2 = " " ;
1237
- stream << indent2 << " - axiom:\n " << indent2 << indent;
1232
+ stream << std::string (4 , ' ' ) << " - axiom:\n " << std::string (6 , ' ' );
1238
1233
stream << to_string (axiom);
1239
- stream << ' \n ' << indent2 << " - axiom_in_model:\n " << indent2 << indent;
1234
+ stream << ' \n ' << std::string (4 , ' ' ) << " - axiom_in_model:\n "
1235
+ << std::string (6 , ' ' );
1240
1236
stream << to_string (axiom_in_model) << ' \n '
1241
- << indent2 << " - negated_axiom:\n "
1242
- << indent2 << indent << format (negaxiom) << ' \n ' ;
1243
- stream << indent2 << " - negated_axiom_with_concretized_arrays:\n "
1244
- << indent2 << indent << format (with_concretized_arrays) << ' \n ' ;
1237
+ << std::string ( 4 , ' ' ) << " - negated_axiom:\n "
1238
+ << std::string ( 6 , ' ' ) << format (negaxiom) << ' \n ' ;
1239
+ stream << std::string ( 4 , ' ' ) << " - negated_axiom_with_concretized_arrays:\n "
1240
+ << std::string ( 6 , ' ' ) << format (with_concretized_arrays) << ' \n ' ;
1245
1241
}
1246
1242
1247
1243
// / \return true if the current model satisfies all the axioms
@@ -1256,8 +1252,6 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1256
1252
const union_find_replacet &symbol_resolve)
1257
1253
{
1258
1254
const auto eom=messaget::eom;
1259
- static const std::string indent = " " ;
1260
- static const std::string indent2 = " " ;
1261
1255
// clang-format off
1262
1256
const auto gen_symbol = [&](const irep_idt &id, const typet &type)
1263
1257
{
@@ -1300,7 +1294,7 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1300
1294
exprt negaxiom = axiom_in_model.negation ();
1301
1295
negaxiom = simplify_expr (negaxiom, ns);
1302
1296
1303
- stream << indent << i << " .\n " ;
1297
+ stream << std::string ( 2 , ' ' ) << i << " .\n " ;
1304
1298
const exprt with_concretized_arrays =
1305
1299
substitute_array_access (negaxiom, gen_symbol, true );
1306
1300
debug_check_axioms_step (
@@ -1310,12 +1304,12 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1310
1304
const auto &witness =
1311
1305
find_counter_example (ns, with_concretized_arrays, axiom.univ_var ))
1312
1306
{
1313
- stream << indent2 << " - violated_for: " << format (axiom. univ_var ) << " = "
1314
- << format (*witness) << eom;
1307
+ stream << std::string ( 4 , ' ' ) << " - violated_for: "
1308
+ << format (axiom. univ_var ) << " = " << format ( *witness) << eom;
1315
1309
violated[i]=*witness;
1316
1310
}
1317
1311
else
1318
- stream << indent2 << " - correct" << eom;
1312
+ stream << std::string ( 4 , ' ' ) << " - correct" << eom;
1319
1313
}
1320
1314
1321
1315
// Maps from indexes of violated not_contains axiom to a witness of violation
@@ -1332,16 +1326,16 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
1332
1326
nc_axiom, univ_var, [&](const exprt &expr) {
1333
1327
return simplify_expr (get (expr), ns); });
1334
1328
1335
- stream << indent << i << " .\n " ;
1329
+ stream << std::string ( 2 , ' ' ) << i << " .\n " ;
1336
1330
debug_check_axioms_step (
1337
1331
stream, nc_axiom, nc_axiom, negated_axiom, negated_axiom);
1338
1332
1339
1333
if (
1340
1334
const auto witness =
1341
1335
find_counter_example (ns, negated_axiom, univ_var))
1342
1336
{
1343
- stream << indent2 << " - violated_for: " << univ_var. get_identifier ()
1344
- << " =" << format (*witness) << eom;
1337
+ stream << std::string ( 4 , ' ' ) << " - violated_for: "
1338
+ << univ_var. get_identifier () << " =" << format (*witness) << eom;
1345
1339
violated_not_contains[i]=*witness;
1346
1340
}
1347
1341
}
0 commit comments