20
20
#include < solvers/prop/literal_expr.h>
21
21
#include < solvers/prop/prop.h>
22
22
#include < solvers/prop/prop_conv.h>
23
+ #include < util/format.h>
23
24
24
25
#include " equation_conversion_exceptions.h"
25
26
#include " goto_symex_state.h"
@@ -423,7 +424,7 @@ void symex_target_equationt::convert_decls(
423
424
{
424
425
util_throw_with_nested (
425
426
equation_conversion_exceptiont (
426
- " Error converting decls for step" , step, ns ));
427
+ " Error converting decls for step" , step));
427
428
}
428
429
}
429
430
}
@@ -448,7 +449,7 @@ void symex_target_equationt::convert_guards(
448
449
{
449
450
util_throw_with_nested (
450
451
equation_conversion_exceptiont (
451
- " Error converting guard for step" , step, ns ));
452
+ " Error converting guard for step" , step));
452
453
}
453
454
}
454
455
}
@@ -475,7 +476,7 @@ void symex_target_equationt::convert_assumptions(
475
476
{
476
477
util_throw_with_nested (
477
478
equation_conversion_exceptiont (
478
- " Error converting assumptions for step" , step, ns ));
479
+ " Error converting assumptions for step" , step));
479
480
}
480
481
}
481
482
}
@@ -503,7 +504,7 @@ void symex_target_equationt::convert_goto_instructions(
503
504
{
504
505
util_throw_with_nested (
505
506
equation_conversion_exceptiont (
506
- " Error converting goto instructions for step" , step, ns ));
507
+ " Error converting goto instructions for step" , step));
507
508
}
508
509
}
509
510
}
@@ -582,7 +583,7 @@ void symex_target_equationt::convert_assertions(
582
583
{
583
584
util_throw_with_nested (
584
585
equation_conversion_exceptiont (
585
- " Error converting assertions for step" , step, ns ));
586
+ " Error converting assertions for step" , step));
586
587
}
587
588
588
589
// store disjunct
@@ -767,3 +768,101 @@ void symex_target_equationt::SSA_stept::output(
767
768
768
769
out << " Guard: " << from_expr (ns, source.pc ->function , guard) << ' \n ' ;
769
770
}
771
+
772
+ void symex_target_equationt::SSA_stept::output (std::ostream &out) const
773
+ {
774
+ if (source.is_set )
775
+ {
776
+ out << " Thread " << source.thread_nr ;
777
+
778
+ if (source.pc ->source_location .is_not_nil ())
779
+ out << " " << source.pc ->source_location << ' \n ' ;
780
+ else
781
+ out << ' \n ' ;
782
+ }
783
+
784
+ switch (type)
785
+ {
786
+ case goto_trace_stept::typet::ASSERT:
787
+ out << " ASSERT " << format (cond_expr) << ' \n ' ; break ;
788
+ case goto_trace_stept::typet::ASSUME:
789
+ out << " ASSUME " << format (cond_expr) << ' \n ' ; break ;
790
+ case goto_trace_stept::typet::LOCATION:
791
+ out << " LOCATION" << ' \n ' ; break ;
792
+ case goto_trace_stept::typet::INPUT:
793
+ out << " INPUT" << ' \n ' ; break ;
794
+ case goto_trace_stept::typet::OUTPUT:
795
+ out << " OUTPUT" << ' \n ' ; break ;
796
+
797
+ case goto_trace_stept::typet::DECL:
798
+ out << " DECL" << ' \n ' ;
799
+ out << format (ssa_lhs) << ' \n ' ;
800
+ break ;
801
+
802
+ case goto_trace_stept::typet::ASSIGNMENT:
803
+ out << " ASSIGNMENT (" ;
804
+ switch (assignment_type)
805
+ {
806
+ case assignment_typet::HIDDEN:
807
+ out << " HIDDEN" ;
808
+ break ;
809
+ case assignment_typet::STATE:
810
+ out << " STATE" ;
811
+ break ;
812
+ case assignment_typet::VISIBLE_ACTUAL_PARAMETER:
813
+ out << " VISIBLE_ACTUAL_PARAMETER" ;
814
+ break ;
815
+ case assignment_typet::HIDDEN_ACTUAL_PARAMETER:
816
+ out << " HIDDEN_ACTUAL_PARAMETER" ;
817
+ break ;
818
+ case assignment_typet::PHI:
819
+ out << " PHI" ;
820
+ break ;
821
+ case assignment_typet::GUARD:
822
+ out << " GUARD" ;
823
+ break ;
824
+ default :
825
+ {
826
+ }
827
+ }
828
+
829
+ out << " )\n " ;
830
+ break ;
831
+
832
+ case goto_trace_stept::typet::DEAD:
833
+ out << " DEAD\n " ; break ;
834
+ case goto_trace_stept::typet::FUNCTION_CALL:
835
+ out << " FUNCTION_CALL\n " ; break ;
836
+ case goto_trace_stept::typet::FUNCTION_RETURN:
837
+ out << " FUNCTION_RETURN\n " ; break ;
838
+ case goto_trace_stept::typet::CONSTRAINT:
839
+ out << " CONSTRAINT\n " ; break ;
840
+ case goto_trace_stept::typet::SHARED_READ:
841
+ out << " SHARED READ\n " ; break ;
842
+ case goto_trace_stept::typet::SHARED_WRITE:
843
+ out << " SHARED WRITE\n " ; break ;
844
+ case goto_trace_stept::typet::ATOMIC_BEGIN:
845
+ out << " ATOMIC_BEGIN\n " ; break ;
846
+ case goto_trace_stept::typet::ATOMIC_END:
847
+ out << " AUTOMIC_END\n " ; break ;
848
+ case goto_trace_stept::typet::SPAWN:
849
+ out << " SPAWN\n " ; break ;
850
+ case goto_trace_stept::typet::MEMORY_BARRIER:
851
+ out << " MEMORY_BARRIER\n " ; break ;
852
+ case goto_trace_stept::typet::GOTO:
853
+ out << " IF " << format (cond_expr) << " GOTO\n " ; break ;
854
+
855
+ default : UNREACHABLE;
856
+ }
857
+
858
+ if (is_assert () || is_assume () || is_assignment () || is_constraint ())
859
+ out << format (cond_expr) << ' \n ' ;
860
+
861
+ if (is_assert () || is_constraint ())
862
+ out << comment << ' \n ' ;
863
+
864
+ if (is_shared_read () || is_shared_write ())
865
+ out << format (ssa_lhs) << ' \n ' ;
866
+
867
+ out << " Guard: " << format (guard) << ' \n ' ;
868
+ }
0 commit comments