190 likes | 264 Views
PDA: Sequence of moves. By Diana Castro. PDA: Sequence of moves for aaabbb. 1 st Move: (q 0, aaabbb , Z 0 )⊦. Initial State: q 0 Initial Stack Symbol: Z 0 Accepting State: q 3. Match the 1 st move with the table (q 0, aaabbb , Z 0 )⊦. Next Move. 1. (q 0, aaabbb , Z 0 )⊦.
E N D
PDA: Sequence of moves By Diana Castro
PDA: Sequence of moves for aaabbb 1st Move: (q0,aaabbb, Z0)⊦ Initial State: q0 Initial Stack Symbol: Z0 Accepting State: q3
Match the 1st move with the table (q0,aaabbb, Z0)⊦ Next Move
1. (q0,aaabbb, Z0)⊦ 2nd Move (q1,aabbb, aZ0)⊦ New State Add a to the Stack Unread part of the string
1. (q0,aaabbb, Z0)⊦ Match the 2nd move with the table (q1,aabbb, aZ0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ 3rd Move (q1,abbb, aaZ0)⊦ New State Add a to the Stack Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ Match the 3rd move with the table (q1,abbb, aaZ0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ 4th Move (q1,bbb, aaaZ0)⊦ New State Add a to the Stack Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ Match the 4th move with the table (q1,bbb, aaaZ0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,bbbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ 5th Move (q2, bb, aaZ0)⊦ New State Pop the Stack. In this case we Pop a, and aaZ0 are left on the Stack. Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ Match the 5th move with the table (q2, bb, aaZ0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,bbbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ 5th Move (q2, bb, aaZ0)⊦ New State Pop the Stack. In this case we Pop a, and aaZ0 are left on the Stack. Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ Match the 5th move with the table (q2, bb, aaZ0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,bbbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ • (q2, bb, aaZ0)⊦ 6th Move (q2, b, aZ0)⊦ New State Pop the Stack. In this case we Pop a, and aZ0 are left on the Stack. Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ • (q2, bb, aaZ0)⊦ Match the 6th move with the table (q2, b, a Z0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,bbbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ • (q2, bb, aaZ0)⊦ • (q2, b , aZ0)⊦ 7th Move (q2,Λ, Z0)⊦ New State Pop the Stack. In this case we Pop a, and Z0 are left on the Stack. Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ • (q2, bb, aaZ0)⊦ • (q2, b, aZ0)⊦ Match the 7th move with the table (q2,Λ, Z0)⊦ Next Move
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,bbbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ • (q2, bb, aaZ0)⊦ • (q2, b, aZ0)⊦ • (q2,Λ, Z0)⊦ 8th Move (q3,Λ, Z0)⊦ New State The stack remains empty Unread part of the string
(q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ • (q2, bb, aaZ0)⊦ • (q2, b, aZ0)⊦ • (q2,Λ, Z0)⊦ • (q3,Λ, Z0) String is accepted! Done