postproc: Add an option_map parameter

* src/tgbaalgos/postproc.cc: Add an option_map parameter, and use to get
extra options to pass to the degeneralization algorithm.
* src/tgbaalgos/postproc.hh: Adjust prototype, and store Boolean
variables for degeneralize() options.
* src/bin/ltl2tgba.cc: Add a -x option to fill the option map, and pass
it to the postprocessor.
* src/bin/man/ltl2tgba.x: Document the three degeneralization options.
This commit is contained in:
Alexandre Duret-Lutz 2013-02-01 19:00:31 +01:00
parent 1b2f9fe5d8
commit 05e59a9e1a
4 changed files with 74 additions and 13 deletions

View file

@ -24,6 +24,8 @@
#include "degen.hh"
#include "stats.hh"
#include "stripacc.hh"
#include <cstdlib>
#include "misc/optionmap.hh"
namespace spot
{
@ -41,6 +43,18 @@ namespace spot
return st.states;
}
postprocessor::postprocessor(const option_map* opt)
: type_(TGBA), pref_(Small), level_(High),
degen_reset(true), degen_order(false), degen_cache(true)
{
if (opt)
{
degen_order = opt->get("degen-order", 0);
degen_reset = opt->get("degen-reset", 1);
degen_cache = opt->get("degen-lcache", 1);
}
}
const tgba* postprocessor::run(const tgba* a, const ltl::formula* f)
{
if (type_ == TGBA && pref_ == Any && level_ == Low)
@ -100,7 +114,10 @@ namespace spot
{
if (type_ == BA)
{
const tgba* d = degeneralize(a);
const tgba* d = degeneralize(a,
degen_reset,
degen_order,
degen_cache);
delete a;
a = d;
}
@ -133,7 +150,10 @@ namespace spot
// Degeneralize the result of the simulation if needed.
if (type_ == BA)
{
const tgba* d = degeneralize(sim);
const tgba* d = degeneralize(sim,
degen_reset,
degen_order,
degen_cache);
delete sim;
sim = d;
}