postproc: Add an option_map parameter

* src/tgbaalgos/postproc.cc: Add an option_map parameter, and use to get
extra options to pass to the degeneralization algorithm.
* src/tgbaalgos/postproc.hh: Adjust prototype, and store Boolean
variables for degeneralize() options.
* src/bin/ltl2tgba.cc: Add a -x option to fill the option map, and pass
it to the postprocessor.
* src/bin/man/ltl2tgba.x: Document the three degeneralization options.
This commit is contained in:
Alexandre Duret-Lutz 2013-02-01 19:00:31 +01:00
parent 1b2f9fe5d8
commit 05e59a9e1a
4 changed files with 74 additions and 13 deletions

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -39,6 +39,7 @@
#include "tgbaalgos/save.hh"
#include "tgbaalgos/stats.hh"
#include "tgba/bddprint.hh"
#include "misc/optionmap.hh"
const char argp_program_doc[] ="\
Translate linear-time formulas (LTL/PSL) into Büchi automata.\n\n\
@ -91,6 +92,8 @@ static const argp_option options[] =
"a single %", 0 },
/**************************************************/
{ 0, 0, 0, 0, "Miscellaneous options:", -1 },
{ "extra-options", 'x', "OPTS", 0,
"fine-tuning options (see man page)", 0 },
{ 0, 0, 0, 0, 0, 0 }
};
@ -105,6 +108,7 @@ const struct argp_child children[] =
enum output_format { Dot, Lbtt, Spin, Spot, Stats } format = Dot;
bool utf8 = false;
const char* stats = "";
spot::option_map extra_options;
static int
parse_opt(int key, char* arg, struct argp_state*)
@ -126,6 +130,13 @@ parse_opt(int key, char* arg, struct argp_state*)
if (type != spot::postprocessor::Monitor)
type = spot::postprocessor::BA;
break;
case 'x':
{
const char* opt = extra_options.parse_options(arg);
if (opt)
error(2, 0, "failed to parse --options near '%s'", opt);
}
break;
case OPT_DOT:
format = Dot;
break;
@ -258,7 +269,7 @@ main(int argc, char** argv)
spot::ltl::ltl_simplifier simpl(simplifier_options());
spot::postprocessor postproc;
spot::postprocessor postproc(&extra_options);
postproc.set_pref(pref);
postproc.set_type(type);
postproc.set_level(level);