Class AbstractLStar<A,​I,​D>

  • Type Parameters:
    A - automaton type
    I - input symbol type
    D - output domain type
    All Implemented Interfaces:
    GlobalSuffixLearner<A,​I,​D>, LearningAlgorithm<A,​I,​D>, ObservationTableFeature<I,​D>, OTLearner<A,​I,​D>, net.automatalib.alphabet.SupportsGrowingAlphabet<I>
    Direct Known Subclasses:
    AbstractAutomatonLStar

    public abstract class AbstractLStar<A,​I,​D>
    extends Object
    implements OTLearner<A,​I,​D>, GlobalSuffixLearner<A,​I,​D>, net.automatalib.alphabet.SupportsGrowingAlphabet<I>
    An abstract base class for L*-style algorithms.

    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.

    • Constructor Detail

      • AbstractLStar

        protected AbstractLStar​(net.automatalib.alphabet.Alphabet<I> alphabet,
                                MembershipOracle<I,​D> oracle)
        Constructor.
        Parameters:
        alphabet - the learning alphabet.
        oracle - the membership oracle.
    • Method Detail

      • hypothesisOutput

        protected abstract net.automatalib.automaton.concept.SuffixOutput<I,​D> hypothesisOutput()
      • doRefineHypothesis

        protected void doRefineHypothesis​(DefaultQuery<I,​D> ceQuery)
      • incorporateCounterExample

        protected List<List<Row<I>>> incorporateCounterExample​(DefaultQuery<I,​D> ce)
        Incorporates the information provided by a counterexample into the observation data structure.
        Parameters:
        ce - the query which contradicts the hypothesis
        Returns:
        the rows (equivalence classes) which became unclosed by adding the information.
      • initialPrefixes

        protected List<net.automatalib.word.Word<I>> initialPrefixes()
      • initialSuffixes

        protected abstract List<net.automatalib.word.Word<I>> initialSuffixes()
        Returns the list of initial suffixes which are used to initialize the table.
        Returns:
        the list of initial suffixes.
      • completeConsistentTable

        protected boolean completeConsistentTable​(List<List<Row<I>>> unclosed,
                                                  boolean checkConsistency)
        Iteratively checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof. This process is repeated until the observation table is both closed and consistent.
        Parameters:
        unclosed - the unclosed rows (equivalence classes) to start with.
        checkConsistency - a flag indicating whether consistency should be checked as well. If false, only closedness is ensured.
        Returns:
        true if unclosed rows have been closed, false otherwise
      • selectClosingRows

        protected List<Row<I>> selectClosingRows​(List<List<Row<I>>> unclosed)
        This method selects a set of rows to use for closing the table. It receives as input a list of row lists, such that each (inner) list contains long prefix rows with (currently) identical contents, which have no matching short prefix row. The outer list is the list of all those equivalence classes.
        Parameters:
        unclosed - a list of equivalence classes of unclosed rows.
        Returns:
        a list containing a representative row from each class to move to the short prefix part.
      • analyzeInconsistency

        protected net.automatalib.word.Word<I> analyzeInconsistency​(Inconsistency<I> incons)
        Analyzes an inconsistency. This analysis consists in determining the column in which the two successor rows differ.
        Parameters:
        incons - the inconsistency description
        Returns:
        the suffix to add in order to fix the inconsistency
      • addAlphabetSymbol

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