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

LearnLib / automatalib / 13138848026

04 Feb 2025 02:53PM UTC coverage: 92.108% (+2.2%) from 89.877%
13138848026

push

github

mtf90
[maven-release-plugin] prepare release automatalib-0.12.0

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

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

83.33
/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.ts.AcceptorPowersetViewTS;
21
import net.automatalib.ts.UniversalTransitionSystem;
22
import net.automatalib.ts.powerset.AcceptorPowersetView;
23

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

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

45
        return isAccepting(states);
1✔
46
    }
47

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

58
    boolean isAccepting(Collection<? extends S> states);
59

60
    @Override
61
    default Boolean getStateProperty(S state) {
62
        return isAccepting(state);
1✔
63
    }
64

65
    @Override
66
    default Void getTransitionProperty(S transition) {
67
        return null;
1✔
68
    }
69

70
    @Override
71
    default S getSuccessor(S transition) {
72
        return transition;
1✔
73
    }
74

75
    @Override
76
    default AcceptorPowersetViewTS<?, I, S> powersetView() {
77
        return new AcceptorPowersetView<>(this);
×
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