* src/ltlvisit/contain.hh, src/ltlvisit/contain.cc (reduce_tau03):

New function, performing LTL reduction a la tauriainen.03.a83.
* src/ltltest/equals.cc, src/ltltest/reduc.cc: Add support for
the new reduction.
* src/ltltest/reduc.test: Cut the test in half, and additionally
test the new reduction.
* src/ltltest/reduccmp.test: Run on the new reduction.
* src/ltltest/Makefile.am: Adjust.
* src/tgbatest/ltl2tgba.cc: Add new options to apply the reduction.
* src/tgbatest/spotlbtt.test: Use them.
This commit is contained in:
Alexandre Duret-Lutz 2006-07-19 16:30:10 +00:00
parent 8cbec95253
commit d4c9bf2b1e
10 changed files with 444 additions and 76 deletions

View file

@ -1,6 +1,6 @@
## Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre
## et Marie Curie.
## Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie.
##
## This file is part of Spot, a model checking library.
##
@ -19,7 +19,7 @@
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
AM_CPPFLAGS = -I$(srcdir)/..
AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS)
AM_CXXFLAGS = $(WARNING_CXXFLAGS)
LDADD = ../libspot.la
@ -33,6 +33,8 @@ check_PROGRAMS = \
nenoform \
reduc \
reduccmp \
reductau \
reductaustr \
syntimpl \
tostring \
tunabbrev \
@ -53,6 +55,10 @@ randltl_SOURCES = randltl.cc
reduc_SOURCES = reduc.cc
reduccmp_SOURCES = equals.cc
reduccmp_CPPFLAGS = $(AM_CPPFLAGS) -DREDUC
reductau_SOURCES = equals.cc
reductau_CPPFLAGS = $(AM_CPPFLAGS) -DREDUC_TAU
reductaustr_SOURCES = equals.cc
reductaustr_CPPFLAGS = $(AM_CPPFLAGS) -DREDUC_TAUSTR
syntimpl_SOURCES = syntimpl.cc
tostring_SOURCES = tostring.cc
tunabbrev_SOURCES = equals.cc

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
@ -27,6 +27,7 @@
#include "ltlvisit/dump.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/contain.hh"
#include "ltlast/allnodes.hh"
#include "ltlvisit/reduce.hh"
#include "ltlvisit/tostring.hh"
@ -96,6 +97,20 @@ main(int argc, char** argv)
spot::ltl::destroy(tmp);
spot::ltl::dump(std::cout, f1);
#endif
#ifdef REDUC_TAU
spot::ltl::formula* tmp;
tmp = f1;
f1 = spot::ltl::reduce_tau03(f1, false);
spot::ltl::destroy(tmp);
spot::ltl::dump(std::cout, f1);
#endif
#ifdef REDUC_TAUSTR
spot::ltl::formula* tmp;
tmp = f1;
f1 = spot::ltl::reduce_tau03(f1, true);
spot::ltl::destroy(tmp);
spot::ltl::dump(std::cout, f1);
#endif
int exit_code = f1 != f2;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
@ -30,6 +30,7 @@
#include "ltlvisit/tostring.hh"
#include "ltlvisit/reduce.hh"
#include "ltlvisit/length.hh"
#include "ltlvisit/contain.hh"
#include "ltlast/allnodes.hh"
void
@ -42,6 +43,9 @@ syntax(char* prog)
int
main(int argc, char** argv)
{
bool tau03 = false;
bool stronger = false;
if (argc < 3)
syntax(argv[0]);
@ -57,6 +61,9 @@ main(int argc, char** argv)
case 2:
o = spot::ltl::Reduce_Eventuality_And_Universality;
break;
case 9:
tau03 = stronger = true;
/* fall through */
case 3:
o = spot::ltl::Reduce_All;
break;
@ -71,6 +78,12 @@ main(int argc, char** argv)
o = (spot::ltl::Reduce_Syntactic_Implications
| spot::ltl::Reduce_Eventuality_And_Universality);
break;
case 8:
stronger = true;
/* fall through */
case 7:
tau03 = true;
break;
default:
return 2;
}
@ -114,6 +127,13 @@ main(int argc, char** argv)
spot::ltl::destroy(ftmp1);
spot::ltl::destroy(ftmp2);
if (tau03)
{
ftmp1 = f1;
f1 = spot::ltl::reduce_tau03(f1, stronger);
spot::ltl::destroy(ftmp1);
}
int length_f1_after = spot::ltl::length(f1);
std::string f1s_after = spot::ltl::to_string(f1);

View file

@ -1,5 +1,5 @@
#! /bin/sh
# Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
# Copyright (C) 2004, 2005, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systčmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
#
@ -28,12 +28,13 @@ set -e
FILE=formulae
: > $FILE
for i in 10 11 12 13 14 15 16 17 18 19 20; do
# for i in 10 11 12 13 14 15 16 17 18 19 20; do
for i in 10 12 14 16 18 20; do
run 0 ./randltl -u -s 0 -f $i a b c -F 100 >> $FILE
run 0 ./randltl -u -s 100 -f $i a b c d e f -F 100 >> $FILE
done
for opt in 0 1 2 3; do
for opt in 0 1 2 3 7 8 9; do
rm -f result.data
cat $FILE |

View file

@ -1,5 +1,5 @@
#! /bin/sh
# Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
#
@ -21,81 +21,87 @@
# 02111-1307, USA.
# Check for the equals visitor
# Check LTL reductions
. ./defs || exit 1
# No reduction
run 0 ./reduccmp 'a U b' 'a U b'
run 0 ./reduccmp 'a R b' 'a R b'
run 0 ./reduccmp 'a & b' 'a & b'
run 0 ./reduccmp 'a | b' 'a | b'
run 0 ./reduccmp 'a & (a U b)' 'a & (a U b)'
run 0 ./reduccmp 'a | (a U b)' 'a | (a U b)'
for x in ./reduccmp ./reductaustr; do
# Syntactic reduction
run 0 ./reduccmp 'a & (!b R !a)' 'false'
run 0 ./reduccmp '(!b R !a) & a' 'false'
#run 0 ./reduccmp '(!b R !a) | a' 'true'
#run 0 ./reduccmp 'a | (!b R !a)' 'true'
# No reduction
run 0 $x 'a U b' 'a U b'
run 0 $x 'a R b' 'a R b'
run 0 $x 'a & b' 'a & b'
run 0 $x 'a | b' 'a | b'
run 0 $x 'a & (a U b)' 'a & (a U b)'
run 0 $x 'a | (a U b)' 'a | (a U b)'
run 0 ./reduccmp 'a & (!b R !a) & c' 'false'
run 0 ./reduccmp 'c & (!b R !a) & a' 'false'
#run 0 ./reduccmp 'a | (!b R !a) | c' 'true'
#run 0 ./reduccmp 'c | (!b R !a) | a' 'true'
# Syntactic reduction
run 0 $x 'a & (!b R !a)' 'false'
run 0 $x '(!b R !a) & a' 'false'
run 0 ./reduccmp 'a & (b U a)' 'a'
run 0 ./reduccmp '(b U a) & a' 'a'
run 0 ./reduccmp 'a | (b U a)' '(b U a)'
run 0 ./reduccmp '(b U a) | a' '(b U a)'
run 0 ./reduccmp 'a U (b U a)' '(b U a)'
run 0 $x 'a & (!b R !a) & c' 'false'
run 0 $x 'c & (!b R !a) & a' 'false'
run 0 ./reduccmp 'a & (b U a) & a' 'a'
run 0 ./reduccmp 'a & (b U a) & a' 'a'
run 0 ./reduccmp 'a | (b U a) | a' '(b U a)'
run 0 ./reduccmp 'a | (b U a) | a' '(b U a)'
run 0 ./reduccmp 'a U (b U a)' '(b U a)'
run 0 $x 'a & (b U a)' 'a'
run 0 $x '(b U a) & a' 'a'
run 0 $x 'a | (b U a)' '(b U a)'
run 0 $x '(b U a) | a' '(b U a)'
run 0 $x 'a U (b U a)' '(b U a)'
run 0 $x 'a & (b U a) & a' 'a'
run 0 $x 'a & (b U a) & a' 'a'
run 0 $x 'a | (b U a) | a' '(b U a)'
run 0 $x 'a | (b U a) | a' '(b U a)'
run 0 $x 'a U (b U a)' '(b U a)'
# Basics reduction
run 0 ./reduccmp 'X(true)' 'true'
run 0 ./reduccmp 'X(false)' 'false'
run 0 ./reduccmp 'F(true)' 'true'
run 0 ./reduccmp 'F(false)' 'false'
run 0 ./reduccmp 'G(true)' 'true'
run 0 ./reduccmp 'G(false)' 'false'
# Basics reduction
run 0 $x 'X(true)' 'true'
run 0 $x 'X(false)' 'false'
run 0 $x 'F(true)' 'true'
run 0 $x 'F(false)' 'false'
run 0 $x 'G(true)' 'true'
run 0 $x 'G(false)' 'false'
run 0 ./reduccmp 'XGF(f)' 'GF(f)'
run 0 ./reduccmp 'FX(a)' 'XF(a)'
run 0 ./reduccmp 'G(a R b)' 'G(b)'
run 0 ./reduccmp 'GX(a)' 'XG(a)'
run 0 $x 'XGF(f)' 'GF(f)'
case $x in
*tau*);;
*)
run 0 $x 'G(a R b)' 'G(b)'
run 0 ./reduccmp 'X(a) U X(b)' 'X(a U b)'
run 0 ./reduccmp 'X(a) R X(b)' 'X(a R b)'
run 0 $x 'FX(a)' 'XF(a)'
run 0 $x 'GX(a)' 'XG(a)'
run 0 ./reduccmp 'Xa & Xb' 'X(a & b)'
run 0 ./reduccmp '(a U b) & (c U b)' '(a & c) U b'
run 0 ./reduccmp '(a R b) & (a R c)' 'a R (b & c)'
run 0 ./reduccmp 'Xa | Xb' 'X(a | b)'
run 0 ./reduccmp '(a U b) | (a U c)' 'a U (b | c)'
run 0 ./reduccmp '(a R b) | (c R b)' '(a | c) R b'
run 0 $x 'X(a) U X(b)' 'X(a U b)'
run 0 $x 'X(a) R X(b)' 'X(a R b)'
run 0 $x 'Xa & Xb' 'X(a & b)'
run 0 $x 'Xa | Xb' 'X(a | b)'
run 0 ./reduccmp 'X(a & GFb)' 'Xa & GFb'
run 0 ./reduccmp 'X(a | GFb)' 'Xa | GFb'
run 0 ./reduccmp 'F(a & GFb)' 'Fa & GFb'
run 0 ./reduccmp 'G(a | GFb)' 'Ga | GFb'
run 0 $x '(a U b) & (c U b)' '(a & c) U b'
run 0 $x '(a R b) & (a R c)' 'a R (b & c)'
run 0 $x '(a U b) | (a U c)' 'a U (b | c)'
run 0 $x '(a R b) | (c R b)' '(a | c) R b'
run 0 ./reduccmp 'X(a & GFb & c)' 'X(a & c) & GFb'
run 0 ./reduccmp 'X(a | GFb | c)' 'X(a | c) | GFb'
run 0 ./reduccmp 'F(a & GFb & c)' 'F(a & c) & GFb'
run 0 ./reduccmp 'G(a | GFb | c)' 'G(a | c) | GFb'
run 0 $x 'X(a & GFb)' 'Xa & GFb'
run 0 $x 'X(a | GFb)' 'Xa | GFb'
run 0 $x 'F(a & GFb)' 'Fa & GFb'
run 0 $x 'G(a | GFb)' 'Ga | GFb'
# Eventuality and universality class reduction
run 0 ./reduccmp 'FFa' 'Fa'
run 0 ./reduccmp 'FGFa' 'GFa'
run 0 ./reduccmp 'b U Fa' 'Fa'
run 0 ./reduccmp 'b U GFa' 'GFa'
run 0 ./reduccmp 'Ga' 'Ga'
run 0 ./reduccmp 'GFGa' 'FGa'
run 0 ./reduccmp 'b R Ga' 'Ga'
run 0 ./reduccmp 'b R FGa' 'FGa'
run 0 $x 'X(a & GFb & c)' 'X(a & c) & GFb'
run 0 $x 'X(a | GFb | c)' 'X(a | c) | GFb'
run 0 $x 'F(a & GFb & c)' 'F(a & c) & GFb'
run 0 $x 'G(a | GFb | c)' 'G(a | c) | GFb'
;;
esac
# Eventuality and universality class reduction
run 0 $x 'FFa' 'Fa'
run 0 $x 'FGFa' 'GFa'
run 0 $x 'b U Fa' 'Fa'
run 0 $x 'b U GFa' 'GFa'
run 0 $x 'Ga' 'Ga'
run 0 $x 'GFGa' 'FGa'
run 0 $x 'b R Ga' 'Ga'
run 0 $x 'b R FGa' 'FGa'
done