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

LearnLib / learnlib / 6433387082

06 Oct 2023 03:10PM UTC coverage: 92.296% (-0.007%) from 92.303%
6433387082

push

github

mtf90
update Falk's developer id

11573 of 12539 relevant lines covered (92.3%)

1.67 hits per line

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

91.67
/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/moore/TTTHypothesisMoore.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.algorithms.ttt.moore;
17

18
import de.learnlib.algorithms.ttt.base.AbstractTTTHypothesis;
19
import de.learnlib.algorithms.ttt.base.TTTTransition;
20
import net.automatalib.automata.UniversalDeterministicAutomaton;
21
import net.automatalib.automata.UniversalDeterministicAutomaton.FullIntAbstraction;
22
import net.automatalib.automata.transducers.MooreMachine;
23
import net.automatalib.words.Alphabet;
24
import net.automatalib.words.Word;
25

26
/**
27
 * A {@link MooreMachine}-based specialization of the TTT hypothesis.
28
 *
29
 * @param <I>
30
 *         input symbol type
31
 * @param <O>
32
 *         output symbol type
33
 */
34
public class TTTHypothesisMoore<I, O>
35
        extends AbstractTTTHypothesis<TTTStateMoore<I, O>, I, Word<O>, TTTStateMoore<I, O>>
36
        implements MooreMachine<TTTStateMoore<I, O>, I, TTTStateMoore<I, O>, O>,
37
                   FullIntAbstraction<TTTStateMoore<I, O>, O, Void> {
38

39
    /**
40
     * Constructor.
41
     *
42
     * @param alphabet
43
     *         the input alphabet
44
     */
45
    public TTTHypothesisMoore(Alphabet<I> alphabet) {
46
        super(alphabet);
2✔
47
    }
2✔
48

49
    @Override
50
    protected TTTStateMoore<I, O> mapTransition(TTTTransition<I, Word<O>> internalTransition) {
51
        return (TTTStateMoore<I, O>) internalTransition.getTarget();
2✔
52
    }
53

54
    @Override
55
    public O getStateProperty(int state) {
56
        TTTStateMoore<I, O> mooreState = states.get(state);
2✔
57
        return mooreState.getOutput();
2✔
58

59
    }
60

61
    @Override
62
    protected TTTStateMoore<I, O> newState(int alphabetSize, TTTTransition<I, Word<O>> parent, int id) {
63
        return new TTTStateMoore<>(alphabetSize, parent, id);
2✔
64
    }
65

66
    @Override
67
    public UniversalDeterministicAutomaton.FullIntAbstraction<TTTStateMoore<I, O>, O, Void> fullIntAbstraction(Alphabet<I> alphabet) {
68
        if (alphabet.equals(getInputAlphabet())) {
2✔
69
            return this;
2✔
70
        }
71
        return MooreMachine.super.fullIntAbstraction(alphabet);
×
72
    }
73

74
    @Override
75
    public O getStateOutput(TTTStateMoore<I, O> state) {
76
        return state.getOutput();
2✔
77
    }
78

79
    @Override
80
    public TTTStateMoore<I, O> getSuccessor(TTTStateMoore<I, O> transition) {
81
        return transition;
2✔
82
    }
83

84
    @Override
85
    public Void getTransitionProperty(TTTStateMoore<I, O> state) {
86
        return null;
2✔
87
    }
88
}
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