-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUltimateScript.txt
183 lines (179 loc) · 3.05 KB
/
UltimateScript.txt
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
NestedWordAutomaton palindromeChecker = (
callAlphabet = { a b },
internalAlphabet = { c d },
returnAlphabet = { e f },
states = {f0A f0B f0C f1A f1B f1C s0 s1 t00 t01 t10 t11},
initialStates = {f0A f0B f0C},
finalStates = {s0 t11},
callTransitions = {
(f0A a f0A)
(f0A a f0B)
(f0A a f0C)
(f0A a s0)
(f0B b f0A)
(f0B b f0B)
(f0B b f0C)
(f0B b s0)
(f0C a f1A)
(f0C a f1B)
(f0C a f1C)
(f0C a s1)
(f1A b f0A)
(f1A b f0B)
(f1A a f1C)
(f1A b s0)
(f1B a f1A)
(f1B a f1B)
(f1B b f0C)
(f1B a s1)
(f1C b f1A)
(f1C b f1B)
(f1C b f1C)
(f1C b s1)
},
internalTransitions = {
(f0A c s0)
(f0A c s1)
(f0A d s0)
(f1A c s0)
(f1A c s1)
(f1A d s0)
(f0B c s0)
(f0B c s1)
(f0B d s0)
(f1B c s1)
(f1B d s1)
(f1B d s0)
(f0C c s1)
(f0C d s1)
(f0C d s0)
(f1C c s1)
(f1C d s1)
(f1C d s0)
(f0A c t00)
(f0A d t01)
(f0B c t00)
(f0B d t01)
(f0C c t00)
(f0C d t01)
(f1A c t10)
(f1A d t11)
(f1B c t10)
(f1B d t11)
(f1C c t10)
(f1C d t11)
},
returnTransitions = {
(f0A f0A e t00)
(f0A f0B e t00)
(f0A f0C e t00)
(f0A f1A e t00)
(f0A f1B e t00)
(f0A f1C e t00)
(f0B f0A e t00)
(f0B f0B e t00)
(f0B f0C e t00)
(f0B f1A e t00)
(f0B f1B e t00)
(f0B f1C e t00)
(f0C f0A e t00)
(f0C f0B e t00)
(f0C f0C e t00)
(f0C f1A e t00)
(f0C f1B e t00)
(f0C f1C e t00)
(f1A f0A e t00)
(f1A f0B e t10)
(f1A f0C e t10)
(f1A f1A e t10)
(f1A f1B e t10)
(f1A f1C e t10)
(f1B f0A e t10)
(f1B f0B e t10)
(f1B f0C e t10)
(f1B f1A e t10)
(f1B f1B e t10)
(f1B f1C e t10)
(f1C f0A e t10)
(f1C f0B e t10)
(f1C f0C e t10)
(f1C f1A e t10)
(f1C f1B e t10)
(f1C f1C e t10)
(f0A f0A f t01)
(f0A f0B f t01)
(f0A f0C f t01)
(f0A f1A f t01)
(f0A f1B f t01)
(f0A f1C f t01)
(f0B f0A f t01)
(f0B f0B f t01)
(f0B f0C f t01)
(f0B f1A f t01)
(f0B f1B f t01)
(f0B f1C f t01)
(f0C f0A f t01)
(f0C f0B f t01)
(f0C f0C f t01)
(f0C f1A f t01)
(f0C f1B f t01)
(f0C f1C f t01)
(f1A f0A f t01)
(f1A f0B f t11)
(f1A f0C f t11)
(f1A f1A f t11)
(f1A f1B f t11)
(f1A f1C f t11)
(f1B f0A f t11)
(f1B f0B f t11)
(f1B f0C f t11)
(f1B f1A f t11)
(f1B f1B f t11)
(f1B f1C f t11)
(f1C f0A f t11)
(f1C f0B f t11)
(f1C f0C f t11)
(f1C f1A f t11)
(f1C f1B f t11)
(f1C f1C f t11)
(s0 f0A e s0)
(s0 f1A e s0)
(s0 f0B f s0)
(s0 f1B f s0)
(s0 f0C e s1)
(s0 f1C e s1)
(s1 f0A f s0)
(s1 f1A f s0)
(s1 f0B e s1)
(s1 f1B e s1)
(s1 f0C f s1)
(s1 f1C f s1)
(t00 f0A e t00)
(t00 f0A f t01)
(t00 f1A e t00)
(t00 f1A f t01)
(t00 f0C e t10)
(t00 f0C f t11)
(t00 f1C e t10)
(t00 f1C f t11)
(t01 f0B e t00)
(t01 f0B f t01)
(t01 f1B e t00)
(t01 f1B f t01)
(t10 f0B e t10)
(t10 f0B f t11)
(t10 f1B e t10)
(t10 f1B f t11)
(t11 f0A e t00)
(t11 f0A f t01)
(t11 f1A e t00)
(t11 f1A f t01)
(t11 f0C e t10)
(t11 f0C f t11)
(t11 f1C e t10)
(t11 f1C f t11)
}
);
NestedWordAutomaton detPalCheck = determinize(palindromeChecker);
print(numberOfStates(palindromeChecker));
print(numberOfStates(detPalCheck));