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:
parent
0c8e6a38a8
commit
8a96828d85
40 changed files with 2193 additions and 2281 deletions
|
|
@ -3,6 +3,8 @@
|
|||
#+DESCRIPTION: Code example for iterating of alternating ω-automata in Spot
|
||||
#+INCLUDE: setup.org
|
||||
#+HTML_LINK_UP: tut.html
|
||||
#+PROPERTY: header-args:python :results output :exports both
|
||||
#+PROPERTY: header-args:C+++ :results verbatim :noweb strip-export
|
||||
|
||||
Alternating automata can be explored in a very similar way as
|
||||
non-alternating automata. Most of the code from our [[file:tut21.org][custom automaton
|
||||
|
|
@ -54,7 +56,7 @@ and that we run the following code, similar to what we did in the
|
|||
[[file:tut21.org][custom automaton printer]].
|
||||
|
||||
#+NAME: nonalt-body
|
||||
#+BEGIN_SRC C++
|
||||
#+BEGIN_SRC C++ :export code
|
||||
std::cout << "Initial state: " << aut->get_init_state_number() << '\n';
|
||||
|
||||
const spot::bdd_dict_ptr& dict = aut->get_dict();
|
||||
|
|
@ -98,7 +100,7 @@ for (unsigned s = 0; s < n; ++s)
|
|||
#+END_SRC
|
||||
|
||||
#+NAME: nonalt-one
|
||||
#+BEGIN_SRC C++ :exports none :noweb strip-export :results verbatim
|
||||
#+BEGIN_SRC C++ :exports none
|
||||
<<nonalt-main>>
|
||||
void custom_print(spot::twa_graph_ptr& aut)
|
||||
{
|
||||
|
|
@ -136,7 +138,7 @@ unconditionally. In this example, we simply call =is_univ_dest()= to
|
|||
decide whether to enclose the destinations in braces.
|
||||
|
||||
#+NAME: nonalt-body2
|
||||
#+BEGIN_SRC C++
|
||||
#+BEGIN_SRC C++ :export code
|
||||
unsigned init = aut->get_init_state_number();
|
||||
std::cout << "Initial state:";
|
||||
if (aut->is_univ_dest(init))
|
||||
|
|
@ -169,7 +171,7 @@ decide whether to enclose the destinations in braces.
|
|||
#+END_SRC
|
||||
|
||||
#+NAME: nonalt-two
|
||||
#+BEGIN_SRC C++ :exports none :noweb strip-export :results verbatim
|
||||
#+BEGIN_SRC C++ :exports none
|
||||
<<nonalt-main>>
|
||||
void custom_print(spot::twa_graph_ptr& aut)
|
||||
{
|
||||
|
|
@ -187,27 +189,27 @@ decide whether to enclose the destinations in braces.
|
|||
|
||||
Here is the Python version of this code:
|
||||
|
||||
#+BEGIN_SRC python :results output :exports both
|
||||
import spot
|
||||
#+BEGIN_SRC python
|
||||
import spot
|
||||
|
||||
aut = spot.automaton("tut24.hoa")
|
||||
aut = spot.automaton("tut24.hoa")
|
||||
|
||||
bdict = aut.get_dict()
|
||||
init = aut.get_init_state_number()
|
||||
ui = aut.is_univ_dest(init)
|
||||
print("Initial states: {}{}{}".format("{ " if ui else "",
|
||||
" ".join(map(str, aut.univ_dests(init))),
|
||||
" }" if ui else ""))
|
||||
for s in range(0, aut.num_states()):
|
||||
print("State {}:".format(s))
|
||||
for t in aut.out(s):
|
||||
ud = aut.is_univ_dest(t)
|
||||
print(" edge({} -> {}{}{})".format(t.src,
|
||||
"{ " if ud else "",
|
||||
" ".join(map(str, aut.univ_dests(t))),
|
||||
" }" if ud else ""))
|
||||
print(" label =", spot.bdd_format_formula(bdict, t.cond))
|
||||
print(" acc sets =", t.acc)
|
||||
bdict = aut.get_dict()
|
||||
init = aut.get_init_state_number()
|
||||
ui = aut.is_univ_dest(init)
|
||||
print("Initial states: {}{}{}".format("{ " if ui else "",
|
||||
" ".join(map(str, aut.univ_dests(init))),
|
||||
" }" if ui else ""))
|
||||
for s in range(0, aut.num_states()):
|
||||
print("State {}:".format(s))
|
||||
for t in aut.out(s):
|
||||
ud = aut.is_univ_dest(t)
|
||||
print(" edge({} -> {}{}{})".format(t.src,
|
||||
"{ " if ud else "",
|
||||
" ".join(map(str, aut.univ_dests(t))),
|
||||
" }" if ud else ""))
|
||||
print(" label =", spot.bdd_format_formula(bdict, t.cond))
|
||||
print(" acc sets =", t.acc)
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue