ltlfilt: implement --reject-word and --accept-word

* bin/common_range.hh: Store the common definition of words.
* bin/autfilt.cc: Use it.
* bin/ltlfilt.cc: Likewise, and implement those two options.
* tests/core/acc_word.test: Test them.
* doc/org/autfilt.org: Augment the last example to point out
that it can now be done with ltlfilt.
* NEWS: Mention the new options.
This commit is contained in:
Alexandre Duret-Lutz 2016-04-09 10:10:41 +02:00
parent 901f287032
commit 59e1f6a339
6 changed files with 124 additions and 31 deletions

View file

@ -756,3 +756,25 @@ Fa U !b
Fb R F!b
XF!b U (!b & (!a | G!b))
#+end_example
Note that the above example could be simplified using the
=--accept-word= and =--reject-word= options of =ltlfilt= directly.
However this demonstrates that using =--stats=%M=, it is possible to
filter formulas based on some properties of automata that have been
generated by from them. The translator needs not be =ltl2tgba=: other
tools can be wrapped with [[file:ltldo.org][=ltldo --name=%f=]] to ensure they work well
in a pipeline and preserve the formula name in the HOA output. For
example Here is a list of 5 LTL formulas that =ltl2dstar= converts to
Rabin automata that have exactly 4 states:
#+BEGIN_SRC sh :results verbatim :exports both
randltl -n -1 a b | ltlfilt --simplify --remove-wm |
ltldo ltl2dstar --name=%f | autfilt --states=4 --stats=%M -n 5
#+END_SRC
#+RESULTS:
: Gb | G!b
: b R (a | b)
: (a & !b & (b | (F!a U (!b & F!a)))) | (!a & (b | (!b & (Ga R (b | Ga)))))
: (a & (a U !b)) | (!a & (!a R b))
: a | G((a & GFa) | (!a & FG!a))