Prefix many algorithms with runtime_error for unexpected acceptance

* src/tgba/tgbagraph.cc (merge_transitions): Disable acceptance
merging if Fin acceptance is used.
* src/tgbaalgos/degen.cc, src/tgbaalgos/dtbasat.cc,
src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/isweakscc.cc,
src/tgbaalgos/lbtt.cc, src/tgbaalgos/minimize.cc,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/safety.cc,
src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc: Throw an
exception if an unsupported type of acceptance is received.
This commit is contained in:
Alexandre Duret-Lutz 2015-02-25 22:59:33 +01:00
parent da2ccdb2ed
commit f0b1b9438f
11 changed files with 52 additions and 7 deletions

View file

@ -67,6 +67,10 @@ namespace spot
bool
is_inherently_weak_scc(scc_info& map, unsigned scc)
{
if (!map.get_aut()->acc().uses_fin_acceptance())
throw std::runtime_error
("is_inherently_weak_scc() cannot work with Fin acceptance");
// If no cycle is accepting, the SCC is weak.
if (!map.is_accepting_scc(scc))
return true;
@ -81,7 +85,8 @@ namespace spot
is_weak_scc(scc_info& map, unsigned scc)
{
// If no cycle is accepting, the SCC is weak.
if (!map.is_accepting_scc(scc))
if (!map.is_accepting_scc(scc)
&& !map.get_aut()->acc().uses_fin_acceptance())
return true;
// If all transitions use the same acceptance set, the SCC is weak.
return map.used_acc_of(scc).size() == 1;