I
- input symbol class.public class BaselineLStar<I> extends Object implements OTLearner<DFA<?,I>,I,Boolean>, GlobalSuffixLearner.GlobalSuffixLearnerDFA<I>
OTLearner.OTLearnerDFA<I>, OTLearner.OTLearnerMealy<I,O>
GlobalSuffixLearner.GlobalSuffixLearnerDFA<I>, GlobalSuffixLearner.GlobalSuffixLearnerMealy<I,O>
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>
Constructor and Description |
---|
BaselineLStar(Alphabet<I> alphabet,
MembershipOracle<I,Boolean> oracle)
Initializes a newly created baseline L* implementation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addGlobalSuffixes(Collection<? extends Word<I>> newGlobalSuffixes)
Add the provided suffixes to the collection of global suffixes.
|
Collection<? extends Word<I>> |
getGlobalSuffixes()
Retrieves the global suffixes of this learner.
|
DFA<?,I> |
getHypothesisModel()
Returns the current hypothesis model.
|
ObservationTable<I,Boolean> |
getObservationTable() |
String |
getStringRepresentationOfObservationTable() |
boolean |
refineHypothesis(DefaultQuery<I,Boolean> 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.
|
public BaselineLStar(@Nonnull Alphabet<I> alphabet, @Nonnull MembershipOracle<I,Boolean> oracle)
startLearning()
may be called once.alphabet
- The Alphabet
to learn.oracle
- The MembershipOracle
which is used for membership queries.public void startLearning()
LearningAlgorithm
startLearning
in interface LearningAlgorithm<DFA<?,I>,I,Boolean>
public boolean refineHypothesis(@Nonnull DefaultQuery<I,Boolean> ceQuery)
LearningAlgorithm
LearningAlgorithm.startLearning()
should be illegal.refineHypothesis
in interface LearningAlgorithm<DFA<?,I>,I,Boolean>
ceQuery
- the query which exposes diverging behavior, as posed to the real SUL
(i.e. with the SULs output).public DFA<?,I> 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<DFA<?,I>,I,Boolean>
@Nonnull public String getStringRepresentationOfObservationTable()
@Nonnull 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(@Nonnull 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
.@Nonnull public ObservationTable<I,Boolean> getObservationTable()
getObservationTable
in interface ObservationTableFeature<I,Boolean>
Copyright © 2015. All rights reserved.