Class AbstractAAARLearner<L extends LearningAlgorithm<CM,​CI,​D> & SupportsGrowingAlphabet<CI>,​AM,​CM,​AI,​CI,​D>

  • Type Parameters:
    L - learner type
    AM - abstract model type
    CM - concrete model type
    AI - abstract input symbol type
    CI - concrete input symbol type
    D - output domain type
    All Implemented Interfaces:
    LearningAlgorithm<AM,​CI,​D>
    Direct Known Subclasses:
    AbstractExplicitAAARLearner, AbstractGenericAAARLearner

    public abstract class AbstractAAARLearner<L extends LearningAlgorithm<CM,​CI,​D> & SupportsGrowingAlphabet<CI>,​AM,​CM,​AI,​CI,​D>
    extends Object
    implements LearningAlgorithm<AM,​CI,​D>
    Base implementation of the learner presented in "Automata Learning with Automated Alphabet Abstraction Refinement" by Howar et al.

    This implementation is a LearningAlgorithm for abstract models but operates on concrete systems with concrete input symbols. Therefore, the learner receives concrete counterexamples which are transformed into abstract ones (using the simultaneously inferred abstraction tree) whose symbols are then mapped to their concrete representatives again, prior to actual refinement. Since this concept is agnostic to the actual learning process, this learner can be parameterized with an arbitrary (concrete) learning algorithm for the acutal inference.

    There exist several accessor for different views on the current hypothesis, e.g., the actual hypothesis of the internal learner, an abstracted hypothesis, and a translating hypothesis which automatically performs the previously mentioned translation steps for offering a model that is able to handle previously unobserved (concrete) input symbols.

    • Method Detail

      • refineHypothesis

        public boolean refineHypothesis​(DefaultQuery<CI,​D> query)
        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<L extends LearningAlgorithm<CM,​CI,​D> & SupportsGrowingAlphabet<CI>,​AM,​CM>
        Parameters:
        query - 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).
      • getAbstractAlphabet

        public Alphabet<AI> getAbstractAlphabet()
        Returns the (abstract) alphabet of the current (abstract) hypothesis model (cf. LearningAlgorithm.getHypothesisModel()).
        Returns:
        the (abstract) alphabet of the current (abstract) hypothesis model
      • getLearnerAlphabet

        public abstract Alphabet<CI> getLearnerAlphabet()
        Returns the (concrete) alphabet of the current (concrete) internal hypothesis model (cf. getLearnerHypothesisModel()).
        Returns:
        the (concrete) alphabet of the current (concrete) internal hypothesis model
      • getLearnerHypothesisModel

        public CM getLearnerHypothesisModel()
        Returns the (concrete) hypothesis model form the provided internal learner.
        Returns:
        the (concrete) hypothesis model form the provided internal learner
      • getTranslatingHypothesisModel

        public abstract CM getTranslatingHypothesisModel()
        Returns a model of the current internal hypothesis model (cf. getLearnerHypothesisModel()) that automatically transforms (concrete) input symbols to abstract ones and uses their representatives to actually perform transitions. This allows the returned model to handle (concrete) input symbols that have not yet been added to the hypothesis by previous abstraction refinements. Note that this model requires the MembershipOracle passed to the constructor of this learner to still function in order to determine the abstract input symbols.
        Returns:
        the (concrete) hypothesis model that automatically transforms input symbols
      • getLearner

        public L getLearner()
        Returns the created instance of the provided internal learner.
        Returns:
        the created instance of the provided internal learner
      • getInitialAbstracts

        protected abstract Collection<AI> getInitialAbstracts()
      • getInitialRepresentatives

        protected abstract Collection<CI> getInitialRepresentatives()