* src/ltltest/tostring.test: Simplify with set -e. Move the
description of the test ... * src/ltltest/tostring.cc: ... here, where it is actually coded. * src/ltltest/lunabbrev.test, src/ltltest/tunabbrev.test, src/ltltest/nenoform.test, src/ltltest/tunenoform.test: Simplify with set -e.
This commit is contained in:
parent
03e893b23d
commit
d17a86e87d
7 changed files with 115 additions and 130 deletions
|
|
@ -1,5 +1,12 @@
|
||||||
2003-04-29 Alexandre DURET-LUTZ <aduret@src.lip6.fr>
|
2003-04-29 Alexandre DURET-LUTZ <aduret@src.lip6.fr>
|
||||||
|
|
||||||
|
* src/ltltest/tostring.test: Simplify with set -e. Move the
|
||||||
|
description of the test ...
|
||||||
|
* src/ltltest/tostring.cc: ... here, where it is actually coded.
|
||||||
|
* src/ltltest/lunabbrev.test, src/ltltest/tunabbrev.test,
|
||||||
|
src/ltltest/nenoform.test, src/ltltest/tunenoform.test:
|
||||||
|
Simplify with set -e.
|
||||||
|
|
||||||
* configure.ac (AM_INIT_AUTOMAKE): Use nostdinc, to make
|
* configure.ac (AM_INIT_AUTOMAKE): Use nostdinc, to make
|
||||||
sure we always use paths relative to src/ in src/'s
|
sure we always use paths relative to src/ in src/'s
|
||||||
subdirectories.
|
subdirectories.
|
||||||
|
|
|
||||||
|
|
@ -4,32 +4,25 @@
|
||||||
|
|
||||||
. ./defs || exit 1
|
. ./defs || exit 1
|
||||||
|
|
||||||
check()
|
set -e
|
||||||
{
|
|
||||||
./lunabbrev "$1" "$2" || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# A few things that do not change
|
# A few things that do not change
|
||||||
check 'a' 'a'
|
./lunabbrev 'a' 'a'
|
||||||
check '1' '1'
|
./lunabbrev '1' '1'
|
||||||
check '0' '0'
|
./lunabbrev '0' '0'
|
||||||
check 'G a ' ' G a'
|
./lunabbrev 'G a ' ' G a'
|
||||||
check 'a U b' 'a U b'
|
./lunabbrev 'a U b' 'a U b'
|
||||||
check 'a & b' 'a & b'
|
./lunabbrev 'a & b' 'a & b'
|
||||||
check 'a & b' 'b & a'
|
./lunabbrev 'a & b' 'b & a'
|
||||||
check 'a & b & c' 'c & a & b'
|
./lunabbrev 'a & b & c' 'c & a & b'
|
||||||
check 'a & b & c' 'b & c & a'
|
./lunabbrev 'a & b & c' 'b & c & a'
|
||||||
check 'a & b & a' 'b & a & b'
|
./lunabbrev 'a & b & a' 'b & a & b'
|
||||||
check 'a & b' 'b & a & b'
|
./lunabbrev 'a & b' 'b & a & b'
|
||||||
check 'a & b' 'b & a & a'
|
./lunabbrev 'a & b' 'b & a & a'
|
||||||
check 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(f U g)| e | c) & b'
|
./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
|
||||||
check 'a ^ b' '(a & !b) | (!a & b)'
|
./lunabbrev 'a ^ b' '(a & !b) | (!a & b)'
|
||||||
check 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
|
./lunabbrev 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
|
||||||
check 'GF a => F G(b)' '!GFa | F Gb'
|
./lunabbrev 'GF a => F G(b)' '!GFa | F Gb'
|
||||||
check '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
|
./lunabbrev '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
|
||||||
check '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)'
|
./lunabbrev '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)'
|
||||||
|
|
||||||
# Success.
|
|
||||||
:
|
|
||||||
|
|
|
||||||
|
|
@ -4,46 +4,40 @@
|
||||||
|
|
||||||
. ./defs || exit 1
|
. ./defs || exit 1
|
||||||
|
|
||||||
check()
|
set -e
|
||||||
{
|
|
||||||
./nenoform "$1" "$2" || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# A few things that do not change
|
# A few things that do not change
|
||||||
check 'a' 'a'
|
./nenoform 'a' 'a'
|
||||||
check '1' '1'
|
./nenoform '1' '1'
|
||||||
check '0' '0'
|
./nenoform '0' '0'
|
||||||
check '!a' '!a'
|
./nenoform '!a' '!a'
|
||||||
check 'a U b' 'a U b'
|
./nenoform 'a U b' 'a U b'
|
||||||
check 'a & b' 'a & b'
|
./nenoform 'a & b' 'a & b'
|
||||||
check 'a & b' 'b & a'
|
./nenoform 'a & b' 'b & a'
|
||||||
check 'a & !b & c' 'c & a & !b'
|
./nenoform 'a & !b & c' 'c & a & !b'
|
||||||
check 'a & b & c' 'b & c & a'
|
./nenoform 'a & b & c' 'b & c & a'
|
||||||
check 'Xa & b & Xa' 'b & Xa & b'
|
./nenoform 'Xa & b & Xa' 'b & Xa & b'
|
||||||
check 'a & b' 'b & a & b'
|
./nenoform 'a & b' 'b & a & b'
|
||||||
check 'a & !b' '!b & a & a'
|
./nenoform 'a & !b' '!b & a & a'
|
||||||
check 'a & b & (Xc |(f U !g)| e)' 'b & a & a & (Xc | e |(f U !g)| e | Xc) & b'
|
./nenoform 'a & b & (Xc |(f U !g)| e)' 'b & a & a & (Xc | e |(f U !g)| e | Xc) & b'
|
||||||
check 'GFa => FGb' 'GFa => FGb'
|
./nenoform 'GFa => FGb' 'GFa => FGb'
|
||||||
|
|
||||||
# Basic rewritings
|
# Basic rewritings
|
||||||
check '!!a' 'a'
|
./nenoform '!!a' 'a'
|
||||||
check '!!!!!a' '!a'
|
./nenoform '!!!!!a' '!a'
|
||||||
check '!Xa' 'X!a'
|
./nenoform '!Xa' 'X!a'
|
||||||
check '!Fa' 'G!a'
|
./nenoform '!Fa' 'G!a'
|
||||||
check '!Ga' 'F!a'
|
./nenoform '!Ga' 'F!a'
|
||||||
check '!(a ^ b)' 'a <=> b'
|
./nenoform '!(a ^ b)' 'a <=> b'
|
||||||
check '!(a <=> b)' '(((a) ^ (b)))'
|
./nenoform '!(a <=> b)' '(((a) ^ (b)))'
|
||||||
check '!(a => b)' 'a&!b'
|
./nenoform '!(a => b)' 'a&!b'
|
||||||
check '!(!a => !b)' '!a&b'
|
./nenoform '!(!a => !b)' '!a&b'
|
||||||
check '!(a U b)' '!a R !b'
|
./nenoform '!(a U b)' '!a R !b'
|
||||||
check '!(a R b)' '!a U !b'
|
./nenoform '!(a R b)' '!a U !b'
|
||||||
check '!(!a R !b)' 'a U b'
|
./nenoform '!(!a R !b)' 'a U b'
|
||||||
check '!(a & b & c & d & b)' '!a | !b | !c | !d'
|
./nenoform '!(a & b & c & d & b)' '!a | !b | !c | !d'
|
||||||
check '!(a | b | c | d)' '!a & !b & !c & !d'
|
./nenoform '!(a | b | c | d)' '!a & !b & !c & !d'
|
||||||
|
|
||||||
# Nested rewritings
|
# Nested rewritings
|
||||||
check '!(a U (!b U ((a & b & c) R d)))' '!a R (b R ((!a | !b | !c) U !d))'
|
./nenoform '!(a U (!b U ((a & b & c) R d)))' '!a R (b R ((!a | !b | !c) U !d))'
|
||||||
check '!(GF a => FG b)' 'GFa & GF!b'
|
./nenoform '!(GF a => FG b)' 'GFa & GF!b'
|
||||||
|
|
||||||
# Success.
|
|
||||||
:
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ main(int argc, char **argv)
|
||||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1))
|
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
|
// The string generated from an abstract tree should be parsable
|
||||||
|
// again.
|
||||||
|
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
spot::ltl::to_string(*f1, os);
|
spot::ltl::to_string(*f1, os);
|
||||||
std::cout << os.str() << std::endl;
|
std::cout << os.str() << std::endl;
|
||||||
|
|
@ -32,14 +35,18 @@ main(int argc, char **argv)
|
||||||
if (spot::ltl::format_parse_errors(std::cerr, os.str(), p1))
|
if (spot::ltl::format_parse_errors(std::cerr, os.str(), p1))
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
|
// This second abstract tree should be equal to the first.
|
||||||
|
|
||||||
|
if (! equals(f1, f2))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
// It should also map to the same string.
|
||||||
|
|
||||||
std::ostringstream os2;
|
std::ostringstream os2;
|
||||||
spot::ltl::to_string(*f2, os2);
|
spot::ltl::to_string(*f2, os2);
|
||||||
std::cout << os2.str() << std::endl;
|
std::cout << os2.str() << std::endl;
|
||||||
|
|
||||||
if (os2.str() != os.str())
|
if (os2.str() != os.str())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (! equals(f1, f2))
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,24 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# Check that spot::ltl::tostring is correct: after to parse we get the
|
# Check for spot::ltl::tostring.
|
||||||
# string of the abstract syntax tree and xe parse it again to apply spot::ltl::tostring one more times.
|
|
||||||
|
|
||||||
. ./defs || exit 1
|
. ./defs || exit 1
|
||||||
|
|
||||||
check()
|
set -e
|
||||||
{
|
|
||||||
./tostring "$1" || exit 1
|
./tostring 'a'
|
||||||
}
|
./tostring '1'
|
||||||
|
./tostring '0'
|
||||||
|
./tostring 'a => b'
|
||||||
|
./tostring 'G a '
|
||||||
|
./tostring 'a U b'
|
||||||
|
./tostring 'a & b'
|
||||||
|
./tostring 'a & b & c'
|
||||||
|
./tostring 'b & a & b'
|
||||||
|
./tostring 'b & a & a'
|
||||||
|
./tostring 'a & b & (c |(f U g)| e)'
|
||||||
|
./tostring 'b & a & a & (c | e |(f U g)| e | c) & b'
|
||||||
|
./tostring 'a <=> b'
|
||||||
|
./tostring 'a & b & (c |(f U g)| e)'
|
||||||
|
./tostring 'b & a & a & (c | e |(g U g)| e | c) & b'
|
||||||
|
|
||||||
check 'a'
|
|
||||||
check '1'
|
|
||||||
check '0'
|
|
||||||
check 'a => b'
|
|
||||||
check 'G a '
|
|
||||||
check 'a U b'
|
|
||||||
check 'a & b'
|
|
||||||
check 'a & b & c'
|
|
||||||
check 'b & a & b'
|
|
||||||
check 'b & a & a'
|
|
||||||
check 'a & b & (c |(f U g)| e)'
|
|
||||||
check 'b & a & a & (c | e |(f U g)| e | c) & b'
|
|
||||||
check 'a <=> b'
|
|
||||||
check 'a & b & (c |(f U g)| e)'
|
|
||||||
check 'b & a & a & (c | e |(g U g)| e | c) & b'
|
|
||||||
:
|
|
||||||
|
|
|
||||||
|
|
@ -4,36 +4,30 @@
|
||||||
|
|
||||||
. ./defs || exit 1
|
. ./defs || exit 1
|
||||||
|
|
||||||
check()
|
set -e
|
||||||
{
|
|
||||||
./tunabbrev "$1" "$2" || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# A few things that do not change
|
# A few things that do not change
|
||||||
check 'a' 'a'
|
./tunabbrev 'a' 'a'
|
||||||
check '1' '1'
|
./tunabbrev '1' '1'
|
||||||
check '0' '0'
|
./tunabbrev '0' '0'
|
||||||
check 'a U b' 'a U b'
|
./tunabbrev 'a U b' 'a U b'
|
||||||
check 'a & b' 'a & b'
|
./tunabbrev 'a & b' 'a & b'
|
||||||
check 'a & b' 'b & a'
|
./tunabbrev 'a & b' 'b & a'
|
||||||
check 'a & b & c' 'c & a & b'
|
./tunabbrev 'a & b & c' 'c & a & b'
|
||||||
check 'a & b & c' 'b & c & a'
|
./tunabbrev 'a & b & c' 'b & c & a'
|
||||||
check 'a & b & a' 'b & a & b'
|
./tunabbrev 'a & b & a' 'b & a & b'
|
||||||
check 'a & b' 'b & a & b'
|
./tunabbrev 'a & b' 'b & a & b'
|
||||||
check 'a & b' 'b & a & a'
|
./tunabbrev 'a & b' 'b & a & a'
|
||||||
check 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(f U g)| e | c) & b'
|
./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:
|
||||||
check 'a ^ b' '(a & !b) | (!a & b)'
|
./tunabbrev 'a ^ b' '(a & !b) | (!a & b)'
|
||||||
check 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
|
./tunabbrev 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
|
||||||
check '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
|
./tunabbrev '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
|
||||||
check '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)'
|
./tunabbrev '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)'
|
||||||
|
|
||||||
# LTL unabbreviations:
|
# LTL unabbreviations:
|
||||||
check 'G a ' 'false R a'
|
./tunabbrev 'G a ' 'false R a'
|
||||||
check 'GF a => F G(b)' '!(false R (true U a)) | (true U (false V b))'
|
./tunabbrev 'GF a => F G(b)' '!(false R (true U a)) | (true U (false V b))'
|
||||||
check 'GGGGa' 'false V (false V (false V (false V a)))'
|
./tunabbrev 'GGGGa' 'false V (false V (false V (false V a)))'
|
||||||
check 'FFFfalse' 'true U ((true) U (true U (false)))'
|
./tunabbrev 'FFFfalse' 'true U ((true) U (true U (false)))'
|
||||||
|
|
||||||
# Success.
|
|
||||||
:
|
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,12 @@
|
||||||
|
|
||||||
. ./defs || exit 1
|
. ./defs || exit 1
|
||||||
|
|
||||||
check()
|
set -e
|
||||||
{
|
|
||||||
./tunenoform "$1" "$2" || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
check '!(a ^ b)' '(a|!b) & (!a|b)'
|
./tunenoform '!(a ^ b)' '(a|!b) & (!a|b)'
|
||||||
check '!(a <=> b)' '(a|b) & (!a|!b)'
|
./tunenoform '!(a <=> b)' '(a|b) & (!a|!b)'
|
||||||
check '!(a => b)' 'a&!b'
|
./tunenoform '!(a => b)' 'a&!b'
|
||||||
check '!(!a => !b)' '!a&b'
|
./tunenoform '!(!a => !b)' '!a&b'
|
||||||
check '!Fa' 'false R !a'
|
./tunenoform '!Fa' 'false R !a'
|
||||||
check '!G!a' 'true U a'
|
./tunenoform '!G!a' 'true U a'
|
||||||
check '!(GF a => FG b)' '(0 R (1 U a)) & (0 R (1 U !b))'
|
./tunenoform '!(GF a => FG b)' '(0 R (1 U a)) & (0 R (1 U !b))'
|
||||||
|
|
||||||
# Success.
|
|
||||||
:
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue