-
Notifications
You must be signed in to change notification settings - Fork 0
/
MTL_main.py
42 lines (37 loc) · 1.09 KB
/
MTL_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
from ACOW import *
# User defined automaton
def define_automaton():
a = automaton()
#sg = StateGen(3,'s','a')
a.INITIAL_STATE = 's2'
a.DEST_STATE = 's3'
#a.STATE, a.DELTA = sg.gen_aut()
a.STATE = {
's0':{'a0':0,'a1':0},
's1':{'a0':0,'a1':1},
's2':{'a0':1,'a1':0},
's3':{'a0':1,'a1':1},
}
a.DELTA = {
's0': {'s0','s1','s2','s3'},
's1': {'s0','s1','s2','s3'},
's2': {'s0','s1','s2','s3'},
's3': {'s0','s1','s2','s3'},
}
print(a)
return a
def main():
# a = define_automaton()
# a.init()
#a.show()# show a .pdf figure of the state space model
MTL = '( G[4] a1 )'
top_node = parser.parse(MTL)
cnt2observer = MTLparse.optimize() # comment this line if you don't want to optimze the AST
SCQ_size, _ = MTLparse.queue_size_assign()
MTLparse.gen_assembly()
solution = Traverse(cnt2observer,'signal_trace.txt')
print(solution.run())
#solution = Search(a,cnt2observer,agent='DES')
#solution.run(['s0','s0','s0','s1','s1','s1','s1','s1','s1','s1','s3','s2','s2','s3','s2','s3','s3','s3','s3','s2','s2','s3','s3','s3','s3','s0','s1','s1','s1','s0','s0'])
if __name__ == "__main__":
main()