ltlcross: adding option --grind=FILENAME

Suggested by Joachim Klein.

When a bogus formula is found by ltlcross, the --grind=FILENAME option
tries to find a smaller formula for which the bug is still present, and
outputs it in FILENAME.

* src/bin/ltlcross.cc: Add the --grind option.
* doc/org/ltlcross.org: Document the --grind option.
* src/ltltest/ltlcrossgrind.test: Test it.
* src/ltltest/Makefile.am: Add test.
This commit is contained in:
Thibaud Michaud 2014-09-19 16:34:00 +02:00 committed by Alexandre Duret-Lutz
parent e327f6ea11
commit 4e1586dc54
4 changed files with 140 additions and 0 deletions

View file

@ -99,6 +99,7 @@ TESTS = \
remove_x.test \
ltlrel.test \
ltlgrind.test \
ltlcrossgrind.test \
ltlfilt.test \
latex.test \
lbt.test \

35
src/ltltest/ltlcrossgrind.test Executable file
View file

@ -0,0 +1,35 @@
#! /bin/sh
# Copyright (C) 2013 Laboratoire de Recherche et Developement to
# 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 || exit 1
set -e
cat >fake <<EOF
#!/bin/sh
../../bin/ltl2tgba -s -f "\$1" | sed 's/p0/p1/g'
EOF
chmod +x fake
run 1 ../../bin/ltlcross -f 'p0 U p1' "./fake %f >%N" \
"../../bin/ltl2tgba -s -f %f >%N" --grind=bogus.grind
echo p0 >exp
diff bogus.grind exp