Commit 8ccc2b81 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/tgbatest/ltl2tgba.cc (-l): New option to select the lacim

translation.  It still is the default translation.
(opt_fm, opt_taa): Replace these two variables by ...
(translation): ... this enum.  And use a switch to call the
correct translation.
parent 49d1abbd
2009-11-12 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* src/tgbatest/ltl2tgba.cc (-l): New option to select the lacim
translation. It still is the default translation.
(opt_fm, opt_taa): Replace these two variables by ...
(translation): ... this enum. And use a switch to call the
correct translation.
2009-11-11 Alexandre Duret-Lutz <adl@lrde.epita.fr> 2009-11-11 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Remove python bindings for ltl::clone and ltl::destroy. Remove python bindings for ltl::clone and ltl::destroy.
......
...@@ -102,6 +102,8 @@ syntax(char* prog) ...@@ -102,6 +102,8 @@ syntax(char* prog)
<< " -K dump the graph of SCCs in dot format" << std::endl << " -K dump the graph of SCCs in dot format" << std::endl
<< " -KV verbosely dump the graph of SCCs in dot format" << " -KV verbosely dump the graph of SCCs in dot format"
<< std::endl << std::endl
<< " -l use Couvreur's LaCIM algorithm for translation"
<< std::endl
<< " -L fair-loop approximation (implies -f)" << std::endl << " -L fair-loop approximation (implies -f)" << std::endl
<< " -lS label acceptance conditions on states" << std::endl << " -lS label acceptance conditions on states" << std::endl
<< " -m try to reduce accepting runs, in a second pass" << " -m try to reduce accepting runs, in a second pass"
...@@ -177,8 +179,7 @@ main(int argc, char** argv) ...@@ -177,8 +179,7 @@ main(int argc, char** argv)
bool paper_opt = false; bool paper_opt = false;
enum { NoDegen, DegenTBA, DegenSBA } degeneralize_opt = NoDegen; enum { NoDegen, DegenTBA, DegenSBA } degeneralize_opt = NoDegen;
enum { TransitionLabeled, StateLabeled } labeling_opt = TransitionLabeled; enum { TransitionLabeled, StateLabeled } labeling_opt = TransitionLabeled;
bool taa_opt = false; enum { TransFM, TransLaCIM, TransTAA } translation = TransLaCIM;
bool fm_opt = false;
int fm_red = spot::ltl::Reduce_None; int fm_red = spot::ltl::Reduce_None;
bool fm_exprop_opt = false; bool fm_exprop_opt = false;
bool fm_symb_merge_opt = true; bool fm_symb_merge_opt = true;
...@@ -238,8 +239,8 @@ main(int argc, char** argv) ...@@ -238,8 +239,8 @@ main(int argc, char** argv)
else if (!strcmp(argv[formula_index], "-c")) else if (!strcmp(argv[formula_index], "-c"))
{ {
containment = true; containment = true;
if (!taa_opt) if (translation != TransTAA)
fm_opt = true; translation = TransFM;
} }
else if (!strcmp(argv[formula_index], "-d")) else if (!strcmp(argv[formula_index], "-d"))
{ {
...@@ -291,47 +292,47 @@ main(int argc, char** argv) ...@@ -291,47 +292,47 @@ main(int argc, char** argv)
} }
else if (!strcmp(argv[formula_index], "-taa")) else if (!strcmp(argv[formula_index], "-taa"))
{ {
taa_opt = true; translation = TransTAA;
} }
else if (!strcmp(argv[formula_index], "-f")) else if (!strcmp(argv[formula_index], "-f"))
{ {
fm_opt = true; translation = TransFM;
} }
else if (!strcmp(argv[formula_index], "-fr1")) else if (!strcmp(argv[formula_index], "-fr1"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_Basics; fm_red |= spot::ltl::Reduce_Basics;
} }
else if (!strcmp(argv[formula_index], "-fr2")) else if (!strcmp(argv[formula_index], "-fr2"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_Eventuality_And_Universality; fm_red |= spot::ltl::Reduce_Eventuality_And_Universality;
} }
else if (!strcmp(argv[formula_index], "-fr3")) else if (!strcmp(argv[formula_index], "-fr3"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_Syntactic_Implications; fm_red |= spot::ltl::Reduce_Syntactic_Implications;
} }
else if (!strcmp(argv[formula_index], "-fr4")) else if (!strcmp(argv[formula_index], "-fr4"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_Basics fm_red |= spot::ltl::Reduce_Basics
| spot::ltl::Reduce_Eventuality_And_Universality | spot::ltl::Reduce_Eventuality_And_Universality
| spot::ltl::Reduce_Syntactic_Implications; | spot::ltl::Reduce_Syntactic_Implications;
} }
else if (!strcmp(argv[formula_index], "-fr5")) else if (!strcmp(argv[formula_index], "-fr5"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_Containment_Checks; fm_red |= spot::ltl::Reduce_Containment_Checks;
} }
else if (!strcmp(argv[formula_index], "-fr6")) else if (!strcmp(argv[formula_index], "-fr6"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_Containment_Checks_Stronger; fm_red |= spot::ltl::Reduce_Containment_Checks_Stronger;
} }
else if (!strcmp(argv[formula_index], "-fr7")) else if (!strcmp(argv[formula_index], "-fr7"))
{ {
fm_opt = true; translation = TransFM;
fm_red |= spot::ltl::Reduce_All; fm_red |= spot::ltl::Reduce_All;
} }
else if (!strcmp(argv[formula_index], "-F")) else if (!strcmp(argv[formula_index], "-F"))
...@@ -362,10 +363,14 @@ main(int argc, char** argv) ...@@ -362,10 +363,14 @@ main(int argc, char** argv)
{ {
output = 11; output = 11;
} }
else if (!strcmp(argv[formula_index], "-l"))
{
translation = TransLaCIM;
}
else if (!strcmp(argv[formula_index], "-L")) else if (!strcmp(argv[formula_index], "-L"))
{ {
fair_loop_approx = true; fair_loop_approx = true;
fm_opt = true; translation = TransFM;
} }
else if (!strcmp(argv[formula_index], "-lS")) else if (!strcmp(argv[formula_index], "-lS"))
{ {
...@@ -389,7 +394,7 @@ main(int argc, char** argv) ...@@ -389,7 +394,7 @@ main(int argc, char** argv)
else if (!strcmp(argv[formula_index], "-p")) else if (!strcmp(argv[formula_index], "-p"))
{ {
post_branching = true; post_branching = true;
fm_opt = true; translation = TransFM;
} }
else if (!strncmp(argv[formula_index], "-P", 2)) else if (!strncmp(argv[formula_index], "-P", 2))
{ {
...@@ -493,7 +498,7 @@ main(int argc, char** argv) ...@@ -493,7 +498,7 @@ main(int argc, char** argv)
else if (!strncmp(argv[formula_index], "-U", 2)) else if (!strncmp(argv[formula_index], "-U", 2))
{ {
unobservables = new spot::ltl::atomic_prop_set; unobservables = new spot::ltl::atomic_prop_set;
fm_opt = true; translation = TransFM;
// Parse -U's argument. // Parse -U's argument.
const char* tok = strtok(argv[formula_index] + 2, ", \t;"); const char* tok = strtok(argv[formula_index] + 2, ", \t;");
while (tok) while (tok)
...@@ -509,7 +514,7 @@ main(int argc, char** argv) ...@@ -509,7 +514,7 @@ main(int argc, char** argv)
} }
else if (!strcmp(argv[formula_index], "-x")) else if (!strcmp(argv[formula_index], "-x"))
{ {
fm_opt = true; translation = TransFM;
fm_exprop_opt = true; fm_exprop_opt = true;
} }
else if (!strcmp(argv[formula_index], "-X")) else if (!strcmp(argv[formula_index], "-X"))
...@@ -518,7 +523,7 @@ main(int argc, char** argv) ...@@ -518,7 +523,7 @@ main(int argc, char** argv)
} }
else if (!strcmp(argv[formula_index], "-y")) else if (!strcmp(argv[formula_index], "-y"))
{ {
fm_opt = true; translation = TransFM;
fm_symb_merge_opt = false; fm_symb_merge_opt = false;
} }
else else
...@@ -610,18 +615,25 @@ main(int argc, char** argv) ...@@ -610,18 +615,25 @@ main(int argc, char** argv)
} }
tm.start("translating formula"); tm.start("translating formula");
if (fm_opt) switch (translation)
to_free = a = spot::ltl_to_tgba_fm(f, dict, fm_exprop_opt, {
fm_symb_merge_opt, case TransFM:
post_branching, a = spot::ltl_to_tgba_fm(f, dict, fm_exprop_opt,
fair_loop_approx, unobservables, fm_symb_merge_opt,
fm_red, containment); post_branching,
else fair_loop_approx,
if (taa_opt) unobservables,
to_free = a = spot::ltl_to_taa(f, dict, containment); fm_red, containment);
else break;
to_free = a = concrete = spot::ltl_to_tgba_lacim(f, dict); case TransTAA:
a = spot::ltl_to_taa(f, dict, containment);
break;
case TransLaCIM:
a = concrete = spot::ltl_to_tgba_lacim(f, dict);
break;
}
tm.stop("translating formula"); tm.stop("translating formula");
to_free = a;
} }
spot::tgba_tba_proxy* degeneralized = 0; spot::tgba_tba_proxy* degeneralized = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment