Package de.learnlib.algorithm.oml.ttt
Class AbstractOptimalTTT<M,I,D>
- java.lang.Object
-
- de.learnlib.algorithm.oml.ttt.AbstractOptimalTTT<M,I,D>
-
- All Implemented Interfaces:
LearningAlgorithm<M,I,D>
,SupportsGrowingAlphabet<I>
,InputAlphabetHolder<I>
- Direct Known Subclasses:
OptimalTTTDFA
,OptimalTTTMealy
public abstract class AbstractOptimalTTT<M,I,D> extends Object implements LearningAlgorithm<M,I,D>, SupportsGrowingAlphabet<I>, InputAlphabetHolder<I>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.learnlib.algorithm.LearningAlgorithm
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>, LearningAlgorithm.MooreLearner<I,O>, LearningAlgorithm.NFALearner<I>
-
-
Field Summary
Fields Modifier and Type Field Description protected PrefixTree<I,D>
ptree
protected SuffixTrie<I>
strie
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOptimalTTT(Alphabet<I> alphabet, MembershipOracle<I,D> ceqs)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAlphabetSymbol(I symbol)
protected abstract AbstractDecisionTree<I,D>
dtree()
Alphabet<I>
getInputAlphabet()
protected abstract DTLeaf<I,D>
getState(Word<I> prefix)
protected abstract D
hypOutput(Word<I> word, int length)
protected abstract boolean
isCanonical()
protected abstract int
maxSearchIndex(int ceLength)
boolean
refineHypothesis(DefaultQuery<I,D> counterexample)
Triggers a refinement of the model by providing a counterexample.void
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.protected abstract D
suffix(D output, int length)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.learnlib.algorithm.LearningAlgorithm
getHypothesisModel
-
-
-
-
Field Detail
-
strie
protected final SuffixTrie<I> strie
-
ptree
protected final PrefixTree<I,D> ptree
-
-
Constructor Detail
-
AbstractOptimalTTT
protected AbstractOptimalTTT(Alphabet<I> alphabet, MembershipOracle<I,D> ceqs)
-
-
Method Detail
-
maxSearchIndex
protected abstract int maxSearchIndex(int ceLength)
-
dtree
protected abstract AbstractDecisionTree<I,D> dtree()
-
isCanonical
protected abstract boolean isCanonical()
-
startLearning
public void startLearning()
Description copied from interface:LearningAlgorithm
Starts the model inference process, creating an initial hypothesis in the provided model object. Please note that it should be illegal to invoke this method twice.- Specified by:
startLearning
in interfaceLearningAlgorithm<M,I,D>
-
refineHypothesis
public boolean refineHypothesis(DefaultQuery<I,D> counterexample)
Description copied from interface:LearningAlgorithm
Triggers a refinement of the model by providing a counterexample. A counterexample is a query which exposes different behavior of the real SUL compared to the hypothesis. Please note that invoking this method before an initial invocation ofLearningAlgorithm.startLearning()
should be illegal.- Specified by:
refineHypothesis
in interfaceLearningAlgorithm<M,I,D>
- Parameters:
counterexample
- the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).- Returns:
true
if the counterexample triggered a refinement of the hypothesis,false
otherwise (i.e., it was no counterexample).
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
- Specified by:
addAlphabetSymbol
in interfaceSupportsGrowingAlphabet<M>
-
getInputAlphabet
public Alphabet<I> getInputAlphabet()
- Specified by:
getInputAlphabet
in interfaceInputAlphabetHolder<M>
-
-