Class AbstractAAARLearner<L extends LearningAlgorithm<CM,CI,D> & SupportsGrowingAlphabet<CI>,AM,CM,AI,CI,D>
- java.lang.Object
-
- de.learnlib.algorithm.aaar.AbstractAAARLearner<L,AM,CM,AI,CI,D>
-
- Type Parameters:
L
- learner typeAM
- abstract model typeCM
- concrete model typeAI
- abstract input symbol typeCI
- concrete input symbol typeD
- output domain type
- All Implemented Interfaces:
LearningAlgorithm<AM,CI,D>
- Direct Known Subclasses:
AbstractExplicitAAARLearner
,AbstractGenericAAARLearner
public abstract class AbstractAAARLearner<L extends LearningAlgorithm<CM,CI,D> & SupportsGrowingAlphabet<CI>,AM,CM,AI,CI,D> extends Object implements LearningAlgorithm<AM,CI,D>
Base implementation of the learner presented in "Automata Learning with Automated Alphabet Abstraction Refinement" by Howar et al.This implementation is a
LearningAlgorithm
for abstract models but operates on concrete systems with concrete input symbols. Therefore, the learner receives concrete counterexamples which are transformed into abstract ones (using the simultaneously inferredabstraction tree
) whose symbols are then mapped to their concrete representatives again, prior to actual refinement. Since this concept is agnostic to the actual learning process, this learner can be parameterized with an arbitrary (concrete) learning algorithm for the acutal inference.There exist several accessor for different views on the current hypothesis, e.g., the actual hypothesis of the internal learner, an abstracted hypothesis, and a translating hypothesis which automatically performs the previously mentioned translation steps for offering a model that is able to handle previously unobserved (concrete) input symbols.
-
-
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>
-
-
Constructor Summary
Constructors Constructor Description AbstractAAARLearner(LearnerConstructor<L,CI,D> learnerConstructor, MembershipOracle<CI,D> o)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <S1,S2,SP,TP>
voidcopyAbstract(UniversalDeterministicAutomaton<S1,CI,?,SP,TP> src, MutableDeterministic<S2,AI,?,SP,TP> tgt)
Alphabet<AI>
getAbstractAlphabet()
Returns the (abstract) alphabet of the current (abstract) hypothesis model (cf.protected abstract Collection<AI>
getInitialAbstracts()
protected abstract Collection<CI>
getInitialRepresentatives()
L
getLearner()
Returns the created instance of the provided internal learner.abstract Alphabet<CI>
getLearnerAlphabet()
Returns the (concrete) alphabet of the current (concrete) internal hypothesis model (cf.CM
getLearnerHypothesisModel()
Returns the (concrete) hypothesis model form the provided internal learner.abstract CM
getTranslatingHypothesisModel()
Returns a model of the current internal hypothesis model (cf.protected abstract AbstractAbstractionTree<AI,CI,D>
getTreeForRepresentative(CI ci)
boolean
refineHypothesis(DefaultQuery<CI,D> query)
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.-
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
-
-
-
-
Constructor Detail
-
AbstractAAARLearner
public AbstractAAARLearner(LearnerConstructor<L,CI,D> learnerConstructor, MembershipOracle<CI,D> o)
-
-
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<L extends LearningAlgorithm<CM,CI,D> & SupportsGrowingAlphabet<CI>,AM,CM>
-
refineHypothesis
public boolean refineHypothesis(DefaultQuery<CI,D> query)
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<L extends LearningAlgorithm<CM,CI,D> & SupportsGrowingAlphabet<CI>,AM,CM>
- Parameters:
query
- 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).
-
getAbstractAlphabet
public Alphabet<AI> getAbstractAlphabet()
Returns the (abstract) alphabet of the current (abstract) hypothesis model (cf.LearningAlgorithm.getHypothesisModel()
).- Returns:
- the (abstract) alphabet of the current (abstract) hypothesis model
-
getLearnerAlphabet
public abstract Alphabet<CI> getLearnerAlphabet()
Returns the (concrete) alphabet of the current (concrete) internal hypothesis model (cf.getLearnerHypothesisModel()
).- Returns:
- the (concrete) alphabet of the current (concrete) internal hypothesis model
-
getLearnerHypothesisModel
public CM getLearnerHypothesisModel()
Returns the (concrete) hypothesis model form the provided internal learner.- Returns:
- the (concrete) hypothesis model form the provided internal learner
-
getTranslatingHypothesisModel
public abstract CM getTranslatingHypothesisModel()
Returns a model of the current internal hypothesis model (cf.getLearnerHypothesisModel()
) that automatically transforms (concrete) input symbols to abstract ones and uses their representatives to actually perform transitions. This allows the returned model to handle (concrete) input symbols that have not yet been added to the hypothesis by previous abstraction refinements. Note that this model requires theMembershipOracle
passed to the constructor of this learner to still function in order to determine the abstract input symbols.- Returns:
- the (concrete) hypothesis model that automatically transforms input symbols
-
getLearner
public L getLearner()
Returns the created instance of the provided internal learner.- Returns:
- the created instance of the provided internal learner
-
copyAbstract
protected <S1,S2,SP,TP> void copyAbstract(UniversalDeterministicAutomaton<S1,CI,?,SP,TP> src, MutableDeterministic<S2,AI,?,SP,TP> tgt)
-
getTreeForRepresentative
protected abstract AbstractAbstractionTree<AI,CI,D> getTreeForRepresentative(CI ci)
-
getInitialAbstracts
protected abstract Collection<AI> getInitialAbstracts()
-
getInitialRepresentatives
protected abstract Collection<CI> getInitialRepresentatives()
-
-