acc: make mark_t::operator bool() explicit
This avoids a few conversion problems, and also made the bug of
sbacc (fixed by 37fc948be4) obvious.
Reported by Thomas Medioni.
* spot/twa/acc.hh (mark_t::operator bool): Make it explicit.
* spot/twaalgos/remfin.cc: Adjust.
This commit is contained in:
parent
37fc948be4
commit
cf5d2c2b32
3 changed files with 9 additions and 3 deletions
6
NEWS
6
NEWS
|
|
@ -30,6 +30,12 @@ New in spot 2.3.1.dev (not yet released)
|
||||||
anymore and should be replaced by the newly-introduced --format=%x
|
anymore and should be replaced by the newly-introduced --format=%x
|
||||||
for consistency with tools producing automata.
|
for consistency with tools producing automata.
|
||||||
|
|
||||||
|
Backward-incompatible changes:
|
||||||
|
|
||||||
|
- spot::acc_cond::mark_t::operator bool() has been marked as
|
||||||
|
explicit. The implicit converion to bool (and, via bool, to int)
|
||||||
|
was a source of bugs.
|
||||||
|
|
||||||
|
|
||||||
New in spot 2.3.1 (2017-02-20)
|
New in spot 2.3.1 (2017-02-20)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ namespace spot
|
||||||
return id >= o.id;
|
return id >= o.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator bool() const
|
explicit operator bool() const
|
||||||
{
|
{
|
||||||
return id != 0;
|
return id != 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ namespace spot
|
||||||
i -= f;
|
i -= f;
|
||||||
for (auto s: states)
|
for (auto s: states)
|
||||||
{
|
{
|
||||||
bool acc = aut->state_acc_sets(s) & i;
|
bool acc{aut->state_acc_sets(s) & i};
|
||||||
for (auto& t: aut->out(s))
|
for (auto& t: aut->out(s))
|
||||||
res->new_acc_edge(s, t.dst, t.cond, acc);
|
res->new_acc_edge(s, t.dst, t.cond, acc);
|
||||||
}
|
}
|
||||||
|
|
@ -282,7 +282,7 @@ namespace spot
|
||||||
acc_cond::mark_t acc = aut->state_acc_sets(s);
|
acc_cond::mark_t acc = aut->state_acc_sets(s);
|
||||||
if (acc.has(r))
|
if (acc.has(r))
|
||||||
continue;
|
continue;
|
||||||
bool jacc = acc & inf_alone;
|
bool jacc{acc & inf_alone};
|
||||||
bool cacc = fin_alone.has(r) || acc.has(r + 1);
|
bool cacc = fin_alone.has(r) || acc.has(r + 1);
|
||||||
for (auto& t: aut->out(s))
|
for (auto& t: aut->out(s))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue