is_unambiguous: rewrite more efficiently

Avoid calling scc_info::determine_unknown_acceptance on the product, as
suggested in #188.

* spot/twaalgos/isunamb.cc (is_unambiguous): Rewrite.
* tests/core/unambig.test: Add the automaton from #188.
* NEWS: Mention the improved function.
* spot/twaalgos/mask.cc,
spot/twaalgos/mask.hh (mask_keep_accessible_states): New function.
This commit is contained in:
Alexandre Duret-Lutz 2016-10-18 17:37:55 +02:00
parent 9b3451c52e
commit 5384a3b89a
5 changed files with 188 additions and 12 deletions

View file

@ -244,3 +244,47 @@ cat >expected <<EOF
1
EOF
diff expected ltlcross.res
# This automaton was supplied by František Blahoudek, and is discussed
# in #188. Our initial implementation of is_unambiguous() on this
# automaton used to take 38s, while the new version takes 0.2s. Using
# valgrind on this is a way to ensure that the test is procedure
# enough: it would have been too long on the previous version.
cat >smaller.hoa<<EOF
HOA: v1
States: 7
Start: 1
AP: 2 "a" "b"
Acceptance: 12 (Inf(11) | Fin(5)) & (Inf(10) | Fin(4)) & (Inf(9) |
Fin(3)) & (Inf(8) | Fin(2)) & (Inf(7) | Fin(1)) & (Inf(6) | Fin(0))
properties: trans-labels explicit-labels trans-acc complete
--BODY--
State: 0
[t] 0
State: 1
[!0] 1 {0}
[0] 2
[0&1] 3
State: 2
[t] 2 {1}
[1] 3
State: 3
[t] 3 {2}
[!1] 4
State: 4
[t] 4 {3}
[1] 5
State: 5
[t] 5 {4}
[!1] 6
State: 6
[1] 0 {11}
[!1] 6 {5}
--END--
EOF
run 1 autfilt -q --is-unambiguous smaller.hoa
true