strength: fix is_terminal()

Fix #198.  Reported by Maximilien Colange.

* spot/twaalgos/strength.cc (is_terminal): Test that no accepting
transition lead to a rejecting SCC.
* tests/core/strength.test: Add test case.
* spot/twaalgos/strength.hh, spot/twa/twa.hh, doc/org/concepts.org:
Adjust documentation.
* NEWS: Mention the fix.
This commit is contained in:
Alexandre Duret-Lutz 2016-11-28 16:19:05 +01:00
parent 2fbc75f439
commit 9bc978a90f
6 changed files with 133 additions and 15 deletions

View file

@ -79,6 +79,17 @@ namespace spot
break;
}
}
// A terminal automaton should accept any word that as a prefix
// leading to an accepting edge. In other words, we cannot have
// an accepting edge that goes into a rejecting SCC.
if (terminal && is_term)
for (auto& e: aut->edges())
if (si->is_rejecting_scc(si->scc_of(e.dst))
&& aut->acc().accepting(e.acc))
{
is_term = false;
break;
}
exit:
if (need_si)
delete si;