Create the cosimulation.

* src/tgbaalgos/simulation.cc: Add the cosimulation:
(acc_compl_automaton) Add a template parameter.
(acc_compl_automaton::process_link) Add a swap source destination.
(direct_simulation) Add a template parameter.
(direct_simulation::compute_sig) Add a flag in the signature to
know if the state is initial.
(direct_simulation::build_result) Remove the flag before reading
the signature.
Swap source and destination when building the new automaton.
* src/tgbaalgos/simulation.hh: Declare and document the
Cosimulation.
* src/tgbatest/ltl2tgba.cc: Associate the cosimulation with the -RRS
option.
* src/tgbatest/spotlbtt.test: Add a test on the cosimulation.
This commit is contained in:
Thomas Badie 2012-08-06 18:57:26 +02:00 committed by Alexandre Duret-Lutz
parent aa230d1f8b
commit 387bace98b
4 changed files with 137 additions and 38 deletions

View file

@ -204,6 +204,8 @@ syntax(char* prog)
<< std::endl
<< " -RDS minimize the automaton with direct simulation"
<< std::endl
<< " -RRS minimize the automaton with reverse simulation"
<< std::endl
<< " -Rm attempt to WDBA-minimize the automata" << std::endl
<< std::endl
@ -352,13 +354,14 @@ main(int argc, char** argv)
bool use_timer = false;
bool assume_sba = false;
bool reduction_dir_sim = false;
bool reduction_rev_sim = false;
spot::tgba* temp_dir_sim = 0;
bool ta_opt = false;
bool tgta_opt = false;
bool opt_with_artificial_initial_state = true;
bool opt_single_pass_emptiness_check = false;
bool opt_with_artificial_livelock = false;
spot::tgba* temp_rev_sim = 0;
for (;;)
{
@ -631,6 +634,10 @@ main(int argc, char** argv)
// equal to -RDS.
reduction_dir_sim = true;
}
else if (!strcmp(argv[formula_index], "-RRS"))
{
reduction_rev_sim = true;
}
else if (!strcmp(argv[formula_index], "-R3"))
{
scc_filter = true;
@ -1031,11 +1038,21 @@ main(int argc, char** argv)
a = minimized;
// When the minimization succeed, simulation is useless.
reduction_dir_sim = false;
reduction_rev_sim = false;
assume_sba = true;
}
}
if (reduction_rev_sim)
{
tm.start("Reduction w/ reverse simulation");
temp_rev_sim = spot::cosimulation(a);
a = temp_rev_sim;
tm.stop("Reduction w/ reverse simulation");
assume_sba = false;
}
if (reduction_dir_sim)
{
tm.start("Reduction w/ direct simulation");
@ -1505,6 +1522,7 @@ main(int argc, char** argv)
delete to_free;
delete echeck_inst;
delete temp_dir_sim;
delete temp_rev_sim;
}
else
{