Need a PDA for L={ a^n b^m c^m d^n n,m>=1 }

4.7k Views Asked by At

I am trying to desing a PDA for automata lecture.Language is L={ a^n b^m c^m d^n n,m>=1 }

    δ(q0, a, Z) = (q0, aZ)            
    δ(q0, a, a) = (q0, aa)            
    δ(q0, b, a) = (q1, ba)     
    δ(q1, b, b) = (q1, bb)
    δ(q1, c, b) = (q2, ε)             
    δ(q2, c, b) = (q2, ε)             
    δ(q2,d , a) = (q3, ε) 
    δ(q3, d, a) = (q4, ε) 
    δ(q4, ε, Z) = (q4, Z)    

States are q0,q1,q2,q3,q4.Z means empty stack.ε means push nothing to the stack.And q4 is final state.I designed it that way but i am not sure if it is correct.Can you check the answer and help me to fix it?