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

@ -1,4 +1,4 @@
// Copyright (C) 2008 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2008, 2009 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
@ -24,7 +24,6 @@
#include "ltlast/formula_tree.hh"
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "tgba/tgbabddconcretefactory.hh"
#include <cassert>
@ -240,7 +239,7 @@ namespace spot
{
const formula* lbl = formula_tree::instanciate((*i)->lbl, v);
bdd f = recurse(lbl);
destroy(lbl);
lbl->destroy();
if (nfa->is_final((*i)->dst))
{
tmp1 |= f;
@ -285,13 +284,13 @@ namespace spot
// would involve negations at the BDD level.
const ltl::formula* f1 = ltl::unabbreviate_logic(f);
const ltl::formula* f2 = ltl::negative_normal_form(f1);
ltl::destroy(f1);
f1->destroy();
// Traverse the formula and draft the automaton in a factory.
tgba_bdd_concrete_factory fact(dict);
eltl_trad_visitor v(fact, true);
f2->accept(v);
ltl::destroy(f2);
f2->destroy();
fact.finish();
// Finally setup the resulting automaton.

View file

@ -25,7 +25,6 @@
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/tunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/tostring.hh"
#include "ltlvisit/contain.hh"
#include "ltl2taa.hh"
@ -56,7 +55,7 @@ namespace spot
result()
{
for (unsigned i = 0; i < to_free_.size(); ++i)
destroy(to_free_[i]);
to_free_[i]->destroy();
res_->set_init_state(init_);
return res_;
}
@ -380,14 +379,14 @@ namespace spot
// TODO: s/unabbreviate_ltl/unabbreviate_logic/
const ltl::formula* f1 = ltl::unabbreviate_ltl(f);
const ltl::formula* f2 = ltl::negative_normal_form(f1);
ltl::destroy(f1);
f1->destroy();
spot::taa* res = new spot::taa(dict);
language_containment_checker* lcc =
new language_containment_checker(dict, false, false, false, false);
ltl2taa_visitor v(res, lcc, refined_rules);
f2->accept(v);
ltl::destroy(f2);
f2->destroy();
delete lcc;
return v.result();

View file

@ -27,7 +27,6 @@
#include "ltlast/allnodes.hh"
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/tostring.hh"
#include "ltlvisit/postfix.hh"
#include "ltlvisit/apcollect.hh"
@ -66,7 +65,7 @@ namespace spot
{
fv_map::iterator i;
for (i = next_map.begin(); i != next_map.end(); ++i)
destroy(i->first);
i->first->destroy();
dict->unregister_all_my_variables(this);
}
@ -574,7 +573,7 @@ namespace spot
formula_to_bdd_map::iterator i = f2b_.begin();
const formula* f = i->first;
f2b_.erase(i);
destroy(f);
f->destroy();
}
}
@ -626,7 +625,7 @@ namespace spot
if (i->second != f)
{
// The translated bdd maps to an already seen formula.
destroy(f);
f->destroy();
f = i->second->clone();
}
else if (new_variable && lcc_)
@ -640,7 +639,7 @@ namespace spot
{
f2b_[f] = j->second;
i->second = j->first;
destroy(f);
f->destroy();
f = i->second->clone();
break;
}
@ -687,7 +686,7 @@ namespace spot
else
{
i->second[promises] |= conds;
destroy(dest);
dest->destroy();
}
}
@ -706,13 +705,13 @@ namespace spot
// would involve negations at the BDD level.
formula* f1 = unabbreviate_logic(f);
formula* f2 = negative_normal_form(f1);
destroy(f1);
f1->destroy();
// Simplify the formula, if requested.
if (reduce_ltl)
{
formula* tmp = reduce(f2, reduce_ltl);
destroy(f2);
f2->destroy();
f2 = tmp;
}
@ -864,7 +863,7 @@ namespace spot
if (reduce_ltl)
{
formula* tmp = reduce(dest, reduce_ltl);
destroy(dest);
dest->destroy();
dest = tmp;
// Ignore the arc if the destination reduces to false.
if (dest == constant::false_instance())
@ -982,7 +981,7 @@ namespace spot
}
else
{
destroy(dest);
dest->destroy();
}
}
}
@ -990,7 +989,7 @@ namespace spot
// Free all formulae.
for (std::set<const formula*>::iterator i = formulae_seen.begin();
i != formulae_seen.end(); ++i)
destroy(*i);
(*i)->destroy();
// Turn all promises into real acceptance conditions.
a->complement_all_acceptance_conditions();

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2003, 2004, 2009 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
@ -23,7 +23,6 @@
#include "ltlast/allnodes.hh"
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "tgba/tgbabddconcretefactory.hh"
#include <cassert>
@ -271,13 +270,13 @@ namespace spot
// would involve negations at the BDD level.
const ltl::formula* f1 = ltl::unabbreviate_logic(f);
const ltl::formula* f2 = ltl::negative_normal_form(f1);
ltl::destroy(f1);
f1->destroy();
// Traverse the formula and draft the automaton in a factory.
tgba_bdd_concrete_factory fact(dict);
ltl_trad_visitor v(fact, true);
f2->accept(v);
ltl::destroy(f2);
f2->destroy();
fact.finish();
// Finally setup the resulting automaton.

View file

@ -1,4 +1,4 @@
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// Copyright (C) 2004, 2009 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
@ -28,7 +28,6 @@
#include "reachiter.hh"
#include "ltlvisit/tostring.hh"
#include "tgba/formula2bdd.hh"
#include "ltlvisit/destroy.hh"
namespace spot
{
@ -167,7 +166,7 @@ namespace spot
const ltl::formula* f = bdd_to_formula(si->current_condition(),
automata_->get_dict());
to_spin_string(f, os_);
destroy(f);
f->destroy();
state* current = si->current_state();
os_ << ") -> goto " << get_state_label(current, out) << std::endl;
delete current;

View file

@ -1,4 +1,4 @@
// Copyright (C) 2004, 2005, 2007, 2008 Laboratoire d'Informatique de
// Copyright (C) 2004, 2005, 2007, 2008, 2009 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
@ -23,7 +23,6 @@
#include "tgba/tgbaexplicit.hh"
#include "misc/random.hh"
#include "ltlast/atomic_prop.hh"
#include "ltlvisit/destroy.hh"
#include <sstream>
#include <list>
#include <set>