Class SULCache<I,​O>

  • Type Parameters:
    I - input symbol type
    O - output symbol type
    All Implemented Interfaces:
    LearningCache<net.automatalib.automaton.transducer.MealyMachine<?,​I,​?,​O>,​I,​net.automatalib.word.Word<O>>, LearningCache.MealyLearningCache<I,​O>, Resumable<de.learnlib.filter.cache.sul.AbstractSULCache.SULCacheState<I,​O>>, SUL<I,​O>, net.automatalib.alphabet.SupportsGrowingAlphabet<I>
    Direct Known Subclasses:
    ThreadSafeSULCache

    public class SULCache<I,​O>
    extends Object
    A cache to be used with a SUL.

    Because on a SUL, a query is executed step-by-step, it is impossible to determine in advance whether the cached information is sufficient to answer the complete query. However, in general it is undesired to execute any actions on the underlying SUL as long as the requested information can be provided from the cache.

    This class therefore defers any real execution to the point where the cached information is definitely insufficient; if such a point is not reached before a call to SUL.post() is made, the underlying SUL is not queried.

    Note: this implementation is not thread-safe. If you require a cache that is usable in a parallel environment. use the ThreadSafeSULCache (or rather the ThreadSafeSULCaches factory) from the learnlib-parallelism artifact.

    • Method Detail

      • pre

        public void pre()
        Specified by:
        pre in interface SUL<I,​O>
      • post

        public void post()
        Specified by:
        post in interface SUL<I,​O>
      • step

        public O step​(I in)
        Specified by:
        step in interface SUL<I,​O>
      • canFork

        public boolean canFork()
        Specified by:
        canFork in interface SUL<I,​O>
      • fork

        public SUL<I,​O> fork()
        Specified by:
        fork in interface SUL<I,​O>
      • createCacheConsistencyTest

        public EquivalenceOracle.MealyEquivalenceOracle<I,​O> createCacheConsistencyTest()
        Description copied from interface: LearningCache
        Creates a cache consistency test. A cache consistency test is an equivalence oracle which checks a given hypothesis against the current contents of the cache. Hence, no queries are posed to the underlying system.

        The created cache consistency test is backed by the cache contents. This method does not need to be invoked repeatedly when the cache contents change.

        Specified by:
        createCacheConsistencyTest in interface LearningCache<I,​O,​C extends de.learnlib.filter.cache.sul.AbstractSULCache.SULCacheState<I,​O>>
        Returns:
        a cache consistency test for the contents of this cache
      • addAlphabetSymbol

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

        public C suspend()
        Specified by:
        suspend in interface Resumable<I>
      • resume

        public void resume​(C state)
        Specified by:
        resume in interface Resumable<I>
      • size

        public int size()