Class MealyCacheOracle<I,O>
- java.lang.Object
-
- de.learnlib.filter.cache.mealy.MealyCacheOracle<I,O>
-
- Type Parameters:
I
- input symbol classO
- output symbol class
- All Implemented Interfaces:
LearningCache<MealyMachine<?,I,?,O>,I,Word<O>>
,LearningCache.MealyLearningCache<I,O>
,LearningCacheOracle<MealyMachine<?,I,?,O>,I,Word<O>>
,LearningCacheOracle.MealyLearningCacheOracle<I,O>
,MembershipOracle<I,Word<O>>
,MembershipOracle.MealyMembershipOracle<I,O>
,BatchProcessor<Query<I,Word<O>>>
,QueryAnswerer<I,Word<O>>
,Resumable<MealyCacheOracle.MealyCacheOracleState<I,O>>
,SupportsGrowingAlphabet<I>
- Direct Known Subclasses:
ThreadSafeMealyCacheOracle
public class MealyCacheOracle<I,O> extends Object implements LearningCacheOracle.MealyLearningCacheOracle<I,O>, SupportsGrowingAlphabet<I>, Resumable<MealyCacheOracle.MealyCacheOracleState<I,O>>
Mealy cache. This cache is implemented as a membership oracle: upon construction, it is provided with a delegate oracle. Queries that can be answered from the cache are answered directly, others are forwarded to the delegate oracle. When the delegate oracle has finished processing these remaining queries, the results are incorporated into the cache.This oracle additionally enables the user to define a Mealy-style prefix-closure filter: a
Mapping
from output symbols to output symbols may be provided, with the following semantics: If in an output word a symbol for which the given mapping has a non-null value is encountered, all symbols after this symbol are replaced by the respective value. The rationale behind this is that the concrete error message (key in the mapping) is still reflected in the learned model, it is forced to result in a sink state with only a single repeating output symbol (value in the mapping).Note: this implementation is not thread-safe. If you require a cache that is usable in a parallel environment. use the
ThreadSafeMealyCacheOracle
(or rather theThreadSafeMealyCaches
factory) from thelearnlib-parallelism
artifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MealyCacheOracle.MealyCacheOracleState<I,O>
-
Nested classes/interfaces inherited from interface de.learnlib.filter.cache.LearningCache
LearningCache.DFALearningCache<I>, LearningCache.MealyLearningCache<I,O>, LearningCache.MooreLearningCache<I,O>
-
Nested classes/interfaces inherited from interface de.learnlib.filter.cache.LearningCacheOracle
LearningCacheOracle.DFALearningCacheOracle<I>, LearningCacheOracle.MealyLearningCacheOracle<I,O>, LearningCacheOracle.MooreLearningCacheOracle<I,O>
-
Nested classes/interfaces inherited from interface de.learnlib.oracle.MembershipOracle
MembershipOracle.DFAMembershipOracle<I>, MembershipOracle.MealyMembershipOracle<I,O>, MembershipOracle.MooreMembershipOracle<I,O>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlphabetSymbol(I symbol)
EquivalenceOracle.MealyEquivalenceOracle<I,O>
createCacheConsistencyTest()
Creates a cache consistency test.void
processQueries(Collection<? extends Query<I,Word<O>>> queries)
Processes the specified collection of queries.void
resume(MealyCacheOracle.MealyCacheOracleState<I,O> state)
Resume the datastructure from a previously suspended point in time.MealyCacheOracle.MealyCacheOracleState<I,O>
suspend()
Expose the state object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.learnlib.oracle.MembershipOracle
answerQuery, answerQuery, asOracle, processBatch, processQuery
-
-
-
-
Method Detail
-
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 interfaceLearningCache<MealyMachine<?,I,?,O>,I,Word<O>>
- Returns:
- a cache consistency test for the contents of this cache
-
processQueries
public void processQueries(Collection<? extends Query<I,Word<O>>> queries)
Description copied from interface:MembershipOracle
Processes the specified collection of queries. When this method returns, each of the contained queriesQuery.answer(Object)
method should have been called with an argument reflecting the SUL response to the respective query.- Specified by:
processQueries
in interfaceMembershipOracle<I,O>
- Parameters:
queries
- the queries to process- See Also:
Query.answer(Object)
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
- Specified by:
addAlphabetSymbol
in interfaceSupportsGrowingAlphabet<I>
-
suspend
public MealyCacheOracle.MealyCacheOracleState<I,O> suspend()
Description copied from interface:Resumable
Expose the state object.
-
-