Class AbstractOPLearner<M extends SuffixOutput<I,D>,I,D,SP,TP>
- java.lang.Object
-
- de.learnlib.algorithm.observationpack.AbstractOPLearner<M,I,D,SP,TP>
-
- All Implemented Interfaces:
LearningAlgorithm<M,I,D>
,Resumable<OPLearnerState<I,D,SP,TP>>
,SupportsGrowingAlphabet<I>
- Direct Known Subclasses:
OPLearnerDFA
,OPLearnerMealy
,OPLearnerMoore
public abstract class AbstractOPLearner<M extends SuffixOutput<I,D>,I,D,SP,TP> extends Object implements LearningAlgorithm<M,I,D>, SupportsGrowingAlphabet<I>, Resumable<OPLearnerState<I,D,SP,TP>>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractOPLearner.BuilderDefaults
-
Nested classes/interfaces inherited from interface de.learnlib.algorithm.LearningAlgorithm
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>, LearningAlgorithm.MooreLearner<I,O>, LearningAlgorithm.NFALearner<I>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOPLearner(Alphabet<I> alphabet, MembershipOracle<I,D> oracle, LocalSuffixFinder<? super I,? super D> suffixFinder, boolean repeatedCounterexampleEvaluation, AbstractWordBasedDiscriminationTree<I,D,HState<I,D,SP,TP>> dtree)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAlphabetSymbol(I symbol)
protected HState<I,D,SP,TP>
createState(HTransition<I,D,SP,TP> trans)
AbstractWordBasedDiscriminationTree<I,D,HState<I,D,SP,TP>>
getDiscriminationTree()
OPLearnerHypothesis<I,D,SP,TP>
getHypothesisDS()
protected void
initializeState(HState<I,D,SP,TP> newState)
boolean
refineHypothesis(DefaultQuery<I,D> ceQuery)
Triggers a refinement of the model by providing a counterexample.protected boolean
refineHypothesisSingle(DefaultQuery<I,D> ceQuery)
void
resume(OPLearnerState<I,D,SP,TP> state)
Resume the datastructure from a previously suspended point in time.protected abstract @Nullable Query<I,D>
spQuery(HState<I,D,SP,TP> state)
void
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.OPLearnerState<I,D,SP,TP>
suspend()
Expose the state object.protected abstract @Nullable Query<I,D>
tpQuery(HTransition<I,D,SP,TP> transition)
protected void
updateHypothesis()
protected void
updateTransitions()
-
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
-
-
-
-
Method Detail
-
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 extends SuffixOutput<I,D>,I,D>
-
refineHypothesis
public boolean refineHypothesis(DefaultQuery<I,D> ceQuery)
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 extends SuffixOutput<I,D>,I,D>
- Parameters:
ceQuery
- 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).
-
refineHypothesisSingle
protected boolean refineHypothesisSingle(DefaultQuery<I,D> ceQuery)
-
updateHypothesis
protected void updateHypothesis()
-
updateTransitions
protected void updateTransitions()
-
getDiscriminationTree
public AbstractWordBasedDiscriminationTree<I,D,HState<I,D,SP,TP>> getDiscriminationTree()
-
getHypothesisDS
public OPLearnerHypothesis<I,D,SP,TP> getHypothesisDS()
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
- Specified by:
addAlphabetSymbol
in interfaceSupportsGrowingAlphabet<M extends SuffixOutput<I,D>>
-
suspend
public OPLearnerState<I,D,SP,TP> suspend()
Description copied from interface:Resumable
Expose the state object.
-
-