I
- input symbol typepublic abstract class AbstractTTTLearner<A,I,D> extends Object implements LearningAlgorithm<A,I,D>, SupportsGrowingAlphabet<I>, ResumableLearner<TTTLearnerState<I,D>>
DFA
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractTTTLearner.BuilderDefaults |
static class |
AbstractTTTLearner.Splitter<I,D>
Data structure for representing a splitter.
|
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>
Modifier and Type | Field and Description |
---|---|
protected net.automatalib.words.Alphabet<I> |
alphabet |
protected AcexAnalyzer |
analyzer |
protected BlockList<I,D> |
blockList
The blocks during a split operation.
|
protected BaseTTTDiscriminationTree<I,D> |
dtree |
protected AbstractTTTHypothesis<I,D,?> |
hypothesis |
protected IncomingList<I,D> |
openTransitions
Open transitions, i.e., transitions that possibly point to a non-leaf node in the discrimination tree.
|
protected MembershipOracle<I,D> |
oracle |
Modifier | Constructor and Description |
---|---|
protected |
AbstractTTTLearner(net.automatalib.words.Alphabet<I> alphabet,
MembershipOracle<I,D> oracle,
AbstractTTTHypothesis<I,D,?> hypothesis,
BaseTTTDiscriminationTree<I,D> dtree,
AcexAnalyzer analyzer) |
Modifier and Type | Method and Description |
---|---|
void |
addAlphabetSymbol(I symbol) |
void |
addEventListener(TTTEventListener<I,D> listener) |
protected boolean |
allNodesFinal() |
protected void |
closeTransitions() |
protected abstract D |
computeHypothesisOutput(TTTState<I,D> state,
net.automatalib.words.Word<I> suffix) |
protected <V> Map<D,V> |
createMap() |
protected abstract AbstractBaseDTNode<I,D> |
createNewNode(AbstractBaseDTNode<I,D> parent,
D parentOutput) |
protected TTTTransition<I,D> |
createTransition(TTTState<I,D> state,
I sym) |
protected void |
declareFinal(AbstractBaseDTNode<I,D> blockRoot) |
protected OutInconsPrefixTransformAcex<I,D> |
deriveAcex(OutputInconsistency<I,D> outIncons) |
protected boolean |
finalizeAny()
Chooses a block root, and finalizes the corresponding discriminator.
|
protected OutputInconsistency<I,D> |
findOutputInconsistency() |
protected TTTState<I,D> |
getAnySuccessor(TTTState<I,D> state,
I sym) |
protected TTTState<I,D> |
getAnySuccessor(TTTState<I,D> state,
Iterable<? extends I> suffix) |
protected TTTState<I,D> |
getAnyTarget(TTTTransition<I,D> trans)
Retrieves the target state of a given transition.
|
protected TTTState<I,D> |
getDeterministicState(TTTState<I,D> start,
net.automatalib.words.Word<I> word) |
BaseTTTDiscriminationTree<I,D> |
getDiscriminationTree()
Returns the discrimination tree.
|
AbstractTTTHypothesis<I,D,?> |
getHypothesisDS() |
protected Set<TTTState<I,D>> |
getNondetSuccessors(Collection<? extends TTTState<I,D>> states,
I sym) |
protected TTTTransition<I,D> |
getStateTransition(TTTState<I,D> state,
I sym) |
protected void |
initializeState(TTTState<I,D> state)
Initializes a state.
|
protected static <I,D> void |
link(AbstractBaseDTNode<I,D> dtNode,
TTTState<I,D> state)
Establish the connection between a node in the discrimination tree and a state of the hypothesis.
|
protected TTTState<I,D> |
makeTree(TTTTransition<I,D> trans) |
protected abstract D |
predictSuccOutcome(TTTTransition<I,D> trans,
AbstractBaseDTNode<I,D> succSeparator) |
protected D |
query(AccessSequenceProvider<I> accessSeqProvider,
net.automatalib.words.Word<I> suffix)
Performs a membership query, using an access sequence as its prefix.
|
protected D |
query(net.automatalib.words.Word<I> prefix,
net.automatalib.words.Word<I> suffix)
Performs a membership query.
|
boolean |
refineHypothesis(DefaultQuery<I,D> ceQuery)
Triggers a refinement of the model by providing a counterexample.
|
protected boolean |
refineHypothesisSingle(DefaultQuery<I,D> ceQuery)
Performs a single refinement of the hypothesis, i.e., without repeated counterexample evaluation.
|
void |
removeEventListener(TTTEventListener<I,D> listener) |
void |
resume(TTTLearnerState<I,D> state)
Does not get the learner to continue learning.
|
protected AbstractDTNode.SplitResult |
split(AbstractBaseDTNode<I,D> node,
net.automatalib.words.Word<I> discriminator,
D oldOutput,
D newOutput) |
void |
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.
|
protected abstract D |
succEffect(D effect) |
TTTLearnerState<I,D> |
suspend()
Expose the serializable learner state object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHypothesisModel
protected net.automatalib.words.Alphabet<I> alphabet
protected final MembershipOracle<I,D> oracle
protected final AcexAnalyzer analyzer
protected final IncomingList<I,D> openTransitions
protected final BlockList<I,D> blockList
protected AbstractTTTHypothesis<I,D,?> hypothesis
protected BaseTTTDiscriminationTree<I,D> dtree
protected AbstractTTTLearner(net.automatalib.words.Alphabet<I> alphabet, MembershipOracle<I,D> oracle, AbstractTTTHypothesis<I,D,?> hypothesis, BaseTTTDiscriminationTree<I,D> dtree, AcexAnalyzer analyzer)
protected static <I,D> void link(AbstractBaseDTNode<I,D> dtNode, TTTState<I,D> state)
dtNode
- the node in the discrimination treestate
- the state in the hypothesispublic void startLearning()
LearningAlgorithm
startLearning
in interface LearningAlgorithm<A,I,D>
public boolean refineHypothesis(DefaultQuery<I,D> ceQuery)
LearningAlgorithm
LearningAlgorithm.startLearning()
should be illegal.refineHypothesis
in interface LearningAlgorithm<A,I,D>
ceQuery
- the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).protected void initializeState(TTTState<I,D> state)
state
- the state to initializeprotected boolean refineHypothesisSingle(DefaultQuery<I,D> ceQuery)
refineHypothesis(DefaultQuery)
.ceQuery
- the counterexample (query) to be used for refinementtrue
if the hypothesis was refined, false
otherwiseprotected OutInconsPrefixTransformAcex<I,D> deriveAcex(OutputInconsistency<I,D> outIncons)
protected boolean finalizeAny()
true
if a splittable block root was found, false
otherwise.protected TTTState<I,D> getDeterministicState(TTTState<I,D> start, net.automatalib.words.Word<I> word)
protected Set<TTTState<I,D>> getNondetSuccessors(Collection<? extends TTTState<I,D>> states, I sym)
protected TTTState<I,D> getAnySuccessor(TTTState<I,D> state, Iterable<? extends I> suffix)
protected TTTState<I,D> getAnyTarget(TTTTransition<I,D> trans)
trans
- the transitionprotected OutputInconsistency<I,D> findOutputInconsistency()
protected boolean allNodesFinal()
protected void declareFinal(AbstractBaseDTNode<I,D> blockRoot)
protected abstract D predictSuccOutcome(TTTTransition<I,D> trans, AbstractBaseDTNode<I,D> succSeparator)
protected abstract D computeHypothesisOutput(TTTState<I,D> state, net.automatalib.words.Word<I> suffix)
public AbstractTTTHypothesis<I,D,?> getHypothesisDS()
protected void closeTransitions()
protected D query(net.automatalib.words.Word<I> prefix, net.automatalib.words.Word<I> suffix)
prefix
- the prefix part of the querysuffix
- the suffix part of the queryprotected D query(AccessSequenceProvider<I> accessSeqProvider, net.automatalib.words.Word<I> suffix)
accessSeqProvider
- the object from which to obtain the access sequencesuffix
- the suffix part of the querypublic BaseTTTDiscriminationTree<I,D> getDiscriminationTree()
protected final AbstractDTNode.SplitResult split(AbstractBaseDTNode<I,D> node, net.automatalib.words.Word<I> discriminator, D oldOutput, D newOutput)
public void addEventListener(TTTEventListener<I,D> listener)
public void removeEventListener(TTTEventListener<I,D> listener)
public void addAlphabetSymbol(I symbol)
addAlphabetSymbol
in interface SupportsGrowingAlphabet<I>
protected abstract AbstractBaseDTNode<I,D> createNewNode(AbstractBaseDTNode<I,D> parent, D parentOutput)
public TTTLearnerState<I,D> 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.
suspend
in interface ResumableLearner<TTTLearnerState<I,D>>
public void resume(TTTLearnerState<I,D> state)
ResumableLearner
resume
in interface ResumableLearner<TTTLearnerState<I,D>>
state
- The learner state.Copyright © 2018. All rights reserved.