spot  0.8.1
tgbaunion.hh
Go to the documentation of this file.
00001 // Copyright (C) 2009, 2011 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 
00026 namespace spot
00027 {
00037   class state_union : public state
00038   {
00039   public:
00045     state_union(state* left, state* right)
00046       : left_(left),
00047         right_(right)
00048     {
00049     }
00050 
00052     state_union(const state_union& o);
00053 
00054     virtual ~state_union();
00055 
00056     state*
00057     left() const
00058     {
00059       return left_;
00060     }
00061 
00062     state*
00063     right() const
00064     {
00065       return right_;
00066     }
00067 
00068     virtual int compare(const state* other) const;
00069     virtual size_t hash() const;
00070     virtual state_union* clone() const;
00071 
00072   private:
00073     state* left_;               
00074 
00075     state* right_;              
00076 
00077   };
00078 
00080   class tgba_succ_iterator_union: public tgba_succ_iterator
00081   {
00082   public:
00083     tgba_succ_iterator_union(tgba_succ_iterator* left,
00084                              tgba_succ_iterator* right,
00085                              bdd left_missing,
00086                              bdd right_missing, bdd left_var, bdd right_var);
00087 
00088     virtual ~tgba_succ_iterator_union();
00089 
00090     // iteration
00091     void first();
00092     void next();
00093     bool done() const;
00094 
00095     // inspection
00096     state_union* current_state() const;
00097     bdd current_condition() const;
00098     bdd current_acceptance_conditions() const;
00099 
00100   protected:
00101     tgba_succ_iterator* left_;
00102     tgba_succ_iterator* right_;
00103     bdd current_cond_;
00104     bdd left_missing_;
00105     bdd right_missing_;
00106     bdd left_neg_;
00107     bdd right_neg_;
00108     friend class tgba_union;
00109   };
00110 
00112   class tgba_union: public tgba
00113   {
00114   public:
00118     tgba_union(const tgba* left, const tgba* right);
00119 
00120     virtual ~tgba_union();
00121 
00122     virtual state* get_init_state() const;
00123 
00124     virtual tgba_succ_iterator_union*
00125     succ_iter(const state* local_state,
00126               const state* global_state = 0,
00127               const tgba* global_automaton = 0) const;
00128 
00129     virtual bdd_dict* get_dict() const;
00130 
00131     virtual std::string format_state(const state* state) const;
00132 
00133     virtual state* project_state(const state* s, const tgba* t) const;
00134 
00135     virtual bdd all_acceptance_conditions() const;
00136     virtual bdd neg_acceptance_conditions() const;
00137 
00138   protected:
00139     virtual bdd compute_support_conditions(const state* state) const;
00140     virtual bdd compute_support_variables(const state* state) const;
00141 
00142   private:
00143     bdd_dict* dict_;
00144     const tgba* left_;
00145     const tgba* right_;
00146     bdd left_acc_missing_;
00147     bdd right_acc_missing_;
00148     bdd left_acc_complement_;
00149     bdd right_acc_complement_;
00150     bdd left_var_missing_;
00151     bdd right_var_missing_;
00152     bdd all_acceptance_conditions_;
00153     bdd neg_acceptance_conditions_;
00154     bddPair* right_common_acc_;
00155     // Disallow copy.
00156     tgba_union(const tgba_union&);
00157     tgba_union& operator=(const tgba_union&);
00158   };
00159 
00160 
00161 }
00162 
00163 #endif // SPOT_TGBA_TGBAUNION_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Sun Dec 18 2011 12:57:15 for spot by doxygen 1.7.6.1