ltlcross: support short names

* NEWS: Mention it.
* doc/org/ltlcross.org: Document it.
* src/bin/ltlcross.cc: Implement it.
* src/tgbatest/Makefile.am, src/tgbatest/defs.in,
src/tgbatest/ltlcross4.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2013-11-19 16:34:08 +01:00
parent 1c5536ea9c
commit 7de25a32ef
6 changed files with 211 additions and 13 deletions

View file

@ -114,6 +114,7 @@ TESTS = \
wdba.test \
wdba2.test \
babiak.test \
ltlcross4.test \
ltl2dstar.test \
ltl2dstar2.test \
randtgba.test \

View file

@ -1,6 +1,6 @@
# -*- mode: shell-script; coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
# Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# 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.
@ -64,6 +64,7 @@ LBTT_TRANSLATE="@LBTT_TRANSLATE@"
VALGRIND='@VALGRIND@'
SPIN='@SPIN@'
LTL2BA='@LTL2BA@'
PYTHON='@PYTHON@'
need_lbtt()
{

86
src/tgbatest/ltlcross4.test Executable file
View file

@ -0,0 +1,86 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
# Spot is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Spot is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. ./defs
set -e
test -z "$PYTHON" && exit 77
ltl2tgba=../../bin/ltl2tgba
cat >formulas.txt <<EOF
GFa & GFb
GFa -> GFb
EOF
../../bin/ltlcross -F formulas.txt \
"{ltl2tgba any} $ltl2tgba --lbtt --any %f > %T" \
"{ltl2tgba det} $ltl2tgba --lbtt --deterministic %f > %T" \
"{ltl2tgba sma} $ltl2tgba --lbtt --small %f > %T" \
--csv=output.csv
cat >test.py <<EOF
import sys
try:
import pandas
except ImportError:
sys.exit(77)
x = pandas.read_csv("output.csv")
print(x.filter(('formula', 'tool',
'states', 'transitions')).groupby('tool').describe())
EOF
# will exit 77 if panda is not installed
$PYTHON test.py >out.1
# remove trailing whitespace from pandas' output
sed 's/[ \t]*$//g' <out.1 > py.out
cat >expected <<EOF
states transitions
tool
ltl2tgba any count 4.000000 4.000000
mean 2.250000 10.000000
std 0.957427 5.163978
min 1.000000 4.000000
25% 1.750000 7.000000
50% 2.500000 10.000000
75% 3.000000 13.000000
max 3.000000 16.000000
ltl2tgba det count 4.000000 4.000000
mean 2.250000 9.250000
std 0.957427 4.573474
min 1.000000 4.000000
25% 1.750000 6.250000
50% 2.500000 9.500000
75% 3.000000 12.500000
max 3.000000 14.000000
ltl2tgba sma count 4.000000 4.000000
mean 2.250000 9.250000
std 0.957427 4.573474
min 1.000000 4.000000
25% 1.750000 6.250000
50% 2.500000 9.500000
75% 3.000000 12.500000
max 3.000000 14.000000
EOF
diff py.out expected