* src/tgbaalgos/gtec/gtec.cc: Add a third level hash, to split
each container into lists of states with identical formula states.
This commit is contained in:
parent
afd4ea0eb4
commit
644b74f8c0
2 changed files with 85 additions and 64 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2006-02-15 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
* src/tgbaalgos/gtec/gtec.cc: Add a third level hash, to split
|
||||
each container into lists of states with identical formula states.
|
||||
|
||||
* iface/gspn/ltlgspn.cc, src/tgbaalgos/gtec/gtec.cc,
|
||||
src/tgbaalgos/gtec/gtec.hh: New option (-e6) to disable
|
||||
inclusion check in the stack.
|
||||
|
|
|
|||
|
|
@ -670,12 +670,15 @@ namespace spot
|
|||
virtual numbered_state_heap::state_index
|
||||
find(const state* s) const
|
||||
{
|
||||
const void* cont =
|
||||
container_(dynamic_cast<const state_gspn_ssp*>(s)->left());
|
||||
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
|
||||
const void* cont = container_(s_->left());
|
||||
contained_map::const_iterator i = contained.find(cont);
|
||||
if (i != contained.end())
|
||||
{
|
||||
const state_list& l = i->second;
|
||||
f_map::const_iterator k = i->second.find(s_->right());
|
||||
if (k != i->second.end())
|
||||
{
|
||||
const state_list& l = k->second;
|
||||
|
||||
state_list::const_iterator j;
|
||||
for (j = l.begin(); j != l.end(); ++j)
|
||||
|
|
@ -687,8 +690,6 @@ namespace spot
|
|||
assert(old_state);
|
||||
assert(new_state);
|
||||
|
||||
if ((old_state->right())->compare(new_state->right()) == 0)
|
||||
{
|
||||
if (old_state->left() == new_state->left())
|
||||
break;
|
||||
|
||||
|
|
@ -697,7 +698,6 @@ namespace spot
|
|||
&& spot_inclusion(new_state->left(), old_state->left()))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j != l.end())
|
||||
{
|
||||
if (s != *j)
|
||||
|
|
@ -715,6 +715,11 @@ namespace spot
|
|||
{
|
||||
s = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s = 0;
|
||||
}
|
||||
|
||||
state_index res;
|
||||
|
||||
|
|
@ -737,12 +742,15 @@ namespace spot
|
|||
virtual numbered_state_heap::state_index_p
|
||||
find(const state* s)
|
||||
{
|
||||
const void* cont =
|
||||
container_(dynamic_cast<const state_gspn_ssp*>(s)->left());
|
||||
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
|
||||
const void* cont = container_(s_->left());
|
||||
contained_map::const_iterator i = contained.find(cont);
|
||||
if (i != contained.end())
|
||||
{
|
||||
const state_list& l = i->second;
|
||||
f_map::const_iterator k = i->second.find(s_->right());
|
||||
if (k != i->second.end())
|
||||
{
|
||||
const state_list& l = k->second;
|
||||
|
||||
state_list::const_iterator j;
|
||||
for (j = l.begin(); j != l.end(); ++j)
|
||||
|
|
@ -754,8 +762,6 @@ namespace spot
|
|||
assert(old_state);
|
||||
assert(new_state);
|
||||
|
||||
if ((old_state->right())->compare(new_state->right()) == 0)
|
||||
{
|
||||
if (old_state->left() == new_state->left())
|
||||
break;
|
||||
|
||||
|
|
@ -764,7 +770,6 @@ namespace spot
|
|||
&& spot_inclusion(new_state->left(), old_state->left()))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j != l.end())
|
||||
{
|
||||
if (s != *j)
|
||||
|
|
@ -782,6 +787,11 @@ namespace spot
|
|||
{
|
||||
s = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s = 0;
|
||||
}
|
||||
|
||||
state_index_p res;
|
||||
|
||||
|
|
@ -848,11 +858,12 @@ namespace spot
|
|||
{
|
||||
h[s] = index;
|
||||
|
||||
State sg = dynamic_cast<const state_gspn_ssp*>(s)->left();
|
||||
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
|
||||
State sg = s_->left();
|
||||
if (sg)
|
||||
{
|
||||
const void* cont = container_(sg);
|
||||
contained[cont].push_front(s);
|
||||
contained[cont][s_->right()].push_front(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -870,7 +881,9 @@ namespace spot
|
|||
hash_type h; ///< Map of visited states.
|
||||
|
||||
typedef std::list<const state*> state_list;
|
||||
typedef Sgi::hash_map<const void*, state_list,
|
||||
typedef Sgi::hash_map<const state*, state_list,
|
||||
state_ptr_hash, state_ptr_equal> f_map;
|
||||
typedef Sgi::hash_map<const void*, f_map,
|
||||
ptr_hash<void> > contained_map;
|
||||
contained_map contained;
|
||||
|
||||
|
|
@ -1025,16 +1038,20 @@ namespace spot
|
|||
typedef numbered_state_heap_ssp_semi::hash_type hash_type;
|
||||
hash_type& h = dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->h;
|
||||
typedef numbered_state_heap_ssp_semi::contained_map contained_map;
|
||||
typedef numbered_state_heap_ssp_semi::f_map f_map;
|
||||
typedef numbered_state_heap_ssp_semi::state_list state_list;
|
||||
const contained_map& contained =
|
||||
dynamic_cast<numbered_state_heap_ssp_semi*>(ecs_->h)->contained;
|
||||
|
||||
const void* cont =
|
||||
container_(dynamic_cast<const state_gspn_ssp*>(s)->left());
|
||||
const state_gspn_ssp* s_ = dynamic_cast<const state_gspn_ssp*>(s);
|
||||
const void* cont = container_(s_->left());
|
||||
contained_map::const_iterator i = contained.find(cont);
|
||||
if (i != contained.end())
|
||||
{
|
||||
const state_list& l = i->second;
|
||||
f_map::const_iterator k = i->second.find(s_->right());
|
||||
if (k != i->second.end())
|
||||
{
|
||||
const state_list& l = k->second;
|
||||
state_list::const_iterator j;
|
||||
|
||||
for (j = l.begin(); j != l.end(); ++j)
|
||||
|
|
@ -1046,8 +1063,6 @@ namespace spot
|
|||
assert(old_state);
|
||||
assert(new_state);
|
||||
|
||||
if ((old_state->right())->compare(new_state->right()) == 0)
|
||||
{
|
||||
if (old_state->left() == new_state->left())
|
||||
break;
|
||||
|
||||
|
|
@ -1096,8 +1111,6 @@ namespace spot
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (j != l.end())
|
||||
{
|
||||
if (s != *j)
|
||||
|
|
@ -1115,6 +1128,11 @@ namespace spot
|
|||
{
|
||||
s = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s = 0;
|
||||
}
|
||||
|
||||
// s points to the resulting state, or to 0 if we didn't find
|
||||
// the state in the list.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue