1 / 6

Top-Down PDA

Top-Down PDA. Sequence of steps to which string X= [][[][]] has to be accepted by NPDA NT(G) Grammar has productions s [S]S|^. We compare the moves made by NT(G) in accepting this string be leftmost derivation of this string. S=> [S]S =>[ ] S => [ ][S]S => [ ][ [S] S ] S

gada
Download Presentation

Top-Down PDA

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. Top-Down PDA Sequence of steps to which string X= [][[][]] has to be accepted by NPDA NT(G) Grammar has productions s[S]S|^

  2. We compare the moves made by NT(G) in accepting this string be leftmost derivation of this string. • S=> [S]S =>[ ] S • => [ ][S]S • => [ ][ [S] S ] S • =>[ ] [[ ] S] S • => [ ] [ [ ] [S] S] S • [ ] [ [ ] [ ] S] S • [ ] [ [ ] [ ] ] S • => [ ] [ [ ] [ ] ]

  3. Transition table for Top Down PDA NT(G)

  4. To the right of the each move that replace a variable on stack , we show the corresponding step in the left most derivation. (q0, [ ] [ [ ] [ ] ] , Z0 ) Steps are derived by using the moves in transition table |- (q1, [ ] [ [ ][ ] ], SZ0) S |- (q1, [ ] [ [ ] [ ] ] , [S]SZ0) => [S]S |- (q1, ] [ [ ] [ ] ], S]SZ0) |- (q1 , ] [ [ ] [ ] ], ]SZ0) |- (q1 , [ [ ] [ ] ], SZ0) |- (q1 , [ [ ] [ ] ], [S]SZ0) =>[ ] [S]S |- (q1 , [ ] [ ] ], S]SZ0) |- (q1, , [ ] [ ] ], [S] S]SZ0) =>[ ] [ [S]S]S |- (q1 , ] [ ] ], S] S]SZ0) |- (q1 , ] [ ] ], ] S]SZ0) |- (q1 , [ ] ], S]SZ0) |- (q1 , [ ] ], [S]S]SZ0) => [ ] [ [ ] [S]S]S |- (q1 , ] ], S]S]SZ0) |- (q1 , ] ], ]S]SZ0)

  5. |- (q1 , ], S]SZ0) |- (q1 , ], ]SZ0) |- (q1 , ^ , SZ0) |- (q1 , ^, Z0) = > [ ] [ [ ] [ ] ] |- (q2, ^ , Z0) These are the sequence of steps that string x to be accepted

  6. Thank you

More Related