twaalgos/cobuchi: Add nsa_to_nca()
* NEWS: Update. * spot/twaalgos/cobuchi.hh: Declare to_dca() and nsa_to_nca(). * spot/twaalgos/cobuchi.cc: Implement them. * python/spot/impl.i: Include new file for python bindings. * spot/twaalgos/Makefile.am: Add new file. * bin/autfilt.cc: Add --dca command line option. This option does not return a deterministic automaton yet, but it will. * tests/core/dca.test: Add tests for Büchi automata. * tests/python/dca.py: Add a python script that builds a nondet. Streett automaton. * tests/python/dca.test: Add tests for Streett automata. * tests/Makefile.am: Add all tests.
This commit is contained in:
parent
37c1a19b39
commit
cf18c06940
10 changed files with 678 additions and 1 deletions
|
|
@ -47,6 +47,7 @@
|
|||
#include <spot/tl/exclusive.hh>
|
||||
#include <spot/twaalgos/are_isomorphic.hh>
|
||||
#include <spot/twaalgos/canonicalize.hh>
|
||||
#include <spot/twaalgos/cobuchi.hh>
|
||||
#include <spot/twaalgos/cleanacc.hh>
|
||||
#include <spot/twaalgos/dtwasat.hh>
|
||||
#include <spot/twaalgos/dualize.hh>
|
||||
|
|
@ -89,6 +90,7 @@ enum {
|
|||
OPT_COMPLEMENT,
|
||||
OPT_COMPLEMENT_ACC,
|
||||
OPT_COUNT,
|
||||
OPT_DCA,
|
||||
OPT_DECOMPOSE_SCC,
|
||||
OPT_DESTUT,
|
||||
OPT_DUALIZE,
|
||||
|
|
@ -350,6 +352,12 @@ static const argp_option options[] =
|
|||
"solver can be set thanks to the SPOT_SATSOLVER environment variable"
|
||||
"(see spot-x)."
|
||||
, 0 },
|
||||
{ "dca", OPT_DCA, nullptr, 0,
|
||||
"convert to deterministic co-Büchi. The resulting automaton will always "
|
||||
"recognize at least the same language. Actually, it can recognize "
|
||||
"more if the original language can not be expressed using a co-Büchi "
|
||||
"acceptance condition."
|
||||
, 0 },
|
||||
{ nullptr, 0, nullptr, 0, "Decorations (for -d and -H1.1 output):", 9 },
|
||||
{ "highlight-nondet-states", OPT_HIGHLIGHT_NONDET_STATES, "NUM",
|
||||
OPTION_ARG_OPTIONAL, "highlight nondeterministic states with color NUM",
|
||||
|
|
@ -511,6 +519,7 @@ static const char* opt_sat_minimize = nullptr;
|
|||
static int opt_highlight_nondet_states = -1;
|
||||
static int opt_highlight_nondet_edges = -1;
|
||||
static bool opt_highlight_languages = false;
|
||||
static bool opt_dca = false;
|
||||
|
||||
static spot::twa_graph_ptr
|
||||
ensure_deterministic(const spot::twa_graph_ptr& aut, bool nonalt = false)
|
||||
|
|
@ -594,6 +603,9 @@ parse_opt(int key, char* arg, struct argp_state*)
|
|||
case OPT_COMPLEMENT_ACC:
|
||||
opt_complement_acc = true;
|
||||
break;
|
||||
case OPT_DCA:
|
||||
opt_dca = true;
|
||||
break;
|
||||
case OPT_DECOMPOSE_SCC:
|
||||
opt_decompose_scc = arg;
|
||||
break;
|
||||
|
|
@ -1190,6 +1202,8 @@ namespace
|
|||
aut = spot::to_generalized_rabin(aut, opt_gra == GRA_SHARE_INF);
|
||||
if (opt_gsa)
|
||||
aut = spot::to_generalized_streett(aut, opt_gsa == GSA_SHARE_FIN);
|
||||
if (opt_dca)
|
||||
aut = spot::to_dca(aut, false);
|
||||
|
||||
if (opt_simplify_exclusive_ap && !opt->excl_ap.empty())
|
||||
aut = opt->excl_ap.constrain(aut, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue