• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / learnlib / 31619759710

12 Aug 2026 04:27PM UTC coverage: 95.488% (+1.1%) from 94.368%
31619759710

push

github

mtf90
use new version scheme

15533 of 16267 relevant lines covered (95.49%)

1.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/api/src/main/java/de/learnlib/AccessSequenceTransformer.java
1
/* Copyright (C) 2013-2026 TU Dortmund University
2
 * This file is part of LearnLib <https://learnlib.de>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package de.learnlib;
17

18
import net.automatalib.word.Word;
19

20
@FunctionalInterface
21
public interface AccessSequenceTransformer<I> {
22

23
    Word<I> transformAccessSequence(Word<I> word);
24

25
    default Word<I> longestASPrefix(Word<I> word) {
26
        int len = word.length();
1✔
27
        Word<I> lastPrefix = Word.epsilon();
1✔
28
        for (int i = 1; i <= len; i++) {
1✔
29
            Word<I> prefix = word.prefix(i);
1✔
30
            if (!isAccessSequence(prefix)) {
1✔
31
                return lastPrefix;
1✔
32
            }
33
            lastPrefix = prefix;
1✔
34
        }
35
        return word;
×
36
    }
37

38
    default boolean isAccessSequence(Word<I> word) {
39
        return word.equals(transformAccessSequence(word));
1✔
40
    }
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc