python: better bindings for testing automata

* src/taalgos/dotty.cc, src/taalgos/dotty.hh: Add an interface
similar to that of tgba/dotty.hh, even if we have to ignore
most options.
* src/taalgos/tgba2ta.cc, src/taalgos/tgba2ta.hh: Add an option
to display the intermediate automaton with explicit stuttering
transitions, for the purpose of making demonstrations.
* src/tgba/tgbagraph.hh: Tweak the file so that SWIG can
read it.
* wrap/python/spot.py: Add wrappers for testing automata.
* wrap/python/spot_impl.i: Fix support for
atomic_prop_collect_as_bdd, and include a few more files.
* wrap/python/tests/testingaut.ipynb: New file.
* wrap/python/tests/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2015-04-02 18:29:42 +02:00
parent 7bb183b929
commit 16204e8e61
9 changed files with 796 additions and 31 deletions

View file

@ -410,7 +410,8 @@ namespace spot
build_ta(const ta_explicit_ptr& ta, bdd atomic_propositions_set_,
bool degeneralized,
bool single_pass_emptiness_check,
bool artificial_livelock_state_mode)
bool artificial_livelock_state_mode,
bool no_livelock)
{
std::stack<state_ta_explicit*> todo;
@ -517,6 +518,9 @@ namespace spot
delete tgba_succ_it;
}
if (no_livelock)
return ta;
state_ta_explicit* artificial_livelock_acc_state = 0;
trace << "*** build_ta: artificial_livelock_acc_state_mode = ***"
@ -541,8 +545,10 @@ namespace spot
ta_explicit_ptr
tgba_to_ta(const const_tgba_ptr& tgba_, bdd atomic_propositions_set_,
bool degeneralized, bool artificial_initial_state_mode,
bool single_pass_emptiness_check, bool artificial_livelock_state_mode)
bool degeneralized, bool artificial_initial_state_mode,
bool single_pass_emptiness_check,
bool artificial_livelock_state_mode,
bool no_livelock)
{
ta_explicit_ptr ta;
@ -563,7 +569,8 @@ namespace spot
// build ta automaton
build_ta(ta, atomic_propositions_set_, degeneralized,
single_pass_emptiness_check, artificial_livelock_state_mode);
single_pass_emptiness_check, artificial_livelock_state_mode,
no_livelock);
// (degeneralized=true) => TA
if (degeneralized)
@ -607,7 +614,7 @@ namespace spot
// build a Generalized TA automaton involving a single_pass_emptiness_check
// (without an artificial livelock state):
auto ta = tgta->get_ta();
build_ta(ta, atomic_propositions_set_, false, true, false);
build_ta(ta, atomic_propositions_set_, false, true, false, false);
trace << "***tgba_to_tgbta: POST build_ta***" << std::endl;