diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/AbstractOptimalLStar.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/AbstractOptimalLStar.java index 12bc8afac..afe211173 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/AbstractOptimalLStar.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/AbstractOptimalLStar.java @@ -35,17 +35,15 @@ import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; import net.automatalib.automaton.concept.FiniteRepresentation; -import net.automatalib.automaton.concept.InputAlphabetHolder; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.word.Word; abstract class AbstractOptimalLStar, I, D> implements LearningAlgorithm, - InputAlphabetHolder, SupportsGrowingAlphabet, Resumable>, FiniteRepresentation { - private final Alphabet alphabet; + final Alphabet alphabet; final MembershipOracle mqs; final MembershipOracle ceqs; @@ -109,11 +107,6 @@ public boolean refineHypothesis(DefaultQuery counterexample) { return refined; } - @Override - public Alphabet getInputAlphabet() { - return alphabet; - } - private void initTable() { Word epsilon = Word.epsilon(); List rowData = initRow(epsilon); diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java index e3d4ae235..73df098e7 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java @@ -53,9 +53,7 @@ boolean symbolInconsistency(Word u1, Word u2, I a) { @Override void automatonFromTable() { - Alphabet alphabet = getInputAlphabet(); - - this.hypothesis = new CompactDFA<>(alphabet); + this.hypothesis = new CompactDFA<>(super.alphabet); Map, Integer> stateMap = new HashMap<>(); List rowData = getRow(Word.epsilon()); Integer q = this.hypothesis.addInitialState(rowData.get(0)); @@ -78,7 +76,7 @@ void automatonFromTable() { hypStateMap.put(state, sig); Word u = getShortPrefixes(sig).get(0); - for (I a : alphabet) { + for (I a : super.alphabet) { List dstData = getRow(u.append(a)); assert dstData != null; Integer dst = stateMap.get(dstData); diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java index 6a80fab61..14c589600 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java @@ -79,9 +79,7 @@ boolean symbolInconsistency(Word u1, Word u2, I a) { @Override void automatonFromTable() { - Alphabet alphabet = getInputAlphabet(); - - this.hypothesis = new CompactMealy<>(alphabet); + this.hypothesis = new CompactMealy<>(super.alphabet); Map>, Integer> stateMap = new HashMap<>(); List> rowData = getRow(Word.epsilon()); Integer q = this.hypothesis.addInitialState(); @@ -104,7 +102,7 @@ void automatonFromTable() { hypStateMap.put(state, sig); Word u = getShortPrefixes(sig).get(0); - for (I a : alphabet) { + for (I a : super.alphabet) { Word ua = u.append(a); List> destData = getRow(ua); assert destData != null; diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java index 3de43586f..17959e9d5 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java @@ -31,12 +31,11 @@ import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.concept.InputAlphabetHolder; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.word.Word; public abstract class AbstractOptimalTTT, I, D> - implements LearningAlgorithm, SupportsGrowingAlphabet, InputAlphabetHolder { + implements LearningAlgorithm, SupportsGrowingAlphabet { private final MembershipOracle ceqs; private final Alphabet alphabet; @@ -115,11 +114,6 @@ public void addAlphabetSymbol(I symbol) { } } - @Override - public Alphabet getInputAlphabet() { - return this.alphabet; - } - private void makeConsistent() { while (dtree().makeConsistent()) { // do nothing ...