spot/tests/core/degenscc.test
Alexandre Duret-Lutz 2a38328a5c replace bdd_satoneset(x,y,bddtrue) loops by minterms_of(x,y)
Because the loops iterate in the opposite order, multiple
test cases need to be adjusted.

* spot/taalgos/tgba2ta.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/dualize.cc, spot/twaalgos/ltl2tgba_fm.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/toweak.cc: Replace loops based on
bdd_satonest(x,y,bddtrue) by loops based on minterms_of(x,y).
* tests/core/degenscc.test, tests/core/dualize.test,
tests/core/genltl.test, tests/core/readsave.test,
tests/python/alternation.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/decompose_scc.py,
tests/python/dualize.py, tests/python/sccinfo.py,
tests/python/simstate.py, tests/python/testingaut.ipynb,
tests/python/word.ipynb: Adjust expected test cases.  The
only regression is in genltl.test, but the worsened case
should eventually be fixed as discussed in issue #425 anyway.
2021-04-14 17:31:45 +02:00

65 lines
2.7 KiB
Bash

#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2017, 2019, 2021 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 <http://www.gnu.org/licenses/>.
. ./defs
set -e
# This make sure that the degeneralize fonction does not create
# new SCCs.
#
# The following cases were found with
#
# % randltl -n -1 3 | ltl2tgba | autfilt --acc-sets=3.. |
# autfilt -Bx'!degen-remscc' --stats='%C,%c,%M' |
# awk -F, '{ if ($1 < $2) { print $0; } }'
cat >input <<EOF
GF((Fp2 & X((p0 & Gp1) | (!p0 & F!p1))) | (G!p2 & X((p0 & F!p1) | (!p0 & Gp1))))
((Gp2&FG((Gp1&Xp0)|(F!p1&X!p0)))|(F!p2 & GF((Gp1 & X!p0) | (Xp0 & F!p1)))) W !p0
p2 & GF(G(p0 & !p1) | (F!p0 & Fp1))
G(((Fp1 & (p1 W Fp0)) | (G!p1 & (!p1 M G!p0))) M FG!p2)
Xp0 R F((p0 & FG(Gp2 U p1)) | (!p0 & GF(F!p2 R !p1)))
GF(p0 & (((p1 & Fp2) | (!p1 & G!p2)) M Gp1))
F(G!p0 | GF((Gp0 & (!p2 R !p1)) | ((p2 U p1) & F!p0)))
p1|X(p1 R F((((p2&G!p0)|(!p2&Fp0))&FGp0)|(((p2 & Fp0) | (!p2 & G!p0)) & GF!p0)))
G(!p1 | (!p2 & F!p1) | (GFp2 U p0))
GF((Fp2&(p0 U((p1&GFp0)|(!p1&FG!p0))))|(G!p2&(!p0 R((p1&FG!p0)|(!p1&GFp0)))))
GF((XFp1 & ((p0 & G!p2) | (!p0 & Fp2))) | (XG!p1 & ((p0 & Fp2) | (!p0 & G!p2))))
F(!p2 | GF((Fp0 & ((p0 & Gp1)|(!p0&F!p1)))|(G!p0&((p0&F!p1)|(!p0&Gp1)))))
G(XF((p2 & F!p1) | (!p2 & Gp1)) | (p1 & Fp0))
!p0 | GF((p1 & (Xp2 W Gp2)) | (!p1 & (X!p2 M F!p2)))
G!p0 | G((Fp1 U p2) & F!p2)
EOF
# We want to make sure the degeneralized automaton has fewer SCCs
# (it can be less if the simulation on the BA is lukier than on the TGBA)
ltl2tgba < input | autfilt -B --stats=": '%M'; test %C -ge %c" > test.sh
sh -x -e test.sh
# Make sure that this degen-remscc optimizition is actually doing something.
# The following test could fail in the future if we improve the translation
# of some of these formulas. In that case, regenerate the list of test
# formula using the command displayed above.
ltl2tgba < input |
autfilt -Bx'!degen-remscc' --stats=": '%M'; test %C -lt %c" > test.sh
sh -x -e test.sh
# We also want to make sure those degeneralized automata are correct
ltlcross -F input ltl2tgba 'ltl2tgba -B' 'ltl2tgba %f | autfilt -B > %O'