to_weak_alternating(): fixes a bug on generalized co-Büchi automata

Fixes #278. Also adds a test ensuring non-regression.

* spot/twaalgos/toweak.cc: Fixes the bug.
* tests/python/toweak.py: Add a test case.
This commit is contained in:
Thomas Medioni 2017-08-16 17:06:09 +02:00
parent df04c715cf
commit 4b5606e742
2 changed files with 51 additions and 2 deletions

View file

@ -121,10 +121,11 @@ namespace spot
int curr = static_cast<int>(rank);
// We must always be able to go to the previous even rank
int lower = less_ ? ((curr - 1) & ~1) : 0;
for (int i = curr; i >= lower; --i)
for (int i = curr, start_set = st.mark.min_set() - 1;
i >= lower; --i, start_set = 0)
{
if (i % 2)
for (unsigned m = 0; m < numsets_; ++m)
for (unsigned m = start_set; m < numsets_; ++m)
levels |= state_to_var_[new_state(d, i, {m})];
else
levels |= state_to_var_[new_state(d, i, 0U)];