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,7 @@
|
|||
#+DESCRIPTION: Examples showing how to read and write CSV files using Spot's command-line tools.
|
||||
#+INCLUDE: setup.org
|
||||
#+HTML_LINK_UP: tools.html
|
||||
#+PROPERTY: header-args:sh :results verbatim :exports both
|
||||
|
||||
This page discusses features available in Spot's command-line
|
||||
tools to produce an consume CSV files.
|
||||
|
|
@ -17,7 +18,7 @@ For instance here is how we could use =genltl= to generate a CSV file
|
|||
with three columns: the family name of the formula, its parameter, and
|
||||
the formula itself.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
genltl --and-gf=1..5 --u-left=1..5 --format='%F,%L,%f' > gen.csv
|
||||
cat gen.csv
|
||||
#+END_SRC
|
||||
|
|
@ -45,7 +46,7 @@ For instance, the following command will translate all the previous
|
|||
formulas, and show the resulting number of states (=%s=) and edges
|
||||
(=%e=) of the automaton constructed for each formula.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
genltl --and-gf=1..5 --u-left=1..5 | ltl2tgba --stats '%f,%s,%e'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -66,7 +67,7 @@ If the translated formulas may contain commas, or double quotes, this
|
|||
simple output may prove difficult to process by other tools. For
|
||||
instance consider the translation of the following two formulas:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltl2tgba -f Xa -f 'G("switch == on" -> F"tab[3,5] < 12")' --stats '%f,%s,%e'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -77,7 +78,7 @@ The second line of this input does no conform to [[https://www.rfc-editor.org/rf
|
|||
non-escaped fields are not allowed to contain comma or double quotes.
|
||||
To fix this, simply double-quote the =%f= in the argument to =--stats=:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltl2tgba -f Xa -f 'G("switch == on" -> F"tab[3,5] < 12")' --stats '"%f",%s,%e'
|
||||
#+END_SRC
|
||||
|
||||
|
|
@ -102,7 +103,7 @@ to support the specification of a CSV column. The notation
|
|||
For instance let's consider the file =gen.csv= built with the first command of
|
||||
this page. It contains:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports results
|
||||
#+BEGIN_SRC sh :exports results
|
||||
cat gen.csv
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -122,7 +123,7 @@ u-left,5,(((p1 U p2) U p3) U p4) U p5
|
|||
We can run =ltl2tgba= on the third column to produce
|
||||
the same output as in a previous example:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltl2tgba -F gen.csv/3 --stats '%f,%s,%e'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -143,7 +144,7 @@ When =ltlfilt= is used on a CSV file, it will preserve the
|
|||
text before and after the matched formula in the CSV file.
|
||||
For instance:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltlfilt -F gen.csv/3 --size-min=8 --relabel=abc
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -162,7 +163,7 @@ string.
|
|||
|
||||
For instance this moves the first two columns after the formulas.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltlfilt -F gen.csv/3 --size-min=8 --format='"%f",%<'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -190,7 +191,7 @@ Typical uses of =ltlfilt= on CSV file include:
|
|||
Some CSV files contain a header lines that should not be processed.
|
||||
For instance the CSV files produced by =ltlcross= have such a line:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
randltl -n 2 a b | ltlfilt --remove-wm |
|
||||
ltlcross --csv=results.csv 'ltl2tgba -s %f >%N' 'ltl3ba -f %s >%N'
|
||||
cat results.csv
|
||||
|
|
@ -209,7 +210,7 @@ cat results.csv
|
|||
If we run =ltlfilt= on the first column, it will process the =formula=
|
||||
header as if it was an LTL formula.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltlfilt -F results.csv/1 --format='%f' --unique
|
||||
#+END_SRC
|
||||
|
||||
|
|
@ -223,7 +224,7 @@ ltlfilt -F results.csv/1 --format='%f' --unique
|
|||
In such case, the syntax =FILENAME/-COL= (with a minus sign before the
|
||||
column number) can be used to discard the first line of a CSV file.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltlfilt -F results.csv/-1 --format='%f' --unique
|
||||
#+END_SRC
|
||||
|
||||
|
|
@ -238,7 +239,7 @@ ltlfilt -F results.csv/-1 --format='%f' --unique
|
|||
The =--stats= option of tools that generate automata can be used to
|
||||
generate CSV files that embed automata. For instance
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
genltl --dac=1..3 | ltl2tgba --stats='"%f","%e edges","%h"' > csv-aut.csv
|
||||
cat csv-aut.csv
|
||||
#+END_SRC
|
||||
|
|
@ -258,7 +259,7 @@ syntax we used previously, but by default it will just output the
|
|||
automata. If you want to preserve the entire line, you should use
|
||||
=%<= and =%>= in the =--stats= format.
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
autfilt csv-aut.csv/3 --states=2..3 --stats='%<,"%h"'
|
||||
#+END_SRC
|
||||
|
||||
|
|
@ -271,7 +272,7 @@ Another source of automata in CSV format is =ltlcross=. Using options
|
|||
=--automata= it will record the automata produced by each tool into
|
||||
the CSV file:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
genltl --dac=1..3 | ltlcross --csv=result.csv --automata ltl2tgba
|
||||
cat result.csv
|
||||
#+END_SRC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue