Partial preview of the text
Download toc unit 2 auotomata and more Schemes and Mind Maps Theory of Computation in PDF only on Docsity!
ARYA GROUP OF COLLEGES AlET (_) ACERC(_) AIETM(_) ACP ( apce C) Branch / Faculty: TOPIC: .sssecesessecesssersesen al ase Le REGULAR GRAMMAR al Definition Of a Graamman t= Gaammat isthe sot of nutes. that explaings how the wthda ane udtd pa a Lang iQgb. , | food “4 Un a2 mie — La _dingde nen ~ empty Kit called denmainal dy fe (We 6), o had ea oT ie aan The element of ane__ealled produc tien O4 production putes {| | Name of Lecturer 7 qin _onamman we tan use the folleusing netatlans— HS 4 T the sHanting aiymbol umledd alien bide | | xpocifiod # Now - Sen wiaa du neprestmted by tap tat Lidtones itch os A, b, C, 4 Serainal ts pepresented by er dedtens l Auth ads a, by Cy. sssen Gwe dides (tHs and R2Hs) o4 the. produc tti'oan Ailes: ane Athanated by > ” ssiyen bel Ly 9 442 denotes the C atutng” uf fenminals a8, Pi denates the stalng el Jevunfinn ta oA nan — -euminala 04 bath eluding nul withing WHEE Any dumbol +o the pause wf A 4 Cguiualent to. null Lets ae osleas 2 On ve) | Gaammar G1 -{£5, ALY, fa, bf, g, Ss > AR, Axa, Bob) Zz Heres > Sy A, RB arse Non len minal day rn bold > 4 ana bh ane Tenmi nol say rvb pls >» ¢ jy dhe dont symbol, gen |» Pro duction, Pp: C3 fh, faa, Boh _. Mean sidering ‘a? ad Lat ) (o) Using pute fot SPSS —_4_—__ ae S285 > SSS (auplacing nighdmedd_.< by Ss) 2? SSSSSSss1ss0! wares 2 22.00.20. Hines (eplachg lepimact _ Soy ‘a m timef) OR > E£Cb Eb .eun dimeg me Jepimact— a Shp é n-times) _ B68 £,a and a” fer n2et ts in Lia) Ther afore , Lém) = {£6£,0, 29,000,000, 1.04} Llu) = farcjnrzo} a a* ARYA. GROUP OF COLLEGES AlET (_) ACERCC_) AIETM(_) AcP (_) APGC (_} 7 _ LECTURE NOTES: Branch / Faculty: ... Year / Sem.: Exc(Z)_ Ags amram. (a has the fetbousing bn oduction | S> AR A> ahla ___8 > bB Jb Find ) Ca). Aelublin— (a= (Vn, £, £, 6) | lush tne Vn= $S,A, BY}, ¢ = fas | fz a 7 $2 AB, 4 fos. fi-s 4A, t fo: fi a, fur B-> bB, Poe Roh} Maing tute Pa: D>a [Using nile Pst Bob M — henge te { S2 ah | lowe knoe phof- —__.__f4 3 ¢» AR | g¢> aAbpR Pues fang Fin | S> agAbL Rp iM oo et £5 aah. A bbbn | _ a $2 0001., ntmeg bbbbasi im dimes. aman re AN £* E88 4 “A GROUP OF COLLEGES AIET (_} ACERC(_) AIETM(_) acP (_) apGc (_) LECTURE NOTES Subject: ......... TOPle! oes ecceeeeeeseeee » Lecture NO. oo... AabbC ,ssse0. % — ao the. Aan u age é _ | b= Jy tudo | Lo= ah, aghh, aaokbbh,,.....3 _| 5 Us abc, Dabber, cob bCyn sins b | l= fah, ahc, aabh, Aabbco, Qabhe, sss, 4 Production nite pos languagt ee fr2 A> ah po - 3» ath Py ty ALungiise productiin sen i) : Production Aude. fer Lonpunpe VE Ses Pas GC > Sc fus 69 A [ Hente the gaara. 1s _ -- G2 Cis, At,£a, bch $82 A) se, B22 pb) apis) soe Name of Lecturer ix @ | lfenaduned 2 geammae fas the. language ; | Sian oie la, nt Ko Let the gramman Gi = (aa, 2,°,¢) he y L Sn the quuen tanga. L 2 wery Pf ws my mimetic OUln the —adynbot Pd Lond fa, not e ° aymbol, Henee the danguage = Vv a faca, heb, abcba,aacag, hhe bby vant Panshisd Sot haven Pri S$ aSa Spor whrimo 'a 4 4 fo» S> beh £ ben stag ‘b' 3 Pat X > $ Jor stung '0'3 Pui $2 aya v r Pot S53: bXh Ajden concatenatitn the product? ar sulea - ‘$7 asa |hgh)ayalhyh poe Ma i Thus the geamyn an (n_- (h=(fs,x} farb.ch, o> asa] hsb Javalhyby} ye Fy ¢) j ate, Regular Gramman.- Aenvrally, a grammar Go is a guadnuples (vm, £,P,S) 4 turer ey _ #Vn- isa finite nimempty dot of han- tenmd naly *£ E- is a fu itt. non ¢ mpdy bid oY dtaminals af - 4 a finite nén €mpty éut Bf product ons 2s- is a stant asynb ot. 4 — ——tp q a7 _ oductiéns the mman (Cn ant lim 4 the po that pe om 3 Admost fat won dementia! dayrabel appeana an the sutghd hand «ide ef the. an 5 Atmest One nan denmina! Aiymbed appears On - the Left hand side of the puoductt on a Nan - denminal aiymabed uthich £4 an the a alght- hand aide, rough be either fhe Lip bmnedt- es the Afghtmout ayrabol | then (n £5 knoum ad Aegulan promman!) ok CONTEXT FREE GRAMMARS a Definidion- P=" A grammar Ge Cun fy PS) ts . daid to be context free, if all productions in Pohaue. the fom 47 6 Luhene, ao, —_ Hene=) Lt 7 vee mre . . Mm = + set of portables a2 nenterminals . —e- bet of ferminad alphabed 9 Pe et of, productisw surle. Ee on ~ xStant rm lol & SE Vin _ a tamgeiaye is stale) 10 be. context fpree tp sand only if there daa stondext. Prue - ( peaminah Gr duth thor Le L(t). 8 aocee odes - he. productions im a Cha au ms Lund WIAs = . aw othe Jeph band ile mune} baa afagle ri toi @MRHS can be any combination of ~denrunal ¢ - nonr-enmnad, a | Even At, fe Pe eo me pepolen dengue ts ode a context free one’ I The legp meat deniuatfen £5 — F-= Ete E= F-Etl £=Q-f£+¢€ E=a-b+e _£= a-b+ta _ @ Rightmeat Derivation. “On Adphtmoad derivation, the dmput 4s canned and juin Pate wats the. production sulle. : dept, SO Ly si ghtmbat re en we, Acad fhe- ten put bey: pam faght #0 Aap. ful | Peediut lar Aufed—= es a a a a a = ~— E> F-€— — a - = alb— sot ABJE A > aB B2SSb daludion Lept mat? denfuadion- S> AB. > aBB io ' ve> eh B “.1 D> aebB. 2 absb | 2» ab&b pabb— Rig ht moat derfuation- S 2 AB 2? ASb > Alb 2. 2B be Sa. 7 asbh ? @&bh 2? abs ‘apne txD Onaw a dertuation Due he the astring “bea bp! the CFG iven. fo a ae S> bSbflalb olution - RS Jn aaa bs b AN Ss — tS eee eS 2 N re fx @ _ Conaider the grammar Cr, With productions S32 aAB oe . oe A> bBb a oo BoAle a Find @ most loteabiendipel dent vakion ©. farde - Cos abning ~ "abbbs” ee Aolution Leptm denfyvation —_ - ae —— $7 oAB | SS? aaBbB $a bBbI S-> abAbB fp2Af o> abbebbG {A> bBbT S-> Abbbb B go es $2 Aabbbb § a7 tF x Ambiqulty 4 im Context Free Conard xh the gramman is nit aroblguoas Shen__1d ts Cobled tnam bigueug.—- the grammar, eg 2d ambiguity , the iba vr a natl : for compiler an ie “No methed “ean. dicomabiealty dee? amd . — memove the ambiguity. 4-but We can Aeraoure. ambi Puta uiting the whole mon. ee. a a na tx) Show that the grammar a cs a8 fsa. la Pe am bigueas Soluckton— “Here we Can - generode ay ano paz foltouriong pane a ro _ QO. 2@rxas — i> ons isoash es aqa ff S$2ajz_ a . A a Ss : fy. Fined povrac Dux fet adring Weaaa Efy- Second pone bas foe sb oe D 65 asa ps>saF aes Lebel ss | fe j a a £3:Sa. no 7 S53 saa [Sea Sa} pate co > ana f Sa} om” Sn | ; Oa a