Package de.learnlib.oracle.equivalence
Class RandomWMethodEQOracle<A extends UniversalDeterministicAutomaton<?,I,?,?,?> & Output<I,D>,I,D>
- java.lang.Object
-
- de.learnlib.oracle.equivalence.AbstractTestWordEQOracle<A,I,D>
-
- de.learnlib.oracle.equivalence.RandomWMethodEQOracle<A,I,D>
-
- Type Parameters:
A
- automaton typeI
- input symbol typeD
- 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.learnlib.oracle.EquivalenceOracle
EquivalenceOracle.DFAEquivalenceOracle<I>, EquivalenceOracle.MealyEquivalenceOracle<I,O>, EquivalenceOracle.MooreEquivalenceOracle<I,O>
-
-
Constructor Summary
Constructors Constructor Description RandomWMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength)
Constructor for an unbounded testing oracle.RandomWMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound)
Constructor for a bounded testing oracle.RandomWMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound, int batchSize)
Constructor for a bounded testing oracle with a specific batch size.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stream<Word<I>>
generateTestWords(A hypothesis, Collection<? extends I> inputs)
Generate the stream of test words that should be used for the current equivalence check cycle.-
Methods inherited from class de.learnlib.oracle.equivalence.AbstractTestWordEQOracle
findCounterExample
-
-
-
-
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 wordrndLength
- 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 wordrndLength
- expected length (in addition to minimalSize) of random wordbound
- 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 wordrndLength
- expected length (in addition to minimalSize) of random wordbound
- 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 wordrndLength
- expected length (in addition to minimalSize) of random wordbound
- specifies the bound (set to 0 for unbounded).random
- custom Random generator.batchSize
- size of the batches sent to the membership oracle
-
-
Method Detail
-
generateTestWords
protected Stream<Word<I>> generateTestWords(A hypothesis, Collection<? extends I> inputs)
Description copied from class:AbstractTestWordEQOracle
Generate the stream of test words that should be used for the current equivalence check cycle.- Specified by:
generateTestWords
in classAbstractTestWordEQOracle<A extends UniversalDeterministicAutomaton<?,I,?,?,?> & Output<I,D>,I,D>
- Parameters:
hypothesis
- the current hypothesis of the learning algorithminputs
- the collection of inputs to consider- Returns:
- the stream of test words used for equivalence testing
- See Also:
EquivalenceOracle.findCounterExample(Object, Collection)
-
-