66 typedef std::map<formula, int>
fv_map;
68 typedef std::map<int, formula>
vf_map;
115 template <
typename T>
118 return register_proposition(f, for_me.get());
130 template <
typename T>
133 return has_registered_proposition(f, for_me.get());
146 return var_map.at(f);
157 if (
unsigned(var) < bdd_map.size()
159 return bdd_map[var].f;
176 template <
typename T>
179 return register_acceptance_variable(f, for_me.get());
193 template <
typename T>
196 return register_anonymous_variables(n, for_me.get());
209 template <
typename T>
211 std::shared_ptr<T> for_me)
213 register_all_variables_of(from_other, for_me.get());
216 template <
typename T>
220 register_all_variables_of(from_other.get(), for_me);
223 template <
typename T,
typename U>
225 std::shared_ptr<U> for_me)
227 register_all_variables_of(from_other.get(), for_me.get());
241 template <
typename T>
243 std::shared_ptr<T> for_me)
245 register_all_propositions_of(from_other, for_me.get());
248 template <
typename T>
252 register_all_propotitions_of(from_other.get(), for_me);
255 template <
typename T,
typename U>
257 std::shared_ptr<U> for_me)
259 register_all_propositions_of(from_other.get(), for_me.get());
272 template <
typename T>
275 unregister_variable(var, me.get());
281 std::ostream&
dump(std::ostream& os)
const;
310 return std::make_shared<bdd_dict>();
342 return dict_->register_proposition(f,
this);
354 dict_->unregister_all_my_variables(
this);
A BDD dictionary wrapper that pre-registers atomic propositions before use.
Definition: bdddict.hh:317
int register_proposition(const std::string &f)
Register atomic proposition f (by name) and return its BDD variable number.
Definition: bdddict.hh:347
int register_proposition(formula f)
Register atomic proposition f and return its BDD variable number.
Definition: bdddict.hh:340
bdd_dict_preorder(bdd_dict_ptr dict)
Construct from an existing bdd_dict.
Definition: bdddict.hh:321
bdd_dict_ptr get_dict() const
Return the underlying bdd_dict shared pointer.
Definition: bdddict.hh:333
Map BDD variables to formulas.
Definition: bdddict.hh:53
std::set< const void * > ref_set
BDD-variable reference counts.
Definition: bdddict.hh:74
void register_all_propositions_of(std::shared_ptr< T > from_other, std::shared_ptr< U > for_me)
Duplicate the proposition usage of another object.
Definition: bdddict.hh:256
void register_all_propositions_of(const void *from_other, std::shared_ptr< T > for_me)
Duplicate the proposition usage of another object.
Definition: bdddict.hh:242
int register_acceptance_variable(formula f, const void *for_me)
Register an acceptance variable.
void assert_emptiness() const
Make sure the dictionary is empty.
std::ostream & dump(std::ostream &os) const
Dump all variables for debugging.
void register_all_propositions_of(std::shared_ptr< T > from_other, const void *for_me)
Duplicate the proposition usage of another object.
Definition: bdddict.hh:249
void register_all_variables_of(std::shared_ptr< T > from_other, const void *for_me)
Duplicate the variable usage of another object.
Definition: bdddict.hh:217
std::map< int, formula > vf_map
BDD-variable-to-formula maps.
Definition: bdddict.hh:68
std::map< formula, int > fv_map
Formula-to-BDD-variable maps.
Definition: bdddict.hh:66
void unregister_variable(int var, std::shared_ptr< T > me)
Release a variable used by me.
Definition: bdddict.hh:273
int register_proposition(formula f, const void *for_me)
Register an atomic proposition.
void unregister_all_my_variables(const void *me)
Release all variables used by an object.
int register_proposition(formula f, std::shared_ptr< T > for_me)
Register an atomic proposition.
Definition: bdddict.hh:116
int register_anonymous_variables(int n, const void *for_me)
Register anonymous BDD variables.
int has_registered_proposition(formula f, std::shared_ptr< T > for_me)
Whether a proposition has already been registered.
Definition: bdddict.hh:131
void register_all_variables_of(const void *from_other, std::shared_ptr< T > for_me)
Duplicate the variable usage of another object.
Definition: bdddict.hh:210
bdd_info_map bdd_map
Table mapping BDD variable numbers to their meaning.
Definition: bdddict.hh:100
int has_registered_proposition(formula f, const void *me)
Whether a proposition has already been registered.
void register_all_propositions_of(const void *from_other, const void *for_me)
Duplicate the proposition usage of another object.
fv_map var_map
Maps atomic propositions to BDD variables.
Definition: bdddict.hh:70
void unregister_variable(int var, const void *me)
Release a variable used by me.
std::vector< bdd_info > bdd_info_map
Type of the per-variable information table.
Definition: bdddict.hh:98
int register_anonymous_variables(int n, std::shared_ptr< T > for_me)
Register anonymous BDD variables.
Definition: bdddict.hh:194
void register_all_variables_of(std::shared_ptr< T > from_other, std::shared_ptr< U > for_me)
Duplicate the variable usage of another object.
Definition: bdddict.hh:224
fv_map acc_map
Maps acceptance conditions to BDD variables.
Definition: bdddict.hh:71
formula ap_from_var(int var) const
Return the atomic proposition associated to a BDD variable.
Definition: bdddict.hh:155
int register_acceptance_variable(formula f, std::shared_ptr< T > for_me)
Register an acceptance variable.
Definition: bdddict.hh:177
int varnum(formula f)
Return the BDD variable number for a registered proposition.
Definition: bdddict.hh:144
~bdd_dict()
Destroy the BDD dict.
void register_all_variables_of(const void *from_other, const void *for_me)
Duplicate the variable usage of another object.
var_type
Type of a BDD variable in the dictionary.
Definition: bdddict.hh:81
@ var
Atomic-proposition variable.
Definition: bdddict.hh:83
bdd_dict_ptr make_bdd_dict()
Create a new, empty bdd_dict wrapped in a shared pointer.
Definition: bdddict.hh:308
std::shared_ptr< bdd_dict > bdd_dict_ptr
Shared pointer to a bdd_dict.
Definition: bdddict.hh:304
Definition: automata.hh:26
Information stored for one BDD variable.
Definition: bdddict.hh:91
ref_set refs
Set of objects referencing this variable.
Definition: bdddict.hh:95
formula f
Formula encoded (unused when type==anon).
Definition: bdddict.hh:94
var_type type
Type of this BDD variable.
Definition: bdddict.hh:93