unit_propagation: Correct result when multiple colors are possible
* spot/twa/acc.cc: Here. * tests/core/acc.cc, tests/core/acc.test, tests/core/remfin.test: Update tests.
This commit is contained in:
parent
100fe3f00c
commit
262b24e6d7
4 changed files with 31 additions and 18 deletions
|
|
@ -2599,7 +2599,8 @@ namespace spot
|
||||||
if (!fin)
|
if (!fin)
|
||||||
{
|
{
|
||||||
auto m = pos[-1].mark & possibles;
|
auto m = pos[-1].mark & possibles;
|
||||||
if (m.count() == 1 || conj)
|
if ((!conj && pos[-1].mark.count() == 1)
|
||||||
|
|| (conj && m.count() > 0))
|
||||||
{
|
{
|
||||||
found_one = true;
|
found_one = true;
|
||||||
res |= m;
|
res |= m;
|
||||||
|
|
@ -2611,7 +2612,8 @@ namespace spot
|
||||||
if (!found_one || fin)
|
if (!found_one || fin)
|
||||||
{
|
{
|
||||||
auto m = pos[-1].mark & possibles;
|
auto m = pos[-1].mark & possibles;
|
||||||
if (m.count() == 1 || !conj)
|
if ((conj && pos[-1].mark.count() == 1)
|
||||||
|
|| (!conj && m.count() > 0))
|
||||||
{
|
{
|
||||||
found_one = true;
|
found_one = true;
|
||||||
fin = true;
|
fin = true;
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,10 @@ int main()
|
||||||
auto cond1 = spot::acc_cond::acc_code(
|
auto cond1 = spot::acc_cond::acc_code(
|
||||||
"(Inf(0) & Inf(5)) | Inf(5) | Inf(0)");
|
"(Inf(0) & Inf(5)) | Inf(5) | Inf(0)");
|
||||||
std::cout << cond1.unit_propagation() << '\n';
|
std::cout << cond1.unit_propagation() << '\n';
|
||||||
|
auto cond2 = spot::acc_cond::acc_code("Fin(1) | Inf(0) | Inf(0)");
|
||||||
|
std::cout << cond2.unit_propagation() << '\n';
|
||||||
|
auto cond3 = spot::acc_cond::acc_code("Inf(0) & Inf(2) | Fin(2)");
|
||||||
|
std::cout << cond3.unit_propagation() << '\n';
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,8 @@ Inf(2) & Fin(2)
|
||||||
(Fin(0)|Fin(3)) | (Inf(1) & Fin(2))
|
(Fin(0)|Fin(3)) | (Inf(1) & Fin(2))
|
||||||
(Fin(0)|Fin(3)) | (Inf(1) & Fin(2))
|
(Fin(0)|Fin(3)) | (Inf(1) & Fin(2))
|
||||||
Inf(5) | Inf(0)
|
Inf(5) | Inf(0)
|
||||||
|
Fin(1) | Inf(0)
|
||||||
|
Inf(0) | Fin(2)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run 0 ../acc > stdout
|
run 0 ../acc > stdout
|
||||||
|
|
|
||||||
|
|
@ -313,25 +313,27 @@ State: 2 {0}
|
||||||
[!1] 2
|
[!1] 2
|
||||||
--END--
|
--END--
|
||||||
HOA: v1
|
HOA: v1
|
||||||
States: 3
|
States: 4
|
||||||
Start: 0
|
Start: 0
|
||||||
AP: 2 "a" "b"
|
AP: 2 "a" "b"
|
||||||
acc-name: Buchi
|
Acceptance: 4 Inf(0) | Inf(3) | (Inf(1)&Inf(2))
|
||||||
Acceptance: 1 Inf(0)
|
|
||||||
properties: trans-labels explicit-labels trans-acc
|
properties: trans-labels explicit-labels trans-acc
|
||||||
--BODY--
|
--BODY--
|
||||||
State: 0
|
State: 0
|
||||||
[t] 0 {0}
|
[t] 0 {1 3}
|
||||||
[0] 1 {0}
|
[0] 1 {1 3}
|
||||||
[!0] 2 {0}
|
[!0] 2 {1 3}
|
||||||
State: 1
|
State: 1
|
||||||
[1] 0 {0}
|
[1] 0 {1}
|
||||||
[0&1] 1 {0}
|
[0&1] 1 {1}
|
||||||
[!0&1] 2 {0}
|
[!0&1] 2 {1 2}
|
||||||
State: 2
|
State: 2
|
||||||
[!1] 0
|
[!1] 0
|
||||||
[0&!1] 1 {0}
|
[0&!1] 1
|
||||||
[!0&!1] 2 {0}
|
[!0&!1] 2
|
||||||
|
[!0&!1] 3
|
||||||
|
State: 3
|
||||||
|
[!0&!1] 3 {0}
|
||||||
--END--
|
--END--
|
||||||
HOA: v1
|
HOA: v1
|
||||||
States: 3
|
States: 3
|
||||||
|
|
@ -913,7 +915,7 @@ State: 2 {0}
|
||||||
[!1] 2
|
[!1] 2
|
||||||
--END--
|
--END--
|
||||||
HOA: v1
|
HOA: v1
|
||||||
States: 3
|
States: 4
|
||||||
Start: 0
|
Start: 0
|
||||||
AP: 2 "a" "b"
|
AP: 2 "a" "b"
|
||||||
acc-name: Buchi
|
acc-name: Buchi
|
||||||
|
|
@ -925,13 +927,16 @@ State: 0
|
||||||
[0] 1 {0}
|
[0] 1 {0}
|
||||||
[!0] 2 {0}
|
[!0] 2 {0}
|
||||||
State: 1
|
State: 1
|
||||||
[1] 0 {0}
|
[1] 0
|
||||||
[0&1] 1 {0}
|
[0&1] 1
|
||||||
[!0&1] 2 {0}
|
[!0&1] 2 {0}
|
||||||
State: 2
|
State: 2
|
||||||
[!1] 0
|
[!1] 0
|
||||||
[0&!1] 1 {0}
|
[0&!1] 1
|
||||||
[!0&!1] 2 {0}
|
[!0&!1] 2
|
||||||
|
[!0&!1] 3
|
||||||
|
State: 3
|
||||||
|
[!0&!1] 3 {0}
|
||||||
--END--
|
--END--
|
||||||
HOA: v1
|
HOA: v1
|
||||||
States: 3
|
States: 3
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue