remfin: fix a corner case for rabin_to_buchi_maybe

when fin_alone sets where presents (i.e., not really Rabin condition),
the rabin_to_buchi_maybe() could fail to notice DBA-typeness.

* spot/twaalgos/remfin.cc: Don't set scc_ba_type to false when
fin_alone is present.
* tests/core/remfin.test: Add a test case.
This commit is contained in:
Alexandre Duret-Lutz 2017-04-04 13:53:16 +02:00
parent 01ee49290f
commit 1daffe12f0
3 changed files with 58 additions and 11 deletions

6
NEWS
View file

@ -18,6 +18,12 @@ New in spot 2.3.2.dev (not yet released)
- In bench/stutter/ the .cc files were not compiling due to warnings being - In bench/stutter/ the .cc files were not compiling due to warnings being
caught as errors. caught as errors.
- The code in charge of detecting DBA-type Rabin automata is
actually written to handle a slightly larger class of acceptance
conditions (e.g., Fin(0)|(Fin(1)&Inf(2))), however it failed to
correctly detect DBA-typeness in some of these non-Rabin
acceptance.
New in spot 2.3.2 (2017-03-15) New in spot 2.3.2 (2017-03-15)
Tools: Tools:

View file

@ -73,7 +73,7 @@ namespace spot
// accepting, but which becomes non-accepting when extended with // accepting, but which becomes non-accepting when extended with
// more states. // more states.
i -= f; i -= f;
i |= (inf_alone & sets); i |= inf_alone & sets;
if (!i) if (!i)
{ {
// Check whether the SCC is accepting. We do that by simply // Check whether the SCC is accepting. We do that by simply
@ -192,14 +192,9 @@ namespace spot
ba_final_states[s] = true; ba_final_states[s] = true;
scc_ba_type = true; scc_ba_type = true;
} }
// Conversely, if all fin_alone appear in the SCC, then it // In the general case, we need a dedicated check. Note
// cannot be accepting. // that the used fin_alone sets can be ignored, as they
else if (sets & fin_alone) // cannot contribute to Büchi-typeness,
{
scc_ba_type = false;
}
// In the generale case (no fin_alone involved), we need
// a dedicated check.
else else
{ {
scc_ba_type = is_scc_ba_type(aut, si.states_of(scc), scc_ba_type = is_scc_ba_type(aut, si.states_of(scc),

View file

@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement
# de l'Epita (LRDE). # Copyright (C) 2015-2017 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
# #
@ -236,6 +237,19 @@ State: 15 [t] 15 {4 15} [1] 16 {4} [!1] 22 {15} State: 16 [t] 16 {4 16}
[t] 31 {14} [!1] 32 State: 32 [t] 32 {15} [1] 33 State: 33 [t] 33 {16} [t] 31 {14} [!1] 32 State: 32 [t] 32 {15} [1] 33 State: 33 [t] 33 {16}
[!1] 36 State: 34 [t] 34 State: 35 [1] 34 {11} [!1] 35 {5} State: 36 [!1] 36 State: 34 [t] 34 State: 35 [1] 34 {11} [!1] 35 {5} State: 36
[1] 34 {23} [!1] 36 {17} --END-- [1] 34 {23} [!1] 36 {17} --END--
HOA: v1
States: 2
Acceptance: 3 Fin(0) | (Fin(1)&Inf(2))
Start: 0
AP: 1 "a"
--BODY--
State: 0 {0}
[0] 1
[!0] 0
State: 1 {2}
[0] 1
[!0] 0
--END--
EOF EOF
acctwelve='Inf(0)&Inf(1)&Inf(2)&Inf(3)&Inf(4)&Inf(5)' acctwelve='Inf(0)&Inf(1)&Inf(2)&Inf(3)&Inf(4)&Inf(5)'
@ -713,6 +727,22 @@ State: 36
[1] 34 [1] 34
[!1] 36 {0 1 2 3 4 5 6 7 8 9 10} [!1] 36 {0 1 2 3 4 5 6 7 8 9 10}
--END-- --END--
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic
--BODY--
State: 0
[0] 1
[!0] 0
State: 1 {0}
[0] 1
[!0] 0
--END--
EOF EOF
cat >expected-tgba <<EOF cat >expected-tgba <<EOF
@ -1156,6 +1186,22 @@ State: 36
[1] 34 [1] 34
[!1] 36 [!1] 36
--END-- --END--
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic
--BODY--
State: 0
[!0] 0
[0] 1
State: 1 {0}
[!0] 0
[0] 1
--END--
EOF EOF
run 0 $autfilt -H --remove-fin test1 > output run 0 $autfilt -H --remove-fin test1 > output