public class MealyDHC<I,O> extends Object implements LearningAlgorithm.MealyLearner<I,O>, AccessSequenceTransformer<I>, GlobalSuffixLearner.GlobalSuffixLearnerMealy<I,O>, SupportsGrowingAlphabet<I>, ResumableLearner<de.learnlib.algorithms.dhc.mealy.MealyDHCState<I,O>>
Modifier and Type | Class and Description |
---|---|
static class |
MealyDHC.BuilderDefaults |
GlobalSuffixLearner.GlobalSuffixLearnerDFA<I>, GlobalSuffixLearner.GlobalSuffixLearnerMealy<I,O>
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>
Constructor and Description |
---|
MealyDHC(net.automatalib.words.Alphabet<I> alphabet,
MembershipOracle<I,net.automatalib.words.Word<O>> oracle)
Constructor, provided for backwards compatibility reasons.
|
MealyDHC(net.automatalib.words.Alphabet<I> alphabet,
MembershipOracle<I,net.automatalib.words.Word<O>> oracle,
GlobalSuffixFinder<? super I,? super net.automatalib.words.Word<O>> suffixFinder,
Collection<? extends net.automatalib.words.Word<I>> initialSplitters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlphabetSymbol(I symbol) |
boolean |
addGlobalSuffixes(Collection<? extends net.automatalib.words.Word<I>> newGlobalSuffixes)
Add the provided suffixes to the collection of global suffixes.
|
protected boolean |
addSuffixesUnchecked(Collection<? extends net.automatalib.words.Word<I>> newSuffixes) |
Collection<net.automatalib.words.Word<I>> |
getGlobalSuffixes()
Retrieves the global suffixes of this learner.
|
net.automatalib.automata.transout.impl.compact.CompactMealy<I,O> |
getHypothesisModel()
Returns the current hypothesis model.
|
boolean |
isAccessSequence(net.automatalib.words.Word<I> word) |
boolean |
refineHypothesis(DefaultQuery<I,net.automatalib.words.Word<O>> ceQuery)
Triggers a refinement of the model by providing a counterexample.
|
void |
resume(de.learnlib.algorithms.dhc.mealy.MealyDHCState<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.
|
de.learnlib.algorithms.dhc.mealy.MealyDHCState<I,O> |
suspend()
Expose the serializable learner state object.
|
net.automatalib.words.Word<I> |
transformAccessSequence(net.automatalib.words.Word<I> word) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
longestASPrefix
public MealyDHC(net.automatalib.words.Alphabet<I> alphabet, MembershipOracle<I,net.automatalib.words.Word<O>> oracle)
alphabet
- the learning alphabetoracle
- the learning membership oraclepublic MealyDHC(net.automatalib.words.Alphabet<I> alphabet, MembershipOracle<I,net.automatalib.words.Word<O>> oracle, GlobalSuffixFinder<? super I,? super net.automatalib.words.Word<O>> suffixFinder, Collection<? extends net.automatalib.words.Word<I>> initialSplitters)
alphabet
- the learning alphabetoracle
- the learning membership oraclesuffixFinder
- the suffix finder
to use for analyzing counterexamplesinitialSplitters
- the initial set of splitters, null
or an empty collection will result in the set of splitters
being initialized as the set of alphabet symbols (interpreted as Word
s)public Collection<net.automatalib.words.Word<I>> getGlobalSuffixes()
GlobalSuffixFeature
LearningAlgorithm.startLearning()
should return an empty collection.
The return value should not be modified; attempting to do so may result in an UnsupportedOperationException
. It is the implementation's responsibility to ensure attempted modifications do
not corrupt the learner's internal state.
getGlobalSuffixes
in interface GlobalSuffixFeature<I>
public boolean addGlobalSuffixes(Collection<? extends net.automatalib.words.Word<I>> newGlobalSuffixes)
GlobalSuffixFeature
LearningAlgorithm.startLearning()
has been
called.
The implementation may choose to (but is not required to) omit suffixes which are already present (that is, manage the global suffixes as a proper set).
addGlobalSuffixes
in interface GlobalSuffixFeature<I>
newGlobalSuffixes
- the global suffixes to addtrue
if a refinement was triggered by adding the global suffixes, false otherwise
.protected boolean addSuffixesUnchecked(Collection<? extends net.automatalib.words.Word<I>> newSuffixes)
public void startLearning()
LearningAlgorithm
startLearning
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>> ceQuery)
LearningAlgorithm
LearningAlgorithm.startLearning()
should be illegal.refineHypothesis
in interface LearningAlgorithm<net.automatalib.automata.transout.MealyMachine<?,I,?,O>,I,net.automatalib.words.Word<O>>
ceQuery
- the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).public net.automatalib.automata.transout.impl.compact.CompactMealy<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 addAlphabetSymbol(I symbol)
addAlphabetSymbol
in interface SupportsGrowingAlphabet<I>
public de.learnlib.algorithms.dhc.mealy.MealyDHCState<I,O> 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<de.learnlib.algorithms.dhc.mealy.MealyDHCState<I,O>>
public void resume(de.learnlib.algorithms.dhc.mealy.MealyDHCState<I,O> state)
ResumableLearner
resume
in interface ResumableLearner<de.learnlib.algorithms.dhc.mealy.MealyDHCState<I,O>>
state
- The learner state.public net.automatalib.words.Word<I> transformAccessSequence(net.automatalib.words.Word<I> word)
transformAccessSequence
in interface AccessSequenceTransformer<I>
public boolean isAccessSequence(net.automatalib.words.Word<I> word)
isAccessSequence
in interface AccessSequenceTransformer<I>
Copyright © 2018. All rights reserved.