Hide the safra_tree_automaton type from the public interface.
We do that because the declaration of this type, which is local to src/tgba/tgbasafracomplement.cc has a member in an anonymous namespace, and some versions of g++-4.2 issue a very annoying warning about this legitimate code. See Bug 29365 on GCC's Bugzilla. Report by Silien Hong <silien.hong@lip6.fr>. * src/tgba/tgbasafracomplement.hh (safra_tree_automaton): Do not forward declare. (tgba_safra_complement): Use void* instead of safra_tree_automaton*. * src/tgba/tgbasafracomplement.cc: static_cast void* to safra_tree_automaton* anywhere needed.
This commit is contained in:
parent
498b44f742
commit
1fa1621a6b
4 changed files with 63 additions and 48 deletions
17
ChangeLog
17
ChangeLog
|
|
@ -1,3 +1,20 @@
|
||||||
|
2010-10-07 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
|
Hide the safra_tree_automaton type from the public interface.
|
||||||
|
|
||||||
|
We do that because the declaration of this type, which is local to
|
||||||
|
src/tgba/tgbasafracomplement.cc has a member in an anonymous
|
||||||
|
namespace, and some versions of g++-4.2 issue a very annoying
|
||||||
|
warning about this legitimate code. See Bug 29365 on GCC's
|
||||||
|
Bugzilla. Report by Silien Hong <silien.hong@lip6.fr>.
|
||||||
|
|
||||||
|
* src/tgba/tgbasafracomplement.hh (safra_tree_automaton): Do not
|
||||||
|
forward declare.
|
||||||
|
(tgba_safra_complement): Use void* instead of
|
||||||
|
safra_tree_automaton*.
|
||||||
|
* src/tgba/tgbasafracomplement.cc: static_cast void* to
|
||||||
|
safra_tree_automaton* anywhere needed.
|
||||||
|
|
||||||
2010-05-20 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
2010-05-20 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
Fix the --enable-optimizations check.
|
Fix the --enable-optimizations check.
|
||||||
|
|
|
||||||
1
THANKS
1
THANKS
|
|
@ -6,4 +6,5 @@ Jean-Michel Couvreur
|
||||||
Jean-Michel Ilié
|
Jean-Michel Ilié
|
||||||
Kristin Y. Rozier
|
Kristin Y. Rozier
|
||||||
Rüdiger Ehlers
|
Rüdiger Ehlers
|
||||||
|
Silien Hong
|
||||||
Yann Thierry-Mieg
|
Yann Thierry-Mieg
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (C) 2009 Laboratoire de Recherche et Développement
|
// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement
|
||||||
// de l'Epita (LRDE).
|
// de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -50,7 +50,6 @@ namespace spot
|
||||||
operator()(const safra_tree* left,
|
operator()(const safra_tree* left,
|
||||||
const safra_tree* right) const;
|
const safra_tree* right) const;
|
||||||
};
|
};
|
||||||
} // anonymous.
|
|
||||||
|
|
||||||
/// \brief Automaton with Safra's tree as states.
|
/// \brief Automaton with Safra's tree as states.
|
||||||
struct safra_tree_automaton
|
struct safra_tree_automaton
|
||||||
|
|
@ -74,8 +73,6 @@ namespace spot
|
||||||
const tgba* a_;
|
const tgba* a_;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
/// \brief A Safra tree, used as state during the determinization
|
/// \brief A Safra tree, used as state during the determinization
|
||||||
/// of a Büchi automaton
|
/// of a Büchi automaton
|
||||||
///
|
///
|
||||||
|
|
@ -1120,7 +1117,8 @@ namespace spot
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TRANSFORM_TO_TGBA
|
#if TRANSFORM_TO_TGBA
|
||||||
unsigned nb_acc = safra_->get_nb_acceptance_pairs();
|
unsigned nb_acc =
|
||||||
|
static_cast<safra_tree_automaton*>(safra_)->get_nb_acceptance_pairs();
|
||||||
all_acceptance_cond_ = bddfalse;
|
all_acceptance_cond_ = bddfalse;
|
||||||
neg_acceptance_cond_ = bddtrue;
|
neg_acceptance_cond_ = bddtrue;
|
||||||
acceptance_cond_vec_.reserve(nb_acc);
|
acceptance_cond_vec_.reserve(nb_acc);
|
||||||
|
|
@ -1138,15 +1136,15 @@ namespace spot
|
||||||
tgba_safra_complement::~tgba_safra_complement()
|
tgba_safra_complement::~tgba_safra_complement()
|
||||||
{
|
{
|
||||||
get_dict()->unregister_all_my_variables(safra_);
|
get_dict()->unregister_all_my_variables(safra_);
|
||||||
delete safra_;
|
delete static_cast<safra_tree_automaton*>(safra_);
|
||||||
}
|
}
|
||||||
|
|
||||||
state*
|
state*
|
||||||
tgba_safra_complement::get_init_state() const
|
tgba_safra_complement::get_init_state() const
|
||||||
{
|
{
|
||||||
bitset_t empty(safra_->get_nb_acceptance_pairs());
|
safra_tree_automaton* a = static_cast<safra_tree_automaton*>(safra_);
|
||||||
return new state_complement(empty, empty, safra_->get_initial_state(),
|
bitset_t empty(a->get_nb_acceptance_pairs());
|
||||||
false);
|
return new state_complement(empty, empty, a->get_initial_state(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1189,19 +1187,20 @@ namespace spot
|
||||||
const state* /* = 0 */,
|
const state* /* = 0 */,
|
||||||
const tgba* /* = 0 */) const
|
const tgba* /* = 0 */) const
|
||||||
{
|
{
|
||||||
|
const safra_tree_automaton* a = static_cast<safra_tree_automaton*>(safra_);
|
||||||
const state_complement* s =
|
const state_complement* s =
|
||||||
dynamic_cast<const state_complement*>(local_state);
|
dynamic_cast<const state_complement*>(local_state);
|
||||||
assert(s);
|
assert(s);
|
||||||
safra_tree_automaton::automaton_t::const_iterator tr =
|
safra_tree_automaton::automaton_t::const_iterator tr =
|
||||||
safra_->automaton.find(const_cast<safra_tree*>(s->get_safra()));
|
a->automaton.find(const_cast<safra_tree*>(s->get_safra()));
|
||||||
|
|
||||||
typedef safra_tree_automaton::transition_list::const_iterator trans_iter;
|
typedef safra_tree_automaton::transition_list::const_iterator trans_iter;
|
||||||
|
|
||||||
if (tr != safra_->automaton.end())
|
if (tr != a->automaton.end())
|
||||||
{
|
{
|
||||||
bdd condition = bddfalse;
|
bdd condition = bddfalse;
|
||||||
tgba_safra_complement_succ_iterator::succ_list_t succ_list;
|
tgba_safra_complement_succ_iterator::succ_list_t succ_list;
|
||||||
int nb_acceptance_pairs = safra_->get_nb_acceptance_pairs();
|
int nb_acceptance_pairs = a->get_nb_acceptance_pairs();
|
||||||
bitset_t e(nb_acceptance_pairs);
|
bitset_t e(nb_acceptance_pairs);
|
||||||
|
|
||||||
if (!s->get_use_bitset()) // if \delta'(q, a)
|
if (!s->get_use_bitset()) // if \delta'(q, a)
|
||||||
|
|
@ -1311,14 +1310,14 @@ namespace spot
|
||||||
bdd
|
bdd
|
||||||
tgba_safra_complement::compute_support_conditions(const state* state) const
|
tgba_safra_complement::compute_support_conditions(const state* state) const
|
||||||
{
|
{
|
||||||
|
const safra_tree_automaton* a = static_cast<safra_tree_automaton*>(safra_);
|
||||||
const state_complement* s = dynamic_cast<const state_complement*>(state);
|
const state_complement* s = dynamic_cast<const state_complement*>(state);
|
||||||
assert(s);
|
assert(s);
|
||||||
typedef safra_tree_automaton::automaton_t::const_iterator auto_it;
|
typedef safra_tree_automaton::automaton_t::const_iterator auto_it;
|
||||||
typedef safra_tree_automaton::transition_list::const_iterator trans_it;
|
typedef safra_tree_automaton::transition_list::const_iterator trans_it;
|
||||||
auto_it node(safra_->
|
auto_it node(a->automaton.find(const_cast<safra_tree*>(s->get_safra())));
|
||||||
automaton.find(const_cast<safra_tree*>(s->get_safra())));
|
|
||||||
|
|
||||||
if (node == safra_->automaton.end())
|
if (node == a->automaton.end())
|
||||||
return bddtrue;
|
return bddtrue;
|
||||||
|
|
||||||
bdd res = bddtrue;
|
bdd res = bddtrue;
|
||||||
|
|
@ -1331,14 +1330,14 @@ namespace spot
|
||||||
bdd
|
bdd
|
||||||
tgba_safra_complement::compute_support_variables(const state* state) const
|
tgba_safra_complement::compute_support_variables(const state* state) const
|
||||||
{
|
{
|
||||||
|
const safra_tree_automaton* a = static_cast<safra_tree_automaton*>(safra_);
|
||||||
const state_complement* s = dynamic_cast<const state_complement*>(state);
|
const state_complement* s = dynamic_cast<const state_complement*>(state);
|
||||||
assert(s);
|
assert(s);
|
||||||
typedef safra_tree_automaton::automaton_t::const_iterator auto_it;
|
typedef safra_tree_automaton::automaton_t::const_iterator auto_it;
|
||||||
typedef safra_tree_automaton::transition_list::const_iterator trans_it;
|
typedef safra_tree_automaton::transition_list::const_iterator trans_it;
|
||||||
auto_it node(safra_->
|
auto_it node(a->automaton.find(const_cast<safra_tree*>(s->get_safra())));
|
||||||
automaton.find(const_cast<safra_tree*>(s->get_safra())));
|
|
||||||
|
|
||||||
if (node == safra_->automaton.end())
|
if (node == a->automaton.end())
|
||||||
return bddtrue;
|
return bddtrue;
|
||||||
|
|
||||||
bdd res = bddtrue;
|
bdd res = bddtrue;
|
||||||
|
|
@ -1352,6 +1351,7 @@ namespace spot
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
void display_safra(const tgba_safra_complement* a)
|
void display_safra(const tgba_safra_complement* a)
|
||||||
{
|
{
|
||||||
test::print_safra_automaton(a->get_safra());
|
test::print_safra_automaton(static_cast<safra_tree_automaton*>
|
||||||
|
(a->get_safra()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,6 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
struct safra_tree_automaton;
|
|
||||||
|
|
||||||
/// \brief Build a complemented automaton.
|
/// \brief Build a complemented automaton.
|
||||||
/// \ingroup tgba_on_the_fly_algorithms
|
/// \ingroup tgba_on_the_fly_algorithms
|
||||||
///
|
///
|
||||||
|
|
@ -56,11 +54,6 @@ namespace spot
|
||||||
tgba_safra_complement(const tgba* a);
|
tgba_safra_complement(const tgba* a);
|
||||||
virtual ~tgba_safra_complement();
|
virtual ~tgba_safra_complement();
|
||||||
|
|
||||||
safra_tree_automaton* get_safra() const
|
|
||||||
{
|
|
||||||
return safra_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// tgba interface.
|
// tgba interface.
|
||||||
virtual state* get_init_state() const;
|
virtual state* get_init_state() const;
|
||||||
virtual tgba_succ_iterator*
|
virtual tgba_succ_iterator*
|
||||||
|
|
@ -73,12 +66,17 @@ namespace spot
|
||||||
virtual bdd all_acceptance_conditions() const;
|
virtual bdd all_acceptance_conditions() const;
|
||||||
virtual bdd neg_acceptance_conditions() const;
|
virtual bdd neg_acceptance_conditions() const;
|
||||||
|
|
||||||
|
void* get_safra() const
|
||||||
|
{
|
||||||
|
return safra_;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bdd compute_support_conditions(const state* state) const;
|
virtual bdd compute_support_conditions(const state* state) const;
|
||||||
virtual bdd compute_support_variables(const state* state) const;
|
virtual bdd compute_support_variables(const state* state) const;
|
||||||
private:
|
private:
|
||||||
const tgba* automaton_;
|
const tgba* automaton_;
|
||||||
safra_tree_automaton* safra_;
|
void* safra_;
|
||||||
#if TRANSFORM_TO_TBA
|
#if TRANSFORM_TO_TBA
|
||||||
bdd the_acceptance_cond_;
|
bdd the_acceptance_cond_;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -88,7 +86,6 @@ namespace spot
|
||||||
// Map to i the i-th acceptance condition of the final automaton.
|
// Map to i the i-th acceptance condition of the final automaton.
|
||||||
std::vector<int> acceptance_cond_vec_;
|
std::vector<int> acceptance_cond_vec_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Produce a dot output of the Safra automaton associated
|
/// \brief Produce a dot output of the Safra automaton associated
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue