Class RandomWMethodEQOracle<A extends UniversalDeterministicAutomaton<?,​I,​?,​?,​?> & Output<I,​D>,​I,​D>

  • Type Parameters:
    A - automaton type
    I - input symbol type
    D - output domain type
    All Implemented Interfaces:
    EquivalenceOracle<A,​I,​D>
    Direct Known Subclasses:
    DFARandomWMethodEQOracle, MealyRandomWMethodEQOracle, MooreRandomWMethodEQOracle

    public class RandomWMethodEQOracle<A extends UniversalDeterministicAutomaton<?,​I,​?,​?,​?> & Output<I,​D>,​I,​D>
    extends AbstractTestWordEQOracle<A,​I,​D>
    Implements an equivalence test by applying the W-method test on the given hypothesis automaton. Generally the Wp-method performs better in finding counter examples. Instead of enumerating the test suite in order, this is a sampling implementation:
    • 1. sample uniformly from the transitions for a prefix
    • 2. sample geometrically a random word
    • 3. sample a word from the set of suffixes / state identifiers
    There are two parameters: minimalSize determines the minimal size of the random word, this is useful when one first performs a W(p)-method with some depth and continue with this randomized tester from that depth onward. The second parameter rndLength determines the expected length of the random word. (The expected length in effect is minimalSize + rndLength.) In the unbounded case it will not terminate for a correct hypothesis.
    • Constructor Detail

      • RandomWMethodEQOracle

        public RandomWMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                     int minimalSize,
                                     int rndLength)
        Constructor for an unbounded testing oracle.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
      • RandomWMethodEQOracle

        public RandomWMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                     int minimalSize,
                                     int rndLength,
                                     int bound)
        Constructor for a bounded testing oracle.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
        bound - specifies the bound (set to 0 for unbounded).
      • RandomWMethodEQOracle

        public RandomWMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                     int minimalSize,
                                     int rndLength,
                                     int bound,
                                     int batchSize)
        Constructor for a bounded testing oracle with a specific batch size.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
        bound - specifies the bound (set to 0 for unbounded).
        batchSize - size of the batches sent to the membership oracle
      • RandomWMethodEQOracle

        public RandomWMethodEQOracle​(MembershipOracle<I,​D> sulOracle,
                                     int minimalSize,
                                     int rndLength,
                                     int bound,
                                     Random random,
                                     int batchSize)
        Constructor for a bounded testing oracle with a specific batch size.
        Parameters:
        sulOracle - oracle which answers tests.
        minimalSize - minimal size of the random word
        rndLength - expected length (in addition to minimalSize) of random word
        bound - specifies the bound (set to 0 for unbounded).
        random - custom Random generator.
        batchSize - size of the batches sent to the membership oracle