Commit e3b5119f authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

degen: return input if it is already degeneralized

* src/tgbaalgos/degen.cc (degeneralize, degeneralize_tba): Shortcut
degeneralization if the automaton is already degeneralized.
parent bf6c9067
......@@ -622,6 +622,12 @@ namespace spot
bool use_z_lvl, bool use_cust_acc_orders,
int use_lvl_cache, bool skip_levels)
{
// If this already a degeneralized digraph, there is nothing we
// can improve.
if (auto d = std::dynamic_pointer_cast<const tgba_digraph>(a))
if (d->get_bprop(tgba_digraph::SBA))
return std::const_pointer_cast<tgba_digraph>(d);
return degeneralize_aux<true>(a, use_z_lvl, use_cust_acc_orders,
use_lvl_cache, skip_levels);
}
......@@ -631,6 +637,12 @@ namespace spot
bool use_z_lvl, bool use_cust_acc_orders,
int use_lvl_cache, bool skip_levels)
{
// If this already a degeneralized digraph, there is nothing we
// can improve.
if (auto d = std::dynamic_pointer_cast<const tgba_digraph>(a))
if (d->get_bprop(tgba_digraph::SingleAccSet))
return std::const_pointer_cast<tgba_digraph>(d);
return degeneralize_aux<false>(a, use_z_lvl, use_cust_acc_orders,
use_lvl_cache, skip_levels);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment