Class AbstractTTTLearner<A,​I,​D>

    • Field Detail

      • alphabet

        protected final Alphabet<I> alphabet
      • openTransitions

        protected final IncomingList<I,​D> openTransitions
        Open transitions, i.e., transitions that possibly point to a non-leaf node in the discrimination tree.
      • blockList

        protected final BlockList<I,​D> blockList
        The blocks during a split operation. A block is a maximal subtree of the discrimination tree containing temporary discriminators at its root.
    • 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.
        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.
      • 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,
                                                     Word<I> suffix)
      • closeTransitions

        protected void closeTransitions()
      • query

        protected D query​(Word<I> prefix,
                          Word<I> suffix)
        Performs a membership query.
        Parameters:
        prefix - the prefix part of the query
        suffix - the suffix part of the query
        Returns:
        the output
      • query

        protected D query​(AccessSequenceProvider<I> accessSeqProvider,
                          Word<I> suffix)
        Performs a membership query, using an access sequence as its prefix.
        Parameters:
        accessSeqProvider - the object from which to obtain the access sequence
        suffix - the suffix part of the query
        Returns:
        the output
      • getDiscriminationTree

        public BaseTTTDiscriminationTree<I,​D> getDiscriminationTree()
        Returns the discrimination tree.
        Returns:
        the discrimination tree
      • 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.