maskacc.test 2.7 KB
Newer Older
1
#!/bin/sh
2
3
4
# -*- coding: utf-8 -*-
# Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (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
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


. ./defs

set -e

cat >input1 <<EOF
27
28
29
30
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
31
Acceptance: 2 Fin(0)&Fin(1)
32
33
34
35
36
37
38
39
40
41
42
43
44
45
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 1 {0}
[1] 2 {1}
State: 1
[0] 2
[0] 3 {1}
State: 2
[1] 1
[1] 3 {0}
State: 3
[0] 3 {0 1}
--END--
46
47
48
EOF

cat >expect1 <<EOF
49
50
51
52
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
53
Acceptance: 1 Fin(0)
54
55
56
57
58
59
60
61
62
63
64
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[1] 1 {0}
State: 1
[1] 2
State: 2
[0] 1
[0] 3 {0}
State: 3
--END--
65
66
EOF

67
68
69
70
71
72
73
74
run 0 ../../bin/autfilt --mask-acc=0 input1 -H >output
diff output expect1

cat >expect2 <<EOF
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
75
Acceptance: 1 Fin(0)
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
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 1 {0}
State: 1
[0] 2
State: 2
[1] 1
[1] 3 {0}
State: 3
--END--
EOF

run 0 ../../bin/autfilt --mask-acc=1 input1 -H >output
diff output expect2

cat >expect3 <<EOF
HOA: v1
States: 1
Start: 0
AP: 0
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc deterministic
--BODY--
State: 0
--END--
EOF

run 0 ../../bin/autfilt --mask-acc=0,1,2 input1 -H >output
diff output expect3

run 0 ../../bin/autfilt --mask-acc=0 --mask-acc=1 input1 -H >output
diff output expect3

111
112
113
114
115
116
117
118
119
120
cat >input4 <<EOF
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Buchi 2
Acceptance: 3 Inf(1)|Fin(0)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
121
122
[0] 1 {1}
[1] 2 {0}
123
124
State: 1
[0] 2
125
[0] 3 {0}
126
127
State: 2
[1] 1
128
[1] 3 {1}
129
130
131
132
133
134
135
136
137
138
State: 3
[0] 3 {0 1}
--END--
EOF

cat >expect4 <<EOF
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
139
Acceptance: 2 Fin(0)
140
141
142
143
144
145
146
147
148
149
150
151
152
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[1] 1 {0}
State: 1
[1] 2
State: 2
[0] 1
[0] 3 {0}
State: 3
--END--
EOF

153
run 0 ../../bin/autfilt --mask-acc=1 input4 -H >output
154
155
diff output expect4

156
157
158
159
# Errors
run 2 ../../bin/autfilt --mask-acc=a3 input1
run 2 ../../bin/autfilt --mask-acc=3-2 input1
run 2 ../../bin/autfilt --mask-acc=0,9999,1 input1