translate: use compositional suspension on request

This has to be turned on using "-x comp-susp" and other
related options documented in spot-x (7).

* src/tgbaalgos/translate.hh, src/tgbaalgos/translate.cc:
Add support for calling composition-suspension, with
optional simulation, WDBA-minimization, and composition.
* src/bin/spot-x.cc: Document the new options.
* src/bin/man/spot-x.x: Add some bibliography.
* src/tgbatest/ltlcross2.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2013-04-26 17:43:43 +02:00
parent 88cd376dff
commit b6d4806dca
5 changed files with 93 additions and 14 deletions

View file

@ -19,10 +19,28 @@
#include "translate.hh"
#include "ltl2tgba_fm.hh"
#include "compsusp.hh"
#include "misc/optionmap.hh"
namespace spot
{
void translator::setup_opt(const option_map* opt)
{
comp_susp_ = early_susp_ = skel_wdba_ = skel_simul_ = 0;
if (!opt)
return;
comp_susp_ = opt->get("comp-susp", 0);
if (comp_susp_ == 1)
{
early_susp_ = opt->get("early-susp", 0);
skel_wdba_ = opt->get("skel-wdba", -1);
skel_simul_ = opt->get("skel-simul", 1);
}
}
void translator::build_simplifier(bdd_dict* dict)
{
ltl::ltl_simplifier_options options(false, false, false);
@ -53,8 +71,22 @@ namespace spot
// natural way (improving the degeneralization).
simpl_->clear_as_bdd_cache();
bool exprop = level_ == spot::postprocessor::High;
const tgba* aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop);
const tgba* aut;
if (comp_susp_ > 0)
{
int skel_wdba = skel_wdba_;
if (skel_wdba < 0)
skel_wdba = (pref_ == spot::postprocessor::Deterministic) ? 1 : 2;
aut = compsusp(r, simpl_->get_dict(), skel_wdba == 0,
skel_simul_ == 0, early_susp_ != 0,
comp_susp_ == 2, skel_wdba == 2, false);
}
else
{
bool exprop = level_ == spot::postprocessor::High;
aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop);
}
aut = this->postprocessor::run(aut, r);
return aut;
}

View file

@ -52,18 +52,21 @@ namespace spot
: postprocessor(opt), simpl_(simpl), simpl_owned_(0)
{
assert(simpl);
setup_opt(opt);
}
translator(bdd_dict* dict, const option_map* opt = 0)
: postprocessor(opt)
{
build_simplifier(dict);
setup_opt(opt);
}
translator(const option_map* opt = 0)
: postprocessor(opt)
{
build_simplifier(0);
setup_opt(opt);
}
~translator()
@ -72,8 +75,6 @@ namespace spot
delete simpl_owned_;
}
void build_simplifier(bdd_dict* dict);
typedef postprocessor::output_type output_type;
void
@ -111,10 +112,17 @@ namespace spot
/// the caller.
const tgba* run(const ltl::formula** f);
protected:
void setup_opt(const option_map* opt);
void build_simplifier(bdd_dict* dict);
private:
ltl::ltl_simplifier* simpl_;
ltl::ltl_simplifier* simpl_owned_;
int comp_susp_;
int early_susp_;
int skel_wdba_;
int skel_simul_;
};
/// @}
}