File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -543,3 +543,22 @@ void hoat::output(std::ostream &out) const
543
543
544
544
out << " --END--\n " ;
545
545
}
546
+
547
+ grapht<graph_nodet<hoat::graph_edget>> hoat::graph () const
548
+ {
549
+ grapht<graph_nodet<hoat::graph_edget>> graph;
550
+
551
+ graph.resize (numeric_cast_v<std::size_t >(max_state_number () + 1 ));
552
+
553
+ for (auto &state : body)
554
+ {
555
+ for (auto &edge : state.second )
556
+ for (auto &dest : edge.dest_states )
557
+ {
558
+ graph.add_edge (state.first .number , dest);
559
+ graph.edge (state.first .number , dest).label = edge.label ;
560
+ }
561
+ }
562
+
563
+ return graph;
564
+ }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Author: Daniel Kroening, dkr@amazon.com
9
9
#ifndef CPROVER_TEMPORAL_LOGIC_HOA_H
10
10
#define CPROVER_TEMPORAL_LOGIC_HOA_H
11
11
12
+ #include < util/graph.h>
12
13
#include < util/irep.h>
13
14
14
15
#include < cstdint>
@@ -68,6 +69,14 @@ class hoat
68
69
69
70
// atomic propositions
70
71
std::map<intt, std::string> ap_map;
72
+
73
+ // convert into a graph
74
+ struct graph_edget
75
+ {
76
+ labelt label;
77
+ };
78
+
79
+ grapht<graph_nodet<graph_edget>> graph () const ;
71
80
};
72
81
73
82
#endif // CPROVER_TEMPORAL_LOGIC_HOA_H
You can’t perform that action at this time.
0 commit comments