Skip to content

Commit

Permalink
Cleanup javadoc warnings (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtf90 authored Feb 6, 2024
1 parent 59d0f87 commit b759e83
Show file tree
Hide file tree
Showing 49 changed files with 546 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public void replaceNode(ADTNode<S, I, O> oldNode, ADTNode<S, I, O> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public class KearnsVaziraniDFA<I>
* 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<I> alphabet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public abstract class AbstractAutomatonLStar<A, I, D, S, T, SP, TP, AI extends M
* the learning alphabet
* @param oracle
* the learning oracle
* @param internalHyp
* the internal hypothesis object to write data to
*/
protected AbstractAutomatonLStar(Alphabet<I> alphabet, MembershipOracle<I, D> oracle, AI internalHyp) {
super(alphabet, oracle);
Expand Down Expand Up @@ -159,9 +161,11 @@ protected void setTransition(S from, I input, S to, Row<I> fromRow, int inputIdx
/**
* Derives a transition property from the corresponding transition.
* <p>
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,16 @@ protected List<Word<I>> initialPrefixes() {
protected abstract List<Word<I>> 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<List<Row<I>>> unclosed, boolean checkConsistency) {
boolean refined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public interface ClosingStrategy<I, D> {
* the observation table
* @param oracle
* the membership oracle
* @param <RI>
* the (concrete) row input type
* @param <RO>
* the (concrete) row output type
*
* @return a selection of representative rows to be closed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Queries and Counterexamples".
*
* @param <I>
* input symbol class.
* input symbol type
*/
public class ExtensibleLStarDFA<I>
extends AbstractExtensibleAutomatonLStar<DFA<?, I>, I, Boolean, Integer, Integer, Boolean, Void, CompactDFA<I>>
Expand All @@ -48,9 +48,15 @@ public class ExtensibleLStarDFA<I>
* 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<I> alphabet,
MembershipOracle<I, Boolean> oracle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class OPLearnerDFA<I> extends AbstractOPLearner<DFA<?, I>, 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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ public void fetchNonTreeIncoming(Collection<? super HTransition<I, O, SP, TP>> t
nonTreeIncoming.clear();
}

/**
* See {@link ResizingArrayStorage#ensureCapacity(int)}.
*/
public boolean ensureInputCapacity(int capacity) {
return this.transitions.ensureCapacity(capacity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class OPLearnerMealy<I, O> extends AbstractOPLearner<MealyMachine<?, I, ?
* the membership oracle
* @param suffixFinder
* method to use for analyzing counterexamples
* @param repeatedCounterexampleEvaluation
* a flag whether counterexamples should be analyzed exhaustively
*/
@GenerateBuilder(defaults = AbstractOPLearner.BuilderDefaults.class)
public OPLearnerMealy(Alphabet<I> alphabet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@
/**
* The TTT learning algorithm for generic automata.
*
* @param <A>
* hypothesis automaton type
* @param <I>
* input symbol type
* @param <D>
* output domain type
*/
@SuppressWarnings("PMD.ExcessiveClassLength")
public abstract class AbstractTTTLearner<A, I, D>
Expand Down Expand Up @@ -116,6 +120,10 @@ private static <I, D> void markAndPropagate(AbstractBaseDTNode<I, D> node, D lab
* the old node
* @param label
* the label to consider
* @param <I>
* input symbol type
* @param <D>
* output domain type
*/
private static <I, D> void moveIncoming(AbstractBaseDTNode<I, D> newNode,
AbstractBaseDTNode<I, D> oldNode,
Expand All @@ -130,6 +138,10 @@ private static <I, D> void moveIncoming(AbstractBaseDTNode<I, D> newNode,
* the node in the discrimination tree
* @param state
* the state in the hypothesis
* @param <I>
* input symbol type
* @param <D>
* output domain type
*/
protected static <I, D> void link(AbstractBaseDTNode<I, D> dtNode, TTTState<I, D> state) {
assert dtNode.isLeaf();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ public TTTTransition<I, D>[] getTransitions() {
return transitions.array;
}

/**
* See {@link ResizingArrayStorage#ensureCapacity(int)}.
*/
public boolean ensureInputCapacity(int capacity) {
return this.transitions.ensureCapacity(capacity);
}
Expand Down
39 changes: 26 additions & 13 deletions api/src/main/java/de/learnlib/oracle/PropertyOracle.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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.
* <p>
* 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.
*/
Expand All @@ -80,32 +82,43 @@ 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<I, D> disprove(A hypothesis, Collection<? extends I> 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<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs) {
return isDisproved() || disprove(hypothesis, inputs) != null ? null : doFindCounterExample(hypothesis, inputs);
}

/**
* 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<I, D> doFindCounterExample(A hypothesis, Collection<? extends I> inputs);
Expand Down
3 changes: 3 additions & 0 deletions api/src/main/java/de/learnlib/query/AbstractQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public Word<I> 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[<prefix>|<suffix> / <answer>]"}. If the query has not been answered
* yet, {@code <answer>} will be null.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ private AcexAnalysisAlgorithms() {
* the lower bound of the search range
* @param high
* the upper bound of the search range
* @param <E>
* the effect type
*
* @return an index <code>i</code> such that <code>acex.testEffect(i) != acex.testEffect(i+1)</code>
*/
Expand All @@ -56,6 +58,8 @@ public static <E> int linearSearchFwd(AbstractCounterexample<E> acex, int low, i
* the lower bound of the search range
* @param high
* the upper bound of the search range
* @param <E>
* the effect type
*
* @return an index <code>i</code> such that <code>acex.testEffect(i) != acex.testEffect(i+1)</code>
*/
Expand All @@ -82,6 +86,8 @@ public static <E> int linearSearchBwd(AbstractCounterexample<E> acex, int low, i
* the lower bound of the search range
* @param high
* the upper bound of the search range
* @param <E>
* the effect type
*
* @return an index <code>i</code> such that <code>acex.testEffect(i) != acex.testEffect(i+1)</code>
*/
Expand Down Expand Up @@ -117,6 +123,8 @@ public static <E> int exponentialSearchBwd(AbstractCounterexample<E> acex, int l
* the lower bound of the search range
* @param high
* the upper bound of the search range
* @param <E>
* the effect type
*
* @return an index <code>i</code> such that <code>acex.testEffect(i) != acex.testEffect(i+1)</code>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit b759e83

Please sign in to comment.