Package de.learnlib.oracle.equivalence
Class SampleSetEQOracle<I,D>
- java.lang.Object
-
- de.learnlib.oracle.equivalence.SampleSetEQOracle<I,D>
-
- Type Parameters:
I- input symbol typeD- output domain type
- All Implemented Interfaces:
EquivalenceOracle<net.automatalib.automaton.concept.SuffixOutput<I,D>,I,D>
public class SampleSetEQOracle<I,D> extends Object implements EquivalenceOracle<net.automatalib.automaton.concept.SuffixOutput<I,D>,I,D>
An equivalence oracle that tests a hypothesis against a fixed set of sample queries.Sample queries are provided through one of the
add(...)oraddAll(...)methods of this class. A query consists of an input word (split into a prefix and a suffix), and an expected output. During an equivalence query, for each of those queries if the respective actual suffix output of the hypothesis equals the expected output.This oracle will always repeatedly test queries from the sample set if they turned out to be counterexamples. However, the oracle can be configured to remove queries from the sample set if they did not serve as counterexamples.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.learnlib.oracle.EquivalenceOracle
EquivalenceOracle.DFAEquivalenceOracle<I extends Object>, EquivalenceOracle.MealyEquivalenceOracle<I extends Object,O extends Object>, EquivalenceOracle.MooreEquivalenceOracle<I extends Object,O extends Object>
-
-
Constructor Summary
Constructors Constructor Description SampleSetEQOracle()Constructor.SampleSetEQOracle(boolean removeUnsuccessful)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SampleSetEQOracle<I,D>add(net.automatalib.word.Word<I> input, D expectedOutput)Adds a query word along with its expected output to the sample set.SampleSetEQOracle<I,D>addAll(MembershipOracle<I,D> oracle, Collection<? extends net.automatalib.word.Word<I>> words)Adds words to the sample set.SampleSetEQOracle<I,D>addAll(MembershipOracle<I,D> oracle, net.automatalib.word.Word<I>... words)Adds several query words to the sample set.SampleSetEQOracle<I,D>addAll(DefaultQuery<I,D>... newTestQueries)Adds queries to the sample set.SampleSetEQOracle<I,D>addAll(Collection<? extends DefaultQuery<I,D>> newTestQueries)Adds queries to the sample set.@Nullable DefaultQuery<I,D>findCounterExample(net.automatalib.automaton.concept.SuffixOutput<I,D> hypothesis, Collection<? extends I> inputs)
-
-
-
Constructor Detail
-
SampleSetEQOracle
public SampleSetEQOracle()
Constructor. Convenience method forSampleSetEQOracle(boolean)that does not remove unsuccessful samples.
-
SampleSetEQOracle
public SampleSetEQOracle(boolean removeUnsuccessful)
Constructor. Initializes the oracle with an empty sample set.- Parameters:
removeUnsuccessful- if set totrue, queries will be removed from the sample set if they did not reveal a counterexample. Otherwise, all queries from the sample set will always be tested upon each invocation offindCounterExample(SuffixOutput, Collection).
-
-
Method Detail
-
add
public SampleSetEQOracle<I,D> add(net.automatalib.word.Word<I> input, D expectedOutput)
Adds a query word along with its expected output to the sample set.- Parameters:
input- the input wordexpectedOutput- the expected output for this word- Returns:
this, to enable chainedaddoraddAllcalls
-
addAll
@SafeVarargs public final SampleSetEQOracle<I,D> addAll(MembershipOracle<I,D> oracle, net.automatalib.word.Word<I>... words)
Adds several query words to the sample set. The expected output is determined by means of the specified membership oracle.- Parameters:
oracle- the membership oracle used to determine expected outputswords- the words to be added to the sample set- Returns:
this, to enable chainedaddoraddAllcalls
-
addAll
public SampleSetEQOracle<I,D> addAll(MembershipOracle<I,D> oracle, Collection<? extends net.automatalib.word.Word<I>> words)
Adds words to the sample set. The expected output is determined by means of the specified membership oracle.- Parameters:
oracle- the membership oracle used to determine the expected outputwords- the words to add- Returns:
this, to enable chainedaddoraddAllcalls
-
addAll
@SafeVarargs public final SampleSetEQOracle<I,D> addAll(DefaultQuery<I,D>... newTestQueries)
Adds queries to the sample set. These must beDefaultQuerys, which allow for retrieving the corresponding (expected) output.- Parameters:
newTestQueries- the queries to add to the sample set- Returns:
this, to enable chainedaddoraddAllcalls
-
addAll
public SampleSetEQOracle<I,D> addAll(Collection<? extends DefaultQuery<I,D>> newTestQueries)
Adds queries to the sample set. These must beDefaultQuerys, which allow for retrieving the corresponding (expected) output.- Parameters:
newTestQueries- the queries to add to the sample set- Returns:
this, to enable chainedaddoraddAllcalls
-
findCounterExample
public @Nullable DefaultQuery<I,D> findCounterExample(net.automatalib.automaton.concept.SuffixOutput<I,D> hypothesis, Collection<? extends I> inputs)
- Specified by:
findCounterExamplein interfaceEquivalenceOracle<net.automatalib.automaton.concept.SuffixOutput<I,D>,I,D>
-
-