Class XDD<E>

  • Type Parameters:
    E - Data type of decision diagram

    public class XDD<E>
    extends RegularDD<XDDManager<E>,​XDD<E>>
    Extends decision diagrams to handle arbitrary data types (algebraic decision diagrams). Refer to the wiki documentation for performance considerations.
    • Constructor Detail

      • XDD

        public XDD​(long ptr,
                   XDDManager<E> ddManager)
    • Method Detail

      • v

        public @NonNull E v()
        Returns the value of the DD if the root is a leaf. Otherwise, throws an exception.
        Returns:
        Value of root node
      • apply

        public XDD<E> apply​(BinaryOperator<E> op,
                            XDD<E> g)
        Calls a binary function on the values of XDD and g and computes the result.
      • apply2

        public XDD<E> apply2​(BinaryOperator<XDD<E>> op,
                             XDD<E> g)
        Calls a binary function on the XDD and g themselves and computes the result. The function is recursively applied to all nodes compared to apply. Note that the result of the function is not dereferenced, so avoid using functions that create new references or store the references, otherwise the pointers remain in the memory.

        Might crash if another method that accepts two XDDs is called.

      • monadicApply

        public XDD<E> monadicApply​(UnaryOperator<E> op)
        Calls a unary function on the values of the ADD and computes the result.
      • monadicApply2

        public XDD<E> monadicApply2​(UnaryOperator<XDD<E>> op)
        Calls a unary function on the ADD itself and computes the result. The function is recursively applied to all nodes compared to monadicApply. Note that the result of the function is not dereferenced, so avoid using functions that or store the references, otherwise the pointers remain in the memory.
      • monadicTransform

        public <E2> XDD<E2> monadicTransform​(XDDManager<E2> ddManagerTarget,
                                             Function<E,​E2> op)
        Transforms the XDD to another data type.
        Parameters:
        ddManagerTarget - Manager for transformed XDD
        op - Transformation function from old to new type
        Returns:
        Transformed XDD.
      • inverse

        public XDD<E> inverse()
      • compl

        public XDD<E> compl()
      • not

        public XDD<E> not()
      • multInverse

        public XDD<E> multInverse()
      • addInverse

        public XDD<E> addInverse()
      • meet

        public XDD<E> meet​(XDD<E> g)
      • intersect

        public XDD<E> intersect​(XDD<E> g)
      • mult

        public XDD<E> mult​(XDD<E> g)
      • join

        public XDD<E> join​(XDD<E> g)
      • union

        public XDD<E> union​(XDD<E> g)
      • t

        public XDD<E> t()
        Description copied from class: DD
        Returns the then DD of the root. If the root is constant, an exception is thrown by C.
        Specified by:
        t in class DD<XDDManager<E>,​XDD<E>>
        Returns:
        DD when taking the then child
      • e

        public XDD<E> e()
        Description copied from class: DD
        Returns the else DD of the root. If the root is constant, an exception is thrown by C.
        Specified by:
        e in class DD<XDDManager<E>,​XDD<E>>
        Returns:
        DD when taking the else child
      • eval

        public XDD<E> eval​(boolean... input)
        Description copied from class: DD
        Evaluate the DD based on a given assignment.
        Specified by:
        eval in class DD<XDDManager<E>,​XDD<E>>
        Parameters:
        input - Assignment of variables
        Returns:
        value of evaluation
      • eval

        public E eval​(Map<String,​Boolean> ddNameToTruthValueMap)
        Evaluate the XDD with a mapping of variable names to boolean assignments.
        Parameters:
        ddNameToTruthValueMap - Map of variable assignments
        Returns:
        Result of evaluation
      • eval

        public E eval​(Function<String,​@Nullable Boolean> ddNameToTruthValue)
        Evaluate the XDD with a function with variable names as input and boolean assignments as output.
        Parameters:
        ddNameToTruthValue - Function for variable assignments
        Returns:
        Result of evaluation