* src/tgbatest/ltl2tgba.cc: Handle the -o and -r options.
This commit is contained in:
parent
fc94d6c446
commit
ad0aa705cf
2 changed files with 44 additions and 12 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
2003-06-19 Alexandre Duret-Lutz <aduret@src.lip6.fr>
|
2003-06-19 Alexandre Duret-Lutz <aduret@src.lip6.fr>
|
||||||
|
|
||||||
|
* src/tgbatest/ltl2tgba.cc: Handle the -o and -r options.
|
||||||
|
|
||||||
* src/tgbatest/tripprod.test, src/tgbatest/explprod.test,
|
* src/tgbatest/tripprod.test, src/tgbatest/explprod.test,
|
||||||
src/tgbatest/readsave.test: Adjust to reflect yesterday's
|
src/tgbatest/readsave.test: Adjust to reflect yesterday's
|
||||||
bddprint.cc change.
|
bddprint.cc change.
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,19 @@
|
||||||
#include "ltlast/allnodes.hh"
|
#include "ltlast/allnodes.hh"
|
||||||
#include "ltlparse/public.hh"
|
#include "ltlparse/public.hh"
|
||||||
#include "tgba/ltl2tgba.hh"
|
#include "tgba/ltl2tgba.hh"
|
||||||
|
#include "tgba/bddprint.hh"
|
||||||
|
#include "tgba/tgbabddtranslatefactory.hh"
|
||||||
#include "tgbaalgos/dotty.hh"
|
#include "tgbaalgos/dotty.hh"
|
||||||
|
|
||||||
void
|
void
|
||||||
syntax(char* prog)
|
syntax(char* prog)
|
||||||
{
|
{
|
||||||
std::cerr << prog << " [-d] formula" << std::endl;
|
std::cerr << "Usage: "<< prog << " [-d][-o][-r] formula" << std::endl
|
||||||
|
<< std::endl
|
||||||
|
<< " -d turn on traces during parsing" << std::endl
|
||||||
|
<< " -o re-order BDD variables in the automata" << std::endl
|
||||||
|
<< " -r display the relation BDD, not the reachability graph"
|
||||||
|
<< std::endl;
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -18,24 +25,41 @@ main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int exit_code = 0;
|
int exit_code = 0;
|
||||||
|
|
||||||
if (argc < 2)
|
bool debug_opt = false;
|
||||||
syntax(argv[0]);
|
bool defrag_opt = false;
|
||||||
|
bool rel_opt = false;
|
||||||
|
int formula_index = 0;
|
||||||
|
|
||||||
bool debug = false;
|
for (;;)
|
||||||
int formula_index = 1;
|
|
||||||
|
|
||||||
if (!strcmp(argv[1], "-d"))
|
|
||||||
{
|
{
|
||||||
debug = true;
|
if (argc < formula_index + 2)
|
||||||
if (argc < 3)
|
|
||||||
syntax(argv[0]);
|
syntax(argv[0]);
|
||||||
formula_index = 2;
|
|
||||||
|
++formula_index;
|
||||||
|
|
||||||
|
if (!strcmp(argv[formula_index], "-d"))
|
||||||
|
{
|
||||||
|
debug_opt = true;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[formula_index], "-o"))
|
||||||
|
{
|
||||||
|
defrag_opt = true;
|
||||||
|
}
|
||||||
|
else if (!strcmp(argv[formula_index], "-r"))
|
||||||
|
{
|
||||||
|
rel_opt = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||||
spot::ltl::parse_error_list pel;
|
spot::ltl::parse_error_list pel;
|
||||||
spot::ltl::formula* f = spot::ltl::parse(argv[formula_index],
|
spot::ltl::formula* f = spot::ltl::parse(argv[formula_index],
|
||||||
pel, env, debug);
|
pel, env, debug_opt);
|
||||||
|
|
||||||
exit_code =
|
exit_code =
|
||||||
spot::ltl::format_parse_errors(std::cerr, argv[formula_index], pel);
|
spot::ltl::format_parse_errors(std::cerr, argv[formula_index], pel);
|
||||||
|
|
@ -44,6 +68,12 @@ main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
spot::tgba_bdd_concrete a = spot::ltl_to_tgba(f);
|
spot::tgba_bdd_concrete a = spot::ltl_to_tgba(f);
|
||||||
spot::ltl::destroy(f);
|
spot::ltl::destroy(f);
|
||||||
|
if (defrag_opt)
|
||||||
|
a = spot::defrag(a);
|
||||||
|
if (rel_opt)
|
||||||
|
spot::bdd_print_dot(std::cout, a.get_dict(),
|
||||||
|
a.get_core_data().relation);
|
||||||
|
else
|
||||||
spot::dotty_reachable(std::cout, a);
|
spot::dotty_reachable(std::cout, a);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue