postproc: add support for colored-parity
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Add support for a colored option. * bin/common_post.cc, bin/common_post.hh bin/autfilt.cc, bin/ltl2tgba.cc, bin/dstar2tgba.cc: Add support for --colored-parity. * bin/ltldo.cc: Adjust as well for consistency, even if --parity and --colored-parity is not used here. * tests/core/parity2.test: Add tests. * doc/org/autfilt.org, doc/org/ltl2tgba.org: Add examples. * NEWS: Mention --colored-parity.
This commit is contained in:
parent
6bad8aebdd
commit
bd6dc7a806
12 changed files with 411 additions and 41 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2013, 2014, 2015, 2016, 2017 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2013-2018 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -1540,8 +1540,8 @@ main(int argc, char** argv)
|
|||
spot::srand(opt_seed);
|
||||
|
||||
spot::postprocessor post(&extra_options);
|
||||
post.set_pref(pref | comp | sbacc);
|
||||
post.set_type(type);
|
||||
post.set_pref(pref | comp | sbacc | colored);
|
||||
post.set_level(level);
|
||||
|
||||
autfilt_processor processor(post, o.dict);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,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::output_pref colored = spot::postprocessor::Any;
|
||||
spot::postprocessor::optimization_level level = spot::postprocessor::High;
|
||||
|
||||
bool level_set = false;
|
||||
|
|
@ -60,6 +61,10 @@ static constexpr const argp_option options[] =
|
|||
"any|min|max|odd|even|min odd|min even|max odd|max even",
|
||||
OPTION_ARG_OPTIONAL,
|
||||
"automaton with parity acceptance", 0, },
|
||||
{ "colored-parity", 'p',
|
||||
"any|min|max|odd|even|min odd|min even|max odd|max even",
|
||||
OPTION_ARG_OPTIONAL,
|
||||
"colored automaton with parity acceptance", 0, },
|
||||
/**************************************************/
|
||||
{ nullptr, 0, nullptr, 0, "Simplification goal:", 20 },
|
||||
{ "small", OPT_SMALL, nullptr, 0, "prefer small automata (default)", 0 },
|
||||
|
|
@ -111,9 +116,13 @@ static const argp_option options_disabled[] =
|
|||
"define the acceptance using states", 0 },
|
||||
{ "sbacc", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
|
||||
{ "parity", 'P',
|
||||
"[any|min|max|odd|even|min odd|min even|max odd|max even]",
|
||||
"any|min|max|odd|even|min odd|min even|max odd|max even",
|
||||
OPTION_ARG_OPTIONAL,
|
||||
"automaton with parity acceptance", 0, },
|
||||
{ "colored-parity", 'p',
|
||||
"any|min|max|odd|even|min odd|min even|max odd|max even",
|
||||
OPTION_ARG_OPTIONAL,
|
||||
"colored automaton with parity acceptance", 0, },
|
||||
/**************************************************/
|
||||
{ nullptr, 0, nullptr, 0, "Simplification goal:", 20 },
|
||||
{ "small", OPT_SMALL, nullptr, 0, "prefer small automata", 0 },
|
||||
|
|
@ -143,6 +152,7 @@ parse_opt_post(int key, char* arg, struct argp_state*)
|
|||
break;
|
||||
case 'B':
|
||||
type = spot::postprocessor::BA;
|
||||
colored = spot::postprocessor::Any;
|
||||
break;
|
||||
case 'C':
|
||||
comp = spot::postprocessor::Complete;
|
||||
|
|
@ -153,11 +163,14 @@ parse_opt_post(int key, char* arg, struct argp_state*)
|
|||
break;
|
||||
case 'G':
|
||||
type = spot::postprocessor::Generic;
|
||||
colored = spot::postprocessor::Any;
|
||||
break;
|
||||
case 'M':
|
||||
type = spot::postprocessor::Monitor;
|
||||
colored = spot::postprocessor::Any;
|
||||
break;
|
||||
case 'P':
|
||||
case 'p':
|
||||
{
|
||||
static char const *const parity_args[] =
|
||||
{
|
||||
|
|
@ -186,9 +199,12 @@ parse_opt_post(int key, char* arg, struct argp_state*)
|
|||
};
|
||||
ARGMATCH_VERIFY(parity_args, parity_types);
|
||||
if (arg)
|
||||
type = XARGMATCH("--parity", arg, parity_args, parity_types);
|
||||
type = XARGMATCH(key == 'P' ? "--parity" : "--colored-parity",
|
||||
arg, parity_args, parity_types);
|
||||
else
|
||||
type = spot::postprocessor::Parity;
|
||||
if (key == 'p')
|
||||
colored = spot::postprocessor::Colored;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
|
|
@ -217,6 +233,7 @@ parse_opt_post(int key, char* arg, struct argp_state*)
|
|||
if (automaton_format == Spin)
|
||||
error(2, 0, "--spin and --tgba are incompatible");
|
||||
type = spot::postprocessor::TGBA;
|
||||
colored = spot::postprocessor::Any;
|
||||
break;
|
||||
default:
|
||||
return ARGP_ERR_UNKNOWN;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012, 2013, 2014, 2015, 2016 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2012-2018 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -31,6 +31,7 @@ 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::output_pref colored;
|
||||
extern spot::postprocessor::optimization_level level;
|
||||
// True if --low, --medium, or --high has been given
|
||||
extern bool level_set;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2013, 2014, 2015, 2016, 2017 Laboratoire de Recherche et
|
||||
// Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -147,7 +147,7 @@ main(int argc, char** argv)
|
|||
check_no_automaton();
|
||||
|
||||
spot::postprocessor post(&extra_options);
|
||||
post.set_pref(pref | comp | sbacc);
|
||||
post.set_pref(pref | comp | sbacc | colored);
|
||||
post.set_type(type);
|
||||
post.set_level(level);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2012-2018 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -176,8 +176,8 @@ main(int argc, char** argv)
|
|||
try
|
||||
{
|
||||
spot::translator trans(&extra_options);
|
||||
trans.set_pref(pref | comp | sbacc | unambig);
|
||||
trans.set_type(type);
|
||||
trans.set_pref(pref | comp | sbacc | unambig | colored);
|
||||
trans.set_level(level);
|
||||
|
||||
trans_processor processor(trans);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2015, 2016, 2017 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2015-2018 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -466,7 +466,7 @@ main(int argc, char** argv)
|
|||
setup_sig_handler();
|
||||
|
||||
spot::postprocessor post;
|
||||
post.set_pref(pref | comp | sbacc);
|
||||
post.set_pref(pref | comp | sbacc | colored);
|
||||
post.set_type(type);
|
||||
post.set_level(level);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue