A
- automaton typeI
- input symbol typeD
- output domain typepublic abstract class AbstractLStar<A,I,D> extends Object implements OTLearner<A,I,D>, GlobalSuffixLearner<A,I,D>, SupportsGrowingAlphabet<I>
This class implements basic management features (table, alphabet, oracle) and the main loop of alternating completeness and consistency checks. It does not take care of choosing how to initialize the table and hypothesis construction.
OTLearner.OTLearnerDFA<I>, OTLearner.OTLearnerMealy<I,O>
GlobalSuffixLearner.GlobalSuffixLearnerDFA<I>, GlobalSuffixLearner.GlobalSuffixLearnerMealy<I,O>
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>
Modifier and Type | Field and Description |
---|---|
protected net.automatalib.words.Alphabet<I> |
alphabet |
protected MembershipOracle<I,D> |
oracle |
protected GenericObservationTable<I,D> |
table |
Modifier | Constructor and Description |
---|---|
protected |
AbstractLStar(net.automatalib.words.Alphabet<I> alphabet,
MembershipOracle<I,D> oracle)
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 net.automatalib.words.Word<I> |
analyzeInconsistency(Inconsistency<I> incons)
Analyzes an inconsistency.
|
protected boolean |
completeConsistentTable(List<List<Row<I>>> unclosed,
boolean checkConsistency)
Iteratedly checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof.
|
protected void |
doRefineHypothesis(DefaultQuery<I,D> ceQuery) |
Collection<net.automatalib.words.Word<I>> |
getGlobalSuffixes()
Retrieves the global suffixes of this learner.
|
ObservationTable<I,D> |
getObservationTable() |
protected abstract net.automatalib.automata.concepts.SuffixOutput<I,D> |
hypothesisOutput() |
protected List<List<Row<I>>> |
incorporateCounterExample(DefaultQuery<I,D> ce)
Incorporates the information provided by a counterexample into the observation data structure.
|
protected List<net.automatalib.words.Word<I>> |
initialPrefixes() |
protected abstract List<net.automatalib.words.Word<I>> |
initialSuffixes()
Returns the list of initial suffixes which are used to initialize the table.
|
boolean |
refineHypothesis(DefaultQuery<I,D> ceQuery)
Triggers a refinement of the model by providing a counterexample.
|
protected List<Row<I>> |
selectClosingRows(List<List<Row<I>>> unclosed)
This method selects a set of rows to use for closing the table.
|
void |
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model 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 GenericObservationTable<I,D> table
protected AbstractLStar(net.automatalib.words.Alphabet<I> alphabet, MembershipOracle<I,D> oracle)
alphabet
- the learning alphabet.oracle
- the membership oracle.public void startLearning()
LearningAlgorithm
startLearning
in interface LearningAlgorithm<A,I,D>
public final 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 abstract net.automatalib.automata.concepts.SuffixOutput<I,D> hypothesisOutput()
protected void doRefineHypothesis(DefaultQuery<I,D> ceQuery)
protected List<List<Row<I>>> incorporateCounterExample(DefaultQuery<I,D> ce)
ce
- the query which contradicts the hypothesisprotected abstract List<net.automatalib.words.Word<I>> initialSuffixes()
protected boolean completeConsistentTable(List<List<Row<I>>> unclosed, boolean checkConsistency)
unclosed
- the unclosed rows (equivalence classes) to start with.protected List<Row<I>> selectClosingRows(List<List<Row<I>>> unclosed)
unclosed
- a list of equivalence classes of unclosed rows.protected net.automatalib.words.Word<I> analyzeInconsistency(Inconsistency<I> incons)
incons
- the inconsistency descriptionpublic 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
.public ObservationTable<I,D> getObservationTable()
getObservationTable
in interface ObservationTableFeature<I,D>
public void addAlphabetSymbol(I symbol)
addAlphabetSymbol
in interface SupportsGrowingAlphabet<I>
Copyright © 2018. All rights reserved.