A builder for decision diagrams.
More...
#include <adiar/builder.h>
|
| builder () noexcept |
| Constructor.
|
|
| ~builder () noexcept |
| Destructor.
|
|
builder_ptr< Policy > | add_node (typename Policy::label_type label, const builder_ptr< Policy > &low, const builder_ptr< Policy > &high) |
| Add an internal node with a given label and its two children. More...
|
|
builder_ptr< Policy > | add_node (const typename Policy::label_type label, const bool low, const builder_ptr< Policy > &high) |
| Add an internal node with a given label and its two children. More...
|
|
builder_ptr< Policy > | add_node (const typename Policy::label_type label, const builder_ptr< Policy > &low, const bool high) |
| Add an internal node with a given label and its two children. More...
|
|
builder_ptr< Policy > | add_node (const typename Policy::label_type label, const bool low, const bool high) |
| Add an internal node with a given label and its two children. More...
|
|
builder_ptr< Policy > | add_node (bool terminal_value) |
| Add a terminal node with a given value. More...
|
|
Policy::dd_type | build () |
| Builds the decision diagram with the added nodes. This also clears the builder. More...
|
|
void | clear () noexcept |
| Clear builder of all its current content, discarding all nodes and invalidating any pointers to them. More...
|
|
template<typename Policy>
class adiar::builder< Policy >
A builder for decision diagrams.
Nodes should be added bottom-up. Each added node returns a builder_ptr so that it can be used as a child for other nodes.
- Template Parameters
-
Policy | Logic related to the specific type of decision diagram to construct. |
◆ add_node() [1/5]
template<typename Policy >
Add a terminal node with a given value.
- Parameters
-
terminal_value | Value of the constant function to create. |
◆ add_node() [2/5]
template<typename Policy >
builder_ptr<Policy> adiar::builder< Policy >::add_node |
( |
const typename Policy::label_type |
label, |
|
|
const bool |
low, |
|
|
const bool |
high |
|
) |
| |
|
inline |
Add an internal node with a given label and its two children.
- Parameters
-
label | The variable label for the node to create. |
low | Terminal value for when when the variable with the given label evaluates to false . |
high | Terminal value for when the variable with the given label evaluates to true . |
- Returns
- Pointer to the node for the desired function.
- Exceptions
-
invalid_argument | If label violates the bottom-up ordering (see add_node). |
◆ add_node() [3/5]
template<typename Policy >
Add an internal node with a given label and its two children.
- Parameters
-
label | The variable label for the node to create. |
low | Terminal value for when the variable with the given label evaluates to false . |
high | Pointer for when the variable with the given label evaluates to true . |
- Returns
- Pointer to the (possibly new) node for the desired function.
- Exceptions
-
invalid_argument | If label and high are illegal (see add_node). |
◆ add_node() [4/5]
template<typename Policy >
Add an internal node with a given label and its two children.
- Parameters
-
label | The variable label for the node to create. |
low | Pointer for when when the variable with the given label evaluates to false . |
high | Terminal value for when the variable with the given label evaluates to true . |
- Returns
- Pointer to the (possibly new) node for the desired function.
- Exceptions
-
invalid_argument | If label and low are illegal (see add_node). |
◆ add_node() [5/5]
template<typename Policy >
Add an internal node with a given label and its two children.
- Parameters
-
label | The variable label for the node to create. |
low | Pointer for when the variable with the given label evaluates to false . |
high | Pointer for when the variable with the given label evaluates to true . |
- Returns
- Pointer to the (possibly new) node for the desired function.
- Exceptions
-
invalid_argument | If a node is malformed or not added in bottom-up order. |
invalid_argument | If pointers stem from another builder. |
◆ build()
template<typename Policy >
Builds the decision diagram with the added nodes. This also clears the builder.
- See also
- clear
- Exceptions
-
domain_error | If add_node has not been called |
domain_error | If there are more than one root in the diagram. |
- Precondition
- One has used
add_node
to create a non-empty and singly-rooted decision diagram.
- Warning
- After calling this function all previously created
builder_ptr
created by this object will be invalidated and cannot be used anymore.
◆ clear()
template<typename Policy >
Clear builder of all its current content, discarding all nodes and invalidating any pointers to them.
- Warning
- This will invalidate any pointers created up to this point. You will not be able to use them after this.
The documentation for this class was generated from the following file:
- /home/runner/work/adiar/adiar/src/adiar/builder.h