Adiar 2.1.0
An External Memory Decision Diagram Library
Loading...
Searching...
No Matches
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
8namespace adiar
9{
10 class bdd;
11
21 class __bdd : public internal::__dd
22 {
23 public:
28
33
38
42 __bdd(const bdd& bdd);
43
47 explicit
48 operator bool() &&;
49 };
50
58 class bdd : public internal::dd
59 {
61 // Friends
62 // |- classes [public]
63 friend __bdd;
64
65 // |- functions
66 friend bdd
67 bdd_not(const bdd&);
68 friend bdd
69 bdd_not(bdd&&);
70
71 friend size_t
73
74 friend label_type
76
77 friend __bdd
78 bdd_ite(const exec_policy& ep, const bdd& f, const bdd& g, const bdd& h);
79
80 public:
85 static constexpr std::string_view false_print = "&perp;";
86
90 static constexpr std::string_view true_print = "&#x22A4;"; // &top;
92
94 // Constructors
95 public:
102
110
115 bdd(const shared_node_file_type& f, bool negate = false, signed_label_type shift = 0);
117
121 bdd(const bdd& f);
122
127
139
141 // Operator overloading for use in conditionals
142 public:
146 explicit
147 operator bool() const;
148
150 // Assignment operator overloadings
151 public:
155 bdd&
157
162 bdd&
164
168 bdd&
170
172 bdd&
175
179 bdd&
181
183 bdd&
186
190 bdd&
192
194 bdd&
197
201 bdd&
203
205 bdd&
208
212 bdd&
214
216 bdd&
219
223 bdd&
225
227 bdd&
230 };
231}
232
233#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:59
bdd()
Default construction, creating the false terminal.
bdd & operator=(const bdd &other)
Assigns new bdd.
bdd(const bdd &f)
Copy construction, incrementing the reference count on the file underneath.
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)
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.
bdd & operator-=(const bdd &other)
bdd & operator+=(const bdd &other)
bdd & operator|=(const bdd &other)
friend label_type bdd_varcount(const bdd &)
The number of variables that influence the outcome of the Boolean function, i.e. the number of levels...
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:95
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:280
level_type label_type
Type of variable labels.
Definition dd.h:312
signed_level_type signed_label_type
Type for difference between variable labels.
Definition dd.h:317
shared_file_ptr< node_file_type > shared_node_file_type
File type for the shared file object representing the diagram.
Definition dd.h:347
signed_label_type shift() const
Read-only access to the number of levels to shift.
Definition dd.h:445
typename node_type::terminal_type terminal_type
Type of a terminal value.
Definition dd.h:337
consumer< ValueType > make_consumer(OutputIt &&iter)
Wrap an iterator into a consumer function.
Definition functional.h:71
Core types.
Definition adiar.h:40