twa_graph: add a merge_univ_dests() method

and call it after parsing

* spot/twa/twagraph.cc, spot/twa/twagraph.hh
(twa_graph::merge_univ_dests): New method.
* spot/parseaut/parseaut.yy: Call it.
* spot/twaalgos/dot.cc: Improve output, now that
several edges can use the same universal destination.
* tests/core/alternating.test, tests/core/complete.test,
tests/core/parseaut.test, tests/python/_altscc.ipynb,
tests/python/alternating.py, tests/python/alternation.ipynb: Adjust
test case.
* doc/org/tut24.org: Adjust example.
This commit is contained in:
Alexandre Duret-Lutz 2016-12-27 12:35:16 +01:00
parent 3d0a971aa8
commit 12f6c8cf10
11 changed files with 567 additions and 517 deletions

View file

@ -73,6 +73,11 @@ State: 2
aut2 = spot.automaton(h)
h2 = aut2.to_str('hoa')
print(h2)
assert h != h2
# This will sort destination groups
aut.merge_univ_dests()
h = aut.to_str('hoa')
assert h == h2
aut2.set_univ_init_state([0, 1])
@ -90,7 +95,7 @@ State: 0
[0] 1&2 {0}
[1] 0&1
State: 1
[0&1] 0&2&1
[0&1] 0&1&2
State: 2
[0 | 1] 2
--END--"""
@ -121,7 +126,7 @@ State: 0
[0] 1&2 {0}
[1] 0&1
State: 1
[0&1] 0&2&1
[0&1] 0&1&2
State: 2
[0 | 1] 2
State: 3