#! /bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2013, 2014, 2015 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 .
# Check several options of ltlfilt
. ./defs || exit 1
set -e
ltlfilt=../../bin/ltlfilt
checkopt()
{
cat >exp
run 0 $ltlfilt "$@" formulas > out
diff exp out
}
# The empty lines in the file are meant, we want to make sure that
# they are ignored.
cat >formulas <in <exp <out
diff exp out
cat >exp <(p0 || p2) && <>[](p0 || p2)
#define p0 (b)
#define p1 (a || c)
p0 && []<>p1 && <>[]p1
#define p0 (h || i)
#define p1 (d && e)
#define p2 (!c)
#define p3 (f)
p0 || []p1 || <>[](p2 || Xp3)
EOF
run 0 $ltlfilt -s -u --nnf --relabel-bool=pnn --define in >out
diff exp out
cat >exp <out
diff exp out
run 0 $ltlfilt -0 in > out
perl -i -pe 's/\0/@\n/g' out
cat >exp < stderr && exit 1
test $? = 2
grep 'non-LTL' stderr
SPOT_STUTTER_CHECK=555 \
$ltlfilt --stutter-invariant -f '!{a:b*:c}' 2> stderr && exit 1
test $? = 2
grep 'invalid' stderr
SPOT_STUTTER_CHECK=5 \
$ltlfilt --stutter-invariant -f '!{a:b*:c}'
# This one was incorrectly diagnosed as stutter invariant because of a
# bug in the bitvectors.
$ltlfilt --stutter-invariant -f 'F(a & XXXXXX!a)' && exit 1
$ltlfilt -c -o 'foo' -f a 2>stderr && exit 1
grep 'ltlfilt: options --output and --count are incompatible' stderr
true