spot/src/ltltest/equals.test
Alexandre Duret-Lutz de6314ed74 Revamp the multop interface to allow some basic optimizations like
not constructing a single-child multop.
* src/ltlast/multop.hh (multop::instance(type)): Remove.
(multop::instance(type, formula*, formula*)): Return a formula*.
(multop::instance(type, vec*)): Make it public and return a formula*.
(multop::add_sorted, multop::add):
* src/ltlast/multop.cc (multop::instance(type, vec*)): Rewrite.
(multop::instance(type)): Delete.
(multop::instance(type, formula*, formula*)): Adjust.
(multop::add_sorted, multop::add): Remove.
* src/ltlvisit/clone.cc (clone_visitor::visit(multop*)) Adjust.
* src/ltlvisit/nenoform.cc
(negative_normal_form_visitor::::visit(multop*)) Adjust.
* src/ltltest/equals.test: Make sure `a & a' and `a' are equals.
* wrap/python/tests/ltlsimple.py: Adjust.
2003-08-10 16:29:49 +00:00

45 lines
941 B
Bash
Executable file

#! /bin/sh
# Check for the equals visitor
. ./defs || exit 1
check()
{
./equals "$2" "$3"
test $? != $1 && exit 1;
}
# A few things which are equal
check 0 'a' 'a'
check 0 '1' '1'
check 0 '0' '0'
check 0 'a => b' 'a => b'
check 0 'G a ' ' G a'
check 0 'a U b' 'a U b'
check 0 'a & b' 'a & b'
check 0 'a & b' 'b & a'
check 0 'a & b & c' 'c & a && b'
check 0 'a & b & c' 'b & c & a'
check 0 'a && b & a' 'b & a & b'
check 0 'a & b' 'b & a & b'
check 0 'a & b' 'b & a & a'
check 0 'a & b & (c |(f U g)|| e)' 'b & a & a & (c | e |(f U g)| e | c) & b'
check 0 'a & a' 'a'
# other formulae which are not
check 1 'a' 'b'
check 1 '1' '0'
check 1 'a => b' 'b => a'
check 1 'a => b' 'a <=> b'
check 1 'a => b' 'a U b'
check 1 'a R b' 'a U b'
check 1 'a & b & c' 'c & a'
check 1 'b & c' 'c & a & b'
check 1 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(g U g)| e | c) & b'
# Precedence
check 0 'a & b ^ c | d' 'd | c ^ b & a'
# Success.
: