q0 _ a r q1
q0 _ b r q1
q1 _ a r q2
q1 _ b r q2
q2 _ a r q3
q2 _ b r q3
M = On input <S,n>,
0. Check to see if <S,n> is properly formatted; if not,
immediately REJECT
1. For each element x in S
a. Compare x to n
b. If they are the same, then immediately ACCEPT; otherwise
continue with the for-loop
2. If we checked all elements of S and still did not find n,
then REJECT
M = On input <p> where p is a polynomial over variables x1,...,xk,
1. For each possible integral assignment of x1,...,xk:
a. Evaluate the polynomial p with the current assignment
b. If p evaluates to zero, then immediately ACCEPT
2. If no assignment ever evaluates to zero, then REJECT