Package de.learnlib.oracle.equivalence
Class AbstractTestWordEQOracle<A extends Output<I,D>,I,D>
- java.lang.Object
-
- de.learnlib.oracle.equivalence.AbstractTestWordEQOracle<A,I,D>
-
- Type Parameters:
A
- hypothesis typeI
- input symbol typeD
- output (domain) type
- All Implemented Interfaces:
EquivalenceOracle<A,I,D>
- Direct Known Subclasses:
CompleteExplorationEQOracle
,IncrementalWMethodEQOracle
,RandomWellMatchedWordsEQOracle
,RandomWMethodEQOracle
,RandomWordsEQOracle
,RandomWpMethodEQOracle
,WMethodEQOracle
,WMethodEQOracle
,WMethodEQOracle
,WMethodEQOracle
,WpMethodEQOracle
,WpMethodEQOracle
public abstract class AbstractTestWordEQOracle<A extends Output<I,D>,I,D> extends Object implements EquivalenceOracle<A,I,D>
An abstract equivalence oracle that takes care of query batching and hypothesis checking and allows extending classes to solely focus on test word generation by implementinggenerateTestWords(Output, Collection)
.Being
stream
-based, this oracle encourages the lazy computation of counterexamples, so that all counterexamples do not have to be computed upfront, but only until the first valid counterexample is found.
-
-
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 AbstractTestWordEQOracle(MembershipOracle<I,D> membershipOracle)
AbstractTestWordEQOracle(MembershipOracle<I,D> membershipOracle, int batchSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description @Nullable DefaultQuery<I,D>
findCounterExample(A hypothesis, Collection<? extends I> inputs)
Searches for a counterexample disproving the subjected hypothesis.protected abstract 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.
-
-
-
Constructor Detail
-
AbstractTestWordEQOracle
public AbstractTestWordEQOracle(MembershipOracle<I,D> membershipOracle)
-
AbstractTestWordEQOracle
public AbstractTestWordEQOracle(MembershipOracle<I,D> membershipOracle, int batchSize)
-
-
Method Detail
-
findCounterExample
public @Nullable DefaultQuery<I,D> findCounterExample(A hypothesis, Collection<? extends I> inputs)
Description copied from interface:EquivalenceOracle
Searches for a counterexample disproving the subjected hypothesis. A counterexample is query which, when performed on the SUL, yields a different output than what was predicted by the hypothesis. If no counterexample could be found (this does not necessarily mean that none exists),null
is returned.- Specified by:
findCounterExample
in interfaceEquivalenceOracle<A extends Output<I,D>,I,D>
- Parameters:
hypothesis
- the conjectureinputs
- the set of inputs to consider, this should be a subset of the input alphabet of the provided hypothesis- Returns:
- a query exposing different behavior, or
null
if no counterexample could be found. In case a non-null
value is returned, the output field in theDefaultQuery
contains the SUL output for the respective query.
-
generateTestWords
protected abstract 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.- 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)
-
-