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

LearnLib / automatalib / 19995144613

06 Dec 2025 10:24PM UTC coverage: 92.834% (+0.04%) from 92.796%
19995144613

push

github

mtf90
simplify procedural implementations

since the output semantics now better handle partial systems, get rid of explicit sink management

42 of 45 new or added lines in 5 files covered. (93.33%)

4 existing lines in 4 files now uncovered.

17191 of 18518 relevant lines covered (92.83%)

1.72 hits per line

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

87.5
/api/src/main/java/net/automatalib/ts/acceptor/AcceptorTS.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://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.ts.acceptor;
17

18
import java.util.Collection;
19

20
import net.automatalib.automaton.concept.SuffixOutput;
21
import net.automatalib.ts.AcceptorPowersetViewTS;
22
import net.automatalib.ts.UniversalTransitionSystem;
23
import net.automatalib.ts.concept.OutputTS;
24
import net.automatalib.ts.powerset.AcceptorPowersetView;
25

26
/**
27
 * A transition system whose semantics are defined by whether a state is "accepting" or not.
28
 *
29
 * @param <S>
30
 *         state class
31
 * @param <I>
32
 *         input symbol class
33
 */
34
public interface AcceptorTS<S, I> extends UniversalTransitionSystem<S, I, S, Boolean, Void>,
35
                                          OutputTS<S, I, S, Boolean>,
36
                                          SuffixOutput<I, Boolean> {
37

38
    /**
39
     * Determines whether the given input word is accepted by this acceptor.
40
     *
41
     * @param input
42
     *         the input word.
43
     *
44
     * @return {@code true} if the input word is accepted, {@code false} otherwise.
45
     */
46
    default boolean accepts(Iterable<? extends I> input) {
47
        Collection<S> states = getStates(input);
1✔
48

49
        return isAccepting(states);
1✔
50
    }
51

52
    /**
53
     * Checks whether the given state is accepting.
54
     *
55
     * @param state
56
     *         the state
57
     *
58
     * @return {@code true} if the state is accepting, {@code false} otherwise.
59
     */
60
    boolean isAccepting(S state);
61

62
    boolean isAccepting(Collection<? extends S> states);
63

64
    @Override
65
    default Boolean computeOutput(Iterable<? extends I> input) {
66
        return accepts(input);
1✔
67
    }
68

69
    @Override
70
    default Boolean computeSuffixOutput(Iterable<? extends I> prefix, Iterable<? extends I> suffix) {
71
        return isAccepting(getSuccessors(getStates(prefix), suffix));
1✔
72
    }
73

74
    @Override
75
    default Boolean getStateProperty(S state) {
76
        return isAccepting(state);
1✔
77
    }
78

79
    @Override
80
    default Void getTransitionProperty(S transition) {
81
        return null;
1✔
82
    }
83

84
    @Override
85
    default S getSuccessor(S transition) {
86
        return transition;
1✔
87
    }
88

89
    @Override
90
    default AcceptorPowersetViewTS<?, I, S> powersetView() {
UNCOV
91
        return new AcceptorPowersetView<>(this);
×
92
    }
93
}
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