Deprecate ltl::destroy(f) in favor of f->destroy()

* src/ltlast/formula.cc, src/ltlast/formula.hh (formula::clone):
Transform this static function into a member function.
* src/ltlvisit/destroy.hh (destroy): Document and declare as
deprecated.
* bench/split-product/cutscc.cc, iface/gspn/ltlgspn.cc,
src/eltlparse/eltlparse.yy, src/eltltest/acc.cc,
src/evtgbaalgos/tgba2evtgba.cc, src/evtgbatest/ltl2evtgba.cc,
src/ltlast/automatop.cc, src/ltlast/binop.cc,
src/ltlast/multop.cc, src/ltlast/unop.cc, src/ltlenv/declenv.cc,
src/ltlenv/declenv.hh, src/ltlparse/ltlparse.yy,
src/ltltest/equals.cc, src/ltltest/randltl.cc,
src/ltltest/readltl.cc, src/ltltest/reduc.cc,
src/ltltest/syntimpl.cc, src/ltltest/tostring.cc,
src/ltlvisit/destroy.cc src/ltlvisit/basicreduce.cc,
src/ltlvisit/contain.cc, src/ltlvisit/reduce.cc,
src/ltlvisit/syntimpl.cc, src/tgba/bdddict.cc,
src/tgba/bddprint.cc, src/tgba/taa.cc,
src/tgba/tgbabddconcretefactory.cc, src/tgba/tgbaexplicit.cc,
src/tgba/tgbafromfile.cc, src/tgbaalgos/eltl2tgba_lacim.cc,
src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/ltl2tgba_lacim.cc, src/tgbaalgos/neverclaim.cc,
src/tgbaalgos/randomgraph.cc, src/tgbaparse/tgbaparse.yy,
src/tgbatest/complementation.cc, src/tgbatest/eltl2tgba.cc,
src/tgbatest/ltl2tgba.cc, src/tgbatest/ltlprod.cc,
src/tgbatest/mixprod.cc, src/tgbatest/randtgba.cc,
src/tgbatest/reductgba.cc, wrap/python/cgi/ltl2tgba.in,
wrap/python/tests/ltl2tgba.py, wrap/python/tests/ltlparse.py,
wrap/python/tests/ltlsimple.py: Adjust destroy() usage, and remove
the #include "destroy.hh" when appropriate.
This commit is contained in:
Alexandre Duret-Lutz 2009-11-09 06:54:52 +01:00
parent 48fb19ea44
commit 77df39b4dd
53 changed files with 260 additions and 259 deletions

View file

@ -11,7 +11,6 @@
#include "ltlast/unop.hh"
#include "tgbaalgos/stats.hh"
#include "tgbaalgos/emptiness_stats.hh"
#include "ltlvisit/destroy.hh"
#include "tgba/tgbatba.hh"
#include "tgba/tgbasafracomplement.hh"
@ -146,7 +145,7 @@ int main(int argc, char* argv[])
complement = new spot::tgba_complement(a);
spot::dotty_reachable(std::cout, complement);
spot::ltl::destroy(f1);
f1->destroy();
delete complement;
delete a;
}
@ -226,8 +225,8 @@ int main(int argc, char* argv[])
<< std::endl;
delete a2;
spot::ltl::destroy(f1);
spot::ltl::destroy(nf1);
f1->destroy();
nf1->destroy();
}
}
else
@ -283,8 +282,8 @@ int main(int argc, char* argv[])
delete nAnf;
delete Anf;
spot::ltl::destroy(nf1);
spot::ltl::destroy(f1);
nf1->destroy();
f1->destroy();
}

View file

@ -29,7 +29,6 @@
#include "tgbaalgos/dotty.hh"
#include "tgbaalgos/lbtt.hh"
#include "tgbaalgos/save.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/tostring.hh"
#include "ltlast/allnodes.hh"
@ -99,7 +98,7 @@ main(int argc, char** argv)
input = ltl_defs();
input += "%";
input += spot::ltl::to_string(f, true);
spot::ltl::destroy(f);
f->destroy();
f = spot::eltl::parse_string(input, p, env, false);
formula_index = 2;
@ -140,7 +139,7 @@ main(int argc, char** argv)
}
}
spot::ltl::destroy(f);
f->destroy();
delete concrete;
assert(spot::ltl::atomic_prop::instance_count() == 0);

View file

@ -25,7 +25,6 @@
#include <fstream>
#include <string>
#include <cstdlib>
#include "ltlvisit/destroy.hh"
#include "ltlvisit/contain.hh"
#include "ltlvisit/tostring.hh"
#include "ltlvisit/apcollect.hh"
@ -578,7 +577,7 @@ main(int argc, char** argv)
if (redopt != spot::ltl::Reduce_None)
{
spot::ltl::formula* t = spot::ltl::reduce(f, redopt);
spot::ltl::destroy(f);
f->destroy();
f = t;
if (display_reduce_form)
std::cout << spot::ltl::to_string(f) << std::endl;
@ -902,7 +901,7 @@ main(int argc, char** argv)
if (show_fc)
delete a;
if (f)
spot::ltl::destroy(f);
f->destroy();
delete product_degeneralized;
delete product_to_free;
delete system;
@ -922,7 +921,7 @@ main(int argc, char** argv)
{
for (spot::ltl::atomic_prop_set::iterator i =
unobservables->begin(); i != unobservables->end(); ++i)
spot::ltl::destroy(*i);
(*i)->destroy();
delete unobservables;
}

View file

@ -1,6 +1,6 @@
// Copyright (C) 2003, 2004, 2008 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
// Copyright (C) 2003, 2004, 2008, 2009 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
@ -22,7 +22,6 @@
#include <iostream>
#include <cassert>
#include <cstdlib>
#include "ltlvisit/destroy.hh"
#include "ltlast/allnodes.hh"
#include "ltlparse/public.hh"
#include "tgbaalgos/ltl2tgba_lacim.hh"
@ -63,8 +62,8 @@ main(int argc, char** argv)
{
spot::tgba_bdd_concrete* a1 = spot::ltl_to_tgba_lacim(f1, dict);
spot::tgba_bdd_concrete* a2 = spot::ltl_to_tgba_lacim(f2, dict);
spot::ltl::destroy(f1);
spot::ltl::destroy(f2);
f1->destroy();
f2->destroy();
#ifdef BDD_CONCRETE_PRODUCT
spot::tgba_bdd_concrete* p = spot::product(a1, a2);

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2004, 2008 Laboratoire d'Informatique de Paris
// Copyright (C) 2003, 2004, 2008, 2009 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
@ -22,7 +22,6 @@
#include <iostream>
#include <cassert>
#include <cstdlib>
#include "ltlvisit/destroy.hh"
#include "ltlast/allnodes.hh"
#include "ltlparse/public.hh"
#include "tgbaalgos/ltl2tgba_lacim.hh"
@ -62,7 +61,7 @@ main(int argc, char** argv)
{
spot::tgba_bdd_concrete* a1 = spot::ltl_to_tgba_lacim(f1, dict);
spot::ltl::destroy(f1);
f1->destroy();
spot::tgba_product p(a1, a2);
spot::tgba_save_reachable(std::cout, &p);
delete a1;

View file

@ -32,7 +32,6 @@
#include <vector>
#include "ltlparse/public.hh"
#include "ltlvisit/apcollect.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/randomltl.hh"
#include "ltlvisit/tostring.hh"
#include "ltlvisit/length.hh"
@ -505,10 +504,10 @@ generate_formula(const spot::ltl::random_ltl& rl, int opt_f, int opt_s,
if (opt_l)
{
spot::ltl::formula* g = reduce(f);
spot::ltl::destroy(f);
f->destroy();
if (spot::ltl::length(g) < opt_l)
{
spot::ltl::destroy(g);
g->destroy();
continue;
}
f = g;
@ -531,7 +530,7 @@ generate_formula(const spot::ltl::random_ltl& rl, int opt_f, int opt_s,
{
return f;
}
spot::ltl::destroy(f);
f->destroy();
}
assert(opt_u);
std::cerr << "Failed to generate another unique formula."
@ -853,7 +852,7 @@ main(int argc, char** argv)
if (!f)
exit(1);
formula = spot::ltl_to_tgba_fm(f, dict, true);
spot::ltl::destroy(f);
f->destroy();
}
else if (opt_i)
{
@ -878,7 +877,7 @@ main(int argc, char** argv)
i != tmp->end(); ++i)
apf->insert(dynamic_cast<spot::ltl::atomic_prop*>
((*i)->clone()));
spot::ltl::destroy(f);
f->destroy();
delete tmp;
}
else
@ -1157,7 +1156,7 @@ main(int argc, char** argv)
opt_ec = init_opt_ec;
for (spot::ltl::atomic_prop_set::iterator i = apf->begin();
i != apf->end(); ++i)
spot::ltl::destroy(*i);
(*i)->destroy();
apf->clear();
}
while (opt_F || opt_i);
@ -1304,7 +1303,7 @@ main(int argc, char** argv)
for (spot::ltl::atomic_prop_set::iterator i = ap->begin();
i != ap->end(); ++i)
spot::ltl::destroy(*i);
(*i)->destroy();
if (opt_i && strcmp(opt_i, "-"))
{

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2004, 2006, 2008 Laboratoire d'Informatique de
// Copyright (C) 2003, 2004, 2006, 2008, 2009 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
@ -25,7 +25,6 @@
#include "tgbaalgos/reductgba_sim.hh"
#include "tgba/tgbareduc.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/reduce.hh"
#include "ltlast/allnodes.hh"
#include "ltlparse/public.hh"
@ -166,7 +165,7 @@ main(int argc, char** argv)
delete automatareduc;
#ifndef REDUCCMP
if (f != 0)
spot::ltl::destroy(f);
f->destroy();
#endif
assert(spot::ltl::atomic_prop::instance_count() == 0);