Package de.learnlib.filter.reuse
Class ReuseOracle<S,I,O>
- java.lang.Object
-
- de.learnlib.filter.reuse.ReuseOracle<S,I,O>
-
- Type Parameters:
S
- system state classI
- input symbol classO
- output symbol class
- All Implemented Interfaces:
MembershipOracle<I,Word<O>>
,MembershipOracle.MealyMembershipOracle<I,O>
,BatchProcessor<Query<I,Word<O>>>
,QueryAnswerer<I,Word<O>>
,SingleQueryOracle<I,Word<O>>
,SingleQueryOracle.SingleQueryOracleMealy<I,O>
public final class ReuseOracle<S,I,O> extends Object implements SingleQueryOracle.SingleQueryOracleMealy<I,O>
The reuse oracle is aMembershipOracle.MealyMembershipOracle
that is able to- Cache queries: Each processed query will
not be delegated again (instead the answer will be retrieved from the
ReuseTree
) - Pump queries: If
the
ReuseTree
is configured to know which symbols are model invariant input symbols viaReuseOracle.ReuseOracleBuilder.withInvariantInputs(Set)
(like a read from a database which does not change the SUL) or configured for failure output symbols viaReuseOracle.ReuseOracleBuilder.withFailureOutputs(Set)
(e.g. a roll back mechanism exists for the invoked symbol) the oracle could ''pump'' those symbols inside a query once seen. - Reuse system states: There are a lot of situations where a prefix of a query is already known and a system state
is available. In this situation the oracle is able to reuse the available system state and only process the remaining
suffix. Whether a system state will be removed after it is used is decided upon construction (see
ReuseOracleBuilder(Alphabet, Supplier)
.
ReuseTree
.The usage of model invariant input symbols and failure output symbols is disabled by default and can be enabled upon construction (see
ReuseOracle.ReuseOracleBuilder.withFailureOutputs(Set)
andReuseOracle.ReuseOracleBuilder.withInvariantInputs(Set)
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReuseOracle.ReuseOracleBuilder<S,I,O>
-
Nested classes/interfaces inherited from interface de.learnlib.oracle.MembershipOracle
MembershipOracle.DFAMembershipOracle<I>, MembershipOracle.MealyMembershipOracle<I,O>, MembershipOracle.MooreMembershipOracle<I,O>
-
Nested classes/interfaces inherited from interface de.learnlib.oracle.SingleQueryOracle
SingleQueryOracle.SingleQueryOracleDFA<I>, SingleQueryOracle.SingleQueryOracleMealy<I,O>, SingleQueryOracle.SingleQueryOracleMoore<I,O>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Word<O>
answerQuery(Word<I> input)
Word<O>
answerQuery(Word<I> prefix, Word<I> suffix)
ReuseCapableOracle<S,I,O>
getReuseCapableOracle()
Returns theReuseCapableOracle
used by this instance.ReuseTree<S,I,O>
getReuseTree()
Returns theReuseTree
used by this instance.-
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
asOracle, processBatch
-
Methods inherited from interface de.learnlib.oracle.SingleQueryOracle
processQueries, processQuery
-
-
-
-
Method Detail
-
answerQuery
public Word<O> answerQuery(Word<I> prefix, Word<I> suffix)
- Specified by:
answerQuery
in interfaceMembershipOracle<S,I>
- Specified by:
answerQuery
in interfaceQueryAnswerer<S,I>
- Specified by:
answerQuery
in interfaceSingleQueryOracle<S,I>
-
answerQuery
public Word<O> answerQuery(Word<I> input)
- Specified by:
answerQuery
in interfaceMembershipOracle<S,I>
- Specified by:
answerQuery
in interfaceQueryAnswerer<S,I>
-
getReuseCapableOracle
public ReuseCapableOracle<S,I,O> getReuseCapableOracle()
Returns theReuseCapableOracle
used by this instance.
-
-