Interface MembershipOracle<I,D>

All Superinterfaces:
BatchProcessor<Query<I,D>>, QueryAnswerer<I,D>
All Known Subinterfaces:
LearningCacheOracle<A,I,D>, LearningCacheOracle.DFALearningCacheOracle<I>, LearningCacheOracle.MealyLearningCacheOracle<I,O>, LearningCacheOracle.MMMLTLearningCacheOracle<I,O>, LearningCacheOracle.MooreLearningCacheOracle<I,O>, MembershipOracle.DFAMembershipOracle<I>, MembershipOracle.MealyMembershipOracle<I,O>, MembershipOracle.MooreMembershipOracle<I,O>, ParallelOracle<I,D>, ParallelTimedQueryOracle<I,O>, SingleQueryOracle<I,D>, SingleQueryOracle.SingleQueryOracleDFA<I>, SingleQueryOracle.SingleQueryOracleMealy<I,O>, SingleQueryOracle.SingleQueryOracleMMLT<I,O>, SingleQueryOracle.SingleQueryOracleMoore<I,O>, TimedQueryOracle<I,O>
All Known Implementing Classes:
Adaptive2MembershipWrapper, CLIOracle, CLIOutputOracle, CounterOracle, DFACacheOracle, DFACounterOracle, DFAHashCacheOracle, DFALockableOracle, DFASimulatorOracle, DynamicParallelOracle, DynamicParallelTimedQueryOracle, InterningMealyMembershipOracle, InterningMembershipOracle, InterningMooreMembershipOracle, LockableOracle, MappedOracle, MealyCacheOracle, MealyCounterOracle, MealyLockableOracle, MealySimulatorOracle, MMLTLockableOracle, MooreCacheOracle, MooreCounterOracle, MooreLockableOracle, MooreSimulatorOracle, NFASimulatorOracle, ReuseOracle, SBALockableOracle, SBASimulatorOracle, SEVPALockableOracle, SEVPASimulatorOracle, SimulatorOracle, SPALockableOracle, SPASimulatorOracle, SPMMLockableOracle, SPMMSimulatorOracle, StateLocalInputSULOracle, StaticParallelOracle, StaticParallelTimedQueryOracle, StdInOracle, StdInOutputOracle, SULOracle, ThreadSafeDFACacheOracle, ThreadSafeMealyCacheOracle, ThreadSafeMooreCacheOracle, TimedSULOracle
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MembershipOracle<I,D> extends QueryAnswerer<I,D>, BatchProcessor<Query<I,D>>
Membership oracle interface. A membership oracle provides an elementary abstraction to a System Under Learning (SUL), by allowing to pose queries: A query is a sequence of input symbols (divided into a prefix and a suffix part, cf. Query.getPrefix() and Query.getSuffix()) in reaction to which the SUL produces a specific observable behavior (outputting a word, acceptance/rejection etc.).
See Also:
  • Method Details

    • answerQuery

      default D answerQuery(Word<I> input)
      Specified by:
      answerQuery in interface QueryAnswerer<I,D>
    • answerQuery

      default D answerQuery(Word<I> prefix, Word<I> suffix)
      Specified by:
      answerQuery in interface QueryAnswerer<I,D>
    • processQuery

      default void processQuery(Query<I,D> query)
      Processes a single query. When this method returns, the Query.answer(Object) method of the supplied object will have been called with an argument reflecting the SUL response to the respective query.

      The default implementation of this method will simply wrap the provided Query in a singleton Collection using Collections.singleton(Object). Implementations in subclasses should override this method to circumvent the Collection object creation, if possible.

      Parameters:
      query - the query to process
    • processQueries

      void processQueries(Collection<? extends Query<I,D>> queries)
      Processes the specified collection of queries. When this method returns, each of the contained queries Query.answer(Object) method should have been called with an argument reflecting the SUL response to the respective query.
      Parameters:
      queries - the queries to process
      See Also:
    • asOracle

      default MembershipOracle<I,D> asOracle()
      Specified by:
      asOracle in interface QueryAnswerer<I,D>
    • processBatch

      default void processBatch(Collection<? extends Query<I,D>> batch)
      Description copied from interface: BatchProcessor
      Process the batch.
      Specified by:
      processBatch in interface BatchProcessor<I>
      Parameters:
      batch - the batch to process