Skip to content

Commit caaf1c0

Browse files
committed
Hanoi Omega-Automata as graphs
The HOAs generated by Spot are now transformed into a graph as an intermediate step.
1 parent 4b9a5c5 commit caaf1c0

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/temporal-logic/hoa.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,3 +543,22 @@ void hoat::output(std::ostream &out) const
543543

544544
out << "--END--\n";
545545
}
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+
}

src/temporal-logic/hoa.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Author: Daniel Kroening, dkr@amazon.com
99
#ifndef CPROVER_TEMPORAL_LOGIC_HOA_H
1010
#define CPROVER_TEMPORAL_LOGIC_HOA_H
1111

12+
#include <util/graph.h>
1213
#include <util/irep.h>
1314

1415
#include <cstdint>
@@ -68,6 +69,14 @@ class hoat
6869

6970
// atomic propositions
7071
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;
7180
};
7281

7382
#endif // CPROVER_TEMPORAL_LOGIC_HOA_H

0 commit comments

Comments
 (0)