- java.lang.Object
-
- de.learnlib.algorithm.adt.util.ADTUtil
-
public final class ADTUtil extends Object
Utility class, that offers some operations revolving around adaptive distinguishing sequences.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S,I,O>
ADTNode<S,I,O>buildADSFromObservation(net.automatalib.word.Word<I> input, net.automatalib.word.Word<O> output, S finalState)
Build a single trace ADS from the given information.static <S,I,O>
net.automatalib.common.util.Pair<ADTNode<S,I,O>,ADTNode<S,I,O>>buildADSFromTrace(net.automatalib.automaton.transducer.MealyMachine<S,I,?,O> automaton, net.automatalib.word.Word<I> trace, S state)
static <S,I,O>
ADTNode<S,I,O>buildFromADS(net.automatalib.graph.ads.ADSNode<S,I,O> node)
Utility method that wraps an ADS of typeADSNode
into the equivalent ADS of typeADTNode
.static <S,I,O>
net.automatalib.common.util.Pair<net.automatalib.word.Word<I>,net.automatalib.word.Word<O>>buildTraceForNode(ADTNode<S,I,O> node)
static <S,I,O>
Set<ADTNode<S,I,O>>collectADSNodes(ADTNode<S,I,O> root, boolean includeRoot)
static <S,I,O>
Set<ADTNode<S,I,O>>collectDirectSubADSs(ADTNode<S,I,O> node)
static <S> Set<S>
collectHypothesisStates(ADTNode<S,?,?> root)
static <S,I,O>
Set<ADTNode<S,I,O>>collectLeaves(ADTNode<S,I,O> root)
static <S,I,O>
Set<ADTNode<S,I,O>>collectResetNodes(ADTNode<S,I,O> root)
static int
computeEffectiveResets(ADTNode<?,?,?> 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.static <S,I,O>
OgetOutputForSuccessor(ADTNode<S,I,O> node, ADTNode<S,I,O> successor)
static <S,I,O>
ADTNode<S,I,O>getStartOfADS(ADTNode<S,I,O> node)
static boolean
isLeafNode(@Nullable ADTNode<?,?,?> node)
static boolean
isResetNode(@Nullable ADTNode<?,?,?> node)
static boolean
isSymbolNode(@Nullable ADTNode<?,?,?> node)
static <S,I,O>
booleanmergeADS(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.
-
-
-
Method Detail
-
isLeafNode
public static boolean isLeafNode(@Nullable ADTNode<?,?,?> node)
-
isResetNode
public static boolean isResetNode(@Nullable ADTNode<?,?,?> node)
-
isSymbolNode
public static boolean isSymbolNode(@Nullable ADTNode<?,?,?> node)
-
collectResetNodes
public static <S,I,O> Set<ADTNode<S,I,O>> collectResetNodes(ADTNode<S,I,O> root)
-
collectADSNodes
public static <S,I,O> Set<ADTNode<S,I,O>> collectADSNodes(ADTNode<S,I,O> root, boolean includeRoot)
-
collectDirectSubADSs
public static <S,I,O> Set<ADTNode<S,I,O>> collectDirectSubADSs(ADTNode<S,I,O> node)
-
buildTraceForNode
public static <S,I,O> net.automatalib.common.util.Pair<net.automatalib.word.Word<I>,net.automatalib.word.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(net.automatalib.graph.ads.ADSNode<S,I,O> node)
Utility method that wraps an ADS of typeADSNode
into the equivalent ADS of typeADTNode
.- Type Parameters:
S
- (hypothesis) state typeI
- input alphabet typeO
- output alphabet type- Parameters:
node
- the root node of the ADS- Returns:
- an equivalent ADS using the
ADTNode
interface
-
computeEffectiveResets
public static int computeEffectiveResets(ADTNode<?,?,?> 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.- Parameters:
adt
- the node whose subtree should be analyzed- Returns:
- the number of encountered reset nodes
-
buildADSFromTrace
public static <S,I,O> net.automatalib.common.util.Pair<ADTNode<S,I,O>,ADTNode<S,I,O>> buildADSFromTrace(net.automatalib.automaton.transducer.MealyMachine<S,I,?,O> automaton, net.automatalib.word.Word<I> trace, S state)
-
buildADSFromObservation
public static <S,I,O> ADTNode<S,I,O> buildADSFromObservation(net.automatalib.word.Word<I> input, net.automatalib.word.Word<O> output, S finalState)
Build a single trace ADS from the given information.- Type Parameters:
S
- (hypothesis) state typeI
- input alphabet typeO
- output alphabet type- Parameters:
input
- the input sequence of the traceoutput
- the output sequence of the tracefinalState
- 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 typeI
- input alphabet typeO
- output alphabet type- Parameters:
parent
- the parent ADS in which the given child ADS should be merged intochild
- the (single trace) ADS which should be incorporated into the parent ADS.- Returns:
true
if ADSs could be merged,false
otherwise
-
-