Adiar
2.1.0
An External Memory Decision Diagram Library
|
A reduced Binary Decision Diagram. More...
#include <adiar/bdd/bdd.h>
Public Types | |
using | node_type = node |
Type of nodes of this diagram. | |
using | pointer_type = node_type::pointer_type |
Type of pointers of this diagram. | |
using | label_type = node_type::label_type |
Type of this node's variable label. | |
using | signed_label_type = node_type::signed_label_type |
Type for difference between variable labels. | |
using | id_type = node_type::id_type |
Type of this node's level identifier. | |
using | terminal_type = typename node_type::terminal_type |
Type of a terminal value. | |
using | node_file_type = levelized_file< node_type > |
File type for the file object representing the diagram. | |
using | shared_node_file_type = shared_file_ptr< node_file_type > |
File type for the shared file object representing the diagram. | |
Public Member Functions | |
bdd () | |
Default construction, creating the false terminal. More... | |
bdd (terminal_type t) | |
Implicit conversion from a terminal value to construct the false and true terminals. More... | |
bdd (const bdd &f) | |
Copy construction, incrementing the reference count on the file underneath. | |
bdd (bdd &&f) | |
Move construction, taking over ownership of the files underneath. | |
bdd (__bdd &&f) | |
Implicit move conversion from a possibly to-be reduced result from an algorithm to a bdd . More... | |
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 & | operator&= (const bdd &other) |
bdd & | operator|= (const bdd &other) |
bdd & | operator^= (const bdd &other) |
bdd & | operator+= (const bdd &other) |
bdd & | operator-= (const bdd &other) |
bdd & | operator*= (const bdd &other) |
const shared_node_file_type | file_ptr () const |
Read-only access to the raw files and meta information. | |
const node_file_type * | operator-> () const |
Read-only access to the members of the raw files and meta information, i.e. this is similar to writing .file_ptr()-> . | |
bool | is_negated () const |
Read-only access to the negation flag. | |
signed_label_type | shift () const |
Read-only access to the number of levels to shift. | |
size_t | size () const |
The number of elements in the node file. | |
size_t | width () const |
The number of nodes on the widest level. | |
size_t | number_of_terminals (const bool value) const |
Number of terminals of a certain value. | |
size_t | number_of_terminals () const |
Number of terminals. | |
Static Public Attributes | |
static constexpr label_type | max_label = node_type::max_label |
The maximal possible value for a unique identifier's label. | |
static constexpr id_type | max_id = node_type::max_id |
The maximal possible value for this nodes level identifier. | |
Protected Member Functions | |
void | deref () |
Release the claim on the underlying file, thereby decreasing its reference counter. If this is the sole owner of that file object, then that object is destructed together with the physical files on disk (if temporary). | |
Protected Attributes | |
shared_node_file_type | _file |
The file describing the actual DAG of the decision diagram. | |
bool | _negate = false |
Whether to negate the leaves when reading nodes from the file. | |
signed_label_type | _shift = 0 |
Number of levels to shift by. | |
A reduced Binary Decision Diagram.
adiar::bdd::bdd | ( | ) |
Default construction, creating the false terminal.
adiar::bdd::bdd | ( | terminal_type | t | ) |
Implicit conversion from a terminal value to construct the false
and true
terminals.
adiar::bdd::bdd | ( | __bdd && | f | ) |
Implicit move conversion from a possibly to-be reduced result from an algorithm to a bdd
.
Since the adiar::internal::reduce
algorithm is run as part of this constructor, the scoping rules ensure we garbage collect irrelevant files as early as possible.
o
is forced to be moved, we force the content of o
to be destructed after finishing the Reduce algorithm.