go to previous page   go to home page   go to next page

Answer:

  1. Too few characters to reach the final state.
  2. No state transition out of the current state for the current character.

Skeleton of the FSAaz Class

The entire automaton will be a Java class. To run the automaton, an automaton object will be constructed. Here is a skeleton of the class:

class FSAaz
{

  public boolean recognize(String str)
  {
    . . .
    return true;

    . . .
    return false;
  }
}

A conceptual finite state automaton (such as in the previous chapter) stops processing when there is no transition out of the current state for the current character. We don't want our Java method to halt. If the input string is rejected, the method should return false to its caller.


QUESTION 6:

Add some state transitions to the automaton so that, for every state, any character other than the acceptable ones leads to a new "reject" state.

Finite Automaton