Class MooreCacheOracle<I,O>
- java.lang.Object
-
- de.learnlib.filter.cache.moore.MooreCacheOracle<I,O>
-
- Type Parameters:
I- input symbol classO- output symbol class
- All Implemented Interfaces:
LearningCache<net.automatalib.automaton.transducer.MooreMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>,LearningCache.MooreLearningCache<I,O>,LearningCacheOracle<net.automatalib.automaton.transducer.MooreMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>,LearningCacheOracle.MooreLearningCacheOracle<I,O>,BatchProcessor<Query<I,net.automatalib.word.Word<O>>>,MembershipOracle<I,net.automatalib.word.Word<O>>,MembershipOracle.MooreMembershipOracle<I,O>,QueryAnswerer<I,net.automatalib.word.Word<O>>,Resumable<MooreCacheOracle.MooreCacheOracleState<I,O>>,net.automatalib.alphabet.SupportsGrowingAlphabet<I>
- Direct Known Subclasses:
ThreadSafeMooreCacheOracle
public class MooreCacheOracle<I,O> extends Object implements LearningCacheOracle.MooreLearningCacheOracle<I,O>, net.automatalib.alphabet.SupportsGrowingAlphabet<I>, Resumable<MooreCacheOracle.MooreCacheOracleState<I,O>>
Moore 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 Moore-style prefix-closure filter: a
Mappingfrom 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
ThreadSafeMooreCacheOracle(or rather theThreadSafeMooreCachesfactory) from thelearnlib-parallelismartifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMooreCacheOracle.MooreCacheOracleState<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 extends Object>, MembershipOracle.MealyMembershipOracle<I extends Object,O extends Object>, MembershipOracle.MooreMembershipOracle<I extends Object,O extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAlphabetSymbol(I symbol)EquivalenceOracle.MooreEquivalenceOracle<I,O>createCacheConsistencyTest()Creates a cache consistency test.voidprocessQueries(Collection<? extends Query<I,net.automatalib.word.Word<O>>> queries)voidresume(MooreCacheOracle.MooreCacheOracleState<I,O> state)MooreCacheOracle.MooreCacheOracleState<I,O>suspend()-
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.MooreEquivalenceOracle<I,O> createCacheConsistencyTest()
Description copied from interface:LearningCacheCreates 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:
createCacheConsistencyTestin interfaceLearningCache<net.automatalib.automaton.transducer.MooreMachine<?,I,?,O>,I,net.automatalib.word.Word<O>>- Returns:
- a cache consistency test for the contents of this cache
-
processQueries
public void processQueries(Collection<? extends Query<I,net.automatalib.word.Word<O>>> queries)
- Specified by:
processQueriesin interfaceMembershipOracle<I,O>
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
- Specified by:
addAlphabetSymbolin interfacenet.automatalib.alphabet.SupportsGrowingAlphabet<I>
-
suspend
public MooreCacheOracle.MooreCacheOracleState<I,O> suspend()
-
-