sbacc: fix a serious bug

Reported by Thibaud Michaud

* spot/twaalgos/sbacc.cc: Do not label rejecting SCCs with the empty
mark, as it might be accepting.
* tests/core/sbacc.test: Add test cases.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2017-04-19 18:46:35 +02:00
parent cb920242a7
commit 9377db2e5e
3 changed files with 86 additions and 1 deletions

View file

@ -159,3 +159,68 @@ randltl --weak-fairness -n 20 2 |
"$ltl2tgba -H %f | $autfilt -H >%O"
test 4 = `ltl2tgba -S 'F(a & X(!a &Xb))' --any --stats=%s`
# Test case from Thibaud Michaud. This used to fail, because sbacc()
# would remove acceptance marks from all rejecting SCCS...
cat >tm.hoa <<EOF
HOA: v1
States: 5
Start: 1
AP: 4 "req" "go" "ack" "cancel"
acc-name: parity max odd 3
Acceptance: 3 Fin(2) & (Inf(1) | Fin(0))
properties: trans-labels explicit-labels trans-acc colored complete
properties: deterministic
--BODY--
State: 0
[t] 1 {0}
State: 1
[!0] 0 {0}
[0] 2 {0}
State: 2
[2] 1 {0}
[!2] 3 {0}
State: 3
[t] 4 {0}
State: 4
[2] 1 {2}
[!2] 3 {1}
--END--
EOF
autfilt --sbacc tm.hoa > out.hoa
autfilt -q --equivalent-to out.hoa tm.hoa
# Tautological acceptances are converted to "t"
cat >taut.hoa <<EOF
HOA: v1
States: 2
Start: 1
AP: 0
Acceptance: 2 Fin(0) | Inf(0) | Fin(1)
--BODY--
State: 0
[t] 1 {0}
State: 1
[t] 0
[t] 1 {1}
--END--
EOF
cat >expect.hoa <<EOF
HOA: v1
States: 2
Start: 1
AP: 0
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc complete weak
--BODY--
State: 0
[t] 1
State: 1
[t] 0
[t] 1
--END--
EOF
autfilt --sbacc taut.hoa > out.hoa
diff out.hoa expect.hoa