Adiar  2.1.0
An External Memory Decision Diagram Library
adiar::bdd Class Reference

A reduced Binary Decision Diagram. More...

#include <adiar/bdd/bdd.h>

Inheritance diagram for adiar::bdd:
[legend]
Collaboration diagram for adiar::bdd:
[legend]

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...
 
bddoperator= (const bdd &other)
 Assigns new bdd.
 
bddoperator= (__bdd &&other)
 Assigns new bdd to a variable; the content is derefenced before the given __bdd is reduced into a bdd.
 
bddoperator&= (const bdd &other)
 
bddoperator|= (const bdd &other)
 
bddoperator^= (const bdd &other)
 
bddoperator+= (const bdd &other)
 
bddoperator-= (const bdd &other)
 
bddoperator*= (const bdd &other)
 
const shared_node_file_type file_ptr () const
 Read-only access to the raw files and meta information.
 
const node_file_typeoperator-> () 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.
 

Detailed Description

A reduced Binary Decision Diagram.

Remarks
To ensure the most disk-space is available, try to garbage collect objects of this type as quickly as possible and/or minimise the number of lvalues of this type.

Constructor & Destructor Documentation

◆ bdd() [1/3]

adiar::bdd::bdd ( )

Default construction, creating the false terminal.

See also
bdd_false

◆ bdd() [2/3]

adiar::bdd::bdd ( terminal_type  t)

Implicit conversion from a terminal value to construct the false and true terminals.

See also
bdd_terminal, bdd_false, bdd_true

◆ bdd() [3/3]

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.

Remarks
Since the value o is forced to be moved, we force the content of o to be destructed after finishing the Reduce algorithm.

Member Function Documentation

◆ operator&=()

bdd& adiar::bdd::operator&= ( const bdd other)
See also
bdd_and

◆ operator*=()

bdd& adiar::bdd::operator*= ( const bdd other)
See also
bdd_and

◆ operator+=()

bdd& adiar::bdd::operator+= ( const bdd other)
See also
bdd_or

◆ operator-=()

bdd& adiar::bdd::operator-= ( const bdd other)
See also
bdd_diff

◆ operator^=()

bdd& adiar::bdd::operator^= ( const bdd other)
See also
bdd_xor

◆ operator|=()

bdd& adiar::bdd::operator|= ( const bdd other)
See also
bdd_or

The documentation for this class was generated from the following file: