From d2f11e407594c5d045ed6a4e4ca7b34d448ef744 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 18 Mar 2015 20:52:58 +0100 Subject: [PATCH] move set_generalized_buchi and set_buchi to tgba * src/tgba/tgbagraph.hh (set_generalized_buchi, set_buchi): Move... * src/tgba/tgba.hh: ... here. --- src/tgba/tgba.hh | 32 ++++++++++++++++++++++++++------ src/tgba/tgbagraph.hh | 20 -------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/tgba/tgba.hh b/src/tgba/tgba.hh index ce3150932..69b2f55e2 100644 --- a/src/tgba/tgba.hh +++ b/src/tgba/tgba.hh @@ -638,6 +638,16 @@ namespace spot protected: acc_cond acc_; + void set_num_sets_(unsigned num) + { + if (num < acc_.num_sets()) + { + acc_.~acc_cond(); + new (&acc_) acc_cond; + } + acc_.add_sets(num - acc_.num_sets()); + } + public: const acc_cond::acc_code& get_acceptance() const { @@ -646,12 +656,7 @@ namespace spot void set_acceptance(unsigned num, const acc_cond::acc_code& c) { - if (num < acc_.num_sets()) - { - acc_.~acc_cond(); - new (&acc_) acc_cond; - } - acc_.add_sets(num - acc_.num_sets()); + set_num_sets_(num); acc_.set_acceptance(c); prop_single_acc_set(!acc_.uses_fin_acceptance() && num == 1); if (num == 0) @@ -673,6 +678,21 @@ namespace spot get_dict()->register_all_propositions_of(a, this); } + void set_generalized_buchi(unsigned num) + { + set_num_sets_(num); + acc_.set_generalized_buchi(); + prop_single_acc_set(num == 1); + if (num == 0) + prop_state_based_acc(); + } + + acc_cond::mark_t set_buchi() + { + set_generalized_buchi(1); + return acc_.mark(0); + } + protected: /// Do the actual computation of tgba::support_conditions(). virtual bdd compute_support_conditions(const state* state) const = 0; diff --git a/src/tgba/tgbagraph.hh b/src/tgba/tgbagraph.hh index 4c00b9108..321b225c3 100644 --- a/src/tgba/tgbagraph.hh +++ b/src/tgba/tgbagraph.hh @@ -334,26 +334,6 @@ namespace spot return g_.trans_data(t); } - void set_generalized_buchi(unsigned num) - { - if (num < acc_.num_sets()) - { - acc_.~acc_cond(); - new (&acc_) acc_cond; - } - acc_.add_sets(num - acc_.num_sets()); - prop_single_acc_set(!acc_.uses_fin_acceptance() && num == 1); - if (num == 0) - prop_state_based_acc(); - acc_.set_generalized_buchi(); - } - - acc_cond::mark_t set_buchi() - { - set_generalized_buchi(1); - return acc_.mark(0); - } - trans_storage_t& trans_storage(const tgba_succ_iterator* it) { auto* i = down_cast*>(it);