Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

tgba/bdddict.hh

Go to the documentation of this file.
00001 // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), 00002 // département Systèmes Répartis Coopératifs (SRC), Université Pierre 00003 // 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_BDDDICT_HH 00023 # define SPOT_TGBA_BDDDICT_HH 00024 00025 #include "misc/hash.hh" 00026 #include <list> 00027 #include <set> 00028 #include <iostream> 00029 #include <bdd.h> 00030 #include "ltlast/formula.hh" 00031 #include "misc/bddalloc.hh" 00032 00033 namespace spot 00034 { 00035 00037 class bdd_dict: public bdd_allocator 00038 { 00039 public: 00040 00041 bdd_dict(); 00042 ~bdd_dict(); 00043 00045 typedef Sgi::hash_map<const ltl::formula*, int, 00046 ptr_hash<ltl::formula> > fv_map; 00048 typedef Sgi::hash_map<int, const ltl::formula*> vf_map; 00049 00050 fv_map now_map; 00051 vf_map now_formula_map; 00052 fv_map var_map; 00053 vf_map var_formula_map; 00054 fv_map acc_map; 00055 vf_map acc_formula_map; 00056 00060 bddPair* next_to_now; 00064 bddPair* now_to_next; 00065 00076 int register_proposition(const ltl::formula* f, const void* for_me); 00077 00085 void register_propositions(bdd f, const void* for_me); 00086 00098 int register_state(const ltl::formula* f, const void* for_me); 00099 00110 int register_acceptance_variable(const ltl::formula* f, const void* for_me); 00111 00119 void register_acceptance_variables(bdd f, const void* for_me); 00120 00128 int register_anonymous_variables(int n, const void* for_me); 00129 00136 void register_all_variables_of(const void* from_other, const void* for_me); 00137 00141 void unregister_all_my_variables(const void* me); 00142 00144 void unregister_variable(int var, const void* me); 00145 00148 bool is_registered_proposition(const ltl::formula* f, const void* by_me); 00149 bool is_registered_state(const ltl::formula* f, const void* by_me); 00150 bool is_registered_acceptance_variable(const ltl::formula* f, 00151 const void* by_me); 00153 00156 std::ostream& dump(std::ostream& os) const; 00157 00162 void assert_emptiness() const; 00163 00164 protected: 00166 typedef Sgi::hash_set<const void*, ptr_hash<void> > ref_set; 00167 typedef Sgi::hash_map<int, ref_set> vr_map; 00168 vr_map var_refs; 00169 00170 void unregister_variable(vr_map::iterator& cur, const void* me); 00171 00172 // SWIG does not grok the following definition, no idea why. 00173 // It's not important for the Python interface anyway. 00174 #ifndef SWIG 00175 class annon_free_list : public spot::free_list 00176 { 00177 public: 00178 // WARNING: We need a default constructor so this can be used in 00179 // a hash; but we should ensure that no object in the hash is 00180 // constructed with d==0. 00181 annon_free_list(bdd_dict* d = 0); 00182 virtual int extend(int n); 00183 private: 00184 bdd_dict* dict_; 00185 }; 00186 #endif 00187 00189 typedef Sgi::hash_map<const void*, annon_free_list, 00190 ptr_hash<void> > free_annonymous_list_of_type; 00191 free_annonymous_list_of_type free_annonymous_list_of; 00192 00193 private: 00194 // Disallow copy. 00195 bdd_dict(const bdd_dict& other); 00196 bdd_dict& operator=(const bdd_dict& other); 00197 }; 00198 00199 00200 } 00201 00202 #endif // SPOT_TGBA_BDDDICT_HH

Generated on Tue Jun 29 17:00:35 2004 for spot by doxygen 1.3.7