Binary Decision Diagram
A Binary Decision Diagram (BDD) is a rooted, directed, acyclic graph, which consists of several decision nodes and terminal nodes and uses the concept of Shannon Expansion to represent and encode complex Boolean Formulas.
Each node of the diagram represents a single boolean entry with variable value and part of a Boolean function. T is the type with which a variable is represented. In the context of a formula, variables for which the compareTo method returns 0 indicate the same Boolean variable.
Each BDD node has a directed edge to two sub-BDDs: the "high" BDD that leads to a true Terminal, and the "low" BDD that leads to a false Terminal.
Author
Jason Dellaluce
Types
Functions
accept
Link copied to clipboard
Accepts an instance of BinaryDecisionDiagramVisitor as for the visitor pattern.
Properties
isTerminal
Link copied to clipboard
Returns true if this node is a Terminal node.
isVariable
Link copied to clipboard
Returns true if this node is a Variable node.
Inheritors
Extensions
and
Link copied to clipboard
infix fun <T : Comparable<T>> BinaryDecisionDiagram<T>.and(that: BinaryDecisionDiagram<T>): BinaryDecisionDiagram<T>
Content copied to clipboard
Performs the "And" unary boolean operation over two BinaryDecisionDiagrams.
andThenExpansion
Link copied to clipboard
fun <T : Comparable<T>, E> BinaryDecisionDiagram<T>.andThenExpansion(that: BinaryDecisionDiagram<T>, expansionFalseTerminal: E, expansionTrueTerminal: E, expansionOperator: (T, E, E) -> E): Pair<BinaryDecisionDiagram<T>, E>
Content copied to clipboard
Performs the "And" unary boolean operation over two BinaryDecisionDiagrams and computes a value using the Shannon Expansion over the result.
any
Link copied to clipboard
fun <T : Comparable<T>> BinaryDecisionDiagram<T>.any(predicate: (T) -> Boolean): Boolean
Content copied to clipboard
Returns true if the BinaryDecisionDiagram has at least one variable element matching the given predicate.
apply
Link copied to clipboard
fun <T : Comparable<T>> BinaryDecisionDiagram<T>.apply(unaryOp: (Boolean) -> Boolean): BinaryDecisionDiagram<T>
Content copied to clipboard
Applies the "Apply" construction algorithm over BinaryDecisionDiagrams using a given boolean operator.
fun <T : Comparable<T>> BinaryDecisionDiagram<T>.apply(that: BinaryDecisionDiagram<T>, binaryOp: (Boolean, Boolean) -> Boolean): BinaryDecisionDiagram<T>
Content copied to clipboard
Applies the "Apply" construction algorithm over two BinaryDecisionDiagrams using a given boolean operator.
applyThenExpansion
Link copied to clipboard
fun <T : Comparable<T>, E> BinaryDecisionDiagram<T>.applyThenExpansion(unaryOp: (Boolean) -> Boolean, expansionFalseTerminal: E, expansionTrueTerminal: E, expansionOperator: (T, E, E) -> E): Pair<BinaryDecisionDiagram<T>, E>
Content copied to clipboard
Applies the "Apply" construction algorithm over BinaryDecisionDiagrams using a given boolean operator, and computes a value using the Shannon Expansion over the result.
fun <T : Comparable<T>, E> BinaryDecisionDiagram<T>.applyThenExpansion(that: BinaryDecisionDiagram<T>, binaryOp: (Boolean, Boolean) -> Boolean, expansionFalseTerminal: E, expansionTrueTerminal: E, expansionOperator: (T, E, E) -> E): Pair<BinaryDecisionDiagram<T>, E>
Content copied to clipboard
Applies the "Apply" construction algorithm over two BinaryDecisionDiagrams using a given boolean operator, and computes a value using the Shannon Expansion over the result.
countVariableNodes
Link copied to clipboard
fun <T : Comparable<T>> BinaryDecisionDiagram<T>.countVariableNodes(): Int
Content copied to clipboard
Returns the number of variable nodes contained in a BinaryDecisionDiagram.
map
Link copied to clipboard
fun <T : Comparable<T>, E : Comparable<E>> BinaryDecisionDiagram<T>.map(mapper: (T) -> E): BinaryDecisionDiagram<E>
Content copied to clipboard
Returns a BinaryDecisionDiagram containing nodes of applying the given transform function to each element in the original BinaryDecisionDiagram.
not
Link copied to clipboard
fun <T : Comparable<T>> BinaryDecisionDiagram<T>.not(): BinaryDecisionDiagram<T>
Content copied to clipboard
Performs the "Not" unary boolean operation over a BinaryDecisionDiagram.
notThenExpansion
Link copied to clipboard
fun <T : Comparable<T>, E> BinaryDecisionDiagram<T>.notThenExpansion(expansionFalseTerminal: E, expansionTrueTerminal: E, expansionOperator: (T, E, E) -> E): Pair<BinaryDecisionDiagram<T>, E>
Content copied to clipboard
Performs the "Not" unary boolean operation over a BinaryDecisionDiagram and computes a value using the Shannon Expansion over the result.
or
Link copied to clipboard
infix fun <T : Comparable<T>> BinaryDecisionDiagram<T>.or(that: BinaryDecisionDiagram<T>): BinaryDecisionDiagram<T>
Content copied to clipboard
Performs the "Or" unary boolean operation over two BinaryDecisionDiagrams.
orThenExpansion
Link copied to clipboard
fun <T : Comparable<T>, E> BinaryDecisionDiagram<T>.orThenExpansion(that: BinaryDecisionDiagram<T>, expansionFalseTerminal: E, expansionTrueTerminal: E, expansionOperator: (T, E, E) -> E): Pair<BinaryDecisionDiagram<T>, E>
Content copied to clipboard
Performs the "Or" unary boolean operation over two BinaryDecisionDiagrams and computes a value using the Shannon Expansion over the result.
toDotString
Link copied to clipboard