simulation: fix determinism check
Commit bda40a5f introduced a subtle bug where nm_minato was being
increased in more cases causing some non-deterministic automata to be
incorrectly tagged as deterministic automata.
Fixes issue #575, reported by Dávid Smolka.
* spot/twaalgos/simulation.cc (create_edges): Do not increment
nm_minato when dest is bddfalse.
* tests/core/568.test: Add Dávid's first test-case.
* tests/python/forq_contains.py: Add Dávid's second test-case.
This commit is contained in:
parent
ffddbd84d0
commit
ab7f4f51c4
3 changed files with 51 additions and 0 deletions
|
|
@ -101,3 +101,27 @@ EOF
|
|||
# Using autcross will also test tgba_determinize
|
||||
genaut --cycle-onehot-nba=11..12 --cycle-log-nba=11..12 |
|
||||
autcross --language-preserved 'autfilt --small' --verbose
|
||||
|
||||
|
||||
|
||||
# A test case from issue #575
|
||||
cat >575.hoa <<EOF
|
||||
HOA: v1 States: 16 Start: 0 AP: 7 "p12" "p28" "p14" "p34" "p30" "p29"
|
||||
"p35" acc-name: Buchi Acceptance: 1 Inf(0) properties: trans-labels
|
||||
explicit-labels state-acc --BODY-- State: 0 [0&1&!3] 1 [0&1&3] 2
|
||||
[!0&1&!3] 3 [0&!1&!3] 4 [!0&!1&3] 5 [!0&1&3] 6 [0&!1&3] 7 [!0&!1&!3] 8
|
||||
State: 1 {0} [t] 1 State: 2 [!3] 1 [3] 2 State: 3 [t] 9 State: 4 [t]
|
||||
10 State: 5 [3] 12 [!3 | !6] 13 State: 6 [!3 | !6] 9 [3] 14 State: 7
|
||||
[!3 | !6] 10 [3] 15 State: 8 [t] 13 State: 9 [2] 1 [!2] 9 State: 10
|
||||
[4] 1 [!4] 10 [!4&5] 11 State: 11 {0} [5] 11 State: 12 [2&!3&4] 1
|
||||
[2&3&4] 2 [!2&!3&4] 9 [2&!3&!4] 10 [2&!3&!4&5] 11 [!2&3&!4] 12
|
||||
[!2&!3&!4] 13 [!2&3&4] 14 [2&3&!4] 15 State: 13 [2&4] 1 [!2&4] 9
|
||||
[2&!4] 10 [2&!4&5] 11 [!2&!4] 13 State: 14 [2&!3] 1 [2&3] 2 [!2&!3] 9
|
||||
[!2&3] 14 State: 15 [!3&4] 1 [3&4] 2 [!3&!4] 10 [!3&!4&5] 11 [3&!4] 15
|
||||
--END--
|
||||
EOF
|
||||
# the automaton original bug was detected by print_hoa, which complained
|
||||
# that the non-derministic automaton was incorrectly tagged as deterministic.
|
||||
# So let's print the automaton in HOA format before checking its size.
|
||||
autfilt --small 575.hoa -H > res.hoa
|
||||
test "16 49 0" = "`autfilt --stats='%s %e %d' res.hoa`"
|
||||
|
|
|
|||
|
|
@ -360,3 +360,28 @@ tc.assertFalse(spot.contains(tba2, tba))
|
|||
a = spot.translate("(p0 & p2) -> G!p1", "buchi")
|
||||
b = spot.translate("p0 -> G!p1", "buchi")
|
||||
do_symmetric_test(b, a)
|
||||
|
||||
# issue #575
|
||||
aut1 = spot.automaton("""HOA: v1.1 States: 12 Start: 0 AP: 6 "p13"
|
||||
"p12" "p15" "p16" "p14" "p11" acc-name: Buchi Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc !complete
|
||||
properties: !deterministic exist-branch --BODY-- State: 0 [!0&!1&!3 |
|
||||
!2 | !3&!4] 1 [!0&!1&3 | !2 | 3&!4] 2 [0&!3&4 | 1&!3&4 | !2] 3 [0&3&4
|
||||
| 1&3&4 | !2] 4 [0&!1&3&4 | !2] 6 State: 1 [t] 7 State: 2 [!0&!1&3&!5
|
||||
| !2 | 3&!4&!5] 2 {0} [0&3&4&!5 | 1&3&4&!5 | !2] 4 [0&!1&3&4&!5 | !2]
|
||||
6 State: 3 [t] 5 State: 4 [!2 | 3&!4&!5] 2 {0} [!2 | 3&4&!5] 4 State:
|
||||
5 [t] 9 State: 6 [!0&!1&3&!5 | !0&3&!4&!5 | !2] 2 {0} [!0&1&3&4&!5 |
|
||||
!2] 4 [0&!1&3&!5 | 0&3&!4&!5 | !2] 6 [0&1&3&4&!5 | !2] 10 State: 7 [t]
|
||||
11 State: 8 [t] 8 {0} State: 9 [t] 8 {0} State: 10 [!0&3&!4&!5 | !2] 2
|
||||
{0} [!0&3&4&!5 | !2] 4 [0&3&!4&!5 | !2] 6 [0&3&4&!5 | !2] 10 State: 11
|
||||
[t] 8 {0} --END--""")
|
||||
aut2 = spot.automaton("""HOA: v1 States: 5 Start: 0 AP: 6 "p13" "p12"
|
||||
"p15" "p16" "p14" "p11" acc-name: Buchi Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc --BODY-- State: 0
|
||||
[!0&!1&2&3 | 2&3&!4] 1 [0&2&3&4 | 1&2&3&4] 2 [0&!1&2&3&4] 3 State: 1
|
||||
[!0&!1&2&3&!5 | 2&3&!4&!5] 1 {0} [0&2&3&4&!5 | 1&2&3&4&!5] 2
|
||||
[0&!1&2&3&4&!5] 3 State: 2 [2&3&!4&!5] 1 {0} [2&3&4&!5] 2 State: 3
|
||||
[!0&!1&2&3&!5 | !0&2&3&!4&!5] 1 {0} [!0&1&2&3&4&!5] 2 [0&!1&2&3&!5 |
|
||||
0&2&3&!4&!5] 3 [0&1&2&3&4&!5] 4 State: 4 [!0&2&3&!4&!5] 1 {0}
|
||||
[!0&2&3&4&!5] 2 [0&2&3&!4&!5] 3 [0&2&3&4&!5] 4 --END--""")
|
||||
do_symmetric_test(aut2, aut1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue