Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<checker-qual.version>3.52.1</checker-qual.version>
<commons-lang.version>3.20.0</commons-lang.version>
<gson.version>2.13.2</gson.version>
<error-prone.version>2.45.0</error-prone.version>
<guava.version>33.5.0-jre</guava.version>
<jakarta-xml.version>4.0.4</jakarta-xml.version>
<jaxb-runtime.version>4.0.6</jaxb-runtime.version>
Expand Down Expand Up @@ -250,8 +251,18 @@
<configuration>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint:deprecation</arg>
<arg>-Xlint:deprecation</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -Xep:ObjectToString:OFF -Xep:BadInstanceof:OFF -Xep:UnusedVariable:OFF -Xep:EqualsGetClass:OFF -Xep:BigDecimalEquals:OFF -Xep:ReferenceEquality:OFF -Xep:ArrayAsKeyOfSetOrMap:OFF -Xep:IterableAndIterator:OFF -Xep:ObjectsHashCodePrimitive:OFF -Xep:StatementSwitchToExpressionSwitch:OFF -Xep:JdkObsolete:OFF -Xep:AddressSelection:OFF -Xep:EmptyBlockTag:OFF -Xep:MissingSummary:OFF -Xep:NonApiType:OFF -Xep:StringSplitter:OFF -Xep:WaitNotInLoop:OFF -Xep:StringConcatToTextBlock:OFF</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${error-prone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/de/learnlib/ralib/automata/util/RAToDot.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void printLocations(RegisterAutomaton ra) {
if (!acceptingOnly || loc.isAccepting()) {
printLocation(loc);
stringRA.append(" [shape=");
stringRA.append( (loc.isAccepting()) ? "doublecircle" : "circle");
stringRA.append(loc.isAccepting() ? "doublecircle" : "circle");
stringRA.append("]");
stringRA.append(NEWLINE);
}
Expand Down Expand Up @@ -106,8 +106,8 @@ private void printTransitions(RegisterAutomaton ra) {
printLocation(t.getDestination());
stringRA.append(" [label=<");

if (t instanceof OutputTransition) {
printOutputLabel( (OutputTransition)t );
if (t instanceof OutputTransition outputTransition) {
printOutputLabel( outputTransition );
} else {
printInputLabel( t );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2015 The LearnLib Contributors
* Copyright (C) 2014-2025 The LearnLib Contributors
* This file is part of LearnLib, http://www.learnlib.de/.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -87,11 +87,11 @@ private static RegisterAutomaton.Alphabet.Inputs exportInputs(Collection<InputSy
for (InputSymbol input : is) {
RegisterAutomaton.Alphabet.Inputs.Symbol s = factory.createRegisterAutomatonAlphabetInputsSymbol();
s.setName(input.getName());
int idx=1;
int idx = 1;
for (DataType t : input.getPtypes()) {
RegisterAutomaton.Alphabet.Inputs.Symbol.Param param =
factory.createRegisterAutomatonAlphabetInputsSymbolParam();
param.setName("p" + (idx++));
param.setName("p" + idx++);
param.setType(t.getName());
s.getParam().add(param);
}
Expand All @@ -105,11 +105,11 @@ private static RegisterAutomaton.Alphabet.Outputs exportOutputs(Collection<Outpu
for (OutputSymbol output : os) {
RegisterAutomaton.Alphabet.Outputs.Symbol s = factory.createRegisterAutomatonAlphabetOutputsSymbol();
s.setName(output.getName());
int idx=1;
int idx = 1;
for (DataType t : output.getPtypes()) {
RegisterAutomaton.Alphabet.Outputs.Symbol.Param param =
factory.createRegisterAutomatonAlphabetOutputsSymbolParam();
param.setName("p" + (idx++));
param.setName("p" + idx++);
param.setType(t.getName());
s.getParam().add(param);
}
Expand All @@ -130,7 +130,7 @@ private static RegisterAutomaton.Locations exportLocations(
if (ra.getInitialState().equals(loc)) {
l.setInitial("true");
}
ret.getLocation() .add(l);
ret.getLocation().add(l);
}
return ret;
}
Expand All @@ -140,11 +140,11 @@ private static RegisterAutomaton.Transitions exportTransitions(Collection<Transi
factory.createRegisterAutomatonTransitions();

for (Transition t : trans) {
if (t instanceof OutputTransition) {
ret.getTransition().add( exportOutputTransition( (OutputTransition)t, tmp ));
if (t instanceof OutputTransition outputTransition) {
ret.getTransition().add( exportOutputTransition(outputTransition, tmp));
}
else {
ret.getTransition().add( exportInputTransition( t ));
ret.getTransition().add(exportInputTransition(t));
}
}
return ret;
Expand Down Expand Up @@ -272,10 +272,9 @@ public static void write(de.learnlib.ralib.automata.RegisterAutomaton ra, Consta
Set<OutputSymbol> outputs = new HashSet<>();
for (Transition t : ra.getTransitions()) {
ParameterizedSymbol ps = t.getLabel();
if (ps instanceof InputSymbol) {
inputs.add((InputSymbol)ps);
}
else {
if (ps instanceof InputSymbol inputSymbol) {
inputs.add(inputSymbol);
} else {
outputs.add((OutputSymbol) ps);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ else if (constMap.containsKey(ass.value)) {
Assignment assign = new Assignment(assignments);

// output
if (ps instanceof OutputSymbol) {
if (ps instanceof OutputSymbol outputSymbol) {

Parameter[] pList = paramList(ps);
int idx = 0;
Expand Down Expand Up @@ -223,7 +223,7 @@ else if (constMap.containsKey(ass.value)) {
OutputMapping outMap = new OutputMapping(fresh, outputs);

OutputTransition tOut = new OutputTransition(p, outMap,
(OutputSymbol) ps, from, to, assign);
outputSymbol, from, to, assign);
iora.addTransition(from, ps, tOut);
LOGGER.trace(Category.EVENT, "Loading: {}", tOut);
} // input
Expand Down Expand Up @@ -321,10 +321,6 @@ private DataType getOrCreateType(String name) {
return t;
}

private boolean isDoubleTempCheck(String name) {
return name.equals("DOUBLE") || name.equals("double");
}

private Map<String, SymbolicDataValue> buildValueMap(
Map<String, ? extends SymbolicDataValue> ... maps) {
Map<String, SymbolicDataValue> ret = new LinkedHashMap<>();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/de/learnlib/ralib/data/Bijection.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public Mapping<T, T> toVarMapping() {
return vars;
}

@Override
public String toString() {
return injection.toString();
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/de/learnlib/ralib/dt/DT.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ private DTLeaf sift(MappedPrefix mp, DTInnerNode from, boolean add) {
} while (leaf == null);

if (add && !leaf.getAccessSequence().equals(mp.getPrefix())) {
if (mp instanceof ShortPrefix) {
leaf.addShortPrefix((ShortPrefix) mp);
if (mp instanceof ShortPrefix shortPrefix) {
leaf.addShortPrefix(shortPrefix);
} else {
leaf.addPrefix(mp);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ public void split(Word<PSymbolInstance> prefix, SymbolicSuffix suffix, DTLeaf le

// update old leaf
boolean removed = leaf.removeShortPrefix(prefix);
assert (removed); // must not split a prefix that isn't there
assert removed; // must not split a prefix that isn't there

//SDT tqr2 = leaf.getPrimePrefix().computeTQR(suffix, oracle);
PathResult r2 = PathResult.computePathResult(oracle, leaf.getPrimePrefix(), node.getSuffixes(), ioMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static class Loop {
private final int min;
private final int max;

public Loop(int min, int max) {
Loop(int min, int max) {
this.min = min;
this.max = max;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ private static class Pair<T1, T2> {
private final T1 first;
private final T2 second;

public Pair(T1 first, T2 second) {
Pair(T1 first, T2 second) {
this.first = first;
this.second = second;
}

public T1 getFirst() {
T1 getFirst() {
return first;
}

public T2 getSecond() {
T2 getSecond() {
return second;
}
}
Expand All @@ -83,7 +83,7 @@ private static class Tuple {
RegisterValuation sys1reg;
RegisterValuation sys2reg;

public Tuple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2) {
Tuple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2) {
sys1loc = l1;
sys2loc = l2;
sys1reg = RegisterValuation.copyOf(r1);
Expand Down Expand Up @@ -179,7 +179,7 @@ private static class Triple {
Word<PSymbolInstance> as;
Word<PSymbolInstance> trace;

public Triple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2, Word<PSymbolInstance> w, Word<PSymbolInstance> t) {
Triple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2, Word<PSymbolInstance> w, Word<PSymbolInstance> t) {
sys1loc = l1;
sys2loc = l2;
sys1reg = RegisterValuation.copyOf(r1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static class Tuple {
RegisterValuation sys1reg;
RegisterValuation sys2reg;

public Tuple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2) {
Tuple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2) {
sys1loc = l1;
sys2loc = l2;
sys1reg = RegisterValuation.copyOf(r1);
Expand Down Expand Up @@ -153,7 +153,7 @@ private static class Triple {
Word<PSymbolInstance> as;
Word<PSymbolInstance> trace;

public Triple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2, Word w, Word t) {
Triple(RALocation l1, RALocation l2, RegisterValuation r1, RegisterValuation r2, Word w, Word t) {
sys1loc = l1;
sys2loc = l2;
sys1reg = RegisterValuation.copyOf(r1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected Transition createTransition(ParameterizedSymbol action,
return null;
}

if (!(action instanceof OutputSymbol)) {
if (!(action instanceof OutputSymbol outputSymbol)) {
return super.createTransition(action, guard, src_loc, dest_loc, assign);
}

Expand All @@ -105,7 +105,7 @@ protected Transition createTransition(ParameterizedSymbol action,
OutputMapping outMap = new OutputMapping(fresh, outmap);

return new OutputTransition(ExpressionUtil.TRUE,
outMap, (OutputSymbol) action, src_loc, dest_loc, assign);
outMap, outputSymbol, src_loc, dest_loc, assign);
}

private void analyzeExpression(Expression<Boolean> expr,
Expand All @@ -125,12 +125,12 @@ else if (expr instanceof NumericBooleanExpression nbe) {
Parameter p = null;
SymbolicDataValue sv = null;

if (left instanceof Parameter) {
if (left instanceof Parameter parameter) {
if (right instanceof Parameter) {
throw new UnsupportedOperationException("not implemented yet.");
}
else {
p = (Parameter) left;
p = parameter;
sv = (SymbolicDataValue) right;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class QueryStatistics {
public static final int CE_ANALYSIS = 2;
public static final int CE_PROCESSING = 3;
public static final int OTHER = 4;
public static final String[] PHASES = {"Testing", "CE Optimization", "CE Analysis", "Processing / Refinement", "Other"};
private static final String[] PHASES = {"Testing", "CE Optimization", "CE Analysis", "Processing / Refinement", "Other"};
private static final int MEASUREMENTS = 5;

private final QueryCounter queryCounter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public SymbolicSuffix(Word<ParameterizedSymbol> actions, Map<Integer, SuffixValu
seen.add(sv);
} else if (seen.contains(sv)) {
int id = dataValues.entrySet()
.stream().filter((a) -> (a.getValue().equals(sv)))
.stream().filter((a) -> a.getValue().equals(sv))
.sorted(Map.Entry.comparingByKey(Comparator.naturalOrder()))
.findFirst()
.get()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2015 The LearnLib Contributors
* Copyright (C) 2014-2025 The LearnLib Contributors
* This file is part of LearnLib, http://www.learnlib.de/.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -88,7 +88,7 @@ void toString(StringBuilder sb, String indentation) {

protected Map<SuffixValue, Set<DataValue>> collectDVs() {
Map<SuffixValue, Set<DataValue>> dvs = new LinkedHashMap();
if (!(this.next.keySet()).isEmpty()) {
if (! this.next.keySet().isEmpty()) {
dvs.put(this.parameter, this.next.keySet());
for (Map.Entry<DataValue, Node> e : this.next.entrySet()) {
dvs.putAll(e.getValue().collectDVs());
Expand All @@ -99,7 +99,7 @@ protected Map<SuffixValue, Set<DataValue>> collectDVs() {

protected Map<SuffixValue, Set<SDTGuard>> collectGuards() {
Map<SuffixValue, Set<SDTGuard>> guards = new LinkedHashMap();
if (!(this.next.keySet()).isEmpty()) {
if (! this.next.keySet().isEmpty()) {
guards.put(this.parameter, new LinkedHashSet<SDTGuard>(this.guards.values()));
for (Map.Entry<DataValue, Node> e : this.next.entrySet()) {
guards.putAll(e.getValue().collectGuards());
Expand All @@ -109,7 +109,7 @@ protected Map<SuffixValue, Set<SDTGuard>> collectGuards() {
}

protected SDT buildFakeSDT() {
if (!(this.next.keySet()).isEmpty()) {
if (! this.next.keySet().isEmpty()) {
Map<SDTGuard, SDT> map = new LinkedHashMap();
for (Map.Entry<DataValue, Node> e : this.next.entrySet()) {
SDTGuard guard = guards.get(e.getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,6 @@ private Node createFreshNode(int i, Word<PSymbolInstance> prefix, ParameterizedS
}
}

private Node createNode(int i, Word<PSymbolInstance> prefix, ParameterizedSymbol ps, SuffixValuation pval,
SDT... sdts) {
Node n = createNode(i, prefix, ps, pval, new LinkedHashMap<>(), sdts);
return n;
}

private Node createNode(int i, Word<PSymbolInstance> prefix, ParameterizedSymbol ps, SuffixValuation pval,
Map<SuffixValue, Set<DataValue>> oldDvMap, SDT... sdts) {

Expand Down Expand Up @@ -324,15 +318,15 @@ public SDTGuard conjoin(SDTGuard guard1, SDTGuard guard2) {
return guard1;
}

if (guard1 instanceof SDTGuard.SDTAndGuard && guard2 instanceof SDTGuard.SDTAndGuard) {
List<SDTGuard> guards = new ArrayList<SDTGuard>(((SDTGuard.SDTAndGuard) guard1).conjuncts());
guards.addAll(((SDTGuard.SDTAndGuard) guard2).conjuncts());
if (guard1 instanceof SDTGuard.SDTAndGuard sdtAndGuard1 && guard2 instanceof SDTGuard.SDTAndGuard sdtAndGuard2) {
List<SDTGuard> guards = new ArrayList<SDTGuard>(sdtAndGuard1.conjuncts());
guards.addAll(sdtAndGuard2.conjuncts());
return new SDTGuard.SDTAndGuard(guard1.getParameter(), guards);
}

if (guard1 instanceof SDTGuard.SDTAndGuard || guard2 instanceof SDTGuard.SDTAndGuard) {
SDTGuard.SDTAndGuard andGuard = guard1 instanceof SDTGuard.SDTAndGuard ?
(SDTGuard.SDTAndGuard) guard1 : (SDTGuard.SDTAndGuard) guard2;
SDTGuard.SDTAndGuard andGuard = guard1 instanceof SDTGuard.SDTAndGuard sdtAndGuard ?
sdtAndGuard : (SDTGuard.SDTAndGuard) guard2;
SDTGuard otherGuard = guard2 instanceof SDTGuard.SDTAndGuard ? guard1 : guard2;
List<SDTGuard> conjuncts = andGuard.conjuncts();
conjuncts.add(otherGuard);
Expand Down Expand Up @@ -459,7 +453,7 @@ public Branching updateBranching(Word<PSymbolInstance> prefix, ParameterizedSymb
updated[0] = oldBranching.buildFakeSDT();
System.arraycopy(sdts, 0, updated, 1, sdts.length);

Node n = createNode(1, prefix, ps, new SuffixValuation(),oldDvs, updated);
Node n = createNode(1, prefix, ps, new SuffixValuation(), oldDvs, updated);
MultiTheoryBranching mtb = new MultiTheoryBranching(prefix, ps, n, constants, updated);
return mtb;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/learnlib/ralib/smt/SMTUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static Variable getOrCreate(SymbolicDataValue dv, Map<SymbolicDataValue,
}

public static Constant toConstant(DataValue v) {
return new Constant( BuiltinTypes.DECIMAL, (v.getValue()));
return new Constant(BuiltinTypes.DECIMAL, v.getValue());
}

public static Variable toVariable(DataValue v) {
Expand Down
Loading