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

@ -118,11 +118,11 @@ properties: trans-labels explicit-labels trans-acc complete
properties: deterministic stutter-invariant
--BODY--
State: 0
[0] 1 {1}
[!0] 0
State: 1
[0] 1 {1}
State: 1
[!0] 0 {0}
[0] 1 {1}
--END--
EOF
diff out expected

View file

@ -1,7 +1,7 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2013, 2014, 2015, 2016 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# Copyright (C) 2013-2017 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
@ -148,20 +148,20 @@ cat >expected-nd.hoa <<EOF
HOA: v1.1
name: "XGa R (!a & Fa)"
States: 2
Start: 1
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic
spot.highlight.states: 1 1
spot.highlight.edges: 2 2 3 2
spot.highlight.states: 0 1
spot.highlight.edges: 1 2 2 2
--BODY--
State: 0 {0}
[0] 0
State: 1
State: 0
[!0] 0
[!0] 1
State: 1 {0}
[0] 1
--END--
EOF
diff expected-nd.hoa out-nd.hoa
@ -173,19 +173,19 @@ cat >expected-rand.hoa <<EOF
HOA: v1.1
name: "XGa R (!a & Fa)"
States: 2
Start: 0
Start: 1
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic
spot.highlight.states: 0 1
spot.highlight.states: 1 1
--BODY--
State: 0
[!0] 0
State: 0 {0}
[0] 0
State: 1
[!0] 1
State: 1 {0}
[0] 1
[!0] 0
--END--
EOF
diff expected-rand.hoa rand.hoa
@ -197,20 +197,20 @@ cat >expected-rand2.hoa <<EOF
HOA: v1.1
name: "XGa R (!a & Fa)"
States: 2
Start: 0
Start: 1
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic
spot.highlight.states: 0 5
spot.highlight.edges: 1 5 2 5
spot.highlight.states: 1 5
spot.highlight.edges: 2 5 3 5
--BODY--
State: 0
[!0] 0
State: 0 {0}
[0] 0
State: 1
[!0] 1
State: 1 {0}
[0] 1
[!0] 0
--END--
EOF
diff expected-rand2.hoa rand2.hoa

View file

@ -255,3 +255,11 @@ ltl2tgba --low --any 'Xp1 xor (Fp1 M (!p1 M (Fp0 W p1)))' \
ltl2tgba --low --any 'Xp1 xor (Fp1 M (!p1 M (Fp0 W p1)))' "$s" >res2
ltl2tgba --low --any 'Fp0 -> XXG(1 U Gp1)' "$s" >>res2
diff res1 res2
# Another case where different but isomorphic automata
# were output (issue #262 again).
f1='F(Gp0 <-> Gp1)'
f2='Gp1 | FGp0'
(ltl2tgba -xsimul=1 --low "$f1"; ltl2tgba -xsimul=1 --low "$f2") > res1
ltl2tgba -xsimul=1 --low "$f1" "$f2" > res2
diff res1 res2

View file

@ -1712,7 +1712,7 @@ cat >expected <<EOF
HOA: v1
name: "(c U d) & G(Fa & Fb)"
States: 3
Start: 1
Start: 0
AP: 4 "c" "d" "a" "b"
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
@ -1720,39 +1720,39 @@ properties: implicit-labels trans-acc complete deterministic
properties: stutter-invariant
--BODY--
State: 0
2
0
1
1
2
0
1
1
2
0
1
1
2
0
0 {0}
0 {0}
0 {0}
0 {0}
0 {1}
0 {1}
0 {1}
0 {1}
0 {0 1}
0 {0 1}
0 {0 1}
0 {0 1}
1
1
State: 1
2
1
0
0
2
1
0
0
2
1
0
0
2
1
0
0
1 {0}
1 {0}
1 {0}
1 {0}
1 {1}
1 {1}
1 {1}
1 {1}
1 {0 1}
1 {0 1}
1 {0 1}
1 {0 1}
State: 2
2
2

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Laboratoire de Recherche et Développement
# Copyright (C) 2015, 2017 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -39,10 +39,10 @@ properties: trans-labels explicit-labels trans-acc complete
properties: stutter-invariant
--BODY--
State: 0
[0&1] 1 {1}
[!0&1] 1
[0] 0 {1}
[!0] 0
[0&1] 1 {1}
[!0&1] 1
State: 1
[0&1] 1 {0 1}
[!0&1] 1 {0}
@ -70,10 +70,10 @@ Acceptance: 2 Inf(0)&Inf(1)
properties: trans-labels explicit-labels trans-acc stutter-invariant
--BODY--
State: 0
[0&1] 1 {1}
[!0&1] 1
[0] 0 {1}
[!0] 0
[0&1] 1 {1}
[!0&1] 1
State: 1
[0&1] 1 {0 1}
[!0&1] 1 {0}

View file

@ -93,8 +93,8 @@ Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[0&2] 1
[0] 0
[0&2] 1
State: 1 {0}
[2] 1
--END--