/** * Runs the given string on this automaton. [Martin, Def. 3.14] * @param s a string * @return true iff the string is accepted * @exception IllegalArgumentException if a symbol in s is not in the alphabet */ public boolean accepts(String s) throws IllegalArgumentException { Set set = deltaStar(initial, s); set.retainAll(accept); return !set.isEmpty(); }