kv.test 1.68 KB
Newer Older
1
#!/bin/sh
2 3 4
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
# Développement de l'EPITA.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#
# 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.


. ./defs

set -e

check ()
{
  run 0 ../ltl2tgba -f -KV "$1" > out.dot
31
  test -z "$DOT" || "$DOT" out.dot > /dev/null
32 33 34 35 36 37 38 39
  rm -f out.dot
}

# We don't check the output, but running these might be
# enough to trigger assertions in the code, or raise valgrind concerns.

check 'a R (b R c)'
check '(a U b) U (c U d)'
40
check '((Xp2)U(X(1)))&(p1 R(p2 R p0))'
41 42 43

# Make sure escaped variables print OK.
check '"G1"U"GG" && "FF"'
44 45 46 47 48 49 50 51 52


# Make sure we count 4 atomic propositions in
# G("P_1.p2" <-> (F"P_1.p3" & ("P_0.p3" | (X"P_1.CS" U "P_1.p2")))) U G"P_1.p2"
# even after iterated simulation
# Report from Etienne Renault.

../ltl2tgba -KV -R3 -RIS >out \
'G("P_1.p2" <-> (F"P_1.p3" & ("P_0.p3" | (X"P_1.CS" U "P_1.p2")))) U G"P_1.p2"'
53 54 55 56
x=`sed -n '/APrec/{
  s/.*APrec=\[\([^]]*\)\].*/\1/p
  q
}' out | tr ' ' '\n' | wc -l`
57
test "$x" = 4