#! /bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# 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 || exit 1
set -e
checkopt_noparse()
{
cat >exp
run 0 ltlgrind --sort "$@" > out
diff exp out
}
checkopt()
{
checkopt_noparse "$@"
# The result must be parsable
ltlfilt out
}
checkopt -f 'Xp1 U (p4 | (p3 xor (p4 W p0)))' <-> G(d <-> e) xor f' --split-ops \
<-> (f xor G(d -> e))
{{a | b}[*4] & {{a | b}[*];c}}<>-> (f xor G(e -> d))
{{a | b}[*4] & {{a | b}[*];c}}<>-> (f xor G(d & e))
{{a | b}[*4] & {{a | b}[*];c}}<>-> (f & !G(d <-> e))
{{a | b}[*4] & {{a | b}[*];c}}<>-> (!f & G(d <-> e))
{{a | b}[*4] & {{a | b}[*];c}}<>-> (f xor G(!d & !e))
{{{a | b}[*];c} && {{a | b}[*4];[*]}}<>-> (f xor G(d <-> e))
{{a | b}[*4] && {{a | b}[*];c;[*]}}<>-> (f xor G(d <-> e))
EOF
checkopt -f '!(!XXp1 M X(p4 U p2))' --rewrite-ops < 0' --simplify-bounds < 0
{p2[*3..5] | p3[*6..] | p1[*]}[]-> 0
{p1[*0..2] | p3[*6..] | p2[*2..5]}[]-> 0
{p1[*0..2] | p3[*6..] | p2[*0..5]}[]-> 0
{p1[*0..2] | p3[*6..] | p2[*3..4]}[]-> 0
{p1[*0..2] | p3[*6..] | p2[*3..]}[]-> 0
{p1[*0..2] | p2[*3..5] | p3[*5..]}[]-> 0
{p1[*0..2] | p2[*3..5] | p3[*]}[]-> 0
EOF
checkopt -f '!F(!X(Xp1 R p2) -> p4)' --remove-one-ap < p4)
!F(!X(Xp4 R p2) -> p4)
!F(!X(Xp1 R p1) -> p4)
!F(!X(Xp1 R p4) -> p4)
!F(!X(Xp1 R p2) -> p1)
!F(!X(Xp1 R p2) -> p2)
EOF
checkopt -f '!p4 & (p2 | {{!p1}[*]})' --ap-to-const < p4)' -m 2 < p4
p4 -> p3
p3 & p4
1 U p3
1 U p4
1 U !p3
1 U !p4
!p3 & !p4
1 U (p3 & !p4)
1 U (!p3 & p4)
EOF
checkopt -f 'F({{p2;p0}[:*]}[]-> Xp0)' < Xp0
F({p2;p0}[]-> Xp0)
F({{p2;p0}[:*]}[]-> p0)
F({p0[*2][:*]}[]-> Xp0)
F({p2[*2][:*]}[]-> Xp2)
F({{1;p0}[:*]}[]-> Xp0)
F({{p2;1}[:*]}[]-> Xp0)
F({{p2;p0}[:*]}[]-> X(0))
EOF
echo '1,a,3' > input
checkopt_noparse input/2 <,%F,%L' <err && exit 1
grep 'too large' err
# The following message appears only if run from a tty.
if (: > /dev/tty) >/dev/null 2>&1 ; then
ltlgrind err && exit 1
grep 'No formula to mutate' err
fi
: