Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS322D Tutorials.

Similar presentations


Presentation on theme: "CS322D Tutorials."— Presentation transcript:

1 CS322D Tutorials

2 Q1. Given state diagram PDA ( PushDown Automata ) M that recognizes  the language {anbn : n > 0}
The stack initially has one symbol: Z Transition label a;Z;aZ means on input a, the top of the stack should be Z, which is popped and the two symbols aZ are pushed back on the stack.

3 a. By using JFLAB show if the string aaaabbbb is accepted or not .

4 To start a new NPDA, start JFLAP and click the Pushdown Automaton option from the menu, as shown below:

5 After adding four states to the screen, setting the initial state to be q0 and the final state to be q3 and adding transitions. The screen should look similar to one below.

6 Click on the “Input” menu and select “Step with Closure
Click on the “Input” menu and select “Step with Closure.” It will prompt you for input, so enter “aaaabbbb” (representing a4b4). After clicking “OK” or pressing enter, the following screen should come up: This text box which currently contains a 'Z', is our stack.

7 If we click the step button, we can see an example of how the stack changes as the simulation runs.
The stack will be at its largest when the  “a”  values have been processed, and it will get smaller if “b” values are processed. The stack will finally end back where it started with a value of “Z”.


Download ppt "CS322D Tutorials."

Similar presentations


Ads by Google