diff --git a/NEWS b/NEWS index 8c30267bf..a7cb523ec 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,20 @@ New in spot 2.4.0.dev (not yet released) --ms-phi-r=RANGE (FGa{n}&GFb{n})|((FGa{n-1}|GFb{n-1})&(...)) --ms-phi-s=RANGE (FGa{n}|GFb{n})&((FGa{n-1}&GFb{n-1})|(...)) + Library: + + - Rename three methods of spot::scc_info. New names are clearer. The + old names have been deprecated. + + Deprecation notices: + + (These functions still work but compilers emit warnings.) + + - spot::scc_info::used_acc(), spot::scc_info::used_acc_of() and + spot::scc_info::acc() are deprecated. They have been renamed + spot::scc_info::marks(), spot::scc_info::marks_of() and + spot::scc_info::acc_sets_of() respectively. + New in spot 2.4 (2017-09-06) Build: @@ -285,23 +299,23 @@ New in spot 2.4 (2017-09-06) from 9 to 16 colors. While the first 8 colors are similar, they are a bit more saturated now. - Deprecation notices: + deprecation notices: - (These functions still work but compilers emit warnings.) + (these functions still work but compilers emit warnings.) - spot::decompose_strength() is deprecated, it has been renamed to spot::decompose_scc(). - - spot::dtwa_complement() is deprecated. Prefer the more generic + - spot::dtwa_complement() is deprecated. prefer the more generic spot::dualize() instead. - - The spot::twa::prop_deterministic() methods have been renamed to + - the spot::twa::prop_deterministic() methods have been renamed to spot::twa::prop_universal() for consistency with the change to - is_deterministic() listed above. We have kept + is_deterministic() listed above. we have kept spot::twa::prop_deterministic() as a deprecated synonym for spot::twa::prop_universal() to help backward compatibility. - - The spot::copy() function is deprecated. Use + - the spot::copy() function is deprecated. use spot::make_twa_graph() instead. New in spot 2.3.5 (2017-06-22) diff --git a/spot/twaalgos/dtwasat.cc b/spot/twaalgos/dtwasat.cc index 71a5cd9c1..7a8f87ad5 100644 --- a/spot/twaalgos/dtwasat.cc +++ b/spot/twaalgos/dtwasat.cc @@ -400,7 +400,7 @@ namespace spot d.is_weak_scc = sm.weak_sccs(); unsigned scccount = sm.scc_count(); { - auto tmp = sm.used_acc(); + auto tmp = sm.marks(); d.scc_marks.reserve(scccount); for (auto& v: tmp) { diff --git a/spot/twaalgos/isweakscc.cc b/spot/twaalgos/isweakscc.cc index 02d22a4f3..5bd292e5e 100644 --- a/spot/twaalgos/isweakscc.cc +++ b/spot/twaalgos/isweakscc.cc @@ -74,7 +74,7 @@ namespace spot if (map.is_rejecting_scc(scc)) return true; // If all transitions use the same acceptance set, the SCC is weak. - return map.used_acc_of(scc).size() == 1; + return map.marks_of(scc).size() == 1; } bool @@ -117,7 +117,7 @@ namespace spot // If all transitions use all acceptance conditions, the SCC is weak. return (map.is_accepting_scc(scc) - && map.used_acc_of(scc).size() == 1 + && map.marks_of(scc).size() == 1 && is_complete_scc(map, scc)); } } diff --git a/spot/twaalgos/remfin.cc b/spot/twaalgos/remfin.cc index a803954ed..fc9a9349d 100644 --- a/spot/twaalgos/remfin.cc +++ b/spot/twaalgos/remfin.cc @@ -309,7 +309,7 @@ namespace spot // The main copy is only accepting for inf_alone // and for all Inf sets that have no matching Fin // sets in this SCC. - auto scc_pairs = rs_pairs_view(pairs, si.acc(scc)); + auto scc_pairs = rs_pairs_view(pairs, si.acc_sets_of(scc)); auto scc_infs_alone = scc_pairs.infs_alone(); for (const auto& e: si.edges_of(scc)) @@ -676,7 +676,7 @@ namespace spot std::vector state_map(nst); for (unsigned n = 0; n < nscc; ++n) { - auto m = si.acc(n); + auto m = si.acc_sets_of(n); auto states = si.states_of(n); trace << "SCC #" << n << " uses " << m << '\n'; diff --git a/spot/twaalgos/sccfilter.cc b/spot/twaalgos/sccfilter.cc index 1a354aed8..80b084528 100644 --- a/spot/twaalgos/sccfilter.cc +++ b/spot/twaalgos/sccfilter.cc @@ -223,7 +223,7 @@ namespace spot "generalized Büchi acceptance"); unsigned scc_count = this->si->scc_count(); - auto used_acc = this->si->used_acc(); + auto used_acc = this->si->marks(); assert(used_acc.size() == scc_count); strip_.resize(scc_count); std::vector cnt(scc_count); // # of useful sets in each SCC diff --git a/spot/twaalgos/sccinfo.cc b/spot/twaalgos/sccinfo.cc index eda86b5b8..54fd09b9c 100644 --- a/spot/twaalgos/sccinfo.cc +++ b/spot/twaalgos/sccinfo.cc @@ -318,7 +318,7 @@ namespace spot } - std::set scc_info::used_acc_of(unsigned scc) const + std::set scc_info::marks_of(unsigned scc) const { std::set res; for (auto& t: inner_edges_of(scc)) @@ -326,7 +326,7 @@ namespace spot return res; } - std::vector> scc_info::used_acc() const + std::vector> scc_info::marks() const { unsigned n = aut_->num_states(); std::vector> result(scc_count()); @@ -351,7 +351,7 @@ namespace spot { unsigned n = scc_count(); std::vector result(scc_count()); - auto acc = used_acc(); + auto acc = marks(); for (unsigned s = 0; s < n; ++s) result[s] = is_rejecting_scc(s) || acc[s].size() == 1; return result; @@ -413,7 +413,8 @@ namespace spot q.pop(); out << " " << state << " [shape=box," - << (aut->acc().accepting(m->acc(state)) ? "style=bold," : "") + << (aut->acc().accepting(m->acc_sets_of(state)) ? + "style=bold," : "") << "label=\"" << state; { size_t n = m->states_of(state).size(); diff --git a/spot/twaalgos/sccinfo.hh b/spot/twaalgos/sccinfo.hh index 0b2d18e37..91f90ac2f 100644 --- a/spot/twaalgos/sccinfo.hh +++ b/spot/twaalgos/sccinfo.hh @@ -476,9 +476,10 @@ namespace spot return node(scc).is_trivial(); } + SPOT_DEPRECATED("use acc_sets_of() instead") acc_cond::mark_t acc(unsigned scc) const { - return node(scc).acc_marks(); + return acc_sets_of(scc); } bool is_accepting_scc(unsigned scc) const @@ -505,20 +506,33 @@ namespace spot return reachable_state(st) && node(scc_of(st)).is_useful(); } - /// \brief Return the set of all used acceptance combinations, for - /// each accepting SCC. - std::vector> used_acc() const; + /// \brief Returns, for each accepting SCC, the set of all marks appearing + /// in it. + std::vector> marks() const; + std::set marks_of(unsigned scc) const; - std::set used_acc_of(unsigned scc) const; - - /// sets that contain at least one transition of the SCC - acc_cond::mark_t acc_sets_of(unsigned scc) const + // Same as above, with old names. + SPOT_DEPRECATED("use marks() instead") + std::vector> used_acc() const { - // FIXME: Why do we have two name for this method? - return acc(scc); + return marks(); + } + SPOT_DEPRECATED("use marks_of() instead") + std::set used_acc_of(unsigned scc) const + { + return marks_of(scc); } - /// sets that contain the entire SCC + /// \brief Returns, for a given SCC, the set of all colors appearing in it. + /// It is the set of colors that appear in some mark among those returned by + /// marks_of(). + acc_cond::mark_t acc_sets_of(unsigned scc) const + { + return node(scc).acc_marks(); + } + + /// Returns, for a given SCC, the set of colors that appear on all of its + /// transitions. acc_cond::mark_t common_sets_of(unsigned scc) const { return node(scc).common_marks();