sccinfo: rename scc_info(x,opt) into scc_info_with_options(x,opt)
* spot/twaalgos/sccinfo.hh, python/spot/impl.i: Here. This avoid ambiguities where options (integer in Python) are interpreted as initial states. * tests/python/genem.py: Adjust.
This commit is contained in:
parent
f7e3d58846
commit
2178684528
3 changed files with 14 additions and 4 deletions
|
|
@ -653,6 +653,9 @@ def state_is_accepting(self, src) -> "bool":
|
|||
}
|
||||
%noexception spot::scc_info::edges_of;
|
||||
%noexception spot::scc_info::inner_edges_of;
|
||||
%rename(scc_info_with_options) spot::scc_info::scc_info(const_twa_graph_ptr aut, scc_info_options options);
|
||||
%rename(scc_info_with_options) spot::scc_info::scc_info(scc_and_mark_filter& filt, scc_info_options options);
|
||||
|
||||
%include <spot/twaalgos/sccinfo.hh>
|
||||
%template(scc_info_scc_edges) spot::internal::scc_edges<spot::digraph<spot::twa_graph_state, spot::twa_graph_edge_data> const, spot::internal::keep_all>;
|
||||
%template(scc_info_inner_scc_edges) spot::internal::scc_edges<spot::digraph<spot::twa_graph_state, spot::twa_graph_edge_data> const, spot::internal::keep_inner_scc>;
|
||||
|
|
|
|||
|
|
@ -457,8 +457,15 @@ namespace spot
|
|||
/// This is usually used to prevent some edges from being
|
||||
/// considered as part of cycles, and can additionally restrict
|
||||
/// to exploration to some SCC discovered by another SCC.
|
||||
scc_info(scc_and_mark_filter& filt,
|
||||
scc_info_options options = scc_info_options::ALL);
|
||||
scc_info(scc_and_mark_filter& filt, scc_info_options options);
|
||||
// we separate the two functions so that we can rename
|
||||
// scc_info(x,options) into scc_info_with_options(x,options) in Python.
|
||||
// Otherwrise calling scc_info(aut,options) can be confused with
|
||||
// scc_info(aut,initial_state).
|
||||
scc_info(scc_and_mark_filter& filt)
|
||||
: scc_info(filt, scc_info_options::ALL)
|
||||
{
|
||||
}
|
||||
/// @}
|
||||
|
||||
const_twa_graph_ptr get_aut() const
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ def generic_emptiness2(aut):
|
|||
|
||||
# A more modern python version of spot.generic_emptiness_check()
|
||||
def is_empty1(g):
|
||||
si = spot.scc_info(g, spot.scc_info_options_NONE)
|
||||
si = spot.scc_info_with_options(g, spot.scc_info_options_NONE)
|
||||
for scc_num in range(si.scc_count()):
|
||||
if si.is_trivial(scc_num):
|
||||
continue
|
||||
|
|
@ -207,7 +207,7 @@ def is_scc_empty1(si, scc_num, acc=None):
|
|||
return True
|
||||
|
||||
def is_empty2(g):
|
||||
si = spot.scc_info(g, spot.scc_info_options_STOP_ON_ACC)
|
||||
si = spot.scc_info_with_options(g, spot.scc_info_options_STOP_ON_ACC)
|
||||
if si.one_accepting_scc() >= 0:
|
||||
return False
|
||||
for scc_num in range(si.scc_count()):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue