tgbaunion.hh

Go to the documentation of this file.
00001 // Copyright (C) 2009 Laboratoire de Recherche et Développement
00002 // de l'Epita (LRDE).
00003 //
00004 // This file is part of Spot, a model checking library.
00005 //
00006 // Spot is free software; you can redistribute it and/or modify it
00007 // under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 2 of the License, or
00009 // (at your option) any later version.
00010 //
00011 // Spot is distributed in the hope that it will be useful, but WITHOUT
00012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00013 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00014 // License for more details.
00015 //
00016 // You should have received a copy of the GNU General Public License
00017 // along with Spot; see the file COPYING.  If not, write to the Free
00018 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00019 // 02111-1307, USA.
00020 
00021 #ifndef SPOT_TGBA_TGBAUNION_HH
00022 # define SPOT_TGBA_TGBAUNION_HH
00023 
00024 #include "tgba.hh"
00025 #include "statebdd.hh"
00026 
00027 namespace spot
00028 {
00038   class state_union : public state
00039   {
00040   public:
00046     state_union(state* left, state* right)
00047       : left_(left),
00048         right_(right)
00049     {
00050     }
00051 
00053     state_union(const state_union& o);
00054 
00055     virtual ~state_union();
00056 
00057     state*
00058     left() const
00059     {
00060       return left_;
00061     }
00062 
00063     state*
00064     right() const
00065     {
00066       return right_;
00067     }
00068 
00069     virtual int compare(const state* other) const;
00070     virtual size_t hash() const;
00071     virtual state_union* clone() const;
00072 
00073   private:
00074     state* left_;               
00075 
00076     state* right_;              
00077 
00078   };
00079 
00081   class tgba_succ_iterator_union: public tgba_succ_iterator
00082   {
00083   public:
00084     tgba_succ_iterator_union(tgba_succ_iterator* left,
00085                              tgba_succ_iterator* right,
00086                              bdd left_missing,
00087                              bdd right_missing, bdd left_var, bdd right_var);
00088 
00089     virtual ~tgba_succ_iterator_union();
00090 
00091     // iteration
00092     void first();
00093     void next();
00094     bool done() const;
00095 
00096     // inspection
00097     state_union* current_state() const;
00098     bdd current_condition() const;
00099     bdd current_acceptance_conditions() const;
00100 
00101   protected:
00102     tgba_succ_iterator* left_;
00103     tgba_succ_iterator* right_;
00104     bdd current_cond_;
00105     bdd left_missing_;
00106     bdd right_missing_;
00107     bdd left_neg_;
00108     bdd right_neg_;
00109     friend class tgba_union;
00110   };
00111 
00113   class tgba_union: public tgba
00114   {
00115   public:
00119     tgba_union(const tgba* left, const tgba* right);
00120 
00121     virtual ~tgba_union();
00122 
00123     virtual state* get_init_state() const;
00124 
00125     virtual tgba_succ_iterator_union*
00126     succ_iter(const state* local_state,
00127               const state* global_state = 0,
00128               const tgba* global_automaton = 0) const;
00129 
00130     virtual bdd_dict* get_dict() const;
00131 
00132     virtual std::string format_state(const state* state) const;
00133 
00134     virtual state* project_state(const state* s, const tgba* t) const;
00135 
00136     virtual bdd all_acceptance_conditions() const;
00137     virtual bdd neg_acceptance_conditions() const;
00138 
00139   protected:
00140     virtual bdd compute_support_conditions(const state* state) const;
00141     virtual bdd compute_support_variables(const state* state) const;
00142 
00143   private:
00144     bdd_dict* dict_;
00145     const tgba* left_;
00146     const tgba* right_;
00147     bdd left_acc_missing_;
00148     bdd right_acc_missing_;
00149     bdd left_acc_complement_;
00150     bdd right_acc_complement_;
00151     bdd left_var_missing_;
00152     bdd right_var_missing_;
00153     bdd all_acceptance_conditions_;
00154     bdd neg_acceptance_conditions_;
00155     bddPair* right_common_acc_;
00156     // Disallow copy.
00157     tgba_union(const tgba_union&);
00158     tgba_union& operator=(const tgba_union&);
00159   };
00160 
00161 
00162 }
00163 
00164 #endif // SPOT_TGBA_TGBAUNION_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Fri Apr 16 09:40:33 2010 for spot by doxygen 1.6.3