diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ac87275f5..6c7fbdc9a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,15 +6,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). [Full changelog](https://github.com/LearnLib/learnlib/compare/learnlib-0.17.0...HEAD) +### Added + +* LearnLib now supports JPMS modules. All artifacts now provide a `module-info` descriptor except of the distribution artifacts (for Maven-less environments) which only provide an `Automatic-Module-Name` due to non-modular dependencies. Note that while this is a Java 9+ feature, LearnLib still supports Java 8 byte code for the remaining class files. + ### Changed +* The JPMS support introduces several changes: + * You now require at least a JDK 11 to build LearnLib. + * We use modules to better structure the aggregated JavaDoc. Since there exist breaking changes between Java 8 and Java 9 regarding documentation (see package-list vs. element-list), you can no longer link against the LearnLib documentation on JDK 8 builds. + * Split packages had to be refactored. + * The `de.learnlib.oracle.parallelism` interfaces in the `learnlib-api` artifact have been moved to the `de.learnlib.oracle` package. + * The `ThreadSafe` caches have been moved from the `learnlib-parallelism` artifact to the `learnlib-cache` artifact. + * The `GrowingAlphabet` and `Resumable` tests from the `learnlib-learner-it-support` artifact been moved to the `learnlib-test-support` artifact. + * The `OTUtils` class no longer provides the `displayHTMLInBrowser` methods in order to not depend on `java.desktop`. If you relied on this functionality, use the `writeHTMLToFile` methods instead and call `Desktop.getDesktop().open(file.toURI())` yourself. + * The classes in the `learnlib-learning-examples` artifact have their package renamed to `de.learnlib.testsupport.example`. * With the removal of the `learnlib-annotation-processor` artifact (see below), the `learnlib-build-config` artifact is now part of the `de.learnlib` group again. * The `ReuseOracleBuilder` and `ReuseTreeBuilder` classes are now auto-generated and therefore reside in the respective packages of their previously enclosing classes. ### Removed * The `de.learnlib.tooling:learnlib-annotation-processor` artifact has been dropped. The functionality has been moved to a [standalone project](https://github.com/LearnLib/build-tools). -* The the `de.learnlib:learnlib-rpni-edsm` and `de.learnlib:learnlib-rpni-mdl` artifacts have been dropped. The code has been merged with the `de.learnlib:learnlib-rpni` artifact. +* The `de.learnlib:learnlib-rpni-edsm` and `de.learnlib:learnlib-rpni-mdl` artifacts have been dropped. The code has been merged with the `de.learnlib:learnlib-rpni` artifact. ## [0.17.0] - 2023-11-15 diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/AbstractAAARLearner.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/AbstractAAARLearner.java index 55923f2c7b..064624050e 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/AbstractAAARLearner.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/AbstractAAARLearner.java @@ -28,8 +28,8 @@ import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.GrowingAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.MutableDeterministic; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.word.Word; diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/AbstractExplicitAAARLearner.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/AbstractExplicitAAARLearner.java index ce075733b4..6fc06c6a31 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/AbstractExplicitAAARLearner.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/AbstractExplicitAAARLearner.java @@ -32,8 +32,8 @@ import de.learnlib.algorithm.aaar.generic.AbstractGenericAAARLearner; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; /** * An "explicit" refinement of the {@link AbstractAAARLearner}. This implementation requires a prior partition of (all) diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFA.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFA.java index 27d7afc537..64dc314efd 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFA.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerDFA.java @@ -23,8 +23,8 @@ import de.learnlib.algorithm.aaar.TranslatingDFA; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; /** * A {@link DFA}-specific refinement of {@link AbstractExplicitAAARLearner}. diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealy.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealy.java index 47f86ce525..74a553714e 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealy.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMealy.java @@ -23,8 +23,8 @@ import de.learnlib.algorithm.aaar.TranslatingMealyMachine; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; /** diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMoore.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMoore.java index f267f90682..14f35f5ef9 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMoore.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/explicit/ExplicitAAARLearnerMoore.java @@ -23,8 +23,8 @@ import de.learnlib.algorithm.aaar.TranslatingMooreMachine; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.transducer.CompactMoore; import net.automatalib.automaton.transducer.MooreMachine; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.word.Word; /** diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/AbstractGenericAAARLearner.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/AbstractGenericAAARLearner.java index a35f41d6e2..3ef2ba9f41 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/AbstractGenericAAARLearner.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/AbstractGenericAAARLearner.java @@ -27,8 +27,8 @@ import de.learnlib.algorithm.aaar.explicit.AbstractExplicitAAARLearner; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; /** * A "generic" refinement of the {@link AbstractAAARLearner}. This implementation uses a single diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFA.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFA.java index 37ddd52dab..43c7d64bb8 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFA.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFA.java @@ -22,8 +22,8 @@ import de.learnlib.algorithm.aaar.TranslatingDFA; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; /** * A {@link DFA}-specific refinement of {@link AbstractGenericAAARLearner}. diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealy.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealy.java index 9d2a37d65b..aee3706d67 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealy.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMealy.java @@ -22,8 +22,8 @@ import de.learnlib.algorithm.aaar.TranslatingMealyMachine; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; /** diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMoore.java b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMoore.java index f97e0a7482..ba5dab73cd 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMoore.java +++ b/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerMoore.java @@ -22,8 +22,8 @@ import de.learnlib.algorithm.aaar.TranslatingMooreMachine; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.transducer.CompactMoore; import net.automatalib.automaton.transducer.MooreMachine; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.word.Word; /** diff --git a/algorithms/active/aaar/src/main/java/module-info.java b/algorithms/active/aaar/src/main/java/module-info.java new file mode 100644 index 0000000000..1995b07f62 --- /dev/null +++ b/algorithms/active/aaar/src/main/java/module-info.java @@ -0,0 +1,44 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 com.google.common; + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires 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/AbstractAAARTest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/AbstractAAARTest.java index 593f6d493a..66a78eb28d 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 @@ -20,10 +20,10 @@ 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; 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 930558adad..3e7b69a772 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 @@ -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 7fb43b9108..097fa25e58 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 @@ -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 139508b49a..9537b9f6b9 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 @@ -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/generic/GenericAAARLearnerDFATest.java b/algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/generic/GenericAAARLearnerDFATest.java index 905943113c..b8c9a37581 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 @@ -25,8 +25,8 @@ 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; 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 bdbefb9829..20cf8106be 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 @@ -25,8 +25,8 @@ 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; 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 71fbdfcc36..e63d0b6f23 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 @@ -28,10 +28,10 @@ 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; diff --git a/algorithms/active/adt/pom.xml b/algorithms/active/adt/pom.xml index d4cba7bf22..c514e0ca4b 100644 --- a/algorithms/active/adt/pom.xml +++ b/algorithms/active/adt/pom.xml @@ -111,6 +111,10 @@ limitations under the License. learnlib-membership-oracles test + + de.learnlib.testsupport + learnlib-test-support + net.automatalib 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 26cc596dc3..b855da8978 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 @@ -16,7 +16,7 @@ package de.learnlib.algorithm.adt.adt; import de.learnlib.oracle.SymbolQueryOracle; -import net.automatalib.graph.ads.AbstractRecursiveADSLeafNode; +import net.automatalib.graph.ads.impl.AbstractRecursiveADSLeafNode; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; 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 f157e5a6ea..ba89a47cee 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 @@ -16,7 +16,7 @@ package de.learnlib.algorithm.adt.adt; import de.learnlib.oracle.SymbolQueryOracle; -import net.automatalib.graph.ads.AbstractRecursiveADSSymbolNode; +import net.automatalib.graph.ads.impl.AbstractRecursiveADSSymbolNode; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADTLearner.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADTLearner.java index f880b7c943..5b8c105956 100644 --- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADTLearner.java +++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/learner/ADTLearner.java @@ -57,8 +57,8 @@ import de.learnlib.tooling.annotation.builder.GenerateBuilder; import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.common.util.Pair; import net.automatalib.word.Word; diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/model/ObservationTree.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/model/ObservationTree.java index 814f239757..1005672e1e 100644 --- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/model/ObservationTree.java +++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/model/ObservationTree.java @@ -27,8 +27,8 @@ import de.learnlib.algorithm.adt.adt.ADTNode; import de.learnlib.algorithm.adt.util.ADTUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.FastMealy; -import net.automatalib.automaton.transducer.FastMealyState; +import net.automatalib.automaton.transducer.impl.FastMealy; +import net.automatalib.automaton.transducer.impl.FastMealyState; import net.automatalib.common.util.Pair; import net.automatalib.util.automaton.equivalence.NearLinearEquivalenceTest; import net.automatalib.word.Word; diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/util/SQOOTBridge.java b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/util/SQOOTBridge.java index 901da5ecbf..bfbe2a3488 100644 --- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/util/SQOOTBridge.java +++ b/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/util/SQOOTBridge.java @@ -22,8 +22,8 @@ import de.learnlib.algorithm.adt.model.ObservationTree; import de.learnlib.oracle.SymbolQueryOracle; -import net.automatalib.automaton.transducer.FastMealy; -import net.automatalib.automaton.transducer.FastMealyState; +import net.automatalib.automaton.transducer.impl.FastMealy; +import net.automatalib.automaton.transducer.impl.FastMealyState; /** * A utility class that links an observation tree with a symbol query oracle, meaning that all queries to the symbol diff --git a/algorithms/active/adt/src/main/java/module-info.java b/algorithms/active/adt/src/main/java/module-info.java new file mode 100644 index 0000000000..6a594c8686 --- /dev/null +++ b/algorithms/active/adt/src/main/java/module-info.java @@ -0,0 +1,55 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 ADT learning algorithm as described in the Master thesis Active Automata Learning with Adaptive Distinguishing Sequences by Markus + * Frohme. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-adt</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.adt { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires de.learnlib.common.util; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.adt.ads; + exports de.learnlib.algorithm.adt.adt; + exports de.learnlib.algorithm.adt.api; + exports de.learnlib.algorithm.adt.automaton; + exports de.learnlib.algorithm.adt.config; + exports de.learnlib.algorithm.adt.learner; + exports de.learnlib.algorithm.adt.model; + exports de.learnlib.algorithm.adt.util; +} diff --git a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/automaton/ADTHypothesisTest.java b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/automaton/ADTHypothesisTest.java index 7f410b3e53..ad7b15b8e4 100644 --- a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/automaton/ADTHypothesisTest.java +++ b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/automaton/ADTHypothesisTest.java @@ -16,7 +16,7 @@ package de.learnlib.algorithm.adt.automaton; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.concept.StateIDs; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTGrowingAlphabetTest.java b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTGrowingAlphabetTest.java index 312acdf911..ecabff514b 100644 --- a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTGrowingAlphabetTest.java +++ b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTGrowingAlphabetTest.java @@ -16,9 +16,7 @@ package de.learnlib.algorithm.adt.learner; import java.util.Collection; -import java.util.List; import java.util.Random; -import java.util.function.Consumer; import de.learnlib.algorithm.adt.config.ADTExtenders; import de.learnlib.algorithm.adt.config.LeafSplitters; @@ -28,7 +26,7 @@ import de.learnlib.oracle.membership.SULSymbolQueryOracle; import de.learnlib.testsupport.AbstractGrowingAlphabetTest; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; @@ -65,13 +63,4 @@ protected ADTLearner getLearner(SymbolQueryOracle getCachedOracle(Alphabet alphabet, - SymbolQueryOracle original, - List> symbolListener) { - // ADT learner already uses a cache internally. - return original; - } - } diff --git a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTResumableLearnerTest.java b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTResumableLearnerTest.java index 130d8ee29f..ec7e283cd0 100644 --- a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTResumableLearnerTest.java +++ b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTResumableLearnerTest.java @@ -19,15 +19,12 @@ import de.learnlib.algorithm.adt.automaton.ADTState; import de.learnlib.driver.simulator.MealySimulatorSUL; -import de.learnlib.oracle.EquivalenceOracle.MealyEquivalenceOracle; import de.learnlib.oracle.SymbolQueryOracle; import de.learnlib.oracle.membership.SULSymbolQueryOracle; -import de.learnlib.query.DefaultQuery; import de.learnlib.testsupport.AbstractResumableLearnerTest; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; -import net.automatalib.util.automaton.Automata; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; @@ -49,17 +46,6 @@ protected SymbolQueryOracle getOracle(MealyMachine(new MealySimulatorSUL<>(target)); } - @Override - protected MealyEquivalenceOracle getEquivalenceOracle(MealyMachine target) { - return (mealy, inputs) -> { - final Word separatingWord = Automata.findSeparatingWord(target, mealy, inputs); - if (separatingWord == null) { - return null; - } - return new DefaultQuery<>(Word.epsilon(), separatingWord, target.computeOutput(separatingWord)); - }; - } - @Override protected ADTLearner getLearner(SymbolQueryOracle oracle, Alphabet alphabet) { diff --git a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTVisualizationTest.java b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTVisualizationTest.java index 151b38c10e..7dff9348a0 100644 --- a/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTVisualizationTest.java +++ b/algorithms/active/adt/src/test/java/de/learnlib/algorithm/adt/learner/ADTVisualizationTest.java @@ -18,10 +18,10 @@ import java.io.IOException; import java.io.StringWriter; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; import de.learnlib.oracle.membership.SULSymbolQueryOracle; import de.learnlib.sul.SUL; import de.learnlib.testsupport.AbstractVisualizationTest; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; import net.automatalib.alphabet.Alphabet; import net.automatalib.serialization.dot.GraphDOT; import org.checkerframework.checker.initialization.qual.UnderInitialization; diff --git a/algorithms/active/dhc/pom.xml b/algorithms/active/dhc/pom.xml index 4df062f8e2..a990fe1169 100644 --- a/algorithms/active/dhc/pom.xml +++ b/algorithms/active/dhc/pom.xml @@ -94,6 +94,10 @@ limitations under the License. learnlib-membership-oracles test
+ + de.learnlib.testsupport + learnlib-test-support + net.automatalib diff --git a/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHC.java b/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHC.java index e3766f2759..6553eea243 100644 --- a/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHC.java +++ b/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHC.java @@ -40,9 +40,9 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.mapping.MapMapping; import net.automatalib.common.util.mapping.MutableMapping; import net.automatalib.word.Word; diff --git a/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHCState.java b/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHCState.java index c3f6bd4c0c..f3ced0f6f9 100644 --- a/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHCState.java +++ b/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/mealy/MealyDHCState.java @@ -19,7 +19,7 @@ import java.util.Set; import com.google.common.collect.Maps; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.mapping.MutableMapping; import net.automatalib.word.Word; diff --git a/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/package-info.java b/algorithms/active/dhc/src/main/java/module-info.java similarity index 52% rename from algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/package-info.java rename to algorithms/active/dhc/src/main/java/module-info.java index e1e683ead6..b7eea4d3a6 100644 --- a/algorithms/active/dhc/src/main/java/de/learnlib/algorithm/dhc/package-info.java +++ b/algorithms/active/dhc/src/main/java/module-info.java @@ -15,8 +15,30 @@ */ /** - * This package (and sub-packages) provides the implementation of the DHC learning algorithm as described in the paper + * This module provides the implementation of the DHC learning algorithm as described in the paper * Automata Learning with on-the-Fly Direct Hypothesis * Construction by Maik Merten, Falk Howar, Bernhard Steffen, and Tiziana Margaria. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-dhc</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.dhc; +open module de.learnlib.algorithm.dhc { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.dhc.mealy; +} diff --git a/algorithms/active/dhc/src/test/java/de/learnlib/algorithm/dhc/mealy/MealyDHCTest.java b/algorithms/active/dhc/src/test/java/de/learnlib/algorithm/dhc/mealy/MealyDHCTest.java index 2a6e80fa90..99423003cc 100644 --- a/algorithms/active/dhc/src/test/java/de/learnlib/algorithm/dhc/mealy/MealyDHCTest.java +++ b/algorithms/active/dhc/src/test/java/de/learnlib/algorithm/dhc/mealy/MealyDHCTest.java @@ -20,18 +20,18 @@ import java.util.List; import java.util.Random; -import de.learnlib.example.mealy.ExampleCoffeeMachine; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; -import de.learnlib.example.mealy.ExampleGrid; -import de.learnlib.example.mealy.ExampleStack; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.equivalence.MealySimulatorEQOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; +import de.learnlib.testsupport.example.mealy.ExampleGrid; +import de.learnlib.testsupport.example.mealy.ExampleStack; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; import org.testng.Assert; diff --git a/algorithms/active/kearns-vazirani/pom.xml b/algorithms/active/kearns-vazirani/pom.xml index 7f12d36783..5c998b498d 100644 --- a/algorithms/active/kearns-vazirani/pom.xml +++ b/algorithms/active/kearns-vazirani/pom.xml @@ -87,6 +87,10 @@ limitations under the License. de.learnlib.testsupport learnlib-learner-it-support
+ + de.learnlib.testsupport + learnlib-test-support + org.testng diff --git a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java index 366e3ef342..b9a15a6f56 100644 --- a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java +++ b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFA.java @@ -37,10 +37,10 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.common.smartcollection.ArrayStorage; import net.automatalib.word.Word; import org.slf4j.Logger; diff --git a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFAState.java b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFAState.java index a9374644eb..792efea10e 100644 --- a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFAState.java +++ b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/dfa/KearnsVaziraniDFAState.java @@ -19,7 +19,7 @@ import de.learnlib.algorithm.kv.StateInfo; import de.learnlib.datastructure.discriminationtree.BinaryDTree; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; /** * Class that contains all data that represent the internal state of the {@link KearnsVaziraniDFA} learner. diff --git a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealy.java b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealy.java index 8438675afc..dbf2a257eb 100644 --- a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealy.java +++ b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealy.java @@ -38,11 +38,11 @@ import de.learnlib.tooling.annotation.builder.GenerateBuilder; import de.learnlib.util.mealy.MealyUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.CompactTransition; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.impl.CompactTransition; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; diff --git a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealyState.java b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealyState.java index abc107b35d..3b1ff43ffa 100644 --- a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealyState.java +++ b/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/mealy/KearnsVaziraniMealyState.java @@ -19,7 +19,7 @@ import de.learnlib.algorithm.kv.StateInfo; import de.learnlib.datastructure.discriminationtree.MultiDTree; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; /** diff --git a/algorithms/active/kearns-vazirani/src/main/java/module-info.java b/algorithms/active/kearns-vazirani/src/main/java/module-info.java new file mode 100644 index 0000000000..621bd817b6 --- /dev/null +++ b/algorithms/active/kearns-vazirani/src/main/java/module-info.java @@ -0,0 +1,47 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 learning algorithm described in the book "An + * Introduction to Computational Learning Theory" by Michael Kearns and Umesh Vazirani. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-kearns-vazirani</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.kv { + + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires de.learnlib.common.util; + requires de.learnlib.datastructure.discriminationtree; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.kv; + exports de.learnlib.algorithm.kv.dfa; + exports de.learnlib.algorithm.kv.mealy; +} diff --git a/algorithms/active/lstar/pom.xml b/algorithms/active/lstar/pom.xml index 5d35ba727d..8abc9c786b 100644 --- a/algorithms/active/lstar/pom.xml +++ b/algorithms/active/lstar/pom.xml @@ -109,6 +109,10 @@ limitations under the License. learnlib-membership-oracles test
+ + de.learnlib.testsupport + learnlib-test-support + net.automatalib @@ -121,4 +125,45 @@ limitations under the License. testng + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} --add-reads=de.learnlib.algorithm.lstar=net.automatalib.util + + + + + + + + + fix-xstream + + [16,) + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} + --add-reads=de.learnlib.algorithm.lstar=net.automatalib.util + --add-opens=java.base/java.util=ALL-UNNAMED + + + + + + + + diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java index 60cd8864fd..c0439c67f8 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/AbstractLStar.java @@ -32,8 +32,8 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.word.Word; diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java index 0cbdc3b51a..6bb5b85f78 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/dfa/ExtensibleLStarDFA.java @@ -29,8 +29,8 @@ import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.concept.SuffixOutput; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.word.Word; /** diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ClassicLStarMealy.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ClassicLStarMealy.java index b246e6d0b8..7d16f8e982 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ClassicLStarMealy.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ClassicLStarMealy.java @@ -28,10 +28,10 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.CompactTransition; import net.automatalib.automaton.concept.SuffixOutput; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.automaton.impl.CompactTransition; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; /** diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ExtensibleLStarMealy.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ExtensibleLStarMealy.java index 0b2af26e37..7178af5cae 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ExtensibleLStarMealy.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/ExtensibleLStarMealy.java @@ -30,10 +30,10 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.CompactTransition; import net.automatalib.automaton.concept.SuffixOutput; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.automaton.impl.CompactTransition; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; /** diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ClassicLStarMoore.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ClassicLStarMoore.java index 09ceee0d79..44161dcf4d 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ClassicLStarMoore.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ClassicLStarMoore.java @@ -26,8 +26,8 @@ import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.concept.SuffixOutput; -import net.automatalib.automaton.transducer.CompactMoore; import net.automatalib.automaton.transducer.MooreMachine; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.word.Word; /** diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ExtensibleLStarMoore.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ExtensibleLStarMoore.java index df8422c0c4..8985ca1409 100644 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ExtensibleLStarMoore.java +++ b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/moore/ExtensibleLStarMoore.java @@ -28,8 +28,8 @@ import de.learnlib.tooling.annotation.builder.GenerateBuilder; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.concept.SuffixOutput; -import net.automatalib.automaton.transducer.CompactMoore; import net.automatalib.automaton.transducer.MooreMachine; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.word.Word; /** diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/package-info.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/package-info.java deleted file mode 100644 index 007f6ebde6..0000000000 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the L* learning algorithm described in the paper - * Learning Regular Sets from Queries and Counterexamples by - * Dana Angluin as well as multiple variations thereof. - */ -package de.learnlib.algorithm.lstar; diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/malerpnueli/package-info.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/malerpnueli/package-info.java deleted file mode 100644 index 1b21c05f8c..0000000000 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/malerpnueli/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the {@link de.learnlib.algorithm.lstar L* variation} - * based on the paper On the Learnability of Infinitary Regular - * Sets by Oded Maler and Amir Pnueli. - */ -package de.learnlib.algorithm.malerpnueli; diff --git a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/rivestschapire/package-info.java b/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/rivestschapire/package-info.java deleted file mode 100644 index c24a3feff2..0000000000 --- a/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/rivestschapire/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the {@link de.learnlib.algorithm.lstar L* variation} - * based on the paper Inference of finite automata using homing - * sequences by Ronald L. Rivest and Robert E. Schapire. - */ -package de.learnlib.algorithm.rivestschapire; diff --git a/algorithms/active/lstar/src/main/java/module-info.java b/algorithms/active/lstar/src/main/java/module-info.java new file mode 100644 index 0000000000..b088dd4773 --- /dev/null +++ b/algorithms/active/lstar/src/main/java/module-info.java @@ -0,0 +1,56 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 L* learning algorithm described in the paper + * Learning Regular Sets from Queries and Counterexamples by + * Dana Angluin including variations and optimizations thereof such as the versions based on "On the Learnability of Infinitary Regular Sets by Oded Maler + * and Amir Pnueli or Inference of finite automata using homing + * sequences) by Ronald L. Rivest and Robert E. Schapire. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-lstar</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.lstar { + + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires de.learnlib.common.util; + requires de.learnlib.datastructure.observationtable; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.lstar; + exports de.learnlib.algorithm.lstar.ce; + exports de.learnlib.algorithm.lstar.closing; + exports de.learnlib.algorithm.lstar.dfa; + exports de.learnlib.algorithm.lstar.mealy; + exports de.learnlib.algorithm.lstar.moore; + exports de.learnlib.algorithm.malerpnueli; + exports de.learnlib.algorithm.rivestschapire; +} diff --git a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ClassicLStarMealyGrowingAlphabetTest.java b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ClassicLStarMealyGrowingAlphabetTest.java index ad7d0f836b..ba0579099f 100644 --- a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ClassicLStarMealyGrowingAlphabetTest.java +++ b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ClassicLStarMealyGrowingAlphabetTest.java @@ -21,14 +21,14 @@ import de.learnlib.algorithm.lstar.closing.ClosingStrategies; import de.learnlib.algorithm.lstar.mealy.ClassicLStarMealy; import de.learnlib.algorithm.lstar.mealy.ExtensibleLStarMealy; -import de.learnlib.example.mealy.ExampleCoffeeMachine; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; import de.learnlib.util.mealy.MealyUtil; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; import org.testng.Assert; diff --git a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarDFAResumableLearnerTest.java b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarDFAResumableLearnerTest.java index 18abe550f8..0e45514ba9 100644 --- a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarDFAResumableLearnerTest.java +++ b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarDFAResumableLearnerTest.java @@ -20,7 +20,7 @@ import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.testsupport.AbstractResumableLearnerDFATest; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; public class ExtensibleLStarDFAResumableLearnerTest extends AbstractResumableLearnerDFATest, AutomatonLStarState, Integer>> { diff --git a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMealyResumableLearnerTest.java b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMealyResumableLearnerTest.java index 6c69a68315..558dbdaeed 100644 --- a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMealyResumableLearnerTest.java +++ b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMealyResumableLearnerTest.java @@ -22,9 +22,9 @@ import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.testsupport.AbstractResumableLearnerMealyTest; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; diff --git a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMooreResumableLearnerTest.java b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMooreResumableLearnerTest.java index 9ae975edc1..e522f60203 100644 --- a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMooreResumableLearnerTest.java +++ b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/ExtensibleLStarMooreResumableLearnerTest.java @@ -22,9 +22,9 @@ import de.learnlib.oracle.MembershipOracle.MooreMembershipOracle; import de.learnlib.testsupport.AbstractResumableLearnerMooreTest; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMoore; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MooreMachine; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; diff --git a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarDFATest.java b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarDFATest.java index f0be51ba46..49da2e953d 100644 --- a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarDFATest.java +++ b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarDFATest.java @@ -23,13 +23,13 @@ import de.learnlib.algorithm.lstar.ce.ObservationTableCEXHandler; import de.learnlib.algorithm.lstar.closing.ClosingStrategy; import de.learnlib.algorithm.lstar.dfa.ExtensibleLStarDFA; -import de.learnlib.example.dfa.ExamplePaulAndMary; import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.equivalence.SimulatorEQOracle; import de.learnlib.oracle.equivalence.WMethodEQOracle; import de.learnlib.oracle.equivalence.WpMethodEQOracle; import de.learnlib.oracle.membership.DFASimulatorOracle; +import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.fsa.DFA; import net.automatalib.word.Word; diff --git a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarMealyTest.java b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarMealyTest.java index 119092db30..9f04369010 100644 --- a/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarMealyTest.java +++ b/algorithms/active/lstar/src/test/java/de/learnlib/algorithm/lstar/LStarMealyTest.java @@ -23,15 +23,15 @@ import de.learnlib.algorithm.lstar.closing.ClosingStrategy; import de.learnlib.algorithm.lstar.mealy.ClassicLStarMealy; import de.learnlib.algorithm.lstar.mealy.ExtensibleLStarMealy; -import de.learnlib.example.mealy.ExampleStack; -import de.learnlib.example.mealy.ExampleStack.Input; -import de.learnlib.example.mealy.ExampleStack.Output; import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.equivalence.SimulatorEQOracle; import de.learnlib.oracle.equivalence.mealy.SymbolEQOracleWrapper; import de.learnlib.oracle.membership.MealySimulatorOracle; +import de.learnlib.testsupport.example.mealy.ExampleStack; +import de.learnlib.testsupport.example.mealy.ExampleStack.Input; +import de.learnlib.testsupport.example.mealy.ExampleStack.Output; import de.learnlib.util.mealy.MealyUtil; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; diff --git a/algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/NLStarLearner.java b/algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/NLStarLearner.java index b96d39af87..3796e96b46 100644 --- a/algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/NLStarLearner.java +++ b/algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/NLStarLearner.java @@ -25,8 +25,8 @@ import de.learnlib.tooling.annotation.builder.GenerateBuilder; import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.fsa.CompactDFA; -import net.automatalib.automaton.fsa.CompactNFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; +import net.automatalib.automaton.fsa.impl.CompactNFA; import net.automatalib.util.automaton.fsa.NFAs; import net.automatalib.word.Word; diff --git a/algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/package-info.java b/algorithms/active/nlstar/src/main/java/module-info.java similarity index 53% rename from algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/package-info.java rename to algorithms/active/nlstar/src/main/java/module-info.java index 57e12ce55a..eb22ac1388 100644 --- a/algorithms/active/nlstar/src/main/java/de/learnlib/algorithm/nlstar/package-info.java +++ b/algorithms/active/nlstar/src/main/java/module-info.java @@ -15,8 +15,29 @@ */ /** - * This package (and sub-packages) provides the implementation of the NL* learning algorithm as described in the paper + * This module provides the implementation of the NL* learning algorithm as described in the paper * Angluin-Style Learning of NFA by Benedikt Bollig, Peter * Habermehl, Carsten Kern, and Martin Leucker. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-nlstar</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.nlstar; +open module de.learnlib.algorithm.nlstar { + + requires de.learnlib.api; + requires de.learnlib.common.util; + requires net.automatalib.api; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.nlstar; +} diff --git a/algorithms/active/nlstar/src/test/java/de/learnlib/algorithm/nlstar/NLStarTest.java b/algorithms/active/nlstar/src/test/java/de/learnlib/algorithm/nlstar/NLStarTest.java index 2ee76f8f6d..d5a7ea5716 100644 --- a/algorithms/active/nlstar/src/test/java/de/learnlib/algorithm/nlstar/NLStarTest.java +++ b/algorithms/active/nlstar/src/test/java/de/learnlib/algorithm/nlstar/NLStarTest.java @@ -20,9 +20,9 @@ import de.learnlib.oracle.membership.NFASimulatorOracle; import de.learnlib.util.Experiment; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactNFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.NFA; +import net.automatalib.automaton.fsa.impl.CompactNFA; import net.automatalib.util.automaton.Automata; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.util.automaton.fsa.NFAs; diff --git a/algorithms/active/observation-pack-vpa/pom.xml b/algorithms/active/observation-pack-vpa/pom.xml index 5afa33fb2c..8b5ca0bffc 100644 --- a/algorithms/active/observation-pack-vpa/pom.xml +++ b/algorithms/active/observation-pack-vpa/pom.xml @@ -124,4 +124,19 @@ limitations under the License. testng + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} --add-reads=de.learnlib.algorithm.observationpack.vpa=net.automatalib.util + + + + + diff --git a/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/hypothesis/OneSEVPAHypothesis.java b/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/hypothesis/OneSEVPAHypothesis.java index 2ca46f202d..49120d9ece 100644 --- a/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/hypothesis/OneSEVPAHypothesis.java +++ b/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/hypothesis/OneSEVPAHypothesis.java @@ -19,10 +19,10 @@ import java.util.List; import net.automatalib.alphabet.VPAlphabet; -import net.automatalib.automaton.vpa.AbstractSEVPA; import net.automatalib.automaton.vpa.OneSEVPA; import net.automatalib.automaton.vpa.StackContents; import net.automatalib.automaton.vpa.State; +import net.automatalib.automaton.vpa.impl.AbstractSEVPA; import org.checkerframework.checker.nullness.qual.Nullable; /** diff --git a/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/package-info.java b/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/package-info.java deleted file mode 100644 index 11e3a509a3..0000000000 --- a/algorithms/active/observation-pack-vpa/src/main/java/de/learnlib/algorithm/observationpack/vpa/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the VPA adaption of the Observation-Pack learning - * algorithm as discussed in the PhD thesis Foundations of Active - * Automata Learning: An Algorithmic Perspective by Malte Isberner. - */ -package de.learnlib.algorithm.observationpack.vpa; diff --git a/algorithms/active/observation-pack-vpa/src/main/java/module-info.java b/algorithms/active/observation-pack-vpa/src/main/java/module-info.java new file mode 100644 index 0000000000..ca68f5d5eb --- /dev/null +++ b/algorithms/active/observation-pack-vpa/src/main/java/module-info.java @@ -0,0 +1,48 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 VPA adaption of the Observation-Pack learning algorithm as discussed + * in the PhD thesis Foundations of Active Automata Learning: An + * Algorithmic Perspective by Malte Isberner. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-observation-pack-vpa</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.observationpack.vpa { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires de.learnlib.datastructure.discriminationtree; + requires de.learnlib.datastructure.list; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.observationpack.vpa; + exports de.learnlib.algorithm.observationpack.vpa.hypothesis; +} diff --git a/algorithms/active/observation-pack-vpa/src/test/java/de/learnlib/algorithm/observationpack/vpa/DTVisualizationTest.java b/algorithms/active/observation-pack-vpa/src/test/java/de/learnlib/algorithm/observationpack/vpa/DTVisualizationTest.java index 74ed5cd8ae..714ca03777 100644 --- a/algorithms/active/observation-pack-vpa/src/test/java/de/learnlib/algorithm/observationpack/vpa/DTVisualizationTest.java +++ b/algorithms/active/observation-pack-vpa/src/test/java/de/learnlib/algorithm/observationpack/vpa/DTVisualizationTest.java @@ -26,10 +26,10 @@ import de.learnlib.oracle.equivalence.vpa.SimulatorEQOracle; import de.learnlib.oracle.membership.SEVPASimulatorOracle; import de.learnlib.util.Experiment; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultVPAlphabet; -import net.automatalib.automaton.vpa.DefaultOneSEVPA; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultVPAlphabet; import net.automatalib.automaton.vpa.OneSEVPA; +import net.automatalib.automaton.vpa.impl.DefaultOneSEVPA; import net.automatalib.common.util.IOUtil; import net.automatalib.serialization.dot.GraphDOT; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/algorithms/active/observation-pack/pom.xml b/algorithms/active/observation-pack/pom.xml index 562ba255cf..c093c4e8be 100644 --- a/algorithms/active/observation-pack/pom.xml +++ b/algorithms/active/observation-pack/pom.xml @@ -96,6 +96,10 @@ limitations under the License. learnlib-membership-oracles test + + de.learnlib.testsupport + learnlib-test-support + net.automatalib diff --git a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/AbstractOPLearner.java b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/AbstractOPLearner.java index eb0da13828..69a0503b88 100644 --- a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/AbstractOPLearner.java +++ b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/AbstractOPLearner.java @@ -34,8 +34,8 @@ import de.learnlib.query.Query; import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/OPLearnerHypothesis.java b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/OPLearnerHypothesis.java index f79320e082..a8bd01934b 100644 --- a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/OPLearnerHypothesis.java +++ b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/hypothesis/OPLearnerHypothesis.java @@ -23,8 +23,8 @@ import de.learnlib.AccessSequenceTransformer; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.automaton.concept.StateIDs; import net.automatalib.graph.Graph; diff --git a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/package-info.java b/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/package-info.java deleted file mode 100644 index 245091449a..0000000000 --- a/algorithms/active/observation-pack/src/main/java/de/learnlib/algorithm/observationpack/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the Observation-Pack learning algorithm as described - * in the PhD thesis Active learning of interface programs by Falk - * Howar. - */ -package de.learnlib.algorithm.observationpack; diff --git a/algorithms/active/observation-pack/src/main/java/module-info.java b/algorithms/active/observation-pack/src/main/java/module-info.java new file mode 100644 index 0000000000..8c28422b08 --- /dev/null +++ b/algorithms/active/observation-pack/src/main/java/module-info.java @@ -0,0 +1,48 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 Observation-Pack learning algorithm as described in the PhD thesis Active learning of interface programs by Falk Howar. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-observation-pack</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.observationpack { + + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires de.learnlib.common.util; + requires de.learnlib.datastructure.discriminationtree; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.observationpack; + exports de.learnlib.algorithm.observationpack.dfa; + exports de.learnlib.algorithm.observationpack.hypothesis; + exports de.learnlib.algorithm.observationpack.mealy; + exports de.learnlib.algorithm.observationpack.moore; +} diff --git a/algorithms/active/observation-pack/src/test/java/de/learnlib/algorithm/observationpack/DTVisualizationTest.java b/algorithms/active/observation-pack/src/test/java/de/learnlib/algorithm/observationpack/DTVisualizationTest.java index c336a11da4..9273eedf37 100644 --- a/algorithms/active/observation-pack/src/test/java/de/learnlib/algorithm/observationpack/DTVisualizationTest.java +++ b/algorithms/active/observation-pack/src/test/java/de/learnlib/algorithm/observationpack/DTVisualizationTest.java @@ -20,10 +20,10 @@ import de.learnlib.algorithm.observationpack.mealy.OPLearnerMealy; import de.learnlib.algorithm.observationpack.mealy.OPLearnerMealyBuilder; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; import de.learnlib.oracle.membership.SULOracle; import de.learnlib.sul.SUL; import de.learnlib.testsupport.AbstractVisualizationTest; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; import net.automatalib.alphabet.Alphabet; import net.automatalib.serialization.dot.GraphDOT; import org.checkerframework.checker.initialization.qual.UnderInitialization; diff --git a/algorithms/active/oml/pom.xml b/algorithms/active/oml/pom.xml index bbfe28e09b..cfd14add0e 100644 --- a/algorithms/active/oml/pom.xml +++ b/algorithms/active/oml/pom.xml @@ -69,6 +69,10 @@ limitations under the License. de.learnlib.testsupport learnlib-learning-examples
+ + de.learnlib.testsupport + learnlib-test-support + net.automatalib diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java index 750b72b1f8..7cc92afb44 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarDFA.java @@ -23,8 +23,8 @@ import de.learnlib.algorithm.LearningAlgorithm.DFALearner; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.common.util.mapping.MutableMapping; import net.automatalib.word.Word; diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java index b96dac0beb..849f7db624 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/lstar/OptimalLStarMealy.java @@ -24,8 +24,8 @@ import de.learnlib.algorithm.LearningAlgorithm.MealyLearner; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.mapping.MutableMapping; import net.automatalib.word.Word; diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/package-info.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/package-info.java deleted file mode 100644 index a37b0ff712..0000000000 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementations of various learning algorithms based on the "optimal MAT - * learning" concept as described in the paper Active Automata - * Learning as Black-Box Search and Lazy Partition Refinement by Falk Howar and Bernhard Steffen. - */ -package de.learnlib.algorithm.oml; diff --git a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java index 63460b75c0..f2e87f45a8 100644 --- a/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java +++ b/algorithms/active/oml/src/main/java/de/learnlib/algorithm/oml/ttt/AbstractOptimalTTT.java @@ -29,8 +29,8 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.concept.InputAlphabetHolder; import net.automatalib.word.Word; diff --git a/algorithms/active/oml/src/main/java/module-info.java b/algorithms/active/oml/src/main/java/module-info.java new file mode 100644 index 0000000000..7ae26c6e98 --- /dev/null +++ b/algorithms/active/oml/src/main/java/module-info.java @@ -0,0 +1,46 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 implementations of various learning algorithms based on the "optimal MAT learning" concept + * as described in the paper Active Automata Learning as + * Black-Box Search and Lazy Partition Refinement by Falk Howar and Bernhard Steffen. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-oml</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.oml { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + exports de.learnlib.algorithm.oml.lstar; + exports de.learnlib.algorithm.oml.ttt; + exports de.learnlib.algorithm.oml.ttt.dfa; + exports de.learnlib.algorithm.oml.ttt.dt; + exports de.learnlib.algorithm.oml.ttt.mealy; + exports de.learnlib.algorithm.oml.ttt.pt; + exports de.learnlib.algorithm.oml.ttt.st; +} diff --git a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/adapter/dfa/KearnsVaziraniAdapterDFA.java b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/adapter/dfa/KearnsVaziraniAdapterDFA.java index 285d452675..ef1820ba78 100644 --- a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/adapter/dfa/KearnsVaziraniAdapterDFA.java +++ b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/adapter/dfa/KearnsVaziraniAdapterDFA.java @@ -20,7 +20,7 @@ import de.learnlib.algorithm.kv.dfa.KearnsVaziraniDFA; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.word.Word; /** diff --git a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/package-info.java b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/package-info.java deleted file mode 100644 index 4cac27fa96..0000000000 --- a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementations of various learning algorithms for systems of procedural - * automata such as the ones described in the papers Compositional - * learning of mutually recursive procedural systems and From Languages to Behaviors and Back by Markus Frohme and - * Bernhard Steffen. - */ -package de.learnlib.algorithm.procedural; diff --git a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/sba/SBALearner.java b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/sba/SBALearner.java index 62abf8012f..e42388b515 100644 --- a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/sba/SBALearner.java +++ b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/sba/SBALearner.java @@ -38,14 +38,14 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.fsa.DFA; -import net.automatalib.automaton.procedural.EmptySBA; import net.automatalib.automaton.procedural.SBA; -import net.automatalib.automaton.procedural.StackSBA; +import net.automatalib.automaton.procedural.impl.EmptySBA; +import net.automatalib.automaton.procedural.impl.StackSBA; import net.automatalib.common.util.Pair; import net.automatalib.common.util.mapping.Mapping; import net.automatalib.util.automaton.Automata; diff --git a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spa/SPALearner.java b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spa/SPALearner.java index 7fbea07967..e6cafe869f 100644 --- a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spa/SPALearner.java +++ b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spa/SPALearner.java @@ -38,13 +38,13 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.query.DefaultQuery; import de.learnlib.util.MQUtil; -import net.automatalib.alphabet.GrowingMapAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.fsa.DFA; -import net.automatalib.automaton.procedural.EmptySPA; import net.automatalib.automaton.procedural.SPA; -import net.automatalib.automaton.procedural.StackSPA; +import net.automatalib.automaton.procedural.impl.EmptySPA; +import net.automatalib.automaton.procedural.impl.StackSPA; import net.automatalib.common.util.mapping.Mapping; import net.automatalib.word.Word; import net.automatalib.word.WordBuilder; diff --git a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spmm/SPMMLearner.java b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spmm/SPMMLearner.java index 41dd4ae43f..922a71a1c4 100644 --- a/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spmm/SPMMLearner.java +++ b/algorithms/active/procedural/src/main/java/de/learnlib/algorithm/procedural/spmm/SPMMLearner.java @@ -35,13 +35,13 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.util.MQUtil; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; -import net.automatalib.automaton.procedural.EmptySPMM; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.procedural.SPMM; -import net.automatalib.automaton.procedural.StackSPMM; +import net.automatalib.automaton.procedural.impl.EmptySPMM; +import net.automatalib.automaton.procedural.impl.StackSPMM; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.common.util.Pair; import net.automatalib.common.util.mapping.Mapping; diff --git a/algorithms/active/procedural/src/main/java/module-info.java b/algorithms/active/procedural/src/main/java/module-info.java new file mode 100644 index 0000000000..37d0de9e03 --- /dev/null +++ b/algorithms/active/procedural/src/main/java/module-info.java @@ -0,0 +1,59 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 implementations of various learning algorithms for systems of procedural automata such as + * the ones described in the papers Compositional learning of + * mutually recursive procedural systems and From Languages + * to Behaviors and Back by Markus Frohme and Bernhard Steffen. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-procedural</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.procedural { + + requires com.google.common; + requires de.learnlib.algorithm.kv; + requires de.learnlib.algorithm.lstar; + requires de.learnlib.algorithm.observationpack; + requires de.learnlib.algorithm.oml; + requires de.learnlib.algorithm.ttt; + requires de.learnlib.api; + requires de.learnlib.common.util; + requires de.learnlib.common.counterexample; + requires de.learnlib.datastructure.observationtable; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + + exports de.learnlib.algorithm.procedural; + exports de.learnlib.algorithm.procedural.adapter.dfa; + exports de.learnlib.algorithm.procedural.adapter.mealy; + exports de.learnlib.algorithm.procedural.sba; + exports de.learnlib.algorithm.procedural.sba.manager; + exports de.learnlib.algorithm.procedural.spa; + exports de.learnlib.algorithm.procedural.spa.manager; + exports de.learnlib.algorithm.procedural.spmm; + exports de.learnlib.algorithm.procedural.spmm.manager; +} diff --git a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/ATManagerTest.java b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/ATManagerTest.java index 422d071aaf..4acf20b16a 100644 --- a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/ATManagerTest.java +++ b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/ATManagerTest.java @@ -18,9 +18,9 @@ import de.learnlib.algorithm.procedural.sba.manager.DefaultATManager; import de.learnlib.algorithm.procedural.sba.manager.OptimizingATManager; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/OptimizationsTest.java b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/OptimizationsTest.java index 33335873c7..951686c461 100644 --- a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/OptimizationsTest.java +++ b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/sba/OptimizationsTest.java @@ -21,11 +21,11 @@ import de.learnlib.algorithm.procedural.SymbolWrapper; import de.learnlib.algorithm.procedural.adapter.dfa.TTTAdapterDFA; import de.learnlib.algorithm.procedural.sba.manager.OptimizingATManager; -import de.learnlib.example.sba.ExamplePalindrome; import de.learnlib.oracle.equivalence.EQOracleChain; import de.learnlib.oracle.equivalence.SampleSetEQOracle; import de.learnlib.oracle.equivalence.sba.SimulatorEQOracle; import de.learnlib.oracle.membership.SimulatorOracle; +import de.learnlib.testsupport.example.sba.ExamplePalindrome; import de.learnlib.util.Experiment; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.automaton.procedural.SBA; diff --git a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spa/ATRManagerTest.java b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spa/ATRManagerTest.java index 56a8f1f7fe..60f8fbf84c 100644 --- a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spa/ATRManagerTest.java +++ b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spa/ATRManagerTest.java @@ -18,9 +18,9 @@ import de.learnlib.algorithm.procedural.spa.manager.DefaultATRManager; import de.learnlib.algorithm.procedural.spa.manager.OptimizingATRManager; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/ATManagerTest.java b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/ATManagerTest.java index aa486f1b6c..e466e90058 100644 --- a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/ATManagerTest.java +++ b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/ATManagerTest.java @@ -19,9 +19,9 @@ import de.learnlib.algorithm.procedural.spmm.manager.OptimizingATManager; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/OptimizationsTest.java b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/OptimizationsTest.java index a2e6eec38b..074f3640da 100644 --- a/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/OptimizationsTest.java +++ b/algorithms/active/procedural/src/test/java/de/learnlib/algorithm/procedural/spmm/OptimizationsTest.java @@ -21,11 +21,11 @@ import de.learnlib.algorithm.procedural.SymbolWrapper; import de.learnlib.algorithm.procedural.adapter.mealy.TTTAdapterMealy; import de.learnlib.algorithm.procedural.spmm.manager.OptimizingATManager; -import de.learnlib.example.spmm.ExamplePalindrome; import de.learnlib.oracle.equivalence.EQOracleChain; import de.learnlib.oracle.equivalence.SampleSetEQOracle; import de.learnlib.oracle.equivalence.spmm.SimulatorEQOracle; import de.learnlib.oracle.membership.SimulatorOracle; +import de.learnlib.testsupport.example.spmm.ExamplePalindrome; import de.learnlib.util.Experiment; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.automaton.procedural.SPMM; diff --git a/algorithms/active/ttt-vpa/src/main/java/de/learnlib/algorithm/ttt/vpa/package-info.java b/algorithms/active/ttt-vpa/src/main/java/module-info.java similarity index 50% rename from algorithms/active/ttt-vpa/src/main/java/de/learnlib/algorithm/ttt/vpa/package-info.java rename to algorithms/active/ttt-vpa/src/main/java/module-info.java index dc648c68cb..0c713c44b5 100644 --- a/algorithms/active/ttt-vpa/src/main/java/de/learnlib/algorithm/ttt/vpa/package-info.java +++ b/algorithms/active/ttt-vpa/src/main/java/module-info.java @@ -15,8 +15,30 @@ */ /** - * This package (and sub-packages) provides the implementation of the VPA adaption of the TTT learning algorithm as + * This module provides the implementation of the VPA adaption of the TTT learning algorithm as * presented in the PhD thesis Foundations of Active Automata * Learning: An Algorithmic Perspective by Malte Isberner. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-ttt-vpa</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.ttt.vpa; +open module de.learnlib.algorithm.ttt.vpa { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.algorithm.observationpack.vpa; + requires de.learnlib.common.counterexample; + requires de.learnlib.datastructure.discriminationtree; + requires net.automatalib.api; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.ttt.vpa; +} diff --git a/algorithms/active/ttt/pom.xml b/algorithms/active/ttt/pom.xml index 63a023953c..8ad7a84b3e 100644 --- a/algorithms/active/ttt/pom.xml +++ b/algorithms/active/ttt/pom.xml @@ -105,6 +105,10 @@ limitations under the License. learnlib-membership-oracles test
+ + de.learnlib.testsupport + learnlib-test-support + net.automatalib diff --git a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java index a309f64bcd..989df42270 100644 --- a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java +++ b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java @@ -22,9 +22,9 @@ import java.util.Map; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.GrowingAlphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.DeterministicAutomaton; import net.automatalib.automaton.FiniteAlphabetAutomaton; import net.automatalib.automaton.fsa.DFA; diff --git a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java index 09eaace879..fddc6a401f 100644 --- a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java +++ b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTLearner.java @@ -40,8 +40,8 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.common.smartcollection.ElementReference; import net.automatalib.common.smartcollection.UnorderedCollection; import net.automatalib.word.Word; diff --git a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/package-info.java b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/package-info.java deleted file mode 100644 index 6a170409db..0000000000 --- a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the TTT algorithm as described in the paper The TTT Algorithm: A Redundancy-Free Approach to Active Automata - * Learning by Malte Isberner, Falk Howar, and Bernhard Steffen. - */ -package de.learnlib.algorithm.ttt; diff --git a/algorithms/active/ttt/src/main/java/module-info.java b/algorithms/active/ttt/src/main/java/module-info.java new file mode 100644 index 0000000000..68b2a91863 --- /dev/null +++ b/algorithms/active/ttt/src/main/java/module-info.java @@ -0,0 +1,51 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 TTT algorithm as described in the paper The TTT Algorithm: A Redundancy-Free Approach to Active Automata + * Learning by Malte Isberner, Falk Howar, and Bernhard Steffen. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-ttt</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.ttt { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.common.counterexample; + requires de.learnlib.common.util; + requires de.learnlib.datastructure.discriminationtree; + requires de.learnlib.datastructure.list; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.algorithm.ttt.base; + exports de.learnlib.algorithm.ttt.dfa; + exports de.learnlib.algorithm.ttt.mealy; + exports de.learnlib.algorithm.ttt.moore; +} diff --git a/algorithms/active/ttt/src/test/java/de/learnlib/algorithm/ttt/TTTVisualizationTest.java b/algorithms/active/ttt/src/test/java/de/learnlib/algorithm/ttt/TTTVisualizationTest.java index 53cd4c0169..e14b0e7a37 100644 --- a/algorithms/active/ttt/src/test/java/de/learnlib/algorithm/ttt/TTTVisualizationTest.java +++ b/algorithms/active/ttt/src/test/java/de/learnlib/algorithm/ttt/TTTVisualizationTest.java @@ -20,10 +20,10 @@ import de.learnlib.algorithm.ttt.mealy.TTTLearnerMealy; import de.learnlib.algorithm.ttt.mealy.TTTLearnerMealyBuilder; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; import de.learnlib.oracle.membership.SULOracle; import de.learnlib.sul.SUL; import de.learnlib.testsupport.AbstractVisualizationTest; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; import net.automatalib.alphabet.Alphabet; import net.automatalib.serialization.dot.GraphDOT; import org.testng.Assert; diff --git a/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/OSTIA.java b/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/OSTIA.java index a49378cb21..10c9217c86 100644 --- a/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/OSTIA.java +++ b/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/OSTIA.java @@ -34,7 +34,7 @@ import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.GrowingAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.SubsequentialTransducer; import net.automatalib.common.smartcollection.IntSeq; import net.automatalib.common.util.Pair; diff --git a/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/package-info.java b/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/package-info.java deleted file mode 100644 index d8d2b923f0..0000000000 --- a/algorithms/passive/ostia/src/main/java/de/learnlib/algorithm/ostia/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (and sub-packages) provides the implementation of the "onward subsequential transducer inference - * algorithm" (OSTIA) learning algorithm as presented in the paper Learning - * Subsequential Transducers for Pattern Recognition Interpretation Tasks by Jose Oncina, Pedro García, and Enrique - * Vidal. - */ -package de.learnlib.algorithm.ostia; diff --git a/algorithms/passive/ostia/src/main/java/module-info.java b/algorithms/passive/ostia/src/main/java/module-info.java new file mode 100644 index 0000000000..7b250402e7 --- /dev/null +++ b/algorithms/passive/ostia/src/main/java/module-info.java @@ -0,0 +1,41 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 "onward subsequential transducer inference algorithm" (OSTIA) learning + * algorithm as presented in the paper Learning Subsequential Transducers + * for Pattern Recognition Interpretation Tasks by Jose Oncina, Pedro García, and Enrique Vidal. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-ostia</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.algorithm.ostia { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + exports de.learnlib.algorithm.ostia; +} diff --git a/algorithms/passive/ostia/src/test/java/de/learnlib/algorithm/ostia/OSTIATest.java b/algorithms/passive/ostia/src/test/java/de/learnlib/algorithm/ostia/OSTIATest.java index 02ebaba2cf..b2369ae77c 100644 --- a/algorithms/passive/ostia/src/test/java/de/learnlib/algorithm/ostia/OSTIATest.java +++ b/algorithms/passive/ostia/src/test/java/de/learnlib/algorithm/ostia/OSTIATest.java @@ -29,9 +29,9 @@ import com.google.common.collect.Iterables; import com.google.common.io.CharStreams; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactSST; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.SubsequentialTransducer; +import net.automatalib.automaton.transducer.impl.CompactSST; import net.automatalib.common.smartcollection.IntSeq; import net.automatalib.common.util.IOUtil; import net.automatalib.common.util.Pair; diff --git a/algorithms/passive/rpni/pom.xml b/algorithms/passive/rpni/pom.xml index 82d5768f3b..c7dca4acbb 100644 --- a/algorithms/passive/rpni/pom.xml +++ b/algorithms/passive/rpni/pom.xml @@ -100,4 +100,19 @@ limitations under the License. testng
+ + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} --add-reads=de.learnlib.algorithm.rpni=net.automatalib.core + + + + + diff --git a/algorithms/passive/rpni/src/main/java/de/learnlib/algorithm/rpni/package-info.java b/algorithms/passive/rpni/src/main/java/module-info.java similarity index 60% rename from algorithms/passive/rpni/src/main/java/de/learnlib/algorithm/rpni/package-info.java rename to algorithms/passive/rpni/src/main/java/module-info.java index dbab8194bf..cf1419b7bc 100644 --- a/algorithms/passive/rpni/src/main/java/de/learnlib/algorithm/rpni/package-info.java +++ b/algorithms/passive/rpni/src/main/java/module-info.java @@ -15,12 +15,32 @@ */ /** - * This package provides the implementation of (a blue-fringe version of) the "regular positive negative inference" + * This module provides the implementation of (a blue-fringe version of) the "regular positive negative inference" * (RPNI) learning algorithm as presented in the paper Inferring * regular languages in polynomial update time by Jose Oncina and Pedro García, including merging heuristics such as * the "evidence-driven state merging" (EDSM) and "minimum description length" (MDL) strategies. *

* More details on these implementations can be found in the book Grammatical Inference by Colin de la Higuera. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-rpni</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.rpni; +open module de.learnlib.algorithm.rpni { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.datastructure.pta; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires org.checkerframework.checker.qual; + + exports de.learnlib.algorithm.rpni; +} diff --git a/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/EDSMScoreTest.java b/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/EDSMScoreTest.java index 20173e61ab..655f8ac483 100644 --- a/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/EDSMScoreTest.java +++ b/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/EDSMScoreTest.java @@ -24,9 +24,9 @@ import de.learnlib.datastructure.pta.BlueFringePTAState; import de.learnlib.datastructure.pta.RedBlueMerge; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.common.smartcollection.IntSeq; import net.automatalib.util.automaton.Automata; import net.automatalib.util.automaton.builder.AutomatonBuilders; diff --git a/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/MDLScoreTest.java b/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/MDLScoreTest.java index 42c0d61913..29981ca254 100644 --- a/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/MDLScoreTest.java +++ b/algorithms/passive/rpni/src/test/java/de/learnlib/algorithm/rpni/MDLScoreTest.java @@ -21,7 +21,7 @@ import de.learnlib.datastructure.pta.BlueFringePTA; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; import net.automatalib.common.smartcollection.IntSeq; import net.automatalib.word.Word; diff --git a/api/src/main/java/de/learnlib/algorithm/package-info.java b/api/src/main/java/de/learnlib/algorithm/package-info.java index e010aaaff2..639e1ac4e1 100644 --- a/api/src/main/java/de/learnlib/algorithm/package-info.java +++ b/api/src/main/java/de/learnlib/algorithm/package-info.java @@ -15,6 +15,6 @@ */ /** - * This package (including sub-packages) contains the basic interfaces and classes of learning algorithms of LearnLib. + * This package contains the basic interfaces and classes of learning algorithms of LearnLib. */ package de.learnlib.algorithm; diff --git a/api/src/main/java/de/learnlib/oracle/parallelism/BatchInterruptedException.java b/api/src/main/java/de/learnlib/exception/BatchInterruptedException.java similarity index 93% rename from api/src/main/java/de/learnlib/oracle/parallelism/BatchInterruptedException.java rename to api/src/main/java/de/learnlib/exception/BatchInterruptedException.java index dd7dad2b3c..70ee1e07b7 100644 --- a/api/src/main/java/de/learnlib/oracle/parallelism/BatchInterruptedException.java +++ b/api/src/main/java/de/learnlib/exception/BatchInterruptedException.java @@ -13,10 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.oracle.parallelism; +package de.learnlib.exception; import java.util.Collection; +import de.learnlib.oracle.BatchProcessor; + /** * Exception that is thrown if a parallel batch is interrupted during processing. Note that we cannot rethrow the {@link * InterruptedException} since the {@code throws} specification of {@link BatchProcessor#processBatch(Collection)} does diff --git a/api/src/main/java/de/learnlib/oracle/parallelism/BatchProcessor.java b/api/src/main/java/de/learnlib/oracle/BatchProcessor.java similarity index 93% rename from api/src/main/java/de/learnlib/oracle/parallelism/BatchProcessor.java rename to api/src/main/java/de/learnlib/oracle/BatchProcessor.java index 576e043474..f6f64f1969 100644 --- a/api/src/main/java/de/learnlib/oracle/parallelism/BatchProcessor.java +++ b/api/src/main/java/de/learnlib/oracle/BatchProcessor.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.oracle.parallelism; +package de.learnlib.oracle; import java.util.Collection; -import de.learnlib.oracle.MembershipOracle; +import de.learnlib.exception.BatchInterruptedException; /** * A markup interface for classes that can process a batch of work in a parallel environment (e.g. a {@link diff --git a/api/src/main/java/de/learnlib/oracle/MembershipOracle.java b/api/src/main/java/de/learnlib/oracle/MembershipOracle.java index ce54f25154..85777158e2 100644 --- a/api/src/main/java/de/learnlib/oracle/MembershipOracle.java +++ b/api/src/main/java/de/learnlib/oracle/MembershipOracle.java @@ -18,7 +18,6 @@ import java.util.Collection; import java.util.Collections; -import de.learnlib.oracle.parallelism.BatchProcessor; import de.learnlib.query.DefaultQuery; import de.learnlib.query.Query; import net.automatalib.automaton.fsa.DFA; diff --git a/api/src/main/java/de/learnlib/oracle/OmegaMembershipOracle.java b/api/src/main/java/de/learnlib/oracle/OmegaMembershipOracle.java index a3dcae13db..0c23010fe0 100644 --- a/api/src/main/java/de/learnlib/oracle/OmegaMembershipOracle.java +++ b/api/src/main/java/de/learnlib/oracle/OmegaMembershipOracle.java @@ -20,7 +20,6 @@ import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; -import de.learnlib.oracle.parallelism.BatchProcessor; import de.learnlib.query.OmegaQuery; import de.learnlib.sul.ObservableSUL; import net.automatalib.common.util.Pair; diff --git a/api/src/main/java/de/learnlib/oracle/parallelism/ParallelOmegaOracle.java b/api/src/main/java/de/learnlib/oracle/ParallelOmegaOracle.java similarity index 91% rename from api/src/main/java/de/learnlib/oracle/parallelism/ParallelOmegaOracle.java rename to api/src/main/java/de/learnlib/oracle/ParallelOmegaOracle.java index 182698dbe9..baa01c806c 100644 --- a/api/src/main/java/de/learnlib/oracle/parallelism/ParallelOmegaOracle.java +++ b/api/src/main/java/de/learnlib/oracle/ParallelOmegaOracle.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.oracle.parallelism; - -import de.learnlib.oracle.OmegaMembershipOracle; +package de.learnlib.oracle; /** * {@link ParallelOracle} equivalent for {@link OmegaMembershipOracle}. diff --git a/api/src/main/java/de/learnlib/oracle/parallelism/ParallelOracle.java b/api/src/main/java/de/learnlib/oracle/ParallelOracle.java similarity index 93% rename from api/src/main/java/de/learnlib/oracle/parallelism/ParallelOracle.java rename to api/src/main/java/de/learnlib/oracle/ParallelOracle.java index b28f2c5bf6..785c0314db 100644 --- a/api/src/main/java/de/learnlib/oracle/parallelism/ParallelOracle.java +++ b/api/src/main/java/de/learnlib/oracle/ParallelOracle.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.oracle.parallelism; - -import de.learnlib.oracle.MembershipOracle; +package de.learnlib.oracle; /** * Basic interface for {@link MembershipOracle}s that can process queries in parallel. diff --git a/api/src/main/java/de/learnlib/oracle/parallelism/ThreadPool.java b/api/src/main/java/de/learnlib/oracle/ThreadPool.java similarity index 98% rename from api/src/main/java/de/learnlib/oracle/parallelism/ThreadPool.java rename to api/src/main/java/de/learnlib/oracle/ThreadPool.java index eeec1ba219..a25cb9da1b 100644 --- a/api/src/main/java/de/learnlib/oracle/parallelism/ThreadPool.java +++ b/api/src/main/java/de/learnlib/oracle/ThreadPool.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.oracle.parallelism; +package de.learnlib.oracle; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; diff --git a/api/src/main/java/de/learnlib/oracle/package-info.java b/api/src/main/java/de/learnlib/oracle/package-info.java index 5ad8aaeedf..e329a1e920 100644 --- a/api/src/main/java/de/learnlib/oracle/package-info.java +++ b/api/src/main/java/de/learnlib/oracle/package-info.java @@ -15,7 +15,7 @@ */ /** - * This package (including sub-packages) contains the basic interfaces and classes for describing and implementing - * various types of oracles used throughout LearnLib. + * This package contains the basic interfaces and classes for describing and implementing various types of oracles used + * throughout LearnLib. */ package de.learnlib.oracle; diff --git a/api/src/main/java/module-info.java b/api/src/main/java/module-info.java new file mode 100644 index 0000000000..be44554115 --- /dev/null +++ b/api/src/main/java/module-info.java @@ -0,0 +1,44 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 core interfaces of LearnLib. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-api</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.api { + + requires net.automatalib.api; + requires net.automatalib.common.util; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + exports de.learnlib; + exports de.learnlib.algorithm; + exports de.learnlib.exception; + exports de.learnlib.logging; + exports de.learnlib.oracle; + exports de.learnlib.query; + exports de.learnlib.statistic; + exports de.learnlib.sul; +} diff --git a/archetypes/basic/src/main/resources/archetype-resources/src/main/java/Example.java b/archetypes/basic/src/main/resources/archetype-resources/src/main/java/Example.java index cc70c5005e..4b108515b3 100644 --- a/archetypes/basic/src/main/resources/archetype-resources/src/main/java/Example.java +++ b/archetypes/basic/src/main/resources/archetype-resources/src/main/java/Example.java @@ -12,9 +12,9 @@ import de.learnlib.util.Experiment.DFAExperiment; import de.learnlib.util.statistic.SimpleProfiler; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.visualization.Visualization; diff --git a/archetypes/complete/src/main/resources/archetype-resources/src/main/java/Example.java b/archetypes/complete/src/main/resources/archetype-resources/src/main/java/Example.java index cc70c5005e..4b108515b3 100644 --- a/archetypes/complete/src/main/resources/archetype-resources/src/main/java/Example.java +++ b/archetypes/complete/src/main/resources/archetype-resources/src/main/java/Example.java @@ -12,9 +12,9 @@ import de.learnlib.util.Experiment.DFAExperiment; import de.learnlib.util.statistic.SimpleProfiler; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.visualization.Visualization; diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 8e231fafdf..6adae30f93 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -109,6 +109,7 @@ limitations under the License. /learnlib-pmd-ruleset.xml + **/module-info.java @@ -127,6 +128,7 @@ limitations under the License. /learnlib-checkstyle-suppressions.xml true false + **/module-info.java diff --git a/commons/counterexamples/src/main/java/module-info.java b/commons/counterexamples/src/main/java/module-info.java new file mode 100644 index 0000000000..1c075f4b39 --- /dev/null +++ b/commons/counterexamples/src/main/java/module-info.java @@ -0,0 +1,38 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a collection of algorithms for handling counterexamples in automata learning. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-counterexamples</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.common.counterexample { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires org.checkerframework.checker.qual; + + exports de.learnlib.acex; + exports de.learnlib.counterexample; +} diff --git a/commons/settings/pom.xml b/commons/settings/pom.xml index a5118e6695..5cd4b9c17e 100644 --- a/commons/settings/pom.xml +++ b/commons/settings/pom.xml @@ -69,4 +69,28 @@ limitations under the License. testng
+ + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + classpath-test + test + + test + + + false + + + + + + + diff --git a/commons/settings/src/main/java/de/learnlib/setting/LearnLibProperty.java b/commons/settings/src/main/java/de/learnlib/setting/LearnLibProperty.java index 98fd7b462e..c67e9d9c6e 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/LearnLibProperty.java +++ b/commons/settings/src/main/java/de/learnlib/setting/LearnLibProperty.java @@ -15,6 +15,8 @@ */ package de.learnlib.setting; +import de.learnlib.oracle.ThreadPool.PoolPolicy; + /** * An enum of all the system properties currently used by LearnLib. */ @@ -38,8 +40,8 @@ public enum LearnLibProperty { * {@code learnlib.parallel.pool_policy}. *

* Pool policy for threads of parallel oracles. - *

- * See de.learnlib.oracle.parallelism.ParallelOracle#PoolPolicy + * + * @see PoolPolicy */ PARALLEL_POOL_POLICY("parallel.pool_policy"), diff --git a/commons/settings/src/main/java/de/learnlib/setting/LearnLibSettings.java b/commons/settings/src/main/java/de/learnlib/setting/LearnLibSettings.java index 6cead93953..6b12f6eaf4 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/LearnLibSettings.java +++ b/commons/settings/src/main/java/de/learnlib/setting/LearnLibSettings.java @@ -34,7 +34,7 @@ public final class LearnLibSettings { private final Properties properties; private LearnLibSettings() { - properties = SettingsSource.readSettings(LearnLibSettingsSource.class); + properties = SettingsSource.readSettings(SettingsSource.class); } public static LearnLibSettings getInstance() { diff --git a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesAutomataLibSettingsSource.java b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesAutomataLibSettingsSource.java index 12c23cc195..74325d6ac7 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesAutomataLibSettingsSource.java +++ b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesAutomataLibSettingsSource.java @@ -17,9 +17,10 @@ import net.automatalib.AutomataLibSettingsSource; import net.automatalib.common.util.setting.LocalFileSource; +import net.automatalib.common.util.setting.SettingsSource; import org.kohsuke.MetaInfServices; -@MetaInfServices(AutomataLibSettingsSource.class) +@MetaInfServices(SettingsSource.class) public class LearnLibLocalPropertiesAutomataLibSettingsSource extends LocalFileSource implements AutomataLibSettingsSource { diff --git a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesSource.java b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesSource.java index 9b0f13fa63..202864b6e3 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesSource.java +++ b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibLocalPropertiesSource.java @@ -17,9 +17,10 @@ import de.learnlib.setting.LearnLibSettingsSource; import net.automatalib.common.util.setting.LocalFileSource; +import net.automatalib.common.util.setting.SettingsSource; import org.kohsuke.MetaInfServices; -@MetaInfServices(LearnLibSettingsSource.class) +@MetaInfServices(SettingsSource.class) public class LearnLibLocalPropertiesSource extends LocalFileSource implements LearnLibSettingsSource { public LearnLibLocalPropertiesSource() { diff --git a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesAutomataLibSettingsSource.java b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesAutomataLibSettingsSource.java index a28d97e2bc..22f5e3b8bf 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesAutomataLibSettingsSource.java +++ b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesAutomataLibSettingsSource.java @@ -17,9 +17,10 @@ import net.automatalib.AutomataLibSettingsSource; import net.automatalib.common.util.setting.AbstractClassPathFileSource; +import net.automatalib.common.util.setting.SettingsSource; import org.kohsuke.MetaInfServices; -@MetaInfServices(AutomataLibSettingsSource.class) +@MetaInfServices(SettingsSource.class) public class LearnLibPropertiesAutomataLibSettingsSource extends AbstractClassPathFileSource implements AutomataLibSettingsSource { diff --git a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesSource.java b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesSource.java index 1e7e3db794..941eb06bcd 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesSource.java +++ b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibPropertiesSource.java @@ -17,9 +17,10 @@ import de.learnlib.setting.LearnLibSettingsSource; import net.automatalib.common.util.setting.AbstractClassPathFileSource; +import net.automatalib.common.util.setting.SettingsSource; import org.kohsuke.MetaInfServices; -@MetaInfServices(LearnLibSettingsSource.class) +@MetaInfServices(SettingsSource.class) public class LearnLibPropertiesSource extends AbstractClassPathFileSource implements LearnLibSettingsSource { public LearnLibPropertiesSource() { diff --git a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesAutomataLibSettingsSource.java b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesAutomataLibSettingsSource.java index 9d72658a66..a618f5344e 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesAutomataLibSettingsSource.java +++ b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesAutomataLibSettingsSource.java @@ -17,8 +17,9 @@ import net.automatalib.AutomataLibSettingsSource; import net.automatalib.common.util.setting.AbstractSystemPropertiesSource; +import net.automatalib.common.util.setting.SettingsSource; import org.kohsuke.MetaInfServices; -@MetaInfServices(AutomataLibSettingsSource.class) +@MetaInfServices(SettingsSource.class) public class LearnLibSystemPropertiesAutomataLibSettingsSource extends AbstractSystemPropertiesSource implements AutomataLibSettingsSource {} diff --git a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesSource.java b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesSource.java index ed0990f899..09484947a0 100644 --- a/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesSource.java +++ b/commons/settings/src/main/java/de/learnlib/setting/sources/LearnLibSystemPropertiesSource.java @@ -17,7 +17,8 @@ import de.learnlib.setting.LearnLibSettingsSource; import net.automatalib.common.util.setting.AbstractSystemPropertiesSource; +import net.automatalib.common.util.setting.SettingsSource; import org.kohsuke.MetaInfServices; -@MetaInfServices(LearnLibSettingsSource.class) +@MetaInfServices(SettingsSource.class) public class LearnLibSystemPropertiesSource extends AbstractSystemPropertiesSource implements LearnLibSettingsSource {} diff --git a/commons/settings/src/main/java/module-info.java b/commons/settings/src/main/java/module-info.java new file mode 100644 index 0000000000..c647ee331f --- /dev/null +++ b/commons/settings/src/main/java/module-info.java @@ -0,0 +1,51 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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. + */ + +import de.learnlib.setting.sources.LearnLibLocalPropertiesAutomataLibSettingsSource; +import de.learnlib.setting.sources.LearnLibLocalPropertiesSource; +import de.learnlib.setting.sources.LearnLibPropertiesAutomataLibSettingsSource; +import de.learnlib.setting.sources.LearnLibPropertiesSource; +import de.learnlib.setting.sources.LearnLibSystemPropertiesAutomataLibSettingsSource; +import de.learnlib.setting.sources.LearnLibSystemPropertiesSource; +import net.automatalib.common.util.setting.SettingsSource; + +/** + * This module provides a collection of utility methods to parse LearnLib specific settings. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-settings</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.setting { + + requires de.learnlib.api; + requires net.automatalib.common.util; + requires net.automatalib.api; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static org.kohsuke.metainf_services; + + exports de.learnlib.setting; + exports de.learnlib.setting.sources; + + provides SettingsSource with LearnLibLocalPropertiesAutomataLibSettingsSource, LearnLibPropertiesAutomataLibSettingsSource, LearnLibSystemPropertiesAutomataLibSettingsSource, LearnLibLocalPropertiesSource, LearnLibPropertiesSource, LearnLibSystemPropertiesSource; +} diff --git a/commons/util/src/main/java/de/learnlib/util/nfa/NFALearnerWrapper.java b/commons/util/src/main/java/de/learnlib/util/nfa/NFALearnerWrapper.java index 7d78e9673b..6c7f3c6998 100644 --- a/commons/util/src/main/java/de/learnlib/util/nfa/NFALearnerWrapper.java +++ b/commons/util/src/main/java/de/learnlib/util/nfa/NFALearnerWrapper.java @@ -18,8 +18,8 @@ import de.learnlib.algorithm.LearningAlgorithm; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.NFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.fsa.NFAs; public class NFALearnerWrapper implements LearningAlgorithm.DFALearner { diff --git a/commons/util/src/main/java/module-info.java b/commons/util/src/main/java/module-info.java new file mode 100644 index 0000000000..e48f7a5f71 --- /dev/null +++ b/commons/util/src/main/java/module-info.java @@ -0,0 +1,45 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a collection of utility methods for learning setups (oracle wrappers, etc.). + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-util</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.common.util { + + requires de.learnlib.api; + requires de.learnlib.filter.statistic; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + exports de.learnlib.util; + exports de.learnlib.util.mealy; + exports de.learnlib.util.moore; + exports de.learnlib.util.nfa; + exports de.learnlib.util.statistic; +} diff --git a/commons/util/src/test/java/de/learnlib/util/ExperimentTest.java b/commons/util/src/test/java/de/learnlib/util/ExperimentTest.java index bbd27c5e84..ad052f7b1f 100644 --- a/commons/util/src/test/java/de/learnlib/util/ExperimentTest.java +++ b/commons/util/src/test/java/de/learnlib/util/ExperimentTest.java @@ -24,9 +24,9 @@ import de.learnlib.util.Experiment.DFAExperiment; import de.learnlib.util.statistic.SimpleProfiler; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/datastructures/discrimination-tree/pom.xml b/datastructures/discrimination-tree/pom.xml index 51801ecdaa..bea44bc030 100644 --- a/datastructures/discrimination-tree/pom.xml +++ b/datastructures/discrimination-tree/pom.xml @@ -28,7 +28,7 @@ limitations under the License. learnlib-datastructure-dt LearnLib :: Datastructures :: Discrimination Tree - Data- and utility classes for Discrimination Trees + Data and utility classes for discrimination trees diff --git a/datastructures/discrimination-tree/src/main/java/module-info.java b/datastructures/discrimination-tree/src/main/java/module-info.java new file mode 100644 index 0000000000..3bfb23f8bb --- /dev/null +++ b/datastructures/discrimination-tree/src/main/java/module-info.java @@ -0,0 +1,43 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 data and utility classes for discrimination trees. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-datastructure-dt</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.datastructure.discriminationtree { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.datastructure.list; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + + exports de.learnlib.datastructure.discriminationtree; + exports de.learnlib.datastructure.discriminationtree.iterators; + exports de.learnlib.datastructure.discriminationtree.model; +} diff --git a/datastructures/list/pom.xml b/datastructures/list/pom.xml index 410f4816c5..0d4cb64133 100644 --- a/datastructures/list/pom.xml +++ b/datastructures/list/pom.xml @@ -28,7 +28,7 @@ limitations under the License. learnlib-datastructure-list LearnLib :: Datastructures :: List - Data- and utility classes for Lists + Data and utility classes for lists diff --git a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/package-info.java b/datastructures/list/src/main/java/module-info.java similarity index 56% rename from algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/package-info.java rename to datastructures/list/src/main/java/module-info.java index 525abdc550..c7d09ea9cf 100644 --- a/algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/package-info.java +++ b/datastructures/list/src/main/java/module-info.java @@ -15,8 +15,21 @@ */ /** - * This package (and sub-packages) 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 provides data and utility classes for lists. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-datastructure-list</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.aaar; +open module de.learnlib.datastructure.list { + + requires com.google.common; + requires org.checkerframework.checker.qual; + + exports de.learnlib.datastructure.list; +} diff --git a/datastructures/observation-table/pom.xml b/datastructures/observation-table/pom.xml index b3aff6ab40..bcc69ade83 100644 --- a/datastructures/observation-table/pom.xml +++ b/datastructures/observation-table/pom.xml @@ -27,8 +27,8 @@ limitations under the License. learnlib-datastructure-ot - LearnLib :: Datastructures :: Observationtable - Data- and utility classes for Observation Tables + LearnLib :: Datastructures :: Observation Table + Data and utility classes for observation tables diff --git a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/GenericObservationTable.java b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/GenericObservationTable.java index 65aa9d4ff9..f1eaaad558 100644 --- a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/GenericObservationTable.java +++ b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/GenericObservationTable.java @@ -28,7 +28,7 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/OTUtils.java b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/OTUtils.java index f9720adb97..f988c29bf2 100644 --- a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/OTUtils.java +++ b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/OTUtils.java @@ -15,8 +15,6 @@ */ package de.learnlib.datastructure.observationtable; -import java.awt.Desktop; -import java.awt.HeadlessException; import java.io.File; import java.io.IOException; import java.io.Writer; @@ -65,72 +63,79 @@ public static ObservationTable fromString(String source, return reader.read(source, alphabet); } - public static void writeHTMLToFile(ObservationTable table, File file) throws IOException { - writeHTMLToFile(table, file, Objects::toString, Objects::toString); - } - - public static void writeHTMLToFile(ObservationTable table, - File file, - Function, ? extends String> wordToString, - Function outputToString) throws IOException { - - try (Writer w = IOUtil.asBufferedUTF8Writer(file)) { - w.write(HTML_FILE_HEADER); - ObservationTableHTMLWriter otWriter = new ObservationTableHTMLWriter<>(wordToString, outputToString); - otWriter.write(table, w); - w.write(HTML_FILE_FOOTER); - } + /** + * Convenience method for {@link #writeHTMLToFile(ObservationTable, File)} that automatically creates (and returns) + * a temporary file to write to. Note that the file is {@link File#deleteOnExit() deleted} upon VM termination. + * + * @param table + * the observation table to write to the file + * @param + * input symbol type + * @param + * output domain type + * + * @return the temporary file with the observation table's contents written to + * + * @throws IOException + * when writing to the file fails + */ + public static File writeHTMLToFile(ObservationTable table) throws IOException { + final File file = File.createTempFile("learnlib-ot", ".html"); + file.deleteOnExit(); + writeHTMLToFile(table, file); + return file; } /** - * Convenience method for {@link #displayHTMLInBrowser(ObservationTable, Function, Function)} that uses {@link - * Object#toString()} to render words and outputs of the observation table. + * Convenience method for {@link #writeHTMLToFile(ObservationTable, File, Function, Function)} that uses + * {@link Object#toString()} to render words and outputs of the observation table. + * + * @param table + * the observation table to write to the file + * @param file + * the file to write to + * @param + * input symbol type + * @param + * output domain type + * + * @throws IOException + * when writing to the file fails */ - public static void displayHTMLInBrowser(ObservationTable table) throws IOException { - displayHTMLInBrowser(table, Objects::toString, Objects::toString); + public static void writeHTMLToFile(ObservationTable table, File file) throws IOException { + writeHTMLToFile(table, file, Objects::toString, Objects::toString); } /** - * Displays the observation table as an HTML document in the default browser. - *

- * This method internally relies on {@link Desktop#browse(java.net.URI)}, hence it will not work if {@link Desktop} - * is not supported, or if the application is running in headless mode. - *

- * IMPORTANT NOTE: Calling this method may delay the termination of the JVM by up to 5 seconds. This is due - * to the fact that the temporary file created in this method is marked for deletion upon JVM termination. If the - * JVM terminates too early, it might be deleted before it was loaded by the browser. + * Writes the contents of a given observation table into a file using HTML as a (markup) language and the given + * functions to display inputs and outputs. * * @param table - * the observation table to display + * the observation table to write to the file + * @param file + * the file to write to * @param wordToString - * the transformation from words to strings. This transformation is not required nor expected to - * escape HTML entities + * the input word renderer * @param outputToString - * the transformation from outputs to strings. This transformation is not required nor expected to - * escape HTML entities + * the output value renderer + * @param + * input symbol type + * @param + * output domain type * * @throws IOException - * if creating or writing to the temporary file fails - * @throws HeadlessException - * if the JVM is running in headless mode - * @throws UnsupportedOperationException - * if {@link Desktop#getDesktop()} is not supported by the system + * when writing to the file fails */ - public static void displayHTMLInBrowser(ObservationTable table, - Function, ? extends String> wordToString, - Function outputToString) - throws IOException { - File tempFile = File.createTempFile("learnlib-ot", ".html"); - - // Doing this might cause problems if the startup delay of the browser - // causes it to start only after the JVM has exited. - // Temp directory should be wiped regularly anyway. - // tempFile.deleteOnExit(); - writeHTMLToFile(table, tempFile, wordToString, outputToString); + public static void writeHTMLToFile(ObservationTable table, + File file, + Function, ? extends String> wordToString, + Function outputToString) throws IOException { - Desktop desktop = Desktop.getDesktop(); - // We use browse() instead of open() because, e.g., web developers may have - // an HTML editor set up as their default application to open HTML files - desktop.browse(tempFile.toURI()); + try (Writer w = IOUtil.asBufferedUTF8Writer(file)) { + w.write(HTML_FILE_HEADER); + ObservationTableHTMLWriter otWriter = new ObservationTableHTMLWriter<>(wordToString, outputToString); + otWriter.write(table, w); + w.write(HTML_FILE_FOOTER); + } } } diff --git a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/reader/SimpleObservationTable.java b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/reader/SimpleObservationTable.java index dc4c2f72bd..44bc142804 100644 --- a/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/reader/SimpleObservationTable.java +++ b/datastructures/observation-table/src/main/java/de/learnlib/datastructure/observationtable/reader/SimpleObservationTable.java @@ -23,7 +23,7 @@ import de.learnlib.datastructure.observationtable.ObservationTable; import de.learnlib.datastructure.observationtable.Row; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/datastructures/observation-table/src/main/java/module-info.java b/datastructures/observation-table/src/main/java/module-info.java new file mode 100644 index 0000000000..e9786f50ab --- /dev/null +++ b/datastructures/observation-table/src/main/java/module-info.java @@ -0,0 +1,42 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 data and utility classes for observation tables. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-datastructure-ot</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.datastructure.observationtable { + + requires com.google.common; + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + exports de.learnlib.datastructure.observationtable; + exports de.learnlib.datastructure.observationtable.reader; + exports de.learnlib.datastructure.observationtable.writer; +} diff --git a/datastructures/observation-table/src/test/java/de/learnlib/datastructure/observationtable/writer/SuffixASCIIWriterTest.java b/datastructures/observation-table/src/test/java/de/learnlib/datastructure/observationtable/writer/SuffixASCIIWriterTest.java index 615804cf3a..1db6ac1a3e 100644 --- a/datastructures/observation-table/src/test/java/de/learnlib/datastructure/observationtable/writer/SuffixASCIIWriterTest.java +++ b/datastructures/observation-table/src/test/java/de/learnlib/datastructure/observationtable/writer/SuffixASCIIWriterTest.java @@ -20,7 +20,7 @@ import de.learnlib.datastructure.observationtable.ObservationTableSource; import de.learnlib.datastructure.observationtable.reader.SuffixASCIIReader; import net.automatalib.alphabet.GrowingAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/datastructures/pta/pom.xml b/datastructures/pta/pom.xml index 939f851e72..8f840c8dce 100644 --- a/datastructures/pta/pom.xml +++ b/datastructures/pta/pom.xml @@ -28,7 +28,7 @@ limitations under the License. learnlib-datastructure-pta LearnLib :: Datastructures :: PTA - Data- and utility classes for Prefix-Tree-Acceptors + Data and utility classes for prefix tree acceptors diff --git a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTA.java b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTA.java index 050ef5a5dd..e82b1e5798 100644 --- a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTA.java +++ b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTA.java @@ -15,7 +15,6 @@ */ package de.learnlib.datastructure.pta; -import java.awt.Color; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTAState.java b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTAState.java index 6810f76fda..0645a67c97 100644 --- a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTAState.java +++ b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/AbstractBlueFringePTAState.java @@ -15,8 +15,6 @@ */ package de.learnlib.datastructure.pta; -import java.awt.Color; - import net.automatalib.common.util.comparison.CmpUtil; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/BasePTA.java b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/BasePTA.java index efea0d619a..1bf52de8e8 100644 --- a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/BasePTA.java +++ b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/BasePTA.java @@ -28,7 +28,7 @@ import com.google.common.collect.AbstractIterator; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.FiniteAlphabetAutomaton; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.automaton.graph.TransitionEdge; diff --git a/commons/util/src/main/java/de/learnlib/util/package-info.java b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/Color.java similarity index 68% rename from commons/util/src/main/java/de/learnlib/util/package-info.java rename to datastructures/pta/src/main/java/de/learnlib/datastructure/pta/Color.java index 9cbf362c06..eb93e263e4 100644 --- a/commons/util/src/main/java/de/learnlib/util/package-info.java +++ b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/Color.java @@ -13,8 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package de.learnlib.datastructure.pta; /** - * This package (and sub-packages) provide general utilities used throughout LearnLib. + * Indicates the coloring of states of the prefix-tree acceptor during merging. */ -package de.learnlib.util; +public enum Color { + /** + * Indicates a blue state. + */ + BLUE, + /** + * Indicates a red state. + */ + RED, + /** + * Indicates a white state. + */ + WHITE +} diff --git a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/RedBlueMerge.java b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/RedBlueMerge.java index 2923f0dbc5..685a831e90 100644 --- a/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/RedBlueMerge.java +++ b/datastructures/pta/src/main/java/de/learnlib/datastructure/pta/RedBlueMerge.java @@ -15,7 +15,6 @@ */ package de.learnlib.datastructure.pta; -import java.awt.Color; import java.util.ArrayDeque; import java.util.Collection; import java.util.Deque; diff --git a/datastructures/pta/src/main/java/module-info.java b/datastructures/pta/src/main/java/module-info.java new file mode 100644 index 0000000000..cd1514f243 --- /dev/null +++ b/datastructures/pta/src/main/java/module-info.java @@ -0,0 +1,41 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 data and utility classes for prefix tree acceptors. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-datastructure-pta</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.datastructure.pta { + + requires com.google.common; + requires net.automatalib.api; + requires net.automatalib.common.smartcollection; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + exports de.learnlib.datastructure.pta; + exports de.learnlib.datastructure.pta.config; + exports de.learnlib.datastructure.pta.wrapper; +} diff --git a/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/MergedAutomatonTest.java b/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/MergedAutomatonTest.java index d9724bfdaa..5a564c50c9 100644 --- a/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/MergedAutomatonTest.java +++ b/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/MergedAutomatonTest.java @@ -19,7 +19,7 @@ import java.util.List; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.word.Word; import org.testng.Assert; diff --git a/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/PTAVisualizationTest.java b/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/PTAVisualizationTest.java index 3df130ded9..edf9f4b5d9 100644 --- a/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/PTAVisualizationTest.java +++ b/datastructures/pta/src/test/java/de/learnlib/datastructure/pta/PTAVisualizationTest.java @@ -22,8 +22,8 @@ import com.google.common.io.CharStreams; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMoore; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.common.util.IOUtil; import net.automatalib.serialization.dot.GraphDOT; import net.automatalib.util.automaton.builder.AutomatonBuilders; diff --git a/distribution/pom.xml b/distribution/pom.xml index 3bfbb4753b..86bf59ef24 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -505,6 +505,11 @@ limitations under the License. ${project.build.directory}/bundles true learnlib-${project.version} + + + de.learnlib.distribution + + diff --git a/distribution/src/main/assembly/learnlib-bundle.xml b/distribution/src/main/assembly/learnlib-bundle.xml index 64007ea6eb..e6f83a1316 100644 --- a/distribution/src/main/assembly/learnlib-bundle.xml +++ b/distribution/src/main/assembly/learnlib-bundle.xml @@ -53,6 +53,11 @@ limitations under the License. false true + + + **/module-info.class + + diff --git a/distribution/src/main/assembly/learnlib-dependencies-bundle.xml b/distribution/src/main/assembly/learnlib-dependencies-bundle.xml index 784b444392..e1134cef44 100644 --- a/distribution/src/main/assembly/learnlib-dependencies-bundle.xml +++ b/distribution/src/main/assembly/learnlib-dependencies-bundle.xml @@ -53,6 +53,11 @@ limitations under the License. false true + + + **/module-info.class + + diff --git a/drivers/basic/pom.xml b/drivers/basic/pom.xml index be4b7ed878..ff2cede404 100644 --- a/drivers/basic/pom.xml +++ b/drivers/basic/pom.xml @@ -28,7 +28,7 @@ limitations under the License. learnlib-drivers-basic LearnLib :: Drivers :: Basic - Basic Test Driver Generation Support + Basic support for test driver creation diff --git a/drivers/basic/src/main/java/de/learnlib/driver/reflect/SimplePOJOTestDriver.java b/drivers/basic/src/main/java/de/learnlib/driver/reflect/SimplePOJOTestDriver.java index 5ca1885f57..a89cb468cd 100644 --- a/drivers/basic/src/main/java/de/learnlib/driver/reflect/SimplePOJOTestDriver.java +++ b/drivers/basic/src/main/java/de/learnlib/driver/reflect/SimplePOJOTestDriver.java @@ -22,7 +22,7 @@ import de.learnlib.sul.SUL; import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.GrowingAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.common.util.ReflectUtil; /** diff --git a/drivers/basic/src/main/java/module-info.java b/drivers/basic/src/main/java/module-info.java new file mode 100644 index 0000000000..2724c0d5b6 --- /dev/null +++ b/drivers/basic/src/main/java/module-info.java @@ -0,0 +1,39 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 basic support for test driver creation. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-drivers-basic</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.driver { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + exports de.learnlib.driver; + exports de.learnlib.driver.reflect; +} diff --git a/drivers/mapper/src/main/java/de/learnlib/mapper/StringMapper.java b/drivers/mapper/src/main/java/de/learnlib/mapper/StringMapper.java index f0a0ca4a5c..3e08c69198 100644 --- a/drivers/mapper/src/main/java/de/learnlib/mapper/StringMapper.java +++ b/drivers/mapper/src/main/java/de/learnlib/mapper/StringMapper.java @@ -20,7 +20,7 @@ import de.learnlib.sul.SULMapper; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; public class StringMapper implements SULMapper { diff --git a/drivers/mapper/src/main/java/module-info.java b/drivers/mapper/src/main/java/module-info.java new file mode 100644 index 0000000000..1af7eabdd9 --- /dev/null +++ b/drivers/mapper/src/main/java/module-info.java @@ -0,0 +1,39 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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. + */ + +import de.learnlib.sul.SUL; + +/** + * This module provides translation utilities for mapping abstract hypothesis symbols to concrete {@link SUL} symbols. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-mapper</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.mapper { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.core; + requires org.checkerframework.checker.qual; + + exports de.learnlib.mapper; +} diff --git a/drivers/mapper/src/test/java/de/learnlib/mapper/MapperCompositionTest.java b/drivers/mapper/src/test/java/de/learnlib/mapper/MapperCompositionTest.java index b8de96f38d..dab8c508e8 100644 --- a/drivers/mapper/src/test/java/de/learnlib/mapper/MapperCompositionTest.java +++ b/drivers/mapper/src/test/java/de/learnlib/mapper/MapperCompositionTest.java @@ -16,7 +16,7 @@ package de.learnlib.mapper; import de.learnlib.Mapper; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; diff --git a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/package-info.java b/drivers/simulator/src/main/java/module-info.java similarity index 53% rename from algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/package-info.java rename to drivers/simulator/src/main/java/module-info.java index d4ac611521..245fb92ff8 100644 --- a/algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/package-info.java +++ b/drivers/simulator/src/main/java/module-info.java @@ -14,9 +14,25 @@ * limitations under the License. */ +import de.learnlib.sul.SUL; + /** - * This package (and sub-packages) provides the implementation of the ADT learning algorithm as described in the Master - * thesis Active Automata Learning with Adaptive Distinguishing Sequences - * by Markus Frohme. + * This module provides utilities for simulating {@link SUL}s. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-drivers-simulator</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.adt; +open module de.learnlib.driver.simulator { + + requires de.learnlib.api; + requires net.automatalib.api; + requires org.checkerframework.checker.qual; + + exports de.learnlib.driver.simulator; +} diff --git a/examples/pom.xml b/examples/pom.xml index 582861b1b8..a04f707b26 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -176,8 +176,8 @@ limitations under the License. cacio-tta
- org.jmockit - jmockit + org.mockito + mockito-core
@@ -201,49 +201,10 @@ limitations under the License. false - @{argLine} -javaagent:${org.jmockit:jmockit:jar} + @{argLine} --add-opens=java.base/java.util=xstream - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - properties - - - - - - - - - fix-xstream - - [16,) - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - @{argLine} - -javaagent:${org.jmockit:jmockit:jar} - --add-opens=java.base/java.util=ALL-UNNAMED - - - - - - - diff --git a/examples/src/main/java/de/learnlib/example/Example1.java b/examples/src/main/java/de/learnlib/example/Example1.java index dd2f93631b..864779108f 100644 --- a/examples/src/main/java/de/learnlib/example/Example1.java +++ b/examples/src/main/java/de/learnlib/example/Example1.java @@ -15,6 +15,7 @@ */ package de.learnlib.example; +import java.awt.Desktop; import java.io.IOException; import de.learnlib.algorithm.lstar.dfa.ClassicLStarDFA; @@ -28,9 +29,9 @@ import de.learnlib.util.Experiment.DFAExperiment; import de.learnlib.util.statistic.SimpleProfiler; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.serialization.dot.GraphDOT; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.visualization.Visualization; @@ -116,7 +117,7 @@ public static void main(String[] args) throws IOException { System.out.println("Final observation table:"); new ObservationTableASCIIWriter<>().write(lstar.getObservationTable(), System.out); - OTUtils.displayHTMLInBrowser(lstar.getObservationTable()); + Desktop.getDesktop().browse(OTUtils.writeHTMLToFile(lstar.getObservationTable()).toURI()); } /** diff --git a/examples/src/main/java/de/learnlib/example/Example3.java b/examples/src/main/java/de/learnlib/example/Example3.java index 4b49fbc826..e693a3ec54 100644 --- a/examples/src/main/java/de/learnlib/example/Example3.java +++ b/examples/src/main/java/de/learnlib/example/Example3.java @@ -30,7 +30,7 @@ import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.query.Query; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.util.automaton.Automata; import net.automatalib.word.Word; diff --git a/examples/src/main/java/de/learnlib/example/bbc/Example1.java b/examples/src/main/java/de/learnlib/example/bbc/Example1.java index dfc1adf296..7fe35f06c3 100644 --- a/examples/src/main/java/de/learnlib/example/bbc/Example1.java +++ b/examples/src/main/java/de/learnlib/example/bbc/Example1.java @@ -20,8 +20,6 @@ import de.learnlib.acex.AcexAnalyzers; import de.learnlib.algorithm.LearningAlgorithm.DFALearner; import de.learnlib.algorithm.ttt.dfa.TTTLearnerDFA; -import de.learnlib.example.LearningExample.DFALearningExample; -import de.learnlib.example.dfa.ExampleTinyDFA; import de.learnlib.oracle.EquivalenceOracle.DFAEquivalenceOracle; import de.learnlib.oracle.InclusionOracle.DFAInclusionOracle; import de.learnlib.oracle.LassoEmptinessOracle.DFALassoEmptinessOracle; @@ -36,6 +34,8 @@ import de.learnlib.oracle.membership.SimulatorOmegaOracle.DFASimulatorOmegaOracle; import de.learnlib.oracle.property.DFALassoPropertyOracle; import de.learnlib.oracle.property.LoggingPropertyOracle.DFALoggingPropertyOracle; +import de.learnlib.testsupport.example.LearningExample.DFALearningExample; +import de.learnlib.testsupport.example.dfa.ExampleTinyDFA; import de.learnlib.util.Experiment.DFAExperiment; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.fsa.DFA; diff --git a/examples/src/main/java/de/learnlib/example/bbc/Example2.java b/examples/src/main/java/de/learnlib/example/bbc/Example2.java index 115d18160f..ba021b3bf9 100644 --- a/examples/src/main/java/de/learnlib/example/bbc/Example2.java +++ b/examples/src/main/java/de/learnlib/example/bbc/Example2.java @@ -20,8 +20,6 @@ import de.learnlib.acex.AcexAnalyzers; import de.learnlib.algorithm.LearningAlgorithm.MealyLearner; import de.learnlib.algorithm.ttt.mealy.TTTLearnerMealy; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.mealy.ExampleTinyMealy; import de.learnlib.oracle.EquivalenceOracle.MealyEquivalenceOracle; import de.learnlib.oracle.InclusionOracle.MealyInclusionOracle; import de.learnlib.oracle.LassoEmptinessOracle.MealyLassoEmptinessOracle; @@ -36,6 +34,8 @@ import de.learnlib.oracle.membership.SimulatorOmegaOracle.MealySimulatorOmegaOracle; import de.learnlib.oracle.property.LoggingPropertyOracle.MealyLoggingPropertyOracle; import de.learnlib.oracle.property.MealyLassoPropertyOracle; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.mealy.ExampleTinyMealy; import de.learnlib.util.Experiment.MealyExperiment; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; diff --git a/examples/src/main/java/de/learnlib/example/bbc/Example3.java b/examples/src/main/java/de/learnlib/example/bbc/Example3.java index 1bb372330f..71cec3435c 100644 --- a/examples/src/main/java/de/learnlib/example/bbc/Example3.java +++ b/examples/src/main/java/de/learnlib/example/bbc/Example3.java @@ -20,8 +20,6 @@ import de.learnlib.acex.AcexAnalyzers; import de.learnlib.algorithm.LearningAlgorithm.MealyLearner; import de.learnlib.algorithm.ttt.mealy.TTTLearnerMealy; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.mealy.ExampleTinyMealy; import de.learnlib.oracle.EquivalenceOracle.MealyEquivalenceOracle; import de.learnlib.oracle.InclusionOracle.MealyInclusionOracle; import de.learnlib.oracle.LassoEmptinessOracle.MealyLassoEmptinessOracle; @@ -36,6 +34,8 @@ import de.learnlib.oracle.membership.SimulatorOmegaOracle.MealySimulatorOmegaOracle; import de.learnlib.oracle.property.LoggingPropertyOracle.MealyLoggingPropertyOracle; import de.learnlib.oracle.property.MealyLassoPropertyOracle; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.mealy.ExampleTinyMealy; import de.learnlib.util.Experiment.MealyExperiment; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; diff --git a/examples/src/main/java/de/learnlib/example/bbc/Example4.java b/examples/src/main/java/de/learnlib/example/bbc/Example4.java index 724c204e10..09cb23b294 100644 --- a/examples/src/main/java/de/learnlib/example/bbc/Example4.java +++ b/examples/src/main/java/de/learnlib/example/bbc/Example4.java @@ -20,8 +20,6 @@ import de.learnlib.acex.AcexAnalyzers; import de.learnlib.algorithm.LearningAlgorithm.DFALearner; import de.learnlib.algorithm.ttt.dfa.TTTLearnerDFA; -import de.learnlib.example.LearningExample.DFALearningExample; -import de.learnlib.example.dfa.ExampleTinyDFA; import de.learnlib.oracle.EmptinessOracle.DFAEmptinessOracle; import de.learnlib.oracle.EquivalenceOracle.DFAEquivalenceOracle; import de.learnlib.oracle.InclusionOracle.DFAInclusionOracle; @@ -40,6 +38,8 @@ import de.learnlib.oracle.property.DFALassoPropertyOracle; import de.learnlib.oracle.property.DFAPropertyOracleChain; import de.learnlib.oracle.property.LoggingPropertyOracle.DFALoggingPropertyOracle; +import de.learnlib.testsupport.example.LearningExample.DFALearningExample; +import de.learnlib.testsupport.example.dfa.ExampleTinyDFA; import de.learnlib.util.Experiment.DFAExperiment; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.fsa.DFA; diff --git a/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample1.java b/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample1.java index 68989d1941..fa2335b3f5 100644 --- a/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample1.java +++ b/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample1.java @@ -23,15 +23,15 @@ import de.learnlib.driver.simulator.MealySimulatorSUL; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; +import de.learnlib.oracle.ParallelOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import de.learnlib.oracle.membership.SULOracle; -import de.learnlib.oracle.parallelism.ParallelOracle; import de.learnlib.oracle.parallelism.ParallelOracleBuilders; import de.learnlib.query.DefaultQuery; import de.learnlib.sul.SUL; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.collection.CollectionsUtil; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; diff --git a/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample2.java b/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample2.java index dff8aaeea5..90df0a011c 100644 --- a/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample2.java +++ b/examples/src/main/java/de/learnlib/example/parallelism/ParallelismExample2.java @@ -27,13 +27,13 @@ import de.learnlib.filter.statistic.sul.ResetCounterSUL; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import de.learnlib.oracle.parallelism.ParallelOracleBuilders; import de.learnlib.query.DefaultQuery; import de.learnlib.sul.SUL; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.random.RandomUtil; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; diff --git a/examples/src/main/java/de/learnlib/example/passive/Example1.java b/examples/src/main/java/de/learnlib/example/passive/Example1.java index 2715eba565..df72fc0d28 100644 --- a/examples/src/main/java/de/learnlib/example/passive/Example1.java +++ b/examples/src/main/java/de/learnlib/example/passive/Example1.java @@ -22,7 +22,7 @@ import de.learnlib.algorithm.PassiveLearningAlgorithm.PassiveDFALearner; import de.learnlib.algorithm.rpni.BlueFringeRPNIDFA; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; import net.automatalib.visualization.Visualization; import net.automatalib.word.Word; diff --git a/examples/src/main/java/de/learnlib/example/resumable/ResumableExample.java b/examples/src/main/java/de/learnlib/example/resumable/ResumableExample.java index f2011c3839..0a5ffb8103 100644 --- a/examples/src/main/java/de/learnlib/example/resumable/ResumableExample.java +++ b/examples/src/main/java/de/learnlib/example/resumable/ResumableExample.java @@ -30,9 +30,9 @@ import de.learnlib.oracle.membership.DFASimulatorOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.GrowingMapAlphabet; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.random.RandomAutomata; /** diff --git a/examples/src/main/java/de/learnlib/example/sli/Example1.java b/examples/src/main/java/de/learnlib/example/sli/Example1.java index e271e7713e..09ca37196a 100644 --- a/examples/src/main/java/de/learnlib/example/sli/Example1.java +++ b/examples/src/main/java/de/learnlib/example/sli/Example1.java @@ -26,9 +26,9 @@ import de.learnlib.sul.StateLocalInputSUL; import de.learnlib.util.Experiment.MealyExperiment; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.util.automaton.transducer.MealyFilter; import net.automatalib.visualization.Visualization; diff --git a/examples/src/main/java/de/learnlib/example/sli/Example2.java b/examples/src/main/java/de/learnlib/example/sli/Example2.java index 188086e717..04122735b4 100644 --- a/examples/src/main/java/de/learnlib/example/sli/Example2.java +++ b/examples/src/main/java/de/learnlib/example/sli/Example2.java @@ -23,7 +23,6 @@ import de.learnlib.algorithm.lstar.mealy.ExtensibleLStarMealyBuilder; import de.learnlib.driver.simulator.MealySimulatorSUL; import de.learnlib.driver.simulator.StateLocalInputMealySimulatorSUL; -import de.learnlib.example.mealy.ExampleRandomStateLocalInputMealy; import de.learnlib.filter.cache.sul.SULCache; import de.learnlib.filter.cache.sul.SULCaches; import de.learnlib.filter.cache.sul.StateLocalInputSULCache; @@ -40,9 +39,10 @@ import de.learnlib.oracle.membership.StateLocalInputSULOracle; import de.learnlib.sul.SUL; import de.learnlib.sul.StateLocalInputSUL; +import de.learnlib.testsupport.example.mealy.ExampleRandomStateLocalInputMealy; import de.learnlib.util.Experiment.MealyExperiment; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.StateLocalInputMealyMachine; /** diff --git a/examples/src/main/java/module-info.java b/examples/src/main/java/module-info.java new file mode 100644 index 0000000000..b61f79e2fb --- /dev/null +++ b/examples/src/main/java/module-info.java @@ -0,0 +1,62 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a collection of various small example applications that illustrate several use cases of + * LearnLib. + * Note: This module is not intended as a library but only exists for educational purposes. No artifacts are + * deployed for this module. + */ +open module de.learnlib.example { + + requires java.desktop; + requires de.learnlib.algorithm.ttt; + requires de.learnlib.api; + requires de.learnlib.algorithm.aaar; + requires de.learnlib.algorithm.lstar; + requires de.learnlib.algorithm.rpni; + requires de.learnlib.common.counterexample; + requires de.learnlib.common.util; + requires de.learnlib.datastructure.observationtable; + requires de.learnlib.driver; + requires de.learnlib.driver.simulator; + requires de.learnlib.filter.cache; + requires de.learnlib.filter.reuse; + requires de.learnlib.filter.statistic; + requires de.learnlib.oracle.emptiness; + requires de.learnlib.oracle.equivalence; + requires de.learnlib.oracle.membership; + requires de.learnlib.oracle.parallelism; + requires de.learnlib.oracle.property; + requires de.learnlib.testsupport.example; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.modelchecker.ltsmin; + requires net.automatalib.util; + requires net.automatalib.serialization.dot; + requires net.automatalib.visualization.dot; + requires org.checkerframework.checker.qual; + requires xstream; + + exports de.learnlib.example; + exports de.learnlib.example.aaar; + exports de.learnlib.example.bbc; + exports de.learnlib.example.parallelism; + exports de.learnlib.example.passive; + exports de.learnlib.example.resumable; + exports de.learnlib.example.sli; +} diff --git a/examples/src/test/java/de/learnlib/example/ExamplesTest.java b/examples/src/test/java/de/learnlib/example/ExamplesTest.java index 4e0aed151f..16da143f99 100644 --- a/examples/src/test/java/de/learnlib/example/ExamplesTest.java +++ b/examples/src/test/java/de/learnlib/example/ExamplesTest.java @@ -16,25 +16,22 @@ package de.learnlib.example; import java.awt.AWTEvent; +import java.awt.Desktop; import java.awt.Toolkit; import java.awt.Window; import java.awt.event.WindowEvent; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.util.function.Function; import javax.swing.SwingUtilities; -import de.learnlib.datastructure.observationtable.OTUtils; -import de.learnlib.datastructure.observationtable.ObservationTable; import de.learnlib.example.aaar.AlternatingBitExampleExplicit; import de.learnlib.example.aaar.AlternatingBitExampleGeneric; -import mockit.Mock; -import mockit.MockUp; import net.automatalib.common.util.system.JVMUtil; import net.automatalib.modelchecker.ltsmin.LTSminUtil; import net.automatalib.modelchecker.ltsmin.LTSminVersion; -import net.automatalib.word.Word; +import org.mockito.MockedStatic; +import org.mockito.Mockito; import org.testng.SkipException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -142,20 +139,16 @@ public void testSLIExample2() { public void testExample1() throws Exception { requireJVMCompatibility(); - // Mock OTUtils class, so we don't actually open a browser during the test - new MockUp() { - - @Mock - public void displayHTMLInBrowser(ObservationTable table, - Function, ? extends String> wordToString, - Function outputToString) { - // do nothing - } - }; - SwingUtilities.invokeAndWait(() -> { try { - Example1.main(new String[0]); + final Desktop mock = Mockito.mock(Desktop.class); + Mockito.doNothing().when(mock).browse(Mockito.any()); + + try (MockedStatic desktop = Mockito.mockStatic(Desktop.class)) { + desktop.when(Desktop::getDesktop).thenReturn(mock); + + Example1.main(new String[0]); + } } catch (IOException e) { throw new RuntimeException(e); } @@ -180,7 +173,6 @@ public void testExample3() throws InvocationTargetException, InterruptedExceptio SwingUtilities.invokeAndWait(() -> Example3.main(new String[0])); } - private static boolean isJVMCompatible() { return JVMUtil.getCanonicalSpecVersion() == 11; } diff --git a/filters/cache/pom.xml b/filters/cache/pom.xml index 25515c1de6..1ca54ea773 100644 --- a/filters/cache/pom.xml +++ b/filters/cache/pom.xml @@ -69,6 +69,13 @@ limitations under the License. slf4j-api + + + de.learnlib + learnlib-parallelism + provided + + de.learnlib @@ -97,6 +104,26 @@ limitations under the License. + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + @{argLine} + --add-reads=de.learnlib.filter.cache=de.learnlib.filter.statistic + --add-reads=de.learnlib.filter.cache=de.learnlib.oracle.membership + --add-reads=de.learnlib.filter.cache=de.learnlib.oracle.parallelism + + + + + + + fix-xstream @@ -110,7 +137,13 @@ limitations under the License. org.apache.maven.plugins maven-surefire-plugin - @{argLine} --add-opens=java.base/java.util=ALL-UNNAMED + + @{argLine} + --add-opens=java.base/java.util=ALL-UNNAMED + --add-reads=de.learnlib.filter.cache=de.learnlib.filter.statistic + --add-reads=de.learnlib.filter.cache=de.learnlib.oracle.membership + --add-reads=de.learnlib.filter.cache=de.learnlib.oracle.parallelism + diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/DynamicSymbolComparator.java b/filters/cache/src/main/java/de/learnlib/filter/cache/DynamicSymbolComparator.java index 9879ab115d..a46b8da0a1 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/DynamicSymbolComparator.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/DynamicSymbolComparator.java @@ -17,7 +17,7 @@ import java.util.Comparator; -import net.automatalib.alphabet.GrowingMapAlphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; public final class DynamicSymbolComparator implements Comparator { diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFAHashCacheOracle.java b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFAHashCacheOracle.java index e49ed824d0..025cb008e4 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFAHashCacheOracle.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFAHashCacheOracle.java @@ -36,8 +36,7 @@ * A {@link DFALearningCacheOracle} that uses a {@link Map} for internal cache organization. *

* Note: this implementation is not thread-safe. If you require a cache that is usable in a parallel - * environment. consider using the alternatives offered by the {@code ThreadSafeDFACaches} factory from the {@code - * learnlib-parallelism} artifact. + * environment. consider using the alternatives offered by the {@link ThreadSafeDFACaches} factory. * * @param * input symbol type diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheConsistencyTest.java b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheConsistencyTest.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheConsistencyTest.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheConsistencyTest.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheOracle.java b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheOracle.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheOracle.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACacheOracle.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACaches.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACaches.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/dfa/ThreadSafeDFACaches.java diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/SymbolQueryCache.java b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/SymbolQueryCache.java index cca361c6be..66808f99f3 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/SymbolQueryCache.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/SymbolQueryCache.java @@ -27,8 +27,9 @@ import de.learnlib.oracle.SymbolQueryOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.SupportsGrowingAlphabet; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.equivalence.NearLinearEquivalenceTest; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; @@ -46,7 +47,7 @@ * output alphabet type */ public class SymbolQueryCache - implements SymbolQueryOracle, MealyLearningCacheOracle, Resumable> { + implements SymbolQueryOracle, MealyLearningCacheOracle, SupportsGrowingAlphabet, Resumable> { private CompactMealy cache; private final SymbolQueryOracle delegate; @@ -142,6 +143,11 @@ public void resume(SymbolQueryCacheState state) { this.cache = state.getCache(); } + @Override + public void addAlphabetSymbol(I symbol) { + this.cache.addAlphabetSymbol(symbol); + } + public static class SymbolQueryCacheState { private final CompactMealy cache; diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheConsistencyTest.java b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheConsistencyTest.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheConsistencyTest.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheConsistencyTest.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheOracle.java b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheOracle.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheOracle.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCacheOracle.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCaches.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCaches.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/mealy/ThreadSafeMealyCaches.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheConsistencyTest.java b/filters/cache/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheConsistencyTest.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheConsistencyTest.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheConsistencyTest.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheOracle.java b/filters/cache/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheOracle.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheOracle.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCacheOracle.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCaches.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCaches.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/moore/ThreadSafeMooreCaches.java diff --git a/filters/cache/src/main/java/de/learnlib/filter/cache/sul/StateLocalInputSULCache.java b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/StateLocalInputSULCache.java index 7587e6031e..ddda6dc79f 100644 --- a/filters/cache/src/main/java/de/learnlib/filter/cache/sul/StateLocalInputSULCache.java +++ b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/StateLocalInputSULCache.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.Map; -import de.learnlib.filter.cache.sul.AbstractSULCache.SULCacheState; import de.learnlib.filter.cache.sul.StateLocalInputSULCache.StateLocalInputSULCacheState; import de.learnlib.sul.StateLocalInputSUL; import net.automatalib.incremental.mealy.IncrementalMealyBuilder; diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCache.java b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCache.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCache.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCache.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCaches.java b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCaches.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCaches.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeSULCaches.java diff --git a/oracles/parallelism/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeStateLocalInputSULCache.java b/filters/cache/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeStateLocalInputSULCache.java similarity index 100% rename from oracles/parallelism/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeStateLocalInputSULCache.java rename to filters/cache/src/main/java/de/learnlib/filter/cache/sul/ThreadSafeStateLocalInputSULCache.java diff --git a/filters/cache/src/main/java/module-info.java b/filters/cache/src/main/java/module-info.java new file mode 100644 index 0000000000..4df43d4094 --- /dev/null +++ b/filters/cache/src/main/java/module-info.java @@ -0,0 +1,48 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 caches to avoid posing duplicate membership queries. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-cache</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.filter.cache { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.incremental; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + // only required by documentation + requires static de.learnlib.oracle.parallelism; + + exports de.learnlib.filter.cache; + exports de.learnlib.filter.cache.dfa; + exports de.learnlib.filter.cache.mealy; + exports de.learnlib.filter.cache.moore; + exports de.learnlib.filter.cache.sul; +} diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/AbstractCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/AbstractCacheTest.java index 886da74792..a314bc344b 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/AbstractCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/AbstractCacheTest.java @@ -26,6 +26,7 @@ import de.learnlib.query.Query; import de.learnlib.testsupport.ResumeUtils; import net.automatalib.alphabet.Alphabet; +import net.automatalib.alphabet.SupportsGrowingAlphabet; import net.automatalib.automaton.concept.Output; import net.automatalib.word.Word; import net.automatalib.word.WordBuilder; @@ -148,6 +149,41 @@ public void testResuming() { } @Test(dependsOnMethods = "testResuming") + public void testAddSymbol() { + if (supportsGrowing()) { + @SuppressWarnings("unchecked") + final SupportsGrowingAlphabet growingCache = (SupportsGrowingAlphabet) oracle; + + // test that adding existing symbols does nothing; + final long oldCount = getNumberOfPosedQueries(); + alphabet.forEach(growingCache::addAlphabetSymbol); + final long newCount = getNumberOfPosedQueries(); + Assert.assertEquals(newCount, oldCount); + + // test that adding new symbols does nothing; + final Alphabet extensions = getExtensionAlphabet(); + final long oldCount2 = getNumberOfPosedQueries(); + extensions.forEach(growingCache::addAlphabetSymbol); + final long newCount2 = getNumberOfPosedQueries(); + Assert.assertEquals(newCount2, oldCount2); + + // test that adding new queries works + queries.clear(); + queries.add(new DefaultQuery<>(generateWord())); + final long oldCount3 = getNumberOfPosedQueries(); + oracle.processQueries(queries); + final long newCount3 = getNumberOfPosedQueries(); + Assert.assertEquals(newCount3, oldCount3 + 1); + + // test that querying new queries works + final long oldCount4 = getNumberOfPosedQueries(); + oracle.processQueries(queries); + final long newCount4 = getNumberOfPosedQueries(); + Assert.assertEquals(newCount4, oldCount4); + } + } + + @Test(dependsOnMethods = "testAddSymbol") public void testDuplicatesInBatch() { final long oldCount = getNumberOfPosedQueries(); @@ -172,6 +208,10 @@ public void testDuplicatesInBatch() { } private Word generateWord() { + return generateWord(alphabet); + } + + private Word generateWord(Alphabet alphabet) { final WordBuilder result = new WordBuilder<>(LENGTH); for (int i = 0; i < LENGTH; ++i) { @@ -198,6 +238,8 @@ protected Query getQuery(int i) { protected abstract Alphabet getAlphabet(); + protected abstract Alphabet getExtensionAlphabet(); + protected abstract A getTargetModel(); protected abstract A getInvalidTargetModel(); @@ -210,4 +252,6 @@ protected Query getQuery(int i) { protected abstract boolean supportsPrefixes(); + protected abstract boolean supportsGrowing(); + } diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/AbstractParallelCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/AbstractParallelCacheTest.java similarity index 99% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/AbstractParallelCacheTest.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/AbstractParallelCacheTest.java index 0902ca2a39..75f66ec1c5 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/AbstractParallelCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/AbstractParallelCacheTest.java @@ -20,7 +20,7 @@ import java.util.stream.IntStream; import de.learnlib.oracle.EquivalenceOracle; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; import net.automatalib.common.util.collection.CollectionsUtil; diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/CacheConfig.java b/filters/cache/src/test/java/de/learnlib/filter/cache/CacheConfig.java similarity index 93% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/CacheConfig.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/CacheConfig.java index 4445342758..1a476de8c0 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/CacheConfig.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/CacheConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache.configuration; +package de.learnlib.filter.cache; import java.util.ArrayList; import java.util.Collection; @@ -21,20 +21,18 @@ import java.util.function.BiFunction; import java.util.function.Supplier; -import de.learnlib.filter.cache.LearningCache; +import de.learnlib.filter.cache.CacheCreator.DFACacheCreator; +import de.learnlib.filter.cache.CacheCreator.MealyCacheCreator; +import de.learnlib.filter.cache.CacheCreator.MooreCacheCreator; +import de.learnlib.filter.cache.CacheCreator.SLISULCacheCreator; +import de.learnlib.filter.cache.CacheCreator.SULCacheCreator; import de.learnlib.filter.cache.LearningCache.MealyLearningCache; -import de.learnlib.filter.cache.LearningCacheOracle; import de.learnlib.filter.cache.LearningCacheOracle.DFALearningCacheOracle; import de.learnlib.filter.cache.LearningCacheOracle.MealyLearningCacheOracle; import de.learnlib.filter.cache.LearningCacheOracle.MooreLearningCacheOracle; -import de.learnlib.filter.cache.configuration.CacheCreator.DFACacheCreator; -import de.learnlib.filter.cache.configuration.CacheCreator.MealyCacheCreator; -import de.learnlib.filter.cache.configuration.CacheCreator.MooreCacheCreator; -import de.learnlib.filter.cache.configuration.CacheCreator.SLISULCacheCreator; -import de.learnlib.filter.cache.configuration.CacheCreator.SULCacheCreator; import de.learnlib.oracle.MembershipOracle; +import de.learnlib.oracle.ParallelOracle; import de.learnlib.oracle.parallelism.AbstractStaticBatchProcessor; -import de.learnlib.oracle.parallelism.ParallelOracle; import de.learnlib.oracle.parallelism.ParallelOracleBuilders; import de.learnlib.sul.SUL; import de.learnlib.sul.StateLocalInputSUL; diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/CacheCreator.java b/filters/cache/src/test/java/de/learnlib/filter/cache/CacheCreator.java similarity index 87% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/CacheCreator.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/CacheCreator.java index fadd6b6d64..fe47996474 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/CacheCreator.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/CacheCreator.java @@ -13,28 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache.configuration; +package de.learnlib.filter.cache; import java.util.Collection; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; -import de.learnlib.filter.cache.LearningCache; +import de.learnlib.filter.cache.CacheConfig.DFACollectionConfig; +import de.learnlib.filter.cache.CacheConfig.DFASupplierConfig; +import de.learnlib.filter.cache.CacheConfig.MealyCollectionConfig; +import de.learnlib.filter.cache.CacheConfig.MealySupplierConfig; +import de.learnlib.filter.cache.CacheConfig.MooreCollectionConfig; +import de.learnlib.filter.cache.CacheConfig.MooreSupplierConfig; +import de.learnlib.filter.cache.CacheConfig.SLISULConfig; +import de.learnlib.filter.cache.CacheConfig.SULConfig; import de.learnlib.filter.cache.LearningCache.DFALearningCache; import de.learnlib.filter.cache.LearningCache.MealyLearningCache; import de.learnlib.filter.cache.LearningCache.MooreLearningCache; import de.learnlib.filter.cache.LearningCacheOracle.DFALearningCacheOracle; import de.learnlib.filter.cache.LearningCacheOracle.MealyLearningCacheOracle; import de.learnlib.filter.cache.LearningCacheOracle.MooreLearningCacheOracle; -import de.learnlib.filter.cache.configuration.CacheConfig.DFACollectionConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.DFASupplierConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.MealyCollectionConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.MealySupplierConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.MooreCollectionConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.MooreSupplierConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.SLISULConfig; -import de.learnlib.filter.cache.configuration.CacheConfig.SULConfig; import de.learnlib.oracle.MembershipOracle; import de.learnlib.sul.SUL; import de.learnlib.sul.StateLocalInputSUL; diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/CacheTestUtils.java b/filters/cache/src/test/java/de/learnlib/filter/cache/CacheTestUtils.java index 69b0e742d7..2236ec7fa8 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/CacheTestUtils.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/CacheTestUtils.java @@ -17,16 +17,31 @@ import java.util.Random; +import de.learnlib.driver.simulator.MealySimulatorSUL; +import de.learnlib.driver.simulator.StateLocalInputMealySimulatorSUL; +import de.learnlib.filter.statistic.oracle.DFACounterOracle; +import de.learnlib.filter.statistic.oracle.MealyCounterOracle; +import de.learnlib.filter.statistic.oracle.MooreCounterOracle; +import de.learnlib.filter.statistic.sul.ResetCounterSUL; +import de.learnlib.filter.statistic.sul.ResetCounterStateLocalInputSUL; +import de.learnlib.oracle.membership.DFASimulatorOracle; +import de.learnlib.oracle.membership.MealySimulatorOracle; +import de.learnlib.oracle.membership.MooreSimulatorOracle; +import de.learnlib.sul.SUL; +import de.learnlib.sul.StateLocalInputSUL; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; -import net.automatalib.automaton.transducer.CompactMealy; -import net.automatalib.automaton.transducer.CompactMoore; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.fsa.impl.CompactDFA; +import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.MooreMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.util.automaton.random.RandomAutomata; public final class CacheTestUtils { public static final Alphabet INPUT_ALPHABET; + public static final Alphabet EXTENSION_ALPHABET; public static final Alphabet OUTPUT_ALPHABET; public static final CompactDFA DFA; @@ -36,24 +51,51 @@ public final class CacheTestUtils { public static final CompactMoore MOORE; public static final CompactMoore MOORE_INVALID; + public static final SUL SUL; + public static final StateLocalInputSUL SLI_SUL; + static { INPUT_ALPHABET = Alphabets.characters('a', 'c'); - OUTPUT_ALPHABET = Alphabets.integers(1, 3); + EXTENSION_ALPHABET = Alphabets.characters('d', 'e'); + OUTPUT_ALPHABET = Alphabets.integers(1, 4); + final Alphabet combinedAlphabet = Alphabets.characters('a', 'e'); final Random random = new Random(42); final int size = 20; - DFA = RandomAutomata.randomDFA(random, size, INPUT_ALPHABET); - MEALY = RandomAutomata.randomMealy(random, size, INPUT_ALPHABET, OUTPUT_ALPHABET); - MOORE = RandomAutomata.randomMoore(random, size, INPUT_ALPHABET, OUTPUT_ALPHABET); + DFA = RandomAutomata.randomDFA(random, size, combinedAlphabet); + MEALY = RandomAutomata.randomMealy(random, size, combinedAlphabet, OUTPUT_ALPHABET); + MOORE = RandomAutomata.randomMoore(random, size, combinedAlphabet, OUTPUT_ALPHABET); DFA_INVALID = new CompactDFA<>(DFA); DFA_INVALID.flipAcceptance(); // we rely on two generations not producing the same automaton - MEALY_INVALID = RandomAutomata.randomMealy(random, size, INPUT_ALPHABET, OUTPUT_ALPHABET); - MOORE_INVALID = RandomAutomata.randomMoore(random, size, INPUT_ALPHABET, OUTPUT_ALPHABET); + MEALY_INVALID = RandomAutomata.randomMealy(random, size, combinedAlphabet, OUTPUT_ALPHABET); + MOORE_INVALID = RandomAutomata.randomMoore(random, size, combinedAlphabet, OUTPUT_ALPHABET); + + SUL = new MealySimulatorSUL<>(MEALY); + SLI_SUL = new StateLocalInputMealySimulatorSUL<>(MEALY); } private CacheTestUtils() {} + public static DFACounterOracle getCounter(net.automatalib.automaton.fsa.DFA delegate) { + return new DFACounterOracle<>(new DFASimulatorOracle<>(delegate)); + } + + public static MealyCounterOracle getCounter(MealyMachine delegate) { + return new MealyCounterOracle<>(new MealySimulatorOracle<>(delegate)); + } + + public static MooreCounterOracle getCounter(MooreMachine delegate) { + return new MooreCounterOracle<>(new MooreSimulatorOracle<>(delegate)); + } + + public static ResetCounterSUL getCounter(SUL delegate) { + return new ResetCounterSUL<>("Queries", delegate); + } + + public static ResetCounterStateLocalInputSUL getCounter(StateLocalInputSUL delegate) { + return new ResetCounterStateLocalInputSUL<>("Queries", delegate); + } } diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/SULLearningCacheOracle.java b/filters/cache/src/test/java/de/learnlib/filter/cache/SULLearningCacheOracle.java index 2ba0ee1756..ed4eae7a50 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/SULLearningCacheOracle.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/SULLearningCacheOracle.java @@ -26,11 +26,12 @@ import de.learnlib.oracle.membership.SULOracle; import de.learnlib.oracle.membership.StateLocalInputSULOracle; import de.learnlib.query.Query; +import net.automatalib.alphabet.SupportsGrowingAlphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; -public class SULLearningCacheOracle & Resumable> - implements MealyLearningCacheOracle { +public class SULLearningCacheOracle & SupportsGrowingAlphabet & Resumable> + implements MealyLearningCacheOracle, SupportsGrowingAlphabet { private final C cache; private final MealyMembershipOracle oracle; @@ -67,4 +68,9 @@ public static SULLearningCacheOracle> O undefinedInput) { return new SULLearningCacheOracle<>(cache, new StateLocalInputSULOracle<>(cache, undefinedInput)); } + + @Override + public void addAlphabetSymbol(I symbol) { + cache.addAlphabetSymbol(symbol); + } } diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/AbstractDFACacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/AbstractDFACacheTest.java index 731e8e3902..a644e5959d 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/AbstractDFACacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/AbstractDFACacheTest.java @@ -21,6 +21,7 @@ import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.membership.DFASimulatorOracle; import net.automatalib.alphabet.Alphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.fsa.DFA; public abstract class AbstractDFACacheTest @@ -66,7 +67,17 @@ protected boolean supportsPrefixes() { @Override protected Alphabet getAlphabet() { - return CacheTestUtils.INPUT_ALPHABET; + return new GrowingMapAlphabet<>(CacheTestUtils.INPUT_ALPHABET); + } + + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return true; } protected abstract DFACacheOracle getCache(DFAMembershipOracle delegate); diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAHashCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAHashCacheTest.java index 91512c1441..78f3157ede 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAHashCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAHashCacheTest.java @@ -67,4 +67,14 @@ protected boolean supportsPrefixes() { protected Alphabet getAlphabet() { return CacheTestUtils.INPUT_ALPHABET; } + + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return false; + } } diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/DFAParallelCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAParallelCacheTest.java similarity index 83% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/DFAParallelCacheTest.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAParallelCacheTest.java index 0076d7ab76..827677865f 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/DFAParallelCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/dfa/DFAParallelCacheTest.java @@ -13,15 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache; +package de.learnlib.filter.cache.dfa; -import de.learnlib.filter.cache.configuration.CacheConfig; -import de.learnlib.filter.cache.configuration.CacheCreator.DFACacheCreator; -import de.learnlib.filter.cache.configuration.Config; -import de.learnlib.filter.cache.dfa.ThreadSafeDFACacheOracle; -import de.learnlib.filter.cache.dfa.ThreadSafeDFACaches; +import de.learnlib.filter.cache.AbstractParallelCacheTest; +import de.learnlib.filter.cache.CacheConfig; +import de.learnlib.filter.cache.CacheCreator.DFACacheCreator; +import de.learnlib.filter.cache.CacheTestUtils; import de.learnlib.filter.statistic.oracle.DFACounterOracle; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.fsa.DFA; import org.testng.annotations.DataProvider; @@ -35,10 +34,10 @@ public class DFAParallelCacheTest extends AbstractParallelCacheTest> creator) { - this.sul = Config.getCounter(Config.TARGET_MODEL_DFA); + this.sul = CacheTestUtils.getCounter(CacheTestUtils.DFA); final CacheConfig> config = - creator.apply(Config.ALPHABET, this.sul); + creator.apply(CacheTestUtils.INPUT_ALPHABET, this.sul); this.cacheRepresentative = config.getRepresentative(); this.parallelOracle = config.getParallelOracle(); @@ -56,12 +55,12 @@ public static Object[][] cacheProvider() { @Override protected Alphabet getAlphabet() { - return Config.ALPHABET; + return CacheTestUtils.INPUT_ALPHABET; } @Override protected DFA getTargetModel() { - return Config.TARGET_MODEL_DFA; + return CacheTestUtils.DFA; } @Override diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/AbstractMealyCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/AbstractMealyCacheTest.java index c1223fbed4..a783e5b2e4 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/AbstractMealyCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/AbstractMealyCacheTest.java @@ -21,6 +21,7 @@ import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import net.automatalib.alphabet.Alphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.common.util.mapping.Mapping; import net.automatalib.word.Word; @@ -71,7 +72,17 @@ protected boolean supportsPrefixes() { @Override protected Alphabet getAlphabet() { - return CacheTestUtils.INPUT_ALPHABET; + return new GrowingMapAlphabet<>(CacheTestUtils.INPUT_ALPHABET); + } + + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return true; } protected abstract MealyCacheOracle getCache(MealyMembershipOracle delegate); diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/MealyParallelCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/MealyParallelCacheTest.java similarity index 67% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/MealyParallelCacheTest.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/mealy/MealyParallelCacheTest.java index 627c5c27f5..9d853151b4 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/MealyParallelCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/MealyParallelCacheTest.java @@ -13,20 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache; +package de.learnlib.filter.cache.mealy; import java.util.Collection; import java.util.function.Function; import java.util.function.Supplier; -import de.learnlib.filter.cache.configuration.CacheConfig; -import de.learnlib.filter.cache.configuration.CacheCreator.MealyCacheCreator; -import de.learnlib.filter.cache.configuration.Config; -import de.learnlib.filter.cache.mealy.ThreadSafeMealyCacheOracle; -import de.learnlib.filter.cache.mealy.ThreadSafeMealyCaches; +import de.learnlib.filter.cache.AbstractParallelCacheTest; +import de.learnlib.filter.cache.CacheConfig; +import de.learnlib.filter.cache.CacheCreator.MealyCacheCreator; +import de.learnlib.filter.cache.CacheTestUtils; import de.learnlib.filter.statistic.oracle.MealyCounterOracle; import de.learnlib.oracle.MembershipOracle; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; @@ -34,18 +33,18 @@ import org.testng.annotations.Factory; public class MealyParallelCacheTest - extends AbstractParallelCacheTest, Character, Word> { + extends AbstractParallelCacheTest, Character, Word> { - private final MealyCounterOracle sul; - private final ThreadSafeMealyCacheOracle cacheRepresentative; - private final ParallelOracle> parallelOracle; + private final MealyCounterOracle sul; + private final ThreadSafeMealyCacheOracle cacheRepresentative; + private final ParallelOracle> parallelOracle; @Factory(dataProvider = "caches") - public MealyParallelCacheTest(MealyCacheCreator> creator) { - this.sul = Config.getCounter(Config.TARGET_MODEL_MEALY); + public MealyParallelCacheTest(MealyCacheCreator> creator) { + this.sul = CacheTestUtils.getCounter(CacheTestUtils.MEALY); - final CacheConfig, ThreadSafeMealyCacheOracle> config = - creator.apply(Config.ALPHABET, this.sul); + final CacheConfig, ThreadSafeMealyCacheOracle> config = + creator.apply(CacheTestUtils.INPUT_ALPHABET, this.sul); this.cacheRepresentative = config.getRepresentative(); this.parallelOracle = config.getParallelOracle(); @@ -63,21 +62,21 @@ public static Object[][] cacheProvider() { @Override protected Alphabet getAlphabet() { - return Config.ALPHABET; + return CacheTestUtils.INPUT_ALPHABET; } @Override - protected MealyMachine getTargetModel() { - return Config.TARGET_MODEL_MEALY; + protected MealyMachine getTargetModel() { + return CacheTestUtils.MEALY; } @Override - protected ThreadSafeMealyCacheOracle getCacheRepresentative() { + protected ThreadSafeMealyCacheOracle getCacheRepresentative() { return this.cacheRepresentative; } @Override - protected ParallelOracle> getParallelOracle() { + protected ParallelOracle> getParallelOracle() { return this.parallelOracle; } diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/SymbolQueryCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/SymbolQueryCacheTest.java index 733472ff74..e80b1fa6b9 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/SymbolQueryCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/mealy/SymbolQueryCacheTest.java @@ -21,6 +21,7 @@ import de.learnlib.filter.statistic.oracle.CounterSymbolQueryOracle; import de.learnlib.oracle.membership.SULSymbolQueryOracle; import net.automatalib.alphabet.Alphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; @@ -36,7 +37,7 @@ public SymbolQueryCacheTest() { @Override protected Alphabet getAlphabet() { - return CacheTestUtils.INPUT_ALPHABET; + return new GrowingMapAlphabet<>(CacheTestUtils.INPUT_ALPHABET); } @Override @@ -70,4 +71,14 @@ protected long getNumberOfPosedQueries() { protected boolean supportsPrefixes() { return true; } + + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return true; + } } diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/moore/AbstractMooreCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/moore/AbstractMooreCacheTest.java index 221fea48aa..d8554e2e21 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/moore/AbstractMooreCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/moore/AbstractMooreCacheTest.java @@ -21,6 +21,7 @@ import de.learnlib.oracle.MembershipOracle.MooreMembershipOracle; import de.learnlib.oracle.membership.MooreSimulatorOracle; import net.automatalib.alphabet.Alphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.MooreMachine; import net.automatalib.common.util.mapping.Mapping; import net.automatalib.word.Word; @@ -71,7 +72,17 @@ protected boolean supportsPrefixes() { @Override protected Alphabet getAlphabet() { - return CacheTestUtils.INPUT_ALPHABET; + return new GrowingMapAlphabet<>(CacheTestUtils.INPUT_ALPHABET); + } + + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return true; } protected abstract MooreCacheOracle getCache(MooreMembershipOracle delegate); diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/MooreParallelCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/moore/MooreParallelCacheTest.java similarity index 60% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/MooreParallelCacheTest.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/moore/MooreParallelCacheTest.java index 7eee39fdeb..fdc8e91143 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/MooreParallelCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/moore/MooreParallelCacheTest.java @@ -13,15 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache; +package de.learnlib.filter.cache.moore; -import de.learnlib.filter.cache.configuration.CacheConfig; -import de.learnlib.filter.cache.configuration.CacheCreator.MooreCacheCreator; -import de.learnlib.filter.cache.configuration.Config; -import de.learnlib.filter.cache.moore.ThreadSafeMooreCacheOracle; -import de.learnlib.filter.cache.moore.ThreadSafeMooreCaches; +import de.learnlib.filter.cache.AbstractParallelCacheTest; +import de.learnlib.filter.cache.CacheConfig; +import de.learnlib.filter.cache.CacheCreator.MooreCacheCreator; +import de.learnlib.filter.cache.CacheTestUtils; import de.learnlib.filter.statistic.oracle.MooreCounterOracle; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MooreMachine; import net.automatalib.word.Word; @@ -29,18 +28,18 @@ import org.testng.annotations.Factory; public class MooreParallelCacheTest - extends AbstractParallelCacheTest, Character, Word> { + extends AbstractParallelCacheTest, Character, Word> { - private final MooreCounterOracle sul; - private final ThreadSafeMooreCacheOracle cacheRepresentative; - private final ParallelOracle> parallelOracle; + private final MooreCounterOracle sul; + private final ThreadSafeMooreCacheOracle cacheRepresentative; + private final ParallelOracle> parallelOracle; @Factory(dataProvider = "caches") - public MooreParallelCacheTest(MooreCacheCreator> creator) { - this.sul = Config.getCounter(Config.TARGET_MODEL_MOORE); + public MooreParallelCacheTest(MooreCacheCreator> creator) { + this.sul = CacheTestUtils.getCounter(CacheTestUtils.MOORE); - final CacheConfig, ThreadSafeMooreCacheOracle> config = - creator.apply(Config.ALPHABET, this.sul); + final CacheConfig, ThreadSafeMooreCacheOracle> config = + creator.apply(CacheTestUtils.INPUT_ALPHABET, this.sul); this.cacheRepresentative = config.getRepresentative(); this.parallelOracle = config.getParallelOracle(); @@ -56,21 +55,21 @@ public static Object[][] cacheProvider() { @Override protected Alphabet getAlphabet() { - return Config.ALPHABET; + return CacheTestUtils.INPUT_ALPHABET; } @Override - protected MooreMachine getTargetModel() { - return Config.TARGET_MODEL_MOORE; + protected MooreMachine getTargetModel() { + return CacheTestUtils.MOORE; } @Override - protected ThreadSafeMooreCacheOracle getCacheRepresentative() { + protected ThreadSafeMooreCacheOracle getCacheRepresentative() { return this.cacheRepresentative; } @Override - protected ParallelOracle> getParallelOracle() { + protected ParallelOracle> getParallelOracle() { return this.parallelOracle; } diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/sul/AbstractSULCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/AbstractSULCacheTest.java index 418e4d2da6..4f0f251269 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/sul/AbstractSULCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/AbstractSULCacheTest.java @@ -22,6 +22,7 @@ import de.learnlib.filter.statistic.sul.ResetCounterSUL; import de.learnlib.sul.SUL; import net.automatalib.alphabet.Alphabet; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; @@ -69,7 +70,17 @@ protected boolean supportsPrefixes() { @Override protected Alphabet getAlphabet() { - return CacheTestUtils.INPUT_ALPHABET; + return new GrowingMapAlphabet<>(CacheTestUtils.INPUT_ALPHABET); + } + + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return true; } protected abstract SULCache getCache(SUL delegate); diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/SLISULParallelCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/SLISULParallelCacheTest.java similarity index 59% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/SLISULParallelCacheTest.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/sul/SLISULParallelCacheTest.java index f78022e7bb..5be193019e 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/SLISULParallelCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/SLISULParallelCacheTest.java @@ -13,15 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache; +package de.learnlib.filter.cache.sul; -import de.learnlib.filter.cache.configuration.CacheConfig; -import de.learnlib.filter.cache.configuration.CacheCreator.SLISULCacheCreator; -import de.learnlib.filter.cache.configuration.Config; -import de.learnlib.filter.cache.sul.ThreadSafeSULCaches; -import de.learnlib.filter.cache.sul.ThreadSafeStateLocalInputSULCache; +import de.learnlib.filter.cache.AbstractParallelCacheTest; +import de.learnlib.filter.cache.CacheConfig; +import de.learnlib.filter.cache.CacheCreator.SLISULCacheCreator; +import de.learnlib.filter.cache.CacheTestUtils; import de.learnlib.filter.statistic.sul.ResetCounterStateLocalInputSUL; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; @@ -29,18 +28,18 @@ import org.testng.annotations.Factory; public class SLISULParallelCacheTest - extends AbstractParallelCacheTest, Character, Word> { + extends AbstractParallelCacheTest, Character, Word> { - private final ResetCounterStateLocalInputSUL sul; - private final ThreadSafeStateLocalInputSULCache cacheRepresentative; - private final ParallelOracle> parallelOracle; + private final ResetCounterStateLocalInputSUL sul; + private final ThreadSafeStateLocalInputSULCache cacheRepresentative; + private final ParallelOracle> parallelOracle; @Factory(dataProvider = "caches") - public SLISULParallelCacheTest(SLISULCacheCreator> creator) { - this.sul = Config.getCounter(Config.TARGET_MODEL_SLI_SUL); + public SLISULParallelCacheTest(SLISULCacheCreator> creator) { + this.sul = CacheTestUtils.getCounter(CacheTestUtils.SLI_SUL); - final CacheConfig, ThreadSafeStateLocalInputSULCache> config = - creator.apply(Config.ALPHABET, sul); + final CacheConfig, ThreadSafeStateLocalInputSULCache> config = + creator.apply(CacheTestUtils.INPUT_ALPHABET, sul); this.cacheRepresentative = config.getRepresentative(); this.parallelOracle = config.getParallelOracle(); @@ -54,21 +53,21 @@ public static Object[][] cacheProvider() { @Override protected Alphabet getAlphabet() { - return Config.ALPHABET; + return CacheTestUtils.INPUT_ALPHABET; } @Override - protected MealyMachine getTargetModel() { - return Config.TARGET_MODEL_MEALY; + protected MealyMachine getTargetModel() { + return CacheTestUtils.MEALY; } @Override - protected ThreadSafeStateLocalInputSULCache getCacheRepresentative() { + protected ThreadSafeStateLocalInputSULCache getCacheRepresentative() { return this.cacheRepresentative; } @Override - protected ParallelOracle> getParallelOracle() { + protected ParallelOracle> getParallelOracle() { return this.parallelOracle; } diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/SULParallelCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/SULParallelCacheTest.java similarity index 60% rename from oracles/parallelism/src/test/java/de/learnlib/filter/cache/SULParallelCacheTest.java rename to filters/cache/src/test/java/de/learnlib/filter/cache/sul/SULParallelCacheTest.java index 842e5038f5..2599ab6d08 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/SULParallelCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/SULParallelCacheTest.java @@ -13,15 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.filter.cache; +package de.learnlib.filter.cache.sul; -import de.learnlib.filter.cache.configuration.CacheConfig; -import de.learnlib.filter.cache.configuration.CacheCreator.SULCacheCreator; -import de.learnlib.filter.cache.configuration.Config; -import de.learnlib.filter.cache.sul.ThreadSafeSULCache; -import de.learnlib.filter.cache.sul.ThreadSafeSULCaches; +import de.learnlib.filter.cache.AbstractParallelCacheTest; +import de.learnlib.filter.cache.CacheConfig; +import de.learnlib.filter.cache.CacheCreator.SULCacheCreator; +import de.learnlib.filter.cache.CacheTestUtils; import de.learnlib.filter.statistic.sul.ResetCounterSUL; -import de.learnlib.oracle.parallelism.ParallelOracle; +import de.learnlib.oracle.ParallelOracle; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.word.Word; @@ -29,18 +28,18 @@ import org.testng.annotations.Factory; public class SULParallelCacheTest - extends AbstractParallelCacheTest, Character, Word> { + extends AbstractParallelCacheTest, Character, Word> { - private final ResetCounterSUL sul; - private final ThreadSafeSULCache cacheRepresentative; - private final ParallelOracle> parallelOracle; + private final ResetCounterSUL sul; + private final ThreadSafeSULCache cacheRepresentative; + private final ParallelOracle> parallelOracle; @Factory(dataProvider = "caches") - public SULParallelCacheTest(SULCacheCreator> creator) { - this.sul = Config.getCounter(Config.TARGET_MODEL_SUL); + public SULParallelCacheTest(SULCacheCreator> creator) { + this.sul = CacheTestUtils.getCounter(CacheTestUtils.SUL); - final CacheConfig, ThreadSafeSULCache> config = - creator.apply(Config.ALPHABET, sul); + final CacheConfig, ThreadSafeSULCache> config = + creator.apply(CacheTestUtils.INPUT_ALPHABET, sul); this.cacheRepresentative = config.getRepresentative(); this.parallelOracle = config.getParallelOracle(); @@ -55,21 +54,21 @@ public static Object[][] cacheProvider() { @Override protected Alphabet getAlphabet() { - return Config.ALPHABET; + return CacheTestUtils.INPUT_ALPHABET; } @Override - protected MealyMachine getTargetModel() { - return Config.TARGET_MODEL_MEALY; + protected MealyMachine getTargetModel() { + return CacheTestUtils.MEALY; } @Override - protected ThreadSafeSULCache getCacheRepresentative() { + protected ThreadSafeSULCache getCacheRepresentative() { return this.cacheRepresentative; } @Override - protected ParallelOracle> getParallelOracle() { + protected ParallelOracle> getParallelOracle() { return this.parallelOracle; } diff --git a/filters/cache/src/test/java/de/learnlib/filter/cache/sul/StateLocalInputSULTreeCacheTest.java b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/StateLocalInputSULTreeCacheTest.java index 31ef622d44..acf74cd010 100644 --- a/filters/cache/src/test/java/de/learnlib/filter/cache/sul/StateLocalInputSULTreeCacheTest.java +++ b/filters/cache/src/test/java/de/learnlib/filter/cache/sul/StateLocalInputSULTreeCacheTest.java @@ -106,7 +106,7 @@ public void testQueryWithNoContainedAlphabetSymbol() { final long oldCount = getNumberOfPosedQueries(); final Word oldQuery = getQuery(0).getInput(); - final Word answer = super.oracle.answerQuery(oldQuery.concat(Word.fromString("dcba"))); + final Word answer = super.oracle.answerQuery(oldQuery.concat(Word.fromString("fcba"))); Assert.assertEquals(getNumberOfPosedQueries(), oldCount); @@ -159,6 +159,16 @@ protected Alphabet getAlphabet() { return CacheTestUtils.INPUT_ALPHABET; } + @Override + protected Alphabet getExtensionAlphabet() { + return CacheTestUtils.EXTENSION_ALPHABET; + } + + @Override + protected boolean supportsGrowing() { + return false; + } + private StateLocalInputSULCache getCache() { return SULCaches.createStateLocalInputCache(CacheTestUtils.INPUT_ALPHABET, sliCounter); } diff --git a/filters/reuse/src/main/java/module-info.java b/filters/reuse/src/main/java/module-info.java new file mode 100644 index 0000000000..89e64311d3 --- /dev/null +++ b/filters/reuse/src/main/java/module-info.java @@ -0,0 +1,39 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a reuse tree for (intelligently) caching membership queries. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-reuse</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.filter.reuse { + + requires de.learnlib.api; + requires net.automatalib.api; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.filter.reuse; + exports de.learnlib.filter.reuse.tree; +} diff --git a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/DomainKnowledgeTest.java b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/DomainKnowledgeTest.java index 49af1bb770..d74374203c 100644 --- a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/DomainKnowledgeTest.java +++ b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/DomainKnowledgeTest.java @@ -24,7 +24,7 @@ import de.learnlib.filter.reuse.ReuseOracleBuilder; import de.learnlib.filter.reuse.tree.ReuseNode.NodeResult; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.BeforeMethod; diff --git a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/LearningTest.java b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/LearningTest.java index a6c12dccdf..dcc32d6af2 100644 --- a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/LearningTest.java +++ b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/LearningTest.java @@ -26,7 +26,7 @@ import de.learnlib.filter.reuse.ReuseOracleBuilder; import de.learnlib.filter.reuse.tree.ReuseTree; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.serialization.dot.GraphDOT; import net.automatalib.word.Word; import net.automatalib.word.WordBuilder; diff --git a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/QuiescenceTest.java b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/QuiescenceTest.java index d9f94e9371..6aa29250a0 100644 --- a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/QuiescenceTest.java +++ b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/QuiescenceTest.java @@ -23,7 +23,7 @@ import de.learnlib.filter.reuse.ReuseOracle; import de.learnlib.filter.reuse.ReuseOracleBuilder; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import net.automatalib.word.WordBuilder; import org.testng.annotations.BeforeClass; diff --git a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/ReuseOracleTest.java b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/ReuseOracleTest.java index 4b6d08de81..65a5afb2d1 100644 --- a/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/ReuseOracleTest.java +++ b/filters/reuse/src/test/java/de/learnlib/filter/reuse/test/ReuseOracleTest.java @@ -23,7 +23,7 @@ import de.learnlib.filter.reuse.ReuseOracleBuilder; import de.learnlib.filter.reuse.tree.ReuseNode.NodeResult; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.BeforeMethod; diff --git a/filters/statistics/src/main/java/module-info.java b/filters/statistics/src/main/java/module-info.java new file mode 100644 index 0000000000..010bc62a5b --- /dev/null +++ b/filters/statistics/src/main/java/module-info.java @@ -0,0 +1,41 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 filters for collecting statistical data. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-statistics</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.filter.statistic { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.util; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.filter.statistic; + exports de.learnlib.filter.statistic.learner; + exports de.learnlib.filter.statistic.oracle; + exports de.learnlib.filter.statistic.sul; +} diff --git a/filters/statistics/src/test/java/de/learnlib/filter/statistic/TestQueries.java b/filters/statistics/src/test/java/de/learnlib/filter/statistic/TestQueries.java index 56d594d83c..6e1c44924c 100644 --- a/filters/statistics/src/test/java/de/learnlib/filter/statistic/TestQueries.java +++ b/filters/statistics/src/test/java/de/learnlib/filter/statistic/TestQueries.java @@ -22,8 +22,8 @@ import de.learnlib.query.Query; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.collection.CollectionsUtil; import net.automatalib.common.util.random.RandomUtil; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/oracles/emptiness-oracles/pom.xml b/oracles/emptiness-oracles/pom.xml index b7e11fad6f..ceec43bf96 100644 --- a/oracles/emptiness-oracles/pom.xml +++ b/oracles/emptiness-oracles/pom.xml @@ -68,4 +68,23 @@ mockito-core + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + @{argLine} + --add-reads=de.learnlib.oracle.emptiness=net.automatalib.core + --add-reads=de.learnlib.oracle.emptiness=net.automatalib.util + + + + + + diff --git a/oracles/emptiness-oracles/src/main/java/module-info.java b/oracles/emptiness-oracles/src/main/java/module-info.java new file mode 100644 index 0000000000..ec8558643d --- /dev/null +++ b/oracles/emptiness-oracles/src/main/java/module-info.java @@ -0,0 +1,39 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a collection of emptiness oracles. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-emptiness-oracles</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.oracle.emptiness { + + requires de.learnlib.api; + requires de.learnlib.common.util; + requires net.automatalib.api; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.oracle.emptiness; +} diff --git a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/AbstractLassoEmptinessOracleImplTest.java b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/AbstractLassoEmptinessOracleImplTest.java index f0c080d37b..1b4d22ba15 100644 --- a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/AbstractLassoEmptinessOracleImplTest.java +++ b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/AbstractLassoEmptinessOracleImplTest.java @@ -20,7 +20,7 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.query.OmegaQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.modelchecking.Lasso; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFABFEmptinessOracleTest.java b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFABFEmptinessOracleTest.java index e4a22ada70..2c51682904 100644 --- a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFABFEmptinessOracleTest.java +++ b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFABFEmptinessOracleTest.java @@ -19,8 +19,8 @@ import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.query.DefaultQuery; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFALassoEmptinessOracleImplTest.java b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFALassoEmptinessOracleImplTest.java index 9ed3aeac4e..a59ec515e6 100644 --- a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFALassoEmptinessOracleImplTest.java +++ b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/DFALassoEmptinessOracleImplTest.java @@ -20,10 +20,10 @@ import de.learnlib.oracle.OmegaMembershipOracle.DFAOmegaMembershipOracle; import de.learnlib.query.DefaultQuery; import de.learnlib.query.OmegaQuery; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; -import net.automatalib.modelchecking.DFALassoImpl; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.modelchecking.Lasso; +import net.automatalib.modelchecking.impl.DFALassoImpl; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyBFEmptinessOracleTest.java b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyBFEmptinessOracleTest.java index 52c04072fb..b763249620 100644 --- a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyBFEmptinessOracleTest.java +++ b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyBFEmptinessOracleTest.java @@ -19,8 +19,8 @@ import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.query.DefaultQuery; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyLassoEmptinessOracleImplTest.java b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyLassoEmptinessOracleImplTest.java index fce67de90d..e1951956a4 100644 --- a/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyLassoEmptinessOracleImplTest.java +++ b/oracles/emptiness-oracles/src/test/java/de/learnlib/oracle/emptiness/MealyLassoEmptinessOracleImplTest.java @@ -20,10 +20,10 @@ import de.learnlib.oracle.OmegaMembershipOracle.MealyOmegaMembershipOracle; import de.learnlib.query.DefaultQuery; import de.learnlib.query.OmegaQuery; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.modelchecking.Lasso; -import net.automatalib.modelchecking.MealyLassoImpl; +import net.automatalib.modelchecking.impl.MealyLassoImpl; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/equivalence-oracles/src/main/java/module-info.java b/oracles/equivalence-oracles/src/main/java/module-info.java new file mode 100644 index 0000000000..54307ad3b1 --- /dev/null +++ b/oracles/equivalence-oracles/src/main/java/module-info.java @@ -0,0 +1,49 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a collection of equivalence oracles. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-equivalence-oracles</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.oracle.equivalence { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.common.util; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.oracle.equivalence; + exports de.learnlib.oracle.equivalence.mealy; + exports de.learnlib.oracle.equivalence.sba; + exports de.learnlib.oracle.equivalence.spa; + exports de.learnlib.oracle.equivalence.spmm; + exports de.learnlib.oracle.equivalence.vpa; +} diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/DFABFInclusionOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/DFABFInclusionOracleTest.java index 64462ac27c..20841a9733 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/DFABFInclusionOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/DFABFInclusionOracleTest.java @@ -19,8 +19,8 @@ import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.query.DefaultQuery; -import net.automatalib.automaton.fsa.CompactDFA; import net.automatalib.automaton.fsa.DFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/EmptyAutomatonOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/EmptyAutomatonOracleTest.java index da540478ec..d7e96013fd 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/EmptyAutomatonOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/EmptyAutomatonOracleTest.java @@ -15,20 +15,20 @@ */ package de.learnlib.oracle.equivalence; -import de.learnlib.example.LearningExample; -import de.learnlib.example.dfa.ExamplePaulAndMary; -import de.learnlib.example.mealy.ExampleStack; import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.membership.SimulatorOracle; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.LearningExample; +import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary; +import de.learnlib.testsupport.example.mealy.ExampleStack; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.AutomatonCreator; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.automaton.concept.DetSuffixOutputAutomaton; import net.automatalib.automaton.concept.Output; -import net.automatalib.automaton.fsa.CompactDFA; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.automaton.fsa.impl.CompactDFA; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.exception.UndefinedPropertyAccessException; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/IncrementalWMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/IncrementalWMethodEQOracleTest.java index c10acafa8a..6a4ace150b 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/IncrementalWMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/IncrementalWMethodEQOracleTest.java @@ -18,9 +18,9 @@ import java.util.HashSet; import java.util.Set; -import de.learnlib.example.dfa.ExamplePaulAndMary; import de.learnlib.oracle.EquivalenceOracle; 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.util.automaton.Automata; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/MealyBFInclusionOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/MealyBFInclusionOracleTest.java index 214645ce75..eca3489cd4 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/MealyBFInclusionOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/MealyBFInclusionOracleTest.java @@ -19,8 +19,8 @@ import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.query.DefaultQuery; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.word.Word; import org.mockito.ArgumentMatchers; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWMethodEQOracleTest.java index cb292629ab..aa2c9b533f 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWMethodEQOracleTest.java @@ -18,9 +18,9 @@ import java.util.HashSet; import java.util.Set; -import de.learnlib.example.dfa.ExamplePaulAndMary; import de.learnlib.oracle.EquivalenceOracle; 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.util.automaton.Automata; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWordsEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWordsEQOracleTest.java index b91affa6b0..7cb36ee37a 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWordsEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWordsEQOracleTest.java @@ -20,7 +20,7 @@ import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.word.Word; import org.testng.Assert; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWpMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWpMethodEQOracleTest.java index 2c1144bb4f..2a1e6b9c50 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWpMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/RandomWpMethodEQOracleTest.java @@ -18,9 +18,9 @@ import java.util.HashSet; import java.util.Set; -import de.learnlib.example.dfa.ExamplePaulAndMary; import de.learnlib.oracle.EquivalenceOracle; 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.util.automaton.Automata; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/SampleSetEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/SampleSetEQOracleTest.java index 9f69faeaea..1c91c327c0 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/SampleSetEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/SampleSetEQOracleTest.java @@ -23,7 +23,7 @@ import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.oracle.MembershipOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.common.util.random.RandomUtil; import net.automatalib.word.Word; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/mealy/RandomWalkEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/mealy/RandomWalkEQOracleTest.java index e94e4af4bf..c4b9dec966 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/mealy/RandomWalkEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/mealy/RandomWalkEQOracleTest.java @@ -21,8 +21,8 @@ import de.learnlib.query.DefaultQuery; import de.learnlib.sul.SUL; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; import org.checkerframework.checker.nullness.qual.Nullable; import org.testng.Assert; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/sba/WMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/sba/WMethodEQOracleTest.java index c2bab2a445..fb5bbd8719 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/sba/WMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/sba/WMethodEQOracleTest.java @@ -21,9 +21,9 @@ import com.google.common.collect.Streams; import de.learnlib.oracle.membership.SimulatorOracle; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.automaton.procedural.SBA; import net.automatalib.util.automaton.conformance.SBAWMethodTestsIterator; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WMethodEQOracleTest.java index 23e171d934..55c2e223ba 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WMethodEQOracleTest.java @@ -21,9 +21,9 @@ import com.google.common.collect.Streams; import de.learnlib.oracle.membership.SimulatorOracle; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.automaton.procedural.SPA; import net.automatalib.util.automaton.conformance.SPATestsIterator; import net.automatalib.util.automaton.conformance.WMethodTestsIterator; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WpMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WpMethodEQOracleTest.java index 5b939e2e3c..ce375185ab 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WpMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spa/WpMethodEQOracleTest.java @@ -21,9 +21,9 @@ import com.google.common.collect.Streams; import de.learnlib.oracle.membership.SimulatorOracle; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.automaton.procedural.SPA; import net.automatalib.util.automaton.conformance.SPATestsIterator; import net.automatalib.util.automaton.conformance.WpMethodTestsIterator; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spmm/WMethodEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spmm/WMethodEQOracleTest.java index c0f2a7e229..863b7b5153 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spmm/WMethodEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/spmm/WMethodEQOracleTest.java @@ -21,11 +21,11 @@ import com.google.common.collect.Streams; import de.learnlib.oracle.membership.SimulatorOracle; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; -import net.automatalib.alphabet.DefaultProceduralOutputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralOutputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; +import net.automatalib.alphabet.impl.DefaultProceduralOutputAlphabet; import net.automatalib.automaton.procedural.SPMM; import net.automatalib.util.automaton.conformance.SPMMWMethodTestsIterator; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/vpa/RandomWellMatchedWordsEQOracleTest.java b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/vpa/RandomWellMatchedWordsEQOracleTest.java index aec84576de..4a4eaf6f01 100644 --- a/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/vpa/RandomWellMatchedWordsEQOracleTest.java +++ b/oracles/equivalence-oracles/src/test/java/de/learnlib/oracle/equivalence/vpa/RandomWellMatchedWordsEQOracleTest.java @@ -21,9 +21,9 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.equivalence.AbstractEQOracleTest; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultVPAlphabet; import net.automatalib.alphabet.VPAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultVPAlphabet; import net.automatalib.automaton.concept.Output; import net.automatalib.automaton.concept.SuffixOutput; import net.automatalib.word.Word; diff --git a/oracles/membership-oracles/pom.xml b/oracles/membership-oracles/pom.xml index 075eda777b..2bf85b23f3 100644 --- a/oracles/membership-oracles/pom.xml +++ b/oracles/membership-oracles/pom.xml @@ -89,4 +89,19 @@ limitations under the License. testng + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + @{argLine} --add-reads=de.learnlib.oracle.membership=net.automatalib.core + + + + + diff --git a/oracles/membership-oracles/src/main/java/module-info.java b/oracles/membership-oracles/src/main/java/module-info.java new file mode 100644 index 0000000000..d83f017f45 --- /dev/null +++ b/oracles/membership-oracles/src/main/java/module-info.java @@ -0,0 +1,40 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 a collection of membership oracles. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-membership-oracles</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.oracle.membership { + + requires de.learnlib.api; + requires de.learnlib.common.util; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires org.checkerframework.checker.qual; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.oracle.membership; +} diff --git a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULOmegaOracleTest.java b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULOmegaOracleTest.java index 1350113ac7..4cdf7166ab 100644 --- a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULOmegaOracleTest.java +++ b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULOmegaOracleTest.java @@ -19,12 +19,12 @@ import java.util.List; import de.learnlib.driver.simulator.ObservableMealySimulatorSUL; -import de.learnlib.example.mealy.ExampleCoffeeMachine; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; import de.learnlib.oracle.OmegaMembershipOracle.MealyOmegaMembershipOracle; import de.learnlib.query.OmegaQuery; import de.learnlib.sul.ObservableSUL; -import net.automatalib.automaton.transducer.CompactMealy; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.word.Word; import org.mockito.Mockito; import org.testng.Assert; diff --git a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULSymbolQueryOracleTest.java b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULSymbolQueryOracleTest.java index 4fa2b6f729..acaeb39343 100644 --- a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULSymbolQueryOracleTest.java +++ b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SULSymbolQueryOracleTest.java @@ -18,10 +18,10 @@ import java.util.Random; import de.learnlib.driver.simulator.MealySimulatorSUL; -import de.learnlib.example.mealy.ExampleRandomMealy; import de.learnlib.sul.SUL; +import de.learnlib.testsupport.example.mealy.ExampleRandomMealy; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import org.mockito.Mockito; import org.testng.Assert; diff --git a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOmegaOracleTest.java b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOmegaOracleTest.java index b361e6d5e9..03e681e0f0 100644 --- a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOmegaOracleTest.java +++ b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOmegaOracleTest.java @@ -18,9 +18,9 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.dfa.ExamplePaulAndMary; import de.learnlib.oracle.membership.SimulatorOmegaOracle.DFASimulatorOmegaOracle; import de.learnlib.query.OmegaQuery; +import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary; import net.automatalib.automaton.fsa.DFA; import net.automatalib.word.Word; import org.testng.Assert; diff --git a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOracleTest.java b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOracleTest.java index 01d8822dd7..57c3b02cea 100644 --- a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOracleTest.java +++ b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/SimulatorOracleTest.java @@ -19,8 +19,8 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.dfa.ExamplePaulAndMary; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary; import net.automatalib.automaton.fsa.DFA; import net.automatalib.word.Word; import org.testng.Assert; diff --git a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/StateLocalInputSULSymbolQueryOracleTest.java b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/StateLocalInputSULSymbolQueryOracleTest.java index c8858819d9..c3b999096a 100644 --- a/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/StateLocalInputSULSymbolQueryOracleTest.java +++ b/oracles/membership-oracles/src/test/java/de/learnlib/oracle/membership/StateLocalInputSULSymbolQueryOracleTest.java @@ -19,10 +19,10 @@ import java.util.Random; import de.learnlib.driver.simulator.StateLocalInputMealySimulatorSUL; -import de.learnlib.example.mealy.ExampleRandomStateLocalInputMealy; import de.learnlib.sul.StateLocalInputSUL; +import de.learnlib.testsupport.example.mealy.ExampleRandomStateLocalInputMealy; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.word.Word; import org.mockito.Mockito; import org.testng.Assert; diff --git a/oracles/parallelism/pom.xml b/oracles/parallelism/pom.xml index ae5b9d47bc..3c878708b7 100644 --- a/oracles/parallelism/pom.xml +++ b/oracles/parallelism/pom.xml @@ -28,7 +28,7 @@ limitations under the License. learnlib-parallelism LearnLib :: Oracles :: Parallelism - Support for parallel membership queries and thread-safe caches + Support for posing membership queries in parallel @@ -36,10 +36,6 @@ limitations under the License. de.learnlib learnlib-api - - de.learnlib - learnlib-cache - de.learnlib learnlib-membership-oracles @@ -67,10 +63,6 @@ limitations under the License. net.automatalib automata-commons-smartcollections - - net.automatalib - automata-incremental - org.checkerframework diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessor.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessor.java index 0929e1cccb..cd1c276ad0 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessor.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessor.java @@ -24,6 +24,9 @@ import java.util.function.Supplier; import com.google.common.base.Throwables; +import de.learnlib.exception.BatchInterruptedException; +import de.learnlib.oracle.BatchProcessor; +import de.learnlib.oracle.ThreadPool; import de.learnlib.setting.LearnLibProperty; import de.learnlib.setting.LearnLibSettings; import org.checkerframework.checker.index.qual.NonNegative; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessorBuilder.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessorBuilder.java index e919ebf6d6..f9a70d0196 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessorBuilder.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractDynamicBatchProcessorBuilder.java @@ -22,7 +22,8 @@ import java.util.function.Supplier; import com.google.common.base.Preconditions; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.BatchProcessor; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import net.automatalib.common.util.concurrent.ScalingThreadPoolExecutor; import org.checkerframework.checker.index.qual.NonNegative; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractQueriesJob.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractQueriesJob.java index 99c4f7ef77..422b0dd6ed 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractQueriesJob.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractQueriesJob.java @@ -17,6 +17,8 @@ import java.util.Collection; +import de.learnlib.oracle.BatchProcessor; + /** * Abstract base class for jobs (i.e., {@link Runnable}s) that process queries. *

diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessor.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessor.java index f89f962b77..c3f479c999 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessor.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessor.java @@ -25,6 +25,9 @@ import java.util.concurrent.Future; import com.google.common.base.Throwables; +import de.learnlib.exception.BatchInterruptedException; +import de.learnlib.oracle.BatchProcessor; +import de.learnlib.oracle.ThreadPool; import de.learnlib.setting.LearnLibProperty; import de.learnlib.setting.LearnLibSettings; import net.automatalib.common.smartcollection.ArrayStorage; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessorBuilder.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessorBuilder.java index e23e973255..ff7cb8c1e4 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessorBuilder.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/AbstractStaticBatchProcessorBuilder.java @@ -21,7 +21,8 @@ import java.util.function.Supplier; import com.google.common.base.Preconditions; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.BatchProcessor; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import org.checkerframework.checker.index.qual.NonNegative; import org.checkerframework.checker.nullness.qual.Nullable; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracle.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracle.java index 8cd6ee54a4..86911b14d0 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracle.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracle.java @@ -21,6 +21,7 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.OmegaMembershipOracle; +import de.learnlib.oracle.ParallelOmegaOracle; import de.learnlib.query.OmegaQuery; import net.automatalib.word.Word; import org.checkerframework.checker.index.qual.NonNegative; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOracle.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOracle.java index d1605f34a5..af1e10e57e 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOracle.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicParallelOracle.java @@ -20,6 +20,7 @@ import java.util.function.Supplier; import de.learnlib.oracle.MembershipOracle; +import de.learnlib.oracle.ParallelOracle; import de.learnlib.query.Query; import org.checkerframework.checker.index.qual.NonNegative; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicQueriesJob.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicQueriesJob.java index 3ce0e6e405..e248b6696c 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicQueriesJob.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/DynamicQueriesJob.java @@ -17,6 +17,8 @@ import java.util.Collection; +import de.learnlib.oracle.BatchProcessor; + /** * A queries job that maintains a thread-local reference to a {@link BatchProcessor}, and dynamically selects that * oracle depending on the executing thread. diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/ParallelOracleBuilders.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/ParallelOracleBuilders.java index c9b0573962..f13a281668 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/ParallelOracleBuilders.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/ParallelOracleBuilders.java @@ -22,10 +22,10 @@ import com.google.common.collect.Lists; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.OmegaMembershipOracle; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.oracle.membership.AbstractSULOmegaOracle; import de.learnlib.oracle.membership.SULOracle; import de.learnlib.oracle.membership.StateLocalInputSULOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; import de.learnlib.sul.ObservableSUL; import de.learnlib.sul.SUL; import de.learnlib.sul.StateLocalInputSUL; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracle.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracle.java index 4f90145f6d..2e8f30190c 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracle.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracle.java @@ -19,6 +19,7 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.OmegaMembershipOracle; +import de.learnlib.oracle.ParallelOmegaOracle; import de.learnlib.query.OmegaQuery; import net.automatalib.word.Word; import org.checkerframework.checker.index.qual.NonNegative; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleBuilder.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleBuilder.java index beb447cd16..ab8ff31fcd 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleBuilder.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleBuilder.java @@ -19,7 +19,7 @@ import java.util.function.Supplier; import de.learnlib.oracle.OmegaMembershipOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.query.OmegaQuery; /** diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracle.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracle.java index 12498cdb32..9adcad3bcc 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracle.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracle.java @@ -18,6 +18,7 @@ import java.util.Collection; import de.learnlib.oracle.MembershipOracle; +import de.learnlib.oracle.ParallelOracle; import de.learnlib.query.Query; import org.checkerframework.checker.index.qual.NonNegative; diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracleBuilder.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracleBuilder.java index f398548523..41efffef3e 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracleBuilder.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticParallelOracleBuilder.java @@ -19,7 +19,7 @@ import java.util.function.Supplier; import de.learnlib.oracle.MembershipOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.query.Query; /** diff --git a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticQueriesJob.java b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticQueriesJob.java index 00e068cfe0..3dec64f1a0 100644 --- a/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticQueriesJob.java +++ b/oracles/parallelism/src/main/java/de/learnlib/oracle/parallelism/StaticQueriesJob.java @@ -17,6 +17,8 @@ import java.util.Collection; +import de.learnlib.oracle.BatchProcessor; + /** * A queries job that maintains a fixed reference to a {@link BatchProcessor}, executes queries using this oracle * regardless of the executing thread. diff --git a/oracles/parallelism/src/main/java/module-info.java b/oracles/parallelism/src/main/java/module-info.java new file mode 100644 index 0000000000..cf29aad47f --- /dev/null +++ b/oracles/parallelism/src/main/java/module-info.java @@ -0,0 +1,41 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 support for posing membership queries in parallel. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-parallelism</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.oracle.parallelism { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.oracle.membership; + requires de.learnlib.setting; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.common.smartcollection; + requires org.checkerframework.checker.qual; + + exports de.learnlib.oracle.parallelism; +} diff --git a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/Config.java b/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/Config.java deleted file mode 100644 index eeaafb5cb1..0000000000 --- a/oracles/parallelism/src/test/java/de/learnlib/filter/cache/configuration/Config.java +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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.filter.cache.configuration; - -import java.util.Random; - -import de.learnlib.driver.simulator.MealySimulatorSUL; -import de.learnlib.driver.simulator.StateLocalInputMealySimulatorSUL; -import de.learnlib.filter.statistic.oracle.DFACounterOracle; -import de.learnlib.filter.statistic.oracle.MealyCounterOracle; -import de.learnlib.filter.statistic.oracle.MooreCounterOracle; -import de.learnlib.filter.statistic.sul.ResetCounterSUL; -import de.learnlib.filter.statistic.sul.ResetCounterStateLocalInputSUL; -import de.learnlib.oracle.membership.DFASimulatorOracle; -import de.learnlib.oracle.membership.MealySimulatorOracle; -import de.learnlib.oracle.membership.MooreSimulatorOracle; -import de.learnlib.sul.SUL; -import de.learnlib.sul.StateLocalInputSUL; -import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.DFA; -import net.automatalib.automaton.transducer.CompactMealy; -import net.automatalib.automaton.transducer.CompactMoore; -import net.automatalib.automaton.transducer.MealyMachine; -import net.automatalib.automaton.transducer.MooreMachine; -import net.automatalib.util.automaton.random.RandomAutomata; - -public final class Config { - - public static final Alphabet ALPHABET; - public static final DFA TARGET_MODEL_DFA; - public static final MealyMachine TARGET_MODEL_MEALY; - public static final MooreMachine TARGET_MODEL_MOORE; - public static final SUL TARGET_MODEL_SUL; - public static final StateLocalInputSUL TARGET_MODEL_SLI_SUL; - - static { - ALPHABET = Alphabets.characters('a', 'e'); - TARGET_MODEL_DFA = RandomAutomata.randomDFA(new Random(42), 10, ALPHABET); - - final CompactMealy mealy = - RandomAutomata.randomMealy(new Random(42), 10, ALPHABET, ALPHABET); - - final CompactMoore moore = - RandomAutomata.randomMoore(new Random(42), 10, ALPHABET, ALPHABET); - - TARGET_MODEL_MEALY = mealy; - TARGET_MODEL_MOORE = moore; - TARGET_MODEL_SUL = new MealySimulatorSUL<>(mealy); - TARGET_MODEL_SLI_SUL = new StateLocalInputMealySimulatorSUL<>(mealy); - } - - private Config() {} - - public static DFACounterOracle getCounter(DFA delegate) { - return new DFACounterOracle<>(new DFASimulatorOracle<>(delegate)); - } - - public static MealyCounterOracle getCounter(MealyMachine delegate) { - return new MealyCounterOracle<>(new MealySimulatorOracle<>(delegate)); - } - - public static MooreCounterOracle getCounter(MooreMachine delegate) { - return new MooreCounterOracle<>(new MooreSimulatorOracle<>(delegate)); - } - - public static ResetCounterSUL getCounter(SUL delegate) { - return new ResetCounterSUL<>("Queries", delegate); - } - - public static ResetCounterStateLocalInputSUL getCounter(StateLocalInputSUL delegate) { - return new ResetCounterStateLocalInputSUL<>("Queries", delegate); - } -} diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOmegaOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOmegaOracleTest.java index 7d18a16876..b3ea13927c 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOmegaOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOmegaOracleTest.java @@ -23,7 +23,8 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.OmegaMembershipOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ParallelOmegaOracle; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.query.OmegaQuery; import de.learnlib.sul.ObservableSUL; import net.automatalib.word.Word; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOracleTest.java index c508598c04..0fd5776eb3 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractDynamicParallelOracleTest.java @@ -22,7 +22,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import de.learnlib.oracle.MembershipOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ParallelOracle; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.query.Query; import de.learnlib.sul.StateLocalInputSUL; import net.automatalib.word.Word; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOmegaOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOmegaOracleTest.java index 6b9aded6d0..0990e92ae3 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOmegaOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOmegaOracleTest.java @@ -25,7 +25,7 @@ import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.OmegaMembershipOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.oracle.parallelism.Utils.Analysis; import de.learnlib.oracle.parallelism.Utils.TestSULOutput; import de.learnlib.query.OmegaQuery; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOracleTest.java index f408d2e436..a9c2a141fa 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/AbstractStaticParallelOracleTest.java @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger; import de.learnlib.oracle.MembershipOracle; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.oracle.parallelism.Utils.Analysis; import de.learnlib.oracle.parallelism.Utils.TestSULOutput; import de.learnlib.query.DefaultQuery; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracleTest.java index 68408530c8..9ddf0d425a 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOmegaOracleTest.java @@ -20,7 +20,8 @@ import java.util.List; import java.util.concurrent.CountDownLatch; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ParallelOmegaOracle; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.query.OmegaQuery; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOracleTest.java index ced5d05e6d..c1caf3f21f 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/DynamicParallelOracleTest.java @@ -20,7 +20,8 @@ import java.util.List; import java.util.concurrent.CountDownLatch; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; +import de.learnlib.oracle.ParallelOracle; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.query.Query; import org.testng.annotations.Test; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleTest.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleTest.java index 2dfed166a6..ff46c5d6f7 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleTest.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/StaticParallelOmegaOracleTest.java @@ -17,6 +17,7 @@ import java.util.Arrays; +import de.learnlib.oracle.ParallelOmegaOracle; import de.learnlib.oracle.parallelism.AbstractStaticParallelOmegaOracleTest.TestOutput; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/Utils.java b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/Utils.java index 858f90aadc..9e8cb27e43 100644 --- a/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/Utils.java +++ b/oracles/parallelism/src/test/java/de/learnlib/oracle/parallelism/Utils.java @@ -19,8 +19,8 @@ import java.util.Map; import java.util.Random; +import de.learnlib.oracle.ThreadPool.PoolPolicy; import de.learnlib.oracle.parallelism.AbstractStaticParallelOracleTest.TestOutput; -import de.learnlib.oracle.parallelism.ThreadPool.PoolPolicy; import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.DataProvider; diff --git a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/package-info.java b/oracles/property-oracles/src/main/java/module-info.java similarity index 51% rename from algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/package-info.java rename to oracles/property-oracles/src/main/java/module-info.java index cb88d1ba50..1ca41237a9 100644 --- a/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithm/kv/package-info.java +++ b/oracles/property-oracles/src/main/java/module-info.java @@ -15,7 +15,25 @@ */ /** - * This package (and sub-packages) provides the implementation of the learning algorithm described in the book "An - * Introduction to Computational Learning Theory" by Michael Kearns and Umesh Vazirani. + * This module provides a collection of property oracles. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib</groupId>
+ *   <artifactId>learnlib-property-oracles</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
*/ -package de.learnlib.algorithm.kv; +open module de.learnlib.oracle.property { + + requires de.learnlib.api; + requires net.automatalib.api; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + requires static de.learnlib.tooling.annotation; + + exports de.learnlib.oracle.property; +} diff --git a/oracles/property-oracles/src/test/java/de/learnlib/oracle/property/MealyPropertyOracleTest.java b/oracles/property-oracles/src/test/java/de/learnlib/oracle/property/MealyPropertyOracleTest.java index 12e07a719f..9a7aa52349 100644 --- a/oracles/property-oracles/src/test/java/de/learnlib/oracle/property/MealyPropertyOracleTest.java +++ b/oracles/property-oracles/src/test/java/de/learnlib/oracle/property/MealyPropertyOracleTest.java @@ -17,7 +17,6 @@ import java.util.function.Function; -import de.learnlib.example.mealy.ExampleTinyMealy; import de.learnlib.oracle.EmptinessOracle.MealyEmptinessOracle; import de.learnlib.oracle.InclusionOracle.MealyInclusionOracle; import de.learnlib.oracle.LassoEmptinessOracle.MealyLassoEmptinessOracle; @@ -30,10 +29,11 @@ import de.learnlib.oracle.membership.MealySimulatorOracle; import de.learnlib.oracle.membership.SimulatorOmegaOracle.MealySimulatorOmegaOracle; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.mealy.ExampleTinyMealy; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.modelchecker.ltsmin.LTSminUtil; import net.automatalib.modelchecker.ltsmin.LTSminVersion; import net.automatalib.modelchecker.ltsmin.ltl.LTSminLTLIOBuilder; diff --git a/pom.xml b/pom.xml index c747f23452..45627b027b 100644 --- a/pom.xml +++ b/pom.xml @@ -209,7 +209,7 @@ limitations under the License. 3.6.0 3.3.0 3.3.2 - 3.10.1 + 3.11.0 4.3.0 3.6.0 3.1.1 @@ -229,11 +229,11 @@ limitations under the License. 3.12.1 3.3.0 4.7.3.6 - 3.1.2 + 3.2.2 1.2.0 - 0.11.0 + 0.12.0-SNAPSHOT 0.1 1.11.1 3.40.0 @@ -241,16 +241,14 @@ limitations under the License. 32.1.2-jre 1.13.0 2.3.1 - 1.49 1.3.12 - 1.8 + 1.11 5.6.0 2.0.9 7.5.1 1.4.20 - http://docs.oracle.com/javase/8/docs/api/ http://learnlib.github.io/automatalib/maven-site/${automatalib.version}/apidocs/ https://checkerframework.org/releases/${checkerframework.version}/api/ http://google.github.io/guava/releases/${guava.version}/api/docs/ @@ -590,14 +588,6 @@ limitations under the License. test
- - - org.jmockit - jmockit - ${jmockit.version} - test - - com.github.caciocavallosilano @@ -822,9 +812,10 @@ limitations under the License. true false - ${java.apidocs} ${guava.apidocs} - ${automatalib.apidocs} + + + @@ -898,6 +889,37 @@ limitations under the License. + + + default-compile + + compile + + + + 9 + false + + + + java-8-compile + + compile + + + + + ${project.build.sourceDirectory} + ${project.build.directory}/generated-sources + + none + + + module-info.java + + + + org.apache.maven.plugins @@ -960,12 +982,13 @@ limitations under the License. org.apache.maven.plugins maven-javadoc-plugin + + 11 + non-aggregate - - javadoc - + aggregate diff --git a/test-support/learner-it-support/pom.xml b/test-support/learner-it-support/pom.xml index 8f297d80bb..32daf1634c 100644 --- a/test-support/learner-it-support/pom.xml +++ b/test-support/learner-it-support/pom.xml @@ -37,10 +37,6 @@ limitations under the License. de.learnlib learnlib-api - - de.learnlib - learnlib-cache - de.learnlib learnlib-drivers-simulator @@ -59,31 +55,16 @@ limitations under the License. de.learnlib learnlib-membership-oracles - - de.learnlib.testsupport - learnlib-test-support - compile - - de.learnlib learnlib-util - - com.google.guava - guava - - net.automatalib automata-api - - net.automatalib - automata-commons-util - net.automatalib automata-core @@ -93,11 +74,6 @@ limitations under the License. automata-util - - org.checkerframework - checker-qual - - org.slf4j slf4j-api diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java index 65df2e0972..bca700892f 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFALearnerIT.java @@ -18,11 +18,11 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.DFALearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.equivalence.SimulatorEQOracle; import de.learnlib.oracle.membership.DFASimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.DFALearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.DFALearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.DFALearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java index 85171e16c1..a93c0be794 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractDFAPassiveLearnerIT.java @@ -19,11 +19,11 @@ import java.util.Collection; import java.util.List; -import de.learnlib.example.DefaultPassiveLearningExample.DefaultDFAPassiveLearningExample; -import de.learnlib.example.LearningExample.DFALearningExample; -import de.learnlib.example.LearningExamples; -import de.learnlib.example.PassiveLearningExample.DFAPassiveLearningExample; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.DefaultPassiveLearningExample.DefaultDFAPassiveLearningExample; +import de.learnlib.testsupport.example.LearningExample.DFALearningExample; +import de.learnlib.testsupport.example.LearningExamples; +import de.learnlib.testsupport.example.PassiveLearningExample.DFAPassiveLearningExample; import de.learnlib.testsupport.it.learner.PassiveLearnerVariantListImpl.DFAPassiveLearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.fsa.DFA; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractLearnerVariantITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractLearnerVariantITCase.java index a3e64a6511..9516b23411 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractLearnerVariantITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractLearnerVariantITCase.java @@ -16,10 +16,10 @@ package de.learnlib.testsupport.it.learner; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.example.LearningExample; import de.learnlib.logging.Category; import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.LearningExample; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.concept.FiniteRepresentation; import net.automatalib.word.Word; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java index d985adc746..12c1d0a36a 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyLearnerIT.java @@ -19,19 +19,18 @@ import java.util.List; import de.learnlib.driver.simulator.StateLocalInputMealySimulatorSUL; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.LearningExample.StateLocalInputMealyLearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.EquivalenceOracle.MealyEquivalenceOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.equivalence.MealySimulatorEQOracle; import de.learnlib.oracle.equivalence.mealy.StateLocalInputMealySimulatorEQOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import de.learnlib.oracle.membership.StateLocalInputSULOracle; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.LearningExample.StateLocalInputMealyLearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.MealyLearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.MealyLearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.automaton.transducer.StateLocalInputMealyMachine; import net.automatalib.util.automaton.transducer.MealyFilter; @@ -85,7 +84,7 @@ public Object[] createExampleITCases() { final O undefinedOutput = example.getUndefinedOutput(); // make sure, our oracle actually receives a partial mealy - final CompactMealy partialRef = + final StateLocalInputMealyMachine partialRef = MealyFilter.pruneTransitionsWithOutput(reference, alphabet, undefinedOutput); final MealyMembershipOracle mqOracle = diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java index 32d66372d9..ec424bdd8e 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealyPassiveLearnerIT.java @@ -19,11 +19,11 @@ import java.util.Collection; import java.util.List; -import de.learnlib.example.DefaultPassiveLearningExample.DefaultMealyPassiveLearningExample; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.LearningExamples; -import de.learnlib.example.PassiveLearningExample.MealyPassiveLearningExample; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.DefaultPassiveLearningExample.DefaultMealyPassiveLearningExample; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.LearningExamples; +import de.learnlib.testsupport.example.PassiveLearningExample.MealyPassiveLearningExample; import de.learnlib.testsupport.it.learner.PassiveLearnerVariantListImpl.MealyLearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MealyMachine; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java index 81049800dc..8009c09b12 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMealySymLearnerIT.java @@ -18,12 +18,12 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.equivalence.SimulatorEQOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.MealySymLearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.MealySymLearnerVariantListImpl; import de.learnlib.util.mealy.MealyUtil; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java index c5259619ec..d6b9650ec2 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreLearnerIT.java @@ -18,12 +18,12 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.MooreLearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.EquivalenceOracle.MooreEquivalenceOracle; import de.learnlib.oracle.MembershipOracle.MooreMembershipOracle; import de.learnlib.oracle.equivalence.MooreSimulatorEQOracle; import de.learnlib.oracle.membership.MooreSimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.MooreLearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.MooreLearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.MooreLearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java index 58f597dfae..381fb13fb5 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMoorePassiveLearnerIT.java @@ -19,11 +19,11 @@ import java.util.Collection; import java.util.List; -import de.learnlib.example.DefaultPassiveLearningExample.DefaultMoorePassiveLearningExample; -import de.learnlib.example.LearningExample.MooreLearningExample; -import de.learnlib.example.LearningExamples; -import de.learnlib.example.PassiveLearningExample.MoorePassiveLearningExample; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.DefaultPassiveLearningExample.DefaultMoorePassiveLearningExample; +import de.learnlib.testsupport.example.LearningExample.MooreLearningExample; +import de.learnlib.testsupport.example.LearningExamples; +import de.learnlib.testsupport.example.PassiveLearningExample.MoorePassiveLearningExample; import de.learnlib.testsupport.it.learner.PassiveLearnerVariantListImpl.MooreLearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.transducer.MooreMachine; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java index 2d9a95e105..4e0b0b4756 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractMooreSymLearnerIT.java @@ -18,12 +18,12 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.MooreLearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle; import de.learnlib.oracle.MembershipOracle.MooreMembershipOracle; import de.learnlib.oracle.equivalence.SimulatorEQOracle; import de.learnlib.oracle.membership.MooreSimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.MooreLearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.MooreSymLearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.MooreSymLearnerVariantListImpl; import de.learnlib.util.moore.MooreUtil; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java index b54f0c1fb3..9d74651a3e 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractOneSEVPALearnerIT.java @@ -18,11 +18,11 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.OneSEVPALearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.equivalence.vpa.SimulatorEQOracle; import de.learnlib.oracle.membership.SEVPASimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.OneSEVPALearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.OneSEVPALearnerVariantListImpl; import net.automatalib.alphabet.VPAlphabet; import net.automatalib.automaton.vpa.OneSEVPA; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java index c6a3c13a98..3f6d3d0ff3 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSBALearnerIT.java @@ -18,11 +18,11 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.SBALearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.equivalence.sba.SimulatorEQOracle; import de.learnlib.oracle.membership.SBASimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.SBALearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.SBALearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.SBALearnerVariantListImpl; import net.automatalib.alphabet.ProceduralInputAlphabet; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java index a33277f5ad..afc2df67fb 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPALearnerIT.java @@ -18,11 +18,11 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.SPALearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.equivalence.spa.SimulatorEQOracle; import de.learnlib.oracle.membership.SPASimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.SPALearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.SPALearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.SPALearnerVariantListImpl; import net.automatalib.alphabet.ProceduralInputAlphabet; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java index ec479b6e8b..ac19518f07 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSPMMLearnerIT.java @@ -18,11 +18,11 @@ import java.util.ArrayList; import java.util.List; -import de.learnlib.example.LearningExample.SPMMLearningExample; -import de.learnlib.example.LearningExamples; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.equivalence.spmm.SimulatorEQOracle; import de.learnlib.oracle.membership.SPMMSimulatorOracle; +import de.learnlib.testsupport.example.LearningExample.SPMMLearningExample; +import de.learnlib.testsupport.example.LearningExamples; import de.learnlib.testsupport.it.learner.LearnerVariantList.SPMMLearnerVariantList; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.SPMMLearnerVariantListImpl; import net.automatalib.alphabet.ProceduralInputAlphabet; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java index f48fe6a3bf..5a412a8824 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/AbstractSSTPassiveLearnerIT.java @@ -19,13 +19,13 @@ import java.util.Collection; import java.util.List; -import de.learnlib.example.DefaultPassiveLearningExample.DefaultSSTPassiveLearningExample; -import de.learnlib.example.LearningExample; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.LearningExample.SSTLearningExample; -import de.learnlib.example.LearningExamples; -import de.learnlib.example.PassiveLearningExample.SSTPassiveLearningExample; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.DefaultPassiveLearningExample.DefaultSSTPassiveLearningExample; +import de.learnlib.testsupport.example.LearningExample; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.LearningExample.SSTLearningExample; +import de.learnlib.testsupport.example.LearningExamples; +import de.learnlib.testsupport.example.PassiveLearningExample.SSTPassiveLearningExample; import de.learnlib.testsupport.it.learner.PassiveLearnerVariantListImpl.SSTLearnerVariantListImpl; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.UniversalDeterministicAutomaton; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java index 91f7d92ad8..65c505766d 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/LearnerITUtil.java @@ -20,15 +20,15 @@ import java.util.List; import java.util.Random; -import de.learnlib.example.LearningExample; -import de.learnlib.example.LearningExample.OneSEVPALearningExample; -import de.learnlib.example.LearningExample.SBALearningExample; -import de.learnlib.example.LearningExample.SPALearningExample; -import de.learnlib.example.LearningExample.SPMMLearningExample; -import de.learnlib.example.LearningExample.UniversalDeterministicLearningExample; -import de.learnlib.example.PassiveLearningExample; import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.LearningExample; +import de.learnlib.testsupport.example.LearningExample.OneSEVPALearningExample; +import de.learnlib.testsupport.example.LearningExample.SBALearningExample; +import de.learnlib.testsupport.example.LearningExample.SPALearningExample; +import de.learnlib.testsupport.example.LearningExample.SPMMLearningExample; +import de.learnlib.testsupport.example.LearningExample.UniversalDeterministicLearningExample; +import de.learnlib.testsupport.example.PassiveLearningExample; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.OneSEVPALearnerVariantListImpl; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.SBALearnerVariantListImpl; import de.learnlib.testsupport.it.learner.LearnerVariantListImpl.SPALearnerVariantListImpl; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/OneSEVPALearnerITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/OneSEVPALearnerITCase.java index 2b4a548681..9fea3e7e4b 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/OneSEVPALearnerITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/OneSEVPALearnerITCase.java @@ -15,8 +15,8 @@ */ package de.learnlib.testsupport.it.learner; -import de.learnlib.example.LearningExample.OneSEVPALearningExample; import de.learnlib.oracle.EquivalenceOracle; +import de.learnlib.testsupport.example.LearningExample.OneSEVPALearningExample; import net.automatalib.automaton.vpa.OneSEVPA; import net.automatalib.util.automaton.vpa.OneSEVPAs; import net.automatalib.word.Word; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/PassiveLearnerVariantITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/PassiveLearnerVariantITCase.java index 15da9f49a9..c86f04e286 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/PassiveLearnerVariantITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/PassiveLearnerVariantITCase.java @@ -18,9 +18,9 @@ import java.util.Collection; import de.learnlib.algorithm.PassiveLearningAlgorithm; -import de.learnlib.example.PassiveLearningExample; import de.learnlib.logging.Category; import de.learnlib.query.DefaultQuery; +import de.learnlib.testsupport.example.PassiveLearningExample; import net.automatalib.automaton.concept.SuffixOutput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SBALearnerITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SBALearnerITCase.java index 1a11f90025..a7d3d2eaec 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SBALearnerITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SBALearnerITCase.java @@ -15,8 +15,8 @@ */ package de.learnlib.testsupport.it.learner; -import de.learnlib.example.LearningExample.SBALearningExample; import de.learnlib.oracle.EquivalenceOracle; +import de.learnlib.testsupport.example.LearningExample.SBALearningExample; import net.automatalib.automaton.procedural.SBA; import net.automatalib.util.automaton.procedural.SBAs; import net.automatalib.word.Word; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPALearnerITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPALearnerITCase.java index b063048dbc..82180a7b5d 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPALearnerITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPALearnerITCase.java @@ -15,8 +15,8 @@ */ package de.learnlib.testsupport.it.learner; -import de.learnlib.example.LearningExample.SPALearningExample; import de.learnlib.oracle.EquivalenceOracle; +import de.learnlib.testsupport.example.LearningExample.SPALearningExample; import net.automatalib.automaton.procedural.SPA; import net.automatalib.util.automaton.procedural.SPAs; import net.automatalib.word.Word; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPMMLearnerITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPMMLearnerITCase.java index 4b0d745867..8933f5a8d4 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPMMLearnerITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/SPMMLearnerITCase.java @@ -15,8 +15,8 @@ */ package de.learnlib.testsupport.it.learner; -import de.learnlib.example.LearningExample.SPMMLearningExample; import de.learnlib.oracle.EquivalenceOracle; +import de.learnlib.testsupport.example.LearningExample.SPMMLearningExample; import net.automatalib.automaton.procedural.SPMM; import net.automatalib.util.automaton.procedural.SPMMs; import net.automatalib.word.Word; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/UniversalDeterministicLearnerITCase.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/UniversalDeterministicLearnerITCase.java index 11a62d5854..fb0a60439e 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/UniversalDeterministicLearnerITCase.java +++ b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/it/learner/UniversalDeterministicLearnerITCase.java @@ -15,8 +15,8 @@ */ package de.learnlib.testsupport.it.learner; -import de.learnlib.example.LearningExample.UniversalDeterministicLearningExample; import de.learnlib.oracle.EquivalenceOracle; +import de.learnlib.testsupport.example.LearningExample.UniversalDeterministicLearningExample; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.util.automaton.Automata; import net.automatalib.word.Word; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/package-info.java b/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/package-info.java deleted file mode 100644 index e8d748bc83..0000000000 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (including sub-packages) contains utility code for formalizing test-cases. - */ -package de.learnlib.testsupport; diff --git a/test-support/learner-it-support/src/main/java/module-info.java b/test-support/learner-it-support/src/main/java/module-info.java new file mode 100644 index 0000000000..0f57e907e3 --- /dev/null +++ b/test-support/learner-it-support/src/main/java/module-info.java @@ -0,0 +1,46 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 support classes for easily writing integration test cases for learning algorithms. Note: + * This module is not intended as a library but only exists for internal testing purposes. You may use it but + * documentation may be sparse and usability may be inconvenient without any intentions to change it. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib.testsupport</groupId>
+ *   <artifactId>learnlib-learner-it-support</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.testsupport.it { + + requires de.learnlib.api; + requires de.learnlib.common.util; + requires de.learnlib.driver.simulator; + requires de.learnlib.oracle.membership; + requires de.learnlib.oracle.equivalence; + requires de.learnlib.testsupport.example; + requires net.automatalib.api; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.slf4j; + requires org.testng; + + exports de.learnlib.testsupport.it.learner; +} diff --git a/test-support/learning-examples/pom.xml b/test-support/learning-examples/pom.xml index 5a526ee09a..93e2de5b66 100644 --- a/test-support/learning-examples/pom.xml +++ b/test-support/learning-examples/pom.xml @@ -29,7 +29,7 @@ limitations under the License. jar LearnLib :: Test Support :: Learning Examples - Example learning setups, to be used for integration testing + Example learning setups to be used for integration testing diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/package-info.java b/test-support/learning-examples/src/main/java/de/learnlib/example/package-info.java deleted file mode 100644 index 7bfebcc57a..0000000000 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2013-2024 TU Dortmund University - * This file is part of LearnLib, http://www.learnlib.de/. - * - * 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 package (including sub-packages) contains example models of various types used in integration-tests. - */ -package de.learnlib.example; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/DefaultLearningExample.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/DefaultLearningExample.java similarity index 99% rename from test-support/learning-examples/src/main/java/de/learnlib/example/DefaultLearningExample.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/DefaultLearningExample.java index dd1b9a80b8..8495fc3b2a 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/DefaultLearningExample.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/DefaultLearningExample.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example; +package de.learnlib.testsupport.example; import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/DefaultPassiveLearningExample.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/DefaultPassiveLearningExample.java similarity index 98% rename from test-support/learning-examples/src/main/java/de/learnlib/example/DefaultPassiveLearningExample.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/DefaultPassiveLearningExample.java index 5d627232b9..d92cf4dd5a 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/DefaultPassiveLearningExample.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/DefaultPassiveLearningExample.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example; +package de.learnlib.testsupport.example; import java.util.Collection; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/LearningExample.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/LearningExample.java similarity index 98% rename from test-support/learning-examples/src/main/java/de/learnlib/example/LearningExample.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/LearningExample.java index be18b0c027..4c7a780f68 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/LearningExample.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/LearningExample.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example; +package de.learnlib.testsupport.example; import net.automatalib.alphabet.Alphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/LearningExamples.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/LearningExamples.java similarity index 75% rename from test-support/learning-examples/src/main/java/de/learnlib/example/LearningExamples.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/LearningExamples.java index 3f17554b34..8dca17072d 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/LearningExamples.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/LearningExamples.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example; +package de.learnlib.testsupport.example; import java.util.Arrays; import java.util.Collection; @@ -21,41 +21,41 @@ import java.util.List; import java.util.Random; -import de.learnlib.example.LearningExample.DFALearningExample; -import de.learnlib.example.LearningExample.MealyLearningExample; -import de.learnlib.example.LearningExample.MooreLearningExample; -import de.learnlib.example.LearningExample.OneSEVPALearningExample; -import de.learnlib.example.LearningExample.SBALearningExample; -import de.learnlib.example.LearningExample.SPALearningExample; -import de.learnlib.example.LearningExample.SPMMLearningExample; -import de.learnlib.example.LearningExample.SSTLearningExample; -import de.learnlib.example.LearningExample.StateLocalInputMealyLearningExample; -import de.learnlib.example.dfa.ExampleAngluin; -import de.learnlib.example.dfa.ExampleKeylock; -import de.learnlib.example.dfa.ExamplePaulAndMary; -import de.learnlib.example.dfa.ExampleTinyDFA; -import de.learnlib.example.mealy.ExampleCoffeeMachine; -import de.learnlib.example.mealy.ExampleGrid; -import de.learnlib.example.mealy.ExampleRandomMealy; -import de.learnlib.example.mealy.ExampleRandomStateLocalInputMealy; -import de.learnlib.example.mealy.ExampleShahbazGroz; -import de.learnlib.example.mealy.ExampleStack; -import de.learnlib.example.mealy.ExampleTinyMealy; -import de.learnlib.example.moore.ExampleRandomMoore; -import de.learnlib.example.sba.ExampleRandomSBA; -import de.learnlib.example.spa.ExamplePalindrome; -import de.learnlib.example.spa.ExampleRandomSPA; -import de.learnlib.example.spmm.ExampleRandomSPMM; -import de.learnlib.example.sst.ExampleRandomSST; -import de.learnlib.example.vpa.ExampleRandomOneSEVPA; +import de.learnlib.testsupport.example.LearningExample.DFALearningExample; +import de.learnlib.testsupport.example.LearningExample.MealyLearningExample; +import de.learnlib.testsupport.example.LearningExample.MooreLearningExample; +import de.learnlib.testsupport.example.LearningExample.OneSEVPALearningExample; +import de.learnlib.testsupport.example.LearningExample.SBALearningExample; +import de.learnlib.testsupport.example.LearningExample.SPALearningExample; +import de.learnlib.testsupport.example.LearningExample.SPMMLearningExample; +import de.learnlib.testsupport.example.LearningExample.SSTLearningExample; +import de.learnlib.testsupport.example.LearningExample.StateLocalInputMealyLearningExample; +import de.learnlib.testsupport.example.dfa.ExampleAngluin; +import de.learnlib.testsupport.example.dfa.ExampleKeylock; +import de.learnlib.testsupport.example.dfa.ExamplePaulAndMary; +import de.learnlib.testsupport.example.dfa.ExampleTinyDFA; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine; +import de.learnlib.testsupport.example.mealy.ExampleGrid; +import de.learnlib.testsupport.example.mealy.ExampleRandomMealy; +import de.learnlib.testsupport.example.mealy.ExampleRandomStateLocalInputMealy; +import de.learnlib.testsupport.example.mealy.ExampleShahbazGroz; +import de.learnlib.testsupport.example.mealy.ExampleStack; +import de.learnlib.testsupport.example.mealy.ExampleTinyMealy; +import de.learnlib.testsupport.example.moore.ExampleRandomMoore; +import de.learnlib.testsupport.example.sba.ExampleRandomSBA; +import de.learnlib.testsupport.example.spa.ExamplePalindrome; +import de.learnlib.testsupport.example.spa.ExampleRandomSPA; +import de.learnlib.testsupport.example.spmm.ExampleRandomSPMM; +import de.learnlib.testsupport.example.sst.ExampleRandomSST; +import de.learnlib.testsupport.example.vpa.ExampleRandomOneSEVPA; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; -import net.automatalib.alphabet.DefaultProceduralOutputAlphabet; -import net.automatalib.alphabet.DefaultVPAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralOutputAlphabet; import net.automatalib.alphabet.VPAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; +import net.automatalib.alphabet.impl.DefaultProceduralOutputAlphabet; +import net.automatalib.alphabet.impl.DefaultVPAlphabet; import net.automatalib.word.Word; public final class LearningExamples { @@ -137,14 +137,14 @@ public static List> createSPAExamples() { } public static List> createSBAExamples() { - return Arrays.asList(de.learnlib.example.sba.ExamplePalindrome.createExample(), + return Arrays.asList(de.learnlib.testsupport.example.sba.ExamplePalindrome.createExample(), ExampleRandomSBA.createExample(new Random(RANDOM_SEED), PROCEDURAL_INPUT_ALPHABET, PROCEDURE_SIZE)); } public static List> createSPMMExamples() { - return Arrays.asList(de.learnlib.example.spmm.ExamplePalindrome.createExample(), + return Arrays.asList(de.learnlib.testsupport.example.spmm.ExamplePalindrome.createExample(), ExampleRandomSPMM.createExample(new Random(RANDOM_SEED), PROCEDURAL_INPUT_ALPHABET, PROCEDURAL_OUTPUT_ALPHABET, diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/PassiveLearningExample.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/PassiveLearningExample.java similarity index 96% rename from test-support/learning-examples/src/main/java/de/learnlib/example/PassiveLearningExample.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/PassiveLearningExample.java index 772ba46a06..4b3e3698b9 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/PassiveLearningExample.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/PassiveLearningExample.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example; +package de.learnlib.testsupport.example; import java.util.Collection; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/DFABenchmarks.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/DFABenchmarks.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/dfa/DFABenchmarks.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/DFABenchmarks.java index e653ffe3de..4a48ddc125 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/DFABenchmarks.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/DFABenchmarks.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.dfa; +package de.learnlib.testsupport.example.dfa; import java.io.IOException; import java.io.InputStream; -import de.learnlib.example.DefaultLearningExample.DefaultDFALearningExample; -import de.learnlib.example.LearningExample.DFALearningExample; import de.learnlib.logging.Category; -import net.automatalib.automaton.fsa.CompactDFA; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultDFALearningExample; +import de.learnlib.testsupport.example.LearningExample.DFALearningExample; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.serialization.learnlibv2.LearnLibV2Serialization; import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleAngluin.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleAngluin.java similarity index 90% rename from test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleAngluin.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleAngluin.java index c5eb36a6d5..2d1bc2e330 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleAngluin.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleAngluin.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.dfa; +package de.learnlib.testsupport.example.dfa; -import de.learnlib.example.DefaultLearningExample.DefaultDFALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultDFALearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.MutableDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleKeylock.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleKeylock.java similarity index 92% rename from test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleKeylock.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleKeylock.java index 0f77a6eb92..f7aa89b098 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleKeylock.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleKeylock.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.dfa; +package de.learnlib.testsupport.example.dfa; -import de.learnlib.example.DefaultLearningExample.DefaultDFALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultDFALearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.fsa.impl.CompactDFA; public class ExampleKeylock extends DefaultDFALearningExample { diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExamplePaulAndMary.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExamplePaulAndMary.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExamplePaulAndMary.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExamplePaulAndMary.java index 85ee1c3a91..c4a4fe4f2e 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExamplePaulAndMary.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExamplePaulAndMary.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.dfa; +package de.learnlib.testsupport.example.dfa; -import de.learnlib.example.DefaultLearningExample.DefaultDFALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultDFALearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.MutableDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleRandomDFA.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleRandomDFA.java similarity index 86% rename from test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleRandomDFA.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleRandomDFA.java index 3989f9ebc0..37f1b95ce3 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleRandomDFA.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleRandomDFA.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.dfa; +package de.learnlib.testsupport.example.dfa; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultDFALearningExample; -import net.automatalib.alphabet.Alphabets; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultDFALearningExample; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.util.automaton.random.RandomAutomata; public class ExampleRandomDFA extends DefaultDFALearningExample { diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleTinyDFA.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleTinyDFA.java similarity index 88% rename from test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleTinyDFA.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleTinyDFA.java index 5f6e3a4609..ab11642d48 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/dfa/ExampleTinyDFA.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/dfa/ExampleTinyDFA.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.dfa; +package de.learnlib.testsupport.example.dfa; -import de.learnlib.example.DefaultLearningExample.DefaultDFALearningExample; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.fsa.CompactDFA; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultDFALearningExample; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.fsa.impl.CompactDFA; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleCoffeeMachine.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleCoffeeMachine.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java index 049d3d824b..bf5633fcae 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleCoffeeMachine.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleCoffeeMachine.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; -import de.learnlib.example.DefaultLearningExample.DefaultMealyLearningExample; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMealyLearningExample; +import de.learnlib.testsupport.example.mealy.ExampleCoffeeMachine.Input; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MutableMealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleGrid.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java similarity index 92% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleGrid.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java index 8ddf611b10..c56493a716 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleGrid.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleGrid.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; -import de.learnlib.example.DefaultLearningExample.DefaultMealyLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMealyLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MutableMealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; /** * This class generates a Mealy machine consisting of a two-dimensional grid of states. Each transition has unique diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleRandomMealy.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleRandomMealy.java similarity index 90% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleRandomMealy.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleRandomMealy.java index 25d569f168..6e60ccc5b3 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleRandomMealy.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleRandomMealy.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; import java.util.Arrays; import java.util.Collections; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultMealyLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMealyLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.random.RandomAutomata; public class ExampleRandomMealy extends DefaultMealyLearningExample { diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleRandomStateLocalInputMealy.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleRandomStateLocalInputMealy.java similarity index 96% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleRandomStateLocalInputMealy.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleRandomStateLocalInputMealy.java index fde2d8323a..8cad19e1f2 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleRandomStateLocalInputMealy.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleRandomStateLocalInputMealy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; import java.util.Arrays; import java.util.Collection; @@ -22,11 +22,11 @@ import java.util.Objects; import java.util.Random; -import de.learnlib.example.LearningExample.StateLocalInputMealyLearningExample; +import de.learnlib.testsupport.example.LearningExample.StateLocalInputMealyLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.automaton.transducer.StateLocalInputMealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.mapping.Mapping; import net.automatalib.common.util.mapping.MutableMapping; import net.automatalib.common.util.random.RandomUtil; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleShahbazGroz.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleShahbazGroz.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java index f1603fa21d..e0b5344dba 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleShahbazGroz.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleShahbazGroz.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; -import de.learnlib.example.DefaultLearningExample.DefaultMealyLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMealyLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MutableMealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleStack.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java similarity index 87% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleStack.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java index 580b4a3500..b3039f7384 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleStack.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleStack.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; -import de.learnlib.example.DefaultLearningExample.DefaultMealyLearningExample; -import de.learnlib.example.mealy.ExampleStack.Input; -import de.learnlib.example.mealy.ExampleStack.Output; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMealyLearningExample; +import de.learnlib.testsupport.example.mealy.ExampleStack.Input; +import de.learnlib.testsupport.example.mealy.ExampleStack.Output; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MutableMealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleTinyMealy.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleTinyMealy.java similarity index 87% rename from test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleTinyMealy.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleTinyMealy.java index 3587906042..cf3a8c3bcd 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/mealy/ExampleTinyMealy.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/mealy/ExampleTinyMealy.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.mealy; +package de.learnlib.testsupport.example.mealy; -import de.learnlib.example.DefaultLearningExample.DefaultMealyLearningExample; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.automaton.transducer.CompactMealy; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMealyLearningExample; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; /** diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/moore/ExampleRandomMoore.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/moore/ExampleRandomMoore.java similarity index 90% rename from test-support/learning-examples/src/main/java/de/learnlib/example/moore/ExampleRandomMoore.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/moore/ExampleRandomMoore.java index 80b2f1bdf9..5fa1f13533 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/moore/ExampleRandomMoore.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/moore/ExampleRandomMoore.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.moore; +package de.learnlib.testsupport.example.moore; import java.util.Arrays; import java.util.Collections; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultMooreLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultMooreLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactMoore; +import net.automatalib.automaton.transducer.impl.CompactMoore; import net.automatalib.util.automaton.random.RandomAutomata; public class ExampleRandomMoore extends DefaultMooreLearningExample { diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/sba/ExamplePalindrome.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sba/ExamplePalindrome.java similarity index 90% rename from test-support/learning-examples/src/main/java/de/learnlib/example/sba/ExamplePalindrome.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sba/ExamplePalindrome.java index 0c4b3e9c9b..a5932f4e8a 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/sba/ExamplePalindrome.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sba/ExamplePalindrome.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.sba; +package de.learnlib.testsupport.example.sba; import java.util.HashMap; import java.util.Map; -import de.learnlib.example.DefaultLearningExample.DefaultSBALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSBALearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.automaton.fsa.DFA; -import net.automatalib.automaton.fsa.FastDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; +import net.automatalib.automaton.fsa.impl.FastDFA; import net.automatalib.automaton.procedural.SBA; -import net.automatalib.automaton.procedural.StackSBA; +import net.automatalib.automaton.procedural.impl.StackSBA; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.util.automaton.fsa.MutableDFAs; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/sba/ExampleRandomSBA.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sba/ExampleRandomSBA.java similarity index 90% rename from test-support/learning-examples/src/main/java/de/learnlib/example/sba/ExampleRandomSBA.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sba/ExampleRandomSBA.java index f2578666de..348fbe4ef3 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/sba/ExampleRandomSBA.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sba/ExampleRandomSBA.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.sba; +package de.learnlib.testsupport.example.sba; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultSBALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSBALearningExample; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/spa/ExamplePalindrome.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spa/ExamplePalindrome.java similarity index 89% rename from test-support/learning-examples/src/main/java/de/learnlib/example/spa/ExamplePalindrome.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spa/ExamplePalindrome.java index 2e16112de4..82bb5a7078 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/spa/ExamplePalindrome.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spa/ExamplePalindrome.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.spa; +package de.learnlib.testsupport.example.spa; import java.util.HashMap; import java.util.Map; -import de.learnlib.example.DefaultLearningExample.DefaultSPALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSPALearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; -import net.automatalib.automaton.fsa.CompactDFA; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.automaton.fsa.DFA; -import net.automatalib.automaton.fsa.FastDFA; +import net.automatalib.automaton.fsa.impl.CompactDFA; +import net.automatalib.automaton.fsa.impl.FastDFA; import net.automatalib.automaton.procedural.SPA; -import net.automatalib.automaton.procedural.StackSPA; +import net.automatalib.automaton.procedural.impl.StackSPA; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.util.automaton.fsa.MutableDFAs; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/spa/ExampleRandomSPA.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spa/ExampleRandomSPA.java similarity index 90% rename from test-support/learning-examples/src/main/java/de/learnlib/example/spa/ExampleRandomSPA.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spa/ExampleRandomSPA.java index 1e1e6536d9..ce82c18da0 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/spa/ExampleRandomSPA.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spa/ExampleRandomSPA.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.spa; +package de.learnlib.testsupport.example.spa; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultSPALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSPALearningExample; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/spmm/ExamplePalindrome.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spmm/ExamplePalindrome.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/spmm/ExamplePalindrome.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spmm/ExamplePalindrome.java index bf242c8be2..007e6d9e73 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/spmm/ExamplePalindrome.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spmm/ExamplePalindrome.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.spmm; +package de.learnlib.testsupport.example.spmm; import java.util.HashMap; import java.util.Map; -import de.learnlib.example.DefaultLearningExample.DefaultSPMMLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSPMMLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; -import net.automatalib.alphabet.DefaultProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralInputAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.DefaultProceduralInputAlphabet; import net.automatalib.automaton.procedural.SPMM; -import net.automatalib.automaton.procedural.StackSPMM; -import net.automatalib.automaton.transducer.CompactMealy; -import net.automatalib.automaton.transducer.FastMealy; +import net.automatalib.automaton.procedural.impl.StackSPMM; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; +import net.automatalib.automaton.transducer.impl.FastMealy; import net.automatalib.util.automaton.builder.AutomatonBuilders; import net.automatalib.util.automaton.transducer.MutableMealyMachines; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/spmm/ExampleRandomSPMM.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spmm/ExampleRandomSPMM.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/spmm/ExampleRandomSPMM.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spmm/ExampleRandomSPMM.java index 600e68a1da..b3599f0d16 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/spmm/ExampleRandomSPMM.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/spmm/ExampleRandomSPMM.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.spmm; +package de.learnlib.testsupport.example.spmm; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultSPMMLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSPMMLearningExample; import net.automatalib.alphabet.ProceduralInputAlphabet; import net.automatalib.alphabet.ProceduralOutputAlphabet; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/sst/ExampleRandomSST.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sst/ExampleRandomSST.java similarity index 91% rename from test-support/learning-examples/src/main/java/de/learnlib/example/sst/ExampleRandomSST.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sst/ExampleRandomSST.java index e4d17d7c1f..be45116895 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/sst/ExampleRandomSST.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/sst/ExampleRandomSST.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.sst; +package de.learnlib.testsupport.example.sst; import java.util.Collection; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultSSTLearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultSSTLearningExample; import net.automatalib.alphabet.Alphabet; -import net.automatalib.automaton.transducer.CompactSST; +import net.automatalib.automaton.transducer.impl.CompactSST; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; diff --git a/test-support/learning-examples/src/main/java/de/learnlib/example/vpa/ExampleRandomOneSEVPA.java b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/vpa/ExampleRandomOneSEVPA.java similarity index 92% rename from test-support/learning-examples/src/main/java/de/learnlib/example/vpa/ExampleRandomOneSEVPA.java rename to test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/vpa/ExampleRandomOneSEVPA.java index f55f6c7b7f..885a82d62d 100644 --- a/test-support/learning-examples/src/main/java/de/learnlib/example/vpa/ExampleRandomOneSEVPA.java +++ b/test-support/learning-examples/src/main/java/de/learnlib/testsupport/example/vpa/ExampleRandomOneSEVPA.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.learnlib.example.vpa; +package de.learnlib.testsupport.example.vpa; import java.util.Random; -import de.learnlib.example.DefaultLearningExample.DefaultOneSEVPALearningExample; +import de.learnlib.testsupport.example.DefaultLearningExample.DefaultOneSEVPALearningExample; import net.automatalib.alphabet.VPAlphabet; import net.automatalib.util.automaton.random.RandomAutomata; diff --git a/test-support/learning-examples/src/main/java/module-info.java b/test-support/learning-examples/src/main/java/module-info.java new file mode 100644 index 0000000000..7a4038a717 --- /dev/null +++ b/test-support/learning-examples/src/main/java/module-info.java @@ -0,0 +1,51 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 example learning setups, to be used for integration testing. Note: This module is not + * intended as a library but only exists for internal testing purposes. You may use it but documentation may be sparse + * and usability may be inconvenient without any intentions to change it. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib.testsupport</groupId>
+ *   <artifactId>learnlib-learning-examples</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.testsupport.example { + + requires de.learnlib.api; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.serialization.learnlibv2; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + requires org.slf4j; + + exports de.learnlib.testsupport.example; + exports de.learnlib.testsupport.example.dfa; + exports de.learnlib.testsupport.example.mealy; + exports de.learnlib.testsupport.example.moore; + exports de.learnlib.testsupport.example.sba; + exports de.learnlib.testsupport.example.spa; + exports de.learnlib.testsupport.example.spmm; + exports de.learnlib.testsupport.example.sst; + exports de.learnlib.testsupport.example.vpa; +} diff --git a/test-support/learning-examples/src/test/java/de/learnlib/example/dfa/DFAExamplesTest.java b/test-support/learning-examples/src/test/java/de/learnlib/example/dfa/DFAExamplesTest.java index 30d718f41c..82faf3679f 100644 --- a/test-support/learning-examples/src/test/java/de/learnlib/example/dfa/DFAExamplesTest.java +++ b/test-support/learning-examples/src/test/java/de/learnlib/example/dfa/DFAExamplesTest.java @@ -15,6 +15,7 @@ */ package de.learnlib.example.dfa; +import de.learnlib.testsupport.example.dfa.DFABenchmarks; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/test-support/test-support/pom.xml b/test-support/test-support/pom.xml index 5069deb572..43d7c2fc29 100644 --- a/test-support/test-support/pom.xml +++ b/test-support/test-support/pom.xml @@ -17,12 +17,33 @@ + + de.learnlib + learnlib-api + + + de.learnlib + learnlib-drivers-simulator + + + de.learnlib + learnlib-membership-oracles + de.learnlib learnlib-util + + de.learnlib.testsupport + learnlib-learning-examples + compile + + + com.google.guava + guava + com.thoughtworks.xstream xstream @@ -32,11 +53,23 @@ net.automatalib automata-api + + net.automatalib + automata-commons-util + net.automatalib automata-core + + net.automatalib + automata-util + + + org.checkerframework + checker-qual + org.mockito mockito-core diff --git a/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractBFOracleTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractBFOracleTest.java index 3c56c1e832..b0bc6a71bb 100644 --- a/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractBFOracleTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractBFOracleTest.java @@ -17,7 +17,7 @@ import de.learnlib.util.AbstractBFOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.ts.simple.SimpleDTS; import net.automatalib.word.Word; import org.mockito.MockitoAnnotations; diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetDFATest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetDFATest.java similarity index 74% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetDFATest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetDFATest.java index eedb06b41a..b690047941 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetDFATest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetDFATest.java @@ -16,18 +16,14 @@ package de.learnlib.testsupport; import java.util.Collection; -import java.util.List; import java.util.Random; -import java.util.function.Consumer; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.filter.cache.dfa.DFACacheOracle; -import de.learnlib.filter.cache.dfa.DFACaches; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; import de.learnlib.oracle.membership.DFASimulatorOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; import net.automatalib.util.automaton.random.RandomAutomata; @@ -53,14 +49,4 @@ protected DFA getTarget(Alphabet alphabet) { protected DFAMembershipOracle getOracle(DFA target) { return new DFASimulatorOracle<>(target); } - - @Override - protected DFAMembershipOracle getCachedOracle(Alphabet alphabet, - DFAMembershipOracle original, - List> symbolListener) { - final DFACacheOracle cache = DFACaches.createDAGCache(alphabet, original); - symbolListener.add(cache::addAlphabetSymbol); - return cache; - } - } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMealyTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMealyTest.java similarity index 75% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMealyTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMealyTest.java index a083dfcb90..66f9940748 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMealyTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMealyTest.java @@ -16,18 +16,14 @@ package de.learnlib.testsupport; import java.util.Collection; -import java.util.List; import java.util.Random; -import java.util.function.Consumer; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.filter.cache.mealy.MealyCacheOracle; -import de.learnlib.filter.cache.mealy.MealyCaches; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; @@ -57,13 +53,4 @@ protected Collection getAlphabetExtensions() { protected MealyMembershipOracle getOracle(MealyMachine target) { return new MealySimulatorOracle<>(target); } - - @Override - protected MealyMembershipOracle getCachedOracle(Alphabet alphabet, - MealyMembershipOracle source, - List> symbolListener) { - final MealyCacheOracle cache = MealyCaches.createDAGCache(alphabet, source); - symbolListener.add(cache::addAlphabetSymbol); - return cache; - } } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMooreTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMooreTest.java similarity index 75% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMooreTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMooreTest.java index 0cacda7c12..c75399dde4 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMooreTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetMooreTest.java @@ -16,18 +16,14 @@ package de.learnlib.testsupport; import java.util.Collection; -import java.util.List; import java.util.Random; -import java.util.function.Consumer; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.filter.cache.moore.MooreCacheOracle; -import de.learnlib.filter.cache.moore.MooreCaches; import de.learnlib.oracle.MembershipOracle.MooreMembershipOracle; import de.learnlib.oracle.membership.MooreSimulatorOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MooreMachine; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; @@ -57,13 +53,4 @@ protected Collection getAlphabetExtensions() { protected MooreMembershipOracle getOracle(MooreMachine target) { return new MooreSimulatorOracle<>(target); } - - @Override - protected MooreMembershipOracle getCachedOracle(Alphabet alphabet, - MooreMembershipOracle source, - List> symbolListener) { - final MooreCacheOracle cache = MooreCaches.createCache(alphabet, source); - symbolListener.add(cache::addAlphabetSymbol); - return cache; - } } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetTest.java similarity index 82% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetTest.java index f4417fa327..6844259486 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractGrowingAlphabetTest.java @@ -17,17 +17,15 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; -import java.util.function.Consumer; import de.learnlib.algorithm.LearningAlgorithm; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; import net.automatalib.alphabet.GrowingAlphabet; -import net.automatalib.alphabet.GrowingMapAlphabet; import net.automatalib.alphabet.SupportsGrowingAlphabet; +import net.automatalib.alphabet.impl.Alphabets; +import net.automatalib.alphabet.impl.GrowingMapAlphabet; import net.automatalib.automaton.UniversalDeterministicAutomaton; import net.automatalib.automaton.concept.Output; import net.automatalib.exception.GrowingAlphabetNotSupportedException; @@ -77,15 +75,13 @@ public void setup() { protected abstract OR getOracle(M target); - protected abstract OR getCachedOracle(Alphabet alphabet, OR source, List> symbolListener); - protected abstract L getLearner(OR oracle, Alphabet alphabet); @Test(expectedExceptions = GrowingAlphabetNotSupportedException.class) public void testInitialAlphabet() { final L leaner = getLearner(oracle, initialAlphabet); - testAlphabet(initialAlphabet, leaner, Collections.singletonList(leaner::addAlphabetSymbol)); + testAlphabet(initialAlphabet, leaner); } /** @@ -98,24 +94,13 @@ public void testGrowingAlphabet() { final GrowingAlphabet alphabet = new GrowingMapAlphabet<>(initialAlphabet); final L learner = getLearner(oracle, alphabet); - testAlphabet(alphabet, learner, Collections.singletonList(learner::addAlphabetSymbol)); - } - - @Test - public void testGrowingAlphabetWithCache() { - final GrowingAlphabet alphabet = new GrowingMapAlphabet<>(initialAlphabet); - final List> symbolListener = new ArrayList<>(); - final OR cachedOracle = getCachedOracle(alphabet, oracle, symbolListener); - final L learner = getLearner(cachedOracle, alphabet); - symbolListener.add(learner::addAlphabetSymbol); - - testAlphabet(alphabet, learner, symbolListener); + testAlphabet(alphabet, learner); } - private void testAlphabet(Alphabet alphabet, L learner, List> symbolListener) { + private void testAlphabet(Alphabet alphabet, L learner) { // add the first symbol before actually starting the learning process - symbolListener.forEach(c -> c.accept(alphabetExtensions.get(0))); + learner.addAlphabetSymbol(alphabetExtensions.get(0)); learner.startLearning(); this.performLearnLoopAndCheck(learner, alphabet); @@ -127,7 +112,7 @@ private void testAlphabet(Alphabet alphabet, L learner, List> sym for (I i : alphabetExtensions) { currentAlphabet.add(i); - symbolListener.forEach(c -> c.accept(i)); + learner.addAlphabetSymbol(i); if (duplicateAdd) { learner.addAlphabetSymbol(i); diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerDFATest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerDFATest.java similarity index 84% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerDFATest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerDFATest.java index 480b091555..337c2af057 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerDFATest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerDFATest.java @@ -19,12 +19,10 @@ import de.learnlib.Resumable; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.oracle.EquivalenceOracle.DFAEquivalenceOracle; import de.learnlib.oracle.MembershipOracle.DFAMembershipOracle; -import de.learnlib.oracle.equivalence.DFASimulatorEQOracle; import de.learnlib.oracle.membership.DFASimulatorOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.fsa.DFA; import net.automatalib.util.automaton.random.RandomAutomata; @@ -47,10 +45,4 @@ protected DFA getTarget(Alphabet alphabet) { protected DFAMembershipOracle getOracle(DFA target) { return new DFASimulatorOracle<>(target); } - - @Override - protected DFAEquivalenceOracle getEquivalenceOracle(DFA target) { - return new DFASimulatorEQOracle<>(target); - } - } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMealyTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMealyTest.java similarity index 85% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMealyTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMealyTest.java index 0016117a7c..de21e12acb 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMealyTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMealyTest.java @@ -19,12 +19,10 @@ import de.learnlib.Resumable; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.oracle.EquivalenceOracle.MealyEquivalenceOracle; import de.learnlib.oracle.MembershipOracle.MealyMembershipOracle; -import de.learnlib.oracle.equivalence.MealySimulatorEQOracle; import de.learnlib.oracle.membership.MealySimulatorOracle; import net.automatalib.alphabet.Alphabet; -import net.automatalib.alphabet.Alphabets; +import net.automatalib.alphabet.impl.Alphabets; import net.automatalib.automaton.transducer.MealyMachine; import net.automatalib.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; @@ -51,9 +49,4 @@ protected Alphabet getInitialAlphabet() { protected MealyMembershipOracle getOracle(MealyMachine target) { return new MealySimulatorOracle<>(target); } - - @Override - protected MealyEquivalenceOracle getEquivalenceOracle(MealyMachine target) { - return new MealySimulatorEQOracle<>(target); - } } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMooreTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMooreTest.java similarity index 85% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMooreTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMooreTest.java index ffbc632d00..221cdc5cbc 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMooreTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerMooreTest.java @@ -19,12 +19,10 @@ import de.learnlib.Resumable; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.oracle.EquivalenceOracle.MooreEquivalenceOracle; import de.learnlib.oracle.MembershipOracle.MooreMembershipOracle; -import de.learnlib.oracle.equivalence.MooreSimulatorEQOracle; import de.learnlib.oracle.membership.MooreSimulatorOracle; 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.util.automaton.random.RandomAutomata; import net.automatalib.word.Word; @@ -51,9 +49,4 @@ protected Alphabet getInitialAlphabet() { protected MooreMembershipOracle getOracle(MooreMachine target) { return new MooreSimulatorOracle<>(target); } - - @Override - protected MooreEquivalenceOracle getEquivalenceOracle(MooreMachine target) { - return new MooreSimulatorEQOracle<>(target); - } } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerTest.java similarity index 86% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerTest.java index 2a920c0867..5acb437190 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractResumableLearnerTest.java @@ -17,11 +17,12 @@ import de.learnlib.Resumable; import de.learnlib.algorithm.LearningAlgorithm; -import de.learnlib.oracle.EquivalenceOracle; import de.learnlib.query.DefaultQuery; import net.automatalib.alphabet.Alphabet; import net.automatalib.automaton.UniversalDeterministicAutomaton; +import net.automatalib.automaton.concept.Output; import net.automatalib.util.automaton.Automata; +import net.automatalib.word.Word; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -42,7 +43,7 @@ * @param * state type */ -public abstract class AbstractResumableLearnerTest & LearningAlgorithm, M extends UniversalDeterministicAutomaton, OR, I, D, T> { +public abstract class AbstractResumableLearnerTest & LearningAlgorithm, M extends UniversalDeterministicAutomaton & Output, OR, I, D, T> { protected static final int RANDOM_SEED = 42; @@ -72,8 +73,6 @@ public void setup() { protected abstract OR getOracle(M target); - protected abstract EquivalenceOracle getEquivalenceOracle(M target); - protected abstract L getLearner(OR oracle, Alphabet alphabet); protected abstract int getRounds(); @@ -85,15 +84,13 @@ public void testSuspendAndResumeLearner() { int roundsPre = 0, roundsPost = 0; byte[] data = null; - EquivalenceOracle equivalenceOracle = getEquivalenceOracle(target); - while (true) { final M hyp = learner.getHypothesisModel(); - final DefaultQuery ce = equivalenceOracle.findCounterExample(hyp, inputAlphabet); + final Word ce = Automata.findSeparatingWord(target, hyp, inputAlphabet); if (ce == null) { break; } - learner.refineHypothesis(ce); + learner.refineHypothesis(new DefaultQuery<>(Word.epsilon(), ce, target.computeOutput(ce))); roundsPre++; if (roundsPre == rounds) { @@ -111,11 +108,11 @@ public void testSuspendAndResumeLearner() { while (true) { final M hyp = learner2.getHypothesisModel(); - final DefaultQuery ce = equivalenceOracle.findCounterExample(hyp, inputAlphabet); + final Word ce = Automata.findSeparatingWord(target, hyp, inputAlphabet); if (ce == null) { break; } - learner2.refineHypothesis(ce); + learner2.refineHypothesis(new DefaultQuery<>(Word.epsilon(), ce, target.computeOutput(ce))); roundsPost++; } diff --git a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractVisualizationTest.java b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractVisualizationTest.java similarity index 77% rename from test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractVisualizationTest.java rename to test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractVisualizationTest.java index 49e39b5a54..6e0d4facda 100644 --- a/test-support/learner-it-support/src/main/java/de/learnlib/testsupport/AbstractVisualizationTest.java +++ b/test-support/test-support/src/main/java/de/learnlib/testsupport/AbstractVisualizationTest.java @@ -21,15 +21,15 @@ import com.google.common.io.CharStreams; import de.learnlib.algorithm.LearningAlgorithm; import de.learnlib.driver.simulator.MealySimulatorSUL; -import de.learnlib.example.mealy.ExampleCoffeeMachine; -import de.learnlib.example.mealy.ExampleCoffeeMachine.Input; -import de.learnlib.oracle.equivalence.SimulatorEQOracle; +import de.learnlib.query.DefaultQuery; import de.learnlib.sul.SUL; -import de.learnlib.util.Experiment; +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.CompactMealy; import net.automatalib.automaton.transducer.MealyMachine; +import net.automatalib.automaton.transducer.impl.CompactMealy; import net.automatalib.common.util.IOUtil; +import net.automatalib.util.automaton.Automata; import net.automatalib.word.Word; import org.checkerframework.checker.initialization.qual.UnderInitialization; @@ -51,10 +51,16 @@ public AbstractVisualizationTest() { final SUL sul = new MealySimulatorSUL<>(target); this.learner = getLearnerBuilder(alphabet, sul); + this.learner.startLearning(); - final Experiment experiment = new Experiment<>(learner, new SimulatorEQOracle<>(target), alphabet); + MealyMachine hyp = this.learner.getHypothesisModel(); + Word ce; - experiment.run(); + while ((ce = Automata.findSeparatingWord(target, hyp, alphabet)) != null) { + final DefaultQuery> q = new DefaultQuery<>(ce, target.computeOutput(ce)); + while (this.learner.refineHypothesis(q)) {} + hyp = this.learner.getHypothesisModel(); + } } protected String resourceAsString(String resourceName) throws IOException { diff --git a/test-support/test-support/src/main/java/module-info.java b/test-support/test-support/src/main/java/module-info.java new file mode 100644 index 0000000000..7ab636a5bc --- /dev/null +++ b/test-support/test-support/src/main/java/module-info.java @@ -0,0 +1,49 @@ +/* Copyright (C) 2013-2024 TU Dortmund University + * This file is part of LearnLib, http://www.learnlib.de/. + * + * 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 support classes for easily writing unit tests for various components of LearnLib. Note: + * This module is not intended as a library but only exists for internal testing purposes. You may use it but + * documentation may be sparse and usability may be inconvenient without any intentions to change it. + *

+ * This module is provided by the following Maven dependency: + *

+ * <dependency>
+ *   <groupId>de.learnlib.testsupport</groupId>
+ *   <artifactId>learnlib-test-support</artifactId>
+ *   <version>${version}</version>
+ * </dependency>
+ * 
+ */ +open module de.learnlib.testsupport { + + requires com.google.common; + requires de.learnlib.api; + requires de.learnlib.common.util; + requires de.learnlib.driver.simulator; + requires de.learnlib.oracle.membership; + requires de.learnlib.testsupport.example; + requires net.automatalib.api; + requires net.automatalib.common.util; + requires net.automatalib.core; + requires net.automatalib.util; + requires org.checkerframework.checker.qual; + requires org.mockito; + requires org.testng; + requires xstream; + + exports de.learnlib.testsupport; +}