.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This module provides the implementation of the AAAR learning algorithm as described in the paper
+ * Automata Learning with Automated Alphabet Abstraction
+ * Refinement by Falk Howar, Bernhard Steffen, and Maik Merten.
+ *
+ * This module is provided by the following Maven dependency:
+ *
+ * <dependency>
+ * <groupId>de.learnlib</groupId>
+ * <artifactId>learnlib-aaar</artifactId>
+ * <version>${version}</version>
+ * </dependency>
+ *
+ */
+open module de.learnlib.algorithm.aaar {
+
+ requires de.learnlib.api;
+ requires net.automatalib.api;
+ requires net.automatalib.common.util;
+ requires net.automatalib.core;
+
+ // annotations are 'provided'-scoped and do not need to be loaded at runtime
+ requires static org.checkerframework.checker.qual;
+
+ exports de.learnlib.algorithm.aaar;
+ exports de.learnlib.algorithm.aaar.abstraction;
+ exports de.learnlib.algorithm.aaar.explicit;
+ exports de.learnlib.algorithm.aaar.generic;
+}
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AAARTestUtil.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AAARTestUtil.java
index fdcb4fcee1..9c0a3eae4a 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AAARTestUtil.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AAARTestUtil.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@
import de.learnlib.algorithm.LearningAlgorithm.MooreLearner;
import de.learnlib.algorithm.kv.dfa.KearnsVaziraniDFA;
import de.learnlib.algorithm.kv.mealy.KearnsVaziraniMealy;
+import de.learnlib.algorithm.lambda.ttt.dfa.TTTLambdaDFA;
+import de.learnlib.algorithm.lambda.ttt.mealy.TTTLambdaMealy;
import de.learnlib.algorithm.lstar.ce.ObservationTableCEXHandlers;
import de.learnlib.algorithm.lstar.closing.ClosingStrategies;
import de.learnlib.algorithm.lstar.dfa.ClassicLStarDFA;
@@ -33,8 +35,6 @@
import de.learnlib.algorithm.observationpack.dfa.OPLearnerDFA;
import de.learnlib.algorithm.observationpack.mealy.OPLearnerMealy;
import de.learnlib.algorithm.observationpack.moore.OPLearnerMoore;
-import de.learnlib.algorithm.oml.ttt.dfa.OptimalTTTDFA;
-import de.learnlib.algorithm.oml.ttt.mealy.OptimalTTTMealy;
import de.learnlib.algorithm.rivestschapire.RivestSchapireDFA;
import de.learnlib.algorithm.rivestschapire.RivestSchapireMealy;
import de.learnlib.algorithm.rivestschapire.RivestSchapireMoore;
@@ -61,14 +61,14 @@ public static List, I,
(alph, mqo) -> new OPLearnerDFA<>(alph, mqo, LocalSuffixFinders.RIVEST_SCHAPIRE, true, true);
final ComboConstructor, I, Boolean> ttt =
(alph, mqo) -> new TTTLearnerDFA<>(alph, mqo, AcexAnalyzers.BINARY_SEARCH_FWD);
- final ComboConstructor, I, Boolean> oml = (alph, mqo) -> new OptimalTTTDFA<>(alph, mqo, mqo);
+ final ComboConstructor, I, Boolean> lambda = (alph, mqo) -> new TTTLambdaDFA<>(alph, mqo, mqo);
return Arrays.asList(Pair.of("L*", lstar),
Pair.of("RS", rs),
Pair.of("KV", kv),
Pair.of("DT", dt),
Pair.of("TTT", ttt),
- Pair.of("OML", oml));
+ Pair.of("TTTLambda", lambda));
}
public static List, I, Word>>> getMealyLearners() {
@@ -86,15 +86,15 @@ public static List new OPLearnerMealy<>(alph, mqo, LocalSuffixFinders.RIVEST_SCHAPIRE, true);
final ComboConstructor, I, Word> ttt =
(alph, mqo) -> new TTTLearnerMealy<>(alph, mqo, AcexAnalyzers.BINARY_SEARCH_FWD);
- final ComboConstructor, I, Word> oml =
- (alph, mqo) -> new OptimalTTTMealy<>(alph, mqo, mqo);
+ final ComboConstructor, I, Word> lambda =
+ (alph, mqo) -> new TTTLambdaMealy<>(alph, mqo, mqo);
return Arrays.asList(Pair.of("L*", lstar),
Pair.of("RS", rs),
Pair.of("KV", kv),
Pair.of("DT", dt),
Pair.of("TTT", ttt),
- Pair.of("OML", oml));
+ Pair.of("TTTLambda", lambda));
}
public static List, I, Word>>> getMooreLearners() {
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AbstractAAARTest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AbstractAAARTest.java
index eaea096e20..36c5603c63 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AbstractAAARTest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AbstractAAARTest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,19 +15,19 @@
*/
package de.learnlib.algorithm.aaar;
-import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
-import com.google.common.collect.Lists;
import de.learnlib.algorithm.LearningAlgorithm;
-import de.learnlib.example.LearningExample;
import de.learnlib.oracle.MembershipOracle;
import de.learnlib.oracle.equivalence.SampleSetEQOracle;
import de.learnlib.oracle.membership.SimulatorOracle;
+import de.learnlib.testsupport.example.LearningExample;
import de.learnlib.util.Experiment;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.UniversalDeterministicAutomaton;
import net.automatalib.automaton.concept.SuffixOutput;
+import net.automatalib.common.util.collection.IteratorUtil;
import net.automatalib.util.automaton.Automata;
import net.automatalib.util.automaton.conformance.WpMethodTestsIterator;
import net.automatalib.word.Word;
@@ -50,9 +50,9 @@ public AbstractAAARTest(LearningExample learningExample) {
public void testAbstractHypothesisEquivalence() {
final WpMethodTestsIterator iter = new WpMethodTestsIterator<>(automaton, alphabet);
- final ArrayList> testCases = Lists.newArrayList(iter);
+ final List> testCases = IteratorUtil.list(iter);
- final SampleSetEQOracle eqo = new SampleSetEQOracle<>(false);
+ final SampleSetEQOracle eqo = new SampleSetEQOracle<>();
eqo.addAll(new SimulatorOracle<>(automaton), testCases);
final LearningAlgorithm learner =
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/ComboConstructor.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/ComboConstructor.java
index 3c0e1cfb31..feaee17135 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/ComboConstructor.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/ComboConstructor.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/TranslatingLearnerWrapper.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/TranslatingLearnerWrapper.java
index 61c5f593ab..5872da113f 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/TranslatingLearnerWrapper.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/TranslatingLearnerWrapper.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFATest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFATest.java
index d7b57396b2..febf4ad153 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFATest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFATest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@
import de.learnlib.algorithm.aaar.AAARTestUtil;
import de.learnlib.algorithm.aaar.AbstractAAARTest;
-import de.learnlib.example.dfa.ExamplePaulAndMary;
import de.learnlib.oracle.MembershipOracle;
+import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.fsa.DFA;
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealyTest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealyTest.java
index d00f1a1122..7321972eed 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealyTest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealyTest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,9 +17,9 @@
import de.learnlib.algorithm.aaar.AAARTestUtil;
import de.learnlib.algorithm.aaar.AbstractAAARTest;
-import de.learnlib.example.mealy.ExampleCoffeeMachine;
-import de.learnlib.example.mealy.ExampleCoffeeMachine.Input;
import de.learnlib.oracle.MembershipOracle;
+import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine;
+import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.transducer.MealyMachine;
import net.automatalib.word.Word;
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMooreTest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMooreTest.java
index a5a594b3db..0852ac11bd 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMooreTest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMooreTest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@
import de.learnlib.algorithm.aaar.AAARTestUtil;
import de.learnlib.algorithm.aaar.AbstractAAARTest;
import de.learnlib.algorithm.aaar.ComboConstructor;
-import de.learnlib.example.moore.ExampleRandomMoore;
import de.learnlib.oracle.MembershipOracle;
+import de.learnlib.testsupport.example.moore.ExampleRandomMoore;
import net.automatalib.alphabet.Alphabet;
-import net.automatalib.alphabet.Alphabets;
+import net.automatalib.alphabet.impl.Alphabets;
import net.automatalib.automaton.transducer.MooreMachine;
import net.automatalib.common.util.Pair;
import net.automatalib.word.Word;
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/IdentityInitialAbstraction.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/IdentityInitialAbstraction.java
index 4ac1a11d93..8b7d5ec541 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/IdentityInitialAbstraction.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/IdentityInitialAbstraction.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/Incrementor.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/Incrementor.java
index d6fe86c9b4..8bed37af76 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/Incrementor.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/Incrementor.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ModuloInitialAbstraction.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ModuloInitialAbstraction.java
index 69159af573..428b9ac466 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ModuloInitialAbstraction.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ModuloInitialAbstraction.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/NoopIncrementor.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/NoopIncrementor.java
index 78bef51fca..eb89e459f9 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/NoopIncrementor.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/NoopIncrementor.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityDFAIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityDFAIT.java
index ccd3e75a3a..a453130886 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityDFAIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityDFAIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMealyIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMealyIT.java
index 8aa4c6ba70..ad22940c72 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMealyIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMealyIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMooreIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMooreIT.java
index d27fb25e62..213b4ae843 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMooreIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerIdentityMooreIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloDFAIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloDFAIT.java
index d97d26a6dc..7054acefdc 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloDFAIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloDFAIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMealyIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMealyIT.java
index d9d23091ef..e4f04c4db7 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMealyIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMealyIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMooreIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMooreIT.java
index 41d45b365c..84bda9298a 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMooreIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/it/ExplicitAAARLearnerModuloMooreIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFATest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFATest.java
index b5928cc89e..64b61c06aa 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFATest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFATest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,12 +21,11 @@
import java.io.Writer;
import java.util.function.Function;
-import com.google.common.io.CharStreams;
import de.learnlib.algorithm.aaar.AAARTestUtil;
import de.learnlib.algorithm.aaar.AbstractAAARTest;
import de.learnlib.algorithm.aaar.abstraction.AbstractAbstractionTree;
-import de.learnlib.example.dfa.ExamplePaulAndMary;
import de.learnlib.oracle.MembershipOracle;
+import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.fsa.DFA;
import net.automatalib.common.util.IOUtil;
@@ -59,7 +58,7 @@ public void testTreeSerialization() throws IOException {
try (Reader r = IOUtil.asBufferedUTF8Reader(GenericAAARLearnerDFATest.class.getResourceAsStream("/tree_dfa.dot"));
Writer w = new StringWriter()) {
- final String expected = CharStreams.toString(r);
+ final String expected = IOUtil.toString(r);
GraphDOT.write((GraphViewable) tree, w);
Assert.assertEquals(w.toString(), expected);
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealyTest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealyTest.java
index cccfac0f8e..d1f4bfe398 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealyTest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealyTest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,12 +21,11 @@
import java.io.Writer;
import java.util.function.Function;
-import com.google.common.io.CharStreams;
import de.learnlib.algorithm.aaar.AAARTestUtil;
import de.learnlib.algorithm.aaar.AbstractAAARTest;
import de.learnlib.algorithm.aaar.abstraction.AbstractAbstractionTree;
-import de.learnlib.example.mealy.ExampleGrid;
import de.learnlib.oracle.MembershipOracle;
+import de.learnlib.testsupport.example.mealy.ExampleGrid;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.transducer.MealyMachine;
import net.automatalib.common.util.IOUtil;
@@ -63,7 +62,7 @@ public void testTreeSerialization() throws IOException {
"/tree_mealy.dot"));
Writer w = new StringWriter()) {
- final String expected = CharStreams.toString(r);
+ final String expected = IOUtil.toString(r);
GraphDOT.write((GraphViewable) tree, w);
Assert.assertEquals(w.toString(), expected);
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMooreTest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMooreTest.java
index 1cbd9067ff..c9c45c3a51 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMooreTest.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMooreTest.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,16 +22,15 @@
import java.util.Random;
import java.util.function.Function;
-import com.google.common.io.CharStreams;
import de.learnlib.algorithm.LearningAlgorithm.MooreLearner;
import de.learnlib.algorithm.aaar.AAARTestUtil;
import de.learnlib.algorithm.aaar.AbstractAAARTest;
import de.learnlib.algorithm.aaar.ComboConstructor;
import de.learnlib.algorithm.aaar.abstraction.AbstractAbstractionTree;
-import de.learnlib.example.moore.ExampleRandomMoore;
import de.learnlib.oracle.MembershipOracle;
+import de.learnlib.testsupport.example.moore.ExampleRandomMoore;
import net.automatalib.alphabet.Alphabet;
-import net.automatalib.alphabet.Alphabets;
+import net.automatalib.alphabet.impl.Alphabets;
import net.automatalib.automaton.transducer.MooreMachine;
import net.automatalib.common.util.IOUtil;
import net.automatalib.common.util.Pair;
@@ -76,7 +75,7 @@ public void testTreeSerialization() throws IOException {
"/tree_moore.dot"));
Writer w = new StringWriter()) {
- final String expected = CharStreams.toString(r);
+ final String expected = IOUtil.toString(r);
GraphDOT.write((GraphViewable) tree, w);
Assert.assertEquals(w.toString(), expected);
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerDFAIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerDFAIT.java
index 3030c7c299..b02ede9624 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerDFAIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerDFAIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMealyIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMealyIT.java
index 209da7c58a..6fe93c698b 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMealyIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMealyIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMooreIT.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMooreIT.java
index b202f060e1..389f648abc 100644
--- a/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMooreIT.java
+++ b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/it/GenericAAARLearnerMooreIT.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/pom.xml b/algorithms/active/adt/pom.xml
index 2423711603..46f9a658f6 100644
--- a/algorithms/active/adt/pom.xml
+++ b/algorithms/active/adt/pom.xml
@@ -1,7 +1,7 @@
-
- com.google.guava
- guava
-
-
net.automatalib
automata-api
@@ -88,8 +87,8 @@ limitations under the License.
- com.github.misberner.buildergen
- buildergen
+ de.learnlib.tooling
+ annotations
@@ -98,6 +97,11 @@ limitations under the License.
learnlib-drivers-simulator
test
+
+ de.learnlib
+ learnlib-equivalence-oracles
+ test
+
de.learnlib.testsupport
learnlib-learner-it-support
@@ -111,6 +115,15 @@ limitations under the License.
learnlib-membership-oracles
test
+
+ de.learnlib
+ learnlib-statistics
+ test
+
+
+ de.learnlib.testsupport
+ learnlib-test-support
+
net.automatalib
@@ -123,4 +136,19 @@ limitations under the License.
testng
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+
+ @{argLine} --add-reads=de.learnlib.algorithm.adt=de.learnlib.filter.statistic
+
+
+
+
+
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/ads/DefensiveADS.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/ads/DefensiveADS.java
index 4a8e51a290..a4aad5201b 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/ads/DefensiveADS.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/ads/DefensiveADS.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,15 +15,17 @@
*/
package de.learnlib.algorithm.adt.ads;
+import java.util.ArrayDeque;
import java.util.BitSet;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedList;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Optional;
import java.util.Queue;
import java.util.Set;
-import java.util.stream.Collectors;
import de.learnlib.algorithm.adt.adt.ADTLeafNode;
import de.learnlib.algorithm.adt.adt.ADTNode;
@@ -33,16 +35,19 @@
import net.automatalib.automaton.concept.StateIDs;
import net.automatalib.automaton.transducer.MealyMachine;
import net.automatalib.common.smartcollection.ReflexiveMapView;
+import net.automatalib.common.util.HashUtil;
import net.automatalib.common.util.Pair;
+import net.automatalib.util.automaton.ads.ADS;
import net.automatalib.util.automaton.ads.ADSUtil;
+import net.automatalib.util.automaton.ads.BacktrackingSearch;
import net.automatalib.word.Word;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
- * A variant of the backtracking ADS search (see {@link net.automatalib.util.automaton.ads.ADS}, {@link
- * net.automatalib.util.automaton.ads.BacktrackingSearch}), that works on partially defined automata. It tries to find an
- * ADS based on defined transitions and successively closes transitions if no ADS has been found.
+ * A variant of the backtracking ADS search (see {@link ADS}, {@link BacktrackingSearch}), that works on partially
+ * defined automata. It tries to find an ADS based on defined transitions and successively closes transitions if no ADS
+ * has been found.
*
* @param
* (hypothesis) state type
@@ -134,7 +139,7 @@ private Optional> compute(Map mapping) {
final long maximumSplittingWordLength =
ADSUtil.computeMaximumSplittingWordLength(automaton.size(), mapping.size(), this.states.size());
- final Queue> splittingWordCandidates = new LinkedList<>();
+ final Queue> splittingWordCandidates = new ArrayDeque<>();
final StateIDs stateIds = automaton.stateIDs();
final Set cache = new HashSet<>();
@@ -144,11 +149,12 @@ private Optional> compute(Map mapping) {
@SuppressWarnings("nullness") // false positive https://github.com/typetools/checker-framework/issues/399
final @NonNull Word prefix = splittingWordCandidates.poll();
- final Map currentToInitialMapping = mapping.keySet()
- .stream()
- .collect(Collectors.toMap(x -> automaton.getSuccessor(x,
- prefix),
- mapping::get));
+ final Map currentToInitialMapping = new LinkedHashMap<>(HashUtil.capacity(mapping.size()));
+
+ for (Entry e : mapping.entrySet()) {
+ currentToInitialMapping.put(automaton.getSuccessor(e.getKey(), prefix), e.getValue());
+ }
+
final BitSet currentSetAsBitSet = new BitSet();
for (S s : currentToInitialMapping.keySet()) {
currentSetAsBitSet.set(stateIds.getStateId(s));
@@ -162,7 +168,7 @@ private Optional> compute(Map mapping) {
for (I i : this.alphabet) {
//check for missing transitions
- final Set statesWithMissingTransitions = new HashSet<>();
+ final Set statesWithMissingTransitions = new LinkedHashSet<>();
for (S s : currentToInitialMapping.keySet()) {
if (!this.partialTransitionAnalyzer.isTransitionDefined(s, i)) {
statesWithMissingTransitions.add(s);
@@ -190,11 +196,11 @@ private Optional> compute(Map mapping) {
final O nextOutput = automaton.getOutput(current, i);
final Map nextMapping;
- if (!successors.containsKey(nextOutput)) {
+ if (successors.containsKey(nextOutput)) {
+ nextMapping = successors.get(nextOutput);
+ } else {
nextMapping = new HashMap<>();
successors.put(nextOutput, nextMapping);
- } else {
- nextMapping = successors.get(nextOutput);
}
// invalid input
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 92bb2f3f51..9890e31f55 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
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
import de.learnlib.algorithm.adt.api.LeafSplitter;
import de.learnlib.algorithm.adt.config.LeafSplitters;
import de.learnlib.algorithm.adt.util.ADTUtil;
-import de.learnlib.oracle.SymbolQueryOracle;
import net.automatalib.word.Word;
/**
@@ -74,6 +73,7 @@ public void replaceNode(ADTNode oldNode, ADTNode newNode) {
this.root = newNode;
} else if (ADTUtil.isResetNode(oldNode)) {
final ADTNode endOfPreviousADS = oldNode.getParent();
+ assert endOfPreviousADS != null;
final O outputToReset = ADTUtil.getOutputForSuccessor(endOfPreviousADS, oldNode);
newNode.setParent(endOfPreviousADS);
@@ -84,6 +84,8 @@ public void replaceNode(ADTNode oldNode, ADTNode newNode) {
assert ADTUtil.isResetNode(oldNodeParent);
final ADTNode endOfPreviousADS = oldNodeParent.getParent();
+ assert endOfPreviousADS != null;
+
final O outputToReset = ADTUtil.getOutputForSuccessor(endOfPreviousADS, oldNodeParent);
final ADTNode newResetNode = new ADTResetNode<>(newNode);
@@ -93,27 +95,6 @@ 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 word
- * the word to sift
- * @param subtree
- * the node whose subtree is considered
- *
- * @return the leaf (see {@link ADTNode#sift(SymbolQueryOracle, Word)})
- */
- public ADTNode sift(SymbolQueryOracle oracle, Word word, ADTNode subtree) {
-
- ADTNode current = subtree;
-
- while (!ADTUtil.isLeafNode(current)) {
- current = current.sift(oracle, word);
- }
-
- return current;
- }
-
/**
* Splitting a leaf node by extending the trace leading into the node to split.
*
@@ -213,30 +194,35 @@ public LCAInfo findLCA(ADTNode s1, ADTNode s2) {
final Map, ADTNode> s1ParentsToS1 = new HashMap<>();
ADTNode s1Iter = s1;
- ADTNode s2Iter = s2;
+ ADTNode s1ParentIter = s1.getParent();
- while (s1Iter.getParent() != null) {
- s1ParentsToS1.put(s1Iter.getParent(), s1Iter);
- s1Iter = s1Iter.getParent();
+ while (s1ParentIter != null) {
+ s1ParentsToS1.put(s1ParentIter, s1Iter);
+ s1Iter = s1ParentIter;
+ s1ParentIter = s1ParentIter.getParent();
}
final Set> s1Parents = s1ParentsToS1.keySet();
- while (s2Iter.getParent() != null) {
+ ADTNode s2Iter = s2;
+ ADTNode s2ParentIter = s2.getParent();
+
+ while (s2ParentIter != null) {
- if (s1Parents.contains(s2Iter.getParent())) {
- if (!ADTUtil.isSymbolNode(s2Iter.getParent())) {
+ if (s1Parents.contains(s2ParentIter)) {
+ if (!ADTUtil.isSymbolNode(s2ParentIter)) {
throw new IllegalStateException("Only Symbol Nodes should be LCAs");
}
- final ADTNode lca = s2Iter.getParent();
+ final ADTNode lca = s2ParentIter;
final O s1Out = ADTUtil.getOutputForSuccessor(lca, s1ParentsToS1.get(lca));
final O s2Out = ADTUtil.getOutputForSuccessor(lca, s2Iter);
return new LCAInfo<>(lca, s1Out, s2Out);
}
- s2Iter = s2Iter.getParent();
+ s2Iter = s2ParentIter;
+ s2ParentIter = s2ParentIter.getParent();
}
throw new IllegalStateException("Nodes do not share a parent node");
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTLeafNode.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTLeafNode.java
index 1f284d13b1..8cc6aba567 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTLeafNode.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTLeafNode.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,9 +15,7 @@
*/
package de.learnlib.algorithm.adt.adt;
-import de.learnlib.oracle.SymbolQueryOracle;
-import net.automatalib.graph.ads.AbstractRecursiveADSLeafNode;
-import net.automatalib.word.Word;
+import net.automatalib.graph.ads.impl.AbstractRecursiveADSLeafNode;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
@@ -37,11 +35,6 @@ public ADTLeafNode(@Nullable ADTNode parent, @Nullable S hypothesisStat
super(parent, hypothesisState);
}
- @Override
- public ADTNode sift(SymbolQueryOracle oracle, Word prefix) {
- throw new UnsupportedOperationException("Final nodes cannot sift words");
- }
-
@Override
public NodeType getNodeType() {
return NodeType.LEAF_NODE;
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTNode.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTNode.java
index 87936c28b3..68f0cfa88e 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTNode.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTNode.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,10 +19,8 @@
import java.util.Map;
import de.learnlib.algorithm.adt.util.ADTUtil;
-import de.learnlib.oracle.SymbolQueryOracle;
import net.automatalib.graph.ads.RecursiveADSNode;
import net.automatalib.visualization.VisualizationHelper;
-import net.automatalib.word.Word;
/**
* The ADT equivalent of {@link net.automatalib.graph.ads.ADSNode}. In contrast to regular adaptive distinguishing
@@ -38,23 +36,16 @@
public interface ADTNode extends RecursiveADSNode> {
/**
- * Utility method, that sifts a given word through {@code this} ADTNode. If {@code this} node is a - symbol
- * node, the symbol is applied to the system under learning and the corresponding child node (based on the observed
- * output) is returned. If no matching child node is found, a new leaf node is returned instead
- reset
- * node, the system under learning is reset and the provided prefix is reapplied to the system
- leaf node,
- * an exception is thrown
+ * Convenience method for directly accessing this node's {@link #getChildren() children}.
*
- * @param oracle
- * the oracle used to query the system under learning
- * @param prefix
- * the prefix to be re-applied after encountering a reset node
+ * @param output
+ * the output symbol to determine the child to returned
*
- * @return the corresponding child node
- *
- * @throws UnsupportedOperationException
- * when invoked on a leaf node (see {@link #getNodeType()}).
+ * @return the child node that is mapped to given output. May be {@code null},
*/
- ADTNode sift(SymbolQueryOracle oracle, Word prefix);
+ default ADTNode getChild(O output) {
+ return getChildren().get(output);
+ }
// default methods for graph interface
@Override
@@ -73,7 +64,7 @@ public boolean getNodeProperties(ADTNode node, Map prop
properties.put(NodeAttrs.LABEL, "reset");
} else if (ADTUtil.isLeafNode(node)) {
properties.put(NodeAttrs.SHAPE, NodeShapes.BOX);
- properties.put(NodeAttrs.LABEL, String.valueOf(node.getHypothesisState()));
+ properties.put(NodeAttrs.LABEL, String.valueOf(node.getState()));
} else {
properties.put(NodeAttrs.LABEL, node.toString());
properties.put(NodeAttrs.SHAPE, NodeShapes.OVAL);
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTResetNode.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTResetNode.java
index a8b8a5e299..496b35d21c 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTResetNode.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTResetNode.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,10 +18,6 @@
import java.util.Collections;
import java.util.Map;
-import de.learnlib.oracle.SymbolQueryOracle;
-import net.automatalib.word.Word;
-import org.checkerframework.checker.nullness.qual.Nullable;
-
/**
* Reset node implementation.
*
@@ -42,8 +38,8 @@ public ADTResetNode(ADTNode successor) {
}
@Override
- public @Nullable I getSymbol() {
- return null;
+ public I getSymbol() {
+ throw new UnsupportedOperationException("Reset nodes do not have a symbol");
}
@Override
@@ -67,24 +63,13 @@ public Map> getChildren() {
}
@Override
- public @Nullable S getHypothesisState() {
- return null;
- }
-
- @Override
- public void setHypothesisState(S state) {
+ public S getState() {
throw new UnsupportedOperationException("Reset nodes cannot reference a hypothesis state");
}
@Override
- public ADTNode sift(SymbolQueryOracle oracle, Word prefix) {
- oracle.reset();
-
- for (I i : prefix) {
- oracle.query(i);
- }
-
- return successor;
+ public void setState(S state) {
+ throw new UnsupportedOperationException("Reset nodes cannot reference a hypothesis state");
}
@Override
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTSymbolNode.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTSymbolNode.java
index 58ba336713..bde173c8f8 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTSymbolNode.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/adt/ADTSymbolNode.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,9 +15,7 @@
*/
package de.learnlib.algorithm.adt.adt;
-import de.learnlib.oracle.SymbolQueryOracle;
-import net.automatalib.graph.ads.AbstractRecursiveADSSymbolNode;
-import net.automatalib.word.Word;
+import net.automatalib.graph.ads.impl.AbstractRecursiveADSSymbolNode;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
@@ -37,21 +35,6 @@ public ADTSymbolNode(@Nullable ADTNode parent, I symbol) {
super(parent, symbol);
}
- @Override
- public ADTNode sift(SymbolQueryOracle oracle, Word prefix) {
- final O o = oracle.query(super.getSymbol());
-
- final ADTNode successor = super.getChildren().get(o);
-
- if (successor == null) {
- final ADTNode result = new ADTLeafNode<>(this, null);
- super.getChildren().put(o, result);
- return result;
- }
-
- return successor;
- }
-
@Override
public NodeType getNodeType() {
return NodeType.SYMBOL_NODE;
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/ADTExtender.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/ADTExtender.java
index dd3dbbdc13..43405be414 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/ADTExtender.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/ADTExtender.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/LeafSplitter.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/LeafSplitter.java
index 1d6655fac0..14b7464e63 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/LeafSplitter.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/LeafSplitter.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/PartialTransitionAnalyzer.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/PartialTransitionAnalyzer.java
index 0e6e57f443..e84aff12ee 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/PartialTransitionAnalyzer.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/PartialTransitionAnalyzer.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
/**
* During the refinement process of the hypothesis, ADS/Ts may be computed on partially defined automata. These
- * computations may want to skip undefined transitions (as closing them results in resets, which we want to omit) and
+ * computations may want to skip undefined transitions (as closing them results in resets which we want to omit) and
* only determine the information if necessary. This interface mediates between the learner and ADS/T computations by
* defining the basic forms of communication.
*
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/SubtreeReplacer.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/SubtreeReplacer.java
index db1f5cc978..17bbd3ec27 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/SubtreeReplacer.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/SubtreeReplacer.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTHypothesis.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTHypothesis.java
index 5e5709fd57..a03038b276 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTHypothesis.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTHypothesis.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTState.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTState.java
index d69e201026..b4fe20118c 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTState.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTState.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTTransition.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTTransition.java
index a931e41d64..4d1c9e7709 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTTransition.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/automaton/ADTTransition.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/ADTExtenders.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/ADTExtenders.java
index f808297bd0..0122753544 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/ADTExtenders.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/ADTExtenders.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/LeafSplitters.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/LeafSplitters.java
index 1fa5d3453e..b0d71b73f6 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/LeafSplitters.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/LeafSplitters.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -159,12 +159,14 @@ public static ADTNode splitParent(ADTNode nodeToSpli
newIter.next();
newSuffixOutput = oldIter.next();
- adsIter = adsIter.getChildren().get(newSuffixOutput);
+ adsIter = adsIter.getChild(newSuffixOutput);
}
- final ADTNode continuedADS = new ADTSymbolNode<>(adsIter.getParent(), suffixIter.next());
+ final ADTNode parent = adsIter.getParent();
+ final ADTNode continuedADS = new ADTSymbolNode<>(parent, suffixIter.next());
- adsIter.getParent().getChildren().put(newSuffixOutput, continuedADS);
+ assert parent != null;
+ parent.getChildren().put(newSuffixOutput, continuedADS);
return finalizeSplit(nodeToSplit, continuedADS, suffixIter, oldIter, newIter);
}
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/SubtreeReplacers.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/SubtreeReplacers.java
index 45071c251b..d26c122e42 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/SubtreeReplacers.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/SubtreeReplacers.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/ADSCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/ADSCalculator.java
index 5b42896c1e..f4a4461050 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/ADSCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/ADSCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/DefensiveADSCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/DefensiveADSCalculator.java
index 138bd322e1..c8908fcb42 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/DefensiveADSCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/DefensiveADSCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/AbstractCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/AbstractCalculator.java
index 7623735890..7c8006c136 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/AbstractCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/AbstractCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortCalculator.java
index 5032a363e4..726260ec8e 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortDefensiveCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortDefensiveCalculator.java
index 5c25b495e5..c12b374a08 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortDefensiveCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/BestEffortDefensiveCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinLengthCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinLengthCalculator.java
index 261449916a..5fdc820984 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinLengthCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinLengthCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinSizeCalculator.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinSizeCalculator.java
index 8a8bc7a1ca..37234961c0 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinSizeCalculator.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/calculator/MinSizeCalculator.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/extender/DefaultExtender.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/extender/DefaultExtender.java
index 379b7bccab..afcee35aa5 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/extender/DefaultExtender.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/extender/DefaultExtender.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package de.learnlib.algorithm.adt.config.model.extender;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
@@ -73,7 +73,7 @@ public ExtensionResult, I, O> computeExtension(ADTHypothes
// apply parent trace
for (int idx = 0; idx < inputTrace.length(); idx++) {
- final Map, ADTState> nextCurrentToInitialMapping = new HashMap<>();
+ final Map, ADTState> nextCurrentToInitialMapping = new LinkedHashMap<>();
final I input = inputTrace.getSymbol(idx);
final O output = outputTrace.getSymbol(idx);
@@ -123,7 +123,7 @@ public ExtensionResult, I, O> computeExtension(ADTHypothes
// set the original initial states
for (ADTNode, I, O> finalNode : ADTUtil.collectLeaves(extension)) {
- finalNode.setHypothesisState(currentToInitialMapping.get(finalNode.getHypothesisState()));
+ finalNode.setState(currentToInitialMapping.get(finalNode.getState()));
}
return new ExtensionResult<>(extension);
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/ExhaustiveReplacer.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/ExhaustiveReplacer.java
index 4c54b99c86..cc37baf79f 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/ExhaustiveReplacer.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/ExhaustiveReplacer.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,11 +18,11 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.Optional;
import java.util.PriorityQueue;
import java.util.Set;
-import com.google.common.collect.Sets;
import de.learnlib.algorithm.adt.adt.ADT;
import de.learnlib.algorithm.adt.adt.ADTNode;
import de.learnlib.algorithm.adt.api.SubtreeReplacer;
@@ -31,6 +31,7 @@
import de.learnlib.algorithm.adt.util.ADTUtil;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.transducer.MealyMachine;
+import net.automatalib.common.util.HashUtil;
public class ExhaustiveReplacer implements SubtreeReplacer {
@@ -56,16 +57,15 @@ public Set> computeReplacements(MealyMachin
return Collections.singleton(new ReplacementResult<>(adt.getRoot(), potentialResult.get()));
}
- final Set> candidates = ADTUtil.collectADSNodes(adt.getRoot());
- candidates.remove(adt.getRoot());
+ final Set> candidates = ADTUtil.collectADSNodes(adt.getRoot(), false);
final PriorityQueue> queue = new PriorityQueue<>(candidates.size(), Comparator.comparingInt(Set::size));
for (ADTNode node : candidates) {
final Set> leaves = ADTUtil.collectLeaves(node);
- final Set set = Sets.newHashSetWithExpectedSize(leaves.size());
+ final Set set = new LinkedHashSet<>(HashUtil.capacity(leaves.size()));
for (ADTNode l : leaves) {
- set.add(l.getHypothesisState());
+ set.add(l.getState());
}
queue.add(set);
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/LevelOrderReplacer.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/LevelOrderReplacer.java
index 45b42500dc..1dcaccd908 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/LevelOrderReplacer.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/LevelOrderReplacer.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
import de.learnlib.algorithm.adt.util.ADTUtil;
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.transducer.MealyMachine;
+import org.checkerframework.checker.nullness.qual.NonNull;
public class LevelOrderReplacer implements SubtreeReplacer {
@@ -55,7 +56,8 @@ public Set> computeReplacements(MealyMachin
queue.add(adt.getRoot());
while (!queue.isEmpty()) {
- final ADTNode node = queue.poll();
+ @SuppressWarnings("nullness") // false positive https://github.com/typetools/checker-framework/issues/399
+ final @NonNull ADTNode node = queue.poll();
final Set targetStates = ADTUtil.collectHypothesisStates(node);
// try to extendLeaf the parent ADS
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/SingleReplacer.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/SingleReplacer.java
index bb62091afa..4f685f471f 100644
--- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/SingleReplacer.java
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/replacer/SingleReplacer.java
@@ -1,5 +1,5 @@
-/* Copyright (C) 2013-2023 TU Dortmund
- * This file is part of LearnLib, http://www.learnlib.de/.
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
import java.util.Optional;
import java.util.Set;
-import com.google.common.collect.Maps;
import de.learnlib.algorithm.adt.adt.ADT;
import de.learnlib.algorithm.adt.adt.ADTNode;
import de.learnlib.algorithm.adt.api.SubtreeReplacer;
@@ -34,6 +33,7 @@
import net.automatalib.alphabet.Alphabet;
import net.automatalib.automaton.transducer.MealyMachine;
import net.automatalib.common.smartcollection.ReflexiveMapView;
+import net.automatalib.common.util.Pair;
import net.automatalib.word.Word;
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -50,19 +50,19 @@ public Set> computeReplacements(MealyMachin
Alphabet inputs,
ADT adt) {
- final Set> candidates = ADTUtil.collectADSNodes(adt.getRoot());
- candidates.remove(adt.getRoot());
- final Map, Double> candidatesScore = Maps.toMap(candidates, node -> {
- final int resets = 1 + ADTUtil.collectResetNodes(node).size();
- final int finals = ADTUtil.collectLeaves(node).size();
+ final Set> candidates = ADTUtil.collectADSNodes(adt.getRoot(), false);
- return resets / (double) finals;
- });
-
- final List> sortedCandidates = new ArrayList<>(candidates);
- sortedCandidates.sort(Comparator.comparingDouble(candidatesScore::get));
+ // cache scores to prevent expensive recalculations during sorting
+ final List, Double>> sortedCandidates = new ArrayList<>(candidates.size());
+ for (ADTNode candidate : candidates) {
+ final int resets = 1 + ADTUtil.collectResetNodes(candidate).size();
+ final int leaves = ADTUtil.collectLeaves(candidate).size();
+ sortedCandidates.add(Pair.of(candidate, resets / (double) leaves));
+ }
+ sortedCandidates.sort(Comparator.comparingDouble(Pair::getSecond));
- for (ADTNode node : sortedCandidates) {
+ for (Pair, Double> candidate : sortedCandidates) {
+ final ADTNode node = candidate.getFirst();
final Set targetStates = ADTUtil.collectHypothesisStates(node);
// check if we can extendLeaf the parent ADS
@@ -110,12 +110,11 @@ public Set> computeReplacements(MealyMachin
*
* @return a ReplacementResult for the parent (reset) node, if a valid replacement is found. {@code null} otherwise.
*/
- @Nullable
- static ReplacementResult computeParentExtension(MealyMachine hypothesis,
- Alphabet inputs,
- ADTNode node,
- Set targetStates,
- ADSCalculator adsCalculator) {
+ static @Nullable ReplacementResult computeParentExtension(MealyMachine hypothesis,
+ Alphabet inputs,
+ ADTNode node,
+ Set targetStates,
+ ADSCalculator adsCalculator) {
final ADTNode parentReset = node.getParent();
assert ADTUtil.isResetNode(parentReset) : "should not happen";
@@ -148,7 +147,7 @@ static ReplacementResult computeParentExtension(MealyMachine<
final ADTNode extension = potentialExtension.get();
for (ADTNode finalNode : ADTUtil.collectLeaves(extension)) {
- finalNode.setHypothesisState(currentToInitialMapping.get(finalNode.getHypothesisState()));
+ finalNode.setState(currentToInitialMapping.get(finalNode.getState()));
}
return new ReplacementResult<>(parentReset, potentialExtension.get());
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADSAmbiguityQuery.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADSAmbiguityQuery.java
new file mode 100644
index 0000000000..7973dab339
--- /dev/null
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADSAmbiguityQuery.java
@@ -0,0 +1,81 @@
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package de.learnlib.algorithm.adt.learner;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+
+import de.learnlib.algorithm.adt.adt.ADTNode;
+import de.learnlib.algorithm.adt.automaton.ADTState;
+import net.automatalib.word.Word;
+
+/**
+ * Utility class to resolve ADS ambiguities. This query simply tracks the current ADT node for the given inputs.
+ *
+ * @param
+ * input symbol type
+ * @param
+ * output symbol type
+ */
+class ADSAmbiguityQuery extends AbstractAdaptiveQuery {
+
+ private final Word accessSequence;
+ private final Deque oneShotPrefix;
+
+ private int asIndex;
+ private boolean inOneShot;
+
+ ADSAmbiguityQuery(Word accessSequence, Word oneShotPrefix, ADTNode, I, O> root) {
+ super(root);
+ this.accessSequence = accessSequence;
+ this.oneShotPrefix = new ArrayDeque<>(oneShotPrefix.asList());
+ this.asIndex = 0;
+ this.inOneShot = false;
+ }
+
+ @Override
+ public I getInput() {
+ if (this.asIndex < this.accessSequence.length()) {
+ return this.accessSequence.getSymbol(this.asIndex);
+ } else {
+ this.inOneShot = !this.oneShotPrefix.isEmpty();
+ if (this.inOneShot) {
+ return oneShotPrefix.poll();
+ } else {
+ return this.currentADTNode.getSymbol();
+ }
+ }
+ }
+
+ @Override
+ public Response processOutput(O out) {
+ if (this.asIndex < this.accessSequence.length()) {
+ asIndex++;
+ return Response.SYMBOL;
+ } else if (this.inOneShot) {
+ return Response.SYMBOL;
+ } else {
+ return super.processOutput(out);
+ }
+ }
+
+ @Override
+ protected void resetProgress() {
+ this.asIndex = 0;
+ }
+}
+
+
diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADSVerificationQuery.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADSVerificationQuery.java
new file mode 100644
index 0000000000..3296ae3081
--- /dev/null
+++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADSVerificationQuery.java
@@ -0,0 +1,107 @@
+/* Copyright (C) 2013-2025 TU Dortmund University
+ * This file is part of LearnLib .
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package de.learnlib.algorithm.adt.learner;
+
+import java.util.Objects;
+
+import de.learnlib.algorithm.adt.automaton.ADTState;
+import de.learnlib.query.AdaptiveQuery;
+import de.learnlib.query.DefaultQuery;
+import net.automatalib.word.Word;
+import net.automatalib.word.WordBuilder;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/**
+ * Utility class to verify ADSs. This query tracks the current ADT node for the given inputs and compares it with an
+ * expected output, potentially constructing a counterexample from the observed data.
+ *
+ * @param