
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The solution to problem 4 of a short exam on formal languages, context-free grammars, and pushdown automata. It includes the production rules for the grammar, the design of a pushdown automaton, and the acceptance of specific strings by the automaton.
Typology: Study Guides, Projects, Research
1 / 1
This page cannot be seen from the preview
Don't miss anything!
K = { q0, q1, q2, q3, f }, = { a,b}, Γ = { a,b,c}, s = {q0}, F = {f} Δ = { [(q0, Λ, Λ), (q1, c)], [(q1, a, Λ), (q1, a)], [(q1, b, a), (q2, Λ)], [(q2, b, a), (q2, Λ)], [(q2, Λ, c), (f, Λ)], [(q2, b, c), (q2, bc)], [(q2, b, b), (q2, bb)], [(q2, a, b), (q3, Λ)], [(q3, a, b), (q3, Λ)], [(q3, Λ, c), (f, Λ)] } q0: Yığının boşaldığını anlayabilmek için yığına bir c atılarak q1 durumuna geçiliyor. q1: Giriş katarından a’lar okundukça yığına atılıyor. Giriş katarından b okunursa yığından bir a çekilerek q2 durumuna geçiliyor. q2: Giriş katarından okunan her b için yığından bir a çekiliyor. Yığın boşaldığında giriş katarının da sonuna gelinmişse, f durumuna geçiliyor. Yığın boşaldığında giriş katarından b okunursa yığına atılıyor ve bunu takiben okunan b’ler yığına atılıyor. Giriş katarından a okunursa yığından bir b çekilerek q 3 durumuna geçiliyor. q3: Giriş katarından okunan her a için yığından bir b çekiliyor. Yığın boşaldığında giriş katarının da sonuna gelinmişse, f durumuna geçiliyor. f: PDA sonlanıyor
c) Durum Katar Yığın
q1 bbba aac q2 bba ac q2 ba c q2 a bc q3 Λ c f Λ Λ
Durum Katar Yığın
q1 bbb aaac q2 bb aac q2 b ac q2 Λ c f Λ Λ