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

LearnLib / learnlib / 6673301747

27 Oct 2023 11:46PM UTC coverage: 91.986% (-1.3%) from 93.327%
6673301747

push

github

mtf90
merge the release and sign-artifacts profiles

10984 of 11941 relevant lines covered (91.99%)

1.72 hits per line

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

66.67
/algorithms/active/lstar/src/main/java/de/learnlib/algorithm/lstar/mealy/LStarMealyUtil.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of LearnLib, http://www.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.algorithm.lstar.mealy;
17

18
import java.util.ArrayList;
19
import java.util.List;
20

21
import net.automatalib.alphabet.Alphabet;
22
import net.automatalib.word.Word;
23

24
public final class LStarMealyUtil {
25

26
    private LStarMealyUtil() {
27
        // prevent instantiation
28
    }
29

30
    public static <I> List<Word<I>> ensureSuffixCompliancy(List<Word<I>> suffixes,
31
                                                           Alphabet<I> alphabet,
32
                                                           boolean needsConsistencyCheck) {
33
        List<Word<I>> compSuffixes = new ArrayList<>();
2✔
34
        if (needsConsistencyCheck) {
2✔
35
            for (int i = 0; i < alphabet.size(); i++) {
2✔
36
                compSuffixes.add(Word.fromLetter(alphabet.getSymbol(i)));
2✔
37
            }
38
        }
39

40
        for (Word<I> w : suffixes) {
2✔
41
            if (w.isEmpty()) {
1✔
42
                continue;
1✔
43
            }
44
            if (needsConsistencyCheck && w.length() == 1) {
×
45
                continue;
×
46
            }
47
            compSuffixes.add(w);
×
48
        }
×
49

50
        return compSuffixes;
2✔
51
    }
52

53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc