• 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/ObservableSUL.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
/**
19
 * A System Under Learning (SUL) where at any point in time the internal state can be observed.
20
 * <p>
21
 * The main purpose of this interface is to check whether infinite words are accepted by the SUL.
22
 *
23
 * @param <S> the state type
24
 * @param <I> the input type
25
 * @param <O> the output type
26
 */
27
public interface ObservableSUL<S, I, O> extends SUL<I, O> {
28

29
    @Override
30
    default ObservableSUL<S, I, O> fork() {
31
        throw new UnsupportedOperationException();
×
32
    }
33

34
    /**
35
     * Returns the current state of the system.
36
     * <p>
37
     * Implementation note: it is important that the returned Object has a well-defined {@link Object#equals(Object)}
38
     * method, and a good {@link Object#hashCode()} function.
39
     *
40
     * @return the current state of the system.
41
     */
42
    S getState();
43

44
    /**
45
     * Returns whether each state retrieved with {@link #getState()} is a deep copy.
46
     * <p>
47
     * A state is a deep copy if calls to either {@link #step(Object)}, {@link #pre()}, or {@link #post()} do not modify
48
     * any state previously obtained with {@link #getState()}.
49
     * <p>
50
     * More formally (assuming a perfect hash function): the result must be false if there is a case where in the
51
     * following statements the assertion does not hold:
52
     * {@code Object o = getState(); int hc = o.hashCode(); [step(...)|pre()|post()]; assert o.hashCode() == hc;}
53
     *
54
     * Furthermore, if states can be retrieved, but each state is not a deep copy, then this SUL <b>must</b> be
55
     * forkable, i.e. if {@code !deepCopies()} then {@code canFork()} must hold.
56
     *
57
     * @return whether each state is a deep copy.
58
     */
59
    default boolean deepCopies() {
60
        return false;
×
61
    }
62
}
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