-
Notifications
You must be signed in to change notification settings - Fork 0
/
buchi.hpp
58 lines (48 loc) · 1.22 KB
/
buchi.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef BUCHI_HPP
#define BUCHI_HPP
#include "gba.hpp"
class BA {
public:
struct state;
struct single_transition {
DynBitset pos;
DynBitset neg;
state *to;
single_transition(const DynBitset &pos_, const DynBitset &neg_, state *to_)
: pos(pos_), neg(neg_), to(to_) {}
single_transition(single_transition &&other) = default;
bool operator==(const single_transition &other) const {
return pos == other.pos && neg == other.neg && to == other.to;
}
bool subsume(const single_transition &other) const {
return pos.subset(other.pos) && neg == other.neg && to == other.to;
}
};
typedef std::list<single_transition> transition;
struct state {
size_t id;
bool is_final;
transition ts;
state() : is_final(false), ts() {}
state(state &&other) = default;
bool operator==(const state &other) const;
};
private:
std::vector<state *> states;
std::vector<state *> initial;
public:
BA(const GBA &gba);
~BA() {
for (auto s : states) {
delete s;
}
}
size_t nStates() const {
return states.size();
}
const std::vector<state *> &initialStates() const {
return initial;
}
void show(FILE *fp, const Numbering &map) const;
};
#endif