-
Notifications
You must be signed in to change notification settings - Fork 0
/
automata.h
60 lines (41 loc) · 1.32 KB
/
automata.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef AUTOMATA_H
#define AUTOMATA_H
#include <fstream>
#include <iostream>
#include <vector>
#include <map>
#include <iomanip>
#include <regex>
#include <string>
#include <algorithm>
using namespace std;
class Automata{
public:
Automata(string);
void display() const;
void transitions_table() ;
bool is_an_asynchronous_automaton() const;
void asynchronous_to_synchronous();
void synchronous_transition_table() ;
bool is_complete() const ;
void return_formated_index(string ,string&,int&);
int conver_transiiton_letter_to_int(string, int );
int conver_string_to_int(string, int);
std::vector<std::string> split_string(std::string );
std::string concate_vector(std::vector<std::string>);
std::vector<std::string> remove_duplicate_vector(std::vector<std::string> );
std::string remove_duplicate_string(std::string );
private:
void get_data_from_file(string);
void display_transition_table( ) const;
void recursive(int ,int ,int ,vector<string> _transitions,vector<string> &) const;
protected:
int _nb_transitions_available;
int _nb_states;
std::vector<std::string> _init_states;
std::vector<std::string> _final_states;
int _nb_transitions;
std::vector<std::string> _transitions;
std::map<int,std::vector<std::vector<std::string> > > _transitions_table;
};
#endif