Skip to content

Commit

Permalink
Remove unused internal class and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kostis committed Oct 6, 2023
1 parent f5201c3 commit 158c436
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
25 changes: 0 additions & 25 deletions src/main/java/de/learnlib/ralib/equivalence/RAEquivalenceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,6 @@
public class RAEquivalenceTest implements IOEquivalenceOracle
{

/* **********************************************************************
* object pairs ...
*/

private static class Pair<T1, T2> {

private final T1 first;
private final T2 second;

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

public T1 getFirst() {
return first;
}

public T2 getSecond() {
return second;
}
}


/* **********************************************************************
* state pair hash stuff ...
*/
Expand Down Expand Up @@ -274,7 +250,6 @@ public DefaultQuery<PSymbolInstance, Boolean> findCounterExample(

// found counterexample
if (next.sys1loc.isAccepting() != next.sys2loc.isAccepting()) {
//System.out.println("CE: " + out.getFirst() + " : " + out.getSecond());
return new DefaultQuery<>(next.trace, next.sys1loc.isAccepting());
}
// FIXME: this may not be OK in general. I think it is ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public CounterexampleAnalysis(TreeOracle sulOracle, TreeOracle hypOracle,
public CEAnalysisResult analyzeCounterexample(Word<PSymbolInstance> ce) {

int idx = binarySearch(ce);
//int idx = linearBackWardsSearch(ce);

Word<PSymbolInstance> prefix = ce.prefix(idx);
Word<PSymbolInstance> suffix = ce.suffix(ce.length() -idx);
Expand Down Expand Up @@ -179,42 +178,6 @@ private boolean hypRefinesTransitions(Word<PSymbolInstance> prefix,
return true;
}

private int linearBackWardsSearch(Word<PSymbolInstance> ce) {

assert ce.length() > 1;

IndexResult[] results = new IndexResult[ce.length()];
results[ce.length()-1] = IndexResult.NO_CE;

int idx = ce.length()-2;

while (idx >= 0) {
IndexResult res = computeIndex(ce, idx);
results[idx] = res;
if (res != IndexResult.NO_CE) {
break;
}
idx--;
}

assert (idx >= 0);

// if in the last step there was no counterexample,
// we have to move one step to the left
if (results[idx] == IndexResult.NO_CE) {
assert idx > 0;
idx--;
}

// if the current index has no refinement use the
// suffix of the next index
if (results[idx] == IndexResult.HAS_CE_NO_REFINE) {
idx++;
}

return idx;
}

private int binarySearch(Word<PSymbolInstance> ce) {

assert ce.length() > 1;
Expand Down

0 comments on commit 158c436

Please sign in to comment.