Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

* Added the L<sup>s</sup> active learning algorithm (thanks to [Wolffhardt Schwabe](https://github.com/stateMachinist)).
* Added an `EarlyExitEQOracle` which for a given `AdaptiveMembershipOracle` and `TestWordGenerator` stops the evaluation of (potentially long) Mealy-based equivalence tests as soon as a mismatch with the hypothesis is detected, potentially improving the symbol performance of the given equivalence oracle.

### Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Currently, the following learning algorithms with respective target models are s
| DHC | `Mealy` | | | |
| Kearns & Vazirani | `DFA` `Mealy` | | | |
| Lambda | `DFA` `Mealy` | | | |
| L<sup>s</sup> | `Mealy` | | | |
| L# | `Mealy` | | | |
| L* (incl. variants) | `DFA` `Mealy` `Moore` | | | |
| NL* | `NFA` | | | |
Expand Down
1 change: 1 addition & 0 deletions algorithms/active/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ limitations under the License.
<module>observation-pack</module>
<module>observation-pack-vpa</module>
<module>procedural</module>
<module>sparse</module>
<module>ttt</module>
<module>ttt-vpa</module>
</modules>
Expand Down
77 changes: 77 additions & 0 deletions algorithms/active/sparse/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2013-2025 TU Dortmund University
This file is part of LearnLib <https://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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.learnlib</groupId>
<artifactId>learnlib-algorithms-active-parent</artifactId>
<version>0.19.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>learnlib-sparse</artifactId>

<name>LearnLib :: Algorithms :: Sparse</name>
<description>
This artifact provides the implementation of the Sparse OT learning algorithm as described in the paper
"Learning Mealy Machines with Sparse Observation Tables" (TODO) by Wolffhardt Schwabe, Paul Kogel, and Sabine
Glesner.
</description>

<dependencies>
<!-- internal -->
<dependency>
<groupId>de.learnlib</groupId>
<artifactId>learnlib-api</artifactId>
</dependency>
<dependency>
<groupId>de.learnlib</groupId>
<artifactId>learnlib-counterexamples</artifactId>
</dependency>
<dependency>
<groupId>de.learnlib</groupId>
<artifactId>learnlib-util</artifactId>
</dependency>

<!-- external -->
<dependency>
<groupId>net.automatalib</groupId>
<artifactId>automata-api</artifactId>
</dependency>
<dependency>
<groupId>net.automatalib</groupId>
<artifactId>automata-commons-util</artifactId>
</dependency>
<dependency>
<groupId>net.automatalib</groupId>
<artifactId>automata-core</artifactId>
</dependency>

<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</dependency>

<!-- testing -->
<dependency>
<groupId>de.learnlib.testsupport</groupId>
<artifactId>learnlib-learner-it-support</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Copyright (C) 2013-2025 TU Dortmund University
* This file is part of LearnLib <https://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.algorithm.sparse;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import net.automatalib.word.Word;

class CoreRow<S, I, O> extends Row<S, I, O> {

/**
* Hypothesis state associated with this row.
*/
final S state;
/**
* Index in core row list.
*/
final int idx;
/**
* Maps suffixes to the outputs contained in this row.
*/
final Map<Word<I>, Word<O>> sufToOut;
/**
* Also store identifiers of suffix-output pairs for fast compatibility checking.
*/
final Set<Integer> cellIds;

CoreRow(Word<I> prefix, S state, int idx) {
super(prefix);
this.state = state;
this.idx = idx;
sufToOut = new HashMap<>();
cellIds = new HashSet<>();
}

void addSuffix(Word<I> suf, Word<O> out, int cell) {
sufToOut.put(suf, out);
cellIds.add(cell);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Copyright (C) 2013-2025 TU Dortmund University
* This file is part of LearnLib <https://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.algorithm.sparse;

import net.automatalib.word.Word;

/**
* Each fringe row represents a hypothesis transition.
*
* @param <S>
* state type
* @param <I>
* input symbol type
* @param <O>
* output symbol type
*/
class FringeRow<S, I, O> extends Row<S, I, O> {

/**
* Source state.
*/
final S srcState;
/**
* Input symbol.
*/
final I transIn;
/**
* Output symbol (determined dynamically).
*/
O transOut;
/**
* For compression, fringe rows do not store observations directly. Instead, they point to some leaf in a tree
* encoding their classification history. This trick avoids redundantly storing identical observations.
*/
Leaf<S, I, O> leaf;

FringeRow(Word<I> prefix, S srcState, Leaf<S, I, O> leaf) {
super(prefix);
this.srcState = srcState;
this.transIn = prefix.lastSymbol();
this.leaf = leaf;
}
}
Loading