autfilt: add a --exclusive-ap option

* src/ltlvisit/exclusive.cc, src/ltlvisit/exclusive.hh: Implement
constrain() for automata.
* src/bin/autfilt.cc: Add --exclusive-ap option.
* src/tgba/bdddict.cc, src/tgba/bdddict.hh: Add a
has_registered_proposition() method.
* src/tgbatest/exclusive.test: New file.
* src/tgbatest/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2015-03-23 18:14:46 +01:00
parent 544c533ed3
commit fb7b7a944a
7 changed files with 216 additions and 8 deletions

View file

@ -43,6 +43,7 @@
#include "misc/timer.hh"
#include "misc/random.hh"
#include "hoaparse/public.hh"
#include "ltlvisit/exclusive.hh"
#include "tgbaalgos/randomize.hh"
#include "tgbaalgos/are_isomorphic.hh"
#include "tgbaalgos/canonicalize.hh"
@ -71,6 +72,7 @@ enum {
OPT_DESTUT,
OPT_DNF_ACC,
OPT_EDGES,
OPT_EXCLUSIVE_AP,
OPT_INSTUT,
OPT_INTERSECT,
OPT_IS_COMPLETE,
@ -138,6 +140,11 @@ static const argp_option options[] =
{ "complement-acceptance", OPT_COMPLEMENT_ACC, 0, 0,
"complement the acceptance condition (without touching the automaton)",
0 },
{ "exclusive-ap", OPT_EXCLUSIVE_AP, "AP,AP,...", 0,
"if any of those APs occur in the automaton, restrict all edges to "
"ensure two of them may not be true at the same time. Use this option "
"multiple times to declare independent groups of exclusive "
"propositions.", 0 },
/**************************************************/
{ 0, 0, 0, 0, "Filtering options:", 6 },
{ "are-isomorphic", OPT_ARE_ISOMORPHIC, "FILENAME", 0,
@ -225,6 +232,7 @@ static bool opt_complement_acc = 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;
static spot::exclusive_ap excl_ap;
static int
parse_opt(int key, char* arg, struct argp_state*)
@ -287,6 +295,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_EDGES:
opt_edges = parse_range(arg, 0, std::numeric_limits<int>::max());
break;
case OPT_EXCLUSIVE_AP:
excl_ap.add_group(arg);
break;
case OPT_INSTUT:
if (!arg || (arg[0] == '1' && arg[1] == 0))
opt_instut = 1;
@ -490,6 +501,9 @@ namespace
if (opt_mask_acc)
aut = mask_acc_sets(aut, opt_mask_acc & aut->acc().all_sets());
if (!excl_ap.empty())
aut = excl_ap.constrain(aut);
if (opt_destut)
aut = spot::closure(std::move(aut));
if (opt_instut == 1)