Commit 6bad8aeb authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

python: remove error recovery checks from the public notebooks

* tests/python/_autparserr.ipynb: New files, containing error
checking code from automata-io.ipynb and piperead.ipynb.
* tests/python/automata-io.ipynb: Remove error checks, and pipe
examples from piperead.ipynb.
* tests/python/piperead.ipynb: Delete.
* tests/python/word.ipynb: Move error checking code...
* tests/python/_word.ipynb: ... in this new file.
* doc/org/tut.org, tests/Makefile.am: Adjust.
parent 58e64e75
......@@ -58,8 +58,6 @@ real notebooks instead.
- [[https://spot.lrde.epita.fr/ipynb/automata.html][=automata.ipynb=]] covers translation from formulas to automata,
automata printing, and some lights transformations
- [[https://spot.lrde.epita.fr/ipynb/automata-io.html][=automata-io.ipynb=]] shows how to save and read automata from files
- [[https://spot.lrde.epita.fr/ipynb/piperead.html][=piperead.ipynb=]] shows how to save and read automata output from other
commands, using pipes
- [[https://spot.lrde.epita.fr/ipynb/randaut.html][=randaut.ipynb=]] shows a simple case where the [[file:randaut.org][=randaut=]] commands
generated random automata, which are displayed in a table before and
after acceptance simplification
......
......@@ -334,7 +334,6 @@ TESTS_ipython = \
python/highlighting.ipynb \
python/ltsmin-dve.ipynb \
python/ltsmin-pml.ipynb \
python/piperead.ipynb \
python/parity.ipynb \
python/product.ipynb \
python/randaut.ipynb \
......@@ -348,7 +347,9 @@ TESTS_ipython = \
# with a _.
TESTS_python = \
python/_altscc.ipynb \
python/_autparserr.ipynb \
python/_aux.ipynb \
python/_word.ipynb \
python/accparse2.py \
python/alarm.py \
python/alternating.py \
......
%% Cell type:code id: tags:
``` python
import spot
spot.setup()
```
%% Cell type:code id: tags:
``` python
print(spot.parse_word('a; b&!a; b'))
```
%% Output
File "<string>", line unknown
SyntaxError:
>>> a; b&!a; b
^
A twa_word must contain a cycle
%% Cell type:code id: tags:
``` python
print(spot.parse_word('a; b; c}'))
```
%% Output
File "<string>", line unknown
SyntaxError:
>>> a; b; c}
^
Expected ';' delimiter: '}' stands for ending a cycle
%% Cell type:code id: tags:
``` python
print(spot.parse_word('a; cycle{}'))
```
%% Output
File "<string>", line unknown
SyntaxError:
>>> a; cycle{}
^
empty input
%% Cell type:code id: tags:
``` python
print(spot.parse_word('a; cycle{!a}; a'))
```
%% Output
File "<string>", line unknown
SyntaxError:
>>> a; cycle{!a}; a
^
Input should be finished after cycle
%% Cell type:code id: tags:
``` python
# Creating an empty word is OK...
w = spot.twa_word(spot._bdd_dict)
```
%% Cell type:code id: tags:
``` python
# ... as long as this word is not printed.
print(w)
```
%% Output
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-7-9968db49e707> in <module>()
1 # ... as long as this word is not printed.
----> 2 print(w)
/home/adl/git/spot/python/spot/impl.py in __str__(self)
4922
4923 def __str__(self) -> "std::string":
-> 4924 return _impl.twa_word___str__(self)
4925 twa_word_swigregister = _impl.twa_word_swigregister
4926 twa_word_swigregister(twa_word)
RuntimeError: a twa_word may not have an empty cycle
This diff is collapsed.
%% Cell type:code id: tags:
``` python
import spot
spot.setup()
```
%% Cell type:markdown id: tags:
Let's build a small automaton to use as example.
%% Cell type:code id: tags:
``` python
aut = spot.translate('!a & G(Fa <-> XXb)'); aut
```
%% Output