* src/ltltest/reduc.test: POSIXify.
This commit is contained in:
parent
c4a5b325a2
commit
a66e7250bf
2 changed files with 27 additions and 105 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
2004-05-11 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
|
* src/ltltest/reduc.test: POSIXify.
|
||||||
|
|
||||||
2004-05-10 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
2004-05-10 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||||
|
|
||||||
* src/sanity/style.test: New file.
|
* src/sanity/style.test: New file.
|
||||||
|
|
|
||||||
|
|
@ -21,114 +21,32 @@
|
||||||
# 02111-1307, USA.
|
# 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
# Check for the reduc visitor
|
# Check for the reduc visitor.
|
||||||
|
|
||||||
#. ./defs || exit 1
|
. ./defs || exit 1
|
||||||
if [ $1 ]; then
|
|
||||||
FICH=$1
|
set -e
|
||||||
else
|
|
||||||
FICH="formules.ltl"
|
FICH=${1-$srcdir/formules.ltl}
|
||||||
fi
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
rm output? result_bri.test -f
|
|
||||||
for opt in bri ##b r i br bi rb ri ib ir bri bir rbi rib ibr irb
|
rm -f result.data
|
||||||
do
|
|
||||||
for f in `awk '{print $1}' $FICH`
|
cat $FICH |
|
||||||
do
|
while read f; do
|
||||||
if [ ! $f = "####" ]; then
|
if [ -n "$f" ] && [ "$f" != "####" ]; then
|
||||||
#echo $f;
|
./reduc "$f" >> result.data
|
||||||
if ./reduc "$f" >> result_$opt.test;
|
fi
|
||||||
then
|
|
||||||
#echo $f >> output1
|
|
||||||
# if ../tgbatest/ltl2tgba -f "$f" >> output1; then #automate FM
|
|
||||||
# echo "" >> output1
|
|
||||||
# else
|
|
||||||
# echo $f;
|
|
||||||
# fi
|
|
||||||
#echo "'$f' is reduce ($NB)"
|
|
||||||
(( NB += 1 ));
|
|
||||||
else
|
|
||||||
(( NB = NB ));
|
|
||||||
#echo "reduc failed to reduce '$f'";
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
#echo "$NB formula reduce"
|
|
||||||
(( NB = 0 ));
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
test $? == 0 || exit 1
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
#ftmp=""
|
perl -ne 'BEGIN { $sum1 = 0; $sum2 = 0; }
|
||||||
#for f in `sed -e "s/\(.* reduce to \)/'1'/" result_bri.test`
|
/^(\d+)\s+(\d+)/;
|
||||||
# do
|
$sum1 += $1;
|
||||||
# if [ $ftmp = "" ]; then
|
$sum2 += $2;
|
||||||
# echo $ftmp;
|
END { print $sum2 * 100 / $sum1; print "\n"; }
|
||||||
# ftmp="";
|
' < result.test
|
||||||
# else
|
|
||||||
# echo $f;
|
|
||||||
# ftmp="$ftmp $f";
|
|
||||||
# echo $ftmp;
|
|
||||||
# fi
|
|
||||||
# echo $f >> output2
|
|
||||||
# ../tgbatest/ltl2tgba -f "$f" >> output2 #automate FM
|
|
||||||
# echo "" >> output2
|
|
||||||
#done
|
|
||||||
|
|
||||||
##############################################
|
|
||||||
#exit 0
|
|
||||||
##############################################
|
|
||||||
|
|
||||||
SUM1=0
|
|
||||||
SUM2=0
|
|
||||||
AVG=0
|
|
||||||
for res in `awk '{print $1}' result_bri.test`
|
|
||||||
do
|
|
||||||
SUM1=$(expr $res + $SUM1)
|
|
||||||
done
|
|
||||||
#echo $SUM1
|
|
||||||
|
|
||||||
for res in `awk '{print $2}' result_bri.test`
|
|
||||||
do
|
|
||||||
SUM2=$(expr $res + $SUM2)
|
|
||||||
done
|
|
||||||
(( SUM2 *= 100 ))
|
|
||||||
#echo $SUM2
|
|
||||||
|
|
||||||
if [ ! $SUM1 = 0 ]; then
|
|
||||||
AVG=$(expr $SUM2 / $SUM1)
|
|
||||||
fi
|
|
||||||
|
|
||||||
#AVG=$(expr $AVG / $NB)
|
|
||||||
#AVG=$(expr $AVG)
|
|
||||||
#echo "average reduce $AVG %"
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
||||||
### Formule qui ne passe pas !! => Segmentation fault !!
|
|
||||||
#'(((p2)R((X(p2))U(X(1))))*(p0))*((p1)R((p2)R(p0)))'
|
|
||||||
#'(((p2)R((X(p2))U(X(1))))*(p0))'
|
|
||||||
#'((p1)R((p2)R(p0)))'
|
|
||||||
|
|
||||||
#'(p0 R (Gp0 U (p0 U Xp1)))'
|
|
||||||
|
|
||||||
|
|
||||||
#'(((!p)*(X(X(p))))*((p)R((q)+(!q))))+((!q)U(q))'
|
|
||||||
#'X(((p1)R(1))*((0)R((p0)+(p1))))'
|
|
||||||
#'((p0)U(0))U(((0)R(0))*(X(p2)))'
|
|
||||||
#'(((X(1))R(1))U((0)R(1)))R(p0)'
|
|
||||||
#'((X(p0))R(X(p2)))+((0)R((((p2)+(0))*(p0))R(0)))'
|
|
||||||
#'((X(0))+((0)R(p2)))U(((p0)R((p2)*(p2)))R(X(p2)))'
|
|
||||||
#'(p1)R(((p2)R(1))R(((p1)U((1)U(p0)))R((p2)U(0))))'
|
|
||||||
#'(((X(p0))R(X(p0)))R((p0)R(1)))*((0)R((p1)R(0)))'
|
|
||||||
#'(((p1)R(X(p2)))R((0)+((1)U(1))))U((X(1))R(p2))'
|
|
||||||
|
|
||||||
(((!p)*(X(X(p))))*((p)R((q)+(!q))))+((!q)U(q))
|
|
||||||
X(((p1)R(1))*((0)R((p0)+(p1))))
|
|
||||||
((p0)U(0))U(((0)R(0))*(X(p2)))
|
|
||||||
(((X(1))R(1))U((0)R(1)))R(p0)
|
|
||||||
((X(p0))R(X(p2)))+((0)R((((p2)+(0))*(p0))R(0)))
|
|
||||||
((X(0))+((0)R(p2)))U(((p0)R((p2)*(p2)))R(X(p2)))
|
|
||||||
(p1)R(((p2)R(1))R(((p1)U((1)U(p0)))R((p2)U(0))))
|
|
||||||
(((X(p0))R(X(p0)))R((p0)R(1)))*((0)R((p1)R(0)))
|
|
||||||
(((p1)R(X(p2)))R((0)+((1)U(1))))U((X(1))R(p2))
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue