tgbaproduct.hh

Go to the documentation of this file.
00001 // Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris
00002 // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
00003 // Université Pierre et Marie Curie.
00004 //
00005 // This file is part of Spot, a model checking library.
00006 //
00007 // Spot is free software; you can redistribute it and/or modify it
00008 // under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011 //
00012 // Spot is distributed in the hope that it will be useful, but WITHOUT
00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00014 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
00015 // License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Spot; see the file COPYING.  If not, write to the Free
00019 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020 // 02111-1307, USA.
00021 
00022 #ifndef SPOT_TGBA_TGBAPRODUCT_HH
00023 # define SPOT_TGBA_TGBAPRODUCT_HH
00024 
00025 #include "tgba.hh"
00026 #include "statebdd.hh"
00027 
00028 namespace spot
00029 {
00030 
00036   class state_product : public state
00037   {
00038   public:
00044     state_product(state* left, state* right)
00045       : left_(left),
00046         right_(right)
00047     {
00048     }
00049 
00051     state_product(const state_product& o);
00052 
00053     virtual ~state_product();
00054 
00055     state*
00056     left() const
00057     {
00058       return left_;
00059     }
00060 
00061     state*
00062     right() const
00063     {
00064       return right_;
00065     }
00066 
00067     virtual int compare(const state* other) const;
00068     virtual size_t hash() const;
00069     virtual state_product* clone() const;
00070 
00071   private:
00072     state* left_;               
00073     state* right_;              
00074   };
00075 
00076 
00078   class tgba_succ_iterator_product: public tgba_succ_iterator
00079   {
00080   public:
00081     tgba_succ_iterator_product(tgba_succ_iterator* left,
00082                                tgba_succ_iterator* right,
00083                                bdd left_neg, bdd right_neg,
00084                                bddPair* right_common_acc);
00085 
00086     virtual ~tgba_succ_iterator_product();
00087 
00088     // iteration
00089     void first();
00090     void next();
00091     bool done() const;
00092 
00093     // inspection
00094     state_product* current_state() const;
00095     bdd current_condition() const;
00096     bdd current_acceptance_conditions() const;
00097 
00098   private:
00100 
00101     void step_();
00102     void next_non_false_();
00104 
00105   protected:
00106     tgba_succ_iterator* left_;
00107     tgba_succ_iterator* right_;
00108     bdd current_cond_;
00109     bdd left_neg_;
00110     bdd right_neg_;
00111     bddPair* right_common_acc_;
00112     friend class tgba_product;
00113   };
00114 
00116   class tgba_product: public tgba
00117   {
00118   public:
00123     tgba_product(const tgba* left, const tgba* right);
00124 
00125     virtual ~tgba_product();
00126 
00127     virtual state* get_init_state() const;
00128 
00129     virtual tgba_succ_iterator_product*
00130     succ_iter(const state* local_state,
00131               const state* global_state = 0,
00132               const tgba* global_automaton = 0) const;
00133 
00134     virtual bdd_dict* get_dict() const;
00135 
00136     virtual std::string format_state(const state* state) const;
00137 
00138     virtual std::string
00139     transition_annotation(const tgba_succ_iterator* t) const;
00140 
00141     virtual state* project_state(const state* s, const tgba* t) const;
00142 
00143     virtual bdd all_acceptance_conditions() const;
00144     virtual bdd neg_acceptance_conditions() const;
00145 
00146   protected:
00147     virtual bdd compute_support_conditions(const state* state) const;
00148     virtual bdd compute_support_variables(const state* state) const;
00149 
00150   private:
00151     bdd_dict* dict_;
00152     const tgba* left_;
00153     const tgba* right_;
00154     bdd left_acc_complement_;
00155     bdd right_acc_complement_;
00156     bdd all_acceptance_conditions_;
00157     bdd neg_acceptance_conditions_;
00158     bddPair* right_common_acc_;
00159     // Disallow copy.
00160     tgba_product(const tgba_product&);
00161     tgba_product& operator=(const tgba_product&);
00162   };
00163 
00164 }
00165 
00166 #endif // SPOT_TGBA_TGBAPRODUCT_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