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

LearnLib / automatalib / 6654683895

26 Oct 2023 01:15PM UTC coverage: 89.683% (+0.3%) from 89.4%
6654683895

push

github

mtf90
util: handle some more corner-cases in equivalence checks

8 of 8 new or added lines in 1 file covered. (100.0%)

15830 of 17651 relevant lines covered (89.68%)

1.66 hits per line

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

82.61
/incremental/src/main/java/net/automatalib/incremental/dfa/AbstractIncrementalDFABuilder.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of AutomataLib, http://www.automatalib.net/.
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 net.automatalib.incremental.dfa;
17

18
import java.util.Collection;
19
import java.util.Collections;
20
import java.util.Map;
21

22
import net.automatalib.alphabet.Alphabet;
23
import net.automatalib.automaton.concept.InputAlphabetHolder;
24
import net.automatalib.ts.UniversalDTS;
25
import net.automatalib.visualization.DefaultVisualizationHelper;
26
import net.automatalib.visualization.VisualizationHelper;
27
import net.automatalib.word.Word;
28

29
/**
30
 * Abstract base class for {@link IncrementalDFABuilder}s. This class takes care of holding the input alphabet and its
31
 * size.
32
 *
33
 * @param <I>
34
 *         input symbol class
35
 */
36
public abstract class AbstractIncrementalDFABuilder<I> implements IncrementalDFABuilder<I>, InputAlphabetHolder<I> {
37

38
    protected final Alphabet<I> inputAlphabet;
39
    protected int alphabetSize;
40

41
    /**
42
     * Constructor.
43
     *
44
     * @param inputAlphabet
45
     *         the input alphabet
46
     */
47
    public AbstractIncrementalDFABuilder(Alphabet<I> inputAlphabet) {
2✔
48
        this.inputAlphabet = inputAlphabet;
2✔
49
        this.alphabetSize = inputAlphabet.size();
2✔
50
    }
2✔
51

52
    @Override
53
    public Alphabet<I> getInputAlphabet() {
54
        return inputAlphabet;
×
55
    }
56

57
    @Override
58
    public boolean hasDefinitiveInformation(Word<? extends I> word) {
59
        return lookup(word) != Acceptance.DONT_KNOW;
2✔
60
    }
61

62
    @Override
63
    public void insert(Word<? extends I> word) {
64
        insert(word, true);
×
65
    }
×
66

67
    protected abstract static class AbstractGraphView<I, N, E> implements GraphView<I, N, E> {
2✔
68

69
        @Override
70
        public VisualizationHelper<N, E> getVisualizationHelper() {
71
            return new DefaultVisualizationHelper<N, E>() {
2✔
72

73
                @Override
74
                public Collection<N> initialNodes() {
75
                    return Collections.singleton(getInitialNode());
2✔
76
                }
77

78
                @Override
79
                public boolean getNodeProperties(N node, Map<String, String> properties) {
80
                    super.getNodeProperties(node, properties);
2✔
81

82
                    switch (getAcceptance(node)) {
2✔
83
                        case TRUE:
84
                            properties.put(NodeAttrs.SHAPE, NodeShapes.DOUBLECIRCLE);
2✔
85
                            break;
2✔
86
                        case DONT_KNOW:
87
                            properties.put(NodeAttrs.STYLE, NodeStyles.DASHED);
2✔
88
                            break;
2✔
89
                        default: // case FALSE: default style
90
                    }
91

92
                    return true;
2✔
93
                }
94

95
                @Override
96
                public boolean getEdgeProperties(N src, E edge, N tgt, Map<String, String> properties) {
97
                    super.getEdgeProperties(src, edge, tgt, properties);
2✔
98

99
                    properties.put(EdgeAttrs.LABEL, String.valueOf(getInputSymbol(edge)));
2✔
100

101
                    return true;
2✔
102
                }
103
            };
104
        }
105
    }
106

107
    protected abstract static class AbstractTransitionSystemView<S, I, T>
2✔
108
            implements UniversalDTS<S, I, T, Acceptance, Void> {
109

110
        @Override
111
        public Void getTransitionProperty(T transition) {
112
            return null;
×
113
        }
114
    }
115

116
}
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