bdddict: add an unregister_all_typed_variables() method
* src/tgba/bdddict.cc, src/tgba/bdddict.hh (unregister_all_typed_variables): New method. * src/tgbaalgos/degen.cc (degeneralize): Use it. * NEWS: Mention it.
This commit is contained in:
parent
0c7c933805
commit
b4670f85f1
4 changed files with 25 additions and 2 deletions
4
NEWS
4
NEWS
|
|
@ -42,6 +42,10 @@ New in spot 1.1a (not yet released):
|
||||||
- ltlcross has a new option --seed, that makes it possible to
|
- ltlcross has a new option --seed, that makes it possible to
|
||||||
change the seed used by the random graph generator.
|
change the seed used by the random graph generator.
|
||||||
|
|
||||||
|
- bdd_dict::unregister_all_typed_variables() is a new function,
|
||||||
|
making it easy to unregister all BDD variables of a given type
|
||||||
|
owned by some object.
|
||||||
|
|
||||||
* Bug fixes:
|
* Bug fixes:
|
||||||
|
|
||||||
- genltl --gh-r generated the wrong formulas due to a typo.
|
- genltl --gh-r generated the wrong formulas due to a typo.
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,7 @@ namespace spot
|
||||||
assert(unsigned(v) < bdd_map.size());
|
assert(unsigned(v) < bdd_map.size());
|
||||||
|
|
||||||
ref_set& s = bdd_map[v].refs;
|
ref_set& s = bdd_map[v].refs;
|
||||||
|
// If the variable is not owned by me, ignore it.
|
||||||
ref_set::iterator si = s.find(me);
|
ref_set::iterator si = s.find(me);
|
||||||
if (si == s.end())
|
if (si == s.end())
|
||||||
return;
|
return;
|
||||||
|
|
@ -314,6 +315,17 @@ namespace spot
|
||||||
free_anonymous_list_of.erase(me);
|
free_anonymous_list_of.erase(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bdd_dict::unregister_all_typed_variables(var_type type, const void* me)
|
||||||
|
{
|
||||||
|
unsigned s = bdd_map.size();
|
||||||
|
for (unsigned i = 0; i < s; ++i)
|
||||||
|
if (bdd_map[i].type == type)
|
||||||
|
unregister_variable(i, me);
|
||||||
|
if (type == anon)
|
||||||
|
free_anonymous_list_of.erase(me);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
bdd_dict::is_registered_proposition(const ltl::formula* f, const void* by_me)
|
bdd_dict::is_registered_proposition(const ltl::formula* f, const void* by_me)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,10 @@ namespace spot
|
||||||
/// Usually called in the destructor if \a me.
|
/// Usually called in the destructor if \a me.
|
||||||
void unregister_all_my_variables(const void* me);
|
void unregister_all_my_variables(const void* me);
|
||||||
|
|
||||||
|
/// \brief Release all variables of a given type, used by an
|
||||||
|
/// object.
|
||||||
|
void unregister_all_typed_variables(var_type type, const void* me);
|
||||||
|
|
||||||
/// \brief Release a variable used by \a me.
|
/// \brief Release a variable used by \a me.
|
||||||
void unregister_variable(int var, const void* me);
|
void unregister_variable(int var, const void* me);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -243,10 +243,13 @@ namespace spot
|
||||||
|
|
||||||
bdd_dict* dict = a->get_dict();
|
bdd_dict* dict = a->get_dict();
|
||||||
|
|
||||||
// The result (degeneralized) automaton uses numbered state.
|
// The result (degeneralized) automaton uses numbered states.
|
||||||
sba_explicit_number* res = new sba_explicit_number(dict);
|
sba_explicit_number* res = new sba_explicit_number(dict);
|
||||||
|
|
||||||
|
// We use the same BDD variables as the input, except for the
|
||||||
|
// acceptance.
|
||||||
dict->register_all_variables_of(a, res);
|
dict->register_all_variables_of(a, res);
|
||||||
// FIXME: unregister acceptance conditions.
|
dict->unregister_all_typed_variables(bdd_dict::acc, res);
|
||||||
|
|
||||||
// Invent a new acceptance set for the degeneralized automaton.
|
// Invent a new acceptance set for the degeneralized automaton.
|
||||||
int accvar =
|
int accvar =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue