Deprecate reduce() in favor of ltl_simplifier.

* src/ltlvisit/reduce.hh: Mark the file as obsolete.
(reduce): Declare this function as obsolete.
* src/ltlvisit/reduce.cc: Define SKIP_DEPRECATED_WARNING
so we can include reduce.hh.
* src/sanity/includes.test: Also use SKIP_DEPRECATED_WARNING
when compiling headers.
* iface/dve2/dve2check.cc,
src/ltltest/equals.cc, src/ltltest/randltl.cc,
src/ltltest/reduc.cc, src/tgbaalgos/ltl2tgba_fm.hh,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbatest/randtgba.cc,
wrap/python/ajax/spot.in, wrap/python/spot.i: Adjust
to use ltl_simplifier.
* src/tgbatest/ltl2tgba.cc: Adjust to use ltl_simplifier,
and replace -fr1...-fr7 options by a single -fr option.
* src/tgbatest/spotlbtt.test: Adjust -fr flags accordingly.
* src/tgbatest/reductgba.cc: Do not include reduce.hh.
This commit is contained in:
Alexandre Duret-Lutz 2011-08-24 19:16:15 +02:00
parent c0085a8f30
commit 67f4e8b5ce
15 changed files with 367 additions and 166 deletions

View file

@ -27,7 +27,6 @@
#include "misc/minato.hh"
#include "ltlast/visitor.hh"
#include "ltlast/allnodes.hh"
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/tostring.hh"
#include "ltlvisit/postfix.hh"
@ -1588,22 +1587,25 @@ namespace spot
ltl_to_tgba_fm(const formula* f, bdd_dict* dict,
bool exprop, bool symb_merge, bool branching_postponement,
bool fair_loop_approx, const atomic_prop_set* unobs,
int reduce_ltl)
ltl_simplifier* simplifier)
{
// Normalize the formula. We want all the negations on
// the atomic propositions. We also suppress logic
// abbreviations such as <=>, =>, or XOR, since they
// would involve negations at the BDD level.
formula* f1 = unabbreviate_logic(f);
formula* f2 = negative_normal_form(f1);
f1->destroy();
formula* f2;
// Simplify the formula, if requested.
if (reduce_ltl)
if (simplifier)
{
formula* tmp = reduce(f2, reduce_ltl);
f2->destroy();
f2 = tmp;
// This will normalize the formula regardless of the
// configuration of the simplifier.
f2 = simplifier->simplify(f);
}
else
{
// Otherwise, at least normalize the formula. We want all the
// negations on the atomic propositions. We also suppress
// logic abbreviations such as <=>, =>, or XOR, since they
// would involve negations at the BDD level.
ltl_simplifier s;
f2 = s.negative_normal_form(f, false, true);
}
typedef std::set<const formula*, formula_ptr_less_than> set_type;
@ -1611,7 +1613,7 @@ namespace spot
translate_dict d(dict);
// Compute the set of all promises that can possibly occurre
// Compute the set of all promises that can possibly occur
// inside the formula.
bdd all_promises = bddtrue;
if (fair_loop_approx || unobs)
@ -1761,9 +1763,9 @@ namespace spot
const formula* dest = d.conj_bdd_to_formula(dest_bdd);
// Simplify the formula, if requested.
if (reduce_ltl)
if (simplifier)
{
formula* tmp = reduce(dest, reduce_ltl);
formula* tmp = simplifier->simplify(dest);
dest->destroy();
dest = tmp;
// Ignore the arc if the destination reduces to false.

View file

@ -1,5 +1,5 @@
// Copyright (C) 2010 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) 2010, 2011, 2012 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
@ -27,7 +27,7 @@
#include "ltlast/formula.hh"
#include "tgba/tgbaexplicit.hh"
#include "ltlvisit/apcollect.hh"
#include "ltlvisit/reduce.hh"
#include "ltlvisit/simplify.hh"
namespace spot
{
@ -99,10 +99,10 @@ namespace spot
/// 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().
/// \param simpl If this parameter is set, the LTL formulae representing
/// each state of the automaton will be simplified
/// before computing the successor. \a simpl should be configured
/// for the type of reduction you want, see spot::ltl::ltl_simplifier.
/// This idea is taken from the following paper.
/// \verbatim
/// @InProceedings{ thirioux.02.fmics,
@ -128,7 +128,7 @@ namespace spot
bool branching_postponement = false,
bool fair_loop_approx = false,
const ltl::atomic_prop_set* unobs = 0,
int reduce_ltl = ltl::Reduce_None);
ltl::ltl_simplifier* simplifier = 0);
}
#endif // SPOT_TGBAALGOS_LTL2TGBA_FM_HH