org: simplify babel blocks using #+PROPERTY: header-args

This feature is in Org 9, which is already required.

* doc/org/autcross.org, doc/org/autfilt.org, doc/org/compile.org,
doc/org/concepts.org, doc/org/csv.org, doc/org/dstar2tgba.org,
doc/org/genaut.org, doc/org/genltl.org, doc/org/hierarchy.org,
doc/org/hoa.org, doc/org/ioltl.org, doc/org/ltl2tgba.org,
doc/org/ltl2tgta.org, doc/org/ltlcross.org, doc/org/ltldo.org,
doc/org/ltlfilt.org, doc/org/ltlgrind.org, doc/org/ltlsynt.org,
doc/org/oaut.org, doc/org/randaut.org, doc/org/randltl.org,
doc/org/satmin.org, doc/org/setup.org, doc/org/tools.org,
doc/org/tut01.org, doc/org/tut02.org, doc/org/tut03.org,
doc/org/tut04.org, doc/org/tut10.org, doc/org/tut11.org,
doc/org/tut12.org, doc/org/tut20.org, doc/org/tut21.org,
doc/org/tut22.org, doc/org/tut23.org, doc/org/tut24.org,
doc/org/tut30.org, doc/org/tut31.org, doc/org/tut50.org,
doc/org/upgrade2.org: Simplify SRC block setups for sh, python and
C++.  Also fix a few typos and examples along the way.
This commit is contained in:
Alexandre Duret-Lutz 2019-04-16 21:03:13 +02:00
parent 0c8e6a38a8
commit 8a96828d85
40 changed files with 2193 additions and 2281 deletions

View file

@ -3,17 +3,18 @@
#+DESCRIPTION: Code example for converting ω-automata in Spot
#+INCLUDE: setup.org
#+HTML_LINK_UP: tut.html
#+PROPERTY: header-args:sh :results verbatim :exports both
#+PROPERTY: header-args:python :results output :exports both
#+PROPERTY: header-args:C+++ :results verbatim :exports both
Consider the following Rabin automaton, generated by =ltl2dstar=:
#+BEGIN_SRC sh :results silent :exports both
#+BEGIN_SRC sh :results silent
ltldo ltl2dstar -f 'F(Xp1 xor XXp1)' > tut30.hoa
#+END_SRC
#+RESULTS:
#+NAME: tut30in
#+BEGIN_SRC sh :results verbatim :exports none
#+BEGIN_SRC sh :exports none
autfilt tut30.hoa --dot
#+END_SRC
@ -39,11 +40,11 @@ not only be changed to Büchi, but simplification routines (useless
SCCs removal, simulation-based reductions, acceptance sets
simplifications, WDBA-minimization, ...) will also be applied.
#+BEGIN_SRC sh :results verbatim :exports both :wrap SRC hoa
#+BEGIN_SRC sh :wrap SRC hoa
autfilt -B -D tut30.hoa
#+END_SRC
#+RESULTS:
#+BEGIN_SRC hoa
#+begin_SRC hoa
HOA: v1
States: 5
Start: 1
@ -51,7 +52,7 @@ AP: 1 "p1"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic weak
properties: deterministic very-weak
--BODY--
State: 0 {0}
[t] 0
@ -67,40 +68,13 @@ State: 4
[!0] 0
[0] 4
--END--
#+END_SRC
#+end_SRC
#+NAME: tut30out
#+BEGIN_SRC sh :results verbatim :exports none
#+BEGIN_SRC sh :exports none
autfilt -B -D -d tut30.hoa
#+END_SRC
#+RESULTS: tut30out
#+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 -> 1
0 [label="0", peripheries=2]
0 -> 0 [label=<1>]
1 [label="1"]
1 -> 2 [label=<1>]
2 [label="2"]
2 -> 3 [label=<!p1>]
2 -> 4 [label=<p1>]
3 [label="3"]
3 -> 0 [label=<p1>]
3 -> 3 [label=<!p1>]
4 [label="4"]
4 -> 0 [label=<!p1>]
4 -> 4 [label=<p1>]
}
#+end_example
#+BEGIN_SRC dot :file tut30out.svg :var txt=tut30out :exports results
$txt
#+END_SRC
@ -118,7 +92,7 @@ the result further.
The Python version uses the =postprocess()= routine:
#+BEGIN_SRC python :results output :exports both :wrap SRC hoa
#+BEGIN_SRC python :wrap SRC hoa
import spot
aut = spot.automaton('tut30.hoa').postprocess('BA', 'deterministic')
print(aut.to_str('hoa'))
@ -153,7 +127,7 @@ State: 4
The =postprocess()= function has an interface similar to
[[file:tut10.org][the =translate()= function discussed previously]]:
#+BEGIN_SRC python :results output :exports both
#+BEGIN_SRC python
import spot
help(spot.postprocess)
#+END_SRC
@ -162,7 +136,7 @@ help(spot.postprocess)
#+begin_example
Help on function postprocess in module spot:
postprocess(automaton, *args)
postprocess(automaton, *args, formula=None, xargs=None)
Post process an automaton.
This applies a number of simlification algorithms, depending on
@ -171,17 +145,29 @@ postprocess(automaton, *args)
not already 'Deterministic'.
The optional arguments should be strings among the following:
- at most one in 'Generic', 'TGBA', 'BA', or 'Monitor'
(type of automaton to build)
- at most one in 'Generic', 'TGBA', 'BA', or 'Monitor',
'parity', 'parity min odd', 'parity min even',
'parity max odd', 'parity max even' (type of automaton to
build), 'coBuchi'
- at most one in 'Small', 'Deterministic', 'Any'
(preferred characteristics of the produced automaton)
- at most one in 'Low', 'Medium', 'High'
(optimization level)
- any combination of 'Complete' and 'StateBasedAcceptance'
(or 'SBAcc' for short)
- any combination of 'Complete', 'StateBasedAcceptance'
(or 'SBAcc' for short), and 'Colored (only for parity
acceptance)
The default corresponds to 'generic', 'small' and 'high'.
If a formula denoted by this automaton is known, pass it to as the
optional `formula` argument; it can help some algorithms by
providing an easy way to complement the automaton.
Additional options can be supplied using a `spot.option_map`, or a
string (that will be converted to `spot.option_map`), as the `xargs`
argument. This is similar to the `-x` option of command-line tools;
so check out the spot-x(7) man page for details.
#+end_example
@ -192,7 +178,7 @@ The C++ version of this code is a bit more verbose, because the
=postprocessor= object, configure it, and then call it for each
automaton to process.
#+BEGIN_SRC C++ :results verbatim :exports both :wrap SRC hoa
#+BEGIN_SRC C++ :wrap SRC hoa
#include <iostream>
#include <spot/parseaut/public.hh>
#include <spot/twaalgos/postproc.hh>
@ -219,7 +205,7 @@ automaton to process.
#+END_SRC
#+RESULTS:
#+BEGIN_SRC hoa
#+begin_SRC hoa
HOA: v1
States: 5
Start: 1
@ -227,7 +213,7 @@ AP: 1 "p1"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic weak
properties: deterministic very-weak
--BODY--
State: 0 {0}
[t] 0
@ -243,8 +229,8 @@ State: 4
[!0] 0
[0] 4
--END--
#+END_SRC
#+end_SRC
#+BEGIN_SRC sh :results silent :exports results
#+BEGIN_SRC sh :results silent
rm -f tut30.hoa
#+END_SRC