twa: do not set prop_state_acc in set_acceptance

Reported by Juraj Major.

* spot/twa/twa.hh: check num_sets() in prop_state_acc() so we do not
have to set it in set_acceptance(), causing trouble if set_acceptance()
is called multiple times.
* tests/python/setacc.py: New test case.
* tests/Makefile.am: Add it.
* THANKS: Add Juraj.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2016-11-11 14:05:58 +01:00
parent a70589fe13
commit dd706d7847
5 changed files with 34 additions and 7 deletions

View file

@ -879,17 +879,12 @@ namespace spot
{
set_num_sets_(num);
acc_.set_acceptance(c);
if (num == 0)
prop_state_acc(true);
}
/// Copy the acceptance condition of another TωA.
void copy_acceptance_of(const const_twa_ptr& a)
{
acc_ = a->acc();
unsigned num = acc_.num_sets();
if (num == 0)
prop_state_acc(true);
}
/// Copy the atomic propositions of another TωA
@ -915,8 +910,6 @@ namespace spot
{
set_num_sets_(num);
acc_.set_generalized_buchi();
if (num == 0)
prop_state_acc(true);
}
/// \brief Set Büchi acceptance.
@ -1092,6 +1085,8 @@ namespace spot
/// the acceptance set.
trival prop_state_acc() const
{
if (num_sets() == 0)
return true;
return is.state_based_acc;
}