Add a remove_fin() algorithm

* src/bin/autfilt.cc: Add remove_fin().
* src/tgba/acc.cc, src/tgba/acc.hh: Add is_dnf() and simplify eval().
* src/tgbaalgos/remfin.cc, src/tgbaalgos/remfin.hh: New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbatest/remfin.test: New file.
* src/tgbatest/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2015-02-24 09:10:20 +01:00
parent 1441c4fe34
commit 85508a0ea6
8 changed files with 667 additions and 24 deletions

View file

@ -49,6 +49,7 @@
#include "tgbaalgos/mask.hh"
#include "tgbaalgos/sbacc.hh"
#include "tgbaalgos/stripacc.hh"
#include "tgbaalgos/remfin.hh"
static const char argp_program_doc[] ="\
@ -80,6 +81,7 @@ Exit status:\n\
#define OPT_STRIPACC 19
#define OPT_KEEP_STATES 20
#define OPT_DNF_ACC 21
#define OPT_REM_FIN 22
static const argp_option options[] =
{
@ -121,6 +123,8 @@ static const argp_option options[] =
"initial state", 0 },
{ "dnf-acceptance", OPT_DNF_ACC, 0, 0,
"put the acceptance condition in Disjunctive Normal Form", 0 },
{ "remove-fin", OPT_REM_FIN, 0, 0,
"rewrite the automaton without using Fin acceptance", 0 },
/**************************************************/
{ 0, 0, 0, 0, "Filtering options:", 6 },
{ "are-isomorphic", OPT_ARE_ISOMORPHIC, "FILENAME", 0,
@ -201,6 +205,7 @@ static bool opt_is_empty = false;
static bool opt_sbacc = false;
static bool opt_stripacc = false;
static bool opt_dnf_acc = false;
static bool opt_rem_fin = false;
static spot::acc_cond::mark_t opt_mask_acc = 0U;
static std::vector<bool> opt_keep_states = {};
static unsigned int opt_keep_states_initial = 0;
@ -342,6 +347,9 @@ parse_opt(int key, char* arg, struct argp_state*)
randomize_st = true;
}
break;
case OPT_REM_FIN:
opt_rem_fin = true;
break;
case OPT_SBACC:
opt_sbacc = true;
break;
@ -413,6 +421,8 @@ namespace
if (opt_dnf_acc)
aut->set_acceptance(aut->acc().num_sets(),
aut->get_acceptance().to_dnf());
if (opt_rem_fin)
aut = remove_fin(aut);
// Filters.