Commit 011a5684 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

org: document -0

* doc/org/ioltl.org: Add an example with xargs -0.
* src/bin/common_aoutput.hh (statistics): Do not print nullptr if %F is
empty.
parent 2749702e
......@@ -146,13 +146,12 @@ used by [[http://www.ltl2dstar.de][ltl2dstar]].
All tools that output LTL/PSL formulas implement the following options:
#+BEGIN_SRC sh :results verbatim :exports results
ltlfilt --help | sed -n '/Output options:/,/^$/p' | sed '1d;$d'
genltl --help | sed -n '/Output options:/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
#+begin_example
-c, --count print only a count of matched formulas
-n, --max-count=NUM output at most NUM formulas
-q, --quiet suppress all normal output
-0, --zero-terminated-output separate output formulas with \0 instead of \n
(for use with xargs -0)
-8, --utf8 output using UTF-8 characters
--csv-escape quote the formula for use in a CSV file
--format=FORMAT specify how each line should be output (default:
......@@ -231,6 +230,33 @@ rm -f example-*.ltl
#+END_SRC
#+RESULTS:
Option =-0= is useful if the list of formulas is passed to =xargs=.
=xargs= normally splits its input on white space (which are frequent
in LTL formulas), but you can use =xargs -0= to split the input on
null characters. So for instance the following two invocations have
nearly the same output:
#+BEGIN_SRC sh :results verbatim :exports both
genltl -0 --gh-q=1..4 | xargs -0 ltl2tgba --stats='%F,%f,%s'
genltl --gh-q=1..4 | ltl2tgba -F- --stats='%F,%f,%s'
#+END_SRC
#+RESULTS:
: ,Fp1 | Gp2,3
: ,(Fp1 | Gp2) & (Fp2 | Gp3),8
: ,(Fp1 | Gp2) & (Fp2 | Gp3) & (Fp3 | Gp4),18
: ,(Fp1 | Gp2) & (Fp2 | Gp3) & (Fp3 | Gp4) & (Fp4 | Gp5),42
: -,Fp1 | Gp2,3
: -,(Fp1 | Gp2) & (Fp2 | Gp3),8
: -,(Fp1 | Gp2) & (Fp2 | Gp3) & (Fp3 | Gp4),18
: -,(Fp1 | Gp2) & (Fp2 | Gp3) & (Fp3 | Gp4) & (Fp4 | Gp5),42
The only difference is that for the first command, =ltl2tgba= received
its formulas from the command-line arguments supplied by =xargs= (so
=%F= is empty as there is no input file), while in the second case the
formula where read from standard input (denoted by =-=).
# LocalWords: lbt LBT's filename UTF gfa GFa ltlfilt LBTT scheck
# LocalWords: utf associativity
......
......@@ -111,7 +111,7 @@ public:
const spot::ltl::formula* f,
const char* filename, int loc, double run_time)
{
filename_ = filename;
filename_ = filename ? filename : "";
if (loc >= 0 && has('L'))
{
std::ostringstream os;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment