cleanacc: better cleanup

Sometimes, simplifying the acceptance condition (because it refers to
sets that do not appear in the automaton) cause more sets to be removed
from the acceptance condition, and therefore warrant another pass to
remove those sets from the automaton.

* src/tgbaalgos/cleanacc.cc: Here.
* src/tgbatest/hoaparse.test: Add a test case.
This commit is contained in:
Alexandre Duret-Lutz 2015-03-25 18:29:07 +01:00
parent bf42ac3699
commit 7353e47f0c
2 changed files with 56 additions and 0 deletions

View file

@ -47,6 +47,10 @@ namespace spot
// Remove useless marks from the acceptance condition
aut->set_acceptance(useful.count(), c.strip(useless, true));
// This may in turn cause even more set to be unused, because of
// some simplifications, so do it again.
return cleanup_acceptance(aut);
}
}

View file

@ -1371,6 +1371,23 @@ State: 0
[0&!1&!2] 0 {0}
[!0&!1&!2] 0
--END--
HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
Acceptance: 4 (Fin(0) & Inf(1)) | (Fin(2) & Inf(3))
properties: trans-labels explicit-labels state-acc deterministic
--BODY--
State: 0 {2}
[0&!1] 1
[!0&1] 0
[0&1] 1
State: 1 {1 2}
[!0&!1] 1
[0&!1] 1
[!0&1] 1
[0&1] 1
--END--
EOF
expectok input -v --is-empty <<EOF
@ -1407,6 +1424,23 @@ State: 0
[0&!1&!2] 0 {0 5}
[!0&!1&!2] 0 {5}
--END--
HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
Acceptance: 4 (Fin(0) & Inf(1)) | (Fin(2) & Inf(3))
properties: trans-labels explicit-labels state-acc deterministic
--BODY--
State: 0 {2}
[0&!1] 1
[!0&1] 0
[0&1] 1
State: 1 {1 2}
[!0&!1] 1
[0&!1] 1
[!0&1] 1
[0&1] 1
--END--
EOF
@ -1456,6 +1490,24 @@ State: 0
[0&!1&!2] 0 {0 3}
[!0&!1&!2] 0 {3}
--END--
HOA: v1
States: 2
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc deterministic
--BODY--
State: 0
[0&!1] 1
[!0&1] 0
[0&1] 1
State: 1 {0}
[!0&!1] 1
[0&!1] 1
[!0&1] 1
[0&1] 1
--END--
EOF