From 42963b99c8d98013b66ed546b03b34c36ffea312 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 2 May 2012 18:19:57 +0200 Subject: [PATCH] Adjust benchmarks that had not been compiled since 0.8... * bench/scc-stats/stats.cc, bench/split-product/cutscc.cc: Adjust to use state->destroy() and to use const formula*. --- bench/scc-stats/stats.cc | 18 +++++++----------- bench/split-product/cutscc.cc | 14 ++++++-------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/bench/scc-stats/stats.cc b/bench/scc-stats/stats.cc index ecc31495c..89adacfbe 100644 --- a/bench/scc-stats/stats.cc +++ b/bench/scc-stats/stats.cc @@ -1,5 +1,6 @@ -// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement -// de l'Epita (LRDE). +// -*- coding: utf-8 -*- +// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et +// DĂ©veloppement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -57,16 +58,14 @@ namespace spot } else // No, free dst. - delete dst; + dst->destroy(); } delete sit; } hash_type::iterator it2; // Free visited states. for (it2 = seen.begin(); it2 != seen.end(); it2++) - { - delete *it2; - } + (*it2)->destroy(); return count; } } @@ -114,7 +113,6 @@ int main (int argc, char* argv[]) output.open("results"); spot::bdd_dict* dict = new spot::bdd_dict(); unsigned count = 0; - bool count_even; std::vector acc_scc; std::vector dead_scc; std::vector acc_paths; @@ -124,8 +122,7 @@ int main (int argc, char* argv[]) unsigned k = 0; // Get each LTL formula. spot::ltl::ltl_file formulae(argv[1]); - spot::ltl::formula* f; - while((f = formulae.next())) + while (const spot::ltl::formula* f = formulae.next()) { ++k; spot::tgba* a = ltl_to_tgba_fm(f, dict, /* exprop */ true); @@ -135,7 +132,7 @@ int main (int argc, char* argv[]) m.build_map(); spot::state* initial_state = a->get_init_state(); unsigned init = m.scc_of_state(initial_state); - delete initial_state; + initial_state->destroy(); std::vector >* paths = find_paths(a, m); unsigned spanning_count =spot::max_spanning_paths(&(*paths)[init], m); spanning_paths.push_back(double(spanning_count)); @@ -175,7 +172,6 @@ int main (int argc, char* argv[]) sort(spanning_paths.begin(), spanning_paths.end()); sort(dead_paths.begin(), dead_paths.end()); sort(self_loops.begin(), self_loops.end()); - count_even = (count % 2 == 0); output << "Parsed Formulae : " << count << std::endl << std::endl; // Accepting SCCs diff --git a/bench/split-product/cutscc.cc b/bench/split-product/cutscc.cc index 289f35c20..d2e54d418 100644 --- a/bench/split-product/cutscc.cc +++ b/bench/split-product/cutscc.cc @@ -1,5 +1,6 @@ -// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement -// de l'Epita (LRDE). +// -*- coding: utf-8 -*- +// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et +// DĂ©veloppement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -67,16 +68,14 @@ namespace spot } else // No, free dst. - delete dst; + dst->destroy(); } delete sit; } hash_type::iterator it2; // Free visited states. for (it2 = seen.begin(); it2 != seen.end(); it2++) - { - delete *it2; - } + (*it2)->destroy(); return count; } } @@ -165,8 +164,7 @@ int main(int argc, char* argv[]) << " times to improve precision." << std::endl << std::endl; spot::ltl::ltl_file formulae(argv[1]); - spot::ltl::formula* f; - while((f = formulae.next())) + while (const spot::ltl::formula* f = formulae.next()) { spot::tgba* a = ltl_to_tgba_fm(f, dict, /* exprop */ true); ++i;