From 66b6cf194b4833bc54fb410187fbbe22725826f5 Mon Sep 17 00:00:00 2001 From: Markus Frohme Date: Tue, 6 Feb 2024 17:20:13 +0100 Subject: [PATCH] initial fixes javadoc --- .../de/learnlib/algorithm/adt/adt/ADT.java | 2 + .../algorithm/kv/dfa/KearnsVaziraniDFA.java | 4 + .../lstar/AbstractAutomatonLStar.java | 8 +- .../algorithm/lstar/AbstractLStar.java | 7 +- .../lstar/closing/ClosingStrategy.java | 4 + .../lstar/dfa/ExtensibleLStarDFA.java | 12 ++- .../observationpack/dfa/OPLearnerDFA.java | 2 + .../observationpack/hypothesis/HState.java | 3 - .../observationpack/mealy/OPLearnerMealy.java | 2 + .../ttt/base/AbstractTTTLearner.java | 12 +++ .../learnlib/algorithm/ttt/base/TTTState.java | 3 - .../de/learnlib/oracle/PropertyOracle.java | 39 ++++++---- .../java/de/learnlib/query/AbstractQuery.java | 3 + .../learnlib/acex/AcexAnalysisAlgorithms.java | 8 ++ .../counterexample/AcexLocalSuffixFinder.java | 2 + .../counterexample/GlobalSuffixFinders.java | 74 ++++++++++++++++-- .../counterexample/LocalSuffixFinders.java | 12 +++ .../DiscriminationTreeIterators.java | 20 +++-- .../MutableObservationTable.java | 4 +- .../observationtable/ObservationTable.java | 21 +++-- .../pta/config/ProcessingOrder.java | 3 + .../learnlib/filter/cache/dfa/DFACaches.java | 12 +-- .../filter/cache/mealy/MealyCaches.java | 32 ++++++++ .../filter/cache/moore/MooreCaches.java | 20 +++++ .../learnlib/filter/cache/sul/SULCaches.java | 20 +++++ .../de/learnlib/filter/reuse/ReuseOracle.java | 23 ++++++ .../learnlib/filter/reuse/tree/ReuseNode.java | 26 +++++-- .../learnlib/filter/reuse/tree/ReuseTree.java | 21 ++++- .../filter/reuse/tree/SystemStateHandler.java | 4 +- .../membership/AbstractSULOmegaOracle.java | 77 ++++++++++++------- pom.xml | 15 ++++ .../it/learner/AbstractDFALearnerIT.java | 2 + .../learner/AbstractDFAPassiveLearnerIT.java | 2 + .../it/learner/AbstractMealyLearnerIT.java | 4 + .../AbstractMealyPassiveLearnerIT.java | 4 + .../it/learner/AbstractMealySymLearnerIT.java | 4 + .../it/learner/AbstractMooreLearnerIT.java | 4 + .../AbstractMoorePassiveLearnerIT.java | 4 + .../it/learner/AbstractMooreSymLearnerIT.java | 4 + .../it/learner/AbstractOneSEVPALearnerIT.java | 2 + .../it/learner/AbstractSBALearnerIT.java | 2 + .../it/learner/AbstractSPALearnerIT.java | 2 + .../it/learner/AbstractSPMMLearnerIT.java | 4 + .../learner/AbstractSSTPassiveLearnerIT.java | 4 + .../testsupport/it/learner/LearnerITUtil.java | 62 +++++++++++++++ .../example/mealy/ExampleCoffeeMachine.java | 9 +++ .../example/mealy/ExampleGrid.java | 6 ++ .../example/mealy/ExampleShahbazGroz.java | 9 +++ .../example/mealy/ExampleStack.java | 9 +++ 49 files changed, 546 insertions(+), 86 deletions(-) diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADT.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADT.java index 73b5cb5688..4a9e202ec9 100644 --- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADT.java +++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADT.java @@ -96,6 +96,8 @@ public void replaceNode(ADTNode oldNode, ADTNode newNode) { /** * Successively sifts a word through the ADT induced by the given node. Stops when reaching a leaf. * + * @param oracle + * the oracle to query with inner node symbols * @param word * the word to sift * @param subtree diff --git a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java index 0bab4e3f0d..9f28ffc897 100644 --- a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java +++ b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java @@ -72,6 +72,10 @@ public class KearnsVaziraniDFA * the learning alphabet * @param oracle * the membership oracle + * @param repeatedCounterexampleEvaluation + * a flag whether counterexamples should be analyzed exhaustively + * @param counterexampleAnalyzer + * the counterexample analyzer */ @GenerateBuilder(defaults = BuilderDefaults.class) public KearnsVaziraniDFA(Alphabet alphabet, diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractAutomatonLStar.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractAutomatonLStar.java index aac4f3e555..ca8a875654 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractAutomatonLStar.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractAutomatonLStar.java @@ -63,6 +63,8 @@ public abstract class AbstractAutomatonLStar alphabet, MembershipOracle oracle, AI internalHyp) { super(alphabet, oracle); @@ -159,9 +161,11 @@ protected void setTransition(S from, I input, S to, Row fromRow, int inputIdx /** * Derives a transition property from the corresponding transition. *

- * N.B.: Not the transition row is passed to this method, but the row for the outgoing state. The transition row can - * be retrieved using {@link Row#getSuccessor(int)}. + * Note that not the transition row is passed to this method, but the row for the outgoing state. The transition row + * can be retrieved using {@link Row#getSuccessor(int)}. * + * @param table + * the observation table * @param stateRow * the row for the source state * @param inputIdx diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java index 9a4a66ab2f..666faa4b6b 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java @@ -122,11 +122,16 @@ protected List> initialPrefixes() { protected abstract List> initialSuffixes(); /** - * Iteratedly checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof. This + * Iteratively checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof. This * process is repeated until the observation table is both closed and consistent. * * @param unclosed * the unclosed rows (equivalence classes) to start with. + * @param checkConsistency + * a flag indicating whether consistency should be checked as well. If {@code false}, only closedness is + * ensured. + * + * @return {@code true} if unclosed rows have been closed, {@code false} otherwise */ protected boolean completeConsistentTable(List>> unclosed, boolean checkConsistency) { boolean refined = false; diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/closing/ClosingStrategy.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/closing/ClosingStrategy.java index d939d210de..8feada767e 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/closing/ClosingStrategy.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/closing/ClosingStrategy.java @@ -44,6 +44,10 @@ public interface ClosingStrategy { * the observation table * @param oracle * the membership oracle + * @param + * the (concrete) row input type + * @param + * the (concrete) row output type * * @return a selection of representative rows to be closed. */ diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java index 6bb5b85f78..620ef2bcb8 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java @@ -38,7 +38,7 @@ * Queries and Counterexamples". * * @param - * input symbol class. + * input symbol type */ public class ExtensibleLStarDFA extends AbstractExtensibleAutomatonLStar, I, Boolean, Integer, Integer, Boolean, Void, CompactDFA> @@ -48,9 +48,15 @@ public class ExtensibleLStarDFA * Constructor. * * @param alphabet - * the learning alphabet. + * the learning alphabet * @param oracle - * the DFA oracle. + * the DFA oracle + * @param initialSuffixes + * the list of initial suffixes used in the observation table + * @param cexHandler + * the strategy for handling counterexamples + * @param closingStrategy + * the strategy for closing open rows of the observation table */ public ExtensibleLStarDFA(Alphabet alphabet, MembershipOracle oracle, diff --git a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/dfa/OPLearnerDFA.java b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/dfa/OPLearnerDFA.java index 24a8eb43dd..d28ae4cbde 100644 --- a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/dfa/OPLearnerDFA.java +++ b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/dfa/OPLearnerDFA.java @@ -48,6 +48,8 @@ public class OPLearnerDFA extends AbstractOPLearner, I, Boolean, Bo * the membership oracle * @param suffixFinder * method to use for analyzing counterexamples + * @param repeatedCounterexampleEvaluation + * a flag whether counterexamples should be analyzed exhaustively * @param epsilonRoot * whether to ensure the root of the discrimination tree is always labeled using the empty word. */ diff --git a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/HState.java b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/HState.java index 47b09e5dba..f61aeb6615 100644 --- a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/HState.java +++ b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/HState.java @@ -114,9 +114,6 @@ public void fetchNonTreeIncoming(Collection> t nonTreeIncoming.clear(); } - /** - * See {@link ResizingArrayStorage#ensureCapacity(int)}. - */ public boolean ensureInputCapacity(int capacity) { return this.transitions.ensureCapacity(capacity); } diff --git a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/mealy/OPLearnerMealy.java b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/mealy/OPLearnerMealy.java index 5ad99f17c0..261290b737 100644 --- a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/mealy/OPLearnerMealy.java +++ b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/mealy/OPLearnerMealy.java @@ -50,6 +50,8 @@ public class OPLearnerMealy extends AbstractOPLearner alphabet, diff --git a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java index e82c900854..31e91c1212 100644 --- a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java +++ b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java @@ -51,8 +51,12 @@ /** * The TTT learning algorithm for generic automata. * + * @param + * hypothesis automaton type * @param * input symbol type + * @param + * output domain type */ @SuppressWarnings("PMD.ExcessiveClassLength") public abstract class AbstractTTTLearner @@ -116,6 +120,10 @@ private static void markAndPropagate(AbstractBaseDTNode node, D lab * the old node * @param label * the label to consider + * @param + * input symbol type + * @param + * output domain type */ private static void moveIncoming(AbstractBaseDTNode newNode, AbstractBaseDTNode oldNode, @@ -130,6 +138,10 @@ private static void moveIncoming(AbstractBaseDTNode newNode, * the node in the discrimination tree * @param state * the state in the hypothesis + * @param + * input symbol type + * @param + * output domain type */ protected static void link(AbstractBaseDTNode dtNode, TTTState state) { assert dtNode.isLeaf(); diff --git a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/TTTState.java b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/TTTState.java index 1613a8ad04..df5e894ec3 100644 --- a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/TTTState.java +++ b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/TTTState.java @@ -87,9 +87,6 @@ public TTTTransition[] getTransitions() { return transitions.array; } - /** - * See {@link ResizingArrayStorage#ensureCapacity(int)}. - */ public boolean ensureInputCapacity(int capacity) { return this.transitions.ensureCapacity(capacity); } diff --git a/api/src/main/java/de/learnlib/oracle/PropertyOracle.java b/api/src/main/java/de/learnlib/oracle/PropertyOracle.java index cd936cf984..c53e6d2364 100644 --- a/api/src/main/java/de/learnlib/oracle/PropertyOracle.java +++ b/api/src/main/java/de/learnlib/oracle/PropertyOracle.java @@ -56,7 +56,8 @@ default boolean isDisproved() { /** * Set the property. * - * @param property the property to set. + * @param property + * the property to set */ void setProperty(P property); @@ -65,13 +66,14 @@ default boolean isDisproved() { * * @return the property. */ - @Pure P getProperty(); + @Pure + P getProperty(); /** * Returns the counterexample for the property if {@link #isDisproved()}, {@code null} otherwise. *

- * If this method does not return {@code null}, a previous call to {@link #disprove(Output, Collection)} must - * have returned a {@link DefaultQuery}. + * If this method does not return {@code null}, a previous call to {@link #disprove(Output, Collection)} must have + * returned a {@link DefaultQuery}. * * @return the counterexample for the property if {@link #isDisproved()}, {@code null} otherwise. */ @@ -80,22 +82,26 @@ default boolean isDisproved() { /** * Try to disprove the property with the given {@code hypothesis}. * - * @param hypothesis the hypothesis. - * @param inputs the inputs + * @param hypothesis + * the hypothesis + * @param inputs + * the inputs * - * @return the {@link DefaultQuery} that is a counterexample the property, or {@code null}, if the property - * could not be disproved. + * @return the {@link DefaultQuery} that is a counterexample the property, or {@code null}, if the property could + * not be disproved. */ @Nullable DefaultQuery disprove(A hypothesis, Collection inputs); /** * Try to find a counterexample to the given {@code hypothesis} if the property can not be disproved. * - * @param hypothesis the hypothesis to find a counterexample to. - * @param inputs the input alphabet. + * @param hypothesis + * the hypothesis to find a counterexample to + * @param inputs + * the input symbols to consider for finding a counterexample * - * @return the {@link DefaultQuery} that is a counterexample to the given {@code hypothesis}, or {@code - * null}, a counterexample could not be found or the property could be disproved. + * @return the {@link DefaultQuery} that is a counterexample to the given {@code hypothesis}, or {@code null}, a + * counterexample could not be found or the property could be disproved. */ @Override default @Nullable DefaultQuery findCounterExample(A hypothesis, Collection inputs) { @@ -103,9 +109,16 @@ default boolean isDisproved() { } /** - * Unconditionally find a counterexample, i.e. regardless of whether the property can be disproved. In fact, + * Unconditionally find a counterexample, i.e., regardless of whether the property can be disproved. In fact, * {@link #disprove(Output, Collection)} is not even be called. * + * @param hypothesis + * the hypothesis to find a counterexample to + * @param inputs + * the input symbols to consider for finding a counterexample + * + * @return a counterexample for the current hypothesis. May be {@code null} of none can be found + * * @see #findCounterExample(Output, Collection) */ @Nullable DefaultQuery doFindCounterExample(A hypothesis, Collection inputs); diff --git a/api/src/main/java/de/learnlib/query/AbstractQuery.java b/api/src/main/java/de/learnlib/query/AbstractQuery.java index 65b2683db9..9287351920 100644 --- a/api/src/main/java/de/learnlib/query/AbstractQuery.java +++ b/api/src/main/java/de/learnlib/query/AbstractQuery.java @@ -49,6 +49,9 @@ public Word getSuffix() { * Returns the string representation of this query, including a possible answer. This method should be used by * classes extending {@link AbstractQuery} for their toString method to ensure output consistency. * + * @param answer + * the output object to render as answer + * * @return A string of the form {@code "Query[| / ]"}. If the query has not been answered * yet, {@code } will be null. */ diff --git a/commons/counterexamples/src/main/java/de/learnlib/acex/AcexAnalysisAlgorithms.java b/commons/counterexamples/src/main/java/de/learnlib/acex/AcexAnalysisAlgorithms.java index 0dea62d0c2..7a3637a6c5 100644 --- a/commons/counterexamples/src/main/java/de/learnlib/acex/AcexAnalysisAlgorithms.java +++ b/commons/counterexamples/src/main/java/de/learnlib/acex/AcexAnalysisAlgorithms.java @@ -30,6 +30,8 @@ private AcexAnalysisAlgorithms() { * the lower bound of the search range * @param high * the upper bound of the search range + * @param + * the effect type * * @return an index i such that acex.testEffect(i) != acex.testEffect(i+1) */ @@ -56,6 +58,8 @@ public static int linearSearchFwd(AbstractCounterexample acex, int low, i * the lower bound of the search range * @param high * the upper bound of the search range + * @param + * the effect type * * @return an index i such that acex.testEffect(i) != acex.testEffect(i+1) */ @@ -82,6 +86,8 @@ public static int linearSearchBwd(AbstractCounterexample acex, int low, i * the lower bound of the search range * @param high * the upper bound of the search range + * @param + * the effect type * * @return an index i such that acex.testEffect(i) != acex.testEffect(i+1) */ @@ -117,6 +123,8 @@ public static int exponentialSearchBwd(AbstractCounterexample acex, int l * the lower bound of the search range * @param high * the upper bound of the search range + * @param + * the effect type * * @return an index i such that acex.testEffect(i) != acex.testEffect(i+1) */ diff --git a/commons/counterexamples/src/main/java/de/learnlib/counterexample/AcexLocalSuffixFinder.java b/commons/counterexamples/src/main/java/de/learnlib/counterexample/AcexLocalSuffixFinder.java index f88c0b7cce..94f70c79d5 100644 --- a/commons/counterexamples/src/main/java/de/learnlib/counterexample/AcexLocalSuffixFinder.java +++ b/commons/counterexamples/src/main/java/de/learnlib/counterexample/AcexLocalSuffixFinder.java @@ -43,6 +43,8 @@ public class AcexLocalSuffixFinder implements LocalSuffixFinder<@Nullable Object * the analyzer to be wrapped * @param reduce * whether to reduce counterexamples + * @param name + * the display name of the suffix finder */ public AcexLocalSuffixFinder(AcexAnalyzer analyzer, boolean reduce, String name) { this.analyzer = analyzer; diff --git a/commons/counterexamples/src/main/java/de/learnlib/counterexample/GlobalSuffixFinders.java b/commons/counterexamples/src/main/java/de/learnlib/counterexample/GlobalSuffixFinders.java index d40c5fcbe4..99eb6fa78d 100644 --- a/commons/counterexamples/src/main/java/de/learnlib/counterexample/GlobalSuffixFinders.java +++ b/commons/counterexamples/src/main/java/de/learnlib/counterexample/GlobalSuffixFinders.java @@ -133,6 +133,15 @@ private GlobalSuffixFinders() { * Transforms a {@link LocalSuffixFinder} into a global one. This is a convenience method, behaving like {@link * #fromLocalFinder(LocalSuffixFinder, boolean)}. * + * @param localFinder + * the local finder to transform + * @param + * input symbol type + * @param + * output domain type + * + * @return the transformed global suffix finder + * * @see #fromLocalFinder(LocalSuffixFinder, boolean) */ public static GlobalSuffixFinder fromLocalFinder(LocalSuffixFinder localFinder) { @@ -153,6 +162,10 @@ public static GlobalSuffixFinder fromLocalFinder(LocalSuffixFinder< * the local suffix finder * @param allSuffixes * whether all suffixes of the found local suffix should be added + * @param + * input symbol type + * @param + * output domain type * * @return a global suffix finder using the analysis method from the specified local suffix finder */ @@ -180,6 +193,17 @@ public String toString() { /** * Transforms a suffix index returned by a {@link LocalSuffixFinder} into a list containing the single * distinguishing suffix. + * + * @param ceQuery + * the counterexample + * @param localSuffixIdx + * the (local) suffix index + * @param + * input symbol type + * @param + * output domain type + * + * @return the (singleton) list of the distinguishing suffix */ public static List> suffixesForLocalOutput(Query ceQuery, int localSuffixIdx) { return suffixesForLocalOutput(ceQuery, localSuffixIdx, false); @@ -188,13 +212,29 @@ public static List> suffixesForLocalOutput(Query ceQuery, i /** * Transforms a suffix index returned by a {@link LocalSuffixFinder} into a list of distinguishing suffixes. This * list always contains the corresponding local suffix. Since local suffix finders only return a single suffix, - * suffix-closedness of the set of distinguishing suffixes might not be preserved. Note that for correctly - * implemented local suffix finders, this does not impair correctness of the learning algorithm. However, without - * suffix closedness, intermediate hypothesis models might be non-canonical, if no additional precautions are taken. - * For that reasons, the {@code allSuffixes} parameter can be specified to control whether the list returned by + * suffix-closedness of the set of distinguishing suffixes might not be preserved. + *

+ * Note that for correctly implemented local suffix finders, this does not impair correctness of the learning + * algorithm. However, without suffix closedness, intermediate hypothesis models might be non-canonical, if no + * additional precautions are taken. For that reasons, the {@code allSuffixes} parameter can be specified to control + * whether the list returned by * {@link GlobalSuffixFinder#findSuffixes(Query, AccessSequenceTransformer, SuffixOutput, MembershipOracle)} of the * returned global suffix finder should not only contain the single suffix, but also all of its suffixes, ensuring * suffix-closedness. + * + * @param ceQuery + * the counterexample + * @param localSuffixIdx + * the (local) suffix index + * @param allSuffixes + * a flag indicating whether all suffixes of the distinguishing suffix should be included in the returned + * list + * @param + * input symbol type + * @param + * output domain type + * + * @return the list of distinguishing suffixes */ public static List> suffixesForLocalOutput(Query ceQuery, int localSuffixIdx, @@ -218,6 +258,10 @@ public static List> suffixesForLocalOutput(Query ceQuery, * * @param ceQuery * the counterexample query + * @param + * input symbol type + * @param + * output domain type * * @return all suffixes of the counterexample input */ @@ -233,6 +277,10 @@ public static List> findMalerPnueli(Query ceQuery) { * the counterexample query * @param asTransformer * the access sequence transformer + * @param + * input symbol type + * @param + * output domain type * * @return all suffixes from the counterexample after stripping a maximal one-letter extension of an access * sequence. @@ -270,6 +318,10 @@ public static List> findShahbaz(Query ceQuery, AccessSequen * interface to the SUL output * @param allSuffixes * whether to include all suffixes of the found suffix + * @param + * input symbol type + * @param + * output domain type * * @return the distinguishing suffixes * @@ -298,6 +350,10 @@ public static List> findLinear(Query ceQuery, * interface to the SUL output * @param allSuffixes * whether to include all suffixes of the found suffix + * @param + * input symbol type + * @param + * output domain type * * @return the distinguishing suffixes * @@ -326,15 +382,19 @@ public static List> findLinearReverse(Query ceQuery, * interface to the SUL output * @param allSuffixes * whether to include all suffixes of the found suffix + * @param + * input symbol type + * @param + * output domain type * * @return the distinguishing suffixes * * @see LocalSuffixFinders#findRivestSchapire(Query, AccessSequenceTransformer, SuffixOutput, MembershipOracle) */ - public static List> findRivestSchapire(Query ceQuery, + public static List> findRivestSchapire(Query ceQuery, AccessSequenceTransformer asTransformer, - SuffixOutput hypOutput, - MembershipOracle oracle, + SuffixOutput hypOutput, + MembershipOracle oracle, boolean allSuffixes) { int idx = LocalSuffixFinders.findRivestSchapire(ceQuery, asTransformer, hypOutput, oracle); return suffixesForLocalOutput(ceQuery, idx, allSuffixes); diff --git a/commons/counterexamples/src/main/java/de/learnlib/counterexample/LocalSuffixFinders.java b/commons/counterexamples/src/main/java/de/learnlib/counterexample/LocalSuffixFinders.java index 2cee16a53c..e19d2d5365 100644 --- a/commons/counterexamples/src/main/java/de/learnlib/counterexample/LocalSuffixFinders.java +++ b/commons/counterexamples/src/main/java/de/learnlib/counterexample/LocalSuffixFinders.java @@ -72,6 +72,10 @@ private LocalSuffixFinders() { * interface to the hypothesis output, for checking whether the oracle output contradicts the hypothesis * @param oracle * interface to the SUL + * @param + * input symbol type + * @param + * output domain type * * @return the index of the respective suffix, or {@code -1} if no counterexample could be found * @@ -102,6 +106,10 @@ public static int findLinear(Query ceQuery, * interface to the hypothesis output, for checking whether the oracle output contradicts the hypothesis * @param oracle * interface to the SUL + * @param + * input symbol type + * @param + * output domain type * * @return the index of the respective suffix, or {@code -1} if no counterexample could be found * @@ -132,6 +140,10 @@ public static int findLinearReverse(Query ceQuery, * interface to the hypothesis output, for checking whether the oracle output contradicts the hypothesis * @param oracle * interface to the SUL + * @param + * input symbol type + * @param + * output domain type * * @return the index of the respective suffix, or {@code -1} if no counterexample could be found * diff --git a/datastructures/discrimination-tree/src/main/java/de/learnlib/datastructure/discriminationtree/iterators/DiscriminationTreeIterators.java b/datastructures/discrimination-tree/src/main/java/de/learnlib/datastructure/discriminationtree/iterators/DiscriminationTreeIterators.java index 671a962ce1..d460fe437e 100644 --- a/datastructures/discrimination-tree/src/main/java/de/learnlib/datastructure/discriminationtree/iterators/DiscriminationTreeIterators.java +++ b/datastructures/discrimination-tree/src/main/java/de/learnlib/datastructure/discriminationtree/iterators/DiscriminationTreeIterators.java @@ -31,24 +31,28 @@ private DiscriminationTreeIterators() { } /** - * Iterator that traverses all nodes of a subtree of a given discrimination tree node. + * Returns an iterator that traverses all nodes of a subtree of a given discrimination tree node. * * @param root * the root node, from which traversal should start * @param * node type + * + * @return an iterator that traverses all nodes of a subtree of the given node */ public static > Iterator nodeIterator(N root) { return new NodeIterator<>(root); } /** - * Iterator that traverses all inner nodes (no leaves) of a subtree of a given discrimination tree node. + * Returns an iterator that traverses all inner nodes (no leaves) of a subtree of a given discrimination tree node. * * @param root * the root node, from which traversal should start * @param * node type + * + * @return an iterator that traverses all inner nodes of a subtree of the given node */ @SuppressWarnings("nullness") // lambda is only called with our non-null nodes as argument public static > Iterator innerNodeIterator(N root) { @@ -56,20 +60,22 @@ private DiscriminationTreeIterators() { } /** - * Iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node. + * Returns an iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node. * * @param root * the root node, from which traversal should start * @param * node type + * + * @return an iterator that traverses all leaf nodes of a subtree of the given node */ public static > Iterator leafIterator(N root) { return IteratorUtil.filter(nodeIterator(root), AbstractDTNode::isLeaf); } /** - * Iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node. - * Additionally, allows to specify a transformer that is applied to the leaf nodes + * Returns an iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node. + * Additionally, allows one to specify a transformer that is applied to the leaf nodes * * @param root * the root node, from which traversal should start @@ -77,6 +83,10 @@ private DiscriminationTreeIterators() { * the transformer that transforms iterated nodes * @param * node type + * @param + * transformation target data type + * + * @return an iterator that traverses all (transformed) leaf nodes of a subtree of the given node */ public static , D> Iterator transformingLeafIterator(N root, Function transformer) { diff --git a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/MutableObservationTable.java b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/MutableObservationTable.java index f9e385286b..cf05853c45 100644 --- a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/MutableObservationTable.java +++ b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/MutableObservationTable.java @@ -27,8 +27,10 @@ public interface MutableObservationTable extends ObservationTable { /** * Initializes an observation table using a specified set of suffixes. * + * @param initialShortPrefixes + * the set of initial row labels * @param initialSuffixes - * the set of initial column labels. + * the set of initial column labels * @param oracle * the {@link MembershipOracle} to use for performing queries * diff --git a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/ObservationTable.java b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/ObservationTable.java index 982e824a72..05f7da0ee7 100644 --- a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/ObservationTable.java +++ b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/ObservationTable.java @@ -208,12 +208,15 @@ default boolean isClosed() { } /** + * Returns a distinguishing suffix that distinguishes the two access sequences represented by the labels of the + * given rows. + * * @param row1 * the first row * @param row2 * the second row * - * @return the suffix distinguishing the contents of the two rows + * @return the suffix that distinguishes the two rows. {@code null} if no such suffix can be found. */ default @Nullable Word findDistinguishingSuffix(Row row1, Row row2) { int suffixIndex = findDistinguishingSuffixIndex(row1, row2); @@ -224,8 +227,13 @@ default boolean isClosed() { } /** - * @return the suffix (column) index where the contents of the rows differ, or {@code #NO_DISTINGUISHING_SUFFIX} if - * the contents of the rows are equal. + * Returns a suffix (column) index which uncovers an observation discrepancy described by a given inconsistency. + * + * @param inconsistency + * the inconsistency + * + * @return the suffix (column) index which exhibits the observation discrepancy described by a given inconsistency, + * or {@link #NO_DISTINGUISHING_SUFFIX} if no such index can be found. */ default @Signed int findDistinguishingSuffixIndex(Inconsistency inconsistency) { Row row1 = inconsistency.getFirstRow(); @@ -236,13 +244,16 @@ default boolean isClosed() { } /** + * Returns a suffix (column) index which uncovers an observation discrepancy between the two access sequences + * represented by the labels of the given rows. + * * @param row1 * the first row * @param row2 * the second row * - * @return the suffix (column) index where the contents of the rows differ, or {@code #NO_DISTINGUISHING_SUFFIX} if - * the contents of the rows are equal. + * @return the suffix (column) index which exhibits an observation discrepancy between the two given rows, or + * {@link #NO_DISTINGUISHING_SUFFIX} if no such index can be found. */ default @Signed int findDistinguishingSuffixIndex(Row row1, Row row2) { for (int i = 0; i < getSuffixes().size(); i++) { diff --git a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/config/ProcessingOrder.java b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/config/ProcessingOrder.java index 17ba2048de..fad90bdf06 100644 --- a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/config/ProcessingOrder.java +++ b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/config/ProcessingOrder.java @@ -37,6 +37,9 @@ public interface ProcessingOrder { /** * Creates a worklist for managing the set of blue states in the RPNI algorithm. * + * @param + * the (concrete) state type + * * @return a worklist with some specific ordering constraints */ > Queue> createWorklist(); diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACaches.java index 2387226f90..178286a02d 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACaches.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACaches.java @@ -44,6 +44,8 @@ private DFACaches() { * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type * * @return a Mealy learning cache with a default implementation */ @@ -57,7 +59,7 @@ public static DFACacheOracle createCache(Alphabet alphabet, Membership * @param alphabet * the alphabet containing the symbols of possible queries * @param mqOracle - * the oracle to delegate queries to, in case of a cache-miss. + * the oracle to delegate queries to, in case of a cache-miss * @param * input symbol type * @@ -75,7 +77,7 @@ public static DFACacheOracle createDAGCache(Alphabet alphabet, Members * @param alphabet * the alphabet containing the symbols of possible queries * @param mqOracle - * the oracle to delegate queries to, in case of a cache-miss. + * the oracle to delegate queries to, in case of a cache-miss * @param * input symbol type * @@ -93,7 +95,7 @@ public static DFACacheOracle createDAGPCCache(Alphabet alphabet, Membe * @param alphabet * the alphabet containing the symbols of possible queries * @param mqOracle - * the oracle to delegate queries to, in case of a cache-miss. + * the oracle to delegate queries to, in case of a cache-miss * @param * input symbol type * @@ -111,7 +113,7 @@ public static DFACacheOracle createTreeCache(Alphabet alphabet, Member * @param alphabet * the alphabet containing the symbols of possible queries * @param mqOracle - * the oracle to delegate queries to, in case of a cache-miss. + * the oracle to delegate queries to, in case of a cache-miss * @param * input symbol type * @@ -127,7 +129,7 @@ public static DFACacheOracle createTreePCCache(Alphabet alphabet, Memb * Creates a cache oracle for a DFA learning setup, using a {@link Map} for internal cache organization. * * @param mqOracle - * the oracle to delegate queries to, in case of a cache-miss. + * the oracle to delegate queries to, in case of a cache-miss * @param * input symbol type * diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java index f351848653..316e0f9e10 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/MealyCaches.java @@ -43,6 +43,10 @@ private MealyCaches() { * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a default implementation */ @@ -58,6 +62,10 @@ public static MealyCacheOracle createCache(Alphabet alphabet, * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a DAG-based implementation * @@ -77,6 +85,10 @@ public static MealyCacheOracle createDAGCache(Alphabet alphabet, * a mapping for the prefix-closure filter * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a DAG-based implementation * @@ -95,6 +107,10 @@ public static MealyCacheOracle createDAGCache(Alphabet alphabet, * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a tree-based implementation * @@ -114,6 +130,10 @@ public static MealyCacheOracle createTreeCache(Alphabet alphabet * a mapping for the prefix-closure filter * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a tree-based implementation * @@ -135,6 +155,10 @@ public static MealyCacheOracle createTreeCache(Alphabet alphabet * * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a tree-based implementation * @@ -156,6 +180,10 @@ public static MealyCacheOracle createDynamicTreeCache(MembershipOra * a mapping for the prefix-closure filter * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Mealy learning cache with a tree-based implementation * @@ -174,6 +202,10 @@ public static MealyCacheOracle createDynamicTreeCache(Mapping + * input symbol type + * @param + * output symbol type * * @return a symbol-based Mealy learning cache with a tree-based implementation */ diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/moore/MooreCaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/moore/MooreCaches.java index f620aa148e..f2ed1dd59d 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/moore/MooreCaches.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/moore/MooreCaches.java @@ -42,6 +42,10 @@ private MooreCaches() { * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Moore learning cache with a default implementation */ @@ -57,6 +61,10 @@ public static MooreCacheOracle createCache(Alphabet alphabet, * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Moore learning cache with a DAG-based implementation * @@ -76,6 +84,10 @@ public static MooreCacheOracle createDAGCache(Alphabet alphabet, * a mapping for the prefix-closure filter * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Moore learning cache with a DAG-based implementation * @@ -94,6 +106,10 @@ public static MooreCacheOracle createDAGCache(Alphabet alphabet, * the input alphabet * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Moore learning cache with a tree-based implementation * @@ -113,6 +129,10 @@ public static MooreCacheOracle createTreeCache(Alphabet alphabet * a mapping for the prefix-closure filter * @param mqOracle * the membership oracle + * @param + * input symbol type + * @param + * output symbol type * * @return a Moore learning cache with a tree-based implementation * diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/sul/SULCaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/SULCaches.java index b4f077dcde..3e82586dec 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/sul/SULCaches.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/SULCaches.java @@ -40,6 +40,10 @@ private SULCaches() { * the input alphabet * @param sul * the sul + * @param + * input symbol type + * @param + * output symbol type * * @return a {@link SULCache} with a default implementation */ @@ -54,6 +58,10 @@ public static SULCache createCache(Alphabet alphabet, SUL * the input alphabet * @param sul * the sul + * @param + * input symbol type + * @param + * output symbol type * * @return a {@link SULCache} with a DAG-based implementation * @@ -70,6 +78,10 @@ public static SULCache createDAGCache(Alphabet alphabet, SUL + * input symbol type + * @param + * output symbol type * * @return a {@link SULCache} with a tree-based implementation * @@ -89,6 +101,10 @@ public static SULCache createTreeCache(Alphabet alphabet, SUL + * input symbol type + * @param + * output symbol type * * @return a {@link StateLocalInputSULCache} with a default implementation */ @@ -105,6 +121,10 @@ public static StateLocalInputSULCache createStateLocalInputCache(Al * the input alphabet * @param sul * the sul + * @param + * input symbol type + * @param + * output symbol type * * @return a {@link StateLocalInputSULCache} with a tree-based implementation * diff --git a/filters/reuse/src/main/java/de/learnlib/filter/reuse/ReuseOracle.java b/filters/reuse/src/main/java/de/learnlib/filter/reuse/ReuseOracle.java index c1130d13c8..03280f1a8b 100644 --- a/filters/reuse/src/main/java/de/learnlib/filter/reuse/ReuseOracle.java +++ b/filters/reuse/src/main/java/de/learnlib/filter/reuse/ReuseOracle.java @@ -66,6 +66,25 @@ public final class ReuseOracle implements SingleQueryOracleMealy /** * Default constructor. + * + * @param alphabet + * the input alphabet of the system + * @param oracleSupplier + * a supplier for reusable oracles + * @param enabledSystemStateInvalidation + * a flag whether system states should be invalidated after retrieval + * @param systemStateHandler + * the handler for notification about system state removals + * @param invariantInputs + * the set of symbols that behave invariant + * @param failureOutputs + * the set of symbols of failed system outputs + * @param maxSystemStates + * the maximum number of stored system states + * @param accessPolicy + * the strategy for accessing elements + * @param evictPolicy + * the strategy for evicting elements of the capacity is reached */ @GenerateBuilder(defaults = BuilderDefaults.class, getterPrefix = GenerateBuilder.SUPPRESS, @@ -156,6 +175,8 @@ private Word processQuery(Word query) { /** * Returns the {@link ReuseCapableOracle} used by this instance. + * + * @return the oracle used by this instance */ public ReuseCapableOracle getReuseCapableOracle() { return executableOracles.get(); @@ -209,6 +230,8 @@ private QueryResult filterAndProcessQuery(Word query, /** * Returns the {@link ReuseTree} used by this instance. + * + * @return the reuse tree used by this instance */ public ReuseTree getReuseTree() { return this.tree; diff --git a/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseNode.java b/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseNode.java index da5d57e47e..3133aa71b8 100644 --- a/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseNode.java +++ b/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseNode.java @@ -24,7 +24,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; /** - * A {@link ReuseNode} is a vertex in the {@link ReuseTree} that contains (a possible empty) set of outgoing {@link + * A {@link ReuseNode} is a vertex in the {@link ReuseTree} that contains (a possibly empty) set of outgoing {@link * ReuseEdge}s. Each {@link ReuseNode} may contain a system state holding relevant information (e.g. database * identifiers or an object) that belongs to the system state that 'represents' the system state after executing a * membership query. @@ -54,7 +54,12 @@ public ReuseNode(int id, } /** - * The system state, may be {@code null}. + * Retrieve a system state. + * + * @param remove + * a flag whether the system state should be removed from the internal storage after retrieval + * + * @return a system state, May be {@code null}. */ public S fetchSystemState(boolean remove) { if (remove) { @@ -80,8 +85,9 @@ public void clearSystemStates() { } /** - * Returns all outgoing {@link ReuseEdge}s from this {@link ReuseNode}. If there are none the returned {@link - * java.util.Collection} will be empty (but never {@code null}). + * Returns all outgoing {@link ReuseEdge}s from this {@link ReuseNode}. + * + * @return the outgoing edges of this node */ public Collection<@Nullable ReuseEdge> getEdges() { return Arrays.asList(edges); @@ -89,6 +95,11 @@ public void clearSystemStates() { /** * Adds an outgoing {@link ReuseEdge} to this {@link ReuseNode}. + * + * @param index + * the position (index) of the edge to add + * @param edge + * the edge to add */ public void addEdge(int index, ReuseEdge edge) { this.edges[index] = edge; @@ -103,7 +114,12 @@ public void addEdge(int index, ReuseEdge edge) { } /** - * May be {@code null}. + * Return the edge with the given index. + * + * @param index + * the index of the edge + * + * @return the edge with the given index. May be {@code null}. */ public @Nullable ReuseEdge getEdgeWithInput(int index) { return this.edges[index]; diff --git a/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseTree.java b/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseTree.java index a2f3c5fa7e..afd760ccd7 100644 --- a/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseTree.java +++ b/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/ReuseTree.java @@ -242,12 +242,13 @@ public void clearTree() { } /** - * Returns a reuseable {@link ReuseNode.NodeResult} with system state or {@code null} if none such exists. If - * ''oldInvalidated'' was set to {@code true} (in the {@link ReuseOracle}) the system state is already removed from - * the tree whenever one was available. + * Returns a reusable {@link ReuseNode.NodeResult} with system state accessed by the given access sequence. or + * {@code null} if none such exists. * * @param query - * Not allowed to be {@code null}. + * the access sequence to the node + * + * @return the node accessed by the given query, {@code null} if no such node exists */ public ReuseNode.@Nullable NodeResult fetchSystemState(Word query) { if (query == null) { @@ -305,6 +306,11 @@ public void clearTree() { * This method should only be invoked internally from the {@link ReuseOracle} unless you know exactly what you are * doing (you may want to create a predefined reuse tree before start learning). * + * @param query + * the query determining a path in the tree + * @param queryResult + * the output that should be associated with the given path + * * @throws ReuseException * if non-deterministic behavior is detected */ @@ -325,6 +331,13 @@ public void insert(Word query, ReuseCapableOracle.QueryResult queryResu * This method should only be invoked internally from the {@link ReuseOracle} unless you know exactly what you are * doing (you may want to create a predefined reuse tree before start learning). * + * @param query + * the query determining a path in the tree + * @param sink + * the starting node of the path + * @param queryResult + * the output that should be associated with the given path + * * @throws ReuseException * if non-deterministic behavior is detected */ diff --git a/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/SystemStateHandler.java b/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/SystemStateHandler.java index 535f8fcf02..7b395e95a2 100644 --- a/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/SystemStateHandler.java +++ b/filters/reuse/src/main/java/de/learnlib/filter/reuse/tree/SystemStateHandler.java @@ -22,8 +22,8 @@ * {@link ReuseOracleBuilder#withSystemStateHandler(SystemStateHandler)}) will be informed about all removed system * states whenever {@link ReuseTree#disposeSystemStates()} gets called. *

- * The objective of this handler is that clearing system states from the reuse tree may also be resulting in cleaning up - * the SUL by e.g. perform tasks like removing persisted entities from a database. + * The objective of this handler is that clearing system states from the reuse tree may also result in cleaning up the + * SUL by e.g. perform tasks like removing persisted entities from a database. *

* Please note that the normal removal of system states (by sifting them down in the reuse tree by executing only * suffixes of a query) is not be seen as a disposing. diff --git a/oracles/membership-oracles/src/main/java/de/learnlib/oracle/membership/AbstractSULOmegaOracle.java b/oracles/membership-oracles/src/main/java/de/learnlib/oracle/membership/AbstractSULOmegaOracle.java index 0815cde9f7..913ab05c73 100644 --- a/oracles/membership-oracles/src/main/java/de/learnlib/oracle/membership/AbstractSULOmegaOracle.java +++ b/oracles/membership-oracles/src/main/java/de/learnlib/oracle/membership/AbstractSULOmegaOracle.java @@ -99,7 +99,7 @@ public void processQueries(Collection>> queries) final Q nextState = getQueryState(sul); int prefixLength = prefix.length(); - for (Q q: states) { + for (Q q : states) { if (isSameState(inputBuilder.toWord(), nextState, inputBuilder.toWord(0, prefixLength), q)) { return Pair.of(outputBuilder.toWord(), i + 1); } @@ -123,12 +123,16 @@ public MealyMembershipOracle getMembershipOracle() { * Creates a new {@link AbstractSULOmegaOracle}, while making sure the invariants of the {@link ObservableSUL} are * satisfied. * - * @param sul the {@link ObservableSUL} to wrap around. - * @param deepCopies whether to test for state equivalence directly on the retrieved state. - * - * @param the state type - * @param the input type - * @param the output type + * @param sul + * the {@link ObservableSUL} to wrap around. + * @param deepCopies + * whether to test for state equivalence directly on the retrieved state. + * @param + * the state type + * @param + * the input type + * @param + * the output type * * @return the {@link AbstractSULOmegaOracle}. */ @@ -155,11 +159,18 @@ public MealyMembershipOracle getMembershipOracle() { /** * Creates a new {@link AbstractSULOmegaOracle} that assumes the {@link SUL} can not make deep copies. * - * @see #newOracle(ObservableSUL, boolean) + * @param sul + * the sul to delegate queris to + * @param + * the state type + * @param + * the input type + * @param + * the output type * - * @param the state type - * @param the input type - * @param the output type + * @return the new oracle + * + * @see #newOracle(ObservableSUL, boolean) */ public static AbstractSULOmegaOracle newOracle(ObservableSUL sul) { return newOracle(sul, !sul.canFork()); @@ -173,9 +184,12 @@ public MealyMembershipOracle getMembershipOracle() { * The state information used to answer {@link OmegaQuery}s is of type {@link Integer}. The values of those integers * are actually hash codes of states of the {@link ObservableSUL}. * - * @param the state type - * @param the input type - * @param the output type + * @param + * the state type + * @param + * the input type + * @param + * the output type */ private static final class ShallowCopySULOmegaOracle extends AbstractSULOmegaOracle { @@ -187,10 +201,11 @@ private static final class ShallowCopySULOmegaOracle /** * Constructs a new {@link ShallowCopySULOmegaOracle}, use {@link #newOracle(ObservableSUL)} to create an - * instance. This method makes sure the invariants of the {@link ObservableSUL} are satisfied (i.e., the {@link - * ObservableSUL} must be forkable, i.e. ({@code {@link SUL#canFork()} == true}). + * instance. This method makes sure the invariants of the {@link ObservableSUL} are satisfied (i.e., the + * {@link ObservableSUL} must be forkable, i.e. ({@code {@link SUL#canFork()} == true}). * - * @param sul the SUL + * @param sul + * the SUL */ ShallowCopySULOmegaOracle(ObservableSUL sul) { super(sul); @@ -201,7 +216,8 @@ private static final class ShallowCopySULOmegaOracle /** * Returns the state as a hash code. * - * @param sul the {@link ObservableSUL} to retrieve the current state from. + * @param sul + * the {@link ObservableSUL} to retrieve the current state from. * * @return the hash code of the state. */ @@ -213,11 +229,13 @@ protected Integer getQueryState(ObservableSUL sul) { /** * Test for state equivalence, by means of {@link Object#hashCode()}, and {@link Object#equals(Object)}. * - * @see OmegaMembershipOracle#isSameState(Word, Object, Word, Object) - * * @return whether the following conditions hold: - * 1. the hash codes are the same, i.e. {@code s1.equals(s2)}, and - * 2. the two access sequences lead to the same state. + *

    + *
  1. the hash codes are the same, i.e. {@code s1.equals(s2)}, and
  2. + *
  3. the two access sequences lead to the same state.
  4. + *
+ * + * @see OmegaMembershipOracle#isSameState(Word, Object, Word, Object) */ @Override public boolean isSameState(Word input1, Integer s1, Word input2, Integer s2) { @@ -256,9 +274,12 @@ public boolean isSameState(Word input1, Integer s1, Word input2, Integer s *

* The state information used to answer {@link OmegaQuery}s is of type {@link S}. * - * @param the state type - * @param the input type - * @param the output type + * @param + * the state type + * @param + * the input type + * @param + * the output type */ private static final class DeepCopySULOmegaOracle extends AbstractSULOmegaOracle { @@ -267,7 +288,8 @@ private static final class DeepCopySULOmegaOracle * Constructs a {@link DeepCopySULOmegaOracle}, use {@link #newOracle(ObservableSUL, boolean)} to create an * actual instance. This method will make sure the invariants of the {@link ObservableSUL} are satisfied. * - * @param sul the {@link ObservableSUL}. + * @param sul + * the {@link ObservableSUL}. */ DeepCopySULOmegaOracle(ObservableSUL sul) { super(sul); @@ -276,7 +298,8 @@ private static final class DeepCopySULOmegaOracle /** * Returns the current state of the {@link ObservableSUL}. * - * @param sul the {@link ObservableSUL} to retrieve the current state from. + * @param sul + * the {@link ObservableSUL} to retrieve the current state from. * * @return the current state. */ diff --git a/pom.xml b/pom.xml index c3b8bd5479..413b08a96f 100644 --- a/pom.xml +++ b/pom.xml @@ -206,6 +206,8 @@ limitations under the License. 11 + false + 3.1.0 3.2.1 @@ -1008,6 +1010,10 @@ limitations under the License. code-analysis + + + ${learnlib.jdk16orLower} + @@ -1221,6 +1227,15 @@ limitations under the License. 1.17.3 + + jdk16orLower + + (,17) + + + true + + examples diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java index bca700892f..45566d3521 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java @@ -75,6 +75,8 @@ private List>> cre * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, int targetSize, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java index a93c0be794..7d0ba6c222 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java @@ -93,6 +93,8 @@ protected Collection> generateSamplesInternal(Alpha * the input alphabet * @param variants * list to add the learner variants to + * @param + * input symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, PassiveLearnerVariantList, I, Boolean> variants); diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java index 12c1d0a36a..626bbbcccd 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java @@ -110,6 +110,10 @@ public Object[] createExampleITCases() { * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, int targetSize, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java index ec424bdd8e..5f22ef8886 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java @@ -74,6 +74,10 @@ public Object[] createExampleITCases() { * the input alphabet * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, PassiveLearnerVariantList, I, Word> variants); diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java index 8009c09b12..d31a33b089 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java @@ -76,6 +76,10 @@ public Object[] createExampleITCases() { * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, MembershipOracle mqOracle, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java index d6b9650ec2..27fb237903 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java @@ -76,6 +76,10 @@ public Object[] createExampleITCases() { * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, int targetSize, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java index 381fb13fb5..64ba14c4d7 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java @@ -74,6 +74,10 @@ public Object[] createExampleITCases() { * the input alphabet * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, PassiveLearnerVariantList, I, Word> variants); diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java index 4e0b0b4756..004f86cfee 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java @@ -76,6 +76,10 @@ public Object[] createExampleITCases() { * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, MembershipOracle mqOracle, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java index 9d74651a3e..f84001870b 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java @@ -67,6 +67,8 @@ private List> createAllVariantsITCase(OneSEVPALearn * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type */ protected abstract void addLearnerVariants(VPAlphabet alphabet, DFAMembershipOracle mqOracle, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java index 3f6d3d0ff3..526a3294ee 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java @@ -68,6 +68,8 @@ private List> createAllVariantsITCase(SBALearningExample * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type */ protected abstract void addLearnerVariants(ProceduralInputAlphabet alphabet, DFAMembershipOracle mqOracle, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java index afc2df67fb..c7adcdbc52 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java @@ -68,6 +68,8 @@ private List> createAllVariantsITCase(SPALearningExample * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type */ protected abstract void addLearnerVariants(ProceduralInputAlphabet alphabet, DFAMembershipOracle mqOracle, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java index ac19518f07..4147f7b78a 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java @@ -68,6 +68,10 @@ private List> createAllVariantsITCase(SPMMLearnin * the membership oracle * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(ProceduralInputAlphabet alphabet, O errorOutput, diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java index 5a412a8824..6d13b6b605 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java @@ -81,6 +81,10 @@ public Object[] createExampleITCases() { * the input alphabet * @param variants * list to add the learner variants to + * @param + * input symbol type + * @param + * output symbol type */ protected abstract void addLearnerVariants(Alphabet alphabet, PassiveLearnerVariantList, I, Word> variants); diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java index 65c505766d..ae18d9e23c 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java @@ -63,6 +63,19 @@ private LearnerITUtil() { /** * Creates a list of per-example test cases for all learner variants. * + * @param example + * the example system + * @param variants + * the list containing the various learner variants + * @param eqOracle + * the equivalence oracle to use by the learning process + * @param + * input symbol type + * @param + * output domain type + * @param + * automaton type + * * @return the list of test cases, one for each example */ public static > List> createExampleITCases( @@ -80,6 +93,15 @@ private LearnerITUtil() { /** * Creates a list of per-example test cases for all learner variants. * + * @param example + * the example system + * @param variants + * the list containing the various learner variants + * @param eqOracle + * the equivalence oracle to use by the learning process + * @param + * input symbol type + * * @return the list of test cases, one for each example */ public static List> createExampleITCases(SPALearningExample example, @@ -96,6 +118,15 @@ public static List> createExampleITCases(SPALearningExam /** * Creates a list of per-example test cases for all learner variants. * + * @param example + * the example system + * @param variants + * the list containing the various learner variants + * @param eqOracle + * the equivalence oracle to use by the learning process + * @param + * input symbol type + * * @return the list of test cases, one for each example */ public static List> createExampleITCases(SBALearningExample example, @@ -112,6 +143,17 @@ public static List> createExampleITCases(SBALearningExam /** * Creates a list of per-example test cases for all learner variants. * + * @param example + * the example system + * @param variants + * the list containing the various learner variants + * @param eqOracle + * the equivalence oracle to use by the learning process + * @param + * input symbol type + * @param + * output symbol type + * * @return the list of test cases, one for each example */ public static List> createExampleITCases(SPMMLearningExample example, @@ -128,6 +170,15 @@ public static List> createExampleITCases(SPMMLear /** * Creates a list of per-example test cases for all learner variants. * + * @param example + * the example system + * @param variants + * the list containing the various learner variants + * @param eqOracle + * the equivalence oracle to use by the learning process + * @param + * input symbol type + * * @return the list of test cases, one for each example */ public static List> createExampleITCases(OneSEVPALearningExample example, @@ -160,6 +211,17 @@ public static List> createExampleITCases(OneSEVPALe /** * Creates a list of per-example test cases for all learner variants (passive version). * + * @param example + * the example system + * @param variants + * the list containing the various learner variants + * @param + * input symbol type + * @param + * output domain type + * @param + * automaton type + * * @return the list of test cases, one for each example */ public static > List> createPassiveExampleITCases( diff --git a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java index bf5633fcae..acea6c3597 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java @@ -44,6 +44,15 @@ public static CompactMealy constructMachine() { /** * Construct and return a machine representation of this example. * + * @param machine + * the output object to write the contents to + * @param + * state type + * @param + * transition type + * @param + * automaton type + * * @return a Mealy machine representing the coffee machine example */ public static > A constructMachine(A machine) { diff --git a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java index c56493a716..72c63945ca 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java @@ -38,10 +38,16 @@ public static CompactMealy constructMachine(int xsize, int y /** * Construct and return a machine representation of this example. * + * @param fm + * the output object to write the contents to * @param xsize * number of states in x direction * @param ysize * number of states in y direction + * @param + * state type + * @param + * automaton type * * @return a Mealy machine with (xsize * ysize) states */ diff --git a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java index e0b5344dba..bb2b5ddbf7 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java @@ -39,6 +39,15 @@ public static CompactMealy constructMachine() { /** * Construct and return a machine representation of this example. * + * @param fm + * the output object to write the contents to + * @param + * state type + * @param + * transition type + * @param + * automaton type + * * @return machine instance of the example */ public static > A constructMachine(A fm) { diff --git a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java index b3039f7384..a9a9043bc2 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java @@ -41,6 +41,15 @@ public static CompactMealy constructMachine() { /** * Construct and return a machine representation of this example. * + * @param fm + * the output object to write the contents to + * @param + * state type + * @param + * transition type + * @param + * automaton type + * * @return machine instance of the example */ public static > A constructMachine(A fm) {