Download as pdf
Download as pdf
You are on page 1of 12
‘Types og Desivations: - Pevivations :- A grammar Arrives a Gtrin with the Start Syw bol and vepeatedly b 4 beginniw weplath a ao NT by Re Aig hteiele oy o proaluction . A heplacememt anvonding ha production is kwown oS derivation. Types: (. Lett Most derivatton. 2. Right Most dtxivation or) Canonical derivation x Logt Most derivation ': Tn tig Nefhed the Gt vost Nowi- is replaced af ever step. production terminal 29: Consioler the poltienng yoetCleae[id. The ip sting ts id gid ¥id, EO ETE 6 3 ee idte [esidy Es id+ Exe [Terex] Esidt id *E fe sid] eridtidrid [Eid Hemer te Tp String ie clasived, Wwe con derive fRe parse tree for fhe above derivation as foltorss & cN e ca | d j e * j | id & Ri Most derivation: . Hexe , the Aight most Non. ternrinal is expanded fivst. eq: Considtx the Anwme production u oss ee fiexe | id The Ups shetty ts id +id & td. EE, EE ea ER Lesidj e aerexid fe > ere) 6 3 Eerid id Bess Fei. e > id tid aod Lead Doner Re put ating is darived. we can derive Ha parse tren fe Re above duivotion os follows - JIN e mee id m, i I Ambiguous brawamax |: A vammoar fr is said to be oumbi guous ig Tt werats wore tRan Telieks parse trea for Sentence Of language LCG). eq: goerelexel| id. ip hang SH HAL > Apter anponding we can derive te parse tren . it ois We gat foo diggorant parse bye hence, ik is saMbisses ype. Fx ample Problems! Let G be a Context free grammar for whieh ee production wules ove given below, & a8 bA A a las|bAA RB 3 b[bsfaBB, Derive te Shin agabboablbo cha above! gramamon . 4 Soln : bepe Most dervation :. g>aB & 3 aaBsB Lp 288) s 3 0200BBB rR oR) 3 saaabS BB fa 2bs} g noo bbabe LssbAl go> aaabb aBB LA sal g > ooa bbabB [Rb gD aaa bhab BbS [r>bs) a > aaabbabbbA [a bal go aaabb abbba taza. Right Most durtvation :- Kg aB a= aaBB Ca2 088) $> aaBbbs rR. bsj @>.aaRbbA [s3 bAJ gsdaakbba LA >a] pe Ra aaRRbba LCR sabe] SDacaBbbba [Rb] SDaaabebbba L[R->bS] B~> aaabbA bbba [gba S53 acabbabbba LAA. Thus the Arquived ay - Design a derivation tree for Re | Grewia gescaas Saabs at. Also dasign Ra lyk nost lond hight wrogt olerivation for fee ehting Noaabaab”. Soln:. Lat Most derivations. go.as g > aas [soos] [ss asbs] [eo 4J [sgsas] [s>asbsJ [o> «J [s34J & > aaasbs g@>aaabs g3 aaabas G5 aaabaaghs S > aaabaab §$ S- aaabaab Thug the Acquired Being. Right Most olavvation:. &Dasths E S50 S bias bs Es asbs] S&S afbaShb Esse] B—> aSbaasb [sas] gs agbaab [ssa] § > aasbaob [gsas] S> A2AALb aah Bassas} Ls s&@J, B-> aaah aob hae Re aguire d ishing ig darived, Amabigity :- A qroummor wibich produces more Han Ce Sor Re Lone input oie One parse ig known as an ombiguovs grammar. IMs re ig called ae paoperty . Tp Re growmmnor ig ambiqarous we Comk unige duberwiwe which parse treo. to Golet for He paxtitulas ip string. 8 to tonverst He sori tates CaUKARAOLY? cuumanr . The amnbigqerous By associatinty & we have Into now? vous youmumay vorll not Obeu pretadurce | aviffnactic Operator - To make an ambigous grammar into unambiguous grammar we have to introduce ont Non. terminal for each precedimer bvel . Exawple:- dovpvert te given ambiagus grewor into ets i) GUO grammar . escte/e-efexef efe|ere/-c |ce)) id The : lie emma es I Eese+t/e-T/r T>teelrfele Fo ate /& Kas -4 1h Ss Coyle Using fRis unambiguous grammar we Cow construct a parse tra for Ho fp sti id tid Cid Aid Aid) 4 vobera # Spociffes and of the steivg The. followin: ig Re powse tree for both Ggt eanost “and i Most derivation . @ a Ng — i eee i/o ts ~ eae are SS Ce eae Since it gives Some parse free for both duxivatton , the quran if tanar big uous peor + Types of Grranr on + Tere axe generally four types ef pein Thy ere. a8 follows. wT et 0 LC unastrieted Grsawmimoay 4 Type t Ltontext Sensitive Greawmmor] # Type 2 fontext tree. Granrmar] * Type 4 CRegulos Grammer Ths ig also kuovsn as Chorney Wiprorcts 2 ‘Type’ ~> Most pecoartul Creoumr mare 10 Hien toraputation ew ve (hate BO vostyiction . duction PDI on * ae wher YecveT) pé even) EA aAb > bS aA é- + Lat! dannot have e) [at con hove €) Type a Typet ig dexived from type ©, Sows xestrictton 1s applied on ipere produckten to gat Tape." cate & &>P tetetton feondlion tak where: [Xf < IB] MN Aes 7. BE (4T)” te production should Follows eg: ao Ab —> bbb aA - bbb [ab 3 bb] Not allowed) Jor tape! Sinn Lbingth oy 4 >R hence this production Can he used fn ‘gre oO. Tape Dy we pak move restriction on type | gram mon ten tape 2 grammar is ated, ContoxtTace Grom mor |: aie Re, eed production, Loft ors pile ai o E satail op A. Were te Variable A is abe both Sides. Tn Context fret Cro Waar orn the variable %- tontext on toe hove ho tontext f & yee Ove So tee al ond &tt context Of cer wit be &. The General production rule of ChE is as follows, Aref 3 where og ¢ (v1T)* bi As% wars O° A srep (Con boxe ‘Type 38). ® Dy we apply more sestricttong on type 2 YOmmar we e pe 3 grammar. This i * a eran: 16 called neg lar pseanan sical thas two classi fications . au LR Lingor baoragae ser A7> x B/ x : 2. best Lineod RrOUMMmar 5° A> Be foe. . where 4, BEV ee 3% Exowple:- wav 20° § > asfb ( Regules ee ona gp ow [¢ a pus S-y8alfb oo. Se A dba exact! Linear Grranrnror Yo aw yvammar if Here avist one lvoxiable on BHS” and atmest one Variable © Rus then it fs known as Linear qtimnamnes Midd, insod og: 82 adb[bsalé Jat Gromucar A>aplb 6 aas/bsfa BOE Chomsky chy i. spe Nee ae, Qe Oe eS See ae Lae a Type o has mestesiaaly enumarrable language . ox this language we can design bur ieg” Mothine. EType! has tontext Aensitive law mage. . For tis languo we have Linear bounded autowola. . tor Type a has fontoxrt free lan ua HRig we Aasign Push down automata CPDA) . Type 3 has Regular a aed fox which we dasign finite automata. Expressive power :. TM SLBA > PBA SFA

You might also like