-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnfa.h
35 lines (23 loc) · 1.36 KB
/
nfa.h
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
#ifndef DFA_NFA_H
#define DFA_NFA_H
#include "dfa.h"
class NFA : protected FiniteAutomata<std::set<int>> {
private:
std::set<int> create_initial_state();
bool is_dfa_state_final(const std::set<int> &_dfa_state);
std::map<std::set<int>, std::vector<std::set<int>>> create_transition_graph(const std::set<int> &_initial_state);
std::pair<std::set<int>, std::map<int, std::vector<int>>>
transition_graph_updated(const std::set<int> &_old_initial_state,
const std::map<std::set<int>, std::vector<std::set<int>>> &nfa_transition_graph);
static int
add_to_rename_table(const std::set<int> &_state, int &_new_state_name, std::set<std::set<int>> &_added_states,
std::map<std::set<int>, int> &_rename_table);
public:
NFA(int _init_state, int _alphabet_number, std::set<int> &_final_states,
std::map<int, std::vector<std::set<int>>> &_transition_graph) : FiniteAutomata<std::set<int>>(_init_state,
_alphabet_number,
_final_states,
_transition_graph) {};
DFA convert_to_dfa();
};
#endif