Package de.learnlib.oracle.equivalence
Class RandomWpMethodEQOracle<A extends net.automatalib.automaton.UniversalDeterministicAutomaton<?,I,?,?,?> & net.automatalib.automaton.concept.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 net.automatalib.automaton.UniversalDeterministicAutomaton<?,I,?,?,?> & net.automatalib.automaton.concept.Output<I,D>,I,D> extends AbstractTestWordEQOracle<A,I,D>
Implements an equivalence test based on a randomized version of the W(p)-method as described in Complementing Model Learning with Mutation-Based Fuzzing by Rick Smetsers, Joshua Moerman, Mark Janssen, Sicco Verwer. Instead of enumerating the test suite in order, this is a sampling implementation:- sample uniformly from the states for a prefix
- sample geometrically a random word
- 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<net.automatalib.word.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<net.automatalib.word.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 net.automatalib.automaton.UniversalDeterministicAutomaton<?,I,?,?,?> & net.automatalib.automaton.concept.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)
-
-