postproc: add a SBAcc option
Producing state-based acceptance is now part of the postprocessing routines. That means we can more easily simplify automata with state-based acceptance (using autfilt -S --small --high, for instance) and as as side-effect, ltl2tgba can produce GBA. However the result of ltl2tgba -S is often larger than that of ltl2tgba -B. * src/twaalgos/postproc.cc, src/twaalgos/postproc.hh: Implement the SBAcc option. * src/bin/common_post.cc, src/bin/common_post.hh: Implement -S. * src/bin/autfilt.cc, src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc, src/bin/ltldo.cc: Adjust. * src/tests/sim3.test: Augment test case. * NEWS, doc/org/ltl2tgba.org, doc/org/autfilt.org: Document it -S.
This commit is contained in:
parent
dd87bdf868
commit
0786e068ae
13 changed files with 181 additions and 42 deletions
|
|
@ -50,7 +50,6 @@
|
|||
#include "twaalgos/are_isomorphic.hh"
|
||||
#include "twaalgos/canonicalize.hh"
|
||||
#include "twaalgos/mask.hh"
|
||||
#include "twaalgos/sbacc.hh"
|
||||
#include "twaalgos/sepsets.hh"
|
||||
#include "twaalgos/stripacc.hh"
|
||||
#include "twaalgos/remfin.hh"
|
||||
|
|
@ -92,7 +91,6 @@ enum {
|
|||
OPT_REM_DEAD,
|
||||
OPT_REM_UNREACH,
|
||||
OPT_REM_FIN,
|
||||
OPT_SBACC,
|
||||
OPT_SEED,
|
||||
OPT_SEP_SETS,
|
||||
OPT_SIMPLIFY_EXCLUSIVE_AP,
|
||||
|
|
@ -133,9 +131,6 @@ static const argp_option options[] =
|
|||
{ "destut", OPT_DESTUT, 0, 0, "allow less stuttering", 0 },
|
||||
{ "mask-acc", OPT_MASK_ACC, "NUM[,NUM...]", 0,
|
||||
"remove all transitions in specified acceptance sets", 0 },
|
||||
{ "state-based-acceptance", OPT_SBACC, 0, 0,
|
||||
"define the acceptance using states", 0 },
|
||||
{ "sbacc", 0, 0, OPTION_ALIAS, 0, 0 },
|
||||
{ "strip-acceptance", OPT_STRIPACC, 0, 0,
|
||||
"remove the acceptance condition and all acceptance sets", 0 },
|
||||
{ "keep-states", OPT_KEEP_STATES, "NUM[,NUM...]", 0,
|
||||
|
|
@ -251,7 +246,6 @@ static int opt_max_count = -1;
|
|||
static bool opt_destut = false;
|
||||
static char opt_instut = 0;
|
||||
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_cnf_acc = false;
|
||||
|
|
@ -437,9 +431,6 @@ parse_opt(int key, char* arg, struct argp_state*)
|
|||
case OPT_REM_UNREACH:
|
||||
opt_rem_unreach = true;
|
||||
break;
|
||||
case OPT_SBACC:
|
||||
opt_sbacc = true;
|
||||
break;
|
||||
case OPT_SEED:
|
||||
opt_seed = to_int(arg);
|
||||
break;
|
||||
|
|
@ -583,9 +574,6 @@ namespace
|
|||
if (opt->product)
|
||||
aut = spot::product(std::move(aut), opt->product);
|
||||
|
||||
if (opt_sbacc)
|
||||
aut = spot::sbacc(aut);
|
||||
|
||||
aut = post.run(aut, nullptr);
|
||||
|
||||
if (randomize_st || randomize_tr)
|
||||
|
|
@ -686,7 +674,7 @@ main(int argc, char** argv)
|
|||
spot::srand(opt_seed);
|
||||
|
||||
spot::postprocessor post(&extra_options);
|
||||
post.set_pref(pref | comp);
|
||||
post.set_pref(pref | comp | sbacc);
|
||||
post.set_type(type);
|
||||
post.set_level(level);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
spot::postprocessor::output_type type = spot::postprocessor::TGBA;
|
||||
spot::postprocessor::output_pref pref = spot::postprocessor::Small;
|
||||
spot::postprocessor::output_pref comp = spot::postprocessor::Any;
|
||||
spot::postprocessor::output_pref sbacc = spot::postprocessor::Any;
|
||||
spot::postprocessor::optimization_level level = spot::postprocessor::High;
|
||||
|
||||
enum {
|
||||
|
|
@ -43,6 +44,9 @@ static const argp_option options[] =
|
|||
"or deterministic", 0 },
|
||||
{ "complete", 'C', 0, 0, "output a complete automaton (combine "
|
||||
"with other intents)", 0 },
|
||||
{ "state-based-acceptance", 'S', 0, 0,
|
||||
"define the acceptance using states", 0 },
|
||||
{ "sbacc", 0, 0, OPTION_ALIAS, 0, 0 },
|
||||
/**************************************************/
|
||||
{ 0, 0, 0, 0, "Optimization level:", 21 },
|
||||
{ "low", OPT_LOW, 0, 0, "minimal optimizations (fast)", 0 },
|
||||
|
|
@ -62,6 +66,9 @@ static const argp_option options_disabled[] =
|
|||
"or deterministic (default)", 0 },
|
||||
{ "complete", 'C', 0, 0, "output a complete automaton (combine "
|
||||
"with other intents)", 0 },
|
||||
{ "state-based-acceptance", 'S', 0, 0,
|
||||
"define the acceptance using states", 0 },
|
||||
{ "sbacc", 0, 0, OPTION_ALIAS, 0, 0 },
|
||||
/**************************************************/
|
||||
{ 0, 0, 0, 0, "Optimization level:", 21 },
|
||||
{ "low", OPT_LOW, 0, 0, "minimal optimizations (fast, default)", 0 },
|
||||
|
|
@ -86,6 +93,9 @@ parse_opt_post(int key, char*, struct argp_state*)
|
|||
case 'D':
|
||||
pref = spot::postprocessor::Deterministic;
|
||||
break;
|
||||
case 'S':
|
||||
sbacc = spot::postprocessor::SBAcc;
|
||||
break;
|
||||
case OPT_HIGH:
|
||||
level = spot::postprocessor::High;
|
||||
simplification_level = 3;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
|
||||
// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -29,4 +29,5 @@ extern const struct argp post_argp_disabled; // postprocessing disabled
|
|||
extern spot::postprocessor::output_type type;
|
||||
extern spot::postprocessor::output_pref pref;
|
||||
extern spot::postprocessor::output_pref comp;
|
||||
extern spot::postprocessor::output_pref sbacc;
|
||||
extern spot::postprocessor::optimization_level level;
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ main(int argc, char** argv)
|
|||
jobs.emplace_back("-", true);
|
||||
|
||||
spot::postprocessor post(&extra_options);
|
||||
post.set_pref(pref | comp);
|
||||
post.set_pref(pref | comp | sbacc);
|
||||
post.set_type(type);
|
||||
post.set_level(level);
|
||||
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ main(int argc, char** argv)
|
|||
program_name);
|
||||
|
||||
spot::translator trans(&extra_options);
|
||||
trans.set_pref(pref | comp);
|
||||
trans.set_pref(pref | comp | sbacc);
|
||||
trans.set_type(type);
|
||||
trans.set_level(level);
|
||||
if (unambiguous)
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ main(int argc, char** argv)
|
|||
program_name);
|
||||
|
||||
spot::translator trans(&extra_options);
|
||||
trans.set_pref(pref | comp);
|
||||
trans.set_pref(pref | comp | sbacc);
|
||||
trans.set_type(type);
|
||||
trans.set_level(level);
|
||||
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ main(int argc, char** argv)
|
|||
setup_sig_handler();
|
||||
|
||||
spot::postprocessor post;
|
||||
post.set_pref(pref | comp);
|
||||
post.set_pref(pref | comp | sbacc);
|
||||
post.set_type(type);
|
||||
post.set_level(level);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue