Commit 2604b270 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/tgbaalgos/emptiness_stats.hh (ec_statistics::depth): New function.

* src/tgbaalgos/gtec/gtec.cc (couvreur99_check_shy::clear_todo,
couvreur99_check_shy::check): Count all successors in the
todo stack rather than all items on the stack.
parent addb3a30
......@@ -60,17 +60,17 @@ namespace spot
}
void
inc_depth()
inc_depth(int n = 1)
{
++depth_;
depth_ += n;
if (depth_ > max_depth_)
max_depth_ = depth_;
}
void
dec_depth()
dec_depth(int n = 1)
{
--depth_;
depth_ -= n;
}
int
......@@ -91,6 +91,12 @@ namespace spot
return max_depth_;
}
int
depth() const
{
return depth_;
}
private :
unsigned states_; /// number of disctint visited states
unsigned transitions_; /// number of visited transitions
......
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
......@@ -292,9 +292,10 @@ namespace spot
if (spi.first == 0)
delete q->s;
}
dec_depth(todo.back().q.size());
todo.pop_back();
dec_depth();
}
assert(depth() == 0);
}
emptiness_check_result*
......@@ -316,7 +317,6 @@ namespace spot
int index = todo.back().n;
// Backtrack TODO.
todo.pop_back();
dec_depth();
if (todo.empty())
{
// This automaton recognizes no word.
......@@ -341,6 +341,7 @@ namespace spot
// Pick one successor off the list.
successor succ = queue.front();
queue.pop_front();
dec_depth();
int& n = ecs_->h->index_and_insert(succ.s);
// Skip dead states.
......@@ -373,7 +374,6 @@ namespace spot
ecs_->root.push(num);
arc.push(succ.acc);
todo.push_back(todo_item(succ.s, num));
inc_depth();
succ_queue* new_queue = &todo.back().q;
tgba_succ_iterator* iter = ecs_->aut->succ_iter(succ.s);
succ_queue::iterator merge_end;
......@@ -389,6 +389,7 @@ namespace spot
if (!i)
{
new_queue->push_back(successor(acc, dest));
inc_depth();
continue;
}
// Skip dead states.
......@@ -457,7 +458,6 @@ namespace spot
}
prev->q.splice(prev->q.end(), last->q);
todo.pop_back();
dec_depth();
}
new_queue = &todo.back().q;
}
......@@ -477,6 +477,7 @@ namespace spot
bdd acc = old->acc;
// Delete other states.
new_queue->erase(old);
dec_depth();
// Delete dead states.
if (*i == -1)
continue;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment