* src/sanity/80columns.test: New file.

* src/sanity/Makefile.am (check-local): Run it.
* src/ltltest/equals.test, src/ltltest/lunabbrev.test,
src/ltltest/nenoform.test, src/ltltest/parseerr.test
src/ltltest/tunabbrev.test, src/ltlvisit/forminf.cc,
src/tgbatest/explpro2.test, src/tgbatest/explpro3.test,
src/tgbatest/explprod.test, src/tgbatest/spotlbtt.test,
src/tgbatest/tripprod.test: Wrap long lines.
This commit is contained in:
Alexandre Duret-Lutz 2004-05-10 17:18:27 +00:00
parent e69d0fa94e
commit 83de4264cb
15 changed files with 180 additions and 115 deletions

View file

@ -1,3 +1,15 @@
2004-05-10 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/sanity/80columns.test: New file.
* src/sanity/Makefile.am (check-local): Run it.
* src/ltltest/equals.test, src/ltltest/lunabbrev.test,
src/ltltest/nenoform.test, src/ltltest/parseerr.test
src/ltltest/tunabbrev.test, src/ltltest/reduc.cc,
src/ltltest/tunabbrev.test, src/ltlvisit/forminf.cc,
src/tgbatest/explpro2.test, src/tgbatest/explpro3.test,
src/tgbatest/explprod.test, src/tgbatest/spotlbtt.test,
src/tgbatest/tripprod.test: Wrap long lines.
2004-05-10 Thomas MARTINEZ <martinez@abacus.lip6.fr> 2004-05-10 Thomas MARTINEZ <martinez@abacus.lip6.fr>
* src/tgbatest/ltl2tgba.cc (main): Add a option for reduce the formula. * src/tgbatest/ltl2tgba.cc (main): Add a option for reduce the formula.

View file

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), # Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
# #
@ -39,7 +39,8 @@ run 0 ./equals 'a & b & c' 'b & c & a'
run 0 ./equals 'a && b & a' 'b & a & b' run 0 ./equals 'a && b & a' 'b & a & b'
run 0 ./equals 'a & b' 'b & a & b' run 0 ./equals 'a & b' 'b & a & b'
run 0 ./equals 'a & b' 'b & a & a' run 0 ./equals 'a & b' 'b & a & a'
run 0 ./equals 'a & b & (c |(f U g)|| e)' 'b & a & a & (c | e |(f U g)| e | c) & b' run 0 ./equals 'a & b & (c |(f U g)|| e)' \
'b & a & a & (c | e |(f U g)| e | c) & b'
run 0 ./equals 'a & a' 'a' run 0 ./equals 'a & a' 'a'
# other formulae which are not # other formulae which are not
@ -51,7 +52,8 @@ run 1 ./equals 'a => b' 'a U b'
run 1 ./equals 'a R b' 'a U b' run 1 ./equals 'a R b' 'a U b'
run 1 ./equals 'a & b & c' 'c & a' run 1 ./equals 'a & b & c' 'c & a'
run 1 ./equals 'b & c' 'c & a & b' run 1 ./equals 'b & c' 'c & a & b'
run 1 ./equals 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(g U g)| e | c) & b' run 1 ./equals 'a & b & (c |(f U g)| e)' \
'b & a & a & (c | e |(g U g)| e | c) & b'
# Precedence # Precedence
run 0 ./equals 'a & b ^ c | d' 'd | c ^ b & a' run 0 ./equals 'a & b ^ c | d' 'd | c ^ b & a'

View file

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), # Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
# #
@ -40,10 +40,12 @@ run 0 ./lunabbrev 'a & b & c' 'b & c & a'
run 0 ./lunabbrev 'a & b & a' 'b & a & b' run 0 ./lunabbrev 'a & b & a' 'b & a & b'
run 0 ./lunabbrev 'a & b' 'b & a & b' run 0 ./lunabbrev 'a & b' 'b & a & b'
run 0 ./lunabbrev 'a & b' 'b & a & a' run 0 ./lunabbrev 'a & b' 'b & a & a'
run 0 ./lunabbrev 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(f U g)| e | c) & b' run 0 ./lunabbrev 'a & b & (c |(f U g)| e)' \
'b & a & a & (c | e |(f U g)| e | c) & b'
# other formulae that do change # other formulae that do change
run 0 ./lunabbrev 'a ^ b' '(a & !b) | (!a & b)' run 0 ./lunabbrev 'a ^ b' '(a & !b) | (!a & b)'
run 0 ./lunabbrev 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)' run 0 ./lunabbrev 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
run 0 ./lunabbrev 'GF a => F G(b)' '!GFa | F Gb' run 0 ./lunabbrev 'GF a => F G(b)' '!GFa | F Gb'
run 0 ./lunabbrev '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)' run 0 ./lunabbrev '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
run 0 ./lunabbrev '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)' run 0 ./lunabbrev '(a ^ b) | (b ^ c)' \
'(c & !b) | (!c & b) | (a & !b) | (!a & b)'

