Class ADTLearner<I,​O>

    • 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 interface LearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>
      • refineHypothesis

        public boolean refineHypothesis​(DefaultQuery<I,​net.automatalib.word.Word<O>> ce)
        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 of LearningAlgorithm.startLearning() should be illegal.
        Specified by:
        refineHypothesis in interface LearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>
        Parameters:
        ce - 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).
      • refineHypothesisInternal

        public boolean refineHypothesisInternal​(DefaultQuery<I,​net.automatalib.word.Word<O>> ceQuery)
      • 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 interface LearningAlgorithm<net.automatalib.automaton.transducer.MealyMachine<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>
        Returns:
        the current hypothesis model.
      • closeTransition

        public void closeTransition​(ADTState<I,​O> state,
                                    I input)
        Description copied from interface: PartialTransitionAnalyzer
        Determine the successor/output of the transition in question (which is usually achieved by sifting the corresponding long-prefix through the ADT).
        Specified by:
        closeTransition in interface PartialTransitionAnalyzer<I,​O>
        Parameters:
        state - the (source) state of the transition in question
        input - the input symbol of the transition in question
      • isTransitionDefined

        public boolean isTransitionDefined​(ADTState<I,​O> state,
                                           I input)
        Description copied from interface: PartialTransitionAnalyzer
        Check whether the transition in question is defined or not.
        Specified by:
        isTransitionDefined in interface PartialTransitionAnalyzer<I,​O>
        Parameters:
        state - the (source) state of the transition in question
        input - the input symbol of the transition in question
        Returns:
        true if the transition (and thus the successor/output) is defined, false otherwise
      • addAlphabetSymbol

        public void addAlphabetSymbol​(I symbol)
        Specified by:
        addAlphabetSymbol in interface net.automatalib.alphabet.SupportsGrowingAlphabet<I>
      • resume

        public void resume​(ADTLearnerState<ADTState<I,​O>,​I,​O> state)
        Description copied from interface: Resumable
        Resume the datastructure from a previously suspended point in time.
        Specified by:
        resume in interface Resumable<I>
        Parameters:
        state - The learner state.