spot  1.1.4
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 
208  void unregister_all_typed_variables(var_type type, const void* me);
209 
211  void unregister_variable(int var, const void* me);
212 
215  bool is_registered_proposition(const ltl::formula* f, const void* by_me);
216  bool is_registered_state(const ltl::formula* f, const void* by_me);
218  const void* by_me);
220 
223  std::ostream& dump(std::ostream& os) const;
224 
236  void assert_emptiness() const;
237 
238  protected:
239  // SWIG does not grok the following definition, no idea why.
240  // It's not important for the Python interface anyway.
241 #ifndef SWIG
243  {
244  public:
245  // WARNING: We need a default constructor so this can be used in
246  // a hash; but we should ensure that no object in the hash is
247  // constructed with d==0.
248  anon_free_list(bdd_dict* d = 0);
249  virtual int extend(int n);
250  private:
252  };
253 #endif
254 
256  typedef std::map<const void*, anon_free_list> free_anonymous_list_of_type;
258 
259  private:
260  // Disallow copy.
261  bdd_dict(const bdd_dict& other);
262  bdd_dict& operator=(const bdd_dict& other);
263  };
264 
265 
266 }
267 
268 #endif // SPOT_TGBA_BDDDICT_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Mon Jul 29 2013 00:27:24 for spot by doxygen 1.8.4