scc_info: add ways to speedup scc_info

* spot/twaalgos/sccinfo.hh, spot/twaalgos/sccinfo.cc: Add an optional
argument to abort on accepting SCC, to not keep track of SCC states,
and some one_accepting_scc() method.
* NEWS: Mention it.
* bin/ltlcross.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/cobuchi.cc, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/dtbasat.cc,
spot/twaalgos/dtwasat.cc, spot/twaalgos/isunamb.cc,
spot/twaalgos/powerset.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/sbacc.cc, spot/twaalgos/sccfilter.cc,
spot/twaalgos/totgba.cc: Adjust arguments passed to scc_info.
This commit is contained in:
Alexandre Duret-Lutz 2017-04-11 15:27:49 +02:00
parent 11704d31eb
commit 9ca5b8c2f1
16 changed files with 257 additions and 112 deletions

View file

@ -619,7 +619,10 @@ namespace
st->edges = s.edges;
st->transitions = s.transitions;
st->acc = res->acc().num_sets();
spot::scc_info m(res);
spot::scc_info
m(res, (opt_strength
? spot::scc_info_options::TRACK_STATES
: spot::scc_info_options::NONE));
unsigned c = m.scc_count();
st->scc = c;
st->nondetstates = spot::count_nondet_states(res);
@ -750,16 +753,9 @@ namespace
for (size_t i = 0; i < m; ++i)
if (spot::scc_info* m = maps[i])
{
// r == true iff the automaton i is accepting.
bool r = false;
for (auto& scc: *m)
if (scc.is_accepting())
{
r = true;
break;
}
res[i] = r;
if (r)
bool i_is_accepting = m->one_accepting_scc() >= 0;
res[i] = i_is_accepting;
if (i_is_accepting)
++verified;
else
++violated;
@ -1301,7 +1297,8 @@ namespace
std::cerr << "info: product has " << p->num_states()
<< " st., " << p->num_edges()
<< " ed.\n";
sm = new spot::scc_info(p);
sm = new
spot::scc_info(p, spot::scc_info_options::TRACK_STATES);
}
catch (std::bad_alloc&)
{
@ -1334,7 +1331,8 @@ namespace
std::cerr << "info: product has " << p->num_states()
<< " st., " << p->num_edges()
<< " ed.\n";
sm = new spot::scc_info(p);
sm = new
spot::scc_info(p, spot::scc_info_options::TRACK_STATES);
}
catch (std::bad_alloc&)
{