@@ -69,7 +69,7 @@ Author: Daniel Kroening, Peter Schrammel
69
69
#define FILTER_ASSERTIONS 1
70
70
71
71
twols_parse_optionst::twols_parse_optionst (int argc, const char **argv):
72
- parse_options_baset(TWOLS_OPTIONS, argc, argv),
72
+ parse_options_baset(TWOLS_OPTIONS, argc, argv, " 2LS " TWOLS_VERSION ),
73
73
messaget(ui_message_handler),
74
74
ui_message_handler(cmdline, " 2LS " TWOLS_VERSION),
75
75
recursion_detected(false ),
@@ -630,34 +630,43 @@ int twols_parse_optionst::doit()
630
630
// do actual analysis
631
631
switch ((*checker)(goto_model))
632
632
{
633
- case property_checkert:: resultt::PASS:
633
+ case resultt::PASS:
634
634
if (report_assertions)
635
- report_properties (options, goto_model, checker->property_map );
635
+ report_properties (
636
+ options,
637
+ goto_model,
638
+ checker->property_map ,
639
+ checker->traces );
636
640
report_success ();
637
641
if (cmdline.isset (" graphml-witness" ))
638
642
output_graphml_proof (options, goto_model, *checker);
639
643
retval=0 ;
640
644
break ;
641
645
642
- case property_checkert:: resultt::FAIL:
646
+ case resultt::FAIL:
643
647
{
644
648
if (report_assertions)
645
- report_properties (options, goto_model, checker->property_map );
649
+ report_properties (
650
+ options,
651
+ goto_model,
652
+ checker->property_map ,
653
+ checker->traces );
646
654
647
655
// validate trace
648
656
bool trace_valid=false ;
649
657
for (const auto &p : checker->property_map )
650
658
{
651
- if (p.second .result !=property_checkert::resultt ::FAIL)
659
+ if (p.second .status !=property_statust ::FAIL)
652
660
continue ;
653
661
662
+ goto_tracet trace=checker->traces [p.first ];
654
663
if (options.get_bool_option (" trace" ))
655
- show_counterexample (goto_model, p. second . error_trace );
664
+ show_counterexample (goto_model, trace );
656
665
657
666
trace_valid=
658
- !p. second . error_trace .steps .empty () &&
667
+ !trace .steps .empty () &&
659
668
(options.get_bool_option (" nontermination" ) ||
660
- p. second . error_trace .steps .back ().is_assert ());
669
+ trace .steps .back ().is_assert ());
661
670
break ;
662
671
}
663
672
@@ -678,9 +687,13 @@ int twols_parse_optionst::doit()
678
687
retval=10 ;
679
688
break ;
680
689
}
681
- case property_checkert:: resultt::UNKNOWN:
690
+ case resultt::UNKNOWN:
682
691
if (report_assertions)
683
- report_properties (options, goto_model, checker->property_map );
692
+ report_properties (
693
+ options,
694
+ goto_model,
695
+ checker->property_map ,
696
+ checker->traces );
684
697
retval=5 ;
685
698
report_unknown ();
686
699
break ;
@@ -693,6 +706,7 @@ int twols_parse_optionst::doit()
693
706
{
694
707
checker->instrument_and_output (
695
708
goto_model,
709
+ ui_message_handler,
696
710
ui_message_handler.get_verbosity ());
697
711
}
698
712
@@ -1128,10 +1142,7 @@ bool twols_parse_optionst::process_goto_program(
1128
1142
1129
1143
if (cmdline.isset (" show-properties" ))
1130
1144
{
1131
- show_properties (
1132
- goto_model,
1133
- get_message_handler (),
1134
- ui_message_handler.get_ui ());
1145
+ show_properties (goto_model, ui_message_handler);
1135
1146
return true ;
1136
1147
}
1137
1148
@@ -1143,8 +1154,7 @@ bool twols_parse_optionst::process_goto_program(
1143
1154
{
1144
1155
show_goto_functions (
1145
1156
goto_model,
1146
- get_message_handler (),
1147
- ui_message_handler.get_ui (),
1157
+ ui_message_handler,
1148
1158
false );
1149
1159
return true ;
1150
1160
}
@@ -1179,9 +1189,10 @@ bool twols_parse_optionst::process_goto_program(
1179
1189
void twols_parse_optionst::report_properties (
1180
1190
const optionst &options,
1181
1191
const goto_modelt &goto_model,
1182
- const property_checkert::property_mapt &property_map)
1192
+ const propertiest &property_map,
1193
+ const tracest &traces)
1183
1194
{
1184
- for (property_checkert::property_mapt ::const_iterator
1195
+ for (propertiest ::const_iterator
1185
1196
it=property_map.begin ();
1186
1197
it!=property_map.end ();
1187
1198
it++)
@@ -1193,7 +1204,7 @@ void twols_parse_optionst::report_properties(
1193
1204
#endif
1194
1205
1195
1206
if (!options.get_bool_option (" all-properties" ) &&
1196
- it->second .result !=property_checkert::resultt ::FAIL)
1207
+ it->second .status !=property_statust ::FAIL)
1197
1208
continue ;
1198
1209
1199
1210
if (ui_message_handler.get_ui ()==ui_message_handlert::uit::XML_UI)
@@ -1202,27 +1213,27 @@ void twols_parse_optionst::report_properties(
1202
1213
xml_result.set_attribute (" property" , id2string (it->first ));
1203
1214
xml_result.set_attribute (
1204
1215
" status" ,
1205
- property_checkert:: as_string (it->second .result ));
1216
+ as_string (it->second .status ));
1206
1217
std::cout << xml_result << " \n " ;
1207
1218
}
1208
1219
else
1209
1220
{
1210
1221
status () << " [" << it->first << " ] "
1211
- << it->second .location ->source_location .get_comment ()
1222
+ << it->second .pc ->source_location .get_comment ()
1212
1223
<< " : "
1213
- << property_checkert:: as_string (it->second .result )
1224
+ << as_string (it->second .status )
1214
1225
<< eom;
1215
1226
}
1216
1227
1217
1228
if (options.get_bool_option (" trace" ) &&
1218
- it->second .result ==property_checkert::resultt ::FAIL)
1219
- show_counterexample (goto_model, it->second . error_trace );
1229
+ it->second .status ==property_statust ::FAIL)
1230
+ show_counterexample (goto_model, traces. at ( it->first ) );
1220
1231
if (cmdline.isset (" json-cex" ) &&
1221
- it->second .result ==property_checkert::resultt ::FAIL)
1232
+ it->second .status ==property_statust ::FAIL)
1222
1233
output_json_cex (
1223
1234
options,
1224
1235
goto_model,
1225
- it->second . error_trace ,
1236
+ traces. at ( it->first ) ,
1226
1237
id2string (it->first ));
1227
1238
}
1228
1239
@@ -1233,14 +1244,15 @@ void twols_parse_optionst::report_properties(
1233
1244
unsigned failed=0 ;
1234
1245
unsigned unknown=0 ;
1235
1246
1236
- for (property_checkert::property_mapt ::const_iterator
1247
+ for (propertiest ::const_iterator
1237
1248
it=property_map.begin ();
1238
1249
it!=property_map.end ();
1239
1250
it++)
1240
1251
{
1241
- if (it->second .result ==property_checkert::resultt::UNKNOWN)
1252
+ if (it->second .status ==property_statust::UNKNOWN ||
1253
+ it->second .status ==property_statust::NOT_CHECKED)
1242
1254
unknown++;
1243
- if (it->second .result ==property_checkert::resultt ::FAIL)
1255
+ if (it->second .status ==property_statust ::FAIL)
1244
1256
failed++;
1245
1257
}
1246
1258
@@ -1309,15 +1321,15 @@ void twols_parse_optionst::output_graphml_cex(
1309
1321
{
1310
1322
for (const auto &p : summary_checker.property_map )
1311
1323
{
1312
- if (p.second .result !=property_checkert::resultt ::FAIL)
1324
+ if (p.second .status !=property_statust ::FAIL)
1313
1325
continue ;
1314
1326
1315
1327
const namespacet ns (goto_model.symbol_table );
1316
1328
const std::string graphml=options.get_option (" graphml-witness" );
1317
1329
if (!graphml.empty ())
1318
1330
{
1319
1331
graphml_witnesst graphml_witness (ns);
1320
- graphml_witness (p. second . error_trace );
1332
+ graphml_witness (summary_checker. traces . at (p. first ) );
1321
1333
1322
1334
if (graphml==" -" )
1323
1335
write_graphml (graphml_witness.graph (), std::cout);
0 commit comments