simplify: GF(f)=GF(dnf(f)) FG(f)=FG(cnf(f))

These rules come from Delag's paper, and help some cases
in issue #385.

* spot/tl/simplify.cc: Implement the simplification.
* doc/tl/tl.tex, NEWS: Document it.
* tests/core/385.test: New file.
* tests/Makefile.am: Add it.
* tests/core/reduccmp.test: More tests.
* tests/core/ltl2tgba2.test: Adjust one improved case.
* tests/python/automata.ipynb, tests/python/twagraph-internals.ipynb:
Adjust expected output, as the cnf/dnf reorder some subformulas.
This commit is contained in:
Alexandre Duret-Lutz 2019-06-17 00:19:02 +02:00
parent df326e032b
commit da5d23f0a2
9 changed files with 2517 additions and 2291 deletions

45
tests/core/385.test Executable file
View file

@ -0,0 +1,45 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2019 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
# Formulas from issue #385.
ltl2tgba -G --stats=%s,%f> out <<EOF
GFX((e & XXXa) -> (e & X!d))
G(Gc | Fa | F!G(c | Ge))
Ge | XGF(Ge & X(c & Fd))
G!GXXe -> GF(b & c & Gc)
G!(Gd & (c | Fb))
XF(F(Gc & Xb) -> a)
EOF
# Some of the following are still not optimal.
cat >expected <<EOF
1,GF(!a | !d | !e)
6,G(Gc | F(a | (!c & F!e)))
2,Ge | G(Fd & FGe & Fc)
1,F(G(Fb & FGc) | Ge)
4,G(F!d | (!c & G!b))
3,F(GF!c | G!b) | XFa
EOF
diff out expected