Package de.learnlib.oracle.equivalence
Class RandomWpMethodEQOracle<A extends UniversalDeterministicAutomaton<?,I,?,?,?> & Output<I,D>,I,D>
- java.lang.Object
-
- de.learnlib.oracle.equivalence.AbstractTestWordEQOracle<A,I,D>
-
- de.learnlib.oracle.equivalence.RandomWpMethodEQOracle<A,I,D>
-
- Type Parameters:
A
- automaton typeI
- input symbol typeD
- output domain type
- All Implemented Interfaces:
EquivalenceOracle<A,I,D>
- Direct Known Subclasses:
DFARandomWpMethodEQOracle
,MealyRandomWpMethodEQOracle
,MooreRandomWpMethodEQOracle
public class RandomWpMethodEQOracle<A extends UniversalDeterministicAutomaton<?,I,?,?,?> & Output<I,D>,I,D> extends AbstractTestWordEQOracle<A,I,D>
Implements an equivalence test by applying the Wp-method test on the given hypothesis automaton, as described in "Test Selection Based on Finite State Models" by S. Fujiwara et al. Instead of enumerating the test suite in order, this is a sampling implementation:- 1. sample uniformly from the states 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 RandomWpMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength)
Constructor for an unbounded testing oracle.RandomWpMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound)
Constructor for a bounded testing oracle.RandomWpMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound, int batchSize)
Constructor for a bounded testing oracle with specific batch size.RandomWpMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound, Random random, int batchSize)
Constructor for a bounded testing oracle with 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
-
RandomWpMethodEQOracle
public RandomWpMethodEQOracle(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
-
RandomWpMethodEQOracle
public RandomWpMethodEQOracle(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).
-
RandomWpMethodEQOracle
public RandomWpMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound, int batchSize)
Constructor for a bounded testing oracle with 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
-
RandomWpMethodEQOracle
public RandomWpMethodEQOracle(MembershipOracle<I,D> sulOracle, int minimalSize, int rndLength, int bound, Random random, int batchSize)
Constructor for a bounded testing oracle with 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)
-
-