Skip to content

Commit

Permalink
fixed ? quantifier issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanburmane committed Jul 26, 2024
1 parent c667106 commit ff1fc03
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/dk/brics/automaton/GenerateStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ private static void traverse(State curr, int maxNumVisits, ArrayList<State> path
}
for (Transition t : curr.getTransitions()) {
if (t.getDest().numVisits < maxNumVisits) {
traverse(t.getDest(), maxNumVisits, currPath, positiveStr);
if (curr.equals(t.getDest())) {
traverse(t.getDest(), maxNumVisits / 2, currPath, positiveStr);
}
else {
traverse(t.getDest(), maxNumVisits, currPath, positiveStr);
}
}
}
}
Expand Down Expand Up @@ -77,13 +82,13 @@ private static ArrayList<State> shallowCopy(ArrayList<State> path) {
return new ArrayList<>(path);
}

public static void addPathToList(ArrayList<State> path, ArrayList<String> language) {
public static void addPathToList(ArrayList<State> path, ArrayList<String> positiveStr) {
ArrayList<String> pathStrings = new ArrayList<>();
for (int i = 0; i < path.size() - 1; i++) {
ArrayList<Transition> transitions = findTransitions(path.get(i), path.get(i + 1));
pathStrings = addCharacters(transitions, pathStrings);
}
language.add(pathStrings.remove(0));
positiveStr.addAll(pathStrings);
}


Expand Down Expand Up @@ -121,7 +126,6 @@ private static ArrayList<String> addCharacters(ArrayList<Transition> transitions
newPathStrings.add(c.toString());
}
}

return newPathStrings;
}
}

0 comments on commit ff1fc03

Please sign in to comment.