simplify_acc: loop over the simplifications

* spot/twaalgos/cleanacc.cc (simplify_acceptance_here): Run the
simplifications in a loop until the condition does not change anymore.
* tests/python/simplacc.py, tests/core/accsimpl.test,
tests/core/remfin.test, tests/python/merge.py,
tests/python/simplacc.py, tests/python/toparity.py: Update expected
results.
* tests/python/automata.ipynb: Update the failing example to a more
interesting one, matching the one in doc/org/autfilt.org.
This commit is contained in:
Alexandre Duret-Lutz 2020-04-16 22:53:09 +02:00
parent b62e1bb13c
commit 102ef04364
7 changed files with 1516 additions and 1209 deletions

View file

@ -617,20 +617,20 @@ namespace spot
twa_graph_ptr simplify_acceptance_here(twa_graph_ptr aut)
{
cleanup_acceptance_here(aut, false);
merge_identical_marks_here(aut);
if (!aut->acc().is_generalized_buchi())
for (;;)
{
cleanup_acceptance_here(aut, false);
merge_identical_marks_here(aut);
if (aut->acc().is_generalized_buchi())
break;
acc_cond::acc_code old = aut->get_acceptance();
simplify_complementary_marks_here(aut);
fuse_marks_here(aut);
aut->set_acceptance(aut->acc().unit_propagation());
if (old == aut->get_acceptance())
break;
}
cleanup_acceptance_here(aut, true);
auto prop_cond = aut->acc().unit_propagation();
if (prop_cond != aut->acc())
{
aut->set_acceptance(prop_cond);
cleanup_acceptance_here(aut, true);
}
return aut;
}