scc.test 3.44 KB
Newer Older
1
#!/bin/sh
2
# -*- coding: utf-8 -*-
3
# Copyright (C) 2009, 2015, 2017 Laboratoire de Recherche et Developpement de
4
5
6
7
8
9
# l'Epita
#
# This file is part of Spot, a model checking library.
#
# Spot is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
12
13
14
15
16
17
18
# (at your option) any later version.
#
# Spot is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
19
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21
22
23
24

. ./defs

set -e

Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
25
26
27
28
29
cat >formulas<<EOF
((a U c) U b) & (b U c),15,6,5
b U a,3,2,2
0,0,1,1
(Gb | F!a) W GFc,22,6,5
30
(!a & G(Ga | F(!a & b))) | (a & F(F!a & G(a | !b))),16,7,6
31
EOF
32

33
run 0 ltl2tgba --low --any --stats='%f,%e,%s,%c' -F formulas/1 >out
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
34
35
cat out
diff out formulas
36
37
38
39
40
41
42
43
44
45
46

ltl2tgba 'a W b' > aut

cat >ref<<EOF
HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc deterministic
47
properties: terminal
48
49
50
51
52
53
54
55
56
--BODY--
State: 0
[1] 1
[0&!1] 0
State: 1 {0}
[t] 1
--END--
EOF

57
run 0 autfilt --decompose-scc=a0 aut> out
58
59
60
61
62
63
64
65
66
67
68
cat out
diff out ref

cat >ref<<EOF
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc colored
69
properties: deterministic weak
70
71
72
73
74
75
--BODY--
State: 0 {0}
[0&!1] 0
--END--
EOF

76
run 0 autfilt --decompose-scc=a1 aut> out
77
78
diff out ref

79
80
81
82
83
autfilt --decompose-scc=a2 aut 2>stderr && exit 1
[ $? -eq 2 ]
grep "no SCC 'a2'" stderr

autfilt --decompose-scc=2 aut 2>stderr && exit 1
84
[ $? -eq 2 ]
85
grep "no SCC 2" stderr
86
87
88
89
90
91
92
93
94
95
96

# always satisfied acceptance
ltl2tgba 'Ga R b | Gc R b' > aut

cat >ref<<EOF
HOA: v1
States: 2
Start: 0
AP: 3 "b" "a" "c"
acc-name: Buchi
Acceptance: 1 Inf(0)
97
properties: trans-labels explicit-labels state-acc weak
98
99
100
--BODY--
State: 0
[0] 0
101
[0&2] 1
102
103
104
105
106
State: 1 {0}
[2] 1
--END--
EOF

107
run 0 autfilt --decompose-scc=a1 -F aut> out
108
109
cat out
diff out ref
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


# From issue #271, reported by Henrich Lauko.
cat >in.hoa <<EOF
HOA: v1
States: 4
Start: 2
AP: 2 "p1" "p0"
acc-name: generalized-co-Buchi 2
Acceptance: 2 Fin(0)|Fin(1)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic
--BODY--
State: 0 {0}
[1] 0
[!1] 1
State: 1 {0 1}
[1] 0
[!1] 1
State: 2
[0&1] 0
[0&!1] 1
[!0&1] 2
[!0&!1] 3
State: 3 {1}
[0&1] 0
[0&!1] 1
[!0&1] 2
[!0&!1] 3
--END--
EOF
test 2 = `autfilt --stats=%[a]c in.hoa`
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
183
184
185
186
187
188
189
190
191
192
193
194

# From issue #284, reported by Juraj Major.
cat >in.hoa <<EOF
HOA: v1
States: 4
Start: 0
AP: 1 "a"
Acceptance: 8 Fin(5) & Fin(3) & (Inf(6) | Fin(7)) &
              (Inf(2) | Fin(1)) & (Inf(4) | Fin(0))
properties: trans-labels explicit-labels trans-acc complete
spot.highlight.edges: 3 5 11 5 14 5
--BODY--
State: 0
[t] 0 {0}
[0] 1 {4}
[!0] 2 {4}
[0] 0 {2 3}
[!0] 0 {1}
State: 1
[!0] 1 {0}
[!0] 3 {4}
[!0] 1 {1}
[0] 1 {4 5}
[0] 1 {2 3 5}
State: 2
[0] 2 {0 6}
[0] 3 {4 6}
[0] 2 {2 3 6}
[!0] 2 {4 7}
State: 3
[0] 3 {4 5 6}
[0] 3 {2 3 5 6}
[!0] 3 {4 7}
--END--
/* this variant also cause some issues while fixing the above */
HOA: v1
States: 1
Start: 0
AP: 1 "a"
Acceptance: 5 Fin(0) & (Inf(1) | Fin(2)) & (Inf(4))
--BODY--
State: 0
[0] 0 {1}
[0] 0 {0 1}
[!0] 0 {4 2}
--END--
EOF
autfilt --stats='%[a]c' in.hoa >out
cat >exp <<EOF
1
1
EOF
diff out exp