remove_fin: remove useless states

* src/tgba/tgbagraph.cc (purge_dead_states): Using a DFS to compute a
topological order, allowing to remove useless using a second
pass (instead of iterating the passes until there is nothing to remove).
* src/tgbaalgos/remfin.cc: Call purge_dead_states().
* src/tgbatest/remfin.test, src/tgbatest/det.test: Adjust expected
output.
* doc/org/autfilt.org: Update example.
This commit is contained in:
Alexandre Duret-Lutz 2015-03-24 12:04:30 +01:00
parent b4e22a3c7e
commit 020bbd4473
5 changed files with 82 additions and 93 deletions

View file

@ -80,15 +80,14 @@ State: 2
--END--
EOF
# FIXME: we should improve this output
cat >ex.hoa <<'EOF'
HOA: v1
States: 7
States: 5
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
properties: trans-labels explicit-labels state-acc inherently-weak
--BODY--
State: 0
[!0] 0
@ -102,16 +101,12 @@ State: 2
[!0] 0
[0] 2
[!0] 3
[0] 5
[0] 4
State: 3 {0}
[!0] 3
State: 4 {0}
[!0] 3
State: 5 {0}
[!0] 3
[0] 5
State: 6 {0}
[t] 6
[0] 4
--END--
EOF
@ -119,8 +114,6 @@ run 0 ../ltl2tgba -H -DC -XH in.hoa > out.hoa
run 1 ../../bin/autfilt -q --are-isomorph in.hoa out.hoa
run 0 ../../bin/autfilt -q --are-isomorph ex.hoa out.hoa
# FIXME: State 2 and 5 are unreachable and I'd rather
# not show them.
run 0 ../ltl2tgba -x -DC 'GFa & XGFb' > out.tgba
cat >ex.tgba <<EOF
digraph G {
@ -131,16 +124,12 @@ digraph G {
0 -> 1 [label="1"]
1 [label="1"]
1 -> 1 [label="1"]
1 -> 3 [label="!a"]
1 -> 4 [label="!b"]
1 -> 2 [label="!a"]
1 -> 3 [label="!b"]
2 [label="2", peripheries=2]
2 -> 3 [label="!a"]
2 -> 2 [label="!a"]
3 [label="3", peripheries=2]
3 -> 3 [label="!a"]
4 [label="4", peripheries=2]
4 -> 4 [label="!b"]
5 [label="5", peripheries=2]
5 -> 5 [label="1"]
3 -> 3 [label="!b"]
}
EOF
diff out.tgba ex.tgba