#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2020 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
# 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 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 .
. ./defs
# If the size of automata produced by ltl2tgba on the formulas we
# commonly use as benchmark change, we want to notice it.
set -e
genltl --dac --eh --sb --hkrss --p --format=%F,%L,%f >pos
(cat pos; ltlfilt --negate pos/3 --format='!%<,%f') |
ltlfilt -u -F-/3 >formulas
ltl2tgba -Fformulas/3 --stats='%<,%f, %s,%t' |
ltl2tgba -D -F-/3 --stats='%<,%f,%>, %s,%t' |
ltl2tgba -B -F-/3 --stats='%<,%f,%>, %s,%t' |
ltl2tgba -BD -F-/3 --stats='%<,%>, %s,%t' > output
cat >expected <formulas <. Issue #380.
ltlfilt -Fformulas/1 --stats='%f,%f,%>' |
ltl2tgba -F-/2 --stats='%<,%<, %s,%t' |
ltl2tgba -D -F-/2 --stats='%<,%<,%>, %s,%t' |
perl -p -e 's/$/\r/' |
ltl2tgba -B -F-/2 --stats='%<,%<,%>, %s,%t' |
ltl2tgba -BD -F-/2 --stats='%<,%<,%>, %s,%t' |
ltl2tgba -GD -F-/2 --stats='%<,%>, %s,%t' > output
diff formulas output
# Issue #367.
test 4 = `ltl2tgba 'GF(a<->XXa)' --stats=%s`
test 9 = `ltl2tgba --low 'GF(a<->XXa)' --stats=%s`
test 9 = `ltl2tgba -x gf-guarantee=0 'GF(a<->XXa)' --stats=%s`
test 4 = `ltl2tgba --low -x gf-guarantee=1 'GF(a<->XXa)' --stats=%s`
# Regression test for issue #357. The second formula used to
# incorrectly produce 13 edges when translated after the first one
# because the transition were explored in a different order.
ltl2tgba -D 'a | Fb' 'GF(d & (!c | XXc))' --stats=%s,%e,%d >out
cat >expected <in <out
cat >expected < c) W d))' | grep '\[f\]' && exit 1
# Reported by Jens Kreber
ltl2tgba '!b & e U (a & b & c)' | grep '\[f\]' && exit 1
ltl2tgba '!b & e U (a & b & c)' --stats=%w | grep 0 && exit 1
ltl2tgba 'X!c & X(b & c & d & a U e)' | grep '\[f\]' && exit 1
ltl2tgba 'X!c & X(b & c & d & a U e)' --stats=%w | grep 0 && exit 1
# This caused issue at some point, because simplify_acceptance would
# leave some undeclared acceptance set in the automaton, which would
# cause simulation-based reduction to produce garbage output, which
# would in turn cause the HOA printer to choke.
ltlcross -f 'G(F(Gb ^ Fa) & FG!a)' 'ltl2tgba -G -D'
: