Class ADTUtil


  • public final class ADTUtil
    extends Object
    Utility class, that offers some operations revolving around adaptive distinguishing sequences.
    • Method Detail

      • isSymbolNode

        public static <S,​I,​O> boolean isSymbolNode​(ADTNode<S,​I,​O> node)
      • getStartOfADS

        public static <S,​I,​O> ADTNode<S,​I,​O> getStartOfADS​(ADTNode<S,​I,​O> node)
      • isResetNode

        public static <S,​I,​O> boolean isResetNode​(ADTNode<S,​I,​O> node)
      • collectHypothesisStates

        public static <S,​I,​O> Set<S> collectHypothesisStates​(ADTNode<S,​I,​O> root)
      • collectLeaves

        public static <S,​I,​O> Set<ADTNode<S,​I,​O>> collectLeaves​(ADTNode<S,​I,​O> root)
      • collectADSNodes

        public static <S,​I,​O> Set<ADTNode<S,​I,​O>> collectADSNodes​(ADTNode<S,​I,​O> root)
      • collectResetNodes

        public static <S,​I,​O> Set<ADTNode<S,​I,​O>> collectResetNodes​(ADTNode<S,​I,​O> root)
      • collectDirectSubADSs

        public static <S,​I,​O> Set<ADTNode<S,​I,​O>> collectDirectSubADSs​(ADTNode<S,​I,​O> node)
      • buildTraceForNode

        public static <S,​I,​O> Pair<Word<I>,​Word<O>> buildTraceForNode​(ADTNode<S,​I,​O> node)
      • getOutputForSuccessor

        public static <S,​I,​O> O getOutputForSuccessor​(ADTNode<S,​I,​O> node,
                                                                  ADTNode<S,​I,​O> successor)
      • buildFromADS

        public static <S,​I,​O> ADTNode<S,​I,​O> buildFromADS​(ADSNode<S,​I,​O> node)
        Utility method that wraps an ADS of type ADSNode into the equivalent ADS of type ADTNode.
        Type Parameters:
        S - (hypothesis) state type
        I - input alphabet type
        O - output alphabet type
        Parameters:
        node - the root node of the ADS
        Returns:
        an equivalent ADS using the ADTNode interface
      • computeEffectiveResets

        public static <S,​I,​O> int computeEffectiveResets​(ADTNode<S,​I,​O> adt)
        Computes how often reset nodes are encountered when traversing from the given node to the leaves of the induced subtree of the given node.
        Type Parameters:
        S - (hypothesis) state type
        I - input alphabet type
        O - output alphabet type
        Parameters:
        adt - the node whose subtree should be analyzed
        Returns:
        the number of encountered reset nodes
      • buildADSFromTrace

        public static <S,​I,​O> Pair<ADTNode<S,​I,​O>,​ADTNode<S,​I,​O>> buildADSFromTrace​(MealyMachine<S,​I,​?,​O> automaton,
                                                                                                                              Word<I> trace,
                                                                                                                              S state)
      • buildADSFromObservation

        public static <S,​I,​O> ADTNode<S,​I,​O> buildADSFromObservation​(Word<I> input,
                                                                                             Word<O> output,
                                                                                             S finalState)
        Build a single trace ADS from the given information.
        Type Parameters:
        S - (hypothesis) state type
        I - input alphabet type
        O - output alphabet type
        Parameters:
        input - the input sequence of the trace
        output - the output sequence of the trace
        finalState - the hypothesis state that should be referenced in the leaf of the ADS
        Returns:
        the root node of the constructed ADS
      • mergeADS

        public static <S,​I,​O> boolean mergeADS​(ADTNode<S,​I,​O> parent,
                                                           ADTNode<S,​I,​O> child)
        Tries to merge the given (single trace) ADSs (which only contains one leaf) into the given parent ADSs. If possible, the parent ADS is altered as a side effect
        Type Parameters:
        S - (hypothesis) state type
        I - input alphabet type
        O - output alphabet type
        Parameters:
        parent - the parent ADS in which the given child ADS should be merged into
        child - the (single trace) ADS which should be incorporated into the parent ADS.
        Returns:
        true if ADSs could be merged, false otherwise
      • isLeafNode

        public static <S,​I,​O> boolean isLeafNode​(ADTNode<S,​I,​O> node)