13
13
#include < util/string2int.h>
14
14
#include < util/i2string.h>
15
15
#include < util/source_location.h>
16
+ #include < util/string_utils.h>
16
17
#include < util/time_stopping.h>
17
18
#include < util/message.h>
18
19
#include < util/json.h>
@@ -131,6 +132,8 @@ void bmct::output_graphml(
131
132
graphml_witnesst graphml_witness (ns);
132
133
if (result==UNSAFE)
133
134
graphml_witness (safety_checkert::error_trace);
135
+ else if (result==SAFE)
136
+ graphml_witness (equation);
134
137
else
135
138
return ;
136
139
@@ -379,8 +382,9 @@ void bmct::show_program()
379
382
{
380
383
std::string string_value;
381
384
languages.from_expr (step.ssa_lhs , string_value);
382
- std::cout << " (" << count << " ) SHARED_" << (step.is_shared_write ()?" WRITE" :" READ" ) << " ("
383
- << string_value <<" ) " << " \n " ;
385
+ std::cout << " (" << count << " ) SHARED_"
386
+ << (step.is_shared_write ()?" WRITE" :" READ" )
387
+ << " (" << string_value <<" )\n " ;
384
388
385
389
if (!step.guard .is_true ())
386
390
{
@@ -544,6 +548,7 @@ safety_checkert::resultt bmct::run(
544
548
symex.remaining_vccs ==0 )
545
549
{
546
550
report_success ();
551
+ output_graphml (SAFE, goto_functions);
547
552
return safety_checkert::SAFE;
548
553
}
549
554
@@ -619,6 +624,7 @@ safety_checkert::resultt bmct::stop_on_fail(
619
624
{
620
625
case decision_proceduret::D_UNSATISFIABLE:
621
626
report_success ();
627
+ output_graphml (SAFE, goto_functions);
622
628
return SAFE;
623
629
624
630
case decision_proceduret::D_SATISFIABLE:
@@ -661,13 +667,11 @@ Function: bmct::setup_unwind
661
667
void bmct::setup_unwind ()
662
668
{
663
669
const std::string &set=options.get_option (" unwindset" );
664
- std::string::size_type length=set.length ();
670
+ std::vector<std::string> unwindset_loops;
671
+ split_string (set, ' ,' , unwindset_loops, true , true );
665
672
666
- for (std::string::size_type idx= 0 ; idx<length; idx++ )
673
+ for (auto & val : unwindset_loops )
667
674
{
668
- std::string::size_type next=set.find (" ," , idx);
669
- std::string val=set.substr (idx, next-idx);
670
-
671
675
unsigned thread_nr;
672
676
bool thread_nr_set=false ;
673
677
@@ -691,9 +695,6 @@ void bmct::setup_unwind()
691
695
else
692
696
symex.set_unwind_loop_limit (id, uw);
693
697
}
694
-
695
- if (next==std::string::npos) break ;
696
- idx=next;
697
698
}
698
699
699
700
if (options.get_option (" unwind" )!=" " )
0 commit comments