View file

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), # Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
# #
@ -40,7 +40,8 @@ run 0 ./nenoform 'a & b & c' 'b & c & a'
run 0 ./nenoform 'Xa & b & Xa' 'b & Xa & b' run 0 ./nenoform 'Xa & b & Xa' 'b & Xa & b'
run 0 ./nenoform 'a & b' 'b & a & b' run 0 ./nenoform 'a & b' 'b & a & b'
run 0 ./nenoform 'a & !b' '!b & a & a' run 0 ./nenoform 'a & !b' '!b & a & a'
run 0 ./nenoform 'a & b & (Xc |(f U !g)| e)' 'b & a & a & (Xc | e |(f U !g)| e | Xc) & b' run 0 ./nenoform 'a & b & (Xc |(f U !g)| e)' \
'b & a & a & (Xc | e |(f U !g)| e | Xc) & b'
run 0 ./nenoform 'GFa => FGb' 'GFa => FGb' run 0 ./nenoform 'GFa => FGb' 'GFa => FGb'
# Basic rewritings # Basic rewritings
@ -60,5 +61,6 @@ run 0 ./nenoform '!(a & b & c & d & b)' '!a | !b | !c | !d'
run 0 ./nenoform '!(a | b | c | d)' '!a & !b & !c & !d' run 0 ./nenoform '!(a | b | c | d)' '!a & !b & !c & !d'
# Nested rewritings # Nested rewritings
run 0 ./nenoform '!(a U (!b U ((a & b & c) R d)))' '!a R (b R ((!a | !b | !c) U !d))' run 0 ./nenoform '!(a U (!b U ((a & b & c) R d)))' \
'!a R (b R ((!a | !b | !c) U !d))'
run 0 ./nenoform '!(GF a => FG b)' 'GFa & GF!b' run 0 ./nenoform '!(GF a => FG b)' 'GFa & GF!b'

View file

@ -56,7 +56,8 @@ check 'a U b c' 'binop(U, AP(a), AP(b))'
check 'a &&& b' 'multop(And, constant(0), AP(b))' check 'a &&& b' 'multop(And, constant(0), AP(b))'
# (check multop merging while we are at it) # (check multop merging while we are at it)
check 'a & b & c & d e' 'multop(And, AP(a), AP(b), AP(c), AP(d))' check 'a & b & c & d e' 'multop(And, AP(a), AP(b), AP(c), AP(d))'
check 'a & (b | c) & d should work' 'multop(And, AP(a), multop(Or, AP(b), AP(c)), AP(d))' check 'a & (b | c) & d should work' \
'multop(And, AP(a), multop(Or, AP(b), AP(c)), AP(d))'
# Binop recovery # Binop recovery
check 'a U' 'constant(0)' check 'a U' 'constant(0)'

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -106,22 +106,27 @@ main(int argc, char** argv)
if (red && (f2 == NULL)) { if (red && (f2 == NULL)) {
std::cout << length_f1_before << " " << length_f1_after std::cout << length_f1_before << " " << length_f1_after
<< " '" << f1s_before << "' reduce to '" << f1s_after << "'" << std::endl; << " '" << f1s_before << "' reduce to '" << f1s_after << "'"
<< std::endl;
} }
if (f2 != NULL){ if (f2 != NULL){
if (f1 != f2) { if (f1 != f2) {
if (length_f1_after < length_f1_before) if (length_f1_after < length_f1_before)
std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after << " KOREDUC " << std::endl; std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after
<< " KOREDUC " << std::endl;
else else
std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after << " KOIDEM " << std::endl; std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after
<< " KOIDEM " << std::endl;
exit_code = 1; exit_code = 1;
} }
else { else {
if (f1s_before != f1s_after) if (f1s_before != f1s_after)
std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after << " OKREDUC " << std::endl; std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after
<< " OKREDUC " << std::endl;
else else
std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after << " OKIDEM" << std::endl; std::cout << f1s_before << " ** " << f2s << " ** " << f1s_after
<< " OKIDEM" << std::endl;
exit_code = 0; exit_code = 0;
} }
} }

View file

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), # Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
# #
@ -39,16 +39,19 @@ run 0 ./tunabbrev 'a & b & c' 'b & c & a'
run 0 ./tunabbrev 'a & b & a' 'b & a & b' run 0 ./tunabbrev 'a & b & a' 'b & a & b'
run 0 ./tunabbrev 'a & b' 'b & a & b' run 0 ./tunabbrev 'a & b' 'b & a & b'
run 0 ./tunabbrev 'a & b' 'b & a & a' run 0 ./tunabbrev 'a & b' 'b & a & a'
run 0 ./tunabbrev 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(f U g)| e | c) & b' run 0 ./tunabbrev 'a & b & (c |(f U g)| e)' \
'b & a & a & (c | e |(f U g)| e | c) & b'
# same as in lunabbrev.test: # same as in lunabbrev.test:
run 0 ./tunabbrev 'a ^ b' '(a & !b) | (!a & b)' run 0 ./tunabbrev 'a ^ b' '(a & !b) | (!a & b)'
run 0 ./tunabbrev 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)' run 0 ./tunabbrev 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
run 0 ./tunabbrev '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)' run 0 ./tunabbrev '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
run 0 ./tunabbrev '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)' run 0 ./tunabbrev '(a ^ b) | (b ^ c)' \
'(c & !b) | (!c & b) | (a & !b) | (!a & b)'
# LTL unabbreviations: # LTL unabbreviations:
run 0 ./tunabbrev 'G a ' 'false R a' run 0 ./tunabbrev 'G a ' 'false R a'
run 0 ./tunabbrev 'GF a => F G(b)' '!(false R (true U a)) | (true U (false V b))' run 0 ./tunabbrev 'GF a => F G(b)' \
'!(false R (true U a)) | (true U (false V b))'
run 0 ./tunabbrev 'GGGGa' 'false V (false V (false V (false V a)))' run 0 ./tunabbrev 'GGGGa' 'false V (false V (false V (false V a)))'
run 0 ./tunabbrev 'FFFfalse' 'true U ((true) U (true U (false)))' run 0 ./tunabbrev 'FFFfalse' 'true U ((true) U (true U (false)))'

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -414,7 +414,8 @@ namespace spot
&& (node_type(f2) == node_type_form_visitor::Binop)) && (node_type(f2) == node_type_form_visitor::Binop))
if (((const binop*)f)->op() == ((const binop*)f2)->op()) if (((const binop*)f)->op() == ((const binop*)f2)->op())
if (inf_form(((const binop*)f2)->first(),((const binop*)f)->first()) if (inf_form(((const binop*)f2)->first(),((const binop*)f)->first())
&& inf_form(((const binop*)f2)->second(),((const binop*)f)->second()) ) && inf_form(((const binop*)f2)->second(),
((const binop*)f)->second()))
return true; return true;
return false; return false;
} }
@ -483,7 +484,8 @@ namespace spot
return; return;
case unop::G: case unop::G:
// F(a) = false R a // F(a) = false R a
tmp = binop::instance(binop::R,constant::false_instance(),clone(f1)); tmp = binop::instance(binop::R,
constant::false_instance(), clone(f1));
if (this->special_case(tmp)){ if (this->special_case(tmp)){
result_ = true; result_ = true;
spot::ltl::destroy(tmp); spot::ltl::destroy(tmp);
@ -588,7 +590,8 @@ namespace spot
{ {
const formula* ftmp1; const formula* ftmp1;
const formula* ftmp2; const formula* ftmp2;
const formula* ftmp3 = unop::instance(unop::Not,(n == 0)? clone(f1) : clone(f2)); const formula* ftmp3 = unop::instance(unop::Not,
(n == 0)? clone(f1) : clone(f2));
const formula* ftmp4 = spot::ltl::negative_normal_form((n == 0)? f2 : f1); const formula* ftmp4 = spot::ltl::negative_normal_form((n == 0)? f2 : f1);
const formula* ftmp5; const formula* ftmp5;
const formula* ftmp6; const formula* ftmp6;

28
src/sanity/80columns.test Executable file
View file

@ -0,0 +1,28 @@
#! /bin/sh
# Check that all files use at most 80 columns.
set -e
rm -f failures
find "${INCDIR-..}" \( -name "${1-*}.hh" -o -name "${1-*}.cc" \
-o -name "${1-*}.test" \) -a -type f -a -print |
while read file; do
x='.........................................'
if grep -q $x$x "$file"; then
if grep 'GNU Bison' "$file" >/dev/null ||
grep 'generated by flex' "$file" >/dev/null ; then
:
else
echo "$file" >>failures
fi
fi
done
if test -f failures; then
echo "The following files contain lines with more than 80 characters:"
cat failures
rm failures
exit 1;
fi

View file

@ -30,6 +30,8 @@ check-local:
CXXFLAGS='$(AM_CXXFLAGS) $(CXXFLAGS)' \ CXXFLAGS='$(AM_CXXFLAGS) $(CXXFLAGS)' \
INCDIR='$(top_srcdir)/src' \ INCDIR='$(top_srcdir)/src' \
$(SHELL) $(srcdir)/includes.test $(TESTHEADER) $(SHELL) $(srcdir)/includes.test $(TESTHEADER)
INCDIR='$(top_srcdir)/src' \
$(SHELL) $(srcdir)/80columns.test $(TESTHEADER)
# Ensure we have not forgotten to include an header. # Ensure we have not forgotten to include an header.
installcheck-local: installcheck-local:

View file

@ -47,7 +47,8 @@ run 0 ./explprod input1 input2 > stdout
# Sort out some possible inversions in the output. # Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.) # (The order is not guaranteed by SPOT.)
perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?/@{[sort $1, $2, $3]}/g;s/\(!b & a\)/(a & !b)/g;s/\(b & !a\)/(!a & b)/g' \ perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?/@{[sort $1, $2, $3]}/g;
s/\(!b & a\)/(a & !b)/g;s/\(b & !a\)/(!a & b)/g' \
stdout > tmp_ && mv tmp_ stdout stdout > tmp_ && mv tmp_ stdout
cat stdout cat stdout

View file

@ -47,7 +47,8 @@ run 0 ./explprod input1 input2 > stdout
# Sort out some possible inversions in the output. # Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.) # (The order is not guaranteed by SPOT.)
sed 's/"p3" "p2"/"p2" "p3"/g;s/(!b & a)/(a \& !b)/g;s/(b & !a)/(!a \& b)/g' stdout > tmp_ && mv tmp_ stdout sed 's/"p3" "p2"/"p2" "p3"/g;s/(!b & a)/(a \& !b)/g;
s/(b & !a)/(!a \& b)/g' stdout > tmp_ && mv tmp_ stdout
cat stdout cat stdout
diff stdout expected diff stdout expected

View file

@ -49,7 +49,8 @@ EOF
run 0 ./explprod input1 input2 > stdout run 0 ./explprod input1 input2 > stdout
# Sort out some possible inversions in the output. # Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.) # (The order is not guaranteed by SPOT.)
perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?/@{[sort $1, $2, $3]}/g;s/\(c & a\)/(a & c)/g;s/\(b & a\)/(a & b)/g' \ perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?/@{[sort $1, $2, $3]}/g;
s/\(c & a\)/(a & c)/g;s/\(b & a\)/(a & b)/g' \
stdout > tmp_ && mv tmp_ stdout stdout > tmp_ && mv tmp_ stdout
cat stdout cat stdout

View file

@ -185,7 +185,8 @@ Algorithm
Algorithm Algorithm
{ {
Name = "Spot (Couvreur -- FM exprop), fake, LTL simplifications by ltl2ba" Name = "Spot (Couvreur -- FM exprop), fake, LTL simplifications by ltl2ba"
Path = "${LBTT_TRANSLATE} --spot '${srcdir}/ltl2baw.pl --spot=\"-f -x -T\" -F'" Path =
"${LBTT_TRANSLATE} --spot '${srcdir}/ltl2baw.pl --spot=\"-f -x -T\" -F'"
Enabled = no Enabled = no
} }

View file

@ -61,7 +61,8 @@ run 0 ./tripprod input1 input2 input3 > stdout
# Sort out some possible inversions in the output. # Sort out some possible inversions in the output.
# (The order is not guaranteed by SPOT.) # (The order is not guaranteed by SPOT.)
perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?(?: ("\w+"))?/@{[sort $1, $2, $3, $4]}/g;s/\(c & a\)/(a & c)/g;s/\(b & a\)/(a & b)/g' \ perl -pe 's/("\w+") ("\w+")(?: ("\w+"))?(?: ("\w+"))?/@{[sort $1,$2,$3,$4]}/g;
s/\(c & a\)/(a & c)/g;s/\(b & a\)/(a & b)/g' \
stdout > tmp_ && stdout > tmp_ &&
mv tmp_ stdout mv tmp_ stdout