You are on page 1of 68
5 Noamet Larguage Human Nice Human Human FL Machine | FL~ formal Languag® FL ft or ess “get 7 (i ou Rin fe a Re eegearnm ay \ ‘ {Peppa Lem ff putomets 1 pega Language CFL - content free ‘langlag Gor GL. — Content gendtive: language. , REL —Recussive {gnomerable lengendt (2 = ee = pe bidafouctabnada! Tontng machine . | mota f& derived Prom — The term auto eek word which means self- | Qesntig, ok? ng aaa . f in | | > an aukomatan fautomata a pla] fs abstract self propelled computing device which follows o! Pe dekeunine = entation s seapnnaviomalic Yy - slrea utth -Peatte no- of Stalces’ fs Psmilhoife stot) méasune] | 7 called finfte Automata CFA] or a theory 2 | ¥ Why Studuy Automat LFintte automata oe a usekul model doy many amportant ‘Vinds - a Sqtuoatte | | | | cond haxdwaste - | eg arid chaching | | cin, Software dov design the behaviowt of digt "y Breads | di) The Lertcol 01 aly zo qa pret compilet i-e., the complet compore! thot beeaks. the “inp denk toto loecat santts ue ' (48 13 luo for Scanning laxqe bodies such as Collection of webpages fo fin occunence of word , phrases ov offer 4 vet potlesns : dv) Slw tov vetidyfng stem o aul ‘types \ } that have a, fintte no-o& dfstinct states Such OS communtcotion pocotocols tov Seavte exchange §nfor mation Terminology Used :' a { An alphabet Is, any faite set of Synubols ' ; Cx: staf bad SHC, Ma J Ps an alphabet set where . Ari bilrd ate Symbols Shing” A string fy a Htnite Sequence 4 Symbo & Faken Prom Btgmd = x: ‘abedab! ts avalid Stving on the alphabet get E={arbiodd Length of the Staving): ; 3 4t 9% the no.g symbols present in the stutn Toot b a . Ad=o 4% cabled an omet | y string | denoted by A ov & | Kleene stat the Kleene state =* fy a unary operator on aset 4 Sym bob oy Statngs » = trate ves the Sndinide seb “4 possible whe 4 all pesstble ie = vmod & =*_ S050 ee Zp whee, Zp f the set a all possible stoing kn} ct tye tae) S*=f6,4,b, aa, ab, ba bb. - ) Kleene clase pase | the set St 1 the ditingte’ setof al Possible ae of alll possible ae Ovex SL sent ane € , = ZN) Language A Language iS Some alphabet a or Ae . egy olf the lange ey fakes. all, osstbh on of leng He dao: overt Z = fab} =f aay bb, ab, bo} tolvps 8 ‘ohich ane accepted bg a subset 4 =* tov at can be ae othe language finite cuttomara ° one “talled cog Jang eg f 3} a } d es 3 opotpttonst § on, “sequen venga j.onton ~ AUB = = {nf Gao, %E BS Le tencatenation¥ .B= fn JoLeA ‘& 03 3. ato 5 LAr Poy laa Jaki bi RO ke Seah. WP ch} le Sele NM x A= HT Poy, 73 vee ieird ig ee gpg FHLB ps. 09) ZY Pape, Poyry » vt, “4 “nthe prt ft 608d, 2+l¢lor Regular Expressfon Is Method to ¥e presente a larquage “9. The languages ushfth ate aaepted tyitte Vaistornata ae called p srequlon language : — let R, be a stequlo cupstessfon overt alpha fhe (By pe ‘ OY PAs © ‘é) % a stequiar the set eS , l= fej ® 'd’ fe a RE denotfag He emplyst th © For each symbol AEE ,a& RE derotl cet {a} RE= A Leja} , @) vnfon ef 2 RE fs also piegulart pe Concatenotton 4, 2 RE fe lsorsequicrt ® Kieenestar * gf KE fg, also stequlax “pvessfon clenoting \ Is also neg} @) iFREs srequlont aR eat: Vio reuse @ nothing eye | Ree —vely . examples z=ta by a length = SPIN dos i ic t= fab} fe 7 RE = atby | i) tength =D tdi L= aba ye ae = abt par adtiob” a _ a (ade) lr bar) =e = (Carb) il (ath), concatenata ne ti) length = =3 ne = catbyita dv) actmost | ann oe” u= Les a. b5 ae Re = Etatb - { v) ) atmos a 0M I L=Je: aie, dup ba, ane) Be = A WNHARIE CHD QRNED Qe = (Etat) (e4a4b) _ wore) OU —t the language fs tnfprte Gall sivings having a single Le fbrab, ba, Ab: aba, baa, ‘nid RE= atba® Gi) au Seings having RE = (tbr bHH* 2 dtpan ‘bbb’ » as subshi atleast one b, dit) AML gatas paving Re = (atyy* bbbh Cab) Gv) all rafags., end wit Sale | RE= (@tb)Fab w) All stings “Shastt! with “ba R= ba Catb)* een wi All shyings begin ec endl with a a €oth)* a : cit) all Setings' containing ~ (arb)* a Corey Why a era RE= wit) All Shring starting and endtrg with ditbevent Symbols : 4 RC = aCath)*b + b(atb)*o. _fine no- a's 4ollovwed by any no- ps followed by any no-4 ce 4 ptheast 10 followed by atleat tb folloxxl by atleast !G ] with either © oy U ji end % % beginor end 5 wd charade tom nity Overy SS fabs i 5 atleast nio's over sis Sab} 4 exactly obs overt DE Sash 4 even lengths sting over 5 = 808 7 odd length steing over / 5 = 33 . a BRC . ot ee ct ey ; * ott) Coty Coot!) - @rb)¥a (orb) Cath) oa ew vo Ente nutommta ‘sidivtded fnto two | types | 1. Determintslie DFA is B tuple | (5,5, oe fy A= Fivite set of ctates pre — input mblyursr x nokia § — transition - fundion | i i | Ve - Snthiod. stoke “ Bip ronipsd E- rol oy | 5 Khe —state fs 24 atesented “ost dud ath store rome ex! @ . -Transttton 4s. oO ext e ol and is NFA ig easy 40 bo conehruct const + ; (ivi) DFA consist @ by NEA doesnot const dead state uta dead state (iv) Ever state with > Every state with Snput will -have enpate will, have transition 40 Singlé — taanstHfon’ to multple state Axtactes : v) Gachtvacking Gs rap Bach traching ‘s sequire d . not neqpived Wi) fractal terglem- PL o| NFA 5 ~entatfon a DFA not feasible . So, we is teocible: -. have to convert “NEA tO DFA - wid) Siaxyesa 0 Saxe Lora Examples ; vlonstouct DEA thot accepts wold. sbiirgs out alphabet zejo} -stotng stasctPre with so’ p={0, 00, 61,011,000, 010,001, --- "4 No-4 States = min length String + i$) o ransttton Table (Pou a 7 String we with o}" olll oo Dlt0, 0101 L={Lor, o10, oll, s\alan S orstruck bea which axe 5 aul Z= Lory ends with “o' LE Yo, 10)00) OL 0,900, = = - 4, Across Table! ¥ contatng or sobstetig: \. constrdl “a DEA 0 inten’ aisep’s ad) Geing ever ON nobel = Lou's “ol a whee ane Skoting contains Sulosrving '. ie Ty 10) 01400, -- § \ 8 af tyansiton’ table 39 —@) ELLE 5 4 Vo |v) Wo wy, %, -) stings contatning 60 L= a 100, 1001'5 oop, <5 as aie table ° ! Mo lo, M lary Vo O106 toy, ay, 5 ceontataing, 10] Le } 101 010! or vero tort =j i y : \ ~~ chow Jp construct DFA which acepls all tring over Gn alphabet s=ib} hoe tergth q the 7 ano Poe > (5 are a tag o haeg & even Og i L= fad abs bas bbs acon 6 AEN ¥ bbb; aabl bia : Abeb baba ab 51 @ Q = 5 1 416, AstD sD L= ¥ 6/11, 110, 1 001, 410° ays ee 8 when the dectmal eg divided by > \eaves @ sremartnd ets t.e.,vem=©? en en a Divisible by + uy L={o, 100, a 12 16 1000, 1001 19000, 7 ~.] yer enndor {Oils 4 34 wot States Vy Vo. V2 Vy Vy ay, Vy Hn all String over | - ipnstou dh NEA wit -- i) 3 ushene gkving slot wor aan 7 “Qo >. 0} a crea ere Qs) E-clOowte + axe neached Tom set of states that the State ay on &-moves oe, Q' fo LSE €— closure (9%) = § Vo Aa ¢ ~choswreCo) = LU Ve} gn elosuste (%)=L%4 vola]22 of £ Gonverston 4 nfa Usith’ epetton to nfa ; uathouk epsrton . steps: 7 te Fad the encosute g, col states 9. find the -teansitton : s\(q,@) = Eo dlosune ($ 3. Decide the final stoke : FHFUG %} it ¢- ose C%o) Fs (dose) : hasing- Fos & membet =F other wise n Eq. i -_ . & & & ©) E-closuve(4e) % & = 1%,» GF ‘E-cpsatey,) = 14, Ne} : E= Cnsure Cav) | HL s¢ Ve A) = E- (osune( $(é- -cLasure Qe) ; a) = E—Gosure(S ( fagicy, Why 3) = E-closure CF Gia U$(ay,a)u_ 5%» a) = €-dnsure ( 6 by, Ur, ) = E-dosure Cov.) = fy” $'C% 1b) = E-closune(§ (§-clesuite (ve)b)) TEclosune s ( 4% ,24,04,} 0) = E-doswre C.§ (vo, 8) u S(a%.6) Y 816) = E-closwie Ceo 0 ey No) = E-chosunte Cave) = fey ie¥, 04} alli ee s\cay,a) = E-—cosune(§ C &-cLosuste(oy) ,2)) = E- closute C&C £4 9%4:,0)) = €-cosunte (Scay, ya) ug AS) = E-closute ( UY) = -€-closwie Ca/,)\= LO 9 V4 §(ov, rb)= E-dosute (§(é-closure@y), b) = E-dosuie(§ (§%, saz} ,b)) = €~ dloswte( §(av,')5) 49 $(%,b)) = €- dosuste bU%) = E-clOsute Co)—=— $Vo1%,>V24 § (4 a) = E- hesure C$ & cosuote(4),®) = €-closwte $C $%4 1) = Exchoswte ( $Cay, 0d Shc -hosute © ~N) = Vay any o 4 slay, b) = €-choewne C § CE deen, b) = é-dosune (§( 2}, b)) = €-chosune (_§ Coy, ,b)) = E- AOSUne (4p) =F Yoh 5!Co¥p 0) = 191 9%} 81, b= L%Or He 25, 5! cay, 10) = 19) 5 C% 1b) = 2 VOM No F(%,0) = 4% 104 . C13) = $9101, V4 =r cae . vb ; ea Final stale \ Fe FUL @f F Fe VIM} @ AY Vo at g~closwie Vo) contats » CHGS E—closuste(Ho) = LAlo (Ni Ae) e- dosune Cay) = wv, VEY é-chosurte( V2) = Fur} (Np (0): = €-desute(§ (e-dles ure(%e) ,0)) pili -dosuxe ( 5 CIV VW, 4, 4 10) = E- dosune( §(Vo10) 05 (10) 6%) = E-cLosune ( V0 OV 4) = E-cosute (Mo) = £%e 1% Vo 5 § (Me, 1) = € -chosune (§ (€-chesuv€ (Ve) ; 1)) aE closue C$ C$ Vey U1 1) = €xclosune( § (411) O(4 11 08%") = €-dosune C OU.% UG) = €-hosune CW;) = TH, V, 3 (0 iL) = €-Unsune Cf ((E-Uosmrecaye) , r)) = E-dosune Lf (£Ve,%, 5424, 29) = Ecosune C § Vo 2) 0 (42) 46S 1(4%,-)- = €-dosune (4,9 = 2424, doy 6) = e-chosute ( 5(€-cl0su"€ Cr») .0)) = E-cLosune (5 (Mis V23 1) = €-chosure(( §CW oO) UVSC ,0)) | = E-closwie C pu), =o. | §' CVA) = & clesure (Ws) ; = LU, 4 §' Cay, 2) = €-closwte Ca) = 12 f CO%y10) = c-closune(®) = p Sn) = e-closute (o) <9 ~ §\Ca% 10) = = e Closure CX) = =L%} = FU 103 2 eater = | Fe Hn, OVO / . kas Conversfon ot nta to dfa: Steps: : a) find the Tittal state Gi) 4thd the fransiHon dow each and every new slate’ . Gii) Do this poocess fell all the new slates ave confiymed - GV) To find “the ffaal state tect Wentiy Stal state an given nla { Thamson's construct @ RE= & +0-£6) @ Rre= =) 6 ® Re=a 9 6) ue RE= ts oy RIS 0k? AO Bg $5 5- Re= RS ‘3G EQ) CSE> 6. RE= ae eho EEDA 4 Re =X) f c_wrA tor @= énra to@) - Precerlence « i Lo) 2-24] % conatenation , He 40% | ens ® te = Or *10 to e-nFA ° 13—>@Qo or o-OL0D bt bak 4o s-uFA @ “f & 6 ee Q ke = ((oF 8) (oath) Iq) 22 Qnversion Re to FA Je subset method 2° prreck method : hod * Ste 1. Subset Method » , P Pere given Re | |. Constouel NFA with o. Convent FA with & to NFA stad | E » Convent NFA to DFA 9. Disect Method: F | 1. REHOH x : — &) @) 2. RE =ab : . = @5O© 3: RE =atb | ly. Be = On _ | SF | ey Cab | -@ Ex = Re ol +10 oe ® convers10n af ‘NFA to DFA . : 8 (4,0) = 140} $ (a ND=LM Ves {CL Va} 79) = € (9/',;0) V§C%©) = guy, =ivi SLM vets) = (&.") U0 $(41') = OUg =%65 §(an 0) ¢ 5m) =9 po d=¢ §(ON)= ath 0,1 } Gmeision oy FA to RE 1s ARDEN'S Method. _ 1. Uoithe equation for each state boxed on *ncoming edges: 2. Add € Jo the equation 4 Geitfal 3+ Sfmplthy the eduatfon using ave and find RE for fhal state — ARDEN'S + R= QERP >Rear* (nd tons: le FA ehould not contain & 4osansttHong 2eFA should have only one I Hal State . r Ex * CY - al “Qo a - af ea eo | aw Ny. = Hy 9% -© We = Qs + Vs LF LF 440 substitute ® in Wa, = E,b ct a, 108 tay -® Vs, = Y, b+Y, %% +40 Ot, = oy, b+an) HAD 0) ov, ='€.Cbraa) 1% A, = (braa) + %% % the fowm ReAtRP WH = WYA+4,a+E -O Ve =Vbrabte,b @ - Va = oy % —6) Bin®. Ma = bt 4, b +o, ab Vo = Wb + YC b+ab) (AbeNs formula) | V> = Ob Cb+ab)* Vi= Vatay,art€ =aNA 1 oy, bLbrab}* aa + € ac | vy, (a + bCbtab)*aa) NM, = € Ca+b(btabyraa)™ Oy ease! |= (a+ beptab} aa) qjalor ‘ : 9. State elfmfratfon method iedoitiel state chouldn't have incoming edge HE encists create new state & make it aS anideal state - 4: 3G 2@® : an : \! > 6 Ab mil: 2. =O 65-6 Fintte avtomata should have single trol state ,it there oxtst mnultfple Fonal gate then create new cate & make it a5 finak state » e: “Sag 3.firal state showld ' not have aoe edge ,2f exgst create new ets mahe tt as ‘hal state €q: ‘ Qui ns’ ¥ GO > @) M & | > Ne @y ie We Elfisinate every stake one, after | until Finite automata has eat ‘00 States , those aXe Sathal site & final stote elim*nate Vy. bee | Soko ® eliminate a. 7 O36 - ee eliminate Ne ee VN, + seg D0 3 a» Cbtttd) a HD déby ots. f ° 626 Cu Ad P@ASLY e Wad 6 es ial elfmmate , 8st gh b.cFa a Adtbea °&) Sie” eliminoke Ny_ 7 Gp ctacatocayk © » Constsrock DFA which accepts au Siings ovext an alpha et x=&o, VD whoite Pinos] Integ ens dputsi ble by Bb. Convott “OEA ustth & fo NEA =@ OS £S 345 pesiean ‘FA -for given Re 1O+COF LI) O* | - 1 *ox ees ® L =o or, 0101 i yo maindert Jul, 2, Fe ud "G26 (OH Nor} "R848 oY Ns “ee aifa}2>- Compi lex p iP Soule 3 : me va compiler Covor, message Interpreten Ty | e080F al a dang aes Source eee teeth object eager oqo. pepere fe Dl Tle. time, - nulls gory rontime es} teupriet spite te = [Result | ogra skeleton Source Code J | "Sousece, TOU | ic Compt let fe Assen bly vod ee , ear e code/object ut Vader] (Pr kext -— Executable machine Lode ee i Compiler Is a Range oqion that can Stead va program qn one Languoge and translate tb into an equilant Povog-rom, Sn another Lar & fry Sounee’ to doseg taxiquoye : _ an fnterpsutor fs’ brotha kind 5 larquoge pruccesor Insteool of peut a a psvogram a» a Loansiate" wan Inlorpret oe Appears to divecty a execute the: epetations specified fn the Sowxce Porn. oy inp supplied by the users - Prepstocessor scans the source code land fncluoles the ‘heackr Frles :whfch contain stelovant frformation for varfous fund ?- —ons - * Phases § Compi lert . ‘Le Vv 5 chavad US S€mantic ands ysis ll ce Tnleimediate ade aprelgtion O (pate nents : LLL) 9 dT — synror dated translation position = enelfal + vate *60 leatfeal an ahd i> 22 ne apety ids areas £6 b o N a ae ee ae ¢ lad i oe | ie id, 17 re ’ : di,” ws gar N72) oh : fint +0 vec Be Na 60 inlevme dfate Code Genexratfon 4) inte to lloect (60) fo = Maat, ty = Ida+ te [1 [Reitior?—- td ~ 43 | Pnttial| ~- ' fe soke | ~ - t Symbol 7 dent Fex ae ‘OHerS FE sepexadov [keyword = operator I—constants L speactal chanactexs Ry lest y -wde optimizer £ = Ido * 60-0 Yds ido 4! code gerwiabor upe R2,%d3 MULE 2, R2 )#60-0 LLDE. Ay dr Lappe @ RY, RD eye fd, RI aan ~ lercieal analyzer stead Stroarns chortacterts mahing up the Source psroqvamn & group the chorackeny into meaningful sequence « oil Leaimes " | ij \ i 7: oylalor x Fonchons of lextcal Analysis « 1. Steads Ropu” chontactex Aor source pis am 2- Divfctling Fhe poogsiann Sato valid tokens Choker zation) 2,. Remove white space chanacker - Ly Remove comments” ’ 5. tlelps +o fdentrfy the tokens in te mol table . 6. Grenenates eral ervtors Lenfcal evvors : >A chonactex sequance whtch &s not Possible 40 scan any valid token 16 a \ernfcal arntoY ' — lexical eters canbe spelling evurs exceeding length of tdéntifiets 7 AP peasie- “me legen characters. Lex: It f3 a ted| which qenretes vextal ZH fadmanoana texto brevet sai 1 { ly . ol) 5 Taken, stveam the Keyword 5 C- Bracket 3 x-tdentifier 5 7 -opocator 4 6 Bel—numbert 5 Bracket. lex Sowice pooqram : etre Lex .L —> n> letegyec Veneer JY-¢. 37 eee q.out compte stream a-out | 9 Sequence of wees Tot] token Staudune 4 LEX pouog vam § dedaiatfon} © § translation sunles) 5 aunilony funcion4, The Saput notettion toy the ler tool i Hefered to %&% the lex language and the too] itself . 8 the. een, "le compiler ” + The lex compiler sganstosmns the tnpd transition dfagam poatterns Fnto & de qn a ffle called and generates co : lex “44° UNIT 2 Content Fotee Grsammat cFG ts a foomal oxvammet witch 9s used to generate all possible strings 4p agen dosmed language , = CF can be deffne by 4 wos 1 =(Vv.T, Ps) — 6! Gna mm on ae Mette! set of variables -T 3 feotte set a, tesmfnals Pp: set oF potod ution voles voq@T)* si stat syenbol €q° © s — > 15]0A05| ye AO Ale S- stant syria V-2SAR) : T-{oty 3 -) 18 [oAOSTE Aa Whe sa 1S =10A05 \o(AOS “4 191e0s 4 101 0S + vol oe ) (010 + ga psag 1a), 12 ef po‘aahib ? “4 S4 obb B74 aah AD fe $5 afb. © + adahbd A danebh 4 aaabb @ Soy S- oS) S 40S | + ooll x Datvatton tree’ Agee OF A*POSE A, dexfvatfon ed twee thot graphicalls y xe enfosmadfon stoi a CFO Root vertex * tt must be labelled ey stant symbol Vortex: verter Labelled by pon-tesmh- nal Syreool “by terminal, leaves; leaves labelled Symbols oY) & €q' 0 & =$v,T, PS} S708 Az Am IE ® AOAR $4 o8 00AAL ~S300bA RA >OoLEAA 7 oo1dé FOol€e -) 00 | @) 26/9 ]22 Left -Detiation Teee A left dertvatton twee fs obtained by applying pacductfons to the left most vostia ble en each step ex: AADAK, | ) 3 ahs / 088], é (A 5b [ba / sa aBb > aalfbs Ss => aabaalss = aabaa ells => aabaa S| > aabaak + aabaar Right — derfvatfon tue : A stant dettvation tee 's obtained patduction to the ant fous: cok to coh St ex Arado, Sy aSh) => asasg) > asdgé > oboe » aa Agja > aafJEa => aa baa (9) COE | @ ) (S) f 'sammay) Scontext ‘vee a geo 6 0 wetted oe ci CFC ‘ +, ee on of élfmfnati ont Removed ¢- useless Symbols §- potoduction oil (Noll Production) cif the context -foee ore Is having ont Symbols , oneccesantl favreasing the lerg th af Phe qpenmnas then ?t has to be ang | Removal of useless Symbols - | | A Gymbol can be useless if Pt doesn't voppent on the atignt hand sfde ct the prot _dion xule and doesnot take port fn the dusivatton 4 any string Ex’ T- 408) abA/T A> oa ®~> ab]b C74 ad since there f& no C in stat oduction C fs useless and Ayal has no end +heveloe inol stplified productions T— oaB/T B—> ab}b ax: soa hBla => igo Ab * > Elintnactfon ef g—production + ae S—> XNX x = oX1E ¥-oY/é gubsittute K-7 E Ssaxy% | EY Sa xy X [XYE x7 0x/0 saxyx [eve 5-9 wx] XY] YX] Y x5 ok JOE if Substitute Y— & sonyx fren — 17 OIE Y> 0y/0 > S—> KY x] KN YK] ¥ [Kx K > oxo Yoyo ~ Removal 4 ont Productions Cx. s-y0A]18]C A~ 0S| 00 B>I/A ca ol unit psoductions* i Sac 3 BWA S01 5 By 0S]o0 >s—9 of /1B] 0) A 0S [00 B->ifos}oo- Cc ol oslal22 Ambtg vos Orvammat! A qavammonx Ys satd +o be ~ambi Os a thote exist! two or more derivation doy o shing, W Cleffe most endsignt: mest) Ex: SABA A> able Gwbele,, soaer fab, alAjeA - “aa cape , ea)” aa €[B)P ) ofA), yl aagiA) ald Yb ow Bev ink A & ! Bey ; \ \ 1 ot Ly an CL ge € N /\ hit a ‘i a A, : \- ' c & Es ete /exelid € w=idtideid IN ee o €* EF ‘id ~ a | eT dN. ‘d 9 ° \ id id 4 4d 8 Ss Act Savoury ak Conversion of Amb! guous +o wri we Can sumove ambiguity by applying 1. fey Tee ; : 4t the operator fg left assaid i “le gfon. i? ib C+,— 1) induce lef oteawts psroductton 38 ott the opt stiaht seus pened ° bye 3nd ator. ts sight assocative i fon Ain 45 production: 2+ Puestdence Role ¢ x : the level at which the woductten Potesent deffnes the priority tk the operator wontatned fn tt ett Atghon the felel 9 pstoductfon the dower the, ptortty, 4 Te — the Lower the lwuel 4 edulis the Righer tae pert ier Example 3 0 € 3 etelexeltd “16 tidtid Reauission ; sant HeOLBsCTON Left reewission vig a . A> Ax |p ; - Aa BA Al salle A pal pwr! > pax A Px e 7 xe 9 £> erly at Be apet oP vet e! a atele © s> 501808 ol a Ax ®P sols! gl —y01$085' | & @ Lousls !.. Lost uU-ysu lé Reason oy left siewwisfon elimina tion A> Ax|p A> xA|B a AY” © i i { t AY 4 25 AC) 5 5, why 4o stemove left sreansive Gramm Because. top-down parcel cannot wel the gramman havin Nett steuusision «9 we have sto stemove: left stewursfon: fk peesewe the Sade eee oy fe mmo » , left facosin ng: Converting, non-deteririrRstfe jam —axi to detereninfstie stammant % Knot as lett Factoring. B61) 42 5 p NDE to Din 2 Exe A > & Pr] Pa Ju prs)ee Py ~) NDG A «K@l Aly PilBs 1p, ) 4s > 0G © S—> ie bs|fetses]% 7 ype, Eb oe Da: S > fetssila sly e]es Eb ® s_s bssaas] bes ash] bs b) & DG: so bss! Ja slo saas] sasb]b s! + sas"|b sli_, as|sb 4fnal + => vssiie s! 5 sas" Ib: S\5 as|sb S— alablabc|abcd —Nndo,) da: ; Sr as S'>€) bl bc] bed Sy Y éfbs! si, z]eled \ 112, S = E)cs n) S“Je)d pitas Fal DG. : Sas! de loa cM 8!» €] bs! “1. Sis &| as!) 5 eha° Rl i i 12 }10]22 Recworedve descent Fartsex este! Ei e'e mand) 0) i ued iN Nae 604 teciapet ==? ttCinpub== $) a ai peorsing succesfil eC) 5 3 3 boy & ee qd sinpatts 5 arent - iE in \ om uy I an 6a 3 eee elx& ? petunn 3 > i ’ First wif ASax , 0 €E (vor) rast (m=145 2. If Ave then erst = 165 3. \F A+R then Feyst(a)= Fist(B) 24'EHetCB) doesnot cor! Fivstta) = Fhyst(e) oF tC o) s+ EPrst(B) cortafns € Follouo : ef Sis start symP nel A 2% BB then Follow CB Frst() ain € cakol then Follow cst GL Fest CB) doesnot contata '€ a. if ASep then ‘Follow(3) = Follow(A, Cx: A abl beled Fixst @) = ga} foy A>ab Ferst®) =9b3 for ASbory Firsta) = (5 dor A cd Lo Ferst(a) = 2 41b, c3 [e3 A> BG Bab C4C¢ Fist) = First®) First (B)= {b} First) = $B} ABC B= ble caclée for Bob AbC >of Frast@) tbs foY Bog AC for cc! Fret =i 5, for c> é Frrst @) = { i) Fst A) = 1b» 6 4—abC tow BoP ® a vleé errste= Fes) csc BI e A> tc Fate PR {Qe FhistiAlgfissel qteominal “that bean fn all otafng’ deitved from A fx: Axy ABC bb Coe , Follow 0B) = Fist) Iq <{e} Asoabe . Foltovsc eS FutCD De Merit! 671 he Ffsst terminal) = $4 ewmiadl} 4 Fallow @y= {ci Bray. . NM yee Cr (

You might also like