* src/ltlvisit/nenoform.hh, src/ltlvisit/nenoform.cc: New files.

* src/ltlvisit/Makefile.am (libltlvisit_a_SOURCES): Add them.
* src/ltltest/equals.cc (main) [NENOFORM]: Call negative_normal_form.
* src/ltltest/nenoform.test, src/ltltest/tunenoform.test: New files.
* src/ltltest/Makefile.am (check_PROGRAMS): Add nenoform and
tunenoform.
(nenoform_SOURCES, nenoform_CPPFLAGS, tunenoform_SOURCES,
tunenoform_CPPFLAGS): New variables.
(TESTS): Add nenoform.test and tunenoform.test.
This commit is contained in:
Alexandre Duret-Lutz 2003-04-17 13:12:11 +00:00
parent e58aae95c0
commit 0c7a2412a4
9 changed files with 308 additions and 2 deletions

49
src/ltltest/nenoform.test Executable file
View file

@ -0,0 +1,49 @@
#! /bin/sh
# Check for the negative_normal_form visitor
. ./defs || exit 1
check()
{
./nenoform "$1" "$2" || exit 1
}
# A few things that do not change
check 'a' 'a'
check '1' '1'
check '0' '0'
check '!a' '!a'
check 'a U b' 'a U b'
check 'a & b' 'a & b'
check 'a & b' 'b & a'
check 'a & !b & c' 'c & a & !b'
check 'a & b & c' 'b & c & a'
check 'Xa & b & Xa' 'b & Xa & b'
check 'a & b' 'b & a & b'
check 'a & !b' '!b & a & a'
check 'a & b & (Xc |(f U !g)| e)' 'b & a & a & (Xc | e |(f U !g)| e | Xc) & b'
check 'GFa => FGb' 'GFa => FGb'
# Basic rewritings
check '!!a' 'a'
check '!!!!!a' '!a'
check '!Xa' 'X!a'
check '!Fa' 'G!a'
check '!Ga' 'F!a'
check '!(a ^ b)' 'a <=> b'
check '!(a <=> b)' '(((a) ^ (b)))'
check '!(a => b)' 'a&!b'
check '!(!a => !b)' '!a&b'
check '!(a U b)' '!a R !b'
check '!(a R b)' '!a U !b'
check '!(!a R !b)' 'a U b'
check '!(a & b & c & d & b)' '!a | !b | !c | !d'
check '!(a | b | c | d)' '!a & !b & !c & !d'
# Nested rewritings
check '!(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'
# Success.
: