Implement a unicity table for states created by tgba_tba_proxy.

Suggested by Nikos Gorogiannis.

* src/tgba/tgbatba.hh (tgba_tba_proxy::create_state): New method.
(tgba_tba_proxy::uniq_map_): New attribute.
* src/tgba/tgbatba.cc (state_tba_proxy): Use the default
copy constructor.  Empty the destructor.  Implement an empty
destroy() method.  Use addresses for comparison.  Make clone()
a no-op.
(tgba_tba_proxy): Allocate and deallocate the unicity table.
Implement create_sates().
(tgba_tba_proxy, tgba_sba_proxy, tgba_tba_proxy_succ_iterator):
Adjust state construction to call create_state().
This commit is contained in:
Alexandre Duret-Lutz 2012-01-18 10:13:57 +01:00
parent 578c5894f5
commit 75032c9fc4
3 changed files with 100 additions and 20 deletions

View file

@ -1,5 +1,5 @@
// Copyright (C) 2010, 2011 Laboratoire de Recherche et Développement de
// l'Epita.
// Copyright (C) 2010, 2011, 2012 Laboratoire de Recherche et
// Développement de l'Epita.
// 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.
@ -97,12 +97,19 @@ namespace spot
/// then cached.
bdd union_acceptance_conditions_of_original_state(const state* s) const;
/// \brief Create a degeneralized state using the unicity table.
///
/// This is an internal function. \a s should be a fresh state
/// from the source automaton.
state* create_state(state* s, cycle_list::const_iterator acc) const;
protected:
virtual bdd compute_support_conditions(const state* state) const;
virtual bdd compute_support_variables(const state* state) const;
cycle_list acc_cycle_;
const tgba* a_;
private:
bdd the_acceptance_cond_;
typedef Sgi::hash_map<const state*, bdd,
@ -110,6 +117,9 @@ namespace spot
mutable accmap_t accmap_;
mutable accmap_t accmapu_;
/// Unicity table for degeneralized states. See create_state()
mutable void* uniq_map_;
// Disallow copy.
tgba_tba_proxy(const tgba_tba_proxy&);
tgba_tba_proxy& operator=(const tgba_tba_proxy&);