A
- automaton type, must be a subclass of MutableDeterministic
I
- input symbol typeD
- output domain typeSP
- state property typeTP
- transition property typepublic abstract class AbstractAutomatonLStar<A,I,D,S,T,SP,TP,AI extends net.automatalib.automata.MutableDeterministic<S,I,T,SP,TP> & net.automatalib.automata.GrowableAlphabetAutomaton<I>> extends AbstractLStar<A,I,D> implements ResumableLearner<AutomatonLStarState<I,D,AI,S>>
MutableDeterministic
automata.
This class provides the L*-style hypothesis construction. Implementing classes solely have to specify how state and transition properties should be derived.
OTLearner.OTLearnerDFA<I>, OTLearner.OTLearnerMealy<I,O>
GlobalSuffixLearner.GlobalSuffixLearnerDFA<I>, GlobalSuffixLearner.GlobalSuffixLearnerMealy<I,O>
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>
Modifier and Type | Field and Description |
---|---|
protected AI |
internalHyp |
protected List<de.learnlib.algorithms.lstar.AbstractAutomatonLStar.StateInfo<S,I>> |
stateInfos |
alphabet, oracle, table
Modifier | Constructor and Description |
---|---|
protected |
AbstractAutomatonLStar(net.automatalib.words.Alphabet<I> alphabet,
MembershipOracle<I,D> oracle,
AI internalHyp)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlphabetSymbol(I symbol) |
protected S |
createState(boolean initial,
Row<I> row) |
protected void |
doRefineHypothesis(DefaultQuery<I,D> ceQuery) |
protected abstract A |
exposeInternalHypothesis() |
A |
getHypothesisModel()
Returns the current hypothesis model.
|
protected void |
refineHypothesisInternal(DefaultQuery<I,D> ceQuery) |
void |
resume(AutomatonLStarState<I,D,AI,S> state)
Does not get the learner to continue learning.
|
protected void |
setTransition(S from,
I input,
S to,
Row<I> fromRow,
int inputIdx) |
void |
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.
|
protected abstract SP |
stateProperty(ObservationTable<I,D> table,
Row<I> stateRow)
Derives a state property from the corresponding row.
|
AutomatonLStarState<I,D,AI,S> |
suspend()
Expose the serializable learner state object.
|
protected abstract TP |
transitionProperty(ObservationTable<I,D> table,
Row<I> stateRow,
int inputIdx)
Derives a transition property from the corresponding transition.
|
protected void |
updateInternalHypothesis()
Performs the L*-style hypothesis construction.
|
addGlobalSuffixes, analyzeInconsistency, completeConsistentTable, getGlobalSuffixes, getObservationTable, hypothesisOutput, incorporateCounterExample, initialPrefixes, initialSuffixes, refineHypothesis, selectClosingRows
protected AI extends net.automatalib.automata.MutableDeterministic<S,I,T,SP,TP> & net.automatalib.automata.GrowableAlphabetAutomaton<I> internalHyp
protected AbstractAutomatonLStar(net.automatalib.words.Alphabet<I> alphabet, MembershipOracle<I,D> oracle, AI internalHyp)
alphabet
- the learning alphabetoracle
- the learning oraclepublic A getHypothesisModel()
LearningAlgorithm
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()
.
getHypothesisModel
in interface LearningAlgorithm<A,I,D>
protected abstract A exposeInternalHypothesis()
public final void startLearning()
LearningAlgorithm
startLearning
in interface LearningAlgorithm<A,I,D>
startLearning
in class AbstractLStar<A,I,D>
protected void updateInternalHypothesis()
stateProperty(ObservationTable, Row)
and transitionProperty(ObservationTable, Row, int)
methods are
used to derive the respective properties.protected abstract SP stateProperty(ObservationTable<I,D> table, Row<I> stateRow)
table
- the current observation tablestateRow
- the row for which the state is createdprotected abstract TP transitionProperty(ObservationTable<I,D> table, Row<I> stateRow, int inputIdx)
N.B.: Not the transition row is passed to this method, but the row for the outgoing state. The transition row can
be retrieved using Row.getSuccessor(int)
.
stateRow
- the row for the source stateinputIdx
- the index of the input symbol to considerprotected final void doRefineHypothesis(DefaultQuery<I,D> ceQuery)
doRefineHypothesis
in class AbstractLStar<A,I,D>
protected void refineHypothesisInternal(DefaultQuery<I,D> ceQuery)
public void addAlphabetSymbol(I symbol)
addAlphabetSymbol
in interface SupportsGrowingAlphabet<I>
addAlphabetSymbol
in class AbstractLStar<A,I,D>
public AutomatonLStarState<I,D,AI,S> suspend()
ResumableLearner
Does not stop a running learning process. Since most data structures that are used during learning are mutable, use this method inside of a learning loop with care.
public void resume(AutomatonLStarState<I,D,AI,S> state)
ResumableLearner
Copyright © 2018. All rights reserved.