• 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

90.0
/oracles/equivalence-oracles/src/main/java/de/learnlib/oracle/equivalence/vpa/SimulatorEQOracle.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.oracle.equivalence.vpa;
17

18
import java.util.Collection;
19

20
import de.learnlib.api.oracle.EquivalenceOracle;
21
import de.learnlib.api.query.DefaultQuery;
22
import net.automatalib.automata.vpa.OneSEVPA;
23
import net.automatalib.util.automata.Automata;
24
import net.automatalib.words.VPAlphabet;
25
import net.automatalib.words.Word;
26
import org.checkerframework.checker.nullness.qual.Nullable;
27

28
/**
29
 * An equivalence oracle based on the computation of a separating word for a given hypothesis and a previously known
30
 * target system.
31
 */
32
public class SimulatorEQOracle<I> implements EquivalenceOracle<OneSEVPA<?, I>, I, Boolean> {
33

34
    private final OneSEVPA<?, I> reference;
35

36
    public SimulatorEQOracle(OneSEVPA<?, I> reference) {
1✔
37
        this.reference = reference;
1✔
38
    }
1✔
39

40
    @Override
41
    public @Nullable DefaultQuery<I, Boolean> findCounterExample(OneSEVPA<?, I> hypothesis,
42
                                                                 Collection<? extends I> inputs) {
43
        if (!(inputs instanceof VPAlphabet)) {
1✔
44
            throw new IllegalArgumentException("Inputs are not a visibly push-down alphabet");
×
45
        }
46

47
        @SuppressWarnings("unchecked")
48
        final VPAlphabet<I> alphabet = (VPAlphabet<I>) inputs;
1✔
49

50
        final Word<I> sep = Automata.findSeparatingWord(reference, hypothesis, alphabet);
1✔
51

52
        if (sep == null) {
1✔
53
            return null;
1✔
54
        }
55

56
        return new DefaultQuery<>(sep, reference.computeOutput(sep));
1✔
57
    }
58
}
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

© 2026 Coveralls, Inc