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

LearnLib / learnlib / 13181815301

06 Feb 2025 03:00PM CUT coverage: 94.368%. Remained the same
13181815301

push

github

mtf90
[maven-release-plugin] prepare for next development iteration

12484 of 13229 relevant lines covered (94.37%)

1.72 hits per line

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

0.0
/api/src/main/java/de/learnlib/sul/SUL.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of LearnLib <https://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.sul;
17

18
import de.learnlib.exception.SULException;
19

20
/**
21
 * Interface for a system under learning (SUL) that can make single steps.
22
 *
23
 * @param <I>
24
 *         input symbols
25
 * @param <O>
26
 *         output symbols
27
 */
28
public interface SUL<I, O> {
29

30
    /**
31
     * setup SUL.
32
     */
33
    void pre();
34

35
    /**
36
     * shut down SUL.
37
     */
38
    void post();
39

40
    /**
41
     * make one step on the SUL.
42
     *
43
     * @param in
44
     *         input to the SUL
45
     *
46
     * @return output of SUL
47
     *
48
     * @throws SULException
49
     *         if the input symbol cannot be executed on the SUL
50
     */
51
    O step(I in);
52

53
    /**
54
     * Returns whether this SUL is capable of {@link #fork() forking}.
55
     *
56
     * @return {@code true} if this SUL can be forked, {@code false} otherwise
57
     *
58
     * @see #fork()
59
     */
60
    default boolean canFork() {
61
        return false;
×
62
    }
63

64
    /**
65
     * Forks this SUL, if possible. The fork of a SUL is a copy which behaves exactly the same as this SUL. This method
66
     * should always return a reseted SUL, regardless of whether this call is made between a call to {@link #pre()} and
67
     * {@link #post()}.
68
     * <p>
69
     * If {@link #canFork()} returns {@code true}, this method must return a non-{@code null} object, which should
70
     * behave exactly like this SUL (in particular, it must be forkable as well). Otherwise, a {@link
71
     * UnsupportedOperationException} must be thrown.
72
     * <p>
73
     * Implementation note: if resetting a SUL changes the internal state of this object in a non-trivial way (e.g.,
74
     * incrementing a counter to ensure independent sessions), care must be taken that forks of this SUL manipulate the
75
     * same internal state.
76
     *
77
     * @return a fork of this SUL.
78
     *
79
     * @throws UnsupportedOperationException
80
     *         if this SUL can't be forked.
81
     */
82
    default SUL<I, O> fork() {
83
        throw new UnsupportedOperationException();
×
84
    }
85

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