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:
parent
5c39063588
commit
e42fea09a7
4 changed files with 34 additions and 14 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ namespace spot
|
|||
|
||||
for (const auto& e: si.edges_of(scc))
|
||||
{
|
||||
bool acc{e.acc & scc_infs_alone};
|
||||
bool acc = (e.acc & scc_infs_alone) != 0;
|
||||
res->new_acc_edge(e.src, e.dst, e.cond, acc);
|
||||
}
|
||||
|
||||
|
|
@ -320,6 +320,7 @@ namespace spot
|
|||
|
||||
for (auto r: scc_pairs.fins().sets())
|
||||
{
|
||||
acc_cond::mark_t pairinf = scc_pairs.paired_with_fin(r);
|
||||
unsigned base = res->new_states(states.size());
|
||||
for (auto s: states)
|
||||
state_map[s] = base++;
|
||||
|
|
@ -329,9 +330,7 @@ namespace spot
|
|||
continue;
|
||||
auto src = state_map[e.src];
|
||||
auto dst = state_map[e.dst];
|
||||
bool cacc = fins_alone.has(r)
|
||||
? true
|
||||
: ((scc_pairs.paired_with(r) & e.acc) != 0);
|
||||
bool cacc = fins_alone.has(r) || (pairinf & e.acc) != 0;
|
||||
res->new_acc_edge(src, dst, e.cond, cacc);
|
||||
// We need only one non-deterministic jump per
|
||||
// cycle. As an approximation, we only do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue