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,9 @@
|
|||
#+DESCRIPTION: Code example for testing the equivalence of two LTL or PSL formulas
|
||||
#+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
|
||||
|
||||
This page shows how to test whether two LTL/PSL formulas are
|
||||
equivalent, i.e., if they denote the same languages.
|
||||
|
|
@ -13,7 +16,7 @@ Using a =ltlfilt= you can use =--equivalent-to=f= to filter a list of
|
|||
LTL formula and retain only those equivalent to =f=. So this gives an easy
|
||||
way to test the equivalence of two formulas:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltlfilt -f '(a U b) U a' --equivalent-to 'b U a'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -23,7 +26,7 @@ Since the input formula was output, it means it is equivalent to =b U
|
|||
a=. You may want to add =-c= to count the number of formula output if
|
||||
you prefer a 1/0 answer:
|
||||
|
||||
#+BEGIN_SRC sh :results verbatim :exports both
|
||||
#+BEGIN_SRC sh
|
||||
ltlfilt -c -f '(a U b) U a' --equivalent-to 'b U a'
|
||||
#+END_SRC
|
||||
#+RESULTS:
|
||||
|
|
@ -55,7 +58,7 @@ and $A_g\otimes A_{\lnot f}$ are empty.
|
|||
We could also write this check by doing [[file:tut10.org][the translation]] and emptiness
|
||||
check ourselves. For instance:
|
||||
|
||||
#+BEGIN_SRC python :results output :exports both
|
||||
#+BEGIN_SRC python
|
||||
import spot
|
||||
|
||||
def implies(f, g):
|
||||
|
|
@ -76,7 +79,7 @@ print("Equivalent" if equiv(f, g) else "Not equivalent")
|
|||
|
||||
This can also be done via a =language_containment_checker= object:
|
||||
|
||||
#+BEGIN_SRC python :results output :exports both
|
||||
#+BEGIN_SRC python
|
||||
import spot
|
||||
f = spot.formula("(a U b) U a")
|
||||
g = spot.formula("b U a")
|
||||
|
|
@ -97,7 +100,7 @@ Here are possible C++ implementations using either =are_equivalent()=
|
|||
or the =language_containment_checker=. Note that the
|
||||
=are_equivalent()= function also work with automata.
|
||||
|
||||
#+BEGIN_SRC C++ :results verbatim :exports both
|
||||
#+BEGIN_SRC C++
|
||||
#include <iostream>
|
||||
#include <spot/tl/parse.hh>
|
||||
#include <spot/twaalgos/contains.hh>
|
||||
|
|
@ -113,18 +116,18 @@ int main()
|
|||
#+RESULTS:
|
||||
: Equivalent
|
||||
|
||||
#+BEGIN_SRC C++ :results verbatim :exports both
|
||||
#include <iostream>
|
||||
#include <spot/tl/parse.hh>
|
||||
#include <spot/tl/contain.hh>
|
||||
#+BEGIN_SRC C++
|
||||
#include <iostream>
|
||||
#include <spot/tl/parse.hh>
|
||||
#include <spot/tl/contain.hh>
|
||||
|
||||
int main()
|
||||
{
|
||||
spot::formula f = spot::parse_formula("(a U b) U a");
|
||||
spot::formula g = spot::parse_formula("b U a");
|
||||
spot::language_containment_checker c;
|
||||
std::cout << (c.equal(f, g) ? "Equivalent\n" : "Not equivalent\n");
|
||||
}
|
||||
int main()
|
||||
{
|
||||
spot::formula f = spot::parse_formula("(a U b) U a");
|
||||
spot::formula g = spot::parse_formula("b U a");
|
||||
spot::language_containment_checker c;
|
||||
std::cout << (c.equal(f, g) ? "Equivalent\n" : "Not equivalent\n");
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue