Class AbstractTTTLearner<A,​I,​D>

    • Method Detail

      • link

        protected static <I,​D> void link​(AbstractBaseDTNode<I,​D> dtNode,
                                               TTTState<I,​D> state)
        Establish the connection between a node in the discrimination tree and a state of the hypothesis.
        Type Parameters:
        I - input symbol type
        D - output domain type
        Parameters:
        dtNode - the node in the discrimination tree
        state - the state in the hypothesis
      • 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<A,​I,​D>
      • refineHypothesis

        public boolean refineHypothesis​(DefaultQuery<I,​D> 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 of LearningAlgorithm.startLearning() should be illegal.
        Specified by:
        refineHypothesis in interface LearningAlgorithm<A,​I,​D>
        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).
      • initializeState

        protected void initializeState​(TTTState<I,​D> state)
        Initializes a state. Creates its outgoing transition objects, and adds them to the "open" list.
        Parameters:
        state - the state to initialize
      • refineHypothesisSingle

        protected boolean refineHypothesisSingle​(DefaultQuery<I,​D> ceQuery)
        Performs a single refinement of the hypothesis, i.e., without repeated counterexample evaluation. The parameter and return value have the same significance as in refineHypothesis(DefaultQuery).
        Parameters:
        ceQuery - the counterexample (query) to be used for refinement
        Returns:
        true if the hypothesis was refined, false otherwise
      • succEffect

        protected abstract D succEffect​(D effect)
      • finalizeAny

        protected boolean finalizeAny()
        Chooses a block root, and finalizes the corresponding discriminator.
        Returns:
        true if a splittable block root was found, false otherwise.
      • getDeterministicState

        protected TTTState<I,​D> getDeterministicState​(TTTState<I,​D> start,
                                                            net.automatalib.word.Word<I> word)
      • getAnyTarget

        protected TTTState<I,​D> getAnyTarget​(TTTTransition<I,​D> trans)
        Retrieves the target state of a given transition. This method works for both tree and non-tree transitions. If a non-tree transition points to a non-leaf node, it is updated accordingly before a result is obtained.
        Parameters:
        trans - the transition
        Returns:
        the target state of this transition (possibly after it having been updated)
      • allNodesFinal

        protected boolean allNodesFinal()
      • createMap

        protected <V> Map<D,​V> createMap()
      • computeHypothesisOutput

        protected abstract D computeHypothesisOutput​(TTTState<I,​D> state,
                                                     net.automatalib.word.Word<I> suffix)
      • closeTransitions

        protected void closeTransitions()
      • getDiscriminationTree

        public BaseTTTDiscriminationTree<I,​D> getDiscriminationTree()
        Returns the discrimination tree.
        Returns:
        the discrimination tree
      • addAlphabetSymbol

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

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