On any input string w, a computation of the nondeterministic TM M consists of the following sequence of steps.
S# is written starting at position one of the tape 3 and the rules of G are written on tape 2.
A rule is nondeterministically chosen from tape 2.
Let be the most recent string written on tape 3.
An instance of the string in is chosen, if exists. (i.e. in this case for some string and ). Otherwise, the computation halts in a rejecting state.
is written on tape 3 immediately after # (indicating the application of the rule to to produce the next sentential form ).
i) If = w, the computation of M halts in an accepting state.
ii) If occurs at other position on tape 3, the computation halts in a rejecting state.
iii) If , then the computation of M halts in a rejecting state.