(subformula): Recognize `ATOMIC_PROP OP_POST_POS' and `ATOMIC_PROP OP_POST_NEG'. * src/ltlparse/ltlscan.ll: Introduce the not_prop start condition, to restrict the set of atomic propositions allowed in places where they are not expected. Make `true' and `false' case insensitive. * src/ltltest/parse.test, src/ltltest/tostring.test: More cases. * src/ltlvisit/tostring.cc (to_string_visitor): Quote atomic propositions equal to "true" or "false".
96 lines
2.2 KiB
Bash
Executable file
96 lines
2.2 KiB
Bash
Executable file
#! /bin/sh
|
|
# Copyright (C) 2003, 2004 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.
|
|
#
|
|
# 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 2 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 Spot; see the file COPYING. If not, write to the Free
|
|
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
# 02111-1307, USA.
|
|
|
|
|
|
# Check that spot::ltl::parse succeed on valid input, and that
|
|
# dump and dotty will work with the resulting trees. Note that
|
|
# this doesn't check that the tree is correct w.r.t. the formula.
|
|
|
|
. ./defs || exit 1
|
|
|
|
for f in \
|
|
'0' \
|
|
'1' \
|
|
'true' \
|
|
'false' \
|
|
'a' \
|
|
'p11011' \
|
|
'(p11011)' \
|
|
'a & b' \
|
|
'a * _b12' \
|
|
'a . b' \
|
|
'a + b' \
|
|
'a3214 | b' \
|
|
'a & b' \
|
|
'a && b' \
|
|
'a /\ b' \
|
|
'a || b' \
|
|
'a \/ b' \
|
|
'a | b' \
|
|
'_a_ U b' \
|
|
'a R b' \
|
|
'a <=> b' \
|
|
'a <-> b' \
|
|
'a ^ b' \
|
|
'a xor b' \
|
|
'a => b' \
|
|
'a -> b' \
|
|
'F b' \
|
|
'Gb' \
|
|
'G(b)' \
|
|
'!G(!b)' \
|
|
'!b' \
|
|
'[]b' \
|
|
'<>b' \
|
|
'X b' \
|
|
'()b' \
|
|
'long_atomic_proposition_1 U long_atomic_proposition_2' \
|
|
' ab & ac | ad ^ af' \
|
|
'((b * a) + a) & d' \
|
|
'(ab & ac | ad ) <=> af ' \
|
|
'a U b U c U d U e U f U g U h U i U j U k U l U m' \
|
|
'(ab * !Xad + ad U ab) & FG p12 /\ GF p13' \
|
|
'((([]<>()p12)) )' \
|
|
'a R ome V anille' \
|
|
'p=0Uq=1' \
|
|
'((p=1Rq=1)+p=0)UXq=0' \
|
|
'((X(p2=0))U(X(p2=0)))+((Xp1=0)UFALSE)'
|
|
|
|
do
|
|
if ./ltl2text "$f"; then
|
|
:
|
|
else
|
|
echo "ltl2dot failed to parse '$f'"
|
|
exit 1
|
|
fi
|
|
|
|
if test -n "$DOT"; then
|
|
run 0 ./ltl2dot "$f" > parse.dot
|
|
if $DOT -o /dev/null parse.dot; then
|
|
rm -f parse.dot
|
|
else
|
|
rm -f parse.dot
|
|
echo "dot failed to parse ltl2dot output for '$f'"
|
|
exit 1
|
|
fi
|
|
fi
|
|
done
|