Specialize scc_filter when handling tgba_explicit_formula automata.

If the input is a tgba_explicit_formula we can output a
tgba_explicit_formula too, and we want to do that because it is
more space efficient.

* src/tgba/tgbaexplicit.hh (get_label): New method.
* src/tgbaalgos/sccfilter.cc (create_transition): New function,
to handle tgba_explicit_formula and tgba_explicit_string output
differently.
(filter_iter): Template it on the output tgba type, and adjust
to call create_transition.
(scc_filter): Use filter_iter<tgba_explicit_formula> or
filter_iter<tgba_explicit_string> depending on the input tgba
type.
This commit is contained in:
Alexandre Duret-Lutz 2009-11-23 10:19:38 +01:00
parent dfb9c6622b
commit 81e0872b5d
3 changed files with 94 additions and 14 deletions

View file

@ -181,6 +181,20 @@ namespace spot
return name_state_map_.find(name) != name_state_map_.end();
}
const label& get_label(const tgba_explicit::state* s) const
{
typename sn_map::const_iterator i = state_name_map_.find(s);
assert(i != state_name_map_.end());
return i->second;
}
const label& get_label(const spot::state* s) const
{
const state_explicit* se = dynamic_cast<const state_explicit*>(s);
assert(se);
return get_label(se->get_state());
}
/// Return the tgba_explicit::state for \a name, creating the state if
/// it does not exist.
state* add_state(const label& name)