From 0c9c9fc6395acf60a5c0f7e1067fa8b7a4bf4913 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 27 Jan 2011 10:47:57 +0100 Subject: [PATCH] Replace delete by destroy in comments dealing with states. * src/tgba/succiter.hh, src/tgba/tgba.hh, src/tgba/tgbabddconcrete.hh, src/tgba/tgbaproduct.hh, src/tgba/tgbaunion.hh, src/tgbaalgos/bfssteps.hh, src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/gtec/explscc.hh, src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/replayrun.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/scc.hh: Update comments to say that we "destroy" a state instead of "deleting" it. --- ChangeLog | 12 ++++++++++++ src/tgba/succiter.hh | 5 +++++ src/tgba/tgba.hh | 8 ++++---- src/tgba/tgbabddconcrete.hh | 4 +++- src/tgba/tgbaproduct.hh | 2 +- src/tgba/tgbaunion.hh | 2 +- src/tgbaalgos/bfssteps.hh | 6 ++++-- src/tgbaalgos/gtec/ce.cc | 2 +- src/tgbaalgos/gtec/explscc.hh | 4 +++- src/tgbaalgos/gtec/gtec.cc | 6 +++--- src/tgbaalgos/replayrun.cc | 2 +- src/tgbaalgos/scc.cc | 2 +- src/tgbaalgos/scc.hh | 4 ++-- 13 files changed, 41 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9aba2639..576e4d073 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-01-27 Alexandre Duret-Lutz + + Replace delete by destroy in comments dealing with states. + + * src/tgba/succiter.hh, src/tgba/tgba.hh, + src/tgba/tgbabddconcrete.hh, src/tgba/tgbaproduct.hh, + src/tgba/tgbaunion.hh, src/tgbaalgos/bfssteps.hh, + src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/gtec/explscc.hh, + src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/replayrun.cc, + src/tgbaalgos/scc.cc, src/tgbaalgos/scc.hh: Update comments + to say that we "destroy" a state instead of "deleting" it. + 2011-01-26 Alexandre Duret-Lutz Update gspn interface for recent tools. diff --git a/src/tgba/succiter.hh b/src/tgba/succiter.hh index 4d82a4b16..b15b9393d 100644 --- a/src/tgba/succiter.hh +++ b/src/tgba/succiter.hh @@ -1,3 +1,5 @@ +// Copyright (C) 2011 Laboratoire de Recherche et Developpement de +// l'Epita (LRDE). // Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. @@ -85,6 +87,9 @@ namespace spot /// in the iteration. These actually correspond to the same /// destination. It just means there were several transitions, /// with different conditions, leading to the same state. + /// + /// The returned state should be destroyed (see state::destroy) + /// by the caller after it is no longer used. virtual state* current_state() const = 0; /// \brief Get the condition on the transition leading to this successor. /// diff --git a/src/tgba/tgba.hh b/src/tgba/tgba.hh index 03c7632fd..c434d7649 100644 --- a/src/tgba/tgba.hh +++ b/src/tgba/tgba.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Laboratoire de Recherche et Développement +// Copyright (C) 2009, 2011 Laboratoire de Recherche et Développement // de l'Epita (LRDE). // Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), @@ -77,7 +77,7 @@ namespace spot /// \brief Get the initial state of the automaton. /// /// The state has been allocated with \c new. It is the - /// responsability of the caller to \c delete it when no + /// responsability of the caller to \c destroy it when no /// longer needed. virtual state* get_init_state() const = 0; @@ -97,7 +97,7 @@ namespace spot /// /// \param local_state The state whose successors are to be explored. /// This pointer is not adopted in any way by \c succ_iter, and - /// it is still the caller's responsability to delete it when + /// it is still the caller's responsability to destroy it when /// appropriate (this can be done during the lifetime of /// the iterator). /// \param global_state In a product, the state of the global @@ -176,7 +176,7 @@ namespace spot /// /// \return 0 if the projection fails (\a s is unrelated to \a t), /// or a new \c state* (the projected state) that must be - /// deleted by the caller. + /// destroyed by the caller. virtual state* project_state(const state* s, const tgba* t) const; /// \brief Return the set of all acceptance conditions used diff --git a/src/tgba/tgbabddconcrete.hh b/src/tgba/tgbabddconcrete.hh index 0d42d154a..066c8a964 100644 --- a/src/tgba/tgbabddconcrete.hh +++ b/src/tgba/tgbabddconcrete.hh @@ -1,3 +1,5 @@ +// Copyright (C) 2011 Laboratoire de Recherche et Développement +// de l'Epita (LRDE). // Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), // Université Pierre et Marie Curie. @@ -56,7 +58,7 @@ namespace spot /// \code /// state_bdd* s = automata.get_init_state(); /// some_class some_instance(s->as_bdd()); - /// delete s; + /// s->destroy(); /// \endcode bdd get_init_bdd() const; diff --git a/src/tgba/tgbaproduct.hh b/src/tgba/tgbaproduct.hh index 2f1139ae6..48c9b3d50 100644 --- a/src/tgba/tgbaproduct.hh +++ b/src/tgba/tgbaproduct.hh @@ -42,7 +42,7 @@ namespace spot /// \param left The state from the left automaton. /// \param right The state from the right automaton. /// These states are acquired by spot::state_product, and will - /// be deleted on destruction. + /// be destroyed on destruction. state_product(state* left, state* right) : left_(left), right_(right) diff --git a/src/tgba/tgbaunion.hh b/src/tgba/tgbaunion.hh index 803727883..6f2201e83 100644 --- a/src/tgba/tgbaunion.hh +++ b/src/tgba/tgbaunion.hh @@ -41,7 +41,7 @@ namespace spot /// \param left The state from the left automaton. /// \param right The state from the right automaton. /// These states are acquired by spot::state_union, and will - /// be deleted on destruction. + /// be destroyed on destruction. state_union(state* left, state* right) : left_(left), right_(right) diff --git a/src/tgbaalgos/bfssteps.hh b/src/tgbaalgos/bfssteps.hh index df60354a3..77b215b46 100644 --- a/src/tgbaalgos/bfssteps.hh +++ b/src/tgbaalgos/bfssteps.hh @@ -1,3 +1,5 @@ +// Copyright (C) 2011 Laboratoire de Recherche et Developpement de +// l'Epita (LRDE). // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. @@ -62,8 +64,8 @@ namespace spot /// /// If you already have a map or a set which uses states as keys, /// you should probably arrange for filter() to return these keys, - /// and delete \a s. Otherwise you will have to define such a - /// set, just to be able to delete all the state* in a subclass. + /// and destroy \a s. Otherwise you will have to define such a + /// set, just to be able to destroy all the state* in a subclass. /// /// This function can return 0 if the given state should not be /// explored. diff --git a/src/tgbaalgos/gtec/ce.cc b/src/tgbaalgos/gtec/ce.cc index c7a06c51b..89707dd12 100644 --- a/src/tgbaalgos/gtec/ce.cc +++ b/src/tgbaalgos/gtec/ce.cc @@ -235,7 +235,7 @@ namespace spot { ecs_->print_stats(os); // FIXME: This is bogusly assuming run_ exists. (Even if we - // created it, the user might have delete it.) + // created it, the user might have deleted it.) os << run_->prefix.size() << " states in run_->prefix" << std::endl; os << run_->cycle.size() << " states in run_->cycle" << std::endl; } diff --git a/src/tgbaalgos/gtec/explscc.hh b/src/tgbaalgos/gtec/explscc.hh index b3cde4b3b..e67b8b475 100644 --- a/src/tgbaalgos/gtec/explscc.hh +++ b/src/tgbaalgos/gtec/explscc.hh @@ -1,3 +1,5 @@ +// Copyright (C) 2011 Laboratoire de Recherche et Développement de +// l'Epita (LRDE). // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. @@ -35,7 +37,7 @@ namespace spot virtual ~explicit_connected_component() {} /// \brief Check if the SCC contains states \a s. /// - /// Return the representative of \a s in the SCC, and delete \a + /// Return the representative of \a s in the SCC, and destroy \a /// s if it is different (acting like /// numbered_state_heap::filter), or 0 otherwise. virtual const state* has_state(const state* s) const = 0; diff --git a/src/tgbaalgos/gtec/gtec.cc b/src/tgbaalgos/gtec/gtec.cc index b9f4e69c0..7f48d2ec2 100644 --- a/src/tgbaalgos/gtec/gtec.cc +++ b/src/tgbaalgos/gtec/gtec.cc @@ -216,7 +216,7 @@ namespace spot } delete succ; - // Do not delete CURR: it is a key in H. + // Do not destroy CURR: it is a key in H. continue; } @@ -363,7 +363,7 @@ namespace spot void couvreur99_check_shy::clear_todo() { - // We must delete all states appearing in TODO + // We must destroy all states appearing in TODO // unless they are used as keys in H. while (!todo.empty()) { @@ -371,7 +371,7 @@ namespace spot for (succ_queue::iterator q = queue.begin(); q != queue.end(); ++q) { - // Delete the state if it is a clone of a + // Destroy the state if it is a clone of a // state in the heap... numbered_state_heap::state_index_p spi = ecs_->h->index(q->s); // ... or if it is an unknown state. diff --git a/src/tgbaalgos/replayrun.cc b/src/tgbaalgos/replayrun.cc index 4d9b297da..fefae932d 100644 --- a/src/tgbaalgos/replayrun.cc +++ b/src/tgbaalgos/replayrun.cc @@ -142,7 +142,7 @@ namespace spot // browse the actual outgoing transitions tgba_succ_iterator* j = a->succ_iter(s); // When not debugging, S is not used as key in SEEN, so we can - // delete it right now. + // destroy it right now. if (!debug) s->destroy(); for (j->first(); !j->done(); j->next()) diff --git a/src/tgbaalgos/scc.cc b/src/tgbaalgos/scc.cc index bbfe5419f..66f0ecca2 100644 --- a/src/tgbaalgos/scc.cc +++ b/src/tgbaalgos/scc.cc @@ -198,7 +198,7 @@ namespace spot } delete succ; - // Do not delete CURR: it is a key in H. + // Do not destroy CURR: it is a key in H. continue; } diff --git a/src/tgbaalgos/scc.hh b/src/tgbaalgos/scc.hh index e993f743b..45746a27c 100644 --- a/src/tgbaalgos/scc.hh +++ b/src/tgbaalgos/scc.hh @@ -152,7 +152,7 @@ namespace spot /// \brief Return the set of states of an SCC. /// /// The states in the returned list are still owned by the scc_map - /// instance. They should NOT be deleted by the client code. + /// instance. They should NOT be destroyed by the client code. /// /// \pre This should only be called once build_map() has run. const std::list& states_of(unsigned n) const; @@ -160,7 +160,7 @@ namespace spot /// \brief Return one state of an SCC. /// /// The state in the returned list is still owned by the scc_map - /// instance. It should NOT be deleted by the client code. + /// instance. It should NOT be destroyed by the client code. /// /// \pre This should only be called once build_map() has run. const state* one_state_of(unsigned n) const;