& InputAlphabetHolder> DefaultSSTLearningExample(A automaton) {
+ this(automaton.getInputAlphabet(), automaton);
+ }
+
+ public DefaultSSTLearningExample(Alphabet alphabet, SubsequentialTransducer, I, ?, D> referenceAutomaton) {
+ super(alphabet, referenceAutomaton);
+ }
+ }
+
}
diff --git a/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExample.java b/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExample.java
index d4f6f8eb8f..fba1430398 100644
--- a/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExample.java
+++ b/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExample.java
@@ -19,6 +19,7 @@
import net.automatalib.automata.fsa.DFA;
import net.automatalib.automata.transducers.MealyMachine;
import net.automatalib.automata.transducers.StateLocalInputMealyMachine;
+import net.automatalib.automata.transducers.SubsequentialTransducer;
import net.automatalib.words.Alphabet;
public interface LearningExample> {
@@ -31,6 +32,8 @@ interface DFALearningExample extends LearningExample> {}
interface MealyLearningExample extends LearningExample> {}
+ interface SSTLearningExample extends LearningExample> {}
+
/**
* A {@link LearningExample} refinement for {@link StateLocalInputMealyMachine}.
*
diff --git a/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExamples.java b/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExamples.java
index 1a4fb3ef82..54fef25a22 100644
--- a/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExamples.java
+++ b/test-support/learning-examples/src/main/java/de/learnlib/examples/LearningExamples.java
@@ -16,12 +16,14 @@
package de.learnlib.examples;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import de.learnlib.examples.LearningExample.DFALearningExample;
import de.learnlib.examples.LearningExample.MealyLearningExample;
+import de.learnlib.examples.LearningExample.SSTLearningExample;
import de.learnlib.examples.LearningExample.StateLocalInputMealyLearningExample;
import de.learnlib.examples.dfa.ExampleAngluin;
import de.learnlib.examples.dfa.ExampleKeylock;
@@ -34,7 +36,9 @@
import de.learnlib.examples.mealy.ExampleShahbazGroz;
import de.learnlib.examples.mealy.ExampleStack;
import de.learnlib.examples.mealy.ExampleTinyMealy;
+import de.learnlib.examples.sst.ExampleRandomSST;
import net.automatalib.words.Alphabet;
+import net.automatalib.words.Word;
import net.automatalib.words.impl.Alphabets;
public final class LearningExamples {
@@ -44,6 +48,8 @@ public final class LearningExamples {
private static final int GRID_XSIZE = 5;
private static final int GRID_YSIZE = 5;
private static final String[] RANDOM_MEALY_OUTPUTS = {"o1", "o2", "o3"};
+ private static final Collection> RANDOM_SST_PROPS =
+ Arrays.asList(Word.fromCharSequence("ab"), Word.fromCharSequence("bc"), Word.fromCharSequence("ca"));
private static final String UNDEFINED_MEALY_OUTPUT = "undefined";
private static final int KEYLOCK_SIZE = 100;
private static final long RANDOM_SEED = 1337L;
@@ -80,4 +86,12 @@ public static List> createDFAExamples() {
RANDOM_MEALY_OUTPUTS));
}
+ public static List> createSSTExamples() {
+ return Collections.singletonList(ExampleRandomSST.createExample(new Random(RANDOM_SEED),
+ RANDOM_ALPHABET,
+ RANDOM_SIZE,
+ RANDOM_SST_PROPS,
+ RANDOM_SST_PROPS));
+ }
+
}
diff --git a/test-support/learning-examples/src/main/java/de/learnlib/examples/sst/ExampleRandomSST.java b/test-support/learning-examples/src/main/java/de/learnlib/examples/sst/ExampleRandomSST.java
new file mode 100644
index 0000000000..5c69d93d26
--- /dev/null
+++ b/test-support/learning-examples/src/main/java/de/learnlib/examples/sst/ExampleRandomSST.java
@@ -0,0 +1,57 @@
+/* Copyright (C) 2013-2020 TU Dortmund
+ * This file is part of LearnLib, http://www.learnlib.de/.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package de.learnlib.examples.sst;
+
+import java.util.Collection;
+import java.util.Random;
+
+import de.learnlib.examples.DefaultLearningExample.DefaultSSTLearningExample;
+import net.automatalib.automata.transducers.impl.compact.CompactSST;
+import net.automatalib.util.automata.random.RandomAutomata;
+import net.automatalib.words.Alphabet;
+import net.automatalib.words.Word;
+
+public class ExampleRandomSST extends DefaultSSTLearningExample {
+
+ public ExampleRandomSST(Alphabet alphabet,
+ int size,
+ Collection> stateProperties,
+ Collection> transitionProperties) {
+ this(new Random(), alphabet, size, stateProperties, transitionProperties);
+ }
+
+ public ExampleRandomSST(Random random,
+ Alphabet alphabet,
+ int size,
+ Collection> stateProperties,
+ Collection> transitionProperties) {
+ super(alphabet,
+ RandomAutomata.randomDeterministic(random,
+ size,
+ alphabet,
+ stateProperties,
+ transitionProperties,
+ new CompactSST<>(alphabet)));
+ }
+
+ public static ExampleRandomSST createExample(Random random,
+ Alphabet alphabet,
+ int size,
+ Collection> stateProperties,
+ Collection> transitionProperties) {
+ return new ExampleRandomSST<>(random, alphabet, size, stateProperties, transitionProperties);
+ }
+}