Package de.learnlib.filter.cache.mealy
Class SymbolQueryCache<I,O>
- java.lang.Object
-
- de.learnlib.filter.cache.mealy.SymbolQueryCache<I,O>
-
- Type Parameters:
I
- input alphabet typeO
- output alphabet type
- 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>>
,SymbolQueryOracle<I,O>
,Resumable<SymbolQueryCache.SymbolQueryCacheState<I,O>>
public class SymbolQueryCache<I,O> extends Object implements SymbolQueryOracle<I,O>, LearningCacheOracle.MealyLearningCacheOracle<I,O>, Resumable<SymbolQueryCache.SymbolQueryCacheState<I,O>>
A cache for aSymbolQueryOracle
. 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. Queried symbols that have to be delegated are incorporated into the cache directly.Internally, an incrementally growing tree (in form of a mealy automaton) is used for caching.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SymbolQueryCache.SymbolQueryCacheState<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 EquivalenceOracle<MealyMachine<?,I,?,O>,I,Word<O>>
createCacheConsistencyTest()
Creates a cache consistency test.O
query(I i)
Query the system under learning for a new symbol.void
reset()
Reset the system under learning.void
resume(SymbolQueryCache.SymbolQueryCacheState<I,O> state)
Resume the datastructure from a previously suspended point in time.SymbolQueryCache.SymbolQueryCacheState<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
-
Methods inherited from interface de.learnlib.oracle.SymbolQueryOracle
processQueries
-
-
-
-
Method Detail
-
query
public O query(I i)
Description copied from interface:SymbolQueryOracle
Query the system under learning for a new symbol. This is a stateful operation.- Specified by:
query
in interfaceSymbolQueryOracle<I,O>
- Parameters:
i
- the symbol to query- Returns:
- the observed output
-
reset
public void reset()
Description copied from interface:SymbolQueryOracle
Reset the system under learning.- Specified by:
reset
in interfaceSymbolQueryOracle<I,O>
-
createCacheConsistencyTest
public EquivalenceOracle<MealyMachine<?,I,?,O>,I,Word<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
-
suspend
public SymbolQueryCache.SymbolQueryCacheState<I,O> suspend()
Description copied from interface:Resumable
Expose the state object.
-
-