bdddict.hh

Go to the documentation of this file.
00001 // Copyright (C) 2003, 2004, 2006  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 <list>
00026 #include <set>
00027 #include <map>
00028 #include <iosfwd>
00029 #include <bdd.h>
00030 #include "ltlast/formula.hh"
00031 #include "misc/bddalloc.hh"
00032 
00033 namespace spot
00034 {
00035 
00038   class bdd_dict: public bdd_allocator
00039   {
00040   public:
00041 
00042     bdd_dict();
00043     ~bdd_dict();
00044 
00046     typedef std::map<const ltl::formula*, int> fv_map;
00048     typedef std::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 
00058     typedef std::map<int, int> cc_map;
00059     cc_map clone_counts;
00060 
00064     bddPair* next_to_now;
00068     bddPair* now_to_next;
00069 
00080     int register_proposition(const ltl::formula* f, const void* for_me);
00081 
00089     void register_propositions(bdd f, const void* for_me);
00090 
00102     int register_state(const ltl::formula* f, const void* for_me);
00103 
00114     int register_acceptance_variable(const ltl::formula* f, const void* for_me);
00115 
00121     int register_clone_acc(int var, const void* for_me);
00122 
00130     void register_acceptance_variables(bdd f, const void* for_me);
00131 
00139     int register_anonymous_variables(int n, const void* for_me);
00140 
00147     void register_all_variables_of(const void* from_other, const void* for_me);
00148 
00152     void unregister_all_my_variables(const void* me);
00153 
00155     void unregister_variable(int var, const void* me);
00156 
00159     bool is_registered_proposition(const ltl::formula* f, const void* by_me);
00160     bool is_registered_state(const ltl::formula* f, const void* by_me);
00161     bool is_registered_acceptance_variable(const ltl::formula* f,
00162                                            const void* by_me);
00164 
00167     std::ostream& dump(std::ostream& os) const;
00168 
00173     void assert_emptiness() const;
00174 
00175   protected:
00177     typedef std::set<const void*> ref_set;
00178     typedef std::map<int, ref_set> vr_map;
00179     vr_map var_refs;
00180 
00181     void unregister_variable(vr_map::iterator& cur, const void* me);
00182 
00183     // SWIG does not grok the following definition, no idea why.
00184     // It's not important for the Python interface anyway.
00185 #ifndef SWIG
00186     class anon_free_list : public spot::free_list
00187     {
00188     public:
00189       // WARNING: We need a default constructor so this can be used in
00190       // a hash; but we should ensure that no object in the hash is
00191       // constructed with d==0.
00192       anon_free_list(bdd_dict* d = 0);
00193       virtual int extend(int n);
00194     private:
00195       bdd_dict* dict_;
00196     };
00197 #endif
00198 
00200     typedef std::map<const void*, anon_free_list> free_anonymous_list_of_type;
00201     free_anonymous_list_of_type free_anonymous_list_of;
00202 
00203   private:
00204     // Disallow copy.
00205     bdd_dict(const bdd_dict& other);
00206     bdd_dict& operator=(const bdd_dict& other);
00207   };
00208 
00209 
00210 }
00211 
00212 #endif // SPOT_TGBA_BDDDICT_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