spot  1.0.2
bdddict.hh
Go to the documentation of this file.
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2011, 2012, 2013 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 
56  class bdd_dict: public bdd_allocator
57  {
58  public:
59 
60  bdd_dict();
61 
66  ~bdd_dict();
67 
69  typedef std::map<const ltl::formula*, int> fv_map;
71  typedef std::map<int, const ltl::formula*> vf_map;
72 
76 
78  typedef std::set<const void*> ref_set;
79 
80  enum var_type { anon = 0, now, next, var, acc };
81  struct bdd_info {
82  bdd_info() : type(anon) {}
84  const ltl::formula* f; // Used unless t==anon.
87  };
88  typedef std::vector<bdd_info> bdd_info_map;
89  // Map BDD variables to their meaning.
91 
95  bddPair* next_to_now;
99  bddPair* now_to_next;
100 
111  int register_proposition(const ltl::formula* f, const void* for_me);
112 
120  void register_propositions(bdd f, const void* for_me);
121 
133  int register_state(const ltl::formula* f, const void* for_me);
134 
145  int register_acceptance_variable(const ltl::formula* f, const void* for_me);
146 
152  int register_clone_acc(int var, const void* for_me);
153 
161  void register_acceptance_variables(bdd f, const void* for_me);
162 
172  const ltl::formula* oneacc_to_formula(bdd oneacc) const;
173 
182  const ltl::formula* oneacc_to_formula(int var) const;
183 
191  int register_anonymous_variables(int n, const void* for_me);
192 
199  void register_all_variables_of(const void* from_other, const void* for_me);
200 
204  void unregister_all_my_variables(const void* me);
205 
207  void unregister_variable(int var, const void* me);
208 
211  bool is_registered_proposition(const ltl::formula* f, const void* by_me);
212  bool is_registered_state(const ltl::formula* f, const void* by_me);
214  const void* by_me);
216 
219  std::ostream& dump(std::ostream& os) const;
220 
232  void assert_emptiness() const;
233 
234  protected:
235  // SWIG does not grok the following definition, no idea why.
236  // It's not important for the Python interface anyway.
237 #ifndef SWIG
239  {
240  public:
241  // WARNING: We need a default constructor so this can be used in
242  // a hash; but we should ensure that no object in the hash is
243  // constructed with d==0.
244  anon_free_list(bdd_dict* d = 0);
245  virtual int extend(int n);
246  private:
248  };
249 #endif
250 
252  typedef std::map<const void*, anon_free_list> free_anonymous_list_of_type;
254 
255  private:
256  // Disallow copy.
257  bdd_dict(const bdd_dict& other);
258  bdd_dict& operator=(const bdd_dict& other);
259  };
260 
261 
262 }
263 
264 #endif // SPOT_TGBA_BDDDICT_HH

Please comment this page and report errors about it on the RefDocComments page.
Generated on Wed Mar 6 2013 09:25:14 for spot by doxygen 1.8.1.2