0% found this document useful (0 votes)
17 views7 pages

Automata ch4

Uploaded by

peaceforall5682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Automata ch4

Uploaded by

peaceforall5682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
Adding an element Deleting an element The above table Summarizes the operations that can be performed oe The length of the stack is unbounded, ona stack, Prepared by: Getahun T. ee ae 2 A ‘A Minite stack alphabet, ‘The initiaVstarting state, qois in Q » eA starting stack symbol, is in FA set of final/accepting states, which isa subset of Q * SA transition function, where EQx LU (e)) x1> finite subsets of Qx T° The compticated formal appearance of the domain and range of 6 merits a closer examination. ‘The arguments of 8 are the ‘current state of the control unit, the current ‘input symbol, and the Suttent mymbol on top of the stack. The result is a set of pairs (q, x), where q is the next state of. the contro! unit and x is a ‘string that is put on top of the stack in place of the single symbol there before. The “stack” is an additional Component available as part of PDA. The ‘stack’ increases its memory, With respect to (a'b’ | 21), we can store a’s in the stack. When the symbol $b is encountered, an ‘a" from the stack can be removed. If the Stack becomes empty on the completion ‘of procomsing # given string, then the PDA accepts the string. 2 Prepared by: Getahun 1 Fig. Model of Pushdown Automaton (PDA) Representation of State Transition — : Input, Top of stack / new top of stack Initially stnek is empty , denoted by Z, Representation of Push in aPDA- Push an element 'X'if stack is empty (denoted by Zo ), or if there is 1'X’ on top of stackor if there are 2 or more 'X" on top of stack e Representation of Pop ina PDA — Prepared by: Getahun T. : : X,0/¢ Ne X00 7¢ Pp no element x: We tnvet or more 6 E shows dstetion or pop dig 42 Transition Funetions for NPDA y : : » the stack symbol is also “consumed” (removed from the stack). Note that while the nd arguy o> a a ment 25 ember of the input alphabet (so that no input symbol is NY/ im ), i rd Argument. 8 Always consumes a symbol from the stack, NO Move is possible if the stack ig empty, 6 co Bos 4 ? _ Example: Consider the Set of transition rules of an NPDA contains Sy 8 (al.a,b)={(q2,04),(q3, e)} If at any time the control unit is in state 41, the input symbol read is a, and the symbol on top of the stack is b, then one of two things can happen: (1) The control unit goes into state q2 and the string cd replaces b on top of the stack, (2) The control unit goes into state 43 with the symbol b removed from the top of the stack. In our notation we assume that the insertion of a string into a stack is done symbol by symbol, starting at the right end of the string. 4 Prepared by: of chapter Example: Ce Snstruct a push down automata for the language L= (a°b" } where n>=1 L= {ab, aabb, aaabbb, aaaabbbb, ......} Teach of the string, the number of a's are followed by equal number of b's. Approach used in the construction of PDA - As we wi ant to design a NPDA, thus every time ‘a’ ‘comes before ‘b’, When ‘a’ comes then push it in stack and if again ‘a’ comes then also. ‘push it. After that, when “b’ comes then Pop one ‘a’ from the stack each time. So, at the end if the stack becomes empty then we can say that the string is accepted by the PDA. Stack transition functions:- (q®, a, 2) = (qa, a2) ao A. (q®@, a, a) = (q@, aa) iz) (q@, b, a) = (ql, €) a (q1, b, a) = (qi, ©) (qi, ©, z) = (af, z) Where, qo = Initial state qr= Final state € = indicates pop operation Prepared by: Getahun T. {a bY: m>=1). 4.3, Deterministic Push down automata * Tis a variation of the pushdown automaton, which ‘has at most one possible move. M=(@Q,3,T, 8,0, 20, F) * Q-A finite set of states, g * =-A finite input alphabet * T’-A finite stack alphabet, o- The initial/starting state, qois in Q ee YH * 2 A starting stack symbol, is in a + _F-A set of final/accepting states, which is a subset of Q * -A transition function, where 6: Qx ExT — finite subsets of Qx T* © A language Accepted by DPDA is called deterministic CFL (DCFL) o DCFL are subsets of CFL © DPDA is restricted NPDA Prepared by: Getahun T. 4.4. Be OP eMancuaceachne) over the alphabet ©, the language L is deterministic cont if and only if it Secepted by a deterministic pushdown automaton, 7 A Note: a. am S°FFesponding DPD A. REO; 2.1.8, Go, 20, OME 9.55 oOmMeate and Complexity theory chapter-a istic pushdown automata For given input with current stSteo Wwe may have multiple moves It is not possible to convert every NPDA to n | coFresponding DPDA, =(Q,2,1, 8, qo, Zo, F) 6: Qx (ZU {e})x P> 2xr* It is more powerful than DPDA, DFA,] Deterministic context free languages language is context-free if there exists a context-free grammar that can generate it. This means that: Ifa language is context-free then there is a PDA, Mz that recognizes it 1f a language is recognized by a PDA, G1 then there is a CFG that generates

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy