game: fix appending strategies bug

When calling solve_parity_game() multiple times on the same
automaton the strategies are appended one after the other.
Reported by Dávid Smolka.

* NEWS: Mention the bug.
* spot/twaalgos/game.cc: Fix it.
* tests/python/game.py: Test it.
* THANKS: Add Dávid.
This commit is contained in:
Philipp Schlehuber-Caissier 2022-11-27 01:16:46 +01:00 committed by Alexandre Duret-Lutz
parent 86c433cf80
commit 37d4e513d9
4 changed files with 20 additions and 0 deletions

View file

@ -227,6 +227,7 @@ namespace spot
region_t &w = *arena->get_or_set_named_prop<region_t>("state-winner");
strategy_t &s = *arena->get_or_set_named_prop<strategy_t>("strategy");
w.swap(w_.winner_);
s.clear();
s.reserve(s_.size());
for (auto as : s_)
s.push_back(as == no_strat_mark ? 0 : (unsigned) as);