/
main.py
45 lines (34 loc) · 1.01 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#coding:utf-8
from Classe_Automate import *
from L_star import *
from os import listdir
from os.path import isfile, join
import sys
import datetime
# Tests (Victor)
#automate1 = Automate.importFromFile("DataAutomate/141_Cambodian.fsa.att")
def run(fct):
false = []
mypath = "DataAutomate"
count = 0
for f in listdir(mypath):
if isfile(join(mypath, f)):
count += 1
sys.stdout.write(f+" ")
a = Automate.importFromFile(join(mypath, f))
#print a
oracle = Oracle(a)
alphabet = a.getAlphabet()
l_star = L_star(alphabet, oracle)
if fct == "run":
res = l_star.run()
elif fct == "run_without_equivalence":
res = l_star.run_without_equivalence()
if not res:
false.append(f)
print "##", len(false), '/', count, false
print "#Run with equivalence"
run("run")
for i in range(5):
print "#Run_without_equivalence", i
run("run_without_equivalence")