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:
parent
59690dd041
commit
5f49209caf
5 changed files with 33 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2016, 2017 Laboratoire de Recherche et Développement de
|
||||
# Copyright (C) 2016, 2017, 2021 Laboratoire de Recherche et Développement de
|
||||
# l'EPITA.
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -207,3 +207,10 @@ State: 2
|
|||
|
||||
desalt = spot.remove_univ_otf(aut)
|
||||
assert(desalt.to_str('hoa') == out)
|
||||
|
||||
assert aut.num_states() == 3
|
||||
assert aut.num_edges() == 3
|
||||
aut.edge_storage(3).cond = buddy.bddfalse
|
||||
aut.purge_dead_states()
|
||||
assert aut.num_states() == 1
|
||||
assert aut.num_edges() == 0
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue