[go: up one dir, main page]

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

CTCD Unit 2 Cse

unit 2 of ctcd

Uploaded by

Ranjit47 H
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 views32 pages

CTCD Unit 2 Cse

unit 2 of ctcd

Uploaded by

Ranjit47 H
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/ 32
Oni T-2 =—__ Content Free Gyrammor Ge (v,4,P 8) Vi Act of tel (4,8) Tr ack of Tesminads (a,b) P > Production model, S 4 stanting Symbol B's 8 bs form by (arbh nel), cha defined by Solution To tor re Le 5 a,b, dabb aaabbb aaaabbb -.. 4G Production Rate: s aaskh E> bse Soe 8 4 ash “ou Sash £ Lon, % s3e (Ramon é) ») Govabueret the CFA, ‘ a fee wr [we co, tf Soutien * Je 4 a,b, abcba, aabchaa..- 4 S 3 asa S—- bsb oo £ a’ jaak C baa| 1 | Sea 8 > asa a ake te $2 ase ae aM bab s aoe bsb laa bebe 2. | From tH “Yp ebored en produdiu sults , ise howe proved: 3) Grvourc de. CEG ae farne? [rzigt fey abb, aabbbb, aaabbbbbb- -- 3 Producten Ruble: 2 > ase oe 3 abl PPEE Herero Geter cee cSt ree ee ee Ss v aebe Sa shb vt yy a abbp» Sabb Bard om production sule , Bb As presveol Contrast Free Grammar Dextwation t LMD Loft Most Derwation RMD Rigel Most Derivallion Pare Tree Groplical wyrusertil of Derivedion ae J E+ ore] exe(T >anthudt cg rata 7 NT apical Oe =f {6 1200] M, a} Production Rule : EO ere E> ERE E> I fa 8 = ei ar Oe E => FE am =—- it + dm a+ = . ae a+ ERE => at Lee duu R awraes Ee RP a+raee > ata Dw * = AFaKa Am EmECE EO EXE Ext cd 4th x id E =v ETE dur = tA +E ne = fd + EXE dime td tid *e Qn as id tid wid TA ty Rd tid xi * 5 | ) RMD: —— wa Oo Anelter warlord E = E+e Ext tw Z E+ Ew € vm Lt a E+ € svi L4era => E+&w a e+ri* 4 Yr => €E+¢i@ka E14 ava ile Tdi ara ao E+4¢arnKa sS ttaxa eee => BAAAKA ™ * Atakxa vm ——___ Parse Tree E /* 1 fp. A zt /iife (* E V/A do | <7 tof//| £ “— \I {4 \ | oO Ls alp: Atarea PIP a+ awe a Constouet te hing Saabbakba' foo tie given CFG. i) imp HW) RMD) Pasa & 2aB/LA A 7a (agf/baa B sb/ be] aeB Solute | &2, LmD> iad ¢ 5 | ve (4,8 | T= fa,b3 | 8 => 286 | Lin | oa QaaBbB = aabB din = aabbs | dn | => aabbaB am 2. aabbabs ie aabbabbAa = aabbabba Qin - Zs aabbabba be WBMP x s = ab TM = 2aBB Tm => aa®Bbbs Tm > aa bbA - = aaBbba ay aa bsbbo om => ao bbA bbo Crm Te ga bbabba ore s aabbabba +m = 2B = a AlBe = A2aBbs + aaBbbA = aaBblbon => AarbsSbba DaabbAbbe > aabba bba Pash Down Automata, (PDA) # piwplut wor fe SuiplorenE 4. coutemt. free grammar. ts (PDA = tate bok macbve:” eee DEA —> peut amount of Sonormain PPA > Gre anout GF information Pon=1 8,2, 8, 8, 4 2,85 a= Stole Ey Inpt —? etack ay rabols — Trowition. 7 Cyitiol state > Stasting Aybel of Aterck Fo final Abode ” Pim 8 H tee pager | Ug stock | &en” ne2 = aa bb ae ort zt | | | Pusi! (x) Por p= = Stack eS Es Combuuel PDA bre tia farb™ [nw lj Proce : 8 C4. %, Ze) = (4: S (401% OD. (40.02) Fig be) = ee, OD (4, 2b.) = (ar-€? § (gq, 1622) = C48) _ baf€é a,z0/A20 bo/é te i) e7(E Ze) (ee aabb, Ze) (qo, abe, azo) IL (40, bb, care) ee (4, 7 bw azo) Et. 8 2 He (4,6) PDA = (fa qt} (a,b) (a, 22), 7. de, ta, L =) 4 a | Conmeuct PpA tor 2 fonguage ‘ | |e fare” gm [nriemrtd E jee cna ; (n= 2) [rver) =| | Se: aabbcecee | Procuang aipss § (4, & 26) = (4-22) $ (40,00) = (4,9) S (45,6, = (4,9) § CQ bey = (9,/,%) 6 (ys a) = (4,6) § (a2,c,4) = (i,6), § (4,8, 2) = (42/£) Q,20]az b, 0/6 ca/é a/aa bala a q-a/ Oppo @ (4. , aabbec, ze) b ( Yo, abbce, azo) b (qo, bece , 20%) FG . 0, 2) Ela, , St, 4a2) k Ca, , <2) b+ (4.1 &+ %e) + (43,0) PDA -[f aerate}, (a,c), (9.%),8 4,, | | zea) | Clap ie ae Ti eee eit gh Dertgr a2 1 (ee Inst) te accept Yk. 4 ongua ge iS oe In z! Ld ws ceoncidita n=2 Bo aabbB i. Oavact ¢ ctota Srpet Storage . 4 2 input @b, c ) _ gb wf extra Turing Machine . ' Agrnbols Oxy y, 2D used to Autgn Lauguege S + Tondtion Symbol M- (8.2% 5,90,8F) #7 Antal stot Bor Blok symbel 62) tery Fs fual ctate . oe Input tape suod ‘a’ and Pow chomge fois MC Gad owe ocigft ord tir Auord fy Legt mest 'b’ aud chowigg finbo ‘ty’. move Left Again sconce Lif mest ee night fo son a aud change Se ee ee dhemge Lucky ‘Y' dy do He yrocen. "Protentaig . . oabbh B: 8 (40,0) = (4,8) ple] le $(4,,0) = (4.0,8) PELE) s| 8 (4.8) = (av) LaF] Je] S$ Ca.,a) = (24,0) (x[a]y1 [p) 5 (9,.%) = (€90-%,R) re[PIFIaI (40.9) = 08). ela ae 8%, = (9,,% Rvs Lp Nye]E | Lape Sab) = (as,%br > : TES y le. &§ ft, Y% = (42%) Ristoay rs Cl4asry) = (@exX\@ 2 i nee x) pay Ce) ST 4 Sas, = (4,82) Slay,8) = (4, 8,2) gp! 2 (6) kW | 4o (4,,x.R) | ears a, (4, 64, 8) (4.4) uve) 42) Gua) | Gasiony ee tty _ ia J q-2 a ; ofar, Y/YI b/eK : eee aie C se aa 1 Qual y er Nett ~ ln OK vy tle 4.) —_ fa lebaat i” Gy (a. ¥ Rd a \ x] xR ate x/ xR Ambiguity z fpeuthh te dante more thon ome Loft mest darvetion [more than ome wight dexrvalleon 3 Check the given gremmar tb ambiguity orto? Botte € > E-E etd pore ey Sduction’ qPslid +id-id | Erin 4 E ee Eg Ete midte gm idt+ E-€ ypid +id-e “> id vid id | a o land r ER Roe me E+E -€ Rid+e Ridrid = Sida id kx _ Chak whither te geen aamalotguiy Ss AB | aaB Axa /Aa [Sle :a0b | CS i - isk Yer, ik ix powibla. £0 dorive more tow, ews Imp. Page & nD L Z\™ impos ? Ca oa | ps aele NY On aab LD D § dnp a eT a : Bas i ie AaB Ae ae “b) 7 aaB V a a YY aaa Yer, the above Gromanaae Bs ambiigaihy Brounmas. © Blow tat 6: (£5,108.43.0.6) re He QurabSguous Otamrmar g. St8]s*s ja (ble slp Slrg as (arasb), - {| Lmp 1 imp 4 Sr Sts ~mS+ Ses > Ot Sn Ru yp atars watarb , dpm 2 S ax? ars 2 StS #*S at S*S D> Aatraxs > ota b Yes, . S54 aBl(ba As as/bAAlo B > bs/aeb/b. inp 4: 38> a®B > aake 2 aon OB BE a L BB a OO. 79 2bbB gacbe oRF bho bB gaabbabhs palin alp:aaa bbabbbha es e LZIN (OX BOR \ | wal \ b Rips Cx ab “tr = ao B8B = ooaB aBBy — oofaBbs” — aa BabBbba~ 3 oaBobBbba~ Im > sakaboba — aaabbabbeba — cocoa BE abeba - ooakbabbba cabbobbeba aan, \ Peace om B ee a P r \ | AN pane we a A ‘ Gyctax Didedtid Tronslation (SDL) 7 Grammon eee tall ! Qrounmar 5 Prodis ction SESE EEEEE EPEC eeeeee= ———* Grom mar ov Producdion aie Bumoubte ule ( Inform ol Notdllion (GJ add rowe airtbuser: te ts corretpondiing Prous chin ) Gramnnar op Froduchin: Srrasandie rule Ee > ETT E.vol t= Evel 4 T-vol eot E-val: = Teva 7 2 TRF Tevol t= Tvol x Fvol cr oF Teval:= Eval coo Num Fevol:= Num vel | % a+ 3x6 povalie pve + Tal e oe ee \ Y | < (80) | jo Tallis vel * Evel, 3 : pa 6 Boas Twol v=2 Twols= 3 ° ie | LS Fivalico Frol=3 ee | Num \ lune (2) 7) x Direded Trowlodfon con ng fe Spubon Div venting — Pobie Te peel vehi Gramcmor(08)Nobalion ES EES ee pete ae => $3 ToTKe > pad Cr OF To3OF a 3 > pda f Chan tool")? F > Nusa ; 2 a6 * *| (ort or! se pee 6 anate Apt recursion —7 FIRSTID & Foluowtd LL) © , > Prekichive parsing toble 9 Enpub capt wit tabi 2 base om giver qoodudien. Pormule: oa A> BA Beth Ao walle ex} fa?> ‘ _ ee A a A Ale [é A eesisfe Po Peale S+ £05150) sols P , — &p oy osiss'{s P sae /e fur az A A 6 Teen TOT Ble E+ Te! ter tat ' 1 ! Ere Tte' fe ty «Ft'fe a ho to Chonge ou FE) Sid (not pouibl Ee > Te! E> +te'/e ee tTlsoxet'ife F—> ©) fig lewminada @ FirstO £ flowt) & (erb<,*,4 od wv fF ode oly tow minols Ext! NonVerminads S > Bb(ed 64 (A, B,¢, 35 B> aB/e C3 cCle. FIRsTC ) Sa fob e.dg Bo fa, €§j Cm Le,e4 fae f—> Té' |< e'oae'le T> fi! Thow pri/e Foo (e) [id | first 0) veo f Gidg e-> i+, 63 T £¢,id§ Tha fae 5 Fa fe idF FolLowl) as fs, E+ f 4,23 Toit, 4,93 thy f+, $,33 Fo oe 4, $93 © Pewing “eo : + ° nat * a) | id + t E E 4Te' | EsTsS | | E’ pa+te Else | | oe { + Tor | T> FT! T)oaise thee! Toe | (Tae E F->(E) Frid Anput Acceptance: | | ferent | Shack Grpt a te | de deep y FTE fen id xidtid F Ter tele th il +id $ Fsid $eraid daid rid ¢ er widtidg. | To«rt! | ‘ ge'tiex Hid vd f getrte idsidg Faid car any 6 id tid 4 e'r' tid Te ge! rid els 4Te! gerd vid ¢ ter id ¢ T= Fr! tele id ¢ Foid tet r7d add ¢ eft’ $ Tie $e ¢ E'se $ f Aceaptid _— SR Table for motton 1) cDosene. Ff po e4T 2) gots EoaT TO TRE TOF F o(E) Foo th Augrarntid grommas : Ei oF E> EtT —E oT To THF TOF F>5(e) Fo id Comaviicold LR(0) Collector >——_—_—- ‘goto (1p,€) loiK@ E 5 fp ; . E 5.6£+T a: Esa. E'— E: T > .TKE E = Et T TO .F get» (I,, 7) F -53. le) i Fo td = Est. ToT. «F LR(0) > Single LR goto (To ,F) a TOF, goto (Lo, () oe! Foe) E>. e+T Es.T T>. TRE T- .F Fs. (E2Fead fem SR Take! ca 4 * oT 4° Ss 3 vy airs TT | S | ve | % C - “3 : Se per eS og Table (simple LE power a told ? Farias —- Adon vf Lc) [ta | 4 Sy 18s | | | accept Te ¥e Vey vy Sy 8s | Te %, | b + t Sy 8s . 1 | | Sq 85 | Su | Non- terre! gobo TO | —o aj, R 3 0) Skt 2) Reduce BA cep 4) Enor Age fuow (E) = £ $,4,93 Bucw (1) tH, At Foutow (&) fé,e, 4,5 ) Es e4T 2) E€-T 3) T2T#*FP @TF 5) F3(e) b) Frid Doves t 2 ut caing we Avid sid § — Shouk Trp | Adin oO id xidsidf'] gute Os Kid +d $ faeces roid Ors wid rid Pale by 1 es OT2 idtidg | susee ot. *7 thtidd 9° otuste tne Tid tid ¢ | vedic by Fatd Ore TE WO tidg reduce by eee a = . Seo: © ors +id ¢ wedurec bg E> T _ OFt +id g eee id elite Oeits Oeste we $ veduceby Paty OE4+6 F3 4 ee d Tap {42 OR VE UTA ¢ reduce by E> ey OEI 4 Accept eb bee Go conttust TR. JR) ancl accept He biting abl - SSAA A> aAlb Solubion- Auguantedl Crema: S| ace) % 7 Ss - AA ; A > aAlb (anertiol LRto) cotlertion: a s'4.6 | gee ee | goto ( Ta/A) 8 =.AA |= AsacaA (Faso A 7 .oNb As.aal.b | EEE i pe eee g' 4S. A> b. goto (Te,A) goto (TAD - | Ss: = 9.5 A.A | i Ss AA. es, LaAl-b ~—_— Follow (s) Follow (A) ) Ss AA 2) Arak 7) Aab v3 Bs - t4,a,b3 = P4, a,b} A ction Shook" Supt ; . abbs SLatt on3 bb4 state 0a3b* b4 " Ab - oe ee / - CU *2 72) 06 3A b4 4 a - a A> aAGry OAD b+ Slate OA2#BY + | “4 a Aab (a) OAL KE ¢ | rede Of - - | cs AA Os! $ Biede as 7 —— 5 BB poceld. Aogeuntid Crom : a E> BB Bw celd Cououteal LR) cReodion . gots fe to ( To, E> gob ( fo, 8) BE >-E jan ti: c >-8B = Elo gE. “Ee 5 BB Bo.cB B B »-C aod Bod get (ee) gobo ( To,4) Se Te a | " Boe. B Paar r e@o-c B : Bod |'>° goto (Fz ,B) a Le: “B> cB. ee Str Paming ob, 2 F > Ee ee eee | 1 ae ee Chote Ache co ol | 4 o. | $3 _ sa 1 | Aeagt 2 S3 | Sy 3 S3 | Se 2 __& gt <= ll | |8 a c wy) { aa ¥, 6 | ‘eat ae ve 7 j gba gapeat oO | cad ¢ Oc 3. da + occa dt od #86 a¢ Cees | af —__ pe2.dy 4 ~__ofies 4 O&t 4 We goto (£2, 8) ‘E> BB. Filtew Ce)= fF t,.0,43 follows (8) = -f $c, 43 Dat Goto & | 8 Ty | 7 eee | | | | Action. “BhZEE C3) FLL (0) reduce by Bod Geee2) reduc by BocB @«2-4) Slapk (a) reduce by Bod co) | geduaby ES BB ty Acespt LLU) Panatng table and Ae prove “Rot thy wee S > oaABb Awc/é Bod/e Solution » Slep 4 | gat es ft a § OF He grammmas iY ; Eval wo? Be Ease (3) -f3 Fite (5) Lf $3 Fut (A) = fe, 83 fellow (A) F fa,b3 Fiat (8) = fa, ej ftieus( Boni i Skep 2 oe Panting Tobe : Behe a b | a a TL fe | * [f s Ss aA Bb 7 A Ax& | Ane a : ae Bod To pre Aveapt the sbing “lp {aed} 3 aA ETE Stock Tapas Adion ¢s acdb $ S saABb $ bBAw acdb ¢ | ¢ bBA cabs | Awe $¢ bee | edb ¢ | dob : | db 4 Bad | | $b & dos $b | b¢$ | ¢ | ¢ Acespted. 2/2 ae He = DAG (Dirctled Acyelic Groph’) ) Coutruct the DAG for sta following Qromuravr ¥ DAG & divecbed acydlic graph. % Syatoa tree oud DAG ax beth graphical rapresentodion Of gromwman, Auton fee dow uot (ftud tee commun sub eryrerion , but DAG to deud thi. common sysumions. (we DAG ik ated to comburct to adddnon code | : it is ole collect intr nediots toda Qovumotion - Oo 7% = gee & = ott { operator iwalivory a f oot vidde) 2,06 Oo & =bte Db =a+d a Qed 3) c =bte (2) 4) d= a-d &) Face Yo = be-ce be -c- (tp e aw te | ty ety to e \> (a *” (b-c) + (b- o* d ta Ly Ea oO ea tl bie) tlbtcdta 42 eee % = art, ts = %, thy

You might also like