-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (23 loc) · 958 Bytes
/
main.py
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
from QFA import LanguageChecker as Checker, GQFA, MM_1QFA as MM, PFA as PFA, MO_1QFA as MO
from QFA.LanguageGenerator import LanguageGenerator
def main():
pfa = PFA.example()
# MO.example()
mm_1qfa = MM.example()
gqfa = GQFA.example()
mm_checker = Checker.LanguageChecker(mm_1qfa, ["aa"], ["a"])
mm_checker.check_language()
print('MM-1QFA', mm_checker.accepted)
pfa_checker = Checker.LanguageChecker(pfa, ["aa"], ["ab"])
pfa_checker.check_language()
print('PFA', pfa_checker.accepted)
gqfa_checker = Checker.LanguageChecker(gqfa, ["aa", "aaa"], ["a"])
gqfa_checker.check_language()
print('GQFA', gqfa_checker.accepted)
lg = LanguageGenerator('(aa)*', 'a')
l, nl = lg.get_language_sample()
gqfa_checker_generated = Checker.LanguageChecker(gqfa, l, nl)
gqfa_checker_generated.check_language()
print('GQFA 2', gqfa_checker_generated.accepted)
if __name__ == "__main__":
main()