Package de.learnlib.filter.cache.dfa
Class DFACacheOracle<I>
- java.lang.Object
-
- de.learnlib.filter.cache.dfa.DFACacheOracle<I>
-
- Type Parameters:
I
- input symbol class
- All Implemented Interfaces:
LearningCache<DFA<?,I>,I,Boolean>
,LearningCache.DFALearningCache<I>
,LearningCacheOracle<DFA<?,I>,I,Boolean>
,LearningCacheOracle.DFALearningCacheOracle<I>
,MembershipOracle<I,Boolean>
,MembershipOracle.DFAMembershipOracle<I>
,BatchProcessor<Query<I,Boolean>>
,QueryAnswerer<I,Boolean>
,Resumable<DFACacheOracle.DFACacheOracleState<I>>
,SupportsGrowingAlphabet<I>
- Direct Known Subclasses:
ThreadSafeDFACacheOracle
public class DFACacheOracle<I> extends Object implements LearningCacheOracle.DFALearningCacheOracle<I>, SupportsGrowingAlphabet<I>, Resumable<DFACacheOracle.DFACacheOracleState<I>>
DFA 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.Note: this implementation is not thread-safe. If you require a cache that is usable in a parallel environment. use the
ThreadSafeDFACacheOracle
(or rather theThreadSafeDFACaches
factory) from thelearnlib-parallelism
artifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DFACacheOracle.DFACacheOracleState<I>
-
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.DFAEquivalenceOracle<I>
createCacheConsistencyTest()
Creates a cache consistency test.void
processQueries(Collection<? extends Query<I,Boolean>> queries)
Processes the specified collection of queries.void
resume(DFACacheOracle.DFACacheOracleState<I> state)
Resume the datastructure from a previously suspended point in time.DFACacheOracle.DFACacheOracleState<I>
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.DFAEquivalenceOracle<I> 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<DFA<?,I>,I,Boolean>
- Returns:
- a cache consistency test for the contents of this cache
-
processQueries
public void processQueries(Collection<? extends Query<I,Boolean>> 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,Boolean>
- 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 DFACacheOracle.DFACacheOracleState<I> suspend()
Description copied from interface:Resumable
Expose the state object.
-
-