iterated_simulation might perform an extra loop?
Reading the code of iterated_simulations_()
I suspect that it's a bug that next
is not initialized to the size of t
, and that it may cause the do
loop to perform two iterations even when the first iteration did not reduce anything.
template<bool Sba>
twa_graph_ptr
iterated_simulations_(const const_twa_graph_ptr& t)
{
twa_graph_ptr res = nullptr;
automaton_size prev;
automaton_size next;
do
{
prev = next;
direct_simulation<false, Sba> simul(res ? res : t);
res = simul.run();
if (res->prop_universal())
break;
direct_simulation<true, Sba> cosimul(res);
res = cosimul.run();
if (Sba)
res = scc_filter_states(res, false);
else
res = scc_filter(res, false);
next.set_size(res);
}
while (prev != next);
return res;
}