-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
62 lines (57 loc) · 1.48 KB
/
main.cpp
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
61
62
#include <iostream>
#include <list>
#include <string>
#include <iterator>
#include "otomatobj.h"
#include <vector>
using namespace std;
int main()
{
vector<string> m_alphabet;
m_alphabet.push_back("A");
m_alphabet.push_back("B");
m_alphabet.push_back("C");
m_alphabet.push_back("D");
m_alphabet.push_back("E");
m_alphabet.push_back("F");
m_alphabet.push_back("G");
m_alphabet.push_back("H");
vector<char> m_state;
m_state.push_back('0');
m_state.push_back('1');
string m_start = "A";
vector<string> m_end;
m_end.push_back("C");
otomatObj obj;
obj.setAlphabet(m_alphabet);
obj.setState(m_state);
obj.setStart(m_start);
obj.setEnd(m_end);
/*
obj.addRule("S", 'a', "S1");
obj.addRule("S1", 'a', "S1");
obj.addRule("S1", 'a', "S2");
obj.addRule("S2", 'b', "S3");
obj.addRule("S3", 'c', "S3");
obj.addRule("S3", 'c', "S4");
*/
//obj.buildOtomat();
obj.addRule("A", '0', "B");
obj.addRule("A", '1', "F");
obj.addRule("B", '1', "C");
obj.addRule("B", '0', "G");
obj.addRule("C", '1', "C");
obj.addRule("C", '0', "A");
obj.addRule("D", '0', "C");
obj.addRule("D", '1', "G");
obj.addRule("E", '1', "F");
obj.addRule("E", '0', "H");
obj.addRule("F", '1', "G");
obj.addRule("F", '0', "C");
obj.addRule("G", '0', "G");
obj.addRule("G", '1', "E");
obj.addRule("H", '0', "G");
obj.addRule("H", '1', "C");
obj.minimum();
return 0;
}