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 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
81 changes: 81 additions & 0 deletions algorithms/active/sparse/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?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".
</description>

<dependencies>
<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>net.automatalib</groupId>
<artifactId>automata-util</artifactId>
</dependency>
<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-membership-oracles</artifactId>
</dependency>
<dependency>
<groupId>de.learnlib</groupId>
<artifactId>learnlib-util</artifactId>
</dependency>
<dependency>
<groupId>de.learnlib.testsupport</groupId>
<artifactId>learnlib-learner-it-support</artifactId>
</dependency>
<dependency>
<groupId>net.automatalib</groupId>
<artifactId>automata-serialization-dot</artifactId>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* 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> {
final S state; // hypothesis state associated with this row
final int idx; // index in core row list
final Map<Word<I>, Word<O>> sufToOut; // maps suffixes to the outputs contained in this row
final Set<Integer> cellIds; // also store identifiers of suffix-output pairs for fast compatability checking

CoreRow(Word<I> prefix, S state, int idx) {
super(prefix);
this.state = state;
this.idx = idx;
sufToOut = new HashMap<>();
cellIds = new HashSet<>(); // use HashSet to enable fast containment checks
}

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,37 @@
/* 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;

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

// each fringe row represents a hypothesis transition
final S srcState; // source state
final I transIn; // input symbol
O transOut; // output symbol (determined dynamically)
Leaf<S, I, O> leaf;
// 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.

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