parity: don't change_parity to the same acceptance
Follow up to #552. * spot/twaalgos/parity.cc (change_parity): Do not work if the output is supposed to have the same acceptance as the input and 0 or 1 colors.
This commit is contained in:
parent
205df01390
commit
3be62a907c
1 changed files with 12 additions and 0 deletions
|
|
@ -150,8 +150,20 @@ namespace spot
|
||||||
{
|
{
|
||||||
auto new_acc = acc_cond::acc_code::parity(output_max,
|
auto new_acc = acc_cond::acc_code::parity(output_max,
|
||||||
output_odd, num_sets);
|
output_odd, num_sets);
|
||||||
|
// Even if change_kind || change_style, it may be
|
||||||
|
// the case that the new acceptance is the same as the old.
|
||||||
|
// For instance "t" can be both "min even" or "max odd".
|
||||||
|
if (num_sets <= 1 && new_acc == aut->get_acceptance())
|
||||||
|
return aut;
|
||||||
aut->set_acceptance(num_sets, new_acc);
|
aut->set_acceptance(num_sets, new_acc);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (num_sets <= 1)
|
||||||
|
return aut; // Nothing to do
|
||||||
|
}
|
||||||
|
// even if the acceptance is not changed, this code will remove
|
||||||
|
// superfluous colors in case a transition has more than one.
|
||||||
change_acc(aut, old_num_sets, change_kind,
|
change_acc(aut, old_num_sets, change_kind,
|
||||||
change_style, output_max, current_max);
|
change_style, output_max, current_max);
|
||||||
return aut;
|
return aut;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue