Package de.learnlib.algorithm.adt.util
Class ADTUtil
- 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(Word<I> input, Word<O> output, S finalState)
Build a single trace ADS from the given information.static <S,I,O>
Pair<ADTNode<S,I,O>,ADTNode<S,I,O>>buildADSFromTrace(MealyMachine<S,I,?,O> automaton, Word<I> trace, S state)
static <S,I,O>
ADTNode<S,I,O>buildFromADS(ADSNode<S,I,O> node)
static <S,I,O>
Pair<Word<I>,Word<O>>buildTraceForNode(ADTNode<S,I,O> node)
static <S,I,O>
Set<ADTNode<S,I,O>>collectADSNodes(ADTNode<S,I,O> root)
static <S,I,O>
Set<ADTNode<S,I,O>>collectDirectSubADSs(ADTNode<S,I,O> node)
static <S,I,O>
Set<S>collectHypothesisStates(ADTNode<S,I,O> 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 <S,I,O>
intcomputeEffectiveResets(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.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 <S,I,O>
booleanisLeafNode(ADTNode<S,I,O> node)
static <S,I,O>
booleanisResetNode(ADTNode<S,I,O> node)
static <S,I,O>
booleanisSymbolNode(ADTNode<S,I,O> 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
-
isSymbolNode
public static <S,I,O> boolean isSymbolNode(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)
-
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)
- 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 <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 typeI
- input alphabet typeO
- 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 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
-
isLeafNode
public static <S,I,O> boolean isLeafNode(ADTNode<S,I,O> node)
-
-