twagraph: remove bddfalse edges in purge_dead_states

* spot/twa/twagraph.cc (purge_dead_states): Be bddfalse-aware!
* spot/twa/twagraph.hh, NEWS: Document this.
* tests/python/alternating.py, tests/python/twagraph.py: Add some
test cases.
This commit is contained in:
Alexandre Duret-Lutz 2021-11-19 22:13:20 +01:00
parent 59690dd041
commit 5f49209caf
5 changed files with 33 additions and 6 deletions

View file

@ -21,7 +21,7 @@
# This file tests various error conditions on the twa API
import spot
from buddy import bddtrue
from buddy import bddtrue, bddfalse
aut = spot.make_twa_graph(spot.make_bdd_dict())
@ -113,3 +113,14 @@ aut.release_iter(it)
aut.purge_dead_states()
i = aut.get_init_state()
assert aut.state_is_accepting(i) == False
aut = spot.translate('FGa')
# Kill the edge between state 0 and 1
assert aut.edge_storage(2).src == 0
assert aut.edge_storage(2).dst == 1
aut.edge_data(2).cond = bddfalse
assert aut.num_edges() == 3
assert aut.num_states() == 2
aut.purge_dead_states()
assert aut.num_edges() == 1
assert aut.num_states() == 1