cobuchi: nsa_to_nca() takes is_useful_scc() into account

* spot/twaalgos/cobuchi.cc: Add scc_info_options::TRACK_SUCCS in
nsa_to_nca().
* spot/twaalgos/sccinfo.cc: Add scc_info_options::TRACK_SUCCS and
is_useful_scc() in states_on_acc_cycle_of().
This commit is contained in:
Alexandre GBAGUIDI AISSE 2017-12-12 18:57:39 +01:00
parent 81af8359f5
commit 3d5b5be693
2 changed files with 6 additions and 4 deletions

View file

@ -219,7 +219,8 @@ namespace spot
named_states_(named_states), named_states_(named_states),
res_(aug_subset_cons(ref_prod, ref_power, named_states_, pmap_)), res_(aug_subset_cons(ref_prod, ref_power, named_states_, pmap_)),
res_map_(res_->get_named_prop<product_states>("product-states")), res_map_(res_->get_named_prop<product_states>("product-states")),
si_(scc_info(res_, scc_info_options::TRACK_STATES)), si_(scc_info(res_, scc_info_options::TRACK_STATES
| scc_info_options::TRACK_SUCCS)),
nb_states_(res_->num_states()), nb_states_(res_->num_states()),
was_rabin_(was_rabin), was_rabin_(was_rabin),
orig_num_st_(orig_num_st) orig_num_st_(orig_num_st)

View file

@ -559,7 +559,7 @@ namespace spot
std::vector<unsigned>& res, std::vector<unsigned>& res,
std::vector<unsigned>& old) const std::vector<unsigned>& old) const
{ {
if (!is_rejecting_scc(scc)) if (is_useful_scc(scc) && !is_rejecting_scc(scc))
{ {
acc_cond::mark_t all_acc = acc_sets_of(scc); acc_cond::mark_t all_acc = acc_sets_of(scc);
acc_cond::mark_t fin = all_fin & all_acc; acc_cond::mark_t fin = all_fin & all_acc;
@ -584,7 +584,8 @@ namespace spot
for (unsigned i = 0; i < orig_sts->size(); ++i) for (unsigned i = 0; i < orig_sts->size(); ++i)
(*orig_sts)[i] = old[(*orig_sts)[i]]; (*orig_sts)[i] = old[(*orig_sts)[i]];
scc_info si_tmp(aut, scc_info_options::TRACK_STATES); scc_info si_tmp(aut, scc_info_options::TRACK_STATES
| scc_info_options::TRACK_SUCCS);
unsigned scccount_tmp = si_tmp.scc_count(); unsigned scccount_tmp = si_tmp.scc_count();
for (unsigned scc_tmp = 0; scc_tmp < scccount_tmp; ++scc_tmp) for (unsigned scc_tmp = 0; scc_tmp < scccount_tmp; ++scc_tmp)
si_tmp.states_on_acc_cycle_of_rec(scc_tmp, all_fin, all_inf, si_tmp.states_on_acc_cycle_of_rec(scc_tmp, all_fin, all_inf,
@ -608,7 +609,7 @@ namespace spot
unsigned nb_pairs = pairs.size(); unsigned nb_pairs = pairs.size();
std::vector<unsigned> res; std::vector<unsigned> res;
if (!is_rejecting_scc(scc)) if (is_useful_scc(scc) && !is_rejecting_scc(scc))
{ {
std::vector<unsigned> old; std::vector<unsigned> old;
unsigned nb_states = aut_->num_states(); unsigned nb_states = aut_->num_states();