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

@ -668,3 +668,41 @@ be used to gather statistics about a specific set of formulas.
# LocalWords: nxqfd hS vNItGg acc scc nondetstates nondeterministic
# LocalWords: cvs LaTeX datacols len ith otimes ltlcheck eval setq
# LocalWords: setenv concat getenv
** =--grind=FILENAME=
This argument tells =ltlcross= that, when an error is detected, it
should try to find a smaller formula that still exhibit the
bug. This is the procedure used:
- Internally list the mutations of the bogus formula and sort
them by length (as =ltlgrind --sort= would do)
- Process every mutation until one is found that exhibit the bug
- Repeat the process with this formula, and again until a formula
is found for which no mutation exhibit the bug
- Output that last formula in FILENAME
Every bogus formula found during the process will be saved if
=--save-bogus=FILENAME= is provided.
Example:
#+BEGIN_SRC sh :exports both :results verbatim
ltlcross -f '(G!b & (!c | F!a)) | (c & Ga & Fb)' "modella %L %T" \
--save-bogus=bogus \
--grind=bogus-grind
#+END_SRC
#+RESULTS:
#+BEGIN_SRC sh :exports both :results verbatim
cat bogus
#+END_SRC
#+RESULTS:
: (G!b & (!c | F!a)) | (c & Ga & Fb)
: G!b | (c & Ga & Fb)
: G!b | (c & Fb)
: G!c | (c & Fc)
#+BEGIN_SRC sh :exports both :results verbatim
cat bogus-grind
#+END_SRC
#+RESULTS:
: G!c | (c & Fc)