tgbaproduct.hh

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

Please comment this page and report errors about it on the RefDocComments page.
Generated on Tue Feb 1 2011 12:00:52 for spot by doxygen 1.7.1