graph: store the source indices in the transition vector

... and use it to sort transitions.

* src/graph/graph.hh: Adjust storage of source index.  Provide
remove_dead_transitions_(), sort_transitions_() and
chain_transitions_() methods.
* src/tgba/tgbagraph.cc (merge_transitions): Rewrite using
above methods.
* src/tgba/tgbagraph.hh: Add a comparison operator for
transitions.
* src/tgbatest/degenlskip.test, src/tgbatest/det.test,
src/tgbatest/ltl2ta.test, src/tgbatest/neverclaimread.test,
src/tgbatest/readsave.test: Adjust expected transition order in test
cases.
This commit is contained in:
Alexandre Duret-Lutz 2014-12-02 20:16:06 +01:00
parent 80ce0e2129
commit 0db0eca14e
8 changed files with 201 additions and 80 deletions

View file

@ -38,15 +38,15 @@ digraph G {
0 -> 1
1 [label="0", peripheries=2]
1 -> 1 [label="a & b\n{0}"]
1 -> 2 [label="!a & b\n{0}"]
1 -> 3 [label="!b\n{0}"]
1 -> 2 [label="!b\n{0}"]
1 -> 3 [label="!a & b\n{0}"]
2 [label="1"]
2 -> 1 [label="a"]
2 -> 2 [label="!a"]
2 -> 1 [label="a & b"]
2 -> 2 [label="!b"]
2 -> 3 [label="!a & b"]
3 [label="2"]
3 -> 1 [label="a & b"]
3 -> 2 [label="!a & b"]
3 -> 3 [label="!b"]
3 -> 1 [label="a"]
3 -> 3 [label="!a"]
}
EOF
@ -58,13 +58,14 @@ digraph G {
1 [label="0", peripheries=2]
1 -> 2 [label="1\n{0}"]
2 [label="1"]
2 -> 3 [label="b"]
2 -> 2 [label="!b"]
2 -> 3 [label="b"]
3 [label="2"]
3 -> 1 [label="a"]
3 -> 3 [label="!a"]
}
EOF
# FIXME: use are-isomorphic once it is available
diff out2 expected2
diff out3 expected3