fixed complement
This commit is contained in:
parent
0d47de5c44
commit
4422270452
3 changed files with 44 additions and 44 deletions
|
|
@ -362,26 +362,6 @@ public class NFAImpl implements NFA {
|
|||
fakeNFA.acceptingStates.clear();
|
||||
fakeNFA.addAllAcceptingStates(newAcceptingState);
|
||||
|
||||
Set<Character> originalAlphabet = new HashSet<>(fakeNFA.alphabet);
|
||||
|
||||
fakeNFA.alphabet.clear();
|
||||
|
||||
Set<Character> newAlphabet = new HashSet<>();
|
||||
|
||||
for (char ch = 'a'; ch <= 'z'; ch++) {
|
||||
if (!originalAlphabet.contains(ch)) {
|
||||
newAlphabet.add(ch);
|
||||
}
|
||||
}
|
||||
|
||||
for (Transition transition : fakeNFA.transitions) {
|
||||
for (Character letter : newAlphabet) {
|
||||
fakeNFA.addTransition(new Transition(transition.fromState(), letter, transition.toState()));
|
||||
}
|
||||
}
|
||||
|
||||
fakeNFA.alphabet = newAlphabet;
|
||||
|
||||
fakeNFA.finalizeAutomaton();
|
||||
|
||||
return fakeNFA;
|
||||
|
|
|
|||
Reference in a new issue