spot  1.0.1
bdddict.hh
Go to the documentation of this file.
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2012 Laboratoire de Recherche et Développement
3 // de l'Epita (LRDE).
4 // Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
5 // département Systèmes Répartis Coopératifs (SRC), Université Pierre
6 // et Marie Curie.
7 //
8 // This file is part of Spot, a model checking library.
9 //
10 // Spot is free software; you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Spot is distributed in the hope that it will be useful, but WITHOUT
16 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 // License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 #ifndef SPOT_TGBA_BDDDICT_HH
24 # define SPOT_TGBA_BDDDICT_HH
25 
26 #include <list>
27 #include <set>
28 #include <map>
29 #include <iosfwd>
30 #include <bdd.h>
31 #include <vector>
32 #include "ltlast/formula.hh"
33 #include "misc/bddalloc.hh"
34 
35 namespace spot
36 {
37 
47  class bdd_dict: public bdd_allocator
48  {
49  public:
50 
51  bdd_dict();
52  ~bdd_dict();
53 
55  typedef std::map<const ltl::formula*, int> fv_map;
57  typedef std::map<int, const ltl::formula*> vf_map;
58 
62 
64  typedef std::set<const void*> ref_set;
65 
66  enum var_type { anon = 0, now, next, var, acc };
67  struct bdd_info {
68  bdd_info() : type(anon) {}
70  const ltl::formula* f; // Used unless t==anon.
73  };
74  typedef std::vector<bdd_info> bdd_info_map;
75  // Map BDD variables to their meaning.
77 
81  bddPair* next_to_now;
85  bddPair* now_to_next;
86 
97  int register_proposition(const ltl::formula* f, const void* for_me);
98 
106  void register_propositions(bdd f, const void* for_me);
107 
119  int register_state(const ltl::formula* f, const void* for_me);
120 
131  int register_acceptance_variable(const ltl::formula* f, const void* for_me);
132 
138  int register_clone_acc(int var, const void* for_me);
139 
147  void register_acceptance_variables(bdd f, const void* for_me);
148 
158  const ltl::formula* oneacc_to_formula(bdd oneacc) const;
159 
168  const ltl::formula* oneacc_to_formula(int var) const;
169 
177  int register_anonymous_variables(int n, const void* for_me);
178 
185  void register_all_variables_of(const void* from_other, const void* for_me);
186 
190  void unregister_all_my_variables(const void* me);
191 
193  void unregister_variable(int var, const void* me);
194 
197  bool is_registered_proposition(const ltl::formula* f, const void* by_me);
198  bool is_registered_state(const ltl::formula* f, const void* by_me);
200  const void* by_me);
202 
205  std::ostream& dump(std::ostream& os) const;
206 
211  void assert_emptiness() const;
212 
213  protected:
214  // SWIG does not grok the following definition, no idea why.
215  // It's not important for the Python interface anyway.
216 #ifndef SWIG
218  {
219  public:
220  // WARNING: We need a default constructor so this can be used in
221  // a hash; but we should ensure that no object in the hash is
222  // constructed with d==0.
223  anon_free_list(bdd_dict* d = 0);
224  virtual int extend(int n);
225  private:
227  };
228 #endif
229 
231  typedef std::map<const void*, anon_free_list> free_anonymous_list_of_type;
233 
234  private:
235  // Disallow copy.
236  bdd_dict(const bdd_dict& other);
237  bdd_dict& operator=(const bdd_dict& other);
238  };
239 
240 
241 }
242 
243 #endif // SPOT_TGBA_BDDDICT_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Wed Jan 23 2013 15:00:01 for spot by doxygen 1.8.1.2