lib/automata/dfa.rb
def valid?
      # @todo Check that each state is connected.
      #   Iterate through each states to verify the graph
      #   is not disjoint.
      @transitions.each do |key, val|
        @alphabet.each do |a| 
          return false unless @transitions[key].has_key? a.to_s
        end
      end
      return true
    end
def valid?
      # @todo Check that each state is connected.
      #   Iterate through each states to verify the graph
      #   is not disjoint.
      @transitions.each do |key, val|
        @alphabet.each do |a| 
          return false unless @transitions[key].has_key? a.to_s
        end
      end
      return true
    end
Verifies that the initialized DFA is valid.
 Checks that each state has a transition for each
 symbol in the alphabet.

 @return [Boolean] whether or not the DFA is valid.