Commit 2927cf38 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

python: add some doc & tests for the acceptance bindings

* wrap/python/tests/acc_cond.ipynb: New file.
* wrap/python/tests/Makefile.am, doc/org/tut.org: Add it.
* wrap/python/spot_impl.i: Add printer for acc_cond::mark_t.
parent 4993e807
......@@ -50,6 +50,8 @@ real notebooks instead.
generated random automata, which are displayed in a table before and
after acceptance simplification
- [[https://spot.lrde.epita.fr/ipynb/accparse.html][accparse.ipynb]] exercises the acceptance condition parser
- [[https://spot.lrde.epita.fr/ipynb/acc_cond.html][acc_cond.ipynb]] documents the interface for manipulating acceptance
conditions
- [[https://spot.lrde.epita.fr/ipynb/randltl.html][randltl.ipynb]] demonstrates a Python-version of [[file:randltl.org][=randltl=]]
- [[https://spot.lrde.epita.fr/ipynb/decompose.html][decompose.ipynb]] illustrates the =decompose_strength()= function
- [[https://spot.lrde.epita.fr/ipynb/testingaut.html][testingaut.ipynb]] shows the step necessary to build a testing
......
......@@ -441,14 +441,6 @@ namespace std {
std::string __str__() { return spot::str_psl(*self); }
}
%extend spot::acc_cond::mark_t {
// http://comments.gmane.org/gmane.comp.programming.swig/14822
mark_t(const std::vector<unsigned>& f)
{
return new spot::acc_cond::mark_t(f.begin(), f.end());
}
}
%extend spot::twa {
void set_name(std::string name)
{
......@@ -487,12 +479,25 @@ namespace std {
}
%extend spot::acc_cond::mark_t {
// http://comments.gmane.org/gmane.comp.programming.swig/14822
mark_t(const std::vector<unsigned>& f)
{
return new spot::acc_cond::mark_t(f.begin(), f.end());
}
std::string __str__()
{
std::ostringstream os;
os << *self;
return os.str();
}
std::string __repr__()
{
std::ostringstream os;
os << *self;
return os.str();
}
}
%extend spot::twa_run {
......
......@@ -31,6 +31,7 @@ LOG_DRIVER = $(TEST_LOG_DRIVER)
check_SCRIPTS = run
TESTS = \
acc_cond.ipynb \
accparse.ipynb \
accparse2.py \
alarm.py \
......
This diff is collapsed.
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