Commit 8c454f9d authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

FM: use a vector to store the Next BDD->formula map.

* src/tgbaalgos/ltl2tgba_fm.cc: Here.
parent 191fa370
...@@ -168,7 +168,7 @@ namespace spot ...@@ -168,7 +168,7 @@ namespace spot
mark_tools mt; mark_tools mt;
typedef bdd_dict::fv_map fv_map; typedef bdd_dict::fv_map fv_map;
typedef bdd_dict::vf_map vf_map; typedef std::vector<const formula*> vf_map;
fv_map next_map; ///< Maps "Next" variables to BDD variables fv_map next_map; ///< Maps "Next" variables to BDD variables
vf_map next_formula_map; ///< Maps BDD variables to "Next" variables vf_map next_formula_map; ///< Maps BDD variables to "Next" variables
...@@ -256,6 +256,7 @@ namespace spot ...@@ -256,6 +256,7 @@ namespace spot
f = f->clone(); f = f->clone();
num = dict->register_anonymous_variables(1, this); num = dict->register_anonymous_variables(1, this);
next_map[f] = num; next_map[f] = num;
next_formula_map.resize(bdd_varnum());
next_formula_map[num] = f; next_formula_map[num] = f;
} }
next_set &= bdd_ithvar(num); next_set &= bdd_ithvar(num);
...@@ -280,13 +281,16 @@ namespace spot ...@@ -280,13 +281,16 @@ namespace spot
const formula* const formula*
var_to_formula(int var) const var_to_formula(int var) const
{ {
vf_map::const_iterator isi = next_formula_map.find(var);
if (isi != next_formula_map.end())
return isi->second->clone();
const bdd_dict::bdd_info& i = dict->bdd_map[var]; const bdd_dict::bdd_info& i = dict->bdd_map[var];
if (i.type != bdd_dict::anon)
{
assert(i.type == bdd_dict::acc || i.type == bdd_dict::var); assert(i.type == bdd_dict::acc || i.type == bdd_dict::var);
return i.f->clone(); return i.f->clone();
} }
const formula* f = next_formula_map[var];
assert(f);
return f->clone();
}
bdd bdd
boolean_to_bdd(const formula* f) boolean_to_bdd(const formula* f)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment