Skip to content

Commit 189c196

Browse files
committed
bump dependency versions
including necessary updates/refactorings
1 parent 65fae6a commit 189c196

114 files changed

Lines changed: 819 additions & 501 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2222

2323
* Removed the `learnlib.queries.parallel.threshold` property. Learning setups that want to use parallelism now need to explicitly setup parallel oracles.
2424
* Removed `MQUtil#answerQueries{Auto,Parallel}` and `MQUtil#answerOmegaQueries{Auto,Parallel}`)
25+
* Updated to [AutomataLib 0.10.0](https://github.com/LearnLib/automatalib/releases/tag/automatalib-0.10.0)
2526

2627
### Fixed
2728

algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/automaton/ADTHypothesis.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,18 @@ public O getTransitionOutput(final ADTTransition<I, O> transition) {
9696
return transition.getOutput();
9797
}
9898

99-
@SuppressWarnings("nullness") // hypothesis is always complete
10099
@Override
101100
public Word<I> transformAccessSequence(final Word<I> word) {
102-
return this.getState(word).getAccessSequence();
101+
final ADTState<I, O> state = this.getState(word);
102+
assert state != null;
103+
return state.getAccessSequence();
103104
}
104105

105-
@SuppressWarnings("nullness") // hypothesis is always complete
106106
@Override
107107
public boolean isAccessSequence(final Word<I> word) {
108-
return this.getState(word).getAccessSequence().equals(word);
108+
final ADTState<I, O> state = this.getState(word);
109+
assert state != null;
110+
return state.getAccessSequence().equals(word);
109111
}
110112

111113
}

algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/config/model/extender/DefaultExtender.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public <I, O> ExtensionResult<ADTState<I, O>, I, O> computeExtension(final ADTHy
5151
final PartialTransitionAnalyzer<ADTState<I, O>, I> partialTransitionAnalyzer,
5252
final ADTNode<ADTState<I, O>, I, O> ads) {
5353
// cannot compute extension for root node
54-
if (ads.getParent() == null) {
54+
final ADTNode<ADTState<I, O>, I, O> parent = ads.getParent();
55+
if (parent == null) {
5556
return ExtensionResult.empty();
5657
}
5758

@@ -62,7 +63,7 @@ public <I, O> ExtensionResult<ADTState<I, O>, I, O> computeExtension(final ADTHy
6263
return ExtensionResult.empty();
6364
}
6465

65-
final Pair<Word<I>, Word<O>> parentTrace = ADTUtil.buildTraceForNode(ads.getParent());
66+
final Pair<Word<I>, Word<O>> parentTrace = ADTUtil.buildTraceForNode(parent);
6667

6768
// as long as we encounter exceptions, repeat
6869
while (true) {

algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/learner/ADTLearner.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,25 @@ public boolean refineHypothesisInternal(DefaultQuery<I, Word<O>> ceQuery) {
197197

198198
final ADTState<I, O> uState = this.hypothesis.getState(u);
199199
final ADTState<I, O> uaState = this.hypothesis.getState(ua);
200+
201+
assert uState != null && uaState != null;
202+
200203
final Word<I> uAccessSequence = uState.getAccessSequence();
201204
final Word<I> uaAccessSequence = uaState.getAccessSequence();
202205
final Word<I> uAccessSequenceWithA = uAccessSequence.append(a);
203206

204207
final ADTState<I, O> newState = this.hypothesis.addState();
205208
newState.setAccessSequence(uAccessSequenceWithA);
206209
final ADTTransition<I, O> oldTrans = this.hypothesis.getTransition(uState, a);
210+
211+
assert oldTrans != null;
212+
207213
oldTrans.setTarget(newState);
208214
oldTrans.setIsSpanningTreeEdge(true);
209215

210216
final Set<ADTNode<ADTState<I, O>, I, O>> finalNodes = ADTUtil.collectLeaves(this.adt.getRoot());
211217
final ADTNode<ADTState<I, O>, I, O> nodeToSplit = finalNodes.stream()
212-
.filter(n -> n.getHypothesisState().equals(uaState))
218+
.filter(n -> uaState.equals(n.getHypothesisState()))
213219
.findFirst()
214220
.orElseThrow(IllegalStateException::new);
215221

@@ -347,6 +353,7 @@ private void closeTransition(final ADTTransition<I, O> transition) {
347353
public void closeTransition(ADTState<I, O> state, I input) {
348354

349355
final ADTTransition<I, O> transition = this.hypothesis.getTransition(state, input);
356+
assert transition != null;
350357

351358
if (transition.needsSifting()) {
352359
final ADTNode<ADTState<I, O>, I, O> ads = transition.getSiftNode();
@@ -364,7 +371,9 @@ public void closeTransition(ADTState<I, O> state, I input) {
364371

365372
@Override
366373
public boolean isTransitionDefined(ADTState<I, O> state, I input) {
367-
return !this.hypothesis.getTransition(state, input).needsSifting();
374+
final ADTTransition<I, O> transition = this.hypothesis.getTransition(state, input);
375+
assert transition != null;
376+
return !transition.needsSifting();
368377
}
369378

370379
@Override
@@ -745,6 +754,7 @@ private void resolveAmbiguities(final ADTNode<ADTState<I, O>, I, O> nodeToReplac
745754
ADTNode<ADTState<I, O>, I, O> oldReference = null, newReference = null;
746755
for (final ADTNode<ADTState<I, O>, I, O> leaf : cachedLeaves) {
747756
final ADTState<I, O> hypState = leaf.getHypothesisState();
757+
assert hypState != null;
748758

749759
if (hypState.equals(iter.getHypothesisState())) {
750760
oldReference = leaf;
@@ -774,10 +784,12 @@ private void resolveAmbiguities(final ADTNode<ADTState<I, O>, I, O> nodeToReplac
774784
}
775785

776786
final ADTNode<ADTState<I, O>, I, O> reset = new ADTResetNode<>(oldTrace);
777-
final O parentOutput = ADTUtil.getOutputForSuccessor(iter.getParent(), iter);
787+
final ADTNode<ADTState<I, O>, I, O> parent = iter.getParent();
788+
assert parent != null;
789+
final O parentOutput = ADTUtil.getOutputForSuccessor(parent, iter);
778790

779-
iter.getParent().getChildren().put(parentOutput, reset);
780-
reset.setParent(iter.getParent());
791+
parent.getChildren().put(parentOutput, reset);
792+
reset.setParent(parent);
781793
oldTrace.setParent(reset);
782794
}
783795

algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public void addState(final S newState, final Word<I> accessSequence, final O out
184184
this.observationTree.getSuccessor(this.observationTree.getInitialState(), prefix);
185185
final FastMealyState<O> target;
186186

187+
assert pred != null;
187188
if (pred.getTransitionObject(alphabet.getSymbolIndex(sym)) == null) {
188189
target = this.observationTree.addState();
189190
this.observationTree.addTransition(pred, sym, target, output);

algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/ADTUtil.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.Iterator;
1919
import java.util.LinkedHashSet;
2020
import java.util.Map;
21+
import java.util.Objects;
2122
import java.util.Set;
2223

2324
import de.learnlib.algorithms.adt.adt.ADTLeafNode;
@@ -153,7 +154,7 @@ public static <S, I, O> Pair<Word<I>, Word<O>> buildTraceForNode(final ADTNode<S
153154

154155
public static <S, I, O> O getOutputForSuccessor(final ADTNode<S, I, O> node, final ADTNode<S, I, O> successor) {
155156

156-
if (!successor.getParent().equals(node)) {
157+
if (!node.equals(successor.getParent())) {
157158
throw new IllegalArgumentException("No parent relationship");
158159
}
159160

@@ -325,7 +326,7 @@ public static <S, I, O> boolean mergeADS(final ADTNode<S, I, O> parent, final AD
325326

326327
while (!(ADTUtil.isLeafNode(parentIter) || ADTUtil.isResetNode(parentIter)) && !ADTUtil.isLeafNode(childIter)) {
327328

328-
if (!parentIter.getSymbol().equals(childIter.getSymbol())) {
329+
if (!Objects.equals(parentIter.getSymbol(), childIter.getSymbol())) {
329330
return false;
330331
}
331332

algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/util/SQOOTBridge.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
package de.learnlib.algorithms.adt.util;
1717

1818
import java.util.ArrayList;
19+
import java.util.Collections;
1920
import java.util.List;
21+
import java.util.Objects;
2022

2123
import de.learnlib.algorithms.adt.model.ObservationTree;
2224
import de.learnlib.api.oracle.SymbolQueryOracle;
2325
import net.automatalib.automata.transducers.impl.FastMealy;
2426
import net.automatalib.automata.transducers.impl.FastMealyState;
25-
import org.checkerframework.checker.nullness.qual.Nullable;
2627

2728
/**
2829
* A utility class that links an observation tree with a symbol query oracle, meaning that all queries to the symbol
@@ -44,7 +45,7 @@ public class SQOOTBridge<I, O> implements SymbolQueryOracle<I, O> {
4445

4546
private final boolean enableCache;
4647

47-
private final @Nullable List<I> currentTrace;
48+
private final List<I> currentTrace;
4849

4950
private FastMealyState<O> currentState;
5051

@@ -56,7 +57,7 @@ public SQOOTBridge(final ObservationTree<?, I, O> observationTree,
5657
this.observationTree = observationTree.getObservationTree();
5758
this.delegate = delegate;
5859
this.enableCache = enableCache;
59-
this.currentTrace = enableCache ? new ArrayList<>() : null;
60+
this.currentTrace = enableCache ? new ArrayList<>() : Collections.emptyList();
6061
}
6162

6263
public void initialize() {
@@ -98,7 +99,7 @@ public O query(I i) {
9899
this.observationTree.addTransition(this.currentState, i, newState, output);
99100
}
100101
} else {
101-
assert output.equals(this.observationTree.getOutput(this.currentState, i)) : "Inconsistent observations";
102+
assert Objects.equals(output, this.observationTree.getOutput(this.currentState, i)) : "Inconsistent observations";
102103
nextState = succ;
103104
}
104105

algorithms/active/adt/src/test/java/de/learnlib/algorithms/adt/automaton/ADTHypothesisTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,33 @@ public void testAutomaton() {
4646

4747
final StateIDs<ADTState<Character, Integer>> stateIds = automaton.stateIDs();
4848

49+
final ADTState<Character, Integer> init = automaton.getInitialState();
50+
Assert.assertNotNull(init);
51+
4952
for (int s = 0; s < automaton.size(); s++) {
5053
for (final Character i : alphabet) {
51-
automaton.addTransition(stateIds.getState(s), i, automaton.getInitialState(), 0);
54+
automaton.addTransition(stateIds.getState(s), i, init, 0);
5255
}
5356
}
5457

55-
Assert.assertEquals(states * alphabet.size(), automaton.getInitialState().getIncomingTransitions().size());
58+
Assert.assertEquals(states * alphabet.size(), init.getIncomingTransitions().size());
5659

5760
final ADTState<Character, Integer> s1 = stateIds.getState(1), s2 = stateIds.getState(2), s3 =
5861
stateIds.getState(3);
5962

6063
automaton.removeAllTransitions(s1);
6164

62-
Assert.assertEquals((states - 1) * alphabet.size(),
63-
automaton.getInitialState().getIncomingTransitions().size());
65+
Assert.assertEquals((states - 1) * alphabet.size(), init.getIncomingTransitions().size());
6466

6567
automaton.removeAllTransitions(s2, alphabet.getSymbol(0));
6668

67-
Assert.assertEquals((states - 1) * alphabet.size() - 1,
68-
automaton.getInitialState().getIncomingTransitions().size());
69+
Assert.assertEquals((states - 1) * alphabet.size() - 1, init.getIncomingTransitions().size());
6970

7071
automaton.addTransition(s2, alphabet.getSymbol(0), s1, 0);
7172

7273
for (int i = 1; i < alphabet.size(); i++) {
7374
ADTTransition<Character, Integer> transition = automaton.getTransition(s2, alphabet.getSymbol(i));
75+
Assert.assertNotNull(transition);
7476
transition.setTarget(s1);
7577
}
7678

algorithms/active/adt/src/test/java/de/learnlib/algorithms/adt/learner/ADTVisualizationTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import de.learnlib.testsupport.AbstractVisualizationTest;
2525
import net.automatalib.serialization.dot.GraphDOT;
2626
import net.automatalib.words.Alphabet;
27+
import org.checkerframework.checker.initialization.qual.UnderInitialization;
2728
import org.testng.Assert;
2829
import org.testng.annotations.Test;
2930

@@ -33,7 +34,9 @@
3334
public class ADTVisualizationTest extends AbstractVisualizationTest<ADTLearner<Input, String>> {
3435

3536
@Override
36-
protected ADTLearner<Input, String> getLearnerBuilder(Alphabet<Input> alphabet, SUL<Input, String> sul) {
37+
protected ADTLearner<Input, String> getLearnerBuilder(@UnderInitialization ADTVisualizationTest this,
38+
Alphabet<Input> alphabet,
39+
SUL<Input, String> sul) {
3740
return new ADTLearnerBuilder<Input, String>().withAlphabet(alphabet)
3841
.withOracle(new SULSymbolQueryOracle<>(sul))
3942
.create();

algorithms/active/dhc/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ limitations under the License.
6464
<artifactId>automata-commons-util</artifactId>
6565
</dependency>
6666

67+
<dependency>
68+
<groupId>org.checkerframework</groupId>
69+
<artifactId>checker-qual</artifactId>
70+
</dependency>
71+
6772
<dependency>
6873
<groupId>org.slf4j</groupId>
6974
<artifactId>slf4j-api</artifactId>

0 commit comments

Comments
 (0)