pdegen: fix the place with original-states are composed

doing it too early breaks the "redirect all-accepting transitions"
optimization

* spot/twaalgos/degen.cc: move the original-states composition
code.
* tests/python/pdegen.py: Add test-case from Florian Renkin.
This commit is contained in:
Alexandre Duret-Lutz 2020-02-16 16:35:04 +01:00
parent 5b7961257d
commit 10f40041b1
2 changed files with 30 additions and 4 deletions

View file

@ -391,3 +391,25 @@ State: 1
aut13g = spot.partial_degeneralize(aut13)
assert aut13g.equivalent_to(aut13)
assert aut13g.num_states() == 3
aut14 = spot.automaton("""HOA: v1
States: 2
Start: 0
AP: 2 "p0" "p1"
Acceptance: 5 (Inf(0)&Inf(1)) | ((Fin(2)|Fin(3)) & Fin(4))
--BODY--
State: 0
[!0 & 1] 0 {2 3}
[!0 & !1] 0 {3}
[0] 1
State: 1
[0&1] 1 {1 2 4}
[0&!1] 1 {4}
[!0&1] 1 {0 1 2 3}
[!0&!1] 1 {0 3}
--END--
""")
aut14g = spot.partial_degeneralize(aut14)
assert aut14g.equivalent_to(aut14)
assert aut14g.num_states() == 3