to_tgba: fix handling of CNF with multiple unit clauses

Fixes #313, reported by František Blahoudek.

* spot/twaalgos/totgba.cc (to_generalized_buchi): Fix it.
* tests/core/remfin.test: Test it.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2017-12-22 17:53:30 +01:00
parent 19348c8938
commit 9ec7df670e
3 changed files with 99 additions and 2 deletions

View file

@ -478,7 +478,8 @@ namespace spot
while (pos >= end)
{
auto term_end = pos - 1 - pos->sub.size;
if (pos->sub.op == acc_cond::acc_op::Or)
bool inor = pos->sub.op == acc_cond::acc_op::Or;
if (inor)
--pos;
acc_cond::mark_t m = 0U;
while (pos > term_end)
@ -487,7 +488,11 @@ namespace spot
m |= pos[-1].mark;
pos -= 2;
}
res.emplace_back(m);
if (inor)
res.emplace_back(m);
else
for (unsigned i: m.sets())
res.emplace_back(acc_cond::mark_t({i}));
}
return res;
}