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

@ -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