python: rewrite translate() to deal with unambiguous and sbacc
and make it easier to extend and use. * src/twaalgos/postproc.hh, src/twaalgos/translate.cc, src/twaalgos/translate.hh: Incorporate the Unambiguous option with the other preferences. It's cleaner this way, and the previous setup did not work well with Python. * src/bin/ltl2tgba.cc: Adjust to this change. * wrap/python/spot.py (translate): Rewrite. * wrap/python/tests/automata.ipynb: Adjust existing cases, and add more as well as some comments.
This commit is contained in:
parent
1ef3e5f3ff
commit
19a273929c
6 changed files with 666 additions and 190 deletions
|
|
@ -83,7 +83,7 @@ const struct argp_child children[] =
|
|||
};
|
||||
|
||||
static spot::option_map extra_options;
|
||||
bool unambiguous = false;
|
||||
static spot::postprocessor::output_pref unambig = 0;
|
||||
|
||||
static int
|
||||
parse_opt(int key, char* arg, struct argp_state*)
|
||||
|
|
@ -98,7 +98,7 @@ parse_opt(int key, char* arg, struct argp_state*)
|
|||
type = spot::postprocessor::Monitor;
|
||||
break;
|
||||
case 'U':
|
||||
unambiguous = true;
|
||||
unambig = spot::postprocessor::Unambiguous;
|
||||
break;
|
||||
case 'x':
|
||||
{
|
||||
|
|
@ -186,11 +186,9 @@ main(int argc, char** argv)
|
|||
program_name);
|
||||
|
||||
spot::translator trans(&extra_options);
|
||||
trans.set_pref(pref | comp | sbacc);
|
||||
trans.set_pref(pref | comp | sbacc | unambig);
|
||||
trans.set_type(type);
|
||||
trans.set_level(level);
|
||||
if (unambiguous)
|
||||
trans.set_pref(spot::translator::Unambiguous);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue