00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
00127 void register_all_variables_of(const void* from_other, const void* for_me);
00128
00132 void unregister_all_my_variables(const void* me);
00133
00136 bool is_registered_proposition(const ltl::formula* f, const void* by_me);
00137 bool is_registered_state(const ltl::formula* f, const void* by_me);
00138 bool is_registered_acceptance_variable(const ltl::formula* f,
00139 const void* by_me);
00141
00144 std::ostream& dump(std::ostream& os) const;
00145
00150 void assert_emptiness() const;
00151
00152 protected:
00154 typedef Sgi::hash_set<const void*, ptr_hash<void> > ref_set;
00155 typedef Sgi::hash_map<int, ref_set> vr_map;
00156 vr_map var_refs;
00157
00158 private:
00159
00160 bdd_dict(const bdd_dict& other);
00161 bdd_dict& operator=(const bdd_dict& other);
00162 };
00163
00164
00165 }
00166
00167 #endif // SPOT_TGBA_BDDDICT_HH