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())