0% found this document useful (0 votes)
164 views88 pages

TAFL

quantum series TAFL

Uploaded by

sid20037789
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)
164 views88 pages

TAFL

quantum series TAFL

Uploaded by

sid20037789
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/ 88
UNIT-1 : BASIC CONCEPT & AUTOMATA THEORY (1-1 Ato 1-37 A) Introduction to Theory of Computation Autornata, Comutabalit & Complexity, Alphabet, Symbol, String, Formal Lar 5 Deterministic Finite Automaton (DFA). Definition, Meprey Acceptability of a String, and Language, Non Del Automaton (NFA), Equivalence of DEA and NFA Transition, Equivalence of NFA‘s with and without #Sransation, Finite Automata with output- Moore Machine, Mealy Machine, Equivalence of Moore and Mealy Machine, Minimization of Finite Automata, Myhill-Nerode Theorem, Simulation of DFA and NFA UNIT-2 : REGULAR EXPRESSIONS & LANGUAGES ~— (2-1 A to 2-24 A) Regular Expressions, Transition Graph, Kleen’s Theorem, Finite Automata and Regular Expression. Arden’s theorem, A Method Using Arden’s Theorem, Regular and Non-Regular Languages- Closure properties of Regular Languages, Pigeonhole Principle, Pumping Lemma, Application of Pumping Lesnma, Decidability- Decision properties, Finite Automata & Regular Languages, Regular Languages & Computers, Simulation of Transition Graph & Regular language. UNIT-3 : REGULAR & NON-REGULAR GRAMMARS | (3-1 A to 3-28 A) Context Free Grammar (CFG)-Definition, Derivations, Languages, Derivation Trees and Ambiguity, Regular Grammars-Right Linear and Left Linear grammars, Conversion of FA into CFG and Regular gramanar into FA, Simplification of CFG, Normal Forms- Chomsk Form (CNF), Greibach Normal Form (GNF), Chomsky Hierarc Programming, problems based on the properties of CFG» UNIT-4 : PUSHDOWN AUTOMATA (4-1 A to 4-28 A) Nondeterministic Pushdown Autornata (NPDA)- Definition, Moves, ‘A Language Accepted by NPDA, Deterministic Pushdown Autornata (DPDA) and Deterministic Context free Languages (DCFL), Pushdown ‘Automata for Context Free Languages, Context Free grammars for Pushdown Automata, Two stack Pushdown Automata, Pumping Lemma for CFL, Closure properties of CFL, Decision Problems of CFL, Programming, problems based on the properties of CFLs UNIT-5 : TURING MACHINES (5-1 A to 5-35 A) Basic Turing Machine Model, Representation of Turing Machines Language Acceptability of Turing, Machines, Techniques for Turing, Machine Construction, Modifications of Turing Machine, Turing Machine as Computer of Integer Functions, Universal Turing machine, Linear Bounded Automata, Church’s Thesis, Re ive & Recursively merable guage, Halting Proble Post's Correspondance Problem, Introduction to Recursive Function Theory. SHORT QUESTIONS (SQ-1A to SQ-19A) S21 VER DAPERS (9014.15 TO 2018-19) (SP-1A to SP-18A) rit mal | Basic Concept and sana Automata Theory CONTENTS ) Introduction to Theory of Compatation = Automata, | Part: Alphabets, Symbol, Strings, Formal Leaguages, Computability and Complexity Part : Deterministic Finite Automaton (DFA) : Definition, Representation, Acceptability ofa String and Language ‘Non-Deterministie Finite 169A to 124A Bquivalence of DFA and AIA to I-B1A NPA. NFA with Transition, : Equivalence of NFA with and without e-Transition Parts Finite Automata with Outpat = Moore Machiae, | Mealy Machine, Equivalence of Moore and Mealy Machine 1-214 to 1-808, Part-6 + Minimization of Finite Automata, MyhillNerode ‘Theorem, Simulation of DEA and NFA J 1-804 to 1-384 | TACSITSem-4) Basie Concept & Automata Theory PART-1 | Introduction to Theory of Computation : Automata, Alphabets, ‘Symbol, Strings, Formai Languages, Computability and Complexity {2A (CSITSem-4) ‘Questions-Answers ee a 7 Long Answer Type and Medium Answer Type Questions “GouTT] What do you understand by erm alphabets and string in automata theory? Explain. Kaawer Alphabet: TP fn alphabet ea finite, non-empty st of «symbol 4 A2NBiiestion we use the £ symbol to represent an alphabet. Itcontins IiStae lower letters ofthe Latin alphabet (06...) oF digit such a5 0,1 symbols. String: 1. A.string (or word) ie a sequence of symbols from some al igi 2 Forexample given the alphabet Ee la,be) ‘Wecan build several strings using the symbols be ‘beabeabeabeabe Gaeta | Eeplain the trm language in reference 19 automate theory with example, “Answer 1. language is set of lst alphabet. 2 [fisan alphabet and <2" 5 Alanguage over Z need not include st Ae ge re cstabiched that Zea langue {Tina language over any alphabet which 8 u Iphabets or sande fringe chosen fomsome E+, where ie particular thon Lie nngage over alphabet ing wth all the symbols of = So over, we alsa know that speraot oF ‘Theory of Automata & Formal Languages LSA (CSITSem-4) ‘4 The only important constraint that can be on language is al strings shouldbe finite, ‘5 Although they can have an infinite numberof strings, but restricted to ‘strings drawn fom one fixed and faite alphabets For example: 1. English words are aso of strings over the alphabets that consist of all theletters. 2 Mhelanguage ofall stings consisting fn Os followed yn Is for some nie {,01, 0012, 00011, .). 3. The set ofstrings over O's and 1's with equal number of 0 and 1 is (e,0,10, 0014, 1010, 0101, 1100, Qee1 |] Explain arithmetic expression with example, = 1L__An arithmetic expression (AB) is valid combination of input symbols tht ar readoycompeter orang andes oanee aka result. ™ a 2 The recursive definition may be defined fo ality af an arithmetic expression. The definition includes. "| a 4 Any number (positive, negative orzo) sin AE. 1b eisin AB then ‘-laisalsoin AB, ~aisalsoin AE. 2 bora i oa: 6 Exponentiation) ample; If st of alphabets for a language ie ah = 10,1,2, 1 Via fcite entite Romempty set of vs sre epresented by ea 1-4A(CSITSem-) Basie Concept & Automata Theory infinite nonempty st of terminals. Sometimes also represented by 2 2 UNV, Generally terminals are represented by a,c. «-9, 270, yet. 14, Pisfinite set whose elements arein the forma +f. Where a and pare ‘rings, made up by combination of Vand Tie, (VT) «has at least SMe utabol frm V. Elements of Pare called preductions or production rule or rewriting rules, 4. Sis special variable/non-torminal known a starting symbol PART-2 Deterministic Finite Automaton (DPA): Definition, ‘Representation, Acceptability ofa String and Language. ‘Long Answer Type and Medium Answer Type Questions Quoi | What do you understand by Deterministic Finite Automata (DFA) and how itis represented ? oR Define Deterministic Finite Automata (DFA). Answer | 1. AFinite Automata (RA) ssid tobe deterministic iferresponding to an input symbol, there is single resultant state 1, there is only one transition. 2 Adeterministicfiniteautomstaissetoffive tuples andrepresented as Mo 1Q,2, 8.00 F) Where, Q: A non-empty finite set of states present in the finite control Gy) 1: Anon-empty finite sot of input symbols. 48: Itisatransition function that takes two arguments, astate and an input symbol, it returas a single state. The 6 is represented as QE 3g qu: Itisstarting state, one ofthe state in. F: tie non-empty set of final states/accepting states from the set belonging to @. 3. Let isthe state and‘ be the input symbol passed tothe transition function. ‘Theory of Automata & Formal Languages 1-5A(CSIT-Sem-4) wane ith cut of fanctin, which maybe ume oF 2 tat ‘he papel reprecnttone transition fnton allows ‘The satel satan isthe starting ‘GueT | Construct « DFA fr the lanuage that contains the strings ending with 0, 7 | lat M=0Q.5 8.49 bE ADPA gx inal ate= ta) P=. final state =o) Qa Fig 16, QueLT Define Deterministic Finite Automata (DFA) and design DFA that accepts the binary number whose equivalent is divisible ARTUBOITAB, Marl bys. DPA: ReferQ.15, Page I-48, Unit. Numerical ‘| Draw DFA for following over set L=lw: |w|mod 30) ste: jelmod 351) =10,1) L a 2 146A (CST Sem _Basic Concept te Automata Theory Answer Fig. 132, ‘Ques. | Design a FA which accepts set of strings containing ‘exactly four V's in every string over E = (0,1 (ARTO 201415, Marks 08 ‘Answer DFA should seeept the strings such as 1111, 0101011, 011011000, Let DFA be au la ye 9 Pela Inthis ge dead state, [Que 110;] Design a DPA for the language lw severy run of a's has either two three) ‘anower] ‘The transition diagram for language LTA(CSIT-Sem-4) ‘ey toma Formal Lanne Saag =7@) ay i Fig 1.104. Que Lil, ] Draw the finite automata which accept all the string containing both 11 and 010 a4 wubvateing “Anawer ‘The wet of strings forthe language is 110101, 100103, 101011, ‘The string willbe accepted bythe DPA if bth the sub-sequence 11 and ‘igare present. ‘oth 1 and 020 can follow each other in the language Si, the DFA eorrspanding to the given language canbe represented by the following transition diagram WTAE] Design as = a ay chasers th complement accepted by the followi og Fig 1za, LBA(CSITSem4) Keower_| . 1, We know that if Lis regular than complement of J that is Eis lao rogulae. That M=(Q, 3, 8, F) be a DFA that accepts language; then DPA that Basic Concept &e Automata Theory sccopts language Tis B= (Q,.2.6.9Q-F) 2. DFA which accepts the complement oflanguage Lis given by changing ‘every non-inal state to Final state and every final state to noafinal 8. Thus the required DPA is, Fig. 1123, Bie 11a, ] Draw DFA of following over (0,11: J. All strings with even number of 0's and even number of 1's. fi, All strings of length at most 5. “Answer &DFAshould acept the strings such as 1,00, 1010, 0101, 1111, 101101, te, The transition diagram is given by Fig. 118.1. Transition diagram. ‘i. DPA should accep the string of length 5 such as 10110, 09000, 11111, 01101, ete The transition diagram ie given by ‘ory of Automata & Formal Languages _—H®ACCSIT'Sem 7) 0.1 V0.1 Vo.) 0,1 © Fig. 1.198. Transom agri, 91 ‘GeeTTE | What do you mean by language of n DEA? nee] 1. Thea of alstrngs that rutin a sequne of sate transition fom star state to an accepting state 2 Now we ean define the language of « DPA M = (Q, ¥, 8, gy F). This language is denoted by LM), and defined by inh) = leq isin FY 4 Thelanguage of M isthe sto strings) that take the start state gt one ofthe accepting states, Us LON for some deterministic nite automata, then we say Z isa regalar language, PART-3 [Non-Deterministie Finite Automaton (NFA), | ene ‘Long Answer Type and Medium Answer Type Questions Que T15-] What do you understand ‘Automata (NFANDBA) ? How M=10.2.5.4,9 © Atom ci 5. Astvonampty fate ae ‘itil state of NFA. berate and member ut LWA(CSTTSem-4) Basie Concept & Automata Theory Tebaettniaseteadel_ci ee ae & os ig 1.51 ‘Bue 1.16, | Construct a NFA forthe language L which accept all the strings in which the third symbol from right end is always @ over Eeta,b). Trower LetNFAbe M=(Q.E,8,9,7) ‘The Sis defined asfllows WeeLAT] Design a NFA for the language L which accepts all strings over (0,1) that have at least two consecutive O's oF I's. Tower] By the analysis itis clear that NFA wil acept the strngsof the patterns like 00,11, 101000, 101100, "The transition diagram isgiven by Wie 107. ‘Theory of Automata & Formal Languages TATA CSIT Sem = ——— et Que Li. | What do you understand by language of a NFA? “Answer 1. An NFA accepts a string w if it i possible to make an ‘hoe of next state while reading the characters of, Start stateto any accepting state 2 The language of NFA Mf =(Q, 2, 8,q, FV is defined by Ua) = Wwi8a,F 26h 3 sesence and go from 3. LMM isthe set of strings w in * such that §(g,,w) contains at least ong accepting stat, PART-4 Equivalence of DFA and NFA, NFA with ¢-Transition, Equivalence of NFA with and without « Transition, — Or ee Questions Answers ‘Long Answer Type and Medium Answer Type Questions ‘@5e130,] What do you mean by NFA with ctransition? Why we need it? “haewer ss aomata is mei peri ran ing wihear ono tore eins ‘with transitions, * eee en i on without input symbas, oninput symbols, then we get NFA Pa eat re agg or ecample is av din NPA tn ng Lx aby” Jaa%) iil re Towne tha tem rt die age o Fire construct NPA for L, = Where =a and nil Os “ent NEA LABACSITSem4) Basic Concept & Automata Theory Fig. 1192, Now we combine two transition diagram .e., Fig. 1.191 and 1.19.2afoioms In this transition diagram we se transitions, to reach at state , and 9, ‘Que120.] Explain the working of c-closure, with a suitable example. “Answer | Acstringw in willbe accepted by NFA with e-tansition, if there exists atleast one path corresponding u' which start from intial state and nds at final sate 2 Since, this path may or may not contain transition. 3. If the path contains t-moves, then we need to define a function elocure i), where cate of automat, 4. The function e-closure is defined as follows {pslosure (q) = set ofall those states of automata which can be reached from ‘g/om. path labeled by, without consuming any input symbol Consider theNFA Ae @8 mo ‘eelogure g,)= aoa teclasure @,)= la) ‘Theory of Automata & Formal Languages LBA (CRIT Sem4y a) Que ial] Define NFA. What are various points of differency between NFA and DFA? Tomer | ARTU 2018-19, Marks 1p} (NBA: Refer Q 1.15, Page 1-9A, Unit. ‘sno Dra NFA 1a. [it stands for deterministic Ttstandsfornon deterministic nite automata |_—_ finite uma 2 |Ontyone transition is possible “More than one transitions possi from one state to another on same input sym ‘Transition function Sis written aa? 8:Qx QUI oe Lida (CSITSem-4) Basic Concept & Automata Theory Q= 2% i. isthe sto al subsets of a= ah 7 Ux 8p, foreach stave qin @ and each symbol ain and P=WeQlanF,+4. 2 Toobtaina DPAM=Q,2.5,dy FI which accepts the same language a8 sven NFAM, = (Q, 24/8) does, we may proced a follows ‘Step Initially Q=6 ‘Step: Futg,) nto @. (iste intial state ofthe DEA ME. ‘Step 8: Then for each state qin Q othe following ‘a add thisnew state aig. badd 1g, 0)= Use HP, 008, where the Son the right hand side isthat of NFAM,, ‘Step 4: Repeat stop tillnew states are thereto addin @, theres new ‘tate found toad in Q, the process terminates, Althe states of @ that ‘contain ccepting states of M ee ecepting states of M from one stateto another on same input symbol. [8 [fransition funetion 6 is written QE 4 4 [ln DFA, etransition is not sible. TInNFA,cransition is possible, TWSTT | conuruct DA ouitet oNFA where i deinedia los secreiea ic: 15. [DPA cannot be converted intoNPa, [NFA can be converted into DFA ‘Que 122, | Can we convert a NFA into a DFA? ‘Answer 1. Yes, we can convert a NFA into DFA, For every NFA there exists an ‘squialent DPA 2 Theemivalence ie defined ‘aniput symbols are permed of NFA on a particular inp ‘Wecan always construct finite automs eit defined interns oflanguage acceptance. Since NFA hich aero, one or more transition on ata which will simulate all moves GiB teh beNEAharraet DEA. 24, 6, Fl that nati izes the conn L. Then ‘the following conditions @ to aad) a AB cl 2 ‘4 B crtinalstatey | AB. Trevor] 8A,0)=1A,B) A,B) = IC] 8A, BI, a= 8, «) UB, UA, BI, 6)= 6, 8) 8B BD ‘icral= 1) IC, b1= 1A, B) UB, Cha) = 8B, 2) UBC, o) =A 1) al 2, b) UHC, B) = BI UAB 14,2) Asa con ABoa Boa, ‘Transition tablefor DFA, 14, BI Uh =, B) (chu = 8,0) rusythvtontatFormaltangnges —_ ISA CST Seg oo fast Frm ents _TIBA CST Sem = |= [* | roca Sea Baton ont 3 | & «| “Tne wanton efor DA er labeling uly wie | % = e |e fe ve] os “ty fo fy A EB| B 4 |e) F rain agnor a) e)F (op $|2]4 Blea #8] a 25) 4 alae ait =n Fig. 1241. feel stati nothing but interpreted asf there i input‘ on stat ‘hen there io path ort and machine wil bein dead stages SS Que 125; ] Convers thefelowinge NFA tp 4:8) (0,11,5,p, lg. into DFA where i given by ze 7 “a Lu (A,2B,C,D,8,F,0,H,1 E100 F=(B,D.EF,OHD ‘Transition diagram willbe =| ‘heaton bie fr DPA wi be ay Now let p + 138 re 3D sok Gnae ioe bogirl ott ‘ooralot TE cet win ea avn cl eon 8—8 Fig. 1.261, NPA with transition NFO ‘Transition table for eNFA TATA, coryof Automata & Formal Languages Te SS anatcsnsem4) Basi Concept &Astomata Theory Lope t ete itary wecan rite ale] etd fe sm goa afel ¢le Q 8 (lay Gh) cslaadyal quae step th tater ofNPA witht cranstion Doig, Baye=> al tte as follows : fener atti anes om i PeSiiting the state name as the set of states i, 8 (a,,01= a) sour “So transition table for NFA without transition wile as following 4 Islctate willbe eosureof ntl stateofNFA With rang, we iz Tae Fiy 3902 Soe Es Te RN lsure(@)= Id 9) Newiniial stat fr pg etal | Mn deG | Wy ad | al | without ¢-transtion) lav al « fava) | lal Rest ofthe states are a ; | fe a a ow (lew Let unsay Mp ay #4, ‘i The final tates of NFA without etranstion are all those new sta ana) 059, hich eanain ial tate of NFA with transition as member nd ‘a asa, og 234) 40,44) and (9) al re final states. SoifNPA without ctransition is M=(Q,,8,9).F) 4 Glo My Gh QD Wau Ge Qe) ayy (ye dl 1) Step2: Now wehave to decide to find out the transitions as oie 8 (lay ¢y ha) ealasure (gy 4.9) 4) = ealosure (gy, 2) 81g, @, a) U8l4 8) = eclosure(Q,, U6U4) = closure) (99) Smilarly F lay4p4),6)= eelosure (gy 4,,4,),6) lonare Gay 8) 14, 8) 48) edlonure (Ug, U8) = eelosure(g,) lava) elosure (iq, 9,,4,),€) Teenie iy Ugo) a = eelowure (UU, sedurig) = la) Fay guage) Sotransiion diagram is as follows Convert the NFA. to DFA. » QL. 9 Fig 127. 5 Lgl -reory of Automata & Formal Languae® te = a sparivon method fOr testing equ, 7 Soe Cea ith he comparvon metho eating, 10a (CIT-Sem4) Basic Concept & Automata Theory ‘wo PA given below. e wig.1273, accepted by both FAS 3 Language acer DM pelelstrng with ven number of So,both, Asare equivalent as thoy accept same at of string FaeIBE.| Compute the epslon-clowure forthe given NFA. Convert stinto DEA. iFirst we convert NFA-ctoNBA, ‘Transition tale for NFA: (ARTE BOTE7, Marks 7H seloaeof(0)= celonare of) = 1, 2 cla 2) 2) shr-33.0 Tanto abe fr NFA. anim ab for NFA [Pe wa [eon | | 1,2) (2) Let {0} as A a + fA | thet | 2) (2) {1 2)asB 7 7 ° a ‘2lasc acted ‘ans the fr NFA pa ‘TranstonaeOENFA te thadlasa edie ra aaa ia 2.4 is sey of stmt Formal Languages — 2 @ ‘Pig, 1.28.2. TSIA CSTE Sem 4 Finite Automata with Output Moore Machine, Mealy Machine, Equivalence of Moore and Mealy Machine, “Gee. ] explain Moore machine with example, Tarwer | 1. Moore machine i a inite automat in which output is associated with > Tw ouiput ymbolat a given time depends only upon the preset state 8. Mathematically, Moore machine is asi tuple machine and defined MH IQ.E3.5,8,4) whore, @:Anon-mpty faite set of tates, 2 Anon-empty finite et of input symbol ‘Anon empty Cite at of outpta Aetoition function which takes two arguments as in finite ras oe put sate ed sotherisingat reatol Mee his faneion es sige _ gl state and represented ich ape @ to 4 giving the output Nisreprsentedby tesa Mowre ‘machine sngraeame a ed by tran ena ite automata om abe aa wel as transition asic Concept & Automata Theory Lava (catTsem) Basic Concept & Ai many: 7 oun | seit 5 | =a poet [e ja MH 1G. 2 8.8.1.0) Q- lee auayt) E=(0.1) a= (0,0) Guia the inital tate Gio 80, ] Design a Moore machine which determines the residue Mod-3 for each binary string treated as binary integer. Teewer | ‘We have to design @ Moore machine which prints the remainder, when ocimal equivalent is divided by 3 ‘Therefore, = 10,1, Since, 0, and Zare possible remainder, when a dacinal number is divided by the ‘Therefore, we nood thre states in Moore machine Let Moore machine M™= (@,3,4,8,q) (01,2) gy) = 0,219,) = 1,24a,)=2 4 isnt state, ‘The transition able ie bi87.713= 1 remain when we ps 111 to M, it ends a q, and 2iq,)= 1, which is remainder 7. ‘Que 131, | Explain Mealy machine with example, “Anewer Mealy machine : 1. Thisfinite automatain which outpot is In Mealy machine, every tra Fixed output. sociated with each transition 2 ion fora particular input symbol basa ‘Mathematically, Mealy machine is asx tuple machine and defined as e numenpy tote * cmt ty ane * Aci tinh ae ont on “stn rnp eee sia aan tt ean gece oe itlrepresentedy Toa fort Corer ee machin output depends on both curren state and tt Representation ; Mealy mach Mealy machine : Sipe ine ante represented by transition table aswel ec ea ly aching hav ‘oe having lowing ranstion table with = 0th Ma (Q28,0,%04) Qe tty 2-10. A= (0,1) gy O=0 lg t=O Magy O=1 digg =O hgaO=1 quiet hgeO=1 lay l= 0 ‘The transition diagram on Wig. 131. Here the output is associated with each input ‘Que 132, | Design a Mealy machine, which prints I's complement of input bit string over alphabet = (0,11 Tnawer ‘input string is 101110 then 1's complements of 101110 will be 010001, 0 ‘wehave to design a Mealy machine which wil point output 010001 for input string 101110. Let Mt, @= ta) 20,1) given speoty of Avtomata& Formal Languages TI5ACSTT Sen, ee et qisaeninitial state ets pass input 11 to M, qq Output strings w= 100 hich 1's complement of w = O11, Guo as. | Write the procedure for converting a Moore maching ‘Mealy machine with an example, Raswer 1. Draw the tabular format of Mealy machine. 2 Putthe present states ofthe Moore machine in the present state ohana offeonstructing Mealy machine, 8 Putthe next states of More machine for corresponding present state and input combination, inthe next state columns of the construct ‘Mealy machine forthe same present states and input combination, 4 Forthe output look into the present state column and output column the Moore machine. The output for Qu (Nest state for present sae ne and input UP of the constructing Mealy machine) willbe the utp ofthat state Qj.) asa present stats in the given Moore machine Example Conversion of Moore machine to Mealy machine. Given Moore machine: 1-26 A(CSIT-Sem-4) Basie Concept & Automata Theory ‘GEETGT what ae various points fditerenebsteen Moore Naar aac? Rplan the recedare to eves 2 Mowe chine nt Mealy machine = piterence btween Moore and Mealy marine: ake | Mowe machine | Moety neshine “| Te output depends only on | Its output depends on the | present state, transition (input) and present state D | is transition function is | ts transition function is excess | excess into @ (Ginite set of | intoD(output alphabet) states), = 3 | If input string is of length n | IFinput string is oflengthn then | the outpat string i oflength | the output string is oflengthn. nel [At the different input on the | At the different input on the Same state, ts outpotissame. | same state, its output is diferent Procedure to convert a Moore machine into Mealy machine : Refer 133, Page 1-284, Unit ‘Wao Ss: | Write the procedure for converting Mealy machine to Moore machine with example. [Present state | Nestsiate | OP } [ip-0 | wei (See Ta po t “a [we po 3 Anawer | resent state tere et ate (ft sn atthe i next state ‘the output ig 1 Soin the utput wil be output is 0. Hence the the output wil be 0. ty 1 Draw-the tabular format of Mesly machine. 2 Check the next state and output columns of the given Mealy machine 3. Ifforsamenext state inthe next state eolum, the output differs inthe output column, break the state g into different numberof states, The ‘number i equal tothe numberof diferent outputs asseciated with 4. Put the state ofthe present state column in the new table. The states ‘which are broke into umber of diferent states put the broken states in the place of those stat 5. Change the next states inthe next state columns acording tothe new sot of states, 6 Put the output from the output column ofthe original Mealy machine in the new machine ‘1. Draw the tabular format of Moore machine ‘Theory of Automata & Formal Languages TTA CSIT Sem ——E—EOE———E—_—_E & Pat the present states and next states from the constructed new Meg ‘machine to the constructed Moore machine. 9. For output check the next state and output column of the ney, tonstructed Mealy machine. For th state let ¢, 28 next state in new constructed Mealy machine if output is O then for g, a8 presers statein the constructing Moore machine; the output willbe 0 10, For Moore machine the output depends oly onthe present state, ‘means from the beginning sate for e-input we can get an output. he ‘utputis 1, the new constructed Moore machine can cept zero length, string, which was not accepted by given Mealy machine 11, Tomake the Moore machine does nt accept esting, we have to add an extra state g, (new beginning state), whose state transactions willbe ential with those of the existing beginning state but output is 0 ‘Example : Conversion of Mealy machine to Moore machine, Given Mealy machine: Present state [___UP=0 wat) Nextstate] OP [Next state | OP L a % 1 % o a % 1 a r a « 1 % r [a a [0 % Z (Check the next stat and out ecole gin Nal main FaUPOirg sanen steps Tr Pei aes uate 0 Se hinghepem rasa neces ey inst Sotestatag lean tq aig ae ak tebrken aq anddy Aten fe min eee | Present state W=1 Next state Las (CStTSem-4) Basie Concept & Automata Theory From this the Moore machine willbe Present state [__ Next state up-0 | w=1| op > a | [| o . ae % % 1 a a % i Ge a | a 1 Mu | te 7 | % am | % +] For Moore machine boginning states andthe output is 1. That means ‘with null length input (no input) we are getting an output 1. Therefore, the Moore machine accepts length sequence which is not acceptable for mealy machine. To overcome this situstion we must add a new beginning state g, with same transactions as q, but output 0. By Including thenew state the Moore machine willbe ‘Moore machine : Present state | Nextatate w-0 | w-1| op >% a | ae ov] % % | oe 1] %e a «|? | [ay a a ee am | % | es a fa z «| @ | » | 2 Ta beets sen cna oe meine with coum Convert the vn Moly machine aechown Fig 138i Moore oaiee ‘Tpeoy of Automata & Formal Languates —— ot oz, Gor, @ ‘Moore machine : Refer Q. 1.29, Page 1-204, Unit-. ‘Numerical 1 Latusconvert the transition diagram into the transition Table 1963 2 For the given problem : g, is not associated with any output; gi associated with two diferent outputs Z, and Z,q, is associated wt, ‘wo different outputs Z, and Z, ‘Thus we mus splitg, intog, and, with outputs Z, and Z,, respective ands, intoq,,andg, with outputs, andZ, respectively: Table 138, may be reconstructed as Table 1.362 1.86.1 Transition table 1-904 (CS1T-Sem-4) Basic Concept & Automata Theory Fig. 1.6.1 gives the transition diagram ofthe required Moore machine. ig. 1.361, Moore machine, PART-6 Minimization of Finite Automata, Myhill-Nerode ‘Theorem, Simulation of DFA and NFA. Quostions-Answers Long Answer Type and Medium Answer Type Questions ‘Que 137. | What is the need of minimization of finite automata ? “Answer 1. Thelanguage (regular expression) produced by 8 DPA is always unique However, the reverse, ca language produces a unique DRA isnot {Hence fora given language there may be diferent DFAS. 4. By minimising we ean got aminimized DPA with minimum number of States and transitions which produces that partculr language DFA determines how computers manipulate regular languages (expressions) DFA size determines spacetime efficiency 6. Hence from DFA with minimized states needless time to manipalate regular expression, =o (ate eater | 3a, % Z, | 7a a | a —% |a | a _Table 1.62. Transition able of Moore machi | Prevent state] — Next aay = | L state Weed ‘Output 70 2, % | zy etn 4 (Que 1.37. | Define dead state, inaccessible state, equivalent state, distinguishable state and h-equivalence in case of finite automata, Fewer ] A. Dead state: Astateg,iscalled dead state if, nota final state and for all the inputs to this state the transitions confined to that state. In ‘mathematial notation, we can denote, ¢Pand 8g.) rq, ange ‘poory of Automata & For LAT ACHIT M) an mover be reached fy from, 2 Inwecesatble state The taten whic inva ate ar called in ace nat L 843-0 : £ Pig 18. vere, nde sate nd, snail tte A Bguivlent state ttn ang ate tomate eee and Sa, bts preteen ates or tah them produces non-final states for all x © 3°. It is denoted yy a4 * 4 Distinguishable state : Two states q, and g, of finite automata, fae nee rs mnie tings aa Ips) prides Ca eal ane anther prods non-fiul ‘vice versa for all x < I*. La Saisehe equivalent vo state and 9 of finite automata M are ASfuetiesr eqn Stead So th patooms net eae Tethetthom yroduecnos false frase Po ength orien ‘Que189:] Construct « minimum state automaton from the transition table given below. +( NS 5 | offal ls | aoa) | HOD pata tae eA, BOD, LZ (CIE emA) Hane Cent te Autor Tory 2 Allott stein 8, are O-equivaent A automata there are wo types of tates final tate ad Fina nates. | eked the wet of ates into to parts, aa, QI Qy =A BD. B. ROM Sel ia, BB. Gt 5. Slate belong to same nubaet are Lequivalent because they are inthe ame st fr zing length 1 6. States belong to different subsets ae I-dstinguishable aa eine state, hence it cannot be divided. Among the states Thon bLB, FAG, Hl fo (B,D, FH forinput either Gor 1 the nex tate belong to (C] which i different subset. So, 8, INC), (A,B, Gl, (B,D. F Hh Similarly ifwe divide further, 5, IICh (A, I, (G), (B, Hl, (D.F. ‘Tho llateets cannot be divided further. Hence these are the states of ° minimized DFA. to. LatCh gy (A,B) 4 (G)-> dB, lay 1D, Fla, Th atstavasvas A, hence here ial states E6209 2. Binal tate was C, hence here inal stateis (C2 1 Thetabular representation of minimized DPA s NS Ps =o meat @ * a a u % a 4 % w % Que 1A0,] State and prove Myhill-Nerode theorem. “Answer ‘The Myhill-Nerode Theorem : Lat L< 3* be language. The following three statements are equivalent Le Letts regular, tht is,» 1A) for some DFA 2. Lin the union of some ofthe equivalent clases of a rght-nvariant cuivalence relation onal strings taken fro 3” of finite index 5. Latan equivalence relation Ron be defined by tree ifand only ioral we © sae © Ls we © L Then Kinet nite index pai pmmtanontatFomallangnges —_—_MSAICSIT Seg, engage wt characterization extreme tr nea ee a ce eee a 7 jvalence relation R satisfying 2 could be shown is a refineme, 1 dep ritncans every equivalence dass of is entiely contain ee aan analog consgetanree 2 ee wien tentecres ci, Set ie sh hr Pa Se ane noms 1 eevee aig tl dates me 6 He at deel ay ae rem inno ent ft de wal = (al. So Bis well-defined, ‘set ofall tates reachable fromaoninput 7 Que 1L41.] How Myhill-Nerode theor ‘minimizing a DFA? (Ay). This follows from ‘em can be applied in = terre re dnrta nte, DFA at the left and bottom side. major and those ne ven par willbe putas The: diagonal and the upper triangular oe AGS oma tare ee ‘Tske a pair (p,q) and find “ Sows Shee or there ahha Faith yeas ig). enlace ofl thers ne L-gHA(CSITSem-4) Basic Concept & Automata Theory irie)innither Xo, then pw 0 a eat ¢ for final states also, 4c thie combination f states where hae, hey wile thestate of {he minimized mchine. ue 1A, | Minimize the automata given below =a DFA minimization using equivalence theorem : "Transition table of DPA a | @o | s@D ‘Let us apply the equivalence theorem tothe given DFA Py=le,de) (0,69) Prac, dee) a.) (9) Ke, d,0(@,8) (9) Hence, SP, ‘There are three states in the reduced DPA. The reduced DFA is as follows LBA CCSIT S69, 4) theory of Automata & Formal Languages i la ‘Transition table of DFA 26a CSIT-Sem- be Bie dae 2 othe given DFA is already minimized So minimised DFA is [en | eb ede) ‘Transition table of DFA at % a fe as % e a 5 a | aw Lat apply equivalence th Palla orem tothe given odd tetnlagh en DEA Pt Pilih By us fg ha ah soto ie the tet fl Wah a i el Wal ttre Wola ah load agl Wah eh lal iam he Seutalet tates contain al te al __ What do you understand by Deterministic Finite Automata (DFA) and how itis represented ? Refer Q.15. Design a FA which accepts set of sri ‘every string over = (01) ingscontaining exactly What do you understand by Non-Deterministic Finite ‘Automata (NFA/NDFA)? How isitrepresented ? Refer Q. 1.15. Draw DFA of following over (0,1) ‘+ Rhine with even number of Us and evensumber of) iL All strings of length at most 5- Refer Q.L.18 Define NFA. What are various NFAand DFA? Refer 121 Convert the following NFA (Ps % [DFA where 5 is given bY points of difference between ron (0,115 ps (gra) into ‘peor of Automate & Formal Languages LTA CSry, i oT ane Refer Q 125. Dre et nar nachna 1e given Mealy machine as shown in tom wechine Fie Tinto Mag, é) a Ss ‘® vu. 2, Piet ame Peer @ 198 2.8. Minimize the automata given below O--Ory 7 df a, ao ame fer Q. 142, Regular Expressions lat and Languages ~ CONTENTS \ Regular Expressions, BAA to 24h Transition Graph + Kleone's Theorem 2-58 10 2-98 2-08 to 214A Finite Automata and Regular Expression Arden's Theores, Algebraic Method Using ‘Andon's Theorem and Non-Regular 2-148 02-178 Cosore Properties Part6 + Pigeonbole Principle, Pumping mn BIA to 3-834 Temas, Application of Pumping Tammna, Deidnblty: Decision inte Astomata 204 Mt Computers ton Graph B1A(CSITSem-4) 22A(CSIT-Sem-4) ste tg, 1a & Formal Languages 23A(CSITSem) ‘Theory of Automat PART-1 IPR, and R, are two regular expressions over then lar Bxprsions, Transition Gr catenat eT sia 2 Gemeente tie 7 7 Se ing om flowed stig om fe ss unin sur uny. [en nee EURO tm pe eens hen LR" Clorare IRs cimatentingn clement fr n 0 | an Awe Tp Heo ewer T= Quin penta Breede in relar expression eee Preeedonse]| Operator Taste NP atitest Tair) [Parentheses and other grouping GeeZT | What de you mean hy regular expreasion ? [aie Reestion Write the formal OR * abe [Sequence formal recursive definition of regular expression Loves eo “Answer og, PeebVingsiml clases of stings seinen ee ileal j, Mumbers, spaces, tabs, and punctuation). ° Formal recurve dfiton of rulrexpreston: formally, a regular expression is an al nor 2 Mubstng (cr anole abo replarepresion are two regular expressions then their concater end Tresdinric ats 4 Parente tcoesion dency inal eto repetition osu Bort opdar xp eal Union vant re : ert ‘ular expressions over 5 the™ tring fom 2, Gees ] Discuss the identities for regular expression Tawer | 4, wo regular expression P and @ ar Fepresent the same sot of strings 2, The dentites for regular expressions are usefl ‘expressions i Pand @ 1 equivalent ( for simplifying rerlar ce RRS= Re ace RR (pQP = FQPY FP Qi = PQ = IP + Te (Pe Qi= PR+ QR and RP + @=RP+RO WEeBA | simplify the regular expression (r+ ower] Sir +9") Sire? Sree rir Siremeery Samir Weeks, | From the identities of renter lororer (er Kernan [ena «distributes over + frese= rer] expression prove that Regular Expressions ang 24A(CSITSem-4) (141008) +(1 + 100)(0 410810 10") =10" (0+ 105)" fi ce T* OME OID)" = +910" Tnswer i (1+ 100") +11 + 100°0 + 108K0.+ 10°)" LHS =(1 + 100°) [e+ (0+ 10°H0 + 10°) (1+ 100°K0 + 10°F" 1ie+ 00510 + 10%)" = 1040+ 10" = RAS, fi, Take 1*(011)" as P then the LHS becomes ¢ + PP* -P = on" (As P+ Qe g, Que2é. | What are transition diagramsitransition graphs > emer] Atanaton dagran/transiton graphs graph which, States and there isa succesful pat ome start tae ana se path begining at ome start state andra Thus me candeseribe the transit aston graph as cillection of fll 1. Afinite set of states, one of them desi read of which are designated as final eat iiannen Te staring wate repented by cl having an arow ad is represented by two concentric eles. The diagraneon representation iss follows Final state Toil state Fig. 261. & Apabhabet ofposileinpt eters fom which input string is forms According oe Ran, 16011)" = RLS, Intra resented by or tion diagram teint statis ented as > @ and id 25A(CSIT-Sem-1) State and prove Kleene's theorem with exam} ‘Quen. (ARTO 2016-17, Marks 10 Toawer | Kleene’s theorem states that any regular language is accepted by an FA wed conversely that any language accepted by an FA is regular. Taugttin I Part 1 of Kleene’s theorem) : Any regular language is accepted by finite automaton. HQ accepts ° HQ accepts ° HO 2O scents iad v t ig. 274. Proof: Basis atep + As shown in Fig. 2.7.1 the languages 4 c} and (ol for any Pameraih bare aceytedby an rarest cops Wearing ocho th for any language oduct oy Pa tn Ley ay ve neceptl ty Fa oe er dune ts obs xh 0 an lor any el a0 San ae tation and flea star operations the tagthet seth the bs ap woul prove the hore he Eat op woul ea Suppose that, and, are scepted by FAs M, = 2 2 = Qi Qivta,, whee gis BR ee eo Tey ta tay = Mo al 8 forall in Asa, For M.= 0 and n 20) 8 also regula Fotersection :1fL1 and if L2 are two regular languages, thet intersection Lin L2will also be regular For example erin: 0 and m0) and £2 = larbrw Bre" |n20.and m 20) ja" "| n=O and m: Oli also regu Gomlement 110) i regular language it complement L(G) wee certian Complement of a language can be found by subtracting stings ‘which are in L(G) from al posible strings. For example: L(G) = la"|n> 3) L@= 31 Pigeonhole Principle, Pumping Lemma, ranean eidanty : Dcivion Properties, Finite Automata and “Regular Language, Regular Language und Compsters “Simulation of Transition Graph and Regular Language Application of Pumping Pigeonhole principl Pigeon MratTfn pigeons ae assigned tom pigeonboles then eg tate onote contains two or mare pigeons Tan Pinhole principle sometime wel in counting method Proof Proot x pgeonholes be numbered with the numbers 1 through Feasts withthe pigean 1, each pigeon is assigned in orderto hy pigeonhole withthe same number. a. meonbele Ye, the number of pigeonhole isles than the nuber Finwone, 2m pigeons are left without having assigned a pigeouole hole willbe assigned to @ more than one pigeon 44 Thus a least one pige £ Weebte thatthe pigeonhole principe tells us nothing about sow Treat the pigeonhole that eantains two or more pigeons. {6 Teonly asserts the existence of a pigeon hole containing two or ma pigeons. 1. Toapply the prineple ne bas to decide which objects will lay thera otpigeon and which object wil pay the role of pigeonholes Geek] State and prove the pumping lemma for rest language. ‘Anewer 1 Pumping Lemma is a powerful tool for provir yuage noe Poi powerful to for proving certain langue? 2 Fee te ulin the developmen of grt to answer et ions concerning, rite automata, suchas whether the Scceptedby agiven FAs faite or infinite ether te oes ane a. * L be a regular language. Then there exist. a constant * [thet depends ob) such that for every string w in suck [olen Winto thee substrings, w = xyz, such that 2 laylen Tha oe 20 the string sal in Tete aay ida onempty stringy not oi ice pe ee too far from the bed resulting stingintha Tepeating y any number of times Kee? 4 Formal Languages DABACCHTT-Sem-) Proof: Prot an Lis regula. Then L~ Lib fr some DPA, M. Suppose Mb alate sider any string w of length n or more, Let ‘gq, where > and eatho,isaniaput jm, for i= 0, ).where ithe transition isthe rate, Ms 2 12am define state p tobe a. taneigm ot i, and oie Ue start state of M. That is fonthar reading the Best i symbols of inthe Pgeonbole principle, tient possible for them +1 ierest aa agent be dist, since there are only n diferent rates. 1 Bee tan nd to ferent integers adh O.-<) such hate New we can bres =x 08 follows 2 Bo Fae Pare eC reee 3 nal ia ple: takes stomp backtop sine tee povant sx balance 1 Fem conep mong the strings and stats are dicosed in Fir 2251 rene sa. 7 =@ Fig 2253. -emay bo empty, inthe cse that =O As, zmay bert == Sine istrict ss ha However y eannot be empty, 6 Now consider what happens ifthe automaton M receives y's for any 220. Tei» 0 then automaton M goes from the start state gy t0 P90 int x Since p, is lao p, it must be that AC goes from p, tothe scvepting state in Fig, 220.2 on input Thus, in accepts «2 Iti, then M goes from py 27,08 input string, cireles fom, *0P ‘mes om input y, and then goes to the accepting state on input = ‘Thum for any! 0, sy!2 is alo accepted by Mf that is x! 8}. ue 2.26.| Explain the application of pumping lemma. “Answer Application ofthe pumping lemma are ‘Tee pumping lemma is extremely uefa in proving that certain sts Fe non-regular The general sepsia ts application are Renee ete is areguar. etn the umber fats incon FA Step 2: Choose a string w such that [102 tw sayz, with [ye|snand |y1 >” Step 3s Find seule inkger ssh att b Thiscontadct ot assumption, Hene, Lis aot regula ‘Use pumping lemma to write NW ESS sanaccstT sem) _ Besoin GEeTHT] state romping lemme for regular Langage, hat the language L defined aefolgy ‘tow, aswer ‘Pumping lemma for Unit Proof: ey Proot ny[m en} bea language. Asume that Lis regula angus consider fllowing case 8. seqular language : Refer Q. 225, Page 2, Case 1: Assume = 0001 eZ ‘By bnping lemma if2 = ww then if we pomp some string ta pang em cach langage ical eguae. opoinay ieee ite = wl endif =2then 2 = wom Doorn wor yy 4 re oO 0 CO EL, Case2: Assume Le such that seo goguiiiiy at T By pumping emma,2 = ur e Lfr a regular language. fi =2:hen, From these cases, we Sah aaa. = es, we getz¢Z, Thus cur assumption of Z being :eeua* lence given language (= 0*1*|m #n isnot regular Quen: Prove thatthe language = 0" n is prime) is notresl ‘State Pampi oR imping Lemma for regu sets. Show that the setL = 17! is aprime! isnot regular coy ofAutonnin&Formallanguges a1 ACGSIT-Sem) ‘anewer ‘Pumping lemma : Refer Q.2:25, Page Numerical ‘Beep 1: We suppose Sotamaton acepting ti bea prime number greater than pet w =a By pumping et be written sew =sy2, with [xy | Sqand|y|>0.2.9,2 96 1 ae ofa. So.) = 0 forsomo m2 1 (and <9) sme a rept Thon[a'l= ayel + "ape — tin = p+ pm By Searing lea, se Bat [ap +pm-=pll mantel +m) snot pumping mre b Thisisn contradiction. Ths, isnot er GueEBi| Prove that fllowing are not regular languages (0"|n isperfect square). sere ee Pe atrings of form 0! 1 such that the greatest common, divisor of andj is 1. ‘Using Pumping lemma for regular Tanguages prove that language Leo" ,n>=1 isnot regular newer (o"|n is perfect square). sere Re suppose L be a regula, let p be a constant provided by ‘pumping lemma. Let w be te string of a, staring i in Lan it length i atleast p. So we can write Tv] ep andy +e and each 2» also ind. a. BRS PITED, yeonsisteofno more than p sandy ¢£,s0 there is atleast one 0 iny. 4. Now choose to be 2 and the f Melkateto prove thatthe length fy isnt perfect stars 18 srepeae have to show that it Les most strictly in between two rar Mrutive perfect squares, namely p> and (p= 1 6 Re MSS oe ng fy Mhonehe lengthen ier 4S piepirge (sh 1. "he first inequality olds since > apieap + 1>p +4: 184, Unit Lie regular Lat gb the number ofstatein the Gite resulting string 8-092. 0. For second inequality. we ‘ince q a, where Aist variable and wis string of symbols (VU). 4. The example of CO is (4 (i V, 7, P,S) where V=1E), ‘5 = (B) and production Pis given as P:B +E +B,E +E & BBB), Eid) ‘Que 32. ] Give an example of CFG for arithmetic expressions. ‘me ] 1 Anexample, = ple grammar that generates strings representing arithmelt _2presion withthe fou operators, nd numbers as opera 4 ‘expresson> -+ number Sezmeion> > number. cexpression> -» (cexpresson>) Spmenlon-» cexpresin> + f supesion» cexpresion>—cexpremion> + fasion cexpresions + cexpresion> Theonl m wor of Automat & Fos “hit ral (or poduton atestht an exes canbe rewen ced by) number. In eter werd s monies brs vad SIA (CRITSem) - eno in pretest ‘The eons eessioa> Thin rle dies an ecprenten i eras of can un nap of ho in ofrecursion nthe dtatonsf CFO. ‘remain hay edt Gueas | How derivation is defined in CFG? Taswer wT ervation ea sequence of tokens that sued to find out whether a setae o ering is generating valid statement or ac Viecen define the notations to represent a derivation 1 Fintwedefine twonottions = and 3 ray pis a production of Pin CPG and and b are srngs in Wu hen a = 08d 4 Westy thatthe production «+s appli th string ab obtain fbr ay thet ab ety dives a3b 6. Noweuppme yy oe, ae ing in, m2 Landy 2 Oy 0, 2 yt 2 Me: 1. Thenwesaythat a, “> a, 2, wesay a, tives ingrammar Ge rivesby exactly steps, we say «20. QaedA | Construct a CFG for the language Le Cu | we (a,b) “answer 1. wisa string of any combination os and EH suttauo tringonycomtoatinofa ad, tea tng which he reves of 41. Cis terminal symbol ikea 1 Cina termin ara mrror, we wlbesle tose the rection ft inthe! part Like C, abCba, abbaCabbe ike hi 5. Ttmmeans thee is some generating symbol the mi anette same terminal symbol before ander. Eee oul ambol ae alo accepledin the FEE OTS: 1 ‘That moans only Cis acepted by this anguae st: From the above prints the production rules wile le by replacing paacstTsemt) ‘5-010 pe grammar will ves hl, b.C ps aS S119. GuodR | Construct # CFE for (ort 4" on" ig 2, where 0861 “Answer pe reelarexrsin conn oftwogaris O11 #17 and Tere iets wear aking nom erie, Hen ee prt + can bein ae OLY 2 tend erinasonofOsand xwhichisrepresented YS. eine sat ineladed inthe languages 1 TREES forse proetin rue) of eer Prom ea aBle A» OLLI, CDCI, D 01 52 Aenmar willbe @ = P. Sh where TB ALB, CDI, (0,1, 5:1Sh Gueds | Find the CPG for the language Le lat" [n+miseven!. on Design CFG forthe language consisting of al strings of even lengs over [a,b]. TARTU 2015-16, Marks 0] ‘Answer Let @ be CFG for language lb" + m is even} oe V,T,P,8) i (8, Al, P= (a,b) and production Pare defined es: $->AaBb|AB, A->aaA|e, B-»dOBle Derivation Trees and Ambiguity. Questions-Answers Long Answer ’ ‘Type and Medium Answer Type Questions SSA(CMTSem-4) Dotine parse tree. What are the conditions for nga parse trvo from aC? Why parse tree con sible for CEG? bee 1 ropretntation of dervation, so itnalo known eer tre representation evn a Caton Fee von Content Free Grammar (CPG). aa Ce te a odeed te ihe hand ie odin ‘re spent oan children nde re ropreteie by the ‘roction’s right-hand conn for constructing a parse tree from 4 CFG Conditions fox ofthe re must hav label: The sie po terminal or terminal or nal i Therootofthe toe isthe start sym 5. Team othe internal vertices non-terninaleybalteV Bea production A> KX. Xy. Then for verte, abel A the hildren of that node wil be 23% ile sealed efoto parce tee iis label ina terminal sito! ‘eZornull (©) Pare ics constr only possible fo CPO. Thsisheaut te eoeee Ufa tee match with the properties of CPG. GueSH | What do you mean by lft mort derivation and ht most derivation with example ? tower | 41, Left most derivation : The derivation $ — « etvation, if the production is applied only to the {non-terminal at every stp. {mr tun considera graniar that consist reduon rules b> E+E |B * Bid. is called a eR most eft most variable Firetl take the production E>E+E>E* E+B eplace E> B +B id + E+E (Replace Bid) Sid + id +E (Replace Bid) id + id-id (Replace Bid) called a right most 2 ight most derivation : A derivation > is Right mows er ini appedonlyteiet termina avery se z He a grammar G having production. For example: Let us Bo E+E\E* Bie ost variable (nen-

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