spot  1.2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bdddict.hh
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 
34 namespace spot
35 {
37  class bdd_dict_priv;
38 
57  class SPOT_API bdd_dict
58  {
59  bdd_dict_priv* priv_;
60  public:
61 
62  bdd_dict();
63 
68  ~bdd_dict();
69 
71  typedef std::map<const ltl::formula*, int> fv_map;
73  typedef std::map<int, const ltl::formula*> vf_map;
74 
78 
80  typedef std::set<const void*> ref_set;
81 
82  enum var_type { anon = 0, now, next, var, acc };
83  struct bdd_info {
84  bdd_info() : type(anon) {}
85  var_type type;
86  const ltl::formula* f; // Used unless t==anon.
87  ref_set refs;
88  int clone_counts;
89  };
90  typedef std::vector<bdd_info> bdd_info_map;
91  // Map BDD variables to their meaning.
92  bdd_info_map bdd_map;
93 
97  bddPair* next_to_now;
101  bddPair* now_to_next;
102 
113  int register_proposition(const ltl::formula* f, const void* for_me);
114 
122  void register_propositions(bdd f, const void* for_me);
123 
135  int register_state(const ltl::formula* f, const void* for_me);
136 
147  int register_acceptance_variable(const ltl::formula* f, const void* for_me);
148 
154  int register_clone_acc(int var, const void* for_me);
155 
163  void register_acceptance_variables(bdd f, const void* for_me);
164 
174  const ltl::formula* oneacc_to_formula(bdd oneacc) const;
175 
184  const ltl::formula* oneacc_to_formula(int var) const;
185 
193  int register_anonymous_variables(int n, const void* for_me);
194 
201  void register_all_variables_of(const void* from_other, const void* for_me);
202 
206  void unregister_all_my_variables(const void* me);
207 
210  void unregister_all_typed_variables(var_type type, const void* me);
211 
213  void unregister_variable(int var, const void* me);
214 
217  bool is_registered_proposition(const ltl::formula* f, const void* by_me);
218  bool is_registered_state(const ltl::formula* f, const void* by_me);
219  bool is_registered_acceptance_variable(const ltl::formula* f,
220  const void* by_me);
222 
225  std::ostream& dump(std::ostream& os) const;
226 
238  void assert_emptiness() const;
239 
240  private:
241  // Disallow copy.
242  bdd_dict(const bdd_dict& other);
243  bdd_dict& operator=(const bdd_dict& other);
244  };
245 
246 
247 }
248 
249 #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 Thu May 15 2014 11:04:11 for spot by doxygen 1.8.4