• 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

93.1
/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/automaton/ADTHypothesis.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.adt.automaton;
17

18
import de.learnlib.algorithms.adt.adt.ADTNode;
19
import de.learnlib.api.AccessSequenceTransformer;
20
import net.automatalib.automata.base.fast.AbstractFastMutableDet;
21
import net.automatalib.automata.transducers.MutableMealyMachine;
22
import net.automatalib.words.Alphabet;
23
import net.automatalib.words.Word;
24

25
/**
26
 * Hypothesis model.
27
 *
28
 * @param <I>
29
 *         input alphabet type
30
 * @param <O>
31
 *         output alphabet type
32
 */
33
public class ADTHypothesis<I, O> extends AbstractFastMutableDet<ADTState<I, O>, I, ADTTransition<I, O>, Void, O>
2✔
34
        implements MutableMealyMachine<ADTState<I, O>, I, ADTTransition<I, O>, O>, AccessSequenceTransformer<I> {
35

36
    public ADTHypothesis(Alphabet<I> alphabet) {
37
        super(alphabet);
2✔
38
    }
2✔
39

40
    @Override
41
    public ADTState<I, O> getSuccessor(ADTTransition<I, O> transition) {
42
        return transition.getTarget();
2✔
43
    }
44

45
    public ADTTransition<I, O> createOpenTransition(ADTState<I, O> source,
46
                                                    I input,
47
                                                    ADTNode<ADTState<I, O>, I, O> siftTarget) {
48
        ADTTransition<I, O> result = new ADTTransition<>();
2✔
49
        result.setSource(source);
2✔
50
        result.setInput(input);
2✔
51
        result.setSiftNode(siftTarget);
2✔
52

53
        this.setTransition(source, input, result);
2✔
54

55
        return result;
2✔
56
    }
57

58
    @Override
59
    public void setTransition(ADTState<I, O> state, I input, ADTTransition<I, O> transition) {
60
        final ADTTransition<I, O> oldTrans = getTransition(state, input);
2✔
61

62
        if (oldTrans != null) {
2✔
63
            oldTrans.getTarget().getIncomingTransitions().remove(oldTrans);
2✔
64
        }
65

66
        super.setTransition(state, input, transition);
2✔
67

68
        if (transition != null) {
2✔
69
            transition.setSource(state);
2✔
70
            transition.setInput(input);
2✔
71
        }
72
    }
2✔
73

74
    @Override
75
    protected ADTState<I, O> createState(Void property) {
76
        return new ADTState<>(inputAlphabet.size());
2✔
77
    }
78

79
    @Override
80
    public ADTTransition<I, O> createTransition(ADTState<I, O> successor, O properties) {
81
        ADTTransition<I, O> result = new ADTTransition<>();
2✔
82
        result.setTarget(successor);
2✔
83
        result.setOutput(properties);
2✔
84
        return result;
2✔
85
    }
86

87
    @Override
88
    public void setTransitionOutput(ADTTransition<I, O> transition, O output) {
89
        transition.setOutput(output);
×
90
    }
×
91

92
    @Override
93
    public O getTransitionOutput(ADTTransition<I, O> transition) {
94
        return transition.getOutput();
2✔
95
    }
96

97
    @Override
98
    public Word<I> transformAccessSequence(Word<I> word) {
99
        final ADTState<I, O> state = this.getState(word);
2✔
100
        assert state != null;
2✔
101
        return state.getAccessSequence();
2✔
102
    }
103

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