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,3 +1,37 @@
2009-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr>
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.
2009-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr> 2009-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Deprecate ltl::clone(f) in favor of f->clone(). Deprecate ltl::clone(f) in favor of f->clone().

View file

@ -25,7 +25,6 @@
#include "tgbaalgos/scc.hh" #include "tgbaalgos/scc.hh"
#include "tgba/tgbafromfile.hh" #include "tgba/tgbafromfile.hh"
#include "tgbaalgos/dotty.hh" #include "tgbaalgos/dotty.hh"
#include "ltlvisit/destroy.hh"
#include "tgbaalgos/randomgraph.hh" #include "tgbaalgos/randomgraph.hh"
#include "tgbaalgos/emptiness.hh" #include "tgbaalgos/emptiness.hh"
#include "tgba/tgbaproduct.hh" #include "tgba/tgbaproduct.hh"

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2004, 2006, 2007, 2008 Laboratoire // Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009 Laboratoire
// d'Informatique de Paris 6 (LIP6), département Systèmes Répartis // d'Informatique de Paris 6 (LIP6), département Systèmes Répartis
// Coopératifs (SRC), Université Pierre et Marie Curie. // Coopératifs (SRC), Université Pierre et Marie Curie.
// //
@ -29,7 +29,6 @@
#include "tgbaparse/public.hh" #include "tgbaparse/public.hh"
#endif #endif
#include "ltlparse/public.hh" #include "ltlparse/public.hh"
#include "ltlvisit/destroy.hh"
#include "tgba/tgbatba.hh" #include "tgba/tgbatba.hh"
#include "tgba/tgbaproduct.hh" #include "tgba/tgbaproduct.hh"
#include "tgbaalgos/ltl2tgba_lacim.hh" #include "tgbaalgos/ltl2tgba_lacim.hh"
@ -265,7 +264,7 @@ main(int argc, char **argv)
a_f = spot::ltl_to_tgba_lacim(f, dict); a_f = spot::ltl_to_tgba_lacim(f, dict);
break; break;
} }
spot::ltl::destroy(f); f->destroy();
#ifndef SSP #ifndef SSP
spot::tgba* model = gspn.automaton(); spot::tgba* model = gspn.automaton();

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008 Laboratoire d'Informatique de /* Copyright (C) 2008, 2009 Laboratoire d'Informatique de
** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
** Université Pierre et Marie Curie. ** Université Pierre et Marie Curie.
** **
@ -37,8 +37,6 @@
#include "public.hh" #include "public.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlast/formula_tree.hh" #include "ltlast/formula_tree.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/clone.hh"
namespace spot namespace spot
{ {
@ -234,7 +232,7 @@ using namespace spot::ltl;
%type <bval> nfa_arg_list %type <bval> nfa_arg_list
%destructor { delete $$; } "atomic proposition" %destructor { delete $$; } "atomic proposition"
%destructor { spot::ltl::destroy($$); } subformula %destructor { $$->destroy(); } subformula
%printer { debug_stream() << *$$; } "atomic proposition" %printer { debug_stream() << *$$; } "atomic proposition"
@ -425,8 +423,8 @@ subformula: ATOMIC_PROP
v.push_back($1); v.push_back($1);
v.push_back($3); v.push_back($3);
$$ = instanciate(i->second, v); $$ = instanciate(i->second, v);
spot::ltl::destroy($1); $1->destroy();
spot::ltl::destroy($3); $3->destroy();
} }
else else
{ {
@ -449,7 +447,7 @@ subformula: ATOMIC_PROP
$$ = instanciate(i->second, *$3); $$ = instanciate(i->second, *$3);
automatop::vec::iterator it = $3->begin(); automatop::vec::iterator it = $3->begin();
while (it != $3->end()) while (it != $3->end())
spot::ltl::destroy(*it++); (*it++)->destroy();
delete $3; delete $3;
} }
else else
@ -463,7 +461,7 @@ subformula: ATOMIC_PROP
{ {
automatop::vec::iterator it = $3->begin(); automatop::vec::iterator it = $3->begin();
while (it != $3->end()) while (it != $3->end())
spot::ltl::destroy(*it++); (*it++)->destroy();
delete $3; delete $3;
} }

View file

@ -1,6 +1,5 @@
// Copyright (C) 2008 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2008, 2009 Laboratoire de Recherche et Developpement
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // de l'Epita (LRDE)
// et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -22,7 +21,6 @@
#include <iostream> #include <iostream>
#include <cassert> #include <cassert>
#include "eltlparse/public.hh" #include "eltlparse/public.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/lunabbrev.hh" #include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh" #include "ltlvisit/nenoform.hh"
@ -38,20 +36,20 @@ main(int argc, char** argv)
if (f != 0) if (f != 0)
{ {
std::cout << f->dump() << std::endl; std::cout << f->dump() << std::endl;
spot::ltl::destroy(f); f->destroy();
} }
return 1; return 1;
} }
const spot::ltl::formula* f1 = spot::ltl::unabbreviate_logic(f); const spot::ltl::formula* f1 = spot::ltl::unabbreviate_logic(f);
const spot::ltl::formula* f2 = spot::ltl::negative_normal_form(f1); const spot::ltl::formula* f2 = spot::ltl::negative_normal_form(f1);
spot::ltl::destroy(f1); f1->destroy();
assert(f != 0); assert(f != 0);
std::cout << f->dump() << std::endl; std::cout << f->dump() << std::endl;
spot::ltl::destroy(f); f->destroy();
assert(f2 != 0); assert(f2 != 0);
std::cout << f2->dump() << std::endl; std::cout << f2->dump() << std::endl;
spot::ltl::destroy(f2); f2->destroy();
} }

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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -24,7 +24,6 @@
#include "evtgba/explicit.hh" #include "evtgba/explicit.hh"
#include "tgbaalgos/reachiter.hh" #include "tgbaalgos/reachiter.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/destroy.hh"
namespace spot namespace spot
{ {

View file

@ -1,4 +1,4 @@
// Copyright (C) 2004, 2008 Laboratoire d'Informatique de Paris 6 // Copyright (C) 2004, 2008, 2009 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université // (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie. // Pierre et Marie Curie.
// //
@ -23,7 +23,6 @@
#include <cassert> #include <cassert>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include "ltlvisit/destroy.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlparse/public.hh" #include "ltlparse/public.hh"
#include "evtgbaparse/public.hh" #include "evtgbaparse/public.hh"
@ -114,7 +113,7 @@ main(int argc, char** argv)
post_branching, post_branching,
fair_loop_approx, unobservables); fair_loop_approx, unobservables);
spot::ltl::destroy(f); f->destroy();
spot::evtgba* e = spot::tgba_to_evtgba(a); spot::evtgba* e = spot::tgba_to_evtgba(a);
if (dotty_opt) if (dotty_opt)
@ -128,7 +127,7 @@ main(int argc, char** argv)
for (spot::ltl::atomic_prop_set::iterator i = unobservables->begin(); for (spot::ltl::atomic_prop_set::iterator i = unobservables->begin();
i != unobservables->end(); ++i) i != unobservables->end(); ++i)
spot::ltl::destroy(*i); (*i)->destroy();
delete unobservables; delete unobservables;
delete dict; delete dict;

View file

@ -1,6 +1,6 @@
// Copyright (C) 2003, 2004, 2005, 2009 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004, 2005, 2009 Laboratoire d'Informatique de
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// et Marie Curie. // Université Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //

View file

@ -50,7 +50,7 @@ namespace spot
// Dereference children. // Dereference children.
for (unsigned n = 0; n < size(); ++n) for (unsigned n = 0; n < size(); ++n)
formula::destroy(nth(n)); nth(n)->destroy();
delete children_; delete children_;
} }
@ -79,7 +79,7 @@ namespace spot
{ {
// The instance already exists. // The instance already exists.
for (vec::iterator vi = v->begin(); vi != v->end(); ++vi) for (vec::iterator vi = v->begin(); vi != v->end(); ++vi)
formula::destroy(*vi); (*vi)->destroy();
delete v; delete v;
return static_cast<automatop*>(i->second->clone()); return static_cast<automatop*>(i->second->clone());
} }

View file

@ -48,8 +48,8 @@ namespace spot
instances.erase(i); instances.erase(i);
// Dereference children. // Dereference children.
formula::destroy(first()); first()->destroy();
formula::destroy(second()); second()->destroy();
} }
void void
@ -143,8 +143,8 @@ namespace spot
if (i != instances.end()) if (i != instances.end())
{ {
// This instance already exists. // This instance already exists.
formula::destroy(first); first->destroy();
formula::destroy(second); second->destroy();
return static_cast<binop*>(i->second->clone()); return static_cast<binop*>(i->second->clone());
} }
binop* ap = new binop(op, first, second); binop* ap = new binop(op, first, second);

View file

@ -38,10 +38,10 @@ namespace spot
} }
void void
formula::destroy(formula* f) formula::destroy() const
{ {
if (f->unref_()) if (const_cast<formula*>(this)->unref_())
delete f; delete this;
} }
void void

View file

@ -85,7 +85,7 @@ namespace spot
/// ///
/// This decrements the reference counter of this node (if one is /// This decrements the reference counter of this node (if one is
/// used) and can free the object. /// used) and can free the object.
static void destroy(formula* f); void destroy() const;
/// Return a canonic representation of the formula /// Return a canonic representation of the formula
const std::string& dump() const; const std::string& dump() const;

View file

@ -55,7 +55,7 @@ namespace spot
// Dereference children. // Dereference children.
for (unsigned n = 0; n < size(); ++n) for (unsigned n = 0; n < size(); ++n)
formula::destroy(nth(n)); nth(n)->destroy();
delete children_; delete children_;
} }
@ -131,7 +131,7 @@ namespace spot
unsigned ps = p->size(); unsigned ps = p->size();
for (unsigned n = 0; n < ps; ++n) for (unsigned n = 0; n < ps; ++n)
inlined.push_back(p->nth(n)->clone()); inlined.push_back(p->nth(n)->clone());
formula::destroy(*i); (*i)->destroy();
i = v->erase(i); i = v->erase(i);
} }
else else
@ -153,7 +153,7 @@ namespace spot
{ {
if (*i == last) if (*i == last)
{ {
formula::destroy(*i); (*i)->destroy();
i = v->erase(i); i = v->erase(i);
} }
else else
@ -193,7 +193,7 @@ namespace spot
{ {
// The instance already exists. // The instance already exists.
for (vec::iterator vi = v->begin(); vi != v->end(); ++vi) for (vec::iterator vi = v->begin(); vi != v->end(); ++vi)
formula::destroy(*vi); (*vi)->destroy();
delete v; delete v;
return static_cast<multop*>(i->second->clone()); return static_cast<multop*>(i->second->clone());
} }

View file

@ -46,7 +46,7 @@ namespace spot
instances.erase(i); instances.erase(i);
// Dereference child. // Dereference child.
formula::destroy(child()); child()->destroy();
} }
void void
@ -110,7 +110,7 @@ namespace spot
if (i != instances.end()) if (i != instances.end())
{ {
// This instance already exists. // This instance already exists.
formula::destroy(child); child->destroy();
return static_cast<unop*>(i->second->clone()); return static_cast<unop*>(i->second->clone());
} }
unop* ap = new unop(op, child); unop* ap = new unop(op, child);

View file

@ -33,7 +33,7 @@ namespace spot
declarative_environment::~declarative_environment() declarative_environment::~declarative_environment()
{ {
for (prop_map::iterator i = props_.begin(); i != props_.end(); ++i) for (prop_map::iterator i = props_.begin(); i != props_.end(); ++i)
ltl::destroy(i->second); i->second->destroy();
} }
bool bool

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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -25,7 +25,6 @@
# include "environment.hh" # include "environment.hh"
# include <string> # include <string>
# include <map> # include <map>
# include "ltlvisit/destroy.hh"
# include "ltlast/atomic_prop.hh" # include "ltlast/atomic_prop.hh"
namespace spot namespace spot

View file

@ -31,7 +31,6 @@
#include <string> #include <string>
#include "public.hh" #include "public.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlvisit/destroy.hh"
} }
%parse-param {spot::ltl::parse_error_list &error_list} %parse-param {spot::ltl::parse_error_list &error_list}
@ -68,7 +67,7 @@ using namespace spot::ltl;
#define missing_right_binop(res, left, op, str) \ #define missing_right_binop(res, left, op, str) \
do \ do \
{ \ { \
destroy(left); \ left->destroy(); \
missing_right_op(res, op, str); \ missing_right_op(res, op, str); \
} \ } \
while (0); while (0);
@ -114,7 +113,7 @@ using namespace spot::ltl;
proposition"), then the %destructor should refer to that name. proposition"), then the %destructor should refer to that name.
References to ATOMIC_PROP are silently ignored. */ References to ATOMIC_PROP are silently ignored. */
%destructor { delete $$; } "atomic proposition" %destructor { delete $$; } "atomic proposition"
%destructor { spot::ltl::destroy($$); } subformula %destructor { $$->destroy(); } subformula
%printer { debug_stream() << *$$; } "atomic proposition" %printer { debug_stream() << *$$; } "atomic proposition"

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), // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie. // Université Pierre et Marie Curie.
// //
@ -28,7 +28,6 @@
#include "ltlvisit/tunabbrev.hh" #include "ltlvisit/tunabbrev.hh"
#include "ltlvisit/dump.hh" #include "ltlvisit/dump.hh"
#include "ltlvisit/nenoform.hh" #include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/contain.hh" #include "ltlvisit/contain.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlvisit/reduce.hh" #include "ltlvisit/reduce.hh"
@ -74,21 +73,21 @@ main(int argc, char** argv)
#ifdef LUNABBREV #ifdef LUNABBREV
tmp = f1; tmp = f1;
f1 = spot::ltl::unabbreviate_logic(f1); f1 = spot::ltl::unabbreviate_logic(f1);
spot::ltl::destroy(tmp); tmp->destroy();
spot::ltl::dump(std::cout, f1); spot::ltl::dump(std::cout, f1);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
#ifdef TUNABBREV #ifdef TUNABBREV
tmp = f1; tmp = f1;
f1 = spot::ltl::unabbreviate_ltl(f1); f1 = spot::ltl::unabbreviate_ltl(f1);
spot::ltl::destroy(tmp); tmp->destroy();
spot::ltl::dump(std::cout, f1); spot::ltl::dump(std::cout, f1);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
#ifdef NENOFORM #ifdef NENOFORM
tmp = f1; tmp = f1;
f1 = spot::ltl::negative_normal_form(f1); f1 = spot::ltl::negative_normal_form(f1);
spot::ltl::destroy(tmp); tmp->destroy();
spot::ltl::dump(std::cout, f1); spot::ltl::dump(std::cout, f1);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
@ -96,28 +95,28 @@ main(int argc, char** argv)
spot::ltl::formula* tmp; spot::ltl::formula* tmp;
tmp = f1; tmp = f1;
f1 = spot::ltl::reduce(f1); f1 = spot::ltl::reduce(f1);
spot::ltl::destroy(tmp); tmp->destroy();
spot::ltl::dump(std::cout, f1); spot::ltl::dump(std::cout, f1);
#endif #endif
#ifdef REDUC_TAU #ifdef REDUC_TAU
spot::ltl::formula* tmp; spot::ltl::formula* tmp;
tmp = f1; tmp = f1;
f1 = spot::ltl::reduce_tau03(f1, false); f1 = spot::ltl::reduce_tau03(f1, false);
spot::ltl::destroy(tmp); tmp->destroy();
spot::ltl::dump(std::cout, f1); spot::ltl::dump(std::cout, f1);
#endif #endif
#ifdef REDUC_TAUSTR #ifdef REDUC_TAUSTR
spot::ltl::formula* tmp; spot::ltl::formula* tmp;
tmp = f1; tmp = f1;
f1 = spot::ltl::reduce_tau03(f1, true); f1 = spot::ltl::reduce_tau03(f1, true);
spot::ltl::destroy(tmp); tmp->destroy();
spot::ltl::dump(std::cout, f1); spot::ltl::dump(std::cout, f1);
#endif #endif
int exit_code = f1 != f2; int exit_code = f1 != f2;
spot::ltl::destroy(f1); f1->destroy();
spot::ltl::destroy(f2); f2->destroy();
assert(spot::ltl::atomic_prop::instance_count() == 0); assert(spot::ltl::atomic_prop::instance_count() == 0);
assert(spot::ltl::unop::instance_count() == 0); assert(spot::ltl::unop::instance_count() == 0);
assert(spot::ltl::binop::instance_count() == 0); assert(spot::ltl::binop::instance_count() == 0);

View file

@ -28,7 +28,6 @@
#include "ltlast/atomic_prop.hh" #include "ltlast/atomic_prop.hh"
#include "ltlvisit/randomltl.hh" #include "ltlvisit/randomltl.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/length.hh" #include "ltlvisit/length.hh"
#include "ltlvisit/reduce.hh" #include "ltlvisit/reduce.hh"
#include "ltlenv/defaultenv.hh" #include "ltlenv/defaultenv.hh"
@ -179,10 +178,10 @@ main(int argc, char** argv)
if (opt_r) if (opt_r)
{ {
spot::ltl::formula* g = reduce(f); spot::ltl::formula* g = reduce(f);
spot::ltl::destroy(f); f->destroy();
if (spot::ltl::length(g) < opt_r) if (spot::ltl::length(g) < opt_r)
{ {
spot::ltl::destroy(g); g->destroy();
continue; continue;
} }
f = g; f = g;
@ -201,7 +200,7 @@ main(int argc, char** argv)
exit(2); exit(2);
} }
std::string txt = spot::ltl::to_string(f); std::string txt = spot::ltl::to_string(f);
spot::ltl::destroy(f); f->destroy();
if (!opt_u || unique.insert(txt).second) if (!opt_u || unique.insert(txt).second)
{ {
std::cout << txt << std::endl; std::cout << txt << std::endl;
@ -223,7 +222,7 @@ main(int argc, char** argv)
{ {
spot::ltl::atomic_prop_set::const_iterator j = i; spot::ltl::atomic_prop_set::const_iterator j = i;
++i; ++i;
spot::ltl::destroy(*j); (*j)->destroy();
} }
delete ap; delete ap;
} }

View file

@ -26,7 +26,6 @@
#include "ltlparse/public.hh" #include "ltlparse/public.hh"
#include "ltlvisit/dump.hh" #include "ltlvisit/dump.hh"
#include "ltlvisit/dotty.hh" #include "ltlvisit/dotty.hh"
#include "ltlvisit/destroy.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
void void
@ -93,7 +92,7 @@ main(int argc, char** argv)
spot::ltl::dump(std::cout, f); spot::ltl::dump(std::cout, f);
std::cout << std::endl; std::cout << std::endl;
#endif #endif
spot::ltl::destroy(f); f->destroy();
if (debug_ref) if (debug_ref)
dump_instances("after"); dump_instances("after");

View file

@ -1,6 +1,6 @@
// Copyright (C) 2004, 2006, 2007, 2008 Laboratoire d'Informatique de Paris // Copyright (C) 2004, 2006, 2007, 2008, 2009 Laboratoire
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), // d'Informatique de Paris 6 (LIP6), département Systèmes Répartis
// Université Pierre et Marie Curie. // Coopératifs (SRC), Université Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -27,7 +27,6 @@
#include "ltlvisit/tunabbrev.hh" #include "ltlvisit/tunabbrev.hh"
#include "ltlvisit/dump.hh" #include "ltlvisit/dump.hh"
#include "ltlvisit/nenoform.hh" #include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/reduce.hh" #include "ltlvisit/reduce.hh"
#include "ltlvisit/length.hh" #include "ltlvisit/length.hh"
@ -135,8 +134,8 @@ main(int argc, char** argv)
f1 = unabbreviate_logic(f1); f1 = unabbreviate_logic(f1);
ftmp2 = f1; ftmp2 = f1;
f1 = negative_normal_form(f1); f1 = negative_normal_form(f1);
spot::ltl::destroy(ftmp1); ftmp1->destroy();
spot::ltl::destroy(ftmp2); ftmp2->destroy();
int length_f1_before = spot::ltl::length(f1); int length_f1_before = spot::ltl::length(f1);
@ -146,8 +145,8 @@ main(int argc, char** argv)
f1 = spot::ltl::reduce(f1, o); f1 = spot::ltl::reduce(f1, o);
ftmp2 = f1; ftmp2 = f1;
f1 = spot::ltl::unabbreviate_logic(f1); f1 = spot::ltl::unabbreviate_logic(f1);
spot::ltl::destroy(ftmp1); ftmp1->destroy();
spot::ltl::destroy(ftmp2); ftmp2->destroy();
int length_f1_after = spot::ltl::length(f1); int length_f1_after = spot::ltl::length(f1);
std::string f1s_after = spot::ltl::to_string(f1); std::string f1s_after = spot::ltl::to_string(f1);
@ -160,11 +159,11 @@ main(int argc, char** argv)
f2 = unabbreviate_logic(f2); f2 = unabbreviate_logic(f2);
ftmp2 = f2; ftmp2 = f2;
f2 = negative_normal_form(f2); f2 = negative_normal_form(f2);
spot::ltl::destroy(ftmp1); ftmp1->destroy();
spot::ltl::destroy(ftmp2); ftmp2->destroy();
ftmp1 = f2; ftmp1 = f2;
f2 = unabbreviate_logic(f2); f2 = unabbreviate_logic(f2);
spot::ltl::destroy(ftmp1); ftmp1->destroy();
f2s = spot::ltl::to_string(f2); f2s = spot::ltl::to_string(f2);
} }
@ -204,9 +203,9 @@ main(int argc, char** argv)
exit_code = 0; exit_code = 0;
} }
spot::ltl::destroy(f1); f1->destroy();
if (f2) if (f2)
spot::ltl::destroy(f2); f2->destroy();
assert(spot::ltl::atomic_prop::instance_count() == 0); assert(spot::ltl::atomic_prop::instance_count() == 0);

View file

@ -1,4 +1,4 @@
// Copyright (C) 2004, 2008 Laboratoire d'Informatique de Paris 6 // Copyright (C) 2004, 2008, 2009 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université // (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie. // Pierre et Marie Curie.
// //
@ -26,7 +26,6 @@
#include "ltlvisit/lunabbrev.hh" #include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/tunabbrev.hh" #include "ltlvisit/tunabbrev.hh"
#include "ltlvisit/dump.hh" #include "ltlvisit/dump.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/syntimpl.hh" #include "ltlvisit/syntimpl.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
@ -102,10 +101,10 @@ main(int argc, char** argv)
spot::ltl::dump(std::cout, f1) << std::endl; spot::ltl::dump(std::cout, f1) << std::endl;
spot::ltl::dump(std::cout, f2) << std::endl; spot::ltl::dump(std::cout, f2) << std::endl;
spot::ltl::destroy(f1); f1->destroy();
spot::ltl::destroy(f2); f2->destroy();
spot::ltl::destroy(ftmp1); ftmp1->destroy();
spot::ltl::destroy(ftmp2); ftmp2->destroy();
assert(spot::ltl::atomic_prop::instance_count() == 0); assert(spot::ltl::atomic_prop::instance_count() == 0);
assert(spot::ltl::unop::instance_count() == 0); assert(spot::ltl::unop::instance_count() == 0);
assert(spot::ltl::binop::instance_count() == 0); assert(spot::ltl::binop::instance_count() == 0);

View file

@ -1,4 +1,4 @@
// Copyright (C) 2003, 2008 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2008, 2009 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -24,7 +24,6 @@
#include <cstdlib> #include <cstdlib>
#include "ltlparse/public.hh" #include "ltlparse/public.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/destroy.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
void void
@ -70,8 +69,8 @@ main(int argc, char **argv)
if (f2s != f1s) if (f2s != f1s)
return 1; return 1;
spot::ltl::destroy(f1); f1->destroy();
spot::ltl::destroy(f2); f2->destroy();
assert(spot::ltl::atomic_prop::instance_count() == 0); assert(spot::ltl::atomic_prop::instance_count() == 0);
assert(spot::ltl::unop::instance_count() == 0); assert(spot::ltl::unop::instance_count() == 0);
assert(spot::ltl::binop::instance_count() == 0); assert(spot::ltl::binop::instance_count() == 0);

View file

@ -1,6 +1,6 @@
// Copyright (C) 2004, 2007, 2008, 2009 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2007, 2008, 2009 Laboratoire d'Informatique de
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// et Marie Curie. // Université Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -24,8 +24,6 @@
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include <cassert> #include <cassert>
#include "destroy.hh"
namespace spot namespace spot
{ {
namespace ltl namespace ltl
@ -97,7 +95,7 @@ namespace spot
resGF->push_back(mo->nth(i)->clone()); resGF->push_back(mo->nth(i)->clone());
else else
res1->push_back(mo->nth(i)->clone()); res1->push_back(mo->nth(i)->clone());
destroy(mo); mo->destroy();
multop::vec* res3 = new multop::vec; multop::vec* res3 = new multop::vec;
if (!res1->empty()) if (!res1->empty())
res3->push_back(unop::instance(op, res3->push_back(unop::instance(op,
@ -162,10 +160,10 @@ namespace spot
unop::instance(unop::X, unop::instance(unop::X,
unop::instance(unop::F, unop::instance(unop::F,
basic_reduce(u->child()))); basic_reduce(u->child())));
destroy(u); u->destroy();
// FXX(a) = XXF(a) ... // FXX(a) = XXF(a) ...
result_ = basic_reduce(res); result_ = basic_reduce(res);
destroy(res); res->destroy();
return; return;
} }
@ -192,7 +190,7 @@ namespace spot
{ {
result_ = unop::instance(unop::G, result_ = unop::instance(unop::G,
basic_reduce(bo->second())); basic_reduce(bo->second()));
destroy(bo); bo->destroy();
return; return;
} }
@ -204,11 +202,11 @@ namespace spot
unop::instance(unop::X, unop::instance(unop::X,
unop::instance(unop::G, unop::instance(unop::G,
basic_reduce(u->child()))); basic_reduce(u->child())));
destroy(u); u->destroy();
// GXX(a) = XXG(a) ... // GXX(a) = XXG(a) ...
// GXF(a) = XGF(a) = GF(a) ... // GXF(a) = XGF(a) = GF(a) ...
result_ = basic_reduce(res); result_ = basic_reduce(res);
destroy(res); res->destroy();
return; return;
} }
@ -275,9 +273,9 @@ namespace spot
basic_reduce(fu1->child()), basic_reduce(fu1->child()),
basic_reduce(fu2->child())); basic_reduce(fu2->child()));
result_ = unop::instance(unop::X, basic_reduce(ftmp)); result_ = unop::instance(unop::X, basic_reduce(ftmp));
destroy(f1); f1->destroy();
destroy(f2); f2->destroy();
destroy(ftmp); ftmp->destroy();
return; return;
} }
@ -362,7 +360,7 @@ namespace spot
->push_back(bo2->first()->clone()); ->push_back(bo2->first()->clone());
if (j != i) if (j != i)
{ {
destroy(*j); (*j)->destroy();
*j = 0; *j = 0;
} }
} }
@ -393,7 +391,7 @@ namespace spot
->push_back(bo2->second()->clone()); ->push_back(bo2->second()->clone());
if (j != i) if (j != i)
{ {
destroy(*j); (*j)->destroy();
*j = 0; *j = 0;
} }
} }
@ -414,7 +412,7 @@ namespace spot
{ {
tmpOther->push_back((*i)->clone()); tmpOther->push_back((*i)->clone());
} }
destroy(*i); (*i)->destroy();
} }
delete tmpGF; delete tmpGF;
@ -473,7 +471,7 @@ namespace spot
->push_back(bo2->second()->clone()); ->push_back(bo2->second()->clone());
if (j != i) if (j != i)
{ {
destroy(*j); (*j)->destroy();
*j = 0; *j = 0;
} }
} }
@ -502,7 +500,7 @@ namespace spot
->push_back(bo2->first()->clone()); ->push_back(bo2->first()->clone());
if (j != i) if (j != i)
{ {
destroy(*j); (*j)->destroy();
*j = 0; *j = 0;
} }
} }
@ -523,7 +521,7 @@ namespace spot
{ {
tmpOther->push_back((*i)->clone()); tmpOther->push_back((*i)->clone());
} }
destroy(*i); (*i)->destroy();
} }
break; break;

View file

@ -20,7 +20,6 @@
// 02111-1307, USA. // 02111-1307, USA.
#include "contain.hh" #include "contain.hh"
#include "destroy.hh"
#include "tunabbrev.hh" #include "tunabbrev.hh"
#include "ltlast/unop.hh" #include "ltlast/unop.hh"
#include "ltlast/binop.hh" #include "ltlast/binop.hh"
@ -51,7 +50,7 @@ namespace spot
delete i->second.translation; delete i->second.translation;
const formula* f = i->first; const formula* f = i->first;
translated_.erase(i); translated_.erase(i);
destroy(f); f->destroy();
} }
} }
@ -89,7 +88,7 @@ namespace spot
record_* rl = register_formula_(l); record_* rl = register_formula_(l);
const formula* ng = unop::instance(unop::Not, g->clone()); const formula* ng = unop::instance(unop::Not, g->clone());
record_* rng = register_formula_(ng); record_* rng = register_formula_(ng);
destroy(ng); ng->destroy();
return incompatible_(rl, rng); return incompatible_(rl, rng);
} }
@ -102,8 +101,8 @@ namespace spot
record_* rnl = register_formula_(nl); record_* rnl = register_formula_(nl);
const formula* ng = unop::instance(unop::Not, g->clone()); const formula* ng = unop::instance(unop::Not, g->clone());
record_* rng = register_formula_(ng); record_* rng = register_formula_(ng);
destroy(nl); nl->destroy();
destroy(ng); ng->destroy();
return incompatible_(rnl, rng); return incompatible_(rnl, rng);
} }
@ -181,19 +180,19 @@ namespace spot
// if (a U b) => b, then keep b ! // if (a U b) => b, then keep b !
if (stronger && lcc->contained(bo, b)) if (stronger && lcc->contained(bo, b))
{ {
destroy(a); a->destroy();
result_ = b; result_ = b;
} }
// if a => b, then a U b = b. // if a => b, then a U b = b.
else if ((!stronger) && lcc->contained(a, b)) else if ((!stronger) && lcc->contained(a, b))
{ {
destroy(a); a->destroy();
result_ = b; result_ = b;
} }
// if !a => b, then a U b = Fb // if !a => b, then a U b = Fb
else if (lcc->neg_contained(a, b)) else if (lcc->neg_contained(a, b))
{ {
destroy(a); a->destroy();
result_ = unop::instance(unop::F, b); result_ = unop::instance(unop::F, b);
} }
else else
@ -205,19 +204,19 @@ namespace spot
// if (a R b) => b, then keep b ! // if (a R b) => b, then keep b !
if (stronger && lcc->contained(b, bo)) if (stronger && lcc->contained(b, bo))
{ {
destroy(a); a->destroy();
result_ = b; result_ = b;
} }
// if b => a, then a R b = b. // if b => a, then a R b = b.
else if ((!stronger) && lcc->contained(b, a)) else if ((!stronger) && lcc->contained(b, a))
{ {
destroy(a); a->destroy();
result_ = b; result_ = b;
} }
// if a => !b, then a R b = Gb // if a => !b, then a R b = Gb
else if (lcc->contained_neg(a, b)) else if (lcc->contained_neg(a, b))
{ {
destroy(a); a->destroy();
result_ = unop::instance(unop::G, b); result_ = unop::instance(unop::G, b);
} }
else else
@ -266,7 +265,7 @@ namespace spot
// if i => j, then i|j = j // if i => j, then i|j = j
else if (lcc->contained((*res)[i], (*res)[j])) else if (lcc->contained((*res)[i], (*res)[j]))
{ {
destroy((*res)[i]); (*res)[i]->destroy();
(*res)[i] = 0; (*res)[i] = 0;
changed = true; changed = true;
break; break;
@ -274,7 +273,7 @@ namespace spot
// if j => i, then i|j = i // if j => i, then i|j = i
else if (lcc->contained((*res)[j], (*res)[i])) else if (lcc->contained((*res)[j], (*res)[i]))
{ {
destroy((*res)[j]); (*res)[j]->destroy();
(*res)[j] = 0; (*res)[j] = 0;
changed = true; changed = true;
} }
@ -299,14 +298,14 @@ namespace spot
// if i => j, then i&j = i // if i => j, then i&j = i
else if (lcc->contained((*res)[i], (*res)[j])) else if (lcc->contained((*res)[i], (*res)[j]))
{ {
destroy((*res)[j]); (*res)[j]->destroy();
(*res)[j] = 0; (*res)[j] = 0;
changed = true; changed = true;
} }
// if j => i, then i&j = j // if j => i, then i&j = j
else if (lcc->contained((*res)[j], (*res)[i])) else if (lcc->contained((*res)[j], (*res)[i]))
{ {
destroy((*res)[i]); (*res)[i]->destroy();
(*res)[i] = 0; (*res)[i] = 0;
changed = true; changed = true;
break; break;
@ -329,7 +328,7 @@ namespace spot
constant_: constant_:
for (unsigned i = 0; i < mos; ++i) for (unsigned i = 0; i < mos; ++i)
if ((*res)[i]) if ((*res)[i])
destroy((*res)[i]); (*res)[i]->destroy();
delete res; delete res;
} }
@ -354,7 +353,7 @@ namespace spot
// reduce_tau03_visitor does not handle Xor, Implies, and Equiv. // reduce_tau03_visitor does not handle Xor, Implies, and Equiv.
f = unabbreviate_ltl(f); f = unabbreviate_ltl(f);
const_cast<formula*>(f)->accept(v); const_cast<formula*>(f)->accept(v);
destroy(f); f->destroy();
delete v.lcc; delete v.lcc;
return v.result(); return v.result();
} }

View file

@ -28,7 +28,7 @@ namespace spot
void void
destroy(const formula* f) destroy(const formula* f)
{ {
formula::destroy(const_cast<formula*>(f)); f->destroy();
} }
} }
} }

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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -28,9 +28,17 @@ namespace spot
{ {
namespace ltl namespace ltl
{ {
#if __GNUC__
/// \brief Destroys a formula /// \brief Destroys a formula
/// \ingroup ltl_essential /// \ingroup ltl_essential
/// \deprecated Use f->destroy() instead.
void destroy(const formula *f) __attribute__ ((deprecated));
#else
/// \brief Destroys a formula
/// \ingroup ltl_essential
/// \deprecated Use f->destroy() instead.
void destroy(const formula *f); void destroy(const formula *f);
#endif
} }
} }

View file

@ -28,7 +28,6 @@
#include "lunabbrev.hh" #include "lunabbrev.hh"
#include "simpfg.hh" #include "simpfg.hh"
#include "nenoform.hh" #include "nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "contain.hh" #include "contain.hh"
namespace spot namespace spot
@ -137,14 +136,14 @@ namespace spot
if (syntactic_implication(f1, f2)) if (syntactic_implication(f1, f2))
{ {
result_ = f2; result_ = f2;
destroy(f1); f1->destroy();
return; return;
} }
/* !b < a => a U b = Fb */ /* !b < a => a U b = Fb */
if (syntactic_implication_neg(f2, f1, false)) if (syntactic_implication_neg(f2, f1, false))
{ {
result_ = unop::instance(unop::F, f2); result_ = unop::instance(unop::F, f2);
destroy(f1); f1->destroy();
return; return;
} }
/* a < b => a U (b U c) = (b U c) */ /* a < b => a U (b U c) = (b U c) */
@ -154,7 +153,7 @@ namespace spot
&& syntactic_implication(f1, bo->first())) && syntactic_implication(f1, bo->first()))
{ {
result_ = f2; result_ = f2;
destroy(f1); f1->destroy();
return; return;
} }
} }
@ -165,14 +164,14 @@ namespace spot
if (syntactic_implication(f2, f1)) if (syntactic_implication(f2, f1))
{ {
result_ = f2; result_ = f2;
destroy(f1); f1->destroy();
return; return;
} }
/* b < !a => a R b = Gb */ /* b < !a => a R b = Gb */
if (syntactic_implication_neg(f2, f1, true)) if (syntactic_implication_neg(f2, f1, true))
{ {
result_ = unop::instance(unop::G, f2); result_ = unop::instance(unop::G, f2);
destroy(f1); f1->destroy();
return; return;
} }
/* b < a => a R (b R c) = b R c */ /* b < a => a R (b R c) = b R c */
@ -182,7 +181,7 @@ namespace spot
&& syntactic_implication(bo->first(), f1)) && syntactic_implication(bo->first(), f1))
{ {
result_ = f2; result_ = f2;
destroy(f1); f1->destroy();
return; return;
} }
} }
@ -230,7 +229,7 @@ namespace spot
(mo->op() == multop::And))) (mo->op() == multop::And)))
{ {
// We keep f2 // We keep f2
destroy(*f1); (*f1)->destroy();
res->erase(f1); res->erase(f1);
removed = true; removed = true;
break; break;
@ -241,7 +240,7 @@ namespace spot
(mo->op() == multop::And))) (mo->op() == multop::And)))
{ {
// We keep f1 // We keep f1
destroy(*f2); (*f2)->destroy();
res->erase(f2); res->erase(f2);
removed = true; removed = true;
break; break;
@ -261,7 +260,7 @@ namespace spot
{ {
for (multop::vec::iterator j = res->begin(); for (multop::vec::iterator j = res->begin();
j != res->end(); j++) j != res->end(); j++)
destroy(*j); (*j)->destroy();
res->clear(); res->clear();
delete res; delete res;
if (mo->op() == multop::Or) if (mo->op() == multop::Or)
@ -309,7 +308,7 @@ namespace spot
assert(n < 100); assert(n < 100);
if (prev) if (prev)
{ {
destroy(prev); prev->destroy();
prev = const_cast<formula*>(f); prev = const_cast<formula*>(f);
} }
else else
@ -318,15 +317,15 @@ namespace spot
} }
f1 = unabbreviate_logic(f); f1 = unabbreviate_logic(f);
f2 = simplify_f_g(f1); f2 = simplify_f_g(f1);
destroy(f1); f1->destroy();
f1 = negative_normal_form(f2); f1 = negative_normal_form(f2);
destroy(f2); f2->destroy();
f2 = f1; f2 = f1;
if (opt & Reduce_Basics) if (opt & Reduce_Basics)
{ {
f1 = basic_reduce(f2); f1 = basic_reduce(f2);
destroy(f2); f2->destroy();
f2 = f1; f2 = f1;
} }
@ -336,7 +335,7 @@ namespace spot
reduce_visitor v(opt); reduce_visitor v(opt);
f2->accept(v); f2->accept(v);
f1 = v.result(); f1 = v.result();
destroy(f2); f2->destroy();
f2 = f1; f2 = f1;
} }
@ -347,12 +346,12 @@ namespace spot
formula* f1 = formula* f1 =
reduce_tau03(f2, reduce_tau03(f2,
opt & Reduce_Containment_Checks_Stronger); opt & Reduce_Containment_Checks_Stronger);
destroy(f2); f2->destroy();
f2 = f1; f2 = f1;
} }
f = f2; f = f2;
} }
destroy(prev); prev->destroy();
return const_cast<formula*>(f); return const_cast<formula*>(f);
} }
} }

View file

@ -26,7 +26,6 @@
#include "lunabbrev.hh" #include "lunabbrev.hh"
#include "simpfg.hh" #include "simpfg.hh"
#include "nenoform.hh" #include "nenoform.hh"
#include "ltlvisit/destroy.hh"
namespace spot namespace spot
{ {
@ -408,12 +407,12 @@ namespace spot
if (special_case(tmp)) if (special_case(tmp))
{ {
result_ = true; result_ = true;
destroy(tmp); tmp->destroy();
return; return;
} }
if (syntactic_implication(tmp, f)) if (syntactic_implication(tmp, f))
result_ = true; result_ = true;
destroy(tmp); tmp->destroy();
return; return;
} }
case unop::G: case unop::G:
@ -425,12 +424,12 @@ namespace spot
if (special_case(tmp)) if (special_case(tmp))
{ {
result_ = true; result_ = true;
destroy(tmp); tmp->destroy();
return; return;
} }
if (syntactic_implication(tmp, f)) if (syntactic_implication(tmp, f))
result_ = true; result_ = true;
destroy(tmp); tmp->destroy();
return; return;
} }
case unop::Finish: case unop::Finish:
@ -581,24 +580,24 @@ namespace spot
l = unop::instance(unop::Not, l); l = unop::instance(unop::Not, l);
formula* tmp = unabbreviate_logic(l); formula* tmp = unabbreviate_logic(l);
destroy(l); l->destroy();
l = simplify_f_g(tmp); l = simplify_f_g(tmp);
destroy(tmp); tmp->destroy();
tmp = negative_normal_form(l); tmp = negative_normal_form(l);
destroy(l); l->destroy();
l = tmp; l = tmp;
tmp = unabbreviate_logic(r); tmp = unabbreviate_logic(r);
destroy(r); r->destroy();
r = simplify_f_g(tmp); r = simplify_f_g(tmp);
destroy(tmp); tmp->destroy();
tmp = negative_normal_form(r); tmp = negative_normal_form(r);
destroy(r); r->destroy();
r = tmp; r = tmp;
bool result = syntactic_implication(l, r); bool result = syntactic_implication(l, r);
destroy(l); l->destroy();
destroy(r); r->destroy();
return result; return result;
} }
} }

View file

@ -22,7 +22,6 @@
#include <ostream> #include <ostream>
#include <sstream> #include <sstream>
#include <cassert> #include <cassert>
#include <ltlvisit/destroy.hh>
#include <ltlvisit/tostring.hh> #include <ltlvisit/tostring.hh>
#include <ltlvisit/tostring.hh> #include <ltlvisit/tostring.hh>
#include <ltlast/atomic_prop.hh> #include <ltlast/atomic_prop.hh>
@ -156,7 +155,7 @@ namespace spot
ltl::atomic_prop::instance(s.str(), ltl::atomic_prop::instance(s.str(),
ltl::default_environment::instance()); ltl::default_environment::instance());
int res = register_acceptance_variable(f, for_me); int res = register_acceptance_variable(f, for_me);
ltl::destroy(f); f->destroy();
return res; return res;
} }
@ -278,7 +277,7 @@ namespace spot
// formula itself. // formula itself.
release_variables(var, n); release_variables(var, n);
if (f) if (f)
ltl::destroy(f); f->destroy();
var_refs.erase(cur); var_refs.erase(cur);
} }

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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -25,7 +25,6 @@
#include "bddprint.hh" #include "bddprint.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "formula2bdd.hh" #include "formula2bdd.hh"
#include "ltlvisit/destroy.hh"
namespace spot namespace spot
{ {
@ -202,7 +201,7 @@ namespace spot
{ {
const ltl::formula* f = bdd_to_formula(b, d); const ltl::formula* f = bdd_to_formula(b, d);
to_string(f, os); to_string(f, os);
destroy(f); f->destroy();
return os; return os;
} }

View file

@ -23,7 +23,6 @@
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
#include <iostream> #include <iostream>
#include "ltlvisit/destroy.hh"
#include "tgba/formula2bdd.hh" #include "tgba/formula2bdd.hh"
#include "misc/bddop.hh" #include "misc/bddop.hh"
#include "taa.hh" #include "taa.hh"
@ -99,7 +98,7 @@ namespace spot
taa::add_condition(transition* t, const ltl::formula* f) taa::add_condition(transition* t, const ltl::formula* f)
{ {
t->condition &= formula_to_bdd(f, dict_, this); t->condition &= formula_to_bdd(f, dict_, this);
ltl::destroy(f); f->destroy();
} }
void void
@ -125,7 +124,7 @@ namespace spot
bdd_dict::fv_map::iterator i = dict_->acc_map.find(f); bdd_dict::fv_map::iterator i = dict_->acc_map.find(f);
assert(i != dict_->acc_map.end()); assert(i != dict_->acc_map.end());
ltl::destroy(f); f->destroy();
bdd v = bdd_ithvar(i->second); bdd v = bdd_ithvar(i->second);
t->acceptance_conditions |= v & bdd_exist(neg_acceptance_conditions_, v); t->acceptance_conditions |= v & bdd_exist(neg_acceptance_conditions_, v);
} }

View file

@ -19,8 +19,8 @@
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA. // 02111-1307, USA.
#include "ltlvisit/destroy.hh"
#include "tgbabddconcretefactory.hh" #include "tgbabddconcretefactory.hh"
namespace spot namespace spot
{ {
tgba_bdd_concrete_factory::tgba_bdd_concrete_factory(bdd_dict* dict) tgba_bdd_concrete_factory::tgba_bdd_concrete_factory(bdd_dict* dict)
@ -32,7 +32,7 @@ namespace spot
{ {
acc_map_::iterator ai; acc_map_::iterator ai;
for (ai = acc_.begin(); ai != acc_.end(); ++ai) for (ai = acc_.begin(); ai != acc_.end(); ++ai)
destroy(ai->first); ai->first->destroy();
get_dict()->unregister_all_my_variables(this); get_dict()->unregister_all_my_variables(this);
} }

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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -21,7 +21,6 @@
#include "ltlast/atomic_prop.hh" #include "ltlast/atomic_prop.hh"
#include "ltlast/constant.hh" #include "ltlast/constant.hh"
#include "ltlvisit/destroy.hh"
#include "tgbaexplicit.hh" #include "tgbaexplicit.hh"
#include "tgba/formula2bdd.hh" #include "tgba/formula2bdd.hh"
#include "misc/bddop.hh" #include "misc/bddop.hh"
@ -187,7 +186,7 @@ namespace spot
tgba_explicit::add_condition(transition* t, const ltl::formula* f) tgba_explicit::add_condition(transition* t, const ltl::formula* f)
{ {
t->condition &= formula_to_bdd(f, dict_, this); t->condition &= formula_to_bdd(f, dict_, this);
ltl::destroy(f); f->destroy();
} }
void void
@ -201,7 +200,7 @@ namespace spot
tgba_explicit::declare_acceptance_condition(const ltl::formula* f) tgba_explicit::declare_acceptance_condition(const ltl::formula* f)
{ {
int v = dict_->register_acceptance_variable(f, this); int v = dict_->register_acceptance_variable(f, this);
ltl::destroy(f); f->destroy();
bdd neg = bdd_nithvar(v); bdd neg = bdd_nithvar(v);
neg_acceptance_conditions_ &= neg; neg_acceptance_conditions_ &= neg;
@ -287,7 +286,7 @@ namespace spot
/* If this second assert fails and the first doesn't, /* If this second assert fails and the first doesn't,
things are badly broken. This has already happened. */ things are badly broken. This has already happened. */
assert(i != dict_->acc_map.end()); assert(i != dict_->acc_map.end());
ltl::destroy(f); f->destroy();
bdd v = bdd_ithvar(i->second); bdd v = bdd_ithvar(i->second);
v &= bdd_exist(neg_acceptance_conditions_, v); v &= bdd_exist(neg_acceptance_conditions_, v);
return v; return v;

View file

@ -21,7 +21,6 @@
#include "tgba/public.hh" #include "tgba/public.hh"
#include "tgbafromfile.hh" #include "tgbafromfile.hh"
#include "ltlvisit/destroy.hh"
namespace spot namespace spot
{ {
@ -56,7 +55,7 @@ namespace spot
{ {
if (f_) if (f_)
{ {
ltl::destroy(f_); f_->destroy();
f_ = 0; f_ = 0;
} }
std::string line = ""; std::string line = "";
@ -94,4 +93,3 @@ namespace spot
return formula_; return formula_;
} }
} }

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

View file

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

View file

@ -27,7 +27,6 @@
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlvisit/lunabbrev.hh" #include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh" #include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/postfix.hh" #include "ltlvisit/postfix.hh"
#include "ltlvisit/apcollect.hh" #include "ltlvisit/apcollect.hh"
@ -66,7 +65,7 @@ namespace spot
{ {
fv_map::iterator i; fv_map::iterator i;
for (i = next_map.begin(); i != next_map.end(); ++i) for (i = next_map.begin(); i != next_map.end(); ++i)
destroy(i->first); i->first->destroy();
dict->unregister_all_my_variables(this); dict->unregister_all_my_variables(this);
} }
@ -574,7 +573,7 @@ namespace spot
formula_to_bdd_map::iterator i = f2b_.begin(); formula_to_bdd_map::iterator i = f2b_.begin();
const formula* f = i->first; const formula* f = i->first;
f2b_.erase(i); f2b_.erase(i);
destroy(f); f->destroy();
} }
} }
@ -626,7 +625,7 @@ namespace spot
if (i->second != f) if (i->second != f)
{ {
// The translated bdd maps to an already seen formula. // The translated bdd maps to an already seen formula.
destroy(f); f->destroy();
f = i->second->clone(); f = i->second->clone();
} }
else if (new_variable && lcc_) else if (new_variable && lcc_)
@ -640,7 +639,7 @@ namespace spot
{ {
f2b_[f] = j->second; f2b_[f] = j->second;
i->second = j->first; i->second = j->first;
destroy(f); f->destroy();
f = i->second->clone(); f = i->second->clone();
break; break;
} }
@ -687,7 +686,7 @@ namespace spot
else else
{ {
i->second[promises] |= conds; i->second[promises] |= conds;
destroy(dest); dest->destroy();
} }
} }
@ -706,13 +705,13 @@ namespace spot
// would involve negations at the BDD level. // would involve negations at the BDD level.
formula* f1 = unabbreviate_logic(f); formula* f1 = unabbreviate_logic(f);
formula* f2 = negative_normal_form(f1); formula* f2 = negative_normal_form(f1);
destroy(f1); f1->destroy();
// Simplify the formula, if requested. // Simplify the formula, if requested.
if (reduce_ltl) if (reduce_ltl)
{ {
formula* tmp = reduce(f2, reduce_ltl); formula* tmp = reduce(f2, reduce_ltl);
destroy(f2); f2->destroy();
f2 = tmp; f2 = tmp;
} }
@ -864,7 +863,7 @@ namespace spot
if (reduce_ltl) if (reduce_ltl)
{ {
formula* tmp = reduce(dest, reduce_ltl); formula* tmp = reduce(dest, reduce_ltl);
destroy(dest); dest->destroy();
dest = tmp; dest = tmp;
// Ignore the arc if the destination reduces to false. // Ignore the arc if the destination reduces to false.
if (dest == constant::false_instance()) if (dest == constant::false_instance())
@ -982,7 +981,7 @@ namespace spot
} }
else else
{ {
destroy(dest); dest->destroy();
} }
} }
} }
@ -990,7 +989,7 @@ namespace spot
// Free all formulae. // Free all formulae.
for (std::set<const formula*>::iterator i = formulae_seen.begin(); for (std::set<const formula*>::iterator i = formulae_seen.begin();
i != formulae_seen.end(); ++i) i != formulae_seen.end(); ++i)
destroy(*i); (*i)->destroy();
// Turn all promises into real acceptance conditions. // Turn all promises into real acceptance conditions.
a->complement_all_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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -23,7 +23,6 @@
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlvisit/lunabbrev.hh" #include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh" #include "ltlvisit/nenoform.hh"
#include "ltlvisit/destroy.hh"
#include "tgba/tgbabddconcretefactory.hh" #include "tgba/tgbabddconcretefactory.hh"
#include <cassert> #include <cassert>
@ -271,13 +270,13 @@ namespace spot
// would involve negations at the BDD level. // would involve negations at the BDD level.
const ltl::formula* f1 = ltl::unabbreviate_logic(f); const ltl::formula* f1 = ltl::unabbreviate_logic(f);
const ltl::formula* f2 = ltl::negative_normal_form(f1); const ltl::formula* f2 = ltl::negative_normal_form(f1);
ltl::destroy(f1); f1->destroy();
// Traverse the formula and draft the automaton in a factory. // Traverse the formula and draft the automaton in a factory.
tgba_bdd_concrete_factory fact(dict); tgba_bdd_concrete_factory fact(dict);
ltl_trad_visitor v(fact, true); ltl_trad_visitor v(fact, true);
f2->accept(v); f2->accept(v);
ltl::destroy(f2); f2->destroy();
fact.finish(); fact.finish();
// Finally setup the resulting automaton. // 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 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
@ -28,7 +28,6 @@
#include "reachiter.hh" #include "reachiter.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "tgba/formula2bdd.hh" #include "tgba/formula2bdd.hh"
#include "ltlvisit/destroy.hh"
namespace spot namespace spot
{ {
@ -167,7 +166,7 @@ namespace spot
const ltl::formula* f = bdd_to_formula(si->current_condition(), const ltl::formula* f = bdd_to_formula(si->current_condition(),
automata_->get_dict()); automata_->get_dict());
to_spin_string(f, os_); to_spin_string(f, os_);
destroy(f); f->destroy();
state* current = si->current_state(); state* current = si->current_state();
os_ << ") -> goto " << get_state_label(current, out) << std::endl; os_ << ") -> goto " << get_state_label(current, out) << std::endl;
delete current; 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), // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie. // Université Pierre et Marie Curie.
// //
@ -23,7 +23,6 @@
#include "tgba/tgbaexplicit.hh" #include "tgba/tgbaexplicit.hh"
#include "misc/random.hh" #include "misc/random.hh"
#include "ltlast/atomic_prop.hh" #include "ltlast/atomic_prop.hh"
#include "ltlvisit/destroy.hh"
#include <sstream> #include <sstream>
#include <list> #include <list>
#include <set> #include <set>

View file

@ -54,7 +54,6 @@ typedef std::map<std::string, bdd> formula_cache;
%code %code
{ {
#include "ltlast/constant.hh" #include "ltlast/constant.hh"
#include "ltlvisit/destroy.hh"
/* Unfortunately Bison 2.3 uses the same guards in all parsers :( */ /* Unfortunately Bison 2.3 uses the same guards in all parsers :( */
#undef BISON_POSITION_HH #undef BISON_POSITION_HH
#undef BISON_LOCATION_HH #undef BISON_LOCATION_HH
@ -87,7 +86,7 @@ typedef std::pair<bool, spot::ltl::formula*> pair;
%destructor { %destructor {
for (std::list<spot::ltl::formula*>::iterator i = $$->begin(); for (std::list<spot::ltl::formula*>::iterator i = $$->begin();
i != $$->end(); ++i) i != $$->end(); ++i)
spot::ltl::destroy(*i); (*i)->destroy();
delete $$; delete $$;
} acc_list } acc_list
@ -192,7 +191,7 @@ acc_list:
{ {
error_list.push_back(spot::tgba_parse_error(@2, error_list.push_back(spot::tgba_parse_error(@2,
"undeclared acceptance condition `" + *$2 + "'")); "undeclared acceptance condition `" + *$2 + "'"));
destroy(f); f->destroy();
// $2 will be destroyed on error recovery. // $2 will be destroyed on error recovery.
YYERROR; YYERROR;
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -32,7 +32,6 @@
#include <vector> #include <vector>
#include "ltlparse/public.hh" #include "ltlparse/public.hh"
#include "ltlvisit/apcollect.hh" #include "ltlvisit/apcollect.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/randomltl.hh" #include "ltlvisit/randomltl.hh"
#include "ltlvisit/tostring.hh" #include "ltlvisit/tostring.hh"
#include "ltlvisit/length.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) if (opt_l)
{ {
spot::ltl::formula* g = reduce(f); spot::ltl::formula* g = reduce(f);
spot::ltl::destroy(f); f->destroy();
if (spot::ltl::length(g) < opt_l) if (spot::ltl::length(g) < opt_l)
{ {
spot::ltl::destroy(g); g->destroy();
continue; continue;
} }
f = g; f = g;
@ -531,7 +530,7 @@ generate_formula(const spot::ltl::random_ltl& rl, int opt_f, int opt_s,
{ {
return f; return f;
} }
spot::ltl::destroy(f); f->destroy();
} }
assert(opt_u); assert(opt_u);
std::cerr << "Failed to generate another unique formula." std::cerr << "Failed to generate another unique formula."
@ -853,7 +852,7 @@ main(int argc, char** argv)
if (!f) if (!f)
exit(1); exit(1);
formula = spot::ltl_to_tgba_fm(f, dict, true); formula = spot::ltl_to_tgba_fm(f, dict, true);
spot::ltl::destroy(f); f->destroy();
} }
else if (opt_i) else if (opt_i)
{ {
@ -878,7 +877,7 @@ main(int argc, char** argv)
i != tmp->end(); ++i) i != tmp->end(); ++i)
apf->insert(dynamic_cast<spot::ltl::atomic_prop*> apf->insert(dynamic_cast<spot::ltl::atomic_prop*>
((*i)->clone())); ((*i)->clone()));
spot::ltl::destroy(f); f->destroy();
delete tmp; delete tmp;
} }
else else
@ -1157,7 +1156,7 @@ main(int argc, char** argv)
opt_ec = init_opt_ec; opt_ec = init_opt_ec;
for (spot::ltl::atomic_prop_set::iterator i = apf->begin(); for (spot::ltl::atomic_prop_set::iterator i = apf->begin();
i != apf->end(); ++i) i != apf->end(); ++i)
spot::ltl::destroy(*i); (*i)->destroy();
apf->clear(); apf->clear();
} }
while (opt_F || opt_i); while (opt_F || opt_i);
@ -1304,7 +1303,7 @@ main(int argc, char** argv)
for (spot::ltl::atomic_prop_set::iterator i = ap->begin(); for (spot::ltl::atomic_prop_set::iterator i = ap->begin();
i != ap->end(); ++i) i != ap->end(); ++i)
spot::ltl::destroy(*i); (*i)->destroy();
if (opt_i && strcmp(opt_i, "-")) 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), // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie. // Université Pierre et Marie Curie.
// //
@ -25,7 +25,6 @@
#include "tgbaalgos/reductgba_sim.hh" #include "tgbaalgos/reductgba_sim.hh"
#include "tgba/tgbareduc.hh" #include "tgba/tgbareduc.hh"
#include "ltlvisit/destroy.hh"
#include "ltlvisit/reduce.hh" #include "ltlvisit/reduce.hh"
#include "ltlast/allnodes.hh" #include "ltlast/allnodes.hh"
#include "ltlparse/public.hh" #include "ltlparse/public.hh"
@ -166,7 +165,7 @@ main(int argc, char** argv)
delete automatareduc; delete automatareduc;
#ifndef REDUCCMP #ifndef REDUCCMP
if (f != 0) if (f != 0)
spot::ltl::destroy(f); f->destroy();
#endif #endif
assert(spot::ltl::atomic_prop::instance_count() == 0); assert(spot::ltl::atomic_prop::instance_count() == 0);

View file

@ -1,6 +1,6 @@
#!@PYTHON@ #!@PYTHON@
# -*- mode: python; coding: iso-8859-1 -*- # -*- mode: python; coding: iso-8859-1 -*-
# Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de # Copyright (C) 2003, 2004, 2006, 2007, 2009 Laboratoire d'Informatique de
# Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), # Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
# Université Pierre et Marie Curie. # Université Pierre et Marie Curie.
# #
@ -453,7 +453,7 @@ if reduce_eventuniv:
opt = opt + spot.Reduce_Eventuality_And_Universality opt = opt + spot.Reduce_Eventuality_And_Universality
if opt != spot.Reduce_None: if opt != spot.Reduce_None:
f2 = spot.reduce(f, opt) f2 = spot.reduce(f, opt)
spot.destroy(f) f.destroy()
f = f2 f = f2
print "<p>Reduced formula is<code>", f, "</code></p>" print "<p>Reduced formula is<code>", f, "</code></p>"
@ -626,7 +626,7 @@ if draw_acc_run or print_acc_run:
sys.stdout.flush() sys.stdout.flush()
spot.destroy(f) f.destroy()
# Make sure degen is cleared before automaton. # Make sure degen is cleared before automaton.
del degen del degen
del automaton del automaton

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: iso-8859-1 -*- # -*- mode: python; coding: iso-8859-1 -*-
# 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 # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
# #
@ -100,7 +100,7 @@ if f:
concrete = 0 concrete = 0
else: else:
a = concrete = spot.ltl_to_tgba_lacim(f, dict) a = concrete = spot.ltl_to_tgba_lacim(f, dict)
spot.destroy(f) f.destroy()
del f del f
degeneralized = None degeneralized = None

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: iso-8859-1 -*- # -*- mode: python; coding: iso-8859-1 -*-
# 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 # département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie. # et Marie Curie.
# #
@ -34,14 +34,14 @@ for str1 in l:
if spot.format_parse_errors(spot.get_cout(), str1, p): if spot.format_parse_errors(spot.get_cout(), str1, p):
sys.exit(1) sys.exit(1)
str2 = str(f) str2 = str(f)
spot.destroy(f) f.destroy()
print str2 print str2
# Try to reparse the stringified formula # Try to reparse the stringified formula
f = spot.parse(str2, p, e) f = spot.parse(str2, p, e)
if spot.format_parse_errors(spot.get_cout(), str2, p): if spot.format_parse_errors(spot.get_cout(), str2, p):
sys.exit(1) sys.exit(1)
print f print f
spot.destroy(f) f.destroy()
assert spot.atomic_prop.instance_count() == 0 assert spot.atomic_prop.instance_count() == 0
assert spot.binop.instance_count() == 0 assert spot.binop.instance_count() == 0

View file

@ -60,7 +60,7 @@ del op2, op3
assert spot.atomic_prop.instance_count() == 3 assert spot.atomic_prop.instance_count() == 3
assert spot.multop.instance_count() == 1 assert spot.multop.instance_count() == 1
spot.destroy(op4) op4.destroy()
del op4 del op4
assert spot.atomic_prop.instance_count() == 0 assert spot.atomic_prop.instance_count() == 0
@ -83,11 +83,11 @@ assert spot.binop.instance_count() == 3
assert spot.unop.instance_count() == 1 assert spot.unop.instance_count() == 1
assert spot.multop.instance_count() == 0 assert spot.multop.instance_count() == 0
spot.destroy(a) a.destroy()
del a del a
spot.destroy(b) b.destroy()
del b del b
spot.destroy(c) c.destroy()
del c del c
assert spot.atomic_prop.instance_count() == 3 assert spot.atomic_prop.instance_count() == 3
@ -95,7 +95,7 @@ assert spot.binop.instance_count() == 3
assert spot.unop.instance_count() == 1 assert spot.unop.instance_count() == 1
assert spot.multop.instance_count() == 0 assert spot.multop.instance_count() == 0
spot.destroy(f1) f1.destroy()
del f1 del f1
assert spot.atomic_prop.instance_count() == 2 assert spot.atomic_prop.instance_count() == 2
@ -103,7 +103,7 @@ assert spot.binop.instance_count() == 2
assert spot.unop.instance_count() == 1 assert spot.unop.instance_count() == 1
assert spot.multop.instance_count() == 0 assert spot.multop.instance_count() == 0
spot.destroy(f4) f4.destroy()
del f4 del f4
assert spot.atomic_prop.instance_count() == 1 assert spot.atomic_prop.instance_count() == 1
@ -111,7 +111,7 @@ assert spot.binop.instance_count() == 1
assert spot.unop.instance_count() == 0 assert spot.unop.instance_count() == 0
assert spot.multop.instance_count() == 0 assert spot.multop.instance_count() == 0
spot.destroy(f2) f2.destroy()
del f2 del f2
assert spot.atomic_prop.instance_count() == 0 assert spot.atomic_prop.instance_count() == 0