1 / 19

PDA: Sequence of moves

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 )⊦.

terris
Download Presentation

PDA: Sequence of moves

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PDA: Sequence of moves By Diana Castro

  2. PDA: Sequence of moves for aaabbb 1st Move: (q0,aaabbb, Z0)⊦ Initial State: q0 Initial Stack Symbol: Z0 Accepting State: q3

  3. Match the 1st move with the table (q0,aaabbb, Z0)⊦ Next Move

  4. 1. (q0,aaabbb, Z0)⊦ 2nd Move (q1,aabbb, aZ0)⊦ New State Add a to the Stack Unread part of the string

  5. 1. (q0,aaabbb, Z0)⊦ Match the 2nd move with the table (q1,aabbb, aZ0)⊦ Next Move

  6. (q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ 3rd Move (q1,abbb, aaZ0)⊦ New State Add a to the Stack Unread part of the string

  7. (q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ Match the 3rd move with the table (q1,abbb, aaZ0)⊦ Next Move

  8. (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

  9. (q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ Match the 4th move with the table (q1,bbb, aaaZ0)⊦ Next Move

  10. (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

  11. (q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ Match the 5th move with the table (q2, bb, aaZ0)⊦ Next Move

  12. (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

  13. (q0,aaabbb, Z0)⊦ • (q1,aabbb, aZ0)⊦ • (q1,abbb, aaZ0)⊦ • (q1,bbb, aaaZ0)⊦ Match the 5th move with the table (q2, bb, aaZ0)⊦ Next Move

  14. (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

  15. (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

  16. (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

  17. (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

  18. (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

  19. (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 

More Related