autfilt.org 5.29 KB
Newer Older
1
#+TITLE: =autfilt=
2
3
#+SETUPFILE: setup.org
#+HTML_LINK_UP: tools.html
4
5
6
7
8

The =autfilt= tool can filter, transform, and convert a stream of automata.

* Conversion between formats

9
10
11
12
13
14
15
=autfilt= can read automata written in the [[http://adl.github.io/hoaf/][Hanoi Omega Automata
Format]], as [[http://spinroot.com/spin/Man/never.html][Spin never claims]], or using [[http://www.tcs.hut.fi/Software/lbtt/doc/html/Format-for-automata.html][LBTT's format]].  Automata in
those formats (even a mix of those formats) can be concatenated in the
same stream, =autfilt= will process them in batch.

The output format can be controlled using [[file:oaut.org][the common output options]]
(like =--spin=, =--lbtt=, =--dot=, =--hoaf=...).
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169

#+BEGIN_SRC sh :results verbatim :exports both
cat >example.hoa <<EOF
HOA: v1
States: 1
Start: 0
AP: 1 "p0"
Acceptance: 1 Inf(0)
--BODY--
State: 0
[0] 0 {0}
[!0] 0
--END--
EOF
autfilt example.hoa --dot
#+END_SRC

#+RESULTS:
: digraph G {
:   0 [label="", style=invis, height=0]
:   0 -> 1
:   1 [label="0"]
:   1 -> 1 [label="p0\n{0}"]
:   1 -> 1 [label="!p0"]
: }

The =--spin= options implicitly requires a degeneralization:

#+BEGIN_SRC sh :results verbatim :exports both
autfilt example.hoa --spin
#+END_SRC

#+RESULTS:
#+begin_example
never {
accept_init:
  if
  :: ((p0)) -> goto accept_init
  :: ((!(p0))) -> goto T0_S2
  fi;
T0_S2:
  if
  :: ((p0)) -> goto accept_init
  :: ((!(p0))) -> goto T0_S2
  fi;
}
#+end_example

#+BEGIN_SRC sh :results verbatim :exports both
autfilt example.hoa --lbtt
#+END_SRC

#+RESULTS:
: 1 1t
: 0 1
: 0 0 -1 p0
: 0 -1 ! p0
: -1


* Displaying statistics

One special output format of =autfilt= is the statistic output.  For
instance the following command calls [[file:randaut.org][=randaut=]] to generate 10 random
automata, and pipe the result into =autfilt= to display various
statistics.


#+BEGIN_SRC sh :results verbatim :exports both
randaut --hoa -n 10 -A0..2 -S10..20 -d0.05 2 |
autfilt --stats='%s states, %e edges, %a acc-sets, %c SCCs, det=%d'
#+END_SRC

#+RESULTS:
#+begin_example
16 states, 27 edges, 1 acc-sets, 2 SCCs, det=0
12 states, 20 edges, 1 acc-sets, 2 SCCs, det=0
11 states, 15 edges, 0 acc-sets, 4 SCCs, det=1
16 states, 29 edges, 0 acc-sets, 2 SCCs, det=0
15 states, 30 edges, 2 acc-sets, 1 SCCs, det=0
11 states, 17 edges, 1 acc-sets, 2 SCCs, det=0
11 states, 16 edges, 1 acc-sets, 1 SCCs, det=1
17 states, 28 edges, 1 acc-sets, 1 SCCs, det=0
19 states, 36 edges, 0 acc-sets, 3 SCCs, det=0
11 states, 16 edges, 2 acc-sets, 6 SCCs, det=0
#+end_example

The following =%= sequences are available:
#+BEGIN_SRC sh :results verbatim :exports results
autfilt --help | sed -n '/^  %%/,/^$/p' | sed '$d'
#+END_SRC
#+RESULTS:
#+begin_example
  %%                         a single %
  %A, %a                     number of acceptance pairs or sets
  %C, %c                     number of SCCs
  %d                         1 if the output is deterministic, 0 otherwise
  %E, %e                     number of edges
  %F                         name of the input file
  %n                         number of nondeterministic states in output
  %p                         1 if the output is complete, 0 otherwise
  %r                         conversion time (including post-processings, but
                             not parsing) in seconds
  %S, %s                     number of states
  %T, %t                     number of transitions
#+end_example

When a letter is available both as uppercase and lowercase, the
uppercase version refer to the input automaton, while the lowercase
refer to the output automaton.  Of course this distinction makes sense
only if =autfilt= was instructed to perform an operation on the input
automaton.

* Simplifying automata

The standard set of automata simplification routines (these are often
referred to as the "post-processing" routines, because these are the
procedures performed by [[file:ltl2tgba.org][=ltl2tgba=]] after translating a formula into a
TGBA) are available through the following options.

This set of options controls the desired type of output automaton:

#+BEGIN_SRC sh :results verbatim :exports results
autfilt --help | sed -n '/Output automaton type:/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
:   -B, --ba                   Büchi Automaton
:   -M, --monitor              Monitor (accepts all finite prefixes of the given
:                              property)
:       --tgba                 Transition-based Generalized Büchi Automaton
:                              (default)

These options specifies desired properties:

#+BEGIN_SRC sh :results verbatim :exports results
autfilt --help | sed -n '/Translation intent:/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
:   -a, --any                  no preference (default)
:   -C, --complete             output a complete automaton (combine with other
:                              intents)
:   -D, --deterministic        prefer deterministic automata
:       --small                prefer small automata

Finally, the following switches control the amount of effort applied
to reach the desired properties:

#+BEGIN_SRC sh :results verbatim :exports results
autfilt --help | sed -n '/Optimization level:/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
:       --high                 all available optimizations (slow)
:       --low                  minimal optimizations (fast, default)
:       --medium               moderate optimizations