Adding ltlgrind as a command-line tool
* src/bin/ltlgrind.cc: New file, command-line tool to get mutations of a formula. * src/bin/Makefile.am: Add it. * src/ltlvisit/mutation.hh, src/ltlvisit/mutation.cc: New files providing the get_mutations function. * src/ltlvisit/Makefile.am: Add it. * src/ltltest/ltlgrind.test: Test it. * src/ltltest/Makefile.am: Add it. * src/bin/man/ltlgrind.x: Document it. * src/bin/man/Makefile.am: Add it. * doc/org/ltlgrind.org: Document it. * doc/org/tools.org: Add link to ltlgrind documentation page.
This commit is contained in:
parent
51fe5108fe
commit
e327f6ea11
11 changed files with 923 additions and 1 deletions
82
doc/org/ltlgrind.org
Normal file
82
doc/org/ltlgrind.org
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
#+TITLE: =ltlgrind=
|
||||
#+EMAIL spot@lrde.epita.fr
|
||||
#+OPTIONS: H:2 num:nil toc:t
|
||||
#+LINK_UP: tools.html
|
||||
|
||||
This tool lists formulas that are similar to but simpler than a given
|
||||
formula by applying simple mutations to it, like removing operands or
|
||||
operators. This is meant to be used with ltlcross to simplify a
|
||||
formula that caused a problem before trying to debug it (see also
|
||||
=ltlcross --grind=FILENAME=).
|
||||
|
||||
Here is a list of the different kind of mutations that can be applied:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports results
|
||||
ltlgrind --help | sed -n '/Transformation rules:/,/^$/p' | sed '1d;$d'
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_example
|
||||
--ap-to-const atomic propositions are replaced with true/false
|
||||
--remove-multop-operands remove one operand from multops
|
||||
--remove-one-ap all occurrences of an atomic proposition are
|
||||
replaced with another atomic proposition used in
|
||||
the formula
|
||||
--remove-ops replace unary/binary operators with one of their
|
||||
operands
|
||||
--rewrite-ops rewrite operators that have a semantically simpler
|
||||
form: a U b becomes a W b, etc.
|
||||
--simplify-bounds on a bounded unary operator, decrement one of the
|
||||
bounds, or set min to 0 or max to unbounded.
|
||||
--split-ops when an operator can be expressed as a
|
||||
conjunction/disjunction using simpler operators,
|
||||
each term of the conjunction/disjunction is a
|
||||
mutation. e.g. a <-> b can be written as ((a & b)
|
||||
| (!a & !b)) or as ((a -> b) & (b -> a)) so those
|
||||
four terms can be a mutation of a <-> b
|
||||
#+end_example
|
||||
|
||||
By default, all rules are applied. But if one or more rules are
|
||||
specified, only those will be applied.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
ltlgrind -f 'a U G(b <-> c)' --split-ops --rewrite-ops --remove-ops
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_example
|
||||
a
|
||||
G(b <-> c)
|
||||
a W G(b <-> c)
|
||||
a U (b <-> c)
|
||||
a U Gb
|
||||
a U Gc
|
||||
a U G(b -> c)
|
||||
a U G(c -> b)
|
||||
a U G(b & c)
|
||||
a U G(!b & !c)
|
||||
#+end_example
|
||||
|
||||
The idea behind this tool is that when a bogus algorithm is found with
|
||||
=ltlcross=, you probably want to debug it using a smaller formula than
|
||||
the one found by =ltlcross=. So you would give the formula found by
|
||||
=ltlcross= as an argument to =ltlgrind= and then use the resulting
|
||||
mutations as an new input for =ltlcross=. It might report an error on
|
||||
one of the mutation, which is guaranteed to be simpler than the
|
||||
initial formula. The process can then be repeated until no error is
|
||||
reported by =ltlcross=.
|
||||
|
||||
Since the whole process can become quite tedious, it can be done
|
||||
automatically by calling =ltlcross= with the =--grind=FILENAME=
|
||||
argument.
|
||||
|
||||
* Miscellaneous options
|
||||
** =--sort=
|
||||
Formulas are outputted from the shortest to the longest one. The
|
||||
length of a formula is the number of atomic propositions, constants
|
||||
and operators occuring in the formula.
|
||||
** =-m N=, =--mutations=N=
|
||||
This option is used to specify the number of mutations to be
|
||||
applied to the formula. This is like calling ltlgrind on its own
|
||||
output several times, except for the fact that, when called on
|
||||
several formulas, ltlgrind doesn't handle duplicates.
|
||||
|
|
@ -43,6 +43,8 @@ corresponding commands are hidden.
|
|||
- [[file:ltlcross.org][=ltlcross=]] Cross-compare LTL/PSL-to-Büchi translators.
|
||||
- [[file:dstar2tgba.org][=dstar2tgba=]] Convert deterministic Rabin or Streett automata into
|
||||
Büchi automata.
|
||||
- [[file:ltlgrind.org][=ltlgrind=]] List formulas similar to but simpler than a given LTL/PSL
|
||||
formula
|
||||
|
||||
* Advanced uses
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue