public class MealyDHC<I,O> extends Object implements LearningAlgorithm.MealyLearner<I,O>, AccessSequenceTransformer<I>, GlobalSuffixLearner.GlobalSuffixLearnerMealy<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(Alphabet<I> alphabet,
MembershipOracle<I,Word<O>> oracle)
Constructor, provided for backwards compatibility reasons.
|
MealyDHC(Alphabet<I> alphabet,
MembershipOracle<I,Word<O>> oracle,
GlobalSuffixFinder<? super I,? super Word<O>> suffixFinder,
Collection<? extends Word<I>> initialSplitters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addGlobalSuffixes(Collection<? extends Word<I>> newGlobalSuffixes)
Add the provided suffixes to the collection of global suffixes.
|
protected boolean |
addSuffixesUnchecked(Collection<? extends Word<I>> newSuffixes) |
Collection<? extends Word<I>> |
getGlobalSuffixes()
Retrieves the global suffixes of this learner.
|
CompactMealy<I,O> |
getHypothesisModel()
Returns the current hypothesis model.
|
boolean |
isAccessSequence(Word<I> word) |
boolean |
refineHypothesis(DefaultQuery<I,Word<O>> ceQuery)
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.
|
Word<I> |
transformAccessSequence(Word<I> word) |
public MealyDHC(Alphabet<I> alphabet, MembershipOracle<I,Word<O>> oracle)
alphabet
- the learning alphabetoracle
- the learning membership oraclepublic MealyDHC(Alphabet<I> alphabet, MembershipOracle<I,Word<O>> oracle, GlobalSuffixFinder<? super I,? super Word<O>> suffixFinder, Collection<? extends 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 void startLearning()
LearningAlgorithm
startLearning
in interface LearningAlgorithm<MealyMachine<?,I,?,O>,I,Word<O>>
public boolean refineHypothesis(DefaultQuery<I,Word<O>> ceQuery)
LearningAlgorithm
LearningAlgorithm.startLearning()
should be illegal.refineHypothesis
in interface LearningAlgorithm<MealyMachine<?,I,?,O>,I,Word<O>>
ceQuery
- the query which exposes diverging behavior, as posed to the real SUL
(i.e. with the SULs output).public 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<MealyMachine<?,I,?,O>,I,Word<O>>
public Word<I> transformAccessSequence(Word<I> word)
transformAccessSequence
in interface AccessSequenceTransformer<I>
public boolean isAccessSequence(Word<I> word)
isAccessSequence
in interface AccessSequenceTransformer<I>
public Collection<? extends 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 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 Word<I>> newSuffixes)
Copyright © 2015. All rights reserved.