Do not output a counterexample by default in ltl2tgba, introduce

options -C and -CR for that.

* src/tgbatest/ltl2tgba.cc: Add option -C and -CR to control
whether we want the accepting run to be printed or replayed.
* src/tgbatest/dfs.test, src/tgbatest/eltl2tgba.test,
src/tgbatest/emptchk.test, src/tgbatest/emptchke.test,
src/tgbatest/ltl2tgba.cc, src/tgbatest/ltlcounter.test: Use -CR.
This commit is contained in:
Alexandre Duret-Lutz 2010-11-06 15:38:00 +01:00
parent fe1f59cd30
commit a6677c2984
7 changed files with 103 additions and 66 deletions

View file

@ -214,6 +214,10 @@ syntax(char* prog)
<< "accepting run" << std::endl
<< " -E[ALGO] run emptiness check, expect no accepting run"
<< std::endl
<< " -C compute an accepting run (Counterexample) if it exists"
<< std::endl
<< " -CR compute and replay an accepting run (implies -C)"
<< std::endl
<< " -g graph the accepting run on the automaton (requires -e)"
<< std::endl
<< " -G graph the accepting run seen as an automaton "
@ -287,6 +291,8 @@ main(int argc, char** argv)
spot::emptiness_check_instantiator* echeck_inst = 0;
enum { NoneDup, BFS, DFS } dupexp = NoneDup;
bool expect_counter_example = false;
bool accepting_run = false;
bool accepting_run_replay = false;
bool from_file = false;
bool read_neverclaim = false;
int reduc_aut = spot::Reduce_None;
@ -341,6 +347,15 @@ main(int argc, char** argv)
containment = true;
translation = TransTAA;
}
else if (!strcmp(argv[formula_index], "-C"))
{
accepting_run = true;
}
else if (!strcmp(argv[formula_index], "-CR"))
{
accepting_run = true;
accepting_run_replay = true;
}
else if (!strcmp(argv[formula_index], "-d"))
{
debug_opt = true;
@ -440,10 +455,12 @@ main(int argc, char** argv)
}
else if (!strcmp(argv[formula_index], "-g"))
{
accepting_run = true;
graph_run_opt = true;
}
else if (!strcmp(argv[formula_index], "-G"))
{
accepting_run = true;
graph_run_tgba_opt = true;
}
else if (!strcmp(argv[formula_index], "-k"))
@ -1111,7 +1128,7 @@ main(int argc, char** argv)
std::cout << std::endl;
break;
}
else
else if (accepting_run)
{
tm.start("computing accepting run");
@ -1148,14 +1165,21 @@ main(int argc, char** argv)
else
{
spot::print_tgba_run(std::cout, a, run);
if (!spot::replay_tgba_run(std::cout, a, run,
true))
exit_code = 1;
if (accepting_run_replay
&& !spot::replay_tgba_run(std::cout, a, run,
true))
exit_code = 1;
}
delete run;
tm.stop("printing accepting run");
}
}
else
{
std::cout << "an accepting run exists "
<< "(use -C to print it)" << std::endl;
}
}
delete res;
}