5 #include <unordered_map>
18 std::shared_ptr<CUDD::Cudd> mgr_;
19 std::unordered_map<int, std::string> index_to_name_;
20 std::unordered_map<std::string, CUDD::BDD> name_to_variable_;
21 std::size_t state_variable_count_ = 0;
22 std::vector<std::vector<CUDD::BDD>> state_variables_;
23 std::vector<CUDD::BDD> input_variables_;
24 std::vector<CUDD::BDD> output_variables_;
25 std::size_t total_variable_count_ = 0;
67 const std::vector<std::size_t> &automaton_ids);
73 CUDD::BDD
state_variable(std::size_t automaton_id, std::size_t i)
const;
86 const std::vector<int> &state_vector)
const;
97 const std::vector<std::string> &output_names);
102 std::shared_ptr<CUDD::Cudd>
cudd_mgr()
const;
166 const std::vector<int> &state_vector)
const;
180 const std::vector<int> &state_vector)
const;
195 std::size_t automaton_id,
196 const std::vector<CUDD::BDD> &state_bdds)
const;
239 std::size_t automaton_id)
const;
249 void dump_dot(
const CUDD::ADD &add,
const std::string &filename)
const;
260 void dump_dot(
const std::vector<CUDD::ADD> &adds,
261 const std::vector<std::string> &function_labels,
262 const std::string &filename)
const;
283 const std::size_t automaton_id);
A dictionary that maps variable names to indices and vice versa.
Definition: VarMgr.h:15
std::vector< int > make_state_eval_vector(std::size_t automaton_id, const std::vector< int > &state_vector) const
Creates a valid input to CUDD::BDD::Eval.
Definition: VarMgr.cpp:184
std::string index_to_name(int index) const
Returns the name of the variable at index index.
Definition: VarMgr.cpp:136
std::size_t automaton_num() const
Returns the number of DFAs the manager handles.
Definition: VarMgr.cpp:334
std::vector< std::string > output_variable_labels() const
Returns a vector with a label for each output variable.
Definition: VarMgr.cpp:250
VarMgr()
Constructs a VarMgr with no variables.
Definition: VarMgr.cpp:10
CUDD::BDD input_cube() const
Returns a BDD formed by the conjunction of all input variables.
Definition: VarMgr.cpp:160
std::size_t create_complement_state_space(const std::size_t automaton_id)
Create the state space when complementing a DFA.
Definition: VarMgr.cpp:67
std::shared_ptr< CUDD::Cudd > cudd_mgr() const
Returns the CUDD manager used to create the variables.
Definition: VarMgr.cpp:128
CUDD::BDD name_to_variable(const std::string &name) const
Returns the index of the variable with the given name.
Definition: VarMgr.cpp:132
std::size_t total_state_variable_count() const
Returns the total number of state variables.
Definition: VarMgr.cpp:144
std::vector< std::string > input_variable_labels() const
Returns a vector with a label for each input variable.
Definition: VarMgr.cpp:261
CUDD::BDD state_variable(std::size_t automaton_id, std::size_t i) const
Returns the i-th state variable for a given automaton.
Definition: VarMgr.cpp:81
void create_named_variables(const std::vector< std::string > &variable_names)
Creates BDD variables and associates each with a name.
Definition: VarMgr.cpp:14
std::vector< std::string > state_variable_labels(std::size_t automaton_id) const
Returns a vector with a label for each state variable.
Definition: VarMgr.cpp:272
std::string bdd_to_string(const CUDD::BDD &bdd) const
Prints a BDD as a Boolean formula, where each variable has a specific label.
Definition: VarMgr.cpp:338
CUDD::BDD state_vector_to_bdd(std::size_t automaton_id, const std::vector< int > &state_vector) const
Converts a state vector to a BDD.
Definition: VarMgr.cpp:86
void partition_variables(const std::vector< std::string > &input_names, const std::vector< std::string > &output_names)
Partitions the named variables between inputs and outputs.
Definition: VarMgr.cpp:102
void dump_dot(const CUDD::ADD &add, const std::string &filename) const
Saves an ADD in a .dot file.
Definition: VarMgr.cpp:286
CUDD::BDD output_cube() const
Returns a BDD formed by the conjunction of all output variables.
Definition: VarMgr.cpp:164
std::size_t input_variable_count() const
Returns the number of input variables.
Definition: VarMgr.cpp:152
std::size_t output_variable_count() const
Returns the number of output variables.
Definition: VarMgr.cpp:156
std::size_t state_variable_count(std::size_t automaton_id) const
Returns the number of state variables for a given automaton.
Definition: VarMgr.cpp:148
std::size_t create_product_state_space(const std::vector< std::size_t > &automaton_ids)
Registers a new automaton ID associated with a product state space.
Definition: VarMgr.cpp:51
std::size_t create_state_variables(std::size_t variable_count)
Creates and stores state variables.
Definition: VarMgr.cpp:27
std::size_t total_variable_count() const
Returns the total number of variables, including named and state.
Definition: VarMgr.cpp:140
std::vector< int > make_eval_vector(std::size_t automaton_id, const std::vector< int > &state_vector) const
Creates a valid input to CUDD::BDD::Eval.
Definition: VarMgr.cpp:172
std::vector< CUDD::BDD > make_compose_vector(std::size_t automaton_id, const std::vector< CUDD::BDD > &state_bdds) const
Creates a valid input to CUDD::BDD::VectorCompose.
Definition: VarMgr.cpp:196
CUDD::BDD state_variables_cube(std::size_t automaton_id) const
Returns a BDD formed by the conjunction of all state variables of automaton automaton_id.
Definition: VarMgr.cpp:168
std::vector< std::string > variable_labels() const
Returns a vector with a label for each variable.
Definition: VarMgr.cpp:233