degen: consider common outgoing acceptance only inside an SCC

* src/tgbaalgos/degen.cc: Here.
* src/tgbatest/degenid.test: Add a test case that is improved
by this.
* src/tgbatest/ltl2ta.test, src/tgbatest/ltl2tgba.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2013-09-11 10:49:49 +02:00
parent 073334dfd6
commit 90a466d6a3
4 changed files with 110 additions and 12 deletions

View file

@ -103,3 +103,91 @@ grep 'states: 8' out
# easy to obtain a 4-state BA when tweaking the degeneralization
# to ignore arc entering an SCC.
test 3 = "`../../bin/ltl2tgba -B 'G(a|G(b|Fc))' --stats=%s`"
# This 7-state DRA (built with
# ltlfilt -f 'F(a & GFb) | (Fc & Fa & F(c & GF!b))' -l |
# ltl2dstar --ltl2nba=spin:ltl2tgba@-sD - -
# should be converted in into a 6-state DBA.
cat >in.dra <<EOF
DRA v2 explicit
Comment: "Union{Safra[NBA=3],Safra[NBA=5]}"
States: 7
Acceptance-Pairs: 2
Start: 5
AP: 3 "a" "b" "c"
---
State: 0
Acc-Sig: +0 +1
1
1
2
2
1
1
2
2
State: 1
Acc-Sig: +1
1
1
2
2
1
1
2
2
State: 2
Acc-Sig: +0
1
1
2
2
1
1
2
2
State: 3
Acc-Sig: +0
6
6
3
3
1
1
0
0
State: 4
Acc-Sig:
4
0
4
0
4
0
4
0
State: 5
Acc-Sig:
5
3
5
3
4
0
4
0
State: 6
Acc-Sig:
6
6
3
3
1
1
0
0
EOF
run 0 ../../bin/dstar2tgba in.dra -BD --stats=%s > out.stat
test 6 = "`cat out.stat`"

View file

@ -85,7 +85,7 @@ done
for opt in -TA; do
../ltl2tgba -ks $opt -RT -DS 'Ga U b' > stdout
grep 'transitions: 13$' stdout
grep 'transitions: 11$' stdout
grep 'states: 6$' stdout
done
@ -119,11 +119,11 @@ grep 'states: 290$' stdout
#tests with artificial livelock state:
run 0 ../ltl2tgba -ks -TA -lv -DS "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
grep 'transitions: 790$' stdout
grep 'transitions: 784$' stdout
grep 'states: 66$' stdout
run 0 ../ltl2tgba -TA -RT -ks -lv -DS "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
grep 'transitions: 390$' stdout
grep 'transitions: 384$' stdout
grep 'states: 26$' stdout
run 0 ../ltl2tgba -TGTA -RT -ks 'Gq|Gr|(G(q|FGp)&G(r|FG!p))' >stdout
@ -138,7 +138,7 @@ grep 'states: 38$' stdout
run 0 ../ltl2tgba -TA -RT -ks -lv -R3f -x -DS "$f" >stdout
grep 'transitions: 555$' stdout
grep 'transitions: 551$' stdout
grep 'states: 40$' stdout

View file

@ -150,11 +150,10 @@ for opt in '' -D -DS; do
../ltl2tgba -ks -f -R3 $opt "$f" > stdout
grep 'transitions: 15$' stdout
grep 'states: 6$' stdout
../ltl2tgba -ks -f -R3f $opt "$f" > stdout
grep 'transitions: 15$' stdout
grep 'states: 6$' stdout
done
# Note: this is worse with -R3f.
../ltl2tgba -ks -f -R3f -DS "$f" > stdout
grep 'transitions: 17$' stdout
grep 'states: 7$' stdout
# Make sure 'GFa & GFb & GFc & GFd & GFe & GFf'
# has 7 states and 34 transitions after degeneralization.