postproc: add a SBAcc option

Producing state-based acceptance is now part of the postprocessing
routines.  That means we can more easily simplify automata with
state-based acceptance (using autfilt -S --small --high, for instance)
and as as side-effect, ltl2tgba can produce GBA.  However the result of
ltl2tgba -S is often larger than that of ltl2tgba -B.

* src/twaalgos/postproc.cc, src/twaalgos/postproc.hh: Implement
the SBAcc option.
* src/bin/common_post.cc, src/bin/common_post.hh: Implement -S.
* src/bin/autfilt.cc, src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc,
src/bin/ltl2tgta.cc, src/bin/ltldo.cc: Adjust.
* src/tests/sim3.test: Augment test case.
* NEWS, doc/org/ltl2tgba.org, doc/org/autfilt.org: Document it -S.
This commit is contained in:
Alexandre Duret-Lutz 2015-05-14 20:04:50 +02:00
parent dd87bdf868
commit 0786e068ae
13 changed files with 181 additions and 42 deletions

View file

@ -143,7 +143,6 @@ refer to the output automaton. Of course this distinction makes sense
only if =autfilt= was instructed to perform an operation on the input
automaton.
* Filtering automata
=autfilt= supports multiple ways to filter automata based on different
@ -192,10 +191,10 @@ autfilt --help | sed -n '/Output automaton type:/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
: -B, --ba Büchi Automaton
: --generic Any acceptance is allowed (default)
: -M, --monitor Monitor (accepts all finite prefixes of the given
: property)
: --tgba Transition-based Generalized Büchi Automaton
: (default)
These options specifies desired properties:
@ -203,11 +202,14 @@ These options specifies desired properties:
autfilt --help | sed -n '/Translation intent:/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
: -a, --any no preference (default)
: -a, --any no preference, do not bother making it small or
: deterministic (default)
: -C, --complete output a complete automaton (combine with other
: intents)
: -D, --deterministic prefer deterministic automata
: --small prefer small automata
: -S, --state-based-acceptance, --sbacc
: define the acceptance using states
Finally, the following switches control the amount of effort applied
to reach the desired properties:
@ -252,7 +254,8 @@ autfilt --help | sed -n '/Transformations:/,/^$/p' | sed '1d;$d'
exclusive propositions.
--instut[=1|2] allow more stuttering (two possible algorithms)
--keep-states=NUM[,NUM...] only keep specified states. The first state
will be the new initial state
will be the new initial state. Implies
--remove-unreachable-states.
--mask-acc=NUM[,NUM...] remove all transitions in specified acceptance
sets
--merge-transitions merge transitions with same destination and
@ -263,10 +266,20 @@ autfilt --help | sed -n '/Transformations:/,/^$/p' | sed '1d;$d'
--remove-ap=AP[=0|=1][,AP...]
remove atomic propositions either by existential
quantification, or by assigning them 0 or 1
--remove-fin rewrite the automaton without using Fin
acceptance
--state-based-acceptance, --sbacc
define the acceptance using states
--remove-dead-states remove states that are unreachable, or that cannot
belong to an infinite path
--remove-fin rewrite the automaton without using Fin acceptance
--remove-unreachable-states
remove states that are unreachable from the
initial state
--separate-sets if both Inf(x) and Fin(x) appear in the acceptance
condition, replace Fin(x) by a new Fin(y) and
adjust the automaton
--simplify-exclusive-ap if --exclusive-ap is used, assume those AP
groups are actually exclusive in the system to
simplify the expression of transition labels
(implies --merge-transitions)
--strip-acceptance remove the acceptance condition and all acceptance
sets
#+end_example
@ -345,11 +358,11 @@ $txt
#+RESULTS:
[[file:autfilt-ex1.png]]
Using =--sbacc= will "push" the acceptance membership of the transitions to the states:
Using =-S= will "push" the acceptance membership of the transitions to the states:
#+NAME: autfilt-ex2
#+BEGIN_SRC sh :results verbatim :export code
autfilt --sbacc aut-ex1.hoa --dot=.a
autfilt -S aut-ex1.hoa --dot=.a
#+END_SRC
#+RESULTS: autfilt-ex2
@ -358,6 +371,7 @@ digraph G {
rankdir=LR
label=<(Fin(<font color="#F17CB0">❶</font>) &amp; Fin(<font color="#B276B2">❸</font>) &amp; Inf(<font color="#5DA5DA">⓿</font>)) | (Inf(<font color="#FAA43A">❷</font>)&amp;Inf(<font color="#B276B2">❸</font>)) | Inf(<font color="#F17CB0">❶</font>)>
labelloc="t"
node [shape="circle"]
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]

View file

@ -214,6 +214,61 @@ $txt
#+RESULTS:
[[file:dotex2ba-t.png]]
Using option =-S= instead of option =-B= you can obtain generalized
Büchi automata with state-based acceptance. Here is the same formula
as above, for comparison.
#+NAME: dotex2gba
#+BEGIN_SRC sh :results verbatim :exports code
ltl2tgba -S 'GFa & GFb'
#+END_SRC
#+RESULTS: dotex2gba
#+begin_example
digraph G {
rankdir=LR
node [shape="circle"]
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
node[style=filled, fillcolor="#ffffa0"] edge[arrowhead=vee, arrowsize=.7]
I [label="", style=invis, width=0]
I -> 0
0 [label=<0<br/><font color="#5DA5DA">⓿</font><font color="#F17CB0">❶</font>>]
0 -> 0 [label=<a &amp; b>]
0 -> 1 [label=<!a &amp; !b>]
0 -> 2 [label=<!a &amp; b>]
0 -> 3 [label=<a &amp; !b>]
1 [label=<1>]
1 -> 0 [label=<a &amp; b>]
1 -> 1 [label=<!a &amp; !b>]
1 -> 2 [label=<!a &amp; b>]
1 -> 3 [label=<a &amp; !b>]
2 [label=<2<br/><font color="#F17CB0">❶</font>>]
2 -> 0 [label=<a &amp; b>]
2 -> 1 [label=<!a &amp; !b>]
2 -> 2 [label=<!a &amp; b>]
2 -> 3 [label=<a &amp; !b>]
3 [label=<3<br/><font color="#5DA5DA">⓿</font>>]
3 -> 0 [label=<a &amp; b>]
3 -> 1 [label=<!a &amp; !b>]
3 -> 2 [label=<!a &amp; b>]
3 -> 3 [label=<a &amp; !b>]
}
#+end_example
#+BEGIN_SRC dot :file dotex2gba.png :cmdline -Tpng :var txt=dotex2gba :exports results
$txt
#+END_SRC
#+RESULTS:
[[file:dotex2gba.png]]
Note that =ltl2tgba= is not very good at generating state-based
generalized Büchi automata (GBA): all it does is generating a
transition-based one internally, and then pushing acceptance sets onto
states. On this example, the resulting GBA produced by =-S= is larger
than the BA produced by =-B=.
As already discussed on the page about [[file:oaut.org][common output options]], various
options controls the output format of =ltl2tgba=: