* src/tgba/tgbaexplicit.cc (tgba_explicit::all_accepting_conditions)

Compute all_accepting_conditions_ from neg_accepting_conditions_,
not by browsing the dictionary.  The dictionary also contains
accepting conditions from other automata...  This bug was a
consequence of the change from 2003-07-14.
* src/tgbaalgos/save.cc (save_bfs::start()): Likewise, do not
browse the dictionary to print accepting conditions.  Call
->all_accepting_conditions() instead.
* src/tgba/tgbaproduct.cc (tgba_product::tgba_product): Typo
from 2003-08-22 in the computation of all_accepting_conditions_.
* src/tgbatest/explpro3.test: New file.
* src/tgbatest/Makefile.am (TESTS): Add explpro3.test.
* src/tgbatest/explprod.test, src/tgbatest/explpro2.test,
 src/tgbatest/tripprod.test: Sort the output using Perl.
This commit is contained in:
Alexandre Duret-Lutz 2003-08-29 15:48:23 +00:00
parent 1955150999
commit 6da1f35641
9 changed files with 108 additions and 34 deletions

View file

@ -39,6 +39,7 @@ TESTS = \
bddprod.test \
explprod.test \
explpro2.test \
explpro3.test \
tripprod.test \
mixprod.test \
ltlmagic.test \

View file

@ -18,16 +18,16 @@ EOF
cat >expected <<EOF
acc = "p1" "p2" "p3";
"s1 * s1", "s2 * s2", ! a b, "p1" "p2";
"s1 * s1", "s3 * s3", a ! b, "p2" "p3";
"s1 * s1", "s2 * s2", ! a b, "p1" "p2";
"s1 * s1", "s3 * s3", a ! b, "p2" "p3";
EOF
./explprod input1 input2 > stdout
# Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.)
sed 's/c a/a c/g;s/b a/a b/g;s/"p3" "p2"/"p2" "p3"/g;s/"p2" "p1"/"p1" "p2"/g' stdout > tmp_ &&
mv tmp_ stdout
perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?/@{[sort $1, $2, $3]}/g' \
stdout > tmp_ && mv tmp_ stdout
cat stdout
diff stdout expected

33
src/tgbatest/explpro3.test Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
. ./defs
set -e
cat >input1 <<EOF
acc = ;
s1, s2, !a,;
s1, s3, !b,;
EOF
cat >input2 <<EOF
acc = p2 p3;
s1, s2, b, p2;
s1, s3, a, p3;
EOF
cat >expected <<EOF
acc = "p2" "p3";
"s1 * s1", "s2 * s2", ! a b, "p2";
"s1 * s1", "s3 * s3", a ! b, "p3";
EOF
./explprod input1 input2 > stdout
# Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.)
sed 's/"p3" "p2"/"p2" "p3"/g' stdout > tmp_ && mv tmp_ stdout
cat stdout
diff stdout expected
rm input1 input2 stdout expected

View file

@ -20,17 +20,16 @@ EOF
cat >expected <<EOF
acc = "p1" "p2" "p3";
"s1 * s1", "s3 * s2", a b, "p1" "p2";
"s1 * s1", "s2 * s2", b, "p1" "p2";
"s2 * s2", "s3 * s1", a c, "p1" "p3";
"s1 * s1", "s3 * s2", a b, "p1" "p2";
"s1 * s1", "s2 * s2", b, "p1" "p2";
"s2 * s2", "s3 * s1", a c, "p1" "p3";
EOF
./explprod input1 input2 > stdout
# Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.)
sed 's/c a/a c/g;s/b a/a b/g;s/"p3" "p1"/"p1" "p3"/g;s/"p3" "p2"/"p2" "p3"/g;s/"p2" "p1"/"p1" "p2"/g' stdout > tmp_ &&
mv tmp_ stdout
perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?/@{[sort $1, $2, $3]}/g' \
stdout > tmp_ && mv tmp_ stdout
cat stdout
diff stdout expected

View file

@ -28,25 +28,20 @@ EOF
cat >expected <<EOF
acc = "p1" "p2" "p3" "p4";
"s1 * s1 * s1", "s3 * s2 * s2", a b, "p1" "p2";
"s1 * s1 * s1", "s2 * s2 * s2", a b, "p1" "p2";
"s1 * s1 * s1", "s3 * s2 * s3", a b, "p1" "p2";
"s1 * s1 * s1", "s2 * s2 * s3", b, "p1" "p2";
"s2 * s2 * s2", "s3 * s1 * s3", a c, "p3" "p4";
"s2 * s2 * s3", "s3 * s1 * s2", a c, "p3" "p4";
"s1 * s1 * s1", "s3 * s2 * s2", a b, "p1" "p2";
"s1 * s1 * s1", "s2 * s2 * s2", a b, "p1" "p2";
"s1 * s1 * s1", "s3 * s2 * s3", a b, "p1" "p2";
"s1 * s1 * s1", "s2 * s2 * s3", b, "p1" "p2";
"s2 * s2 * s2", "s3 * s1 * s3", a c, "p3" "p4";
"s2 * s2 * s3", "s3 * s1 * s2", a c, "p3" "p4";
EOF
./tripprod input1 input2 input3 > stdout
# Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.)
sed 's/c a/a c/g;s/b a/a b/g;
s/"p4" "p1"/"p1" "p4"/g;
s/"p3" "p1"/"p1" "p3"/g;
s/"p2" "p1"/"p1" "p2"/g;
s/"p4" "p2"/"p2" "p4"/g;
s/"p3" "p2"/"p2" "p3"/g;
s/"p4" "p3"/"p3" "p4"/g' stdout > tmp_ &&
perl -pe 's/c a/a c/g;s/b a/a b/g;s/("\w+") ("\w+")(?: ("\w+"))?(?: ("\w+"))?/@{[sort $1, $2, $3, $4]}/g' \
stdout > tmp_ &&
mv tmp_ stdout
cat stdout