scc_info: add Python bindings
Related to #172, where we discussed that scc_info bindings were missing. * spot/twaalgos/sccinfo.hh (spot::scc_info::scc_node): Move... (spot::scc_info_node): ... here to help Swig. * python/spot/impl.i: Add bindings for scc_info. * tests/python/sccinfo.py: New file. * tests/Makefile.am: Add it.
This commit is contained in:
parent
803f9a5dd8
commit
289b2383ad
4 changed files with 187 additions and 83 deletions
|
|
@ -133,6 +133,7 @@
|
|||
#include <spot/twaalgos/neverclaim.hh>
|
||||
#include <spot/twaalgos/randomize.hh>
|
||||
#include <spot/twaalgos/remfin.hh>
|
||||
#include <spot/twaalgos/sccinfo.hh>
|
||||
#include <spot/twaalgos/strength.hh>
|
||||
#include <spot/twaalgos/sccfilter.hh>
|
||||
#include <spot/twaalgos/stats.hh>
|
||||
|
|
@ -533,6 +534,9 @@ def state_is_accepting(self, src) -> "bool":
|
|||
%include <spot/twaalgos/neverclaim.hh>
|
||||
%include <spot/twaalgos/randomize.hh>
|
||||
%include <spot/twaalgos/remfin.hh>
|
||||
%traits_swigtype(spot::scc_info_node);
|
||||
%fragment(SWIG_Traits_frag(spot::scc_info_node));
|
||||
%include <spot/twaalgos/sccinfo.hh>
|
||||
%include <spot/twaalgos/strength.hh>
|
||||
%include <spot/twaalgos/sccfilter.hh>
|
||||
%include <spot/twaalgos/stats.hh>
|
||||
|
|
@ -778,6 +782,14 @@ def state_is_accepting(self, src) -> "bool":
|
|||
throw std::runtime_error
|
||||
("universal destinations should be explored with univ_dest()");
|
||||
}
|
||||
}
|
||||
|
||||
%extend spot::scc_info {
|
||||
swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF)
|
||||
{
|
||||
return swig::make_forward_iterator(self->begin(), self->begin(),
|
||||
self->end(), *PYTHON_SELF);
|
||||
}
|
||||
}
|
||||
|
||||
%extend spot::acc_cond::acc_code {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue