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 operator bool() &&;
48 };
49
57 class bdd : public internal::dd
58 {
60 // Friends
61 // |- classes [public]
62 friend __bdd;
63
64 // |- functions
65 friend bdd
66 bdd_not(const bdd&);
67 friend bdd
68 bdd_not(bdd&&);
69
70 friend size_t
72
73 friend label_type
75
76 friend __bdd
77 bdd_ite(const exec_policy& ep, const bdd& f, const bdd& g, const bdd& h);
78
79 public:
84 static constexpr std::string_view false_print = "&perp;";
85
89 static constexpr std::string_view true_print = "&#x22A4;"; // &top;
91
93 // Constructors
94 public:
101
109
114 bdd(const shared_node_file_type& f, bool negate = false, signed_label_type shift = 0);
116
120 bdd(const bdd& f);
121
126
138
140 // Operator overloading for use in conditionals
141 public:
142
146 explicit operator bool() const;
147
149 // Assignment operator overloadings
150 public:
154 bdd&
156
161 bdd&
163
167 bdd&
169
171 bdd&
174
178 bdd&
180
182 bdd&
185
189 bdd&
191
193 bdd&
196
200 bdd&
202
204 bdd&
207
211 bdd&
213
215 bdd&
218
222 bdd&
224
226 bdd&
229 };
230}
231
232#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:58
bdd()
Default construction, creating the false terminal.
bdd & operator=(const bdd &other)
Assigns new bdd.
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.
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:85
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:270
shared_file_ptr< node_file_type > shared_node_file_type
File type for the shared file object representing the diagram.
Definition dd.h:327
node_type::signed_label_type signed_label_type
Type for difference between variable labels.
Definition dd.h:297
node_type::label_type label_type
Type of this node's variable label.
Definition dd.h:292
signed_label_type shift() const
Read-only access to the number of levels to shift.
Definition dd.h:425
typename node_type::terminal_type terminal_type
Type of a terminal value.
Definition dd.h:317
consumer< ValueType > make_consumer(OutputIt &&iter)
Wrap an iterator into a consumer function.
Definition functional.h:71
Core types.
Definition adiar.h:40