* src/tgbaalgos/ltl2tgba_fm.hh, src/tgbaalgos/ltl2tgba_fm.cc: Add

the reduce_ltl argument.
* src/tgbatest/ltl2tgba.cc: Add options -fr1, -fr2, -fr3, and -fr4.
* src/tgbatest/spotlbtt.test, bench/ltl2tgba/algorithms: Test -fr4.
* bench/ltl2tgba/parseout.pl: Suppress Perl warnings on disabled
algorithms.
This commit is contained in:
Alexandre Duret-Lutz 2005-05-04 13:47:38 +00:00
parent 7ef117e3dc
commit 9063c5abb4
7 changed files with 127 additions and 201 deletions

View file

@ -637,7 +637,8 @@ namespace spot
tgba_explicit*
ltl_to_tgba_fm(const formula* f, bdd_dict* dict,
bool exprop, bool symb_merge, bool branching_postponement,
bool fair_loop_approx, const ltl::atomic_prop_set* unobs)
bool fair_loop_approx, const atomic_prop_set* unobs,
int reduce_ltl)
{
possible_fair_loop_checker pflc;
@ -649,6 +650,14 @@ namespace spot
formula* f2 = negative_normal_form(f1);
destroy(f1);
// Simplify the formula, if requested.
if (reduce_ltl)
{
formula* tmp = reduce(f2, reduce_ltl);
destroy(f2);
f2 = tmp;
}
typedef std::set<const formula*, formula_ptr_less_than> set_type;
set_type formulae_seen;
set_type formulae_to_translate;
@ -675,8 +684,8 @@ namespace spot
if (unobs)
{
bdd neg_events = bddtrue;
std::auto_ptr<ltl::atomic_prop_set> aps(ltl::atomic_prop_collect(f));
for (ltl::atomic_prop_set::const_iterator i = aps->begin();
std::auto_ptr<atomic_prop_set> aps(atomic_prop_collect(f));
for (atomic_prop_set::const_iterator i = aps->begin();
i != aps->end(); ++i)
{
int p = d.register_proposition(*i);
@ -685,7 +694,7 @@ namespace spot
observable_events = (observable_events & neg) | (neg_events & pos);
neg_events &= neg;
}
for (ltl::atomic_prop_set::const_iterator i = unobs->begin();
for (atomic_prop_set::const_iterator i = unobs->begin();
i != unobs->end(); ++i)
{
int p = d.register_proposition(*i);
@ -790,6 +799,17 @@ namespace spot
bdd dest_bdd = bdd_existcomp(cube, d.next_set);
const formula* dest = d.conj_bdd_to_formula(dest_bdd);
// Simplify the formula, if requested.
if (reduce_ltl)
{
formula* tmp = reduce(dest, reduce_ltl);
destroy(dest);
dest = tmp;
// Ignore the arc if the destination reduces to false.
if (dest == constant::false_instance())
continue;
}
// If we already know a state with the same
// successors, use it in lieu of the current one.
if (symb_merge)

View file

@ -25,6 +25,7 @@
#include "ltlast/formula.hh"
#include "tgba/tgbaexplicit.hh"
#include "ltlvisit/apcollect.hh"
#include "ltlvisit/reduce.hh"
namespace spot
{
@ -95,12 +96,36 @@ namespace spot
/// are interpreted as events that exclude each other. The events in the
/// formula are observable events, and \c unobs can be filled with
/// additional unobservable events.
///
/// \param reduce_ltl If this parameter is set, the LTL formulae representing
/// each state of the automaton will be simplified using spot::ltl::reduce()
/// before computing the successor. \a reduce_ltl should specify the type
/// of reduction to apply as documented for spot::ltl::reduce().
/// This idea is taken from the following paper.
/// \verbatim
/// @InProceedings{ thirioux.02.fmics,
/// author = {Xavier Thirioux},
/// title = {Simple and Efficient Translation from {LTL} Formulas to
/// {B\"u}chi Automata},
/// booktitle = {Proceedings of the 7th International ERCIM Workshop in
/// Formal Methods for Industrial Critical Systems (FMICS'02)},
/// series = {Electronic Notes in Theoretical Computer Science},
/// volume = {66(2)},
/// publisher = {Elsevier},
/// editor = {Rance Cleaveland and Hubert Garavel},
/// year = {2002},
/// month = jul,
/// address = {M{\'a}laga, Spain}
/// }
/// \endverbatim
///
/// \return A spot::tgba_explicit that recognizes the language of \a f.
tgba_explicit* ltl_to_tgba_fm(const ltl::formula* f, bdd_dict* dict,
bool exprop = false, bool symb_merge = true,
bool branching_postponement = false,
bool fair_loop_approx = false,
const ltl::atomic_prop_set* unobs = 0);
const ltl::atomic_prop_set* unobs = 0,
int reduce_ltl = ltl::Reduce_None);
}
#endif // SPOT_TGBAALGOS_LTL2TGBA_FM_HH