    /** 
     * Finds the set of states that are reachable from the initial state. [Martin, Exercise 2.27(b)] 
     */
    public Set<State> findReachableStates() { 
        Set<State> reachable = new HashSet<State>(); // contains the states that are reachable and have been visited
        Set<State> pending = new HashSet<State>(); // contains the states that are reachable but have not yet been visited
        pending.add(initial);
        while (!pending.isEmpty()) {
            State q = pending.iterator().next();
            pending.remove(q);
            reachable.add(q);
            for (char a : alphabet.symbols) {
                State p = delta(q, a);
                if (!reachable.contains(p))
                    pending.add(p);
            }
        }
        return reachable;
    }

