Adiar  2.1.0
An External Memory Decision Diagram Library
bdd.h
1 #ifndef ADIAR_BDD_BDD_H
2 #define ADIAR_BDD_BDD_H
3 
4 #include <string_view>
5 
6 #include <adiar/internal/dd.h>
7 
8 namespace adiar
9 {
10  class bdd;
11 
21  class __bdd : public internal::__dd
22  {
23  public:
27  __bdd();
28 
33 
37  __bdd(const shared_arc_file_type& f, const exec_policy& ep);
38 
42  __bdd(const bdd& bdd);
43  };
44 
52  class bdd : public internal::dd
53  {
55  // Friends
56  // |- classes [public]
57  friend __bdd;
58 
59  // |- functions
60  friend bdd
61  bdd_not(const bdd&);
62  friend bdd
63  bdd_not(bdd&&);
64 
65  friend size_t
66  bdd_nodecount(const bdd&);
67 
68  friend label_type
69  bdd_varcount(const bdd&);
70 
71  friend __bdd
72  bdd_ite(const exec_policy& ep, const bdd& f, const bdd& g, const bdd& h);
73 
74  public:
79  static constexpr std::string_view false_print = "&perp;";
80 
84  static constexpr std::string_view true_print = "&#x22A4;"; // &top;
86 
88  // Constructors
89  public:
95  bdd();
96 
104 
109  bdd(const shared_node_file_type& f, bool negate = false, signed_label_type shift = 0);
111 
115  bdd(const bdd& f);
116 
120  bdd(bdd&& f);
121 
132  bdd(__bdd&& f);
133 
135  // Assignment operator overloadings
136  public:
140  bdd&
141  operator=(const bdd& other);
142 
147  bdd&
148  operator=(__bdd&& other);
149 
153  bdd&
154  operator&=(const bdd& other);
155 
157  bdd&
158  operator&=(bdd&& other);
160 
164  bdd&
165  operator|=(const bdd& other);
166 
168  bdd&
169  operator|=(bdd&& other);
171 
175  bdd&
176  operator^=(const bdd& other);
177 
179  bdd&
180  operator^=(bdd&& other);
182 
186  bdd&
187  operator+=(const bdd& other);
188 
190  bdd&
191  operator+=(bdd&& other);
193 
197  bdd&
198  operator-=(const bdd& other);
199 
201  bdd&
202  operator-=(bdd&& other);
204 
208  bdd&
209  operator*=(const bdd& other);
210 
212  bdd&
213  operator*=(bdd&& other);
215  };
216 }
217 
218 #endif // ADIAR_BDD_BDD_H
A (possibly) unreduced Binary Decision Diagram.
Definition: bdd.h:22
__bdd(const shared_node_file_type &f)
Wrapper for an algorithm's already reduced output.
__bdd(const bdd &bdd)
Conversion constructor from a bdd to pass along a prior value.
__bdd()
Default constructor with an empty result.
__bdd(const shared_arc_file_type &f, const exec_policy &ep)
Wrapper for an algorithm's unreduced output.
A reduced Binary Decision Diagram.
Definition: bdd.h:53
bdd()
Default construction, creating the false terminal.
bdd & operator|=(const bdd &other)
bdd & operator^=(const bdd &other)
friend __bdd bdd_ite(const exec_policy &ep, const bdd &f, const bdd &g, const bdd &h)
If-Then-Else operator.
bdd(const bdd &f)
Copy construction, incrementing the reference count on the file underneath.
bdd & operator*=(const bdd &other)
bdd & operator&=(const bdd &other)
friend size_t bdd_nodecount(const bdd &)
The number of (internal) nodes used to represent the function.
bdd & operator-=(const bdd &other)
bdd & operator=(const bdd &other)
Assigns new bdd.
bdd & operator=(__bdd &&other)
Assigns new bdd to a variable; the content is derefenced before the given __bdd is reduced into a bdd...
bdd(__bdd &&f)
Implicit move conversion from a possibly to-be reduced result from an algorithm to a bdd.
bdd(terminal_type t)
Implicit conversion from a terminal value to construct the false and true terminals.
friend label_type bdd_varcount(const bdd &)
The number of variables that influence the outcome of f, i.e. the number of levels in the BDD.
bdd(bdd &&f)
Move construction, taking over ownership of the files underneath.
bdd & operator+=(const bdd &other)
friend bdd bdd_not(const bdd &)
Negation of a BDD.
Settings to dictate the execution of Adiar's algorithms.
Definition: exec_policy.h:35
Definition: dd.h:45
shared_levelized_file< arc_type > shared_arc_file_type
Type of the file object arc-based representation of a diagram.
Definition: dd.h:80
shared_levelized_file< node_type > shared_node_file_type
Type of the file object node-based representation of a diagram.
Definition: dd.h:55
Container for the files that represent a Decision Diagram.
Definition: dd.h:265
shared_file_ptr< node_file_type > shared_node_file_type
File type for the shared file object representing the diagram.
Definition: dd.h:317
node_type::signed_label_type signed_label_type
Type for difference between variable labels.
Definition: dd.h:287
node_type::label_type label_type
Type of this node's variable label.
Definition: dd.h:282
signed_label_type shift() const
Read-only access to the number of levels to shift.
Definition: dd.h:415
typename node_type::terminal_type terminal_type
Type of a terminal value.
Definition: dd.h:307
Core types.
Definition: adiar.h:40