Push Down Automata What is a stack A
![Push. Down Automata Push. Down Automata](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-1.jpg)
![What is a stack? • A stack is a Last In First Out data What is a stack? • A stack is a Last In First Out data](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-2.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-3.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-4.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-5.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-6.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-7.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-8.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-9.jpg)
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-10.jpg)
![What is a PDA? • A PDA is an enhanced finite automaton that also What is a PDA? • A PDA is an enhanced finite automaton that also](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-11.jpg)
![Transitions • Transitions of the form a, x ⟶ y require that the next Transitions • Transitions of the form a, x ⟶ y require that the next](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-12.jpg)
![Transitions • Transitions of the form ε, x ⟶ y require that the top Transitions • Transitions of the form ε, x ⟶ y require that the top](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-13.jpg)
![Transitions • Transitions of the form a, ε ⟶ y require that the next Transitions • Transitions of the form a, ε ⟶ y require that the next](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-14.jpg)
![Transitions • Transitions of the form ε, ε ⟶ y can be followed without Transitions • Transitions of the form ε, ε ⟶ y can be followed without](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-15.jpg)
![PDA Accept – Reject Status • The PDA accepts when there exists a computation PDA Accept – Reject Status • The PDA accepts when there exists a computation](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-16.jpg)
![A PDA for {anbn : n ≥ 0} • We usually use the stack A PDA for {anbn : n ≥ 0} • We usually use the stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-17.jpg)
![Is the stack empty? How can you check if the stack is empty? • Is the stack empty? How can you check if the stack is empty? •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-18.jpg)
![Stack push and pop in PDA • a, ε �t when you see an Stack push and pop in PDA • a, ε �t when you see an](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-19.jpg)
![](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-20.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-21.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-22.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-23.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-24.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-25.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-26.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-27.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-28.jpg)
![Visualization of {anbn: n ≥ 0} aaabbb q 0 ε, ε ⟶ $ a, Visualization of {anbn: n ≥ 0} aaabbb q 0 ε, ε ⟶ $ a,](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-29.jpg)
![Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-30.jpg)
![Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-31.jpg)
![Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-32.jpg)
![Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-33.jpg)
![Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-34.jpg)
![Visualization of {anbn: n ≥ 0} aab q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} aab q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-35.jpg)
![Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-36.jpg)
![Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-37.jpg)
![Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-38.jpg)
![Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-39.jpg)
![Visualization of {anbn: n ≥ 0} abb q 0 a, ε, ε ⟶ $ Visualization of {anbn: n ≥ 0} abb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-40.jpg)
![PDA formally • A PDA is a sextuple (Q, Σ, Γ, δ, q 0, PDA formally • A PDA is a sextuple (Q, Σ, Γ, δ, q 0,](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-41.jpg)
![L() : proper opening and closing parenthesis ε, ε ⟶ $ q 0 (, L() : proper opening and closing parenthesis ε, ε ⟶ $ q 0 (,](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-42.jpg)
![Try it yourself • Create a PDA for the language: L= = {w : Try it yourself • Create a PDA for the language: L= = {w :](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-43.jpg)
![](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-44.jpg)
![L= : equal number of 0 s and 1 s NPDA for this language L= : equal number of 0 s and 1 s NPDA for this language](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-45.jpg)
![PDA and Regular Languages • Regular languages can be recognized by PDA: – For PDA and Regular Languages • Regular languages can be recognized by PDA: – For](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-46.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-47.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-48.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-49.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-50.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choices. • Non-Determinism • Non- determinism means that we can have more than one choices. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-51.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choices. • Non-Determinism • Non- determinism means that we can have more than one choices. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-52.jpg)
![Non-Determinism • Non- determinism means that we can have more than one choices. • Non-Determinism • Non- determinism means that we can have more than one choices. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-53.jpg)
![Definition of DPDA (deterministic push down automata) δ : Q x Σε x Γε Definition of DPDA (deterministic push down automata) δ : Q x Σε x Γε](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-54.jpg)
![DPDA vs NPDA • Although non-deterministic and deterministic FA are equivalent this is not DPDA vs NPDA • Although non-deterministic and deterministic FA are equivalent this is not](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-55.jpg)
![](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-56.jpg)
![LR = { ww. R : w in {0, 1}* } • Compare the LR = { ww. R : w in {0, 1}* } • Compare the](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-57.jpg)
![NPDA and CF languages • It can be shown that non-deterministic PDA are equivalent NPDA and CF languages • It can be shown that non-deterministic PDA are equivalent](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-58.jpg)
- Slides: 58
![Push Down Automata Push. Down Automata](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-1.jpg)
Push. Down Automata
![What is a stack A stack is a Last In First Out data What is a stack? • A stack is a Last In First Out data](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-2.jpg)
What is a stack? • A stack is a Last In First Out data structure where I only have access to the last element inserted in the stack. • In order to access other elements I have to remove those that are on top one by one.
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-3.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-4.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-5.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-6.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-7.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-8.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-9.jpg)
Stack
![Stack Stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-10.jpg)
Stack
![What is a PDA A PDA is an enhanced finite automaton that also What is a PDA? • A PDA is an enhanced finite automaton that also](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-11.jpg)
What is a PDA? • A PDA is an enhanced finite automaton that also contains an infinite stack. • The transitions in a PDA are of the form a, x ⟶ y meaning that if you see an a in the input string and the stack contains the symbol x on top then you remove the x and add a y. • The stack gives us extra power to recognize non-regular languages.
![Transitions Transitions of the form a x y require that the next Transitions • Transitions of the form a, x ⟶ y require that the next](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-12.jpg)
Transitions • Transitions of the form a, x ⟶ y require that the next input symbol should be a and the top stack symbol should be x. q a, x ⟶ y x w Stack q’ . . . abb. . . Input q a, x ⟶ y q’ y w . . . abb. . . Stack Input
![Transitions Transitions of the form ε x y require that the top Transitions • Transitions of the form ε, x ⟶ y require that the top](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-13.jpg)
Transitions • Transitions of the form ε, x ⟶ y require that the top stack symbol is x. q ε, x ⟶ y x w Stack q’ . . . abb. . . Input q ε, x ⟶ y q’ y w . . . abb. . . Stack Input
![Transitions Transitions of the form a ε y require that the next Transitions • Transitions of the form a, ε ⟶ y require that the next](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-14.jpg)
Transitions • Transitions of the form a, ε ⟶ y require that the next input symbol is a. q a, ε ⟶ y x w Stack q’ . . . abb. . . Input q a, ε ⟶ y q’ y x w . . . abb. . . Stack Input
![Transitions Transitions of the form ε ε y can be followed without Transitions • Transitions of the form ε, ε ⟶ y can be followed without](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-15.jpg)
Transitions • Transitions of the form ε, ε ⟶ y can be followed without restrictions. q ε, ε ⟶ y x w Stack q’ . . . abb. . . Input q ε, ε ⟶ y q’ y x w . . . abb. . . Stack Input
![PDA Accept Reject Status The PDA accepts when there exists a computation PDA Accept – Reject Status • The PDA accepts when there exists a computation](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-16.jpg)
PDA Accept – Reject Status • The PDA accepts when there exists a computation path such that: – The computation path ends in an accept state – All the input is consumed – (no requirement for the stack) • The PDA rejects when all the paths: – Either end in a non-accepting state – Or are incomplete (meaning that at some point there is no possible transition under the current input and stack symbols)
![A PDA for anbn n 0 We usually use the stack A PDA for {anbn : n ≥ 0} • We usually use the stack](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-17.jpg)
A PDA for {anbn : n ≥ 0} • We usually use the stack for counting. • For this language for example, you first insert all the as in the stack until you start seeing bs. • When you see the first b start removing as from the stack. • When you have consumed the whole string you check the stack: if it’s empty then this means that the number of as equals the number of bs.
![Is the stack empty How can you check if the stack is empty Is the stack empty? How can you check if the stack is empty? •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-18.jpg)
Is the stack empty? How can you check if the stack is empty? • What we usually do is to place a special symbol (for example a $) at the bottom of the stack. • Whenever we find the $ again we know that we reached the end of the stack. • In order to accept a string there is no need for the stack to be empty.
![Stack push and pop in PDA a ε t when you see an Stack push and pop in PDA • a, ε �t when you see an](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-19.jpg)
Stack push and pop in PDA • a, ε �t when you see an a in the input push t on the stack • a, b �ε when you see an a in the input and b is on the top of the stack, pop b out.
![](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-20.jpg)
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-21.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-22.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε $
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-23.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a $
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-24.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a a $
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-25.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a a a $
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-26.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a a $
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-27.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a $
![Visualization of anbn n 0 aaabbb q 0 a ε ε Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-28.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε $
![Visualization of anbn n 0 aaabbb q 0 ε ε a Visualization of {anbn: n ≥ 0} aaabbb q 0 ε, ε ⟶ $ a,](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-29.jpg)
Visualization of {anbn: n ≥ 0} aaabbb q 0 ε, ε ⟶ $ a, ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε
![Visualization of anbn n 0 aab a q 0 ε ε Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-30.jpg)
Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε
![Visualization of anbn n 0 aab a q 0 ε ε Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-31.jpg)
Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε $
![Visualization of anbn n 0 aab a q 0 ε ε Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-32.jpg)
Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a $
![Visualization of anbn n 0 aab a q 0 ε ε Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-33.jpg)
Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a a $
![Visualization of anbn n 0 aab a q 0 ε ε Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-34.jpg)
Visualization of {anbn: n ≥ 0} aab a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a $
![Visualization of anbn n 0 aab q 0 a ε ε Visualization of {anbn: n ≥ 0} aab q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-35.jpg)
Visualization of {anbn: n ≥ 0} aab q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a $
![Visualization of anbn n 0 abb a q 0 ε ε Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-36.jpg)
Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε
![Visualization of anbn n 0 abb a q 0 ε ε Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-37.jpg)
Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε $
![Visualization of anbn n 0 abb a q 0 ε ε Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-38.jpg)
Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε a $
![Visualization of anbn n 0 abb a q 0 ε ε Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-39.jpg)
Visualization of {anbn: n ≥ 0} abb a, q 0 ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε $
![Visualization of anbn n 0 abb q 0 a ε ε Visualization of {anbn: n ≥ 0} abb q 0 a, ε, ε ⟶ $](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-40.jpg)
Visualization of {anbn: n ≥ 0} abb q 0 a, ε, ε ⟶ $ ε⟶ a q 1 b, a ⟶ ε q 3 ε, $ ⟶ ε q 2 b, ⟶ a ε $
![PDA formally A PDA is a sextuple Q Σ Γ δ q 0 PDA formally • A PDA is a sextuple (Q, Σ, Γ, δ, q 0,](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-41.jpg)
PDA formally • A PDA is a sextuple (Q, Σ, Γ, δ, q 0, F), where: – Q is the set of states – Σ is the input alphabet – Γ is the alphabet for the stack – δ is the transition function – q 0 is the start state – F is the set of accepting states About Γ: The stack alphabet can contain any symbol you want. It can be completely disjoint from Σ.
![L proper opening and closing parenthesis ε ε q 0 L() : proper opening and closing parenthesis ε, ε ⟶ $ q 0 (,](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-42.jpg)
L() : proper opening and closing parenthesis ε, ε ⟶ $ q 0 (, ε ⟶ * q 1 ε, $ ⟶ ε ), * ⟶ ε
![Try it yourself Create a PDA for the language L w Try it yourself • Create a PDA for the language: L= = {w :](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-43.jpg)
Try it yourself • Create a PDA for the language: L= = {w : w contains an equal number of 0 s and 1 s}
![](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-44.jpg)
![L equal number of 0 s and 1 s NPDA for this language L= : equal number of 0 s and 1 s NPDA for this language](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-45.jpg)
L= : equal number of 0 s and 1 s NPDA for this language ε, ε ⟶ $ q 0 q 1 ε, $ ⟶ ε 0, ε ⟶ 0 0, 1 ⟶ ε 1, ε ⟶ 1 1, 0 ⟶ ε
![PDA and Regular Languages Regular languages can be recognized by PDA For PDA and Regular Languages • Regular languages can be recognized by PDA: – For](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-46.jpg)
PDA and Regular Languages • Regular languages can be recognized by PDA: – For every regular language there is an NFAε recognizing it. – Simply add ε⟶ε in every transition for the stack (i. e just don’t use it at all). • The languages recognized by PDA is a superset of regular languages. – As we saw the language L = {anbn : n≥ 0} is recognized by some PDA. – L is not regular.
![NonDeterminism Non determinism means that we can have more than one choice Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-47.jpg)
Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Deterministic: ⟶ a , 0 1 q 2 q 1 0, a ⟶ 1 q 3
![NonDeterminism Non determinism means that we can have more than one choice Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-48.jpg)
Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Deterministic: ⟶ a , 0 0 q 2 q 1 0, a ⟶ 1 q 3
![NonDeterminism Non determinism means that we can have more than one choice Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-49.jpg)
Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Deterministic: 0, a ⟶ 0 0, a ⟶ 1 q 2
![NonDeterminism Non determinism means that we can have more than one choice Non-Determinism • Non- determinism means that we can have more than one choice. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-50.jpg)
Non-Determinism • Non- determinism means that we can have more than one choice. • Non-Deterministic: ⟶ ε , 0 0 q 2 q 1 0, a ⟶ 1 q 3
![NonDeterminism Non determinism means that we can have more than one choices Non-Determinism • Non- determinism means that we can have more than one choices. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-51.jpg)
Non-Determinism • Non- determinism means that we can have more than one choices. • Non-Deterministic: ⟶ b , ε 0 q 2 q 1 0, b ⟶ 1 q 3
![NonDeterminism Non determinism means that we can have more than one choices Non-Determinism • Non- determinism means that we can have more than one choices. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-52.jpg)
Non-Determinism • Non- determinism means that we can have more than one choices. • Deterministic: 0 ⟶ b , 0 q 2 q 1 0, a ⟶ 1 q 3
![NonDeterminism Non determinism means that we can have more than one choices Non-Determinism • Non- determinism means that we can have more than one choices. •](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-53.jpg)
Non-Determinism • Non- determinism means that we can have more than one choices. • Deterministic: q 1 ε, ε ⟶ 0 q 2 No other possible transitions
![Definition of DPDA deterministic push down automata δ Q x Σε x Γε Definition of DPDA (deterministic push down automata) δ : Q x Σε x Γε](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-54.jpg)
Definition of DPDA (deterministic push down automata) δ : Q x Σε x Γε (Q x Γε) U {φ} A DPDA has exactly one legal move in every situation where its stack is non empty Given any state q, any letter a, any stack letter x Only one of the following is allowed to be non empty δ(q, a, x) δ(q, a, ε) δ(q, ε, x) δ(q, ε, ε)
![DPDA vs NPDA Although nondeterministic and deterministic FA are equivalent this is not DPDA vs NPDA • Although non-deterministic and deterministic FA are equivalent this is not](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-55.jpg)
DPDA vs NPDA • Although non-deterministic and deterministic FA are equivalent this is not the case with PDA. Non -determinism helps us recognize more languages. • Intuition: LR = { ww. R : w in {0, 1}* } An NPDA for this language pushes the first half of the string in the stack and pops the second half. It has to guess where the middle of the string is.
![](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-56.jpg)
![LR ww R w in 0 1 Compare the LR = { ww. R : w in {0, 1}* } • Compare the](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-57.jpg)
LR = { ww. R : w in {0, 1}* } • Compare the previous DPDA with this NPDA q 0 ε, ε ⟶ $ q 1 0, ε ⟶ 0 1, ε ⟶ 1 ε, ε ⟶ ε q 3 ε, $ ⟶ ε q 2 0, 0 ⟶ ε 1, 1 ⟶ ε
![NPDA and CF languages It can be shown that nondeterministic PDA are equivalent NPDA and CF languages • It can be shown that non-deterministic PDA are equivalent](https://slidetodoc.com/presentation_image/3283923ad011d54d8dfefb3325c6d3cd/image-58.jpg)
NPDA and CF languages • It can be shown that non-deterministic PDA are equivalent with context free grammars. • NPDA accept exactly the set of CF languages. • In order to prove that a language is CF you can – Construct a CF grammar that generates it – Construct a NPDA that recognizes it.
Contoh pda
Contoh soal push down automata
Push down
Push down automata (pda) didefinisikan dengan
2 stack pushdown automata
Push hard push fast fully recoil
Components of high quality cpr
Push hard push fast fully recoil
Push hard push fast fully recoil
Push hard push fast fully recoil
Asp medical
L pop lll
Push and pop in stack
Stack pointer definition
Stack smashing vs stack overflow
Stack=[] digunakan untuk memebuat stack dengan ….
Pda for balanced parentheses
Push down accounting
Pda in computer science
Push down accounting
Push down optimization
Debt push down
I fled him
Stand up sit down hands up break down
There's a place where mercy reigns
Book
The sound of heaven touching earth
Limitations of finite automata
Ltl to buchi automata
Reduksi dfa
Nfa
Anatoly shalyto
Contoh soal dan jawaban aturan produksi fsa
Formal languages and automata theory tutorial
Automata
Cellular automata matlab
Automata
Reverse of a string in automata theory
I/o automata
Nfa diagram generator
Generalized transition graph in automata
Finite automata
Simple grammar automata
Automata theory
Unit 2
What is recursive language
Automata theory
Aq0q
Automata
Finite automata tutorial
Finite automata calculator
Instantaneous description of pda
Automata-based programming
Pda language
Alphabet in finite automata
Central concepts of automata theory in flat
Nondeterministic turing machine
Automata
Gambarkan graf transisi berdasarkan pendekatan mesin moore