Replace prune_scc() by scc_filter().
prune_scc() leaked memory and failed to remove chains of useless SCCs. * src/tgbaalgos/reductgba_sim.cc (reduc_tgba_sim): Call scc_filter() instead of prune_scc(), and do it before running any simulation-based reduction. * src/tgbaalgos/reductgba_sim.hh (reduc_tgba_sim): Return a const tgba*. * src/tgbatest/ltl2tgba.cc: Call scc_filter() instead of prune_scc(). * src/tgbatest/scc.test: Add two more tests that failed with prune_scc().
This commit is contained in:
parent
74f620d192
commit
7ea51cc65f
6 changed files with 122 additions and 66 deletions
|
|
@ -48,6 +48,7 @@
|
|||
#include "tgbaalgos/reductgba_sim.hh"
|
||||
#include "tgbaalgos/replayrun.hh"
|
||||
#include "tgbaalgos/rundotdec.hh"
|
||||
#include "tgbaalgos/sccfilter.hh"
|
||||
#include "misc/timer.hh"
|
||||
|
||||
#include "tgbaalgos/stats.hh"
|
||||
|
|
@ -715,64 +716,71 @@ main(int argc, char** argv)
|
|||
}
|
||||
|
||||
spot::tgba_reduc* aut_red = 0;
|
||||
spot::tgba* aut_scc = 0;
|
||||
if (reduc_aut != spot::Reduce_None)
|
||||
{
|
||||
tm.start("reducing formula automaton");
|
||||
a = aut_red = new spot::tgba_reduc(a);
|
||||
|
||||
if (reduc_aut & spot::Reduce_Scc)
|
||||
aut_red->prune_scc();
|
||||
|
||||
if (reduc_aut & (spot::Reduce_quotient_Dir_Sim |
|
||||
spot::Reduce_transition_Dir_Sim |
|
||||
spot::Reduce_quotient_Del_Sim |
|
||||
spot::Reduce_transition_Del_Sim))
|
||||
{
|
||||
spot::direct_simulation_relation* rel_dir = 0;
|
||||
spot::delayed_simulation_relation* rel_del = 0;
|
||||
tm.start("reducing formula aut. w/ SCC");
|
||||
a = aut_scc = spot::scc_filter(a);
|
||||
tm.start("reducing formula aut. w/ SCC");
|
||||
}
|
||||
|
||||
if (reduc_aut & !spot::Reduce_Scc)
|
||||
{
|
||||
tm.start("reducing formula aut. w/ sim.");
|
||||
a = aut_red = new spot::tgba_reduc(a);
|
||||
|
||||
if (reduc_aut & (spot::Reduce_quotient_Dir_Sim |
|
||||
spot::Reduce_transition_Dir_Sim))
|
||||
spot::Reduce_transition_Dir_Sim |
|
||||
spot::Reduce_quotient_Del_Sim |
|
||||
spot::Reduce_transition_Del_Sim))
|
||||
{
|
||||
rel_dir =
|
||||
spot::get_direct_relation_simulation(a,
|
||||
std::cout,
|
||||
display_parity_game);
|
||||
assert(rel_dir);
|
||||
}
|
||||
if (reduc_aut & (spot::Reduce_quotient_Del_Sim |
|
||||
spot::Reduce_transition_Del_Sim))
|
||||
{
|
||||
rel_del =
|
||||
spot::get_delayed_relation_simulation(a,
|
||||
std::cout,
|
||||
display_parity_game);
|
||||
assert(rel_del);
|
||||
}
|
||||
spot::direct_simulation_relation* rel_dir = 0;
|
||||
spot::delayed_simulation_relation* rel_del = 0;
|
||||
|
||||
if (reduc_aut & (spot::Reduce_quotient_Dir_Sim |
|
||||
spot::Reduce_transition_Dir_Sim))
|
||||
{
|
||||
rel_dir =
|
||||
spot::get_direct_relation_simulation
|
||||
(a, std::cout, display_parity_game);
|
||||
assert(rel_dir);
|
||||
}
|
||||
if (reduc_aut & (spot::Reduce_quotient_Del_Sim |
|
||||
spot::Reduce_transition_Del_Sim))
|
||||
{
|
||||
rel_del =
|
||||
spot::get_delayed_relation_simulation
|
||||
(a, std::cout, display_parity_game);
|
||||
assert(rel_del);
|
||||
}
|
||||
|
||||
if (display_rel_sim)
|
||||
{
|
||||
if (rel_dir)
|
||||
aut_red->display_rel_sim(rel_dir, std::cout);
|
||||
if (rel_del)
|
||||
aut_red->display_rel_sim(rel_del, std::cout);
|
||||
}
|
||||
|
||||
if (reduc_aut & spot::Reduce_quotient_Dir_Sim)
|
||||
aut_red->quotient_state(rel_dir);
|
||||
if (reduc_aut & spot::Reduce_transition_Dir_Sim)
|
||||
aut_red->delete_transitions(rel_dir);
|
||||
if (reduc_aut & spot::Reduce_quotient_Del_Sim)
|
||||
aut_red->quotient_state(rel_del);
|
||||
if (reduc_aut & spot::Reduce_transition_Del_Sim)
|
||||
aut_red->delete_transitions(rel_del);
|
||||
|
||||
if (display_rel_sim)
|
||||
{
|
||||
if (rel_dir)
|
||||
aut_red->display_rel_sim(rel_dir, std::cout);
|
||||
spot::free_relation_simulation(rel_dir);
|
||||
if (rel_del)
|
||||
aut_red->display_rel_sim(rel_del, std::cout);
|
||||
spot::free_relation_simulation(rel_del);
|
||||
}
|
||||
|
||||
if (reduc_aut & spot::Reduce_quotient_Dir_Sim)
|
||||
aut_red->quotient_state(rel_dir);
|
||||
if (reduc_aut & spot::Reduce_transition_Dir_Sim)
|
||||
aut_red->delete_transitions(rel_dir);
|
||||
if (reduc_aut & spot::Reduce_quotient_Del_Sim)
|
||||
aut_red->quotient_state(rel_del);
|
||||
if (reduc_aut & spot::Reduce_transition_Del_Sim)
|
||||
aut_red->delete_transitions(rel_del);
|
||||
|
||||
if (rel_dir)
|
||||
spot::free_relation_simulation(rel_dir);
|
||||
if (rel_del)
|
||||
spot::free_relation_simulation(rel_del);
|
||||
tm.stop("reducing formula aut. w/ sim.");
|
||||
}
|
||||
tm.stop("reducing formula automaton");
|
||||
}
|
||||
|
||||
spot::tgba_explicit* expl = 0;
|
||||
|
|
@ -1021,6 +1029,7 @@ main(int argc, char** argv)
|
|||
delete system;
|
||||
delete expl;
|
||||
delete aut_red;
|
||||
delete aut_scc;
|
||||
delete degeneralized;
|
||||
delete state_labeled;
|
||||
delete to_free;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue