simplify_acceptance: generalize the complementary mark rewriting

Fixes #403.

* spot/twaalgos/cleanacc.cc (simplify_complementary_marks_here):
Assume that two colors are complementary in a broad sense, i.e., on is
present if (but not only if) the other is missing before applying
those rewritings.  Technically, this is usually not necessary, because
the changes done in #418 will cause such "covering-the-full-automaton"
pair of colors to be disjoint so complementary in a strict sense.  It
might make a difference (this is not tested) in presence of reused
colors which #418 cannot remove.  In any case, it's simply less code
to implement the broad sense.
* tests/python/toparity.py: Add test case from #403, which is
reduced to two states with recent optimizations.
This commit is contained in:
Alexandre Duret-Lutz 2020-07-29 14:37:38 +02:00
parent 0c4b701630
commit a375089e52
2 changed files with 20 additions and 7 deletions

View file

@ -220,6 +220,21 @@ State: 1
[!0&!1] 1 {0 3}
--END--"""), [7, 5, 3, 6, 5, 5, 3])
test(spot.automaton("""HOA: v1
States: 2
Start: 0
AP: 2 "p0" "p1"
Acceptance: 5 ((Fin(1)|Fin(3)|Fin(4)) | Inf(2) | Inf(0))
& (Inf(0) | Inf(1)) & (Inf(2) | Inf(1))
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0&1] 0 {1 3}
[!0&1] 1 {0}
State: 1
[0&1] 1 {2 3 4}
[!0&!1] 0 {1 2}
--END--"""), [9, 3, 2, 3, 3, 3, 2])
for i,f in enumerate(spot.randltl(10, 400)):
test(spot.translate(f, "det", "G"), full=(i<100))