Class SampleSetEQOracle<I,​D>

  • Type Parameters:
    I - input symbol type
    D - output domain type
    All Implemented Interfaces:
    EquivalenceOracle<net.automatalib.automaton.concept.SuffixOutput<I,​D>,​I,​D>

    public class SampleSetEQOracle<I,​D>
    extends Object
    implements EquivalenceOracle<net.automatalib.automaton.concept.SuffixOutput<I,​D>,​I,​D>
    An equivalence oracle that tests a hypothesis against a fixed set of sample queries.

    Sample queries are provided through one of the add(...) or addAll(...) methods of this class. A query consists of an input word (split into a prefix and a suffix), and an expected output. During an equivalence query, for each of those queries if the respective actual suffix output of the hypothesis equals the expected output.

    This oracle will always repeatedly test queries from the sample set if they turned out to be counterexamples. However, the oracle can be configured to remove queries from the sample set if they did not serve as counterexamples.

    • Constructor Detail

      • SampleSetEQOracle

        public SampleSetEQOracle()
        Constructor. Convenience method for SampleSetEQOracle(boolean) that does not remove unsuccessful samples.
      • SampleSetEQOracle

        public SampleSetEQOracle​(boolean removeUnsuccessful)
        Constructor. Initializes the oracle with an empty sample set.
        Parameters:
        removeUnsuccessful - if set to true, queries will be removed from the sample set if they did not reveal a counterexample. Otherwise, all queries from the sample set will always be tested upon each invocation of findCounterExample(SuffixOutput, Collection).
    • Method Detail

      • add

        public SampleSetEQOracle<I,​D> add​(net.automatalib.word.Word<I> input,
                                                D expectedOutput)
        Adds a query word along with its expected output to the sample set.
        Parameters:
        input - the input word
        expectedOutput - the expected output for this word
        Returns:
        this, to enable chained add or addAll calls
      • addAll

        @SafeVarargs
        public final SampleSetEQOracle<I,​D> addAll​(MembershipOracle<I,​D> oracle,
                                                         net.automatalib.word.Word<I>... words)
        Adds several query words to the sample set. The expected output is determined by means of the specified membership oracle.
        Parameters:
        oracle - the membership oracle used to determine expected outputs
        words - the words to be added to the sample set
        Returns:
        this, to enable chained add or addAll calls
      • addAll

        public SampleSetEQOracle<I,​D> addAll​(MembershipOracle<I,​D> oracle,
                                                   Collection<? extends net.automatalib.word.Word<I>> words)
        Adds words to the sample set. The expected output is determined by means of the specified membership oracle.
        Parameters:
        oracle - the membership oracle used to determine the expected output
        words - the words to add
        Returns:
        this, to enable chained add or addAll calls
      • addAll

        @SafeVarargs
        public final SampleSetEQOracle<I,​D> addAll​(DefaultQuery<I,​D>... newTestQueries)
        Adds queries to the sample set. These must be DefaultQuerys, which allow for retrieving the corresponding (expected) output.
        Parameters:
        newTestQueries - the queries to add to the sample set
        Returns:
        this, to enable chained add or addAll calls
      • addAll

        public SampleSetEQOracle<I,​D> addAll​(Collection<? extends DefaultQuery<I,​D>> newTestQueries)
        Adds queries to the sample set. These must be DefaultQuerys, which allow for retrieving the corresponding (expected) output.
        Parameters:
        newTestQueries - the queries to add to the sample set
        Returns:
        this, to enable chained add or addAll calls