Skip to content

Commit 9df10a7

Browse files
committed
partially revert 0f13423, 1f3e66a and b917561
This reverts a majority of the initial implementation of the partial L* algorithm, including the partial observation table and some of the SLI-specific interfaces. While the concept of state local inputs showed huge improvements regarding query performance, the implementation via specific partial versions of learning algorithms was hard to maintain, as essentially every currently existing learning algorithm would have to be re-implemented. Instead, this commit introduces the SLI concept as a SUL filter and introduces a special StateLocalInputSULOracle which early-answers queries that would traverse unavailable inputs with a previously specified symbol. This way, queries that would traverse undefined input symbols still won't be executed on the SUL but the SUL appears as a 'total' Mealy system to the learner, allowing one to use every currently existing Mealy learner as-is. The only 'drawback' of this approach is that the internal datastructures of the learners are bigger (consume more memory) compared to a 'partial' version of the learner, since the system appears to be total when it is not. But since this is often not the limiting factor in practical AAL, this is a worthwhile trade-off.
1 parent e479076 commit 9df10a7

48 files changed

Lines changed: 1434 additions & 2054 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1515
* JSR305 annotations have been replaced with checker-framework annotations.
1616
* LearnLib (incl. AutomataLib) now follows checker-framework's convention that (non-annotated) types are usually considered non-null unless explicitly annotated with `@Nullable`.
1717
* LearnLib (incl. AutomataLib) no longer has a (runtime-) dependency on JSR305 (and other `javax.*`) annotations or includes them in the distribution artifact. This now makes LearnLib (incl. AutomataLib) compliant with [Oracle's binary code license](https://www.oracle.com/downloads/licenses/binary-code-license.html) and allows LearnLib (incl. AutomataLib) artifacts as-is to be bundled in binary distributions with Oracle's JDKs/JREs.
18+
* A lot of code for inferring partial Mealy machines (esp. `PartialLStarMealy` and `PartialObservationTable`) has been removed/refactored. The concept of state local inputs is now implemented as a SUL filter and introduces a special `StateLocalInputSULOracle` which early-answers queries that would traverse unavailable inputs with a previously specified symbol. This way, queries that would traverse undefined input symbols still won't be executed on the SUL but the SUL appears as a 'total' Mealy system to the learner, allowing one to use every currently existing Mealy learner as-is. See the in-tree examples for more information.
1819

1920
### Removed
2021

algorithms/active/lstar/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ limitations under the License.
7070
<artifactId>automata-util</artifactId>
7171
</dependency>
7272

73-
<dependency>
74-
<groupId>org.slf4j</groupId>
75-
<artifactId>slf4j-api</artifactId>
76-
</dependency>
77-
7873
<!-- build -->
7974
<dependency>
8075
<groupId>com.github.misberner.buildergen</groupId>

algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractAutomatonLStar.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public A getHypothesisModel() {
7676
protected abstract A exposeInternalHypothesis();
7777

7878
@Override
79-
public void startLearning() {
79+
public final void startLearning() {
8080
super.startLearning();
8181
updateInternalHypothesis();
8282
}
@@ -125,14 +125,11 @@ protected void updateInternalHypothesis() {
125125
I input = alphabet.getSymbol(i);
126126

127127
Row<I> succ = sp.getSuccessor(i);
128+
int succId = succ.getRowContentId();
128129

129-
if (succ != null) {
130-
int succId = succ.getRowContentId();
130+
S succState = stateInfos.get(succId).getState();
131131

132-
S succState = stateInfos.get(succId).getState();
133-
134-
setTransition(state, input, succState, sp, i);
135-
}
132+
setTransition(state, input, succState, sp, i);
136133
}
137134
}
138135
}

algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import de.learnlib.api.algorithm.feature.GlobalSuffixLearner;
2626
import de.learnlib.api.oracle.MembershipOracle;
2727
import de.learnlib.api.query.DefaultQuery;
28-
import de.learnlib.datastructure.observationtable.AbstractObservationTable;
2928
import de.learnlib.datastructure.observationtable.GenericObservationTable;
3029
import de.learnlib.datastructure.observationtable.Inconsistency;
3130
import de.learnlib.datastructure.observationtable.OTLearner;
@@ -59,7 +58,7 @@ public abstract class AbstractLStar<A, I, D>
5958

6059
protected final Alphabet<I> alphabet;
6160
protected final MembershipOracle<I, D> oracle;
62-
protected AbstractObservationTable<I, D> table;
61+
protected GenericObservationTable<I, D> table;
6362

6463
/**
6564
* Constructor.

algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStarState.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import java.io.Serializable;
1919

20-
import de.learnlib.datastructure.observationtable.AbstractObservationTable;
20+
import de.learnlib.datastructure.observationtable.GenericObservationTable;
2121

2222
/**
2323
* Class that contains all data that represent the internal state of the {@link AbstractLStar} learner.
@@ -31,13 +31,13 @@
3131
*/
3232
public abstract class AbstractLStarState<I, D> implements Serializable {
3333

34-
private final AbstractObservationTable<I, D> observationTable;
34+
private final GenericObservationTable<I, D> observationTable;
3535

36-
AbstractLStarState(final AbstractObservationTable<I, D> observationTable) {
36+
AbstractLStarState(final GenericObservationTable<I, D> observationTable) {
3737
this.observationTable = observationTable;
3838
}
3939

40-
AbstractObservationTable<I, D> getObservationTable() {
40+
GenericObservationTable<I, D> getObservationTable() {
4141
return observationTable;
4242
}
4343
}

algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AutomatonLStarState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.List;
1919

2020
import de.learnlib.algorithms.lstar.AbstractAutomatonLStar.StateInfo;
21-
import de.learnlib.datastructure.observationtable.AbstractObservationTable;
21+
import de.learnlib.datastructure.observationtable.GenericObservationTable;
2222

2323
/**
2424
* Class that contains all data that represent the internal state of the {@link AbstractAutomatonLStar} learner and its
@@ -40,7 +40,7 @@ public class AutomatonLStarState<I, D, AI, S> extends AbstractLStarState<I, D> {
4040
private final AI hypothesis;
4141
private final List<StateInfo<S, I>> stateInfos;
4242

43-
AutomatonLStarState(final AbstractObservationTable<I, D> observationTable,
43+
AutomatonLStarState(final GenericObservationTable<I, D> observationTable,
4444
final AI hypothesis,
4545
final List<StateInfo<S, I>> stateInfos) {
4646
super(observationTable);

algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/mealy/PartialLStarMealy.java

Lines changed: 0 additions & 209 deletions
This file was deleted.

algorithms/active/lstar/src/test/java/de/learnlib/algorithms/lstar/PartialLStarMealyResumableLearnerTest.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)