• 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

75.0
/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/api/PartialTransitionAnalyzer.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.api;
17

18
/**
19
 * During the refinement process of the hypothesis, ADS/Ts may be computed on partially defined automata. These
20
 * computations may want to skip undefined transitions (as closing them results in resets, which we want to omit) and
21
 * only determine the information if necessary. This interface mediates between the learner and ADS/T computations by
22
 * defining the basic forms of communication.
23
 *
24
 * @param <S>
25
 *         (hypothesis) state type
26
 * @param <I>
27
 *         input alphabet type
28
 */
29
public interface PartialTransitionAnalyzer<S, I> {
30

31
    /**
32
     * Global exception instance to avoid (unnecessary) re-instantiation.
33
     */
34
    HypothesisModificationException HYPOTHESIS_MODIFICATION_EXCEPTION = new HypothesisModificationException();
2✔
35

36
    /**
37
     * Check whether the transition in question is defined or not.
38
     *
39
     * @param state
40
     *         the (source) state of the transition in question
41
     * @param input
42
     *         the input symbol of the transition in question
43
     *
44
     * @return {@code true} if the transition (and thus the successor/output) is defined, {@code false} otherwise
45
     */
46
    boolean isTransitionDefined(S state, I input);
47

48
    /**
49
     * Determine the successor/output of the transition in question (which is usually achieved by sifting the
50
     * corresponding long-prefix through the ADT).
51
     *
52
     * @param state
53
     *         the (source) state of the transition in question
54
     * @param input
55
     *         the input symbol of the transition in question
56
     *
57
     * @throws HypothesisModificationException
58
     *         if closing the transition (sifting in the ADT) discovered a new hypothesis state and thus potentially
59
     *         invalidates previously observed behavior
60
     */
61
    void closeTransition(S state, I input);
62

63
    /**
64
     * A helper exception to interrupt computations on an invalid hypothesis. Does not record the stacktrace when thrown
65
     * (to improve performance)
66
     */
67
    class HypothesisModificationException extends RuntimeException {
68

69
        HypothesisModificationException() {
70
            super(null, null, false, false);
2✔
71
        }
2✔
72

73
        @Override
74
        public Throwable fillInStackTrace() {
75
            return this;
×
76
        }
77

78
    }
79
}
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