Add an option to use WDBA only if it reduces the size of the automaton.

* src/tgba/tgbaexplicit.hh (num_states): New method.
* src/tgbaalgos/minimize.hh, src/tgbaalgos/minimize.cc
(minimize_obligation): Add a reject_bigger option.
* src/tgbatest/ltl2tgba.cc (-RM): New option.
* src/tgbatest/spotlbtt.test: Test -RM.
* bench/ltl2tgba/algorithms: Include -RM in addition to -Rm, and
replace -RDS by -RIS.
* NEWS: Mention this.
This commit is contained in:
Alexandre Duret-Lutz 2012-08-28 10:25:02 +02:00
parent f7af4e65f6
commit 60ec3acea0
7 changed files with 77 additions and 12 deletions

View file

@ -47,6 +47,7 @@
#include "tgbaalgos/scc.hh"
#include "tgbaalgos/ltl2tgba_fm.hh"
#include "tgbaalgos/bfssteps.hh"
#include "tgbaalgos/stats.hh"
namespace spot
{
@ -621,10 +622,22 @@ namespace spot
tgba*
minimize_obligation(const tgba* aut_f,
const ltl::formula* f, const tgba* aut_neg_f)
const ltl::formula* f, const tgba* aut_neg_f,
bool reject_bigger)
{
tgba_explicit_number* min_aut_f = minimize_wdba(aut_f);
if (reject_bigger)
{
// Abort if min_aut_f has more states than aut_f.
tgba_statistics orig_size = stats_reachable(aut_f);
if (orig_size.states < min_aut_f->num_states())
{
delete min_aut_f;
return const_cast<tgba*>(aut_f);
}
}
// if f is a syntactic obligation formula, the WDBA minimization
// must be correct.
if (f && f->is_syntactic_obligation())

View file

@ -63,9 +63,11 @@ namespace spot
/// \brief Minimize a Büchi automaton in the WDBA class.
///
/// This takes a TGBA whose language is representable by
/// a Weak Deterministic Büchi Automaton, and construct
/// a minimal WDBA for this language.
/// This takes a TGBA whose language is representable by a Weak
/// Deterministic Büchi Automaton, and construct a minimal WDBA for
/// this language. This essentially chains three algorithms:
/// determinization, acceptance adjustment (Löding's coloring
/// algorithm), and minimization (using a Moore-like approache).
///
/// If the input automaton does not represent a WDBA language,
/// the resulting automaton is still a WDBA, but it will not
@ -141,9 +143,17 @@ namespace spot
/// product(aut_neg_f,minize(aut))</code> are both empty. If they
/// are, the the minimization was sound. (See the paper for full
/// details.)
///
/// If \a reject_bigger is set, this function will return the input
/// automaton \a aut_f when the minimized WDBA has more states than
/// the input automaton. (More states are possible because of
/// determinization step during minimize_wdba().) Note that
/// checking the size of the minimized WDBA occurs before ensuring
/// that the minimized WDBA is correct.
tgba* minimize_obligation(const tgba* aut_f,
const ltl::formula* f = 0,
const tgba* aut_neg_f = 0);
const tgba* aut_neg_f = 0,
bool reject_bigger = false);
/// @}
}