* src/tgbatest/randtgba.cc: New option -S.
This commit is contained in:
parent
8e00065d84
commit
d5fb32120f
2 changed files with 206 additions and 176 deletions
|
|
@ -1,3 +1,7 @@
|
|||
2005-09-27 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
* src/tgbatest/randtgba.cc: New option -S.
|
||||
|
||||
2005-09-23 Alexandre Duret-Lutz <adl@src.lip6.fr>
|
||||
|
||||
* src/tgbaalgos/lbtt.cc: Typo.
|
||||
|
|
|
|||
|
|
@ -133,6 +133,9 @@ syntax(char* prog)
|
|||
<< " -i FILE do not generate formulae, read them from FILE"
|
||||
<< std::endl
|
||||
<< " -p S priorities to use" << std::endl
|
||||
<< " -S N skip N formulae before starting to use them"
|
||||
<< " (useful to replay a specific seed when -u is used)"
|
||||
<< std::endl
|
||||
<< " -u generate unique formulae" << std::endl
|
||||
<< std::endl
|
||||
<< "Emptiness-Check Options:" << std::endl
|
||||
|
|
@ -545,6 +548,7 @@ main(int argc, char** argv)
|
|||
std::istream *formula_file = 0;
|
||||
int opt_l = 0;
|
||||
bool opt_u = false;
|
||||
int opt_S = 0;
|
||||
|
||||
int opt_n_acc = 0;
|
||||
float opt_a = 0.0;
|
||||
|
|
@ -713,6 +717,12 @@ main(int argc, char** argv)
|
|||
opt_ec_seed = to_int_nonneg(argv[++argn], "-s");
|
||||
spot::srand(opt_ec_seed);
|
||||
}
|
||||
else if (!strcmp(argv[argn], "-S"))
|
||||
{
|
||||
if (argc < argn + 2)
|
||||
syntax(argv[0]);
|
||||
opt_S = to_int_pos(argv[++argn], "-S");
|
||||
}
|
||||
else if (!strcmp(argv[argn], "-t"))
|
||||
{
|
||||
if (argc < argn + 2)
|
||||
|
|
@ -870,6 +880,8 @@ main(int argc, char** argv)
|
|||
i != ap->end(); ++i)
|
||||
apf->insert(dynamic_cast<spot::ltl::atomic_prop*>((*i)->ref()));
|
||||
|
||||
if (!opt_S)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (opt_ec)
|
||||
|
|
@ -881,7 +893,8 @@ main(int argc, char** argv)
|
|||
|
||||
spot::tgba* a;
|
||||
spot::tgba* r = a = spot::random_graph(opt_n, opt_d, apf, dict,
|
||||
opt_n_acc, opt_a, opt_t, &env);
|
||||
opt_n_acc, opt_a, opt_t,
|
||||
&env);
|
||||
|
||||
if (formula)
|
||||
a = product = new spot::tgba_product(formula, a);
|
||||
|
|
@ -970,8 +983,9 @@ main(int argc, char** argv)
|
|||
run = res->accepting_run();
|
||||
if (opt_z && !done)
|
||||
{
|
||||
// Count only the first run (the other way
|
||||
// would be to divide the stats by opt_R).
|
||||
// Count only the first run (the
|
||||
// other way would be to divide
|
||||
// the stats by opt_R).
|
||||
done = true;
|
||||
const spot::unsigned_statistics* s
|
||||
= res->statistics();
|
||||
|
|
@ -992,12 +1006,13 @@ main(int argc, char** argv)
|
|||
{
|
||||
tm_ar.stop(algo);
|
||||
std::ostringstream s;
|
||||
if (!spot::replay_tgba_run(s, res->automaton(),
|
||||
if (!spot::replay_tgba_run(s,
|
||||
res->automaton(),
|
||||
run))
|
||||
{
|
||||
if (!opt_paper)
|
||||
std::cout << ", but could not replay it "
|
||||
<< "(ERROR!)";
|
||||
std::cout << ", but could not replay "
|
||||
<< "it (ERROR!)";
|
||||
failed_seeds.insert(opt_ec_seed);
|
||||
}
|
||||
else
|
||||
|
|
@ -1017,7 +1032,8 @@ main(int argc, char** argv)
|
|||
spot::tgba_run* redrun =
|
||||
spot::reduce_run(res->automaton(), run);
|
||||
if (!spot::replay_tgba_run(s,
|
||||
res->automaton(),
|
||||
res
|
||||
->automaton(),
|
||||
redrun))
|
||||
{
|
||||
if (!opt_paper)
|
||||
|
|
@ -1035,8 +1051,10 @@ main(int argc, char** argv)
|
|||
}
|
||||
if (opt_z && !opt_paper)
|
||||
{
|
||||
std::cout << " [" << redrun->prefix.size()
|
||||
<< "+" << redrun->cycle.size()
|
||||
std::cout << " ["
|
||||
<< redrun->prefix.size()
|
||||
<< "+"
|
||||
<< redrun->cycle.size()
|
||||
<< "]";
|
||||
}
|
||||
delete redrun;
|
||||
|
|
@ -1059,7 +1077,8 @@ main(int argc, char** argv)
|
|||
else
|
||||
{
|
||||
if (!opt_paper)
|
||||
std::cout << "maybe empty language" << std::endl;
|
||||
std::cout << "maybe empty language"
|
||||
<< std::endl;
|
||||
++n_maybe_empty;
|
||||
}
|
||||
|
||||
|
|
@ -1075,7 +1094,8 @@ main(int argc, char** argv)
|
|||
if ((n_empty == 0 && (n_non_empty + n_maybe_empty) != n_ec)
|
||||
|| (n_empty != 0 && n_non_empty != 0))
|
||||
{
|
||||
std::cout << "ERROR: not all algorithms agree" << std::endl;
|
||||
std::cout << "ERROR: not all algorithms agree"
|
||||
<< std::endl;
|
||||
failed_seeds.insert(opt_ec_seed);
|
||||
}
|
||||
|
||||
|
|
@ -1092,6 +1112,12 @@ main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
while (opt_ec);
|
||||
}
|
||||
else
|
||||
{
|
||||
--opt_S;
|
||||
opt_ec_seed += init_opt_ec;
|
||||
}
|
||||
|
||||
delete formula;
|
||||
if (opt_F)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue