Better documentation for the cycle enumeration algorithms.

* src/tgbaalgos/cycles.cc, src/tgbaalgos/cycles.hh,
src/tgbaalgos/isweakscc.hh: Improve .doc
* src/tgbaalgos/isweakscc.cc (weak_checker::cycle_found):
Scan the DFS backward so we only look at the cycle part.
This commit is contained in:
Alexandre Duret-Lutz 2012-09-21 11:15:12 +02:00
parent 420fcd62e4
commit 92e37998b2
4 changed files with 112 additions and 67 deletions

View file

@ -27,6 +27,7 @@ namespace spot
{
namespace
{
// Look for a non-accepting cycle.
class weak_checker: public enumerate_cycles
{
public:
@ -40,16 +41,16 @@ namespace spot
virtual bool
cycle_found(const state* start)
{
dfs_stack::const_iterator i = dfs.begin();
dfs_stack::const_reverse_iterator i = dfs_.rbegin();
bdd acc = bddfalse;
while (i->ts->first != start)
++i;
do
for (;;)
{
acc |= i->succ->current_acceptance_conditions();
if (i->ts->first == start)
break;
++i;
assert(i != dfs_.rend());
}
while (i != dfs.end());
if (acc != aut_->all_acceptance_conditions())
{
// We have found an non-accepting cycle, so the SCC is not