-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
33 lines (22 loc) · 772 Bytes
/
Main.py
File metadata and controls
33 lines (22 loc) · 772 Bytes
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
from FileReader import readFile
from Minimizer import Minimizer
### READ AUTOMATON (The test files must be in the root folder)###
DFA2 = readFile("test2.txt")
DFA = readFile("test1.txt")
# print(DFA)
# DFA.show_table()
### MINIMIZE AUTOMATON ###
minimizer = Minimizer()
DFA = minimizer.minimize(DFA)
print(DFA)
DFA.show_table()
## Testing string acceptance in test1.txt ##
inputString=input("Introduce a string to verify if is accepted: ")
DFA.process(inputString)
print ("-----------------------------------------------------------------------------------")
DFA2 = minimizer.minimize(DFA2)
print(DFA2)
DFA2.show_table()
## Testing string acceptance in test2.txt ##
inputString2=input("Introduce a string to verify if is accepted: ")
DFA2.process(inputString2)