Class AbstractVPALearner<I>
- java.lang.Object
-
- de.learnlib.algorithm.observationpack.vpa.AbstractVPALearner<I>
-
- Type Parameters:
I- input alphabet type
- All Implemented Interfaces:
LearningAlgorithm<OneSEVPA<?,I>,I,Boolean>
- Direct Known Subclasses:
OPLearnerVPA
public abstract class AbstractVPALearner<I> extends Object implements LearningAlgorithm<OneSEVPA<?,I>,I,Boolean>
-
-
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 VPAlphabet<I>alphabetprotected DTree<I>dtreeprotected OneSEVPAHypothesis<I>hypothesisprotected TransList<I>openTransitionsprotected MembershipOracle<I,Boolean>oracle
-
Constructor Summary
Constructors Constructor Description AbstractVPALearner(VPAlphabet<I> alphabet, MembershipOracle<I,Boolean> oracle)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcloseTransitions()protected HypLoc<I>createLocation(AbstractHypTrans<I> trans)DTree<I>getDiscriminationTree()OneSEVPA<?,I>getHypothesisModel()Returns the current hypothesis model.protected voidinitializeLocation(HypLoc<I> loc)protected static <I> voidlink(DTNode<I> leaf, HypLoc<I> loc)protected HypLoc<I>makeTree(AbstractHypTrans<I> trans)protected Booleanquery(AccessSequenceProvider<I> asp, ContextPair<I> context)booleanrefineHypothesis(DefaultQuery<I,Boolean> ceQuery)Triggers a refinement of the model by providing a counterexample.protected abstract booleanrefineHypothesisSingle(DefaultQuery<I,Boolean> ceQuery)voidstartLearning()Starts the model inference process, creating an initial hypothesis in the provided model object.protected List<DTNode<I>>updateDTTargets(List<AbstractHypTrans<I>> trans, boolean hard)
-
-
-
Field Detail
-
alphabet
protected final VPAlphabet<I> alphabet
-
oracle
protected final MembershipOracle<I,Boolean> oracle
-
hypothesis
protected final OneSEVPAHypothesis<I> hypothesis
-
-
Constructor Detail
-
AbstractVPALearner
public AbstractVPALearner(VPAlphabet<I> alphabet, MembershipOracle<I,Boolean> oracle)
-
-
Method Detail
-
startLearning
public void startLearning()
Description copied from interface:LearningAlgorithmStarts 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:
startLearningin interfaceLearningAlgorithm<OneSEVPA<?,I>,I,Boolean>
-
refineHypothesis
public boolean refineHypothesis(DefaultQuery<I,Boolean> ceQuery)
Description copied from interface:LearningAlgorithmTriggers 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:
refineHypothesisin interfaceLearningAlgorithm<OneSEVPA<?,I>,I,Boolean>- Parameters:
ceQuery- the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).- Returns:
trueif the counterexample triggered a refinement of the hypothesis,falseotherwise (i.e., it was no counterexample).
-
refineHypothesisSingle
protected abstract boolean refineHypothesisSingle(DefaultQuery<I,Boolean> ceQuery)
-
getHypothesisModel
public OneSEVPA<?,I> getHypothesisModel()
Description copied from interface:LearningAlgorithmReturns the current hypothesis model.N.B.: By the contract of this interface, the model returned by this method may not be modified (i.e., M generally should refer to an immutable interface), and its validity is retained only until the next invocation of
LearningAlgorithm.refineHypothesis(DefaultQuery). If older hypotheses have to be maintained, a copy of the returned model must be made.Please note that it should be illegal to invoke this method before an initial invocation of
LearningAlgorithm.startLearning().- Specified by:
getHypothesisModelin interfaceLearningAlgorithm<OneSEVPA<?,I>,I,Boolean>- Returns:
- the current hypothesis model.
-
closeTransitions
protected void closeTransitions()
-
updateDTTargets
protected List<DTNode<I>> updateDTTargets(List<AbstractHypTrans<I>> trans, boolean hard)
-
makeTree
protected HypLoc<I> makeTree(AbstractHypTrans<I> trans)
-
createLocation
protected HypLoc<I> createLocation(AbstractHypTrans<I> trans)
-
query
protected Boolean query(AccessSequenceProvider<I> asp, ContextPair<I> context)
-
-