Skip to content
Open
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
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>--enable-preview</arg>
<arg>-Xlint:deprecation</arg>
</compilerArgs>
</configuration>
</plugin>
Expand Down
48 changes: 0 additions & 48 deletions src/main/java/de/learnlib/ralib/oracles/mto/LabeledSDT.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package de.learnlib.ralib.oracles.mto;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import de.learnlib.ralib.theory.SDT;
Expand Down Expand Up @@ -142,50 +140,4 @@ public static LabeledSDT pruneBranch(LabeledSDT lsdt, int label) {
return new LabeledSDT(lsdt, label);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
String regs = Arrays.toString(sdt.getRegisters().toArray());
sb.append(regs).append("-+\n");
toString(sb, spaces(regs.length()));
return sb.toString();
}

void toString(StringBuilder sb, String indentation) {
if (sdt instanceof SDTLeaf) {
sb.append(indentation).append("[Leaf").append(sdt.isAccepting() ? "+" : "-").append("]").append("\n");
} else {
LabeledSDT idioticSdt = this;
sb.append(indentation).append("[]");
final int childCount = idioticSdt.children.size();
int count = 1;
for (Entry<SDTGuard, LabeledSDT> e : idioticSdt.children.entrySet()) {
SDTGuard g = e.getKey();
String gString = g.toString();
String nextIndent;
if (count == childCount) {
nextIndent = indentation + " ";
} else {
nextIndent = indentation + " | ";
}

if (count > 1) {
sb.append(indentation).append(" +");
}
sb.append("- ").append(e.getValue().label).append(":").append(gString).append("\n");
e.getValue().toString(sb, nextIndent);

count++;
}
}
}

private String spaces(int max) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < max; i++) {
sb.append(" ");
}
return sb.toString();
}

}
8 changes: 4 additions & 4 deletions src/main/java/de/learnlib/ralib/theory/SDT.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public SDT(Map<SDTGuard, SDT> children) {
* @return
*/
// todo: SDTs cannot have registers anymore, this should be data values!
// this method is currently only used in the toString methods of SDTs. Changing
// it will require changing many test cases as the toString methods are used
// to check the correctness of many SDTs.
// This private method is currently only used in the toString method of this
// class. Removing it will require changing many test cases as the toString
// method is used to check the correctness of many SDTs.
@Deprecated
public Set<Register> getRegisters() {
private Set<Register> getRegisters() {
Set<DataValue> temp = new LinkedHashSet<>();
this.getVariables().stream().filter(SDTGuardElement::isDataValue).forEach((x) -> {
temp.add((DataValue) x);
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/de/learnlib/ralib/theory/SDTLeaf.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import de.learnlib.ralib.data.SDTGuardElement;
import de.learnlib.ralib.data.SDTRelabeling;
import de.learnlib.ralib.data.SymbolicDataValue;

/**
* Leaf implementation of an SDT.
Expand Down Expand Up @@ -103,11 +102,6 @@ public Map<List<SDTGuard>, Boolean> getAllPaths(List<SDTGuard> path) {
return ret;
}

@Override
public Set<SymbolicDataValue.Register> getRegisters() {
return new LinkedHashSet<>();
}

@Override
public Set<SDTGuardElement> getVariables() {
return new LinkedHashSet<>();
Expand Down