scc_has_rejecting_cycle: rewrite without copy

* spot/twaalgos/genem.hh, spot/twaalgos/genem.cc
(generic_emptiness_check_for_scc): Add a version that takes an acc.
* spot/twaalgos/isweakscc.cc (scc_has_rejecting_cycle): Use
generic_emptiness_check_for_scc.
This commit is contained in:
Alexandre Duret-Lutz 2019-06-21 22:36:33 +02:00
parent c830b5db25
commit 030ebed367
3 changed files with 25 additions and 17 deletions

View file

@ -75,6 +75,8 @@ namespace spot
else
{
int fo = acc.fin_one();
if (fo < 0)
std::cerr << autacc << acc << '\n';
assert(fo >= 0);
// Try to accept when Fin(fo) == true
acc_cond::mark_t fo_m = {(unsigned) fo};
@ -160,9 +162,16 @@ namespace spot
bool generic_emptiness_check_for_scc(const scc_info& si,
unsigned scc)
{
if (SPOT_UNLIKELY(!si.get_aut()->is_existential()))
throw std::runtime_error("generic_emptiness_check_for_scc() "
"does not support alternating automata");
return is_scc_empty(si, scc, si.get_aut()->acc(), nullptr);
}
bool
generic_emptiness_check_for_scc(const scc_info& si, unsigned scc,
const acc_cond& forced_acc)
{
if (si.is_trivial(scc))
return true;
return scc_split_check(si, scc, forced_acc, nullptr, {});
}
}