postproc: fix monitor code

Fixes #240.

* spot/twaalgos/postproc.cc: Do not call do_simul on the output of
minimize_monitor(), and do not skip complete() when PREF_==Any.
* tests/core/monitor.test: Add a test case.
* NEWS: Mention the bug.
* doc/org/ltl2tgba.org: Document complete monitors.
This commit is contained in:
Alexandre Duret-Lutz 2017-03-03 14:29:10 +01:00
parent cf5d2c2b32
commit 2b9accdf58
4 changed files with 61 additions and 44 deletions

View file

@ -227,20 +227,21 @@ namespace spot
else
strip_acceptance_here(a);
if (PREF_ == Any)
return a;
a = do_simul(a, simul_);
// For Small,High we return the smallest between the output of
// the simulation, and that of the deterministic minimization.
if (PREF_ == Small && level_ == High && simul_)
if (PREF_ != Any)
{
auto m = minimize_monitor(a);
if (m->num_states() < a->num_states())
a = m;
if (PREF_ != Deterministic)
a = do_simul(a, simul_);
// For Small,High we return the smallest between the output of
// the simulation, and that of the deterministic minimization.
if (PREF_ == Small && level_ == High && simul_)
{
auto m = minimize_monitor(a);
if (m->num_states() < a->num_states())
a = m;
}
a->remove_unused_ap();
}
a->remove_unused_ap();
if (COMP_)
a = complete(a);
return a;