simulation: do not depend on bdd numbers for ordering classes

Fixes #262 again.  Reported by Maximilien Colange.

* spot/twaalgos/simulation.cc: Use state numbers to order classes, not
their signatures.  The problem was that even if two simulation of the
same automaton assign the same signature, the BDD identifier used for
that signature might be different, and therefore the ordering obtained
by using BDDs as keys in a map can be different.  A side-effect of
this change is that the order of states in automata produced by
simulation-based reduction may change; many tests had to be updated.
* tests/core/ltl2tgba.test: Add a new test case based on Maximilien's
report.
* tests/core/complement.test, tests/core/det.test,
tests/core/parseaut.test, tests/core/prodor.test, tests/core/scc.test,
tests/python/atva16-fig2a.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/decompose_scc.py,
tests/python/highlighting.ipynb, tests/python/piperead.ipynb,
tests/python/sccinfo.py, tests/python/simstate.py,
tests/python/testingaut.ipynb, tests/python/word.ipynb: Update
test case for new order of states.
This commit is contained in:
Alexandre Duret-Lutz 2017-06-02 11:23:42 +02:00
parent 101c2533f1
commit 9ab4b840fd
17 changed files with 1464 additions and 1402 deletions

View file

@ -70,10 +70,10 @@ while todo:
seen.add(s)
todo.add(s)
assert seen == {0, 1, 2, 3}
assert trans == [(1, 0), (1, 1), (1, 2), (1, 3),
(2, 1), (2, 2), (2, 3), (2, 4),
(0, 0), (3, 3), (4, 3), (4, 4)]
assert transi == [(1, 1, 3), (1, 2, 4), (2, 1, 6), (2, 2, 7),
(0, 0, 1), (3, 3, 10), (4, 4, 12)]
assert trans == [(0, 0), (0, 1), (0, 2), (0, 3),
(3, 0), (3, 1), (3, 3), (3, 4),
(1, 1), (2, 2), (4, 1), (4, 4)]
assert transi == [(0, 0, 1), (0, 3, 4), (3, 0, 7),
(3, 3, 9), (1, 1, 5), (2, 2, 6), (4, 4, 12)]
assert not spot.is_weak_automaton(a, si)