* src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gtec/gtec.hh:

(couvreur99_check_shy_ssp): Add a onepass_ attribute to
disable the "shyness", and do not increment pos before calling
find_state since gspn's implementation uses it.
* iface/gspn/ssp.cc: Enable "onepass_" for all "shy" variants,
and also fix find_state for the case where onepass_ is
disabled (but I do not yet know why the latter fix isn't enough).
This commit is contained in:
Alexandre Duret-Lutz 2006-04-05 09:24:39 +00:00
parent 644b74f8c0
commit 983d12cc5a
4 changed files with 38 additions and 4 deletions

View file

@ -322,6 +322,7 @@ namespace spot
group_ = o.get("group", 1);
group2_ = o.get("group2", 0);
group_ |= group2_;
onepass_ = o.get("onepass", 0);
// Setup depth-first search from the initial state.
const state* i = ecs_->aut->get_init_state();
@ -364,7 +365,7 @@ namespace spot
couvreur99_check_shy::check()
{
// Position in the loop seeking known successors.
succ_queue::iterator pos = todo.back().q.begin();
pos = todo.back().q.begin();
for (;;)
{
@ -429,13 +430,18 @@ namespace spot
// which state we are considering. Otherwise just pick the
// first one.
succ_queue::iterator old;
if (onepass_)
pos = queue.end();
if (pos == queue.end())
old = queue.begin();
else
old = pos++;
old = pos;
successor succ = *old;
// Beware: the implementation of find_state in ifage/gspn/ssp.cc
// uses POS and modify QUEUE.
numbered_state_heap::state_index_p sip = find_state(succ.s);
if (pos != queue.end())
++pos;
int* i = sip.second;
if (!i)

View file

@ -221,6 +221,9 @@ namespace spot
// (ACCEPTANCE_CONDITIONS, STATE) pairs.
typedef std::list<successor> succ_queue;
// Position in the loop seeking known successors.
succ_queue::iterator pos;
struct todo_item
{
const state* s;
@ -239,6 +242,10 @@ namespace spot
// If the "group2" option is set (it implies "group"), we
// reprocess the successor states of SCC that have been merged.
bool group2_;
// If the onepass option is true, do only one pass. This cancels
// all the "shyness" of the algorithm, but we need the framework
// of the implementation when working with GreatSPN.
bool onepass_;
/// \brief find the SCC number of a unprocessed state.
///