Module de.learnlib.algorithm.kv
Package de.learnlib.algorithm.kv.mealy
Class KearnsVaziraniMealy<I,O>
- java.lang.Object
-
- de.learnlib.algorithm.kv.mealy.KearnsVaziraniMealy<I,O>
-
- Type Parameters:
I
- input symbol typeO
- output symbol type
- All Implemented Interfaces:
LearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>
,LearningAlgorithm.MealyLearner<I,O>
,Resumable<KearnsVaziraniMealyState<I,O>>
,net.automatalib.alphabet.SupportsGrowingAlphabet<I>
- Direct Known Subclasses:
KearnsVaziraniAdapterMealy
public class KearnsVaziraniMealy<I,O> extends Object implements LearningAlgorithm.MealyLearner<I,O>, net.automatalib.alphabet.SupportsGrowingAlphabet<I>, Resumable<KearnsVaziraniMealyState<I,O>>
An adaption of the Kearns/Vazirani algorithm for Mealy machines.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
KearnsVaziraniMealy.KVAbstractCounterexample
-
Nested classes/interfaces inherited from interface de.learnlib.algorithm.LearningAlgorithm
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>, LearningAlgorithm.MooreLearner<I,O>, LearningAlgorithm.NFALearner<I>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<StateInfo<I,net.automatalib.word.Word<O>>>
stateInfos
-
Constructor Summary
Constructors Constructor Description KearnsVaziraniMealy(net.automatalib.alphabet.Alphabet<I> alphabet, MembershipOracle<I,net.automatalib.word.Word<O>> oracle, boolean repeatedCounterexampleEvaluation, AcexAnalyzer counterexampleAnalyzer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlphabetSymbol(I symbol)
MultiDTree<I,net.automatalib.word.Word<O>,StateInfo<I,net.automatalib.word.Word<O>>>
getDiscriminationTree()
net.automatalib.automaton.transducer.MealyMachine<?,I,?,O>
getHypothesisModel()
Returns the current hypothesis model.boolean
refineHypothesis(DefaultQuery<I,net.automatalib.word.Word<O>> ceQuery)
Triggers a refinement of the model by providing a counterexample.void
resume(KearnsVaziraniMealyState<I,O> state)
Resume the datastructure from a previously suspended point in time.void
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.KearnsVaziraniMealyState<I,O>
suspend()
Expose the state object.
-
-
-
Constructor Detail
-
KearnsVaziraniMealy
public KearnsVaziraniMealy(net.automatalib.alphabet.Alphabet<I> alphabet, MembershipOracle<I,net.automatalib.word.Word<O>> oracle, boolean repeatedCounterexampleEvaluation, AcexAnalyzer counterexampleAnalyzer)
-
-
Method Detail
-
startLearning
public void startLearning()
Description copied from interface:LearningAlgorithm
Starts the model inference process, creating an initial hypothesis in the provided model object. Please note that it should be illegal to invoke this method twice.- Specified by:
startLearning
in interfaceLearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>
-
refineHypothesis
public boolean refineHypothesis(DefaultQuery<I,net.automatalib.word.Word<O>> ceQuery)
Description copied from interface:LearningAlgorithm
Triggers a refinement of the model by providing a counterexample. A counterexample is a query which exposes different behavior of the real SUL compared to the hypothesis. Please note that invoking this method before an initial invocation ofLearningAlgorithm.startLearning()
should be illegal.- Specified by:
refineHypothesis
in interfaceLearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>
- Parameters:
ceQuery
- the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).- Returns:
true
if the counterexample triggered a refinement of the hypothesis,false
otherwise (i.e., it was no counterexample).
-
getHypothesisModel
public net.automatalib.automaton.transducer.MealyMachine<?,I,?,O> getHypothesisModel()
Description copied from interface:LearningAlgorithm
Returns the current hypothesis model.N.B.: By the contract of this interface, the model returned by this method should not be modified by external code (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()
.- Specified by:
getHypothesisModel
in interfaceLearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>
- Returns:
- the current hypothesis model.
-
getDiscriminationTree
public MultiDTree<I,net.automatalib.word.Word<O>,StateInfo<I,net.automatalib.word.Word<O>>> getDiscriminationTree()
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
- Specified by:
addAlphabetSymbol
in interfacenet.automatalib.alphabet.SupportsGrowingAlphabet<I>
-
suspend
public KearnsVaziraniMealyState<I,O> suspend()
Description copied from interface:Resumable
Expose the state object.
-
-