postproc: add the possibility to output a monitor

* src/tgbaalgos/stripacc.cc, src/tgbaalgos/stripacc.hh: New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbaalgos/postproc.cc, src/tgbaalgos/postproc.hh: Add a Monitor
output option.
* src/bin/ltl2tgba.cc: Add a --monitor/-M option.
* NEWS: Mention monitors.
* src/tgba/tgbaexplicit.hh (is_accepting_state): Fix for the
case where the automaton has no acceptance set.
This commit is contained in:
Alexandre Duret-Lutz 2012-10-20 20:18:01 +02:00
parent 5f6c262ae5
commit 76787b23c0
8 changed files with 169 additions and 15 deletions

View file

@ -23,6 +23,7 @@
#include "sccfilter.hh"
#include "degen.hh"
#include "stats.hh"
#include "stripacc.hh"
namespace spot
{
@ -46,6 +47,49 @@ namespace spot
a = s;
}
if (type_ == Monitor)
{
if (pref_ == Deterministic)
{
const tgba* m = minimize_monitor(a);
delete a;
return m;
}
else
{
const tgba* m = strip_acceptance(a);
delete a;
a = m;
}
if (pref_ == Any)
return a;
const tgba* sim;
if (level_ == Low)
sim = simulation(a);
else
sim = iterated_simulations(a);
if (level_ != High)
{
delete a;
return sim;
}
// For Small,High we return the smallest between the output of
// the simulation, and that of the deterministic minimization.
const tgba* m = minimize_monitor(a);
delete a;
if (count_states(m) > count_states(sim))
{
delete m;
return sim;
}
else
{
delete sim;
return m;
}
}
if (pref_ == Any)
{
if (type_ == BA)