relabel: do not unregister old AP that are also new
Reported by Ayrat Khalimov against the trans.html page when using ltl3ba. * spot/twaalgos/relabel.cc: Here. * tests/core/ltl3dra.test: Test it. * NEWS: Mention it. * THANKS: Add Ayrat.
This commit is contained in:
parent
91e8493c7f
commit
421a9a1b12
4 changed files with 19 additions and 2 deletions
|
|
@ -27,6 +27,7 @@ namespace spot
|
|||
bddPair* pairs = bdd_newpair();
|
||||
auto d = aut->get_dict();
|
||||
std::vector<int> vars;
|
||||
std::set<int> newvars;
|
||||
vars.reserve(relmap->size());
|
||||
for (auto& p: *relmap)
|
||||
{
|
||||
|
|
@ -34,10 +35,15 @@ namespace spot
|
|||
int newv = aut->register_ap(p.second);
|
||||
bdd_setpair(pairs, oldv, newv);
|
||||
vars.push_back(oldv);
|
||||
newvars.insert(newv);
|
||||
}
|
||||
for (auto& t: aut->edges())
|
||||
t.cond = bdd_replace(t.cond, pairs);
|
||||
// Erase all the old variable that are not reused in the new set.
|
||||
// (E.g., if we relabel a&p0 into p0&p1 we should not unregister
|
||||
// p0)
|
||||
for (auto v: vars)
|
||||
aut->unregister_ap(v);
|
||||
if (newvars.find(v) == newvars.end())
|
||||
aut->unregister_ap(v);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue