postproc: add support for colored-parity
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Add support for a colored option. * bin/common_post.cc, bin/common_post.hh bin/autfilt.cc, bin/ltl2tgba.cc, bin/dstar2tgba.cc: Add support for --colored-parity. * bin/ltldo.cc: Adjust as well for consistency, even if --parity and --colored-parity is not used here. * tests/core/parity2.test: Add tests. * doc/org/autfilt.org, doc/org/ltl2tgba.org: Add examples. * NEWS: Mention --colored-parity.
This commit is contained in:
parent
6bad8aebdd
commit
bd6dc7a806
12 changed files with 411 additions and 41 deletions
|
|
@ -11,7 +11,7 @@ The tool operates a loop over 5 phases:
|
|||
- optionally preprocess the automaton
|
||||
- optionally filter the automaton (i.e., decide whether to ignore the
|
||||
automaton or continue with it)
|
||||
- optionally postprocess the automaton
|
||||
- optionally postprocess the automaton (to simply it or change its acceptance)
|
||||
- output the automaton
|
||||
|
||||
The simplest way to use the tool is simply to use it for input and
|
||||
|
|
@ -242,14 +242,20 @@ This set of options controls the desired type of output automaton:
|
|||
autfilt --help | sed -n '/Output automaton type:/,/^$/p' | sed '1d;$d'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
: -B, --ba Büchi Automaton (with state-based acceptance)
|
||||
: -C, --complete output a complete automaton
|
||||
: -G, --generic any acceptance is allowed (default)
|
||||
: -M, --monitor Monitor (accepts all finite prefixes of the given
|
||||
: property)
|
||||
: -S, --state-based-acceptance, --sbacc
|
||||
: define the acceptance using states
|
||||
: --tgba Transition-based Generalized Büchi Automaton
|
||||
#+begin_example
|
||||
-B, --ba Büchi Automaton (with state-based acceptance)
|
||||
-C, --complete output a complete automaton
|
||||
-G, --generic any acceptance is allowed (default)
|
||||
-M, --monitor Monitor (accepts all finite prefixes of the given
|
||||
property)
|
||||
-p, --colored-parity[=any|min|max|odd|even|min odd|min even|max odd|max
|
||||
even] colored automaton with parity acceptance
|
||||
-P, --parity[=any|min|max|odd|even|min odd|min even|max odd|max even]
|
||||
automaton with parity acceptance
|
||||
-S, --state-based-acceptance, --sbacc
|
||||
define the acceptance using states
|
||||
--tgba Transition-based Generalized Büchi Automaton
|
||||
#+end_example
|
||||
|
||||
These options specify any simplification goal:
|
||||
|
||||
|
|
@ -286,10 +292,11 @@ if you want to try to make (or keep) it deterministic use
|
|||
Note that the =--deterministic= flag has two possible behaviors
|
||||
depending on the constraints on the acceptance conditions:
|
||||
- When =autfilt= is configured to work with generic acceptance (the
|
||||
=--generic= option, which is the default), then the
|
||||
=--deterministic= flag will do whatever it takes to output a
|
||||
deterministic automaton, and this includes changing the acceptance
|
||||
condition if needed (see below).
|
||||
=--generic= option, which is the default) or parity acceptance
|
||||
(using =--parity= or =--colored-parity=), then the =--deterministic=
|
||||
flag will do whatever it takes to output a deterministic automaton,
|
||||
and this includes changing the acceptance condition if needed (see
|
||||
below).
|
||||
- If options =--tgba= or =--ba= are used, the =--deterministic= option
|
||||
is taken as a /preference/: =autfilt= will try to favor determinism
|
||||
in the output, but it may not always succeed and may output
|
||||
|
|
@ -319,10 +326,15 @@ attempted on any supplied automaton. (It's even attempted for
|
|||
deterministic automata, because that might reduce them.)
|
||||
|
||||
If that first procedure failed, and the input automaton is not
|
||||
deterministic and =--generic= (the default for =autfilt=) is used,
|
||||
then the second procedure is used. In this case, automata will be
|
||||
first converted to transition-based Büchi automata if their condition
|
||||
is more complex.
|
||||
deterministic and =--generic= (the default for =autfilt=), =--parity=
|
||||
or =--colorized-parity= is used, then the second procedure is used.
|
||||
In this case, automata will be first converted to transition-based
|
||||
Büchi automata if their acceptance condition is more complex.
|
||||
|
||||
The difference between =--parity= and =--colored-parity= parity is
|
||||
that the latter requests all transitions (or all states when
|
||||
state-based acceptance is used) to belong to exactly one acceptance
|
||||
set.
|
||||
|
||||
* Transformations
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,12 @@ a quick summary:
|
|||
- =--tgba= (the default) outputs Transition-based Generalized Büchi
|
||||
Automata
|
||||
- =--ba= (or =-B=) outputs state-based Büchi automata
|
||||
- =--monitor= (or =-M=) outputs Monitors
|
||||
- =--generic --deterministic= (or =-GD=) will do whatever it takes to
|
||||
- =--monitor= (or =-M=) outputs monitors
|
||||
- =--generic --deterministic= (or =-DG=) will do whatever it takes to
|
||||
produce a deterministic automaton, and may output generalized Büchi,
|
||||
or parity acceptance.
|
||||
- =--parity --deterministic= (or =-DP=) will produce a deterministic
|
||||
automaton with parity acceptance.
|
||||
|
||||
* TGBA and BA
|
||||
|
||||
|
|
@ -716,7 +718,7 @@ to experiment with the different settings on a small version of the
|
|||
pattern, and select the lowest setting that satisfies your
|
||||
expectations.
|
||||
|
||||
* Deterministic automata with =--generic=
|
||||
* Deterministic automata with =--generic --deterministic=
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: generic
|
||||
:END:
|
||||
|
|
@ -793,6 +795,127 @@ ltl2tgba "F(a W FGb)" -x '!det-scc' -G -D -d.a
|
|||
#+RESULTS:
|
||||
[[file:ltl2tgba-det2.svg]]
|
||||
|
||||
While the =--generic= option currently only builds automata with
|
||||
generalized-Büchi or parity acceptance, this is very likely to change
|
||||
in the future.
|
||||
|
||||
* Deterministic automata with =--parity --deterministic=
|
||||
|
||||
Using the =--parity= (or upper-case =-P=) option will force the
|
||||
acceptance condition to be of a parity type. This has to be
|
||||
understood in the sense of the HOA format, where:
|
||||
- multiple parity types are defined (=min odd n=, =min even n=, =max
|
||||
odd n=, and =max even n= where =n= is the number of acceptance
|
||||
sets), and
|
||||
- the parity acceptance is only a type of acceptance condition, i.e.,
|
||||
a formula expressed in terms of acceptance sets, and does not have
|
||||
additional constraints on these sets. In particular it is not
|
||||
necessary the case that each transition or state belongs to exactly
|
||||
one acceptance set (this is the "colored" property, see below).
|
||||
|
||||
Under these assumptions, Büchi acceptance is just one kind of parity
|
||||
(in HOA =Buchi= is equivalent to =parity max even 1= or =parity min
|
||||
even 1=), Rabin with one pair is also a parity acceptance (=Rabin 1=
|
||||
is equivalent to =parity min odd 2=), and Streett with one pair as
|
||||
well (=Streett 1= is equivalent to =parity max odd 2=).
|
||||
|
||||
In the current implementation, using =ltl2tgba --parity= (without
|
||||
=--deterministic=) will always produce a Büchi automaton, and when
|
||||
=--deterministic= (or =-D=) is added, it will produce an deterministic
|
||||
automaton with Büchi acceptance (=parity min even 1=) or with =parity
|
||||
min odd n= acceptance, because the latter is the type of parity
|
||||
acceptance that our determinization procedure outputs.
|
||||
|
||||
For instance, =FGa= gets translated into an automaton with =Rabin 1=
|
||||
acceptance (another name for =parity min odd 2=):
|
||||
|
||||
#+NAME: ltl2tgba-dp1
|
||||
#+BEGIN_SRC sh :results verbatim :exports code
|
||||
ltl2tgba "FGa" -D -P -d.a
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC dot :file ltl2tgba-dp1.svg :var txt=ltl2tgba-dp1 :exports results
|
||||
$txt
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:ltl2tgba-dp1.svg]]
|
||||
|
||||
And =GFa & GFb= gets translated into a =Büchi= automaton (another name
|
||||
for =parity min even 1=):
|
||||
|
||||
#+NAME: ltl2tgba-dp2
|
||||
#+BEGIN_SRC sh :results verbatim :exports code
|
||||
ltl2tgba "GFa & GFb" -D -P -d.a
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC dot :file ltl2tgba-dp2.svg :var txt=ltl2tgba-dp2 :exports results
|
||||
$txt
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:ltl2tgba-dp2.svg]]
|
||||
|
||||
If we really want to use the same style of parity acceptance for all outputs,
|
||||
we can specify it as an argument to the =--parity= option. For instance
|
||||
|
||||
#+NAME: ltl2tgba-dp3
|
||||
#+BEGIN_SRC sh :results verbatim :exports code
|
||||
ltl2tgba "GFa & GFb" -D -P'min odd' -d.a
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC dot :file ltl2tgba-dp3.svg :var txt=ltl2tgba-dp3 :exports results
|
||||
$txt
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:ltl2tgba-dp3.svg]]
|
||||
|
||||
|
||||
The =--colored-parity= (or lower-case =-p=) option works similarly to
|
||||
=--parity=, but additionally requests that the automaton be colored.
|
||||
I.e., each transition (or state if state-based acceptance is
|
||||
requested) should belong to exactly one acceptance set.
|
||||
|
||||
#+NAME: ltl2tgba-dp4
|
||||
#+BEGIN_SRC sh :results verbatim :exports code
|
||||
ltl2tgba "GFa & GFb" -D -p -d.a
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC dot :file ltl2tgba-dp4.svg :var txt=ltl2tgba-dp4 :exports results
|
||||
$txt
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:ltl2tgba-dp4.svg]]
|
||||
|
||||
#+NAME: ltl2tgba-dp5
|
||||
#+BEGIN_SRC sh :results verbatim :exports code
|
||||
ltl2tgba "GFa & GFb" -D -p'min odd' -d.a
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC dot :file ltl2tgba-dp5.svg :var txt=ltl2tgba-dp5 :exports results
|
||||
$txt
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:ltl2tgba-dp5.svg]]
|
||||
|
||||
Note that all these options can be combined with state-based
|
||||
acceptance if needed:
|
||||
|
||||
#+NAME: ltl2tgba-dp6
|
||||
#+BEGIN_SRC sh :results verbatim :exports code
|
||||
ltl2tgba "GFa & GFb" -D -S -p'max even' -d.a
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC dot :file ltl2tgba-dp6.svg :var txt=ltl2tgba-dp6 :exports results
|
||||
$txt
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:ltl2tgba-dp6.svg]]
|
||||
|
||||
* Translating multiple formulas for statistics
|
||||
|
||||
If multiple formulas are given to =ltl2tgba=, the corresponding
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue