I - input alphabet typeO - output alphabet type@ParametersAreNonnullByDefault public class ADTLearner<I,O> extends Object implements LearningAlgorithm.MealyLearner<I,O>, PartialTransitionAnalyzer<ADTState<I,O>,I>, SupportsGrowingAlphabet<I>, ResumableLearner<ADTLearnerState<ADTState<I,O>,I,O>>
| Modifier and Type | Class and Description |
|---|---|
static class |
ADTLearner.BuilderDefaults |
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>PartialTransitionAnalyzer.HypothesisModificationExceptionHYPOTHESIS_MODIFICATION_EXCEPTION| Constructor and Description |
|---|
ADTLearner(net.automatalib.words.Alphabet<I> alphabet,
SymbolQueryOracle<I,O> oracle,
LeafSplitter leafSplitter,
ADTExtender adtExtender,
SubtreeReplacer subtreeReplacer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAlphabetSymbol(I symbol) |
void |
closeTransition(ADTState<I,O> state,
I input)
Determine the successor/output of the transition in question (which is usually achieved by sifting the
corresponding long-prefix through the ADT).
|
net.automatalib.automata.transout.MealyMachine<?,I,?,O> |
getHypothesisModel()
Returns the current hypothesis model.
|
boolean |
isTransitionDefined(ADTState<I,O> state,
I input)
Check whether the transition in question is defined or not.
|
boolean |
refineHypothesis(DefaultQuery<I,net.automatalib.words.Word<O>> ce)
Triggers a refinement of the model by providing a counterexample.
|
boolean |
refineHypothesisInternal(DefaultQuery<I,net.automatalib.words.Word<O>> ceQuery) |
void |
resume(ADTLearnerState<ADTState<I,O>,I,O> state)
Does not get the learner to continue learning.
|
void |
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.
|
ADTLearnerState<ADTState<I,O>,I,O> |
suspend()
Expose the serializable learner state object.
|
public ADTLearner(net.automatalib.words.Alphabet<I> alphabet, SymbolQueryOracle<I,O> oracle, LeafSplitter leafSplitter, ADTExtender adtExtender, SubtreeReplacer subtreeReplacer)
public void startLearning()
LearningAlgorithmstartLearning in interface LearningAlgorithm<net.automatalib.automata.transout.MealyMachine<?,I,?,O>,I,net.automatalib.words.Word<O>>public boolean refineHypothesis(DefaultQuery<I,net.automatalib.words.Word<O>> ce)
LearningAlgorithmLearningAlgorithm.startLearning() should be illegal.refineHypothesis in interface LearningAlgorithm<net.automatalib.automata.transout.MealyMachine<?,I,?,O>,I,net.automatalib.words.Word<O>>ce - the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).public boolean refineHypothesisInternal(DefaultQuery<I,net.automatalib.words.Word<O>> ceQuery)
@Nonnull public net.automatalib.automata.transout.MealyMachine<?,I,?,O> 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<net.automatalib.automata.transout.MealyMachine<?,I,?,O>,I,net.automatalib.words.Word<O>>public void closeTransition(ADTState<I,O> state, I input) throws PartialTransitionAnalyzer.HypothesisModificationException
PartialTransitionAnalyzercloseTransition in interface PartialTransitionAnalyzer<ADTState<I,O>,I>state - the (source) state of the transition in questioninput - the input symbol of the transition in questionPartialTransitionAnalyzer.HypothesisModificationException - if closing the transition (sifting in the ADT) discovered a new hypothesis state and thus potentially
invalidates previously observed behaviorpublic boolean isTransitionDefined(ADTState<I,O> state, I input)
PartialTransitionAnalyzerisTransitionDefined in interface PartialTransitionAnalyzer<ADTState<I,O>,I>state - the (source) state of the transition in questioninput - the input symbol of the transition in questiontrue if the transition (and thus the successor/output) is defined, false otherwisepublic void addAlphabetSymbol(I symbol)
addAlphabetSymbol in interface SupportsGrowingAlphabet<I>public ADTLearnerState<ADTState<I,O>,I,O> suspend()
ResumableLearnerDoes 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<ADTLearnerState<ADTState<I,O>,I,O>>public void resume(ADTLearnerState<ADTState<I,O>,I,O> state)
ResumableLearnerresume in interface ResumableLearner<ADTLearnerState<ADTState<I,O>,I,O>>state - The learner state.Copyright © 2018. All rights reserved.