tgbatest: drop support of Spot's legacy format from ltl2tgba

This is progress for #1.

* src/tgbatest/ltl2tgba.cc: Remove options -b and -X.  Change
-P to read HOA files instead.
* src/tgbatest/complementation.cc: Replace option -b by -H for
HOA output, and read files in HOA.
* src/tgbatest/complementation.test, src/tgbatest/cycles.test,
src/tgbatest/dbacomp.test, src/tgbatest/degenid.test,
src/tgbatest/dfs.test, src/tgbatest/emptchke.test,
src/tgbatest/ltl2tgba.test, src/tgbatest/renault.test,
src/tgbatest/satmin2.test, src/tgbatest/sccsimpl.test,
src/tgbatest/sim2.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-31 17:43:16 +01:00
parent 5852292c9f
commit 33a944705c
13 changed files with 755 additions and 527 deletions

View file

@ -32,138 +32,207 @@ set -e
# G((!p0 | !p2 | (!p1 W (!p1 & p3 & X(!p1 U p4)))) U p1)
# The formula does not really matter (except to show how
# such automata can occur). The important point is that the
# acceptance condition "p4", used a lot, is always present
# when "p1" is used. So the "p4" acceptance can be removed.
# acceptance set "0" contains the acceptance set "1", so
# "0" can be removed.
cat <<EOF > aut.txt
acc = "p4" "p1";
S1, S1, "p1", "p4" "p1";
S1, S1, "!p0 | !p2", "p4";
S1, S2, "p3", "p4";
S1, S3, "1", "p4";
S2, S1, "p1 & p4", "p4" "p1";
S2, S1, "(p4 & !p0) | (p4 & !p2)", "p4";
S2, S2, "p3 & p4", "p4";
S2, S2, "(!p1 & !p0) | (!p1 & !p2) | (!p1 & p3)",;
S2, S3, "p4", "p4";
S2, S4, "!p1",;
S3, S2, "!p1 & p3", "p4";
S3, S3, "!p1", "p4";
S4, S2, "!p1 & p3 & p4", "p4";
S4, S2, "!p1 & p3",;
S4, S3, "!p1 & p4", "p4";
S4, S4, "!p1",;
HOA: v1
States: 4
Start: 0
AP: 5 "p1" "p0" "p2" "p3" "p4"
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0 1}
[!1 | !2] 0 {0}
[3] 1 {0}
[t] 2 {0}
State: 1
[0&4] 0 {0 1}
[!1&4 | !2&4] 0 {0}
[3&4] 1 {0}
[!0&!1 | !0&!2 | !0&3] 1
[4] 2 {0}
[!0] 3
State: 2
[!0&3] 1 {0}
[!0] 2 {0}
State: 3
[!0&3] 1
[!0&3&4] 1 {0}
[!0&4] 2 {0}
[!0] 3
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut.txt > out.txt
grep '^acc = "[^"]*";$' out.txt
run 0 ../ltl2tgba -XH -R3 -H aut.txt > out.txt
grep '^Acceptance: 1 Inf(0)' out.txt
# Here, acceptances A and C can both be removed.
# Here, acceptance sets 0 and 2 can both be removed.
cat <<EOF > aut2.txt
acc = A B C D;
S1, S1, "a", A;
S1, S1, "b", A B;
S1, S1, "c", A B C;
S1, S1, "d", C D;
HOA: v1
States: 1
Start: 0
AP: 4 "a" "b" "c" "d"
acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0}
[1] 0 {0 1}
[2] 0 {0 1 2}
[3] 0 {2 3}
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut2.txt > out2.txt
grep '^acc = "." ".";$' out2.txt || exit 1
# only 4 lines output, because the "b" and "c" lines have been merged.
test `wc -l < out2.txt` = 4
run 0 ../ltl2tgba -XH -R3 -H aut2.txt > out2.txt
grep '^Acceptance: 2 ' out2.txt
# only 3 transitions output, because [1] and [2] have been merged
test `grep -c '\[.*\]' out2.txt` = 3
# Here, acceptances A and B can both be removed.
# Here, acceptance sets 0 and 1 can both be removed.
cat <<EOF > aut3.txt
acc = A B C D;
S1, S1, "a", A;
S1, S1, "b", A B;
S1, S1, "c", A B C;
S1, S1, "d", B D;
HOA: v1
States: 1
Start: 0
AP: 4 "a" "b" "c" "d"
acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0}
[1] 0 {0 1}
[2] 0 {0 1 2}
[3] 0 {1 3}
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut3.txt > out3.txt
grep '^acc = "." ".";$' out3.txt || exit 1
# only 4 lines output, because the "a" and "b" lines have been merged.
test `wc -l < out3.txt` = 4
run 0 ../ltl2tgba -XH -R3 -H aut3.txt > out3.txt
grep '^Acceptance: 2 ' out3.txt
# only 3 transitions output, because [0] and [1] have been merged
test `grep -c '\[.*\]' out3.txt` = 3
# No simplification possible here
cat <<EOF > aut4.txt
acc = A B C D;
S1, S1, "a", A;
S1, S1, "b", A B;
S1, S1, "c", A B C;
S1, S1, "d", B D;
S1, S1, "e", C D;
HOA: v1
States: 1
Start: 0
AP: 5 "a" "b" "c" "d" "e"
acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0}
[1] 0 {0 1}
[2] 0 {0 1 2}
[3] 0 {1 3}
[4] 0 {2 3}
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut4.txt > out4.txt
test `grep '^acc' out4.txt | wc -w` = 6
test `wc -l < out4.txt` = 6
run 0 ../ltl2tgba -XH -R3 -H aut4.txt > out4.txt
grep '^Acceptance: 4 ' out4.txt
test `grep -c '\[.*\]' out4.txt` = 5
# Make sure nothing wrong (like an assert())
# happens when no acceptance conditions are used.
cat <<EOF > aut5.txt
acc = ;
S1, S1, "a", ;
S1, S1, "b", ;
S1, S1, "c", ;
HOA: v1
States: 1
Start: 0
AP: 3 "a" "b" "c"
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[0] 0
[1 | 2] 0
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut5.txt > out5.txt
test `wc -l < out5.txt` = 2
run 0 ../ltl2tgba -XH -R3 -H aut5.txt > out5.txt
grep '^Acceptance: 0 t' out5.txt
test `grep -c '\[.*\]' out5.txt` = 1
# Here, one of A,B and one of C,D can be removed.
# Here, one of 0,1 and one of 2,3 can be removed.
cat <<EOF > aut6.txt
acc = A B C D;
S1, S1, "a", A B;
S1, S1, "b", A B;
S1, S1, "c", C D;
S1, S1, "d", C D;
HOA: v1
States: 1
Start: 0
AP: 4 "a" "b" "c" "d"
acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0 1}
[1] 0 {0 1}
[2] 0 {2 3}
[3] 0 {2 3}
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut6.txt > out6.txt
test `grep '^acc' out6.txt | wc -w` = 4
test `wc -l < out6.txt` = 3
run 0 ../ltl2tgba -XH -R3 -H aut6.txt > out6.txt
grep '^Acceptance: 2 ' out6.txt
test `grep -c '\[.*\]' out6.txt` = 2
# This automaton comes from the formula
# 1 U (p0 & (!p1 R ((1 U !p2) & (1 U !p3))))
# and and early implementation of our simplification
# and an early implementation of our simplification
# missed the simplification.
cat <<EOF > aut7.txt
acc = ZZ "!p3" "!p2";
S1, S2, "p0 & !p2 & !p3 & !p1", ZZ "!p3" "!p2";
S1, S1, "!p0 | p1 | p2 | p3", "!p3" "!p2";
S1, S3, "p0 & p2 & !p3 & !p1", ZZ "!p3";
S1, S4, "p0 & p3 & !p2 & !p1", ZZ "!p2";
S1, S5, "(p0 & p2 & !p1) | (p0 & p3 & !p1)", ZZ;
S1, S6, "p0 & p1 & !p2 & !p3", ZZ "!p3" "!p2";
S1, S6, "(p0 & p1 & !p3) | (p0 & p2 & !p3)", ZZ "!p3";
S1, S6, "(p0 & p1 & !p2) | (p0 & p3 & !p2)", ZZ "!p2";
S1, S6, "(p0 & p1) | (p0 & p2) | (p0 & p3)", ZZ;
S2, S2, "1", ZZ "!p3" "!p2";
S3, S2, "!p2", ZZ "!p3" "!p2";
S3, S3, "p2", ZZ "!p3";
S4, S2, "!p3", ZZ "!p3" "!p2";
S4, S4, "p3", ZZ "!p2";
S5, S2, "!p2 & !p3", ZZ "!p3" "!p2";
S5, S3, "p2 & !p3", ZZ "!p3";
S5, S4, "p3 & !p2", ZZ "!p2";
S5, S5, "p2 | p3", ZZ;
S6, S2, "!p2 & !p3 & !p1", ZZ "!p3" "!p2";
S6, S3, "p2 & !p3 & !p1", ZZ "!p3";
S6, S4, "p3 & !p2 & !p1", ZZ "!p2";
S6, S5, "(p2 & !p1) | (p3 & !p1)", ZZ;
S6, S6, "p1 & !p2 & !p3", ZZ "!p3" "!p2";
S6, S6, "(p1 & !p3) | (p2 & !p3)", ZZ "!p3";
S6, S6, "(p1 & !p2) | (p3 & !p2)", ZZ "!p2";
S6, S6, "p1 | p2 | p3", ZZ;
HOA: v1
States: 6
Start: 0
AP: 4 "p0" "p1" "p2" "p3"
acc-name: generalized-Buchi 3
Acceptance: 3 Inf(0)&Inf(1)&Inf(2)
properties: trans-labels explicit-labels trans-acc complete
--BODY--
State: 0
[!0 | 1 | 2 | 3] 0 {1 2}
[0&!1&!2&!3] 1 {0 1 2}
[0&!1&2&!3] 2 {0 1}
[0&!1&!2&3] 3 {0 2}
[0&!1&2 | 0&!1&3] 4 {0}
[0&1&!2&!3] 5 {0 1 2}
[0&1&!3 | 0&2&!3] 5 {0 1}
[0&1&!2 | 0&!2&3] 5 {0 2}
[0&1 | 0&2 | 0&3] 5 {0}
State: 1
[t] 1 {0 1 2}
State: 2
[!2] 1 {0 1 2}
[2] 2 {0 1}
State: 3
[!3] 1 {0 1 2}
[3] 3 {0 2}
State: 4
[!2&!3] 1 {0 1 2}
[2&!3] 2 {0 1}
[!2&3] 3 {0 2}
[2 | 3] 4 {0}
State: 5
[!1&!2&!3] 1 {0 1 2}
[!1&2&!3] 2 {0 1}
[!1&!2&3] 3 {0 2}
[!1&2 | !1&3] 4 {0}
[1 | 2 | 3] 5 {0}
[1&!2&!3] 5 {0 1 2}
[1&!3 | 2&!3] 5 {0 1}
[1&!2 | !2&3] 5 {0 2}
--END--
EOF
run 0 ../ltl2tgba -X -R3 -b aut7.txt > out7.txt
test `grep '^acc' out7.txt | wc -w` = 4
run 0 ../ltl2tgba -XH -R3 -H aut7.txt > out7.txt
grep '^Acceptance: 2 ' out7.txt
run 0 ../ltl2tgba -R3 -b '(GFa&GFb) | (GFc&GFd)' > out8.txt
test `grep '^acc' out8.txt | wc -w` = 4
run 0 ../ltl2tgba -R3 -H '(GFa&GFb) | (GFc&GFd)' > out8.txt
grep 'Acceptance: 2 ' out8.txt
# This formula gives a 12-state automaton in which one acceptance
# condition can be removed, and after what direct simulation should