* src/ltlvisit/lunabbrev.cc, src/ltlvisit/lunabbrev.hh: New files.
* src/ltlvisit/Makefile.am (libltlvisit_a_SOURCES): Add them. * src/ltlast/multop.cc (multop::multop(type)): New constructor. * src/ltlast/multop.hh (multop::multop(type)): New constructor. * src/ltltest/lunabbrev.test: New file. * src/ltltest/Makefile.am (TESTS): Add lunabbrev.test. (check_PROGRAMS): Add lunabbrev. (lunabbrev_SOURCES, lunabbrev_CPPFLAGS): New variables. * src/ltltest/equals.cc (main) [LUNABBREV]: Call unabbreviate_logic.
This commit is contained in:
parent
5d714612a3
commit
526012a795
10 changed files with 197 additions and 5 deletions
|
|
@ -8,3 +8,4 @@ parser.dot
|
|||
expect
|
||||
defs
|
||||
equals
|
||||
lunabbrev
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@ LDADD = ../ltlparse/libltlparse.a \
|
|||
../ltlast/libltlast.a
|
||||
|
||||
check_SCRIPTS = defs
|
||||
check_PROGRAMS = ltl2dot ltl2text equals
|
||||
check_PROGRAMS = ltl2dot ltl2text equals lunabbrev
|
||||
ltl2dot_SOURCES = readltl.cc
|
||||
ltl2dot_CPPFLAGS = $(AM_CPPFLAGS) -DDOTTY
|
||||
ltl2text_SOURCES = readltl.cc
|
||||
equals_SOURCES = equals.cc
|
||||
lunabbrev_SOURCES = equals.cc
|
||||
lunabbrev_CPPFLAGS = $(AM_CPPFLAGS) -DLUNABBREV
|
||||
|
||||
EXTRA_DIST = $(TESTS)
|
||||
TESTS = parse.test parseerr.test equals.test
|
||||
TESTS = parse.test parseerr.test equals.test lunabbrev.test
|
||||
|
||||
CLEANFILES = stdout expect parse.dot
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#include <iostream>
|
||||
#include "ltlparse/public.hh"
|
||||
#include "ltlvisit/equals.hh"
|
||||
#include "ltlvisit/lunabbrev.hh"
|
||||
#include "ltlvisit/dump.hh"
|
||||
|
||||
void
|
||||
syntax(char *prog)
|
||||
|
|
@ -28,6 +30,11 @@ main(int argc, char **argv)
|
|||
if (spot::ltl::format_parse_errors(std::cerr, argv[2], p2))
|
||||
return 2;
|
||||
|
||||
#ifdef LUNABBREV
|
||||
f1 = spot::ltl::unabbreviate_logic(f1);
|
||||
spot::ltl::dump(*f1, std::cout);
|
||||
#endif
|
||||
|
||||
if (equals(f1, f2))
|
||||
return 0;
|
||||
return 1;
|
||||
|
|
|
|||
35
src/ltltest/lunabbrev.test
Executable file
35
src/ltltest/lunabbrev.test
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Check for the equals visitor
|
||||
|
||||
. ./defs || exit 1
|
||||
|
||||
check()
|
||||
{
|
||||
./lunabbrev "$1" "$2" || exit 1
|
||||
}
|
||||
|
||||
# A few things that do not change
|
||||
check 'a' 'a'
|
||||
check '1' '1'
|
||||
check '0' '0'
|
||||
check 'G a ' ' G 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 'a & b & a' 'b & a & b'
|
||||
check 'a & b' 'b & a & b'
|
||||
check 'a & b' 'b & a & a'
|
||||
check 'a & b & (c |(f U g)| e)' 'b & a & a & (c | e |(f U g)| e | c) & b'
|
||||
|
||||
# other formulae that do change
|
||||
check 'a ^ b' '(a & !b) | (!a & b)'
|
||||
check 'a ^ Xb' '(!Xb & a) | (!a & Xb) | (Xb & !a)'
|
||||
check 'GF a => F G(b)' '!GFa | F Gb'
|
||||
check '!a <-> Xb' '(Xb & !a) | (!!a & !Xb)'
|
||||
check '(a ^ b) | (b ^ c)' '(c & !b) | (!c & b) | (a & !b) | (!a & b)'
|
||||
|
||||
# Success.
|
||||
:
|
||||
Loading…
Add table
Add a link
Reference in a new issue