* src/tgbaalgos/ndfs_result.hh: Rewrite the computation of accepting

runs.
* src/tgbaalgos/bfssteps.hh, src/tgbaalgos/bfssteps.cc: Add the method
finalize witch compute (by default) the traversed path.
* src/tgbaalgos/magic.cc, src/tgbaalgos/se05.cc: Fix a bug concerning
the heap used for bit state hashing version and ajust the prototype of
has_been_visited and pop_notify.
* src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc: ajust the prototype
of has_been_visited and pop_notify.
This commit is contained in:
Denis Poitrenaud 2004-12-20 10:09:45 +00:00
parent 0c2c12a80f
commit 8dbc9424c1
8 changed files with 525 additions and 253 deletions

View file

@ -19,7 +19,6 @@
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#include <map>
#include <deque>
#include <utility>
#include "tgba/tgba.hh"
@ -37,6 +36,28 @@ namespace spot
{
}
void
bfs_steps::finalize(const std::map<const state*, tgba_run::step,
state_ptr_less_than>& father, const tgba_run::step& s,
const state* start, tgba_run::steps& l)
{
tgba_run::steps p;
tgba_run::step current = s;
for (;;)
{
tgba_run::step tmp = current;
tmp.s = tmp.s->clone();
p.push_front(tmp);
if (current.s == start)
break;
std::map<const state*, tgba_run::step,
state_ptr_less_than>::const_iterator it = father.find(current.s);
assert(it!=father.end());
current = it->second;
}
l.splice(l.end(), p);
}
const state*
bfs_steps::search(const state* start, tgba_run::steps& l)
{
@ -68,19 +89,7 @@ namespace spot
if (match(s, dest))
{
// Found it!
tgba_run::steps p;
for (;;)
{
tgba_run::step tmp = s;
tmp.s = tmp.s->clone();
p.push_front(tmp);
if (s.s == start)
break;
s = father[s.s];
}
l.splice(l.end(), p);
finalize(father, s, start, l);
delete i;
return dest;
}