8081828384858687888990
} } } } } b.minimize(); return b; } private Set<State> findPreSet(Automaton b) { Set<State> pre = new HashSet<State>();
320321322323324325326327328329330
for (State state : result.getLiveStates()) { state.setAccept(true); } result.restoreInvariant(); if (result.isDeterministic()) { result.minimize(); } return result; } /**
343344345346347348349350351352353
} } result.addEpsilons(epsilons); if (automaton.isDeterministic()) { result.determinize(); result.minimize(); } return result; } /**
365366367368369370371372373374375
} } result.restoreInvariant(); // accept states have been modified result.addEpsilons(epsilons); result.determinize(); result.minimize(); return result; } /** * Returns an automaton accepting all characters considered digits by {@link Character#isDigit(char)}.
3536373839404142434445
for (State s : b.getStates()) { epsilons.add(new StatePair(initial, s)); } b.setInitialState(initial); b.addEpsilons(epsilons); b.minimize(); return b; } @Override public String toString() {
5455565758596061626364
} } } b.setDeterministic(false); b.reduce(); b.minimize(); return b; } @Override public String toString() {
5354555657585960616263
for (State s : a1s) { for (Transition t : map.get(s).getTransitions()) { s.addTransition(new Transition(Character.MIN_VALUE, Character.MAX_VALUE, t.getDest())); } } a1.minimize(); return a1; } @Override public String toString() {
3839404142434445464748
epsilons.add(new StatePair(initial, s)); epsilons.add(new StatePair(s, accept)); } b.setInitialState(initial); b.addEpsilons(epsilons); b.minimize(); return b; } @Override public String toString() {
pp.addTransition(new Transition(t.getMin(), t.getMax(), ss)); } } b.setDeterministic(false); b.addEpsilons(epsilons); b.minimize(); return b; } @Override public String toString() {
transitions.add(new Transition(Character.MIN_VALUE, Character.MAX_VALUE, dest)); } } b.setDeterministic(false); b.reduce(); b.minimize(); return b; } @Override public String toString() {