fix tra_to_tba()

Fixes #324, reported by Tobias Meggendorfer and František Blahoudek.

* spot/twa/acc.hh (rs_pairs_view::paired_with): Rename as...
(rs_pairs_view::paired_with_fin):... this and adjust the code.
* spot/twaalgos/remfin.cc: Use paired_with_fin instead of
paired_with, and do it once per pair.
* tests/core/remfin.test: Add a test case.
* NEWS: Mention the issue.
This commit is contained in:
Alexandre Duret-Lutz 2018-02-16 18:12:42 +01:00
parent 5c39063588
commit e42fea09a7
4 changed files with 34 additions and 14 deletions

View file

@ -1397,19 +1397,12 @@ namespace spot
});
}
acc_cond::mark_t paired_with(unsigned mark) const
acc_cond::mark_t paired_with_fin(unsigned mark) const
{
acc_cond::mark_t res = 0U;
for (const auto& p: pairs_)
{
if (visible(p.fin) && visible(p.inf))
{
if (p.fin.has(mark))
res |= p.inf;
if (p.inf.has(mark))
res |= p.fin;
}
}
if (p.fin.has(mark) && visible(p.fin) && visible(p.inf))
res |= p.inf;
return res;
}