0% found this document useful (0 votes)
3 views31 pages

Flat 1

The document discusses formal languages and automata theory, detailing various types of formal languages such as regular, context-free, context-sensitive, and recursively enumerable languages. It explains the concept of automata as abstract machines that perform computations through a series of states and outlines applications in fields like string matching algorithms, network protocols, and text editing. Additionally, it covers the definitions and properties of strings, substrings, and finite automata, including their structure and transition functions.

Uploaded by

s220369
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)
3 views31 pages

Flat 1

The document discusses formal languages and automata theory, detailing various types of formal languages such as regular, context-free, context-sensitive, and recursively enumerable languages. It explains the concept of automata as abstract machines that perform computations through a series of states and outlines applications in fields like string matching algorithms, network protocols, and text editing. Additionally, it covers the definitions and properties of strings, substrings, and finite automata, including their structure and transition functions.

Uploaded by

s220369
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/ 31
ros > Antroduction; plat /Toc: Formal danguages & Automata Theory Applications y © derical Analysis © String Matching Algorithms @® Network protocols © Compilation ob vegulay expressions © Analysis 6 boolean program © To design Text editors ® design Spell Checkevs © sequential civeuity design —~? Fiorrnal danguage;- The Language which fas _ proper get 06 Alphabet , Grammer mules and @ model to Yecognize is called &S Formal danguage: —_ Automata gt fs a model / abstract mode! Oo machine Kat Perform computation on input by moving trough Q Series of states => Automations Denotes — prctymatic Preces carrying out Re proce cHon of Process FLATS Deals sith Logic of Computation Sith respect tp simple machine - Formal donguages 7 FL divides intp 4 categories © Regular denguage —» Jt fas Regular Grammer © conte Free danguage —y Context Free Grammev ® context sensitive danguage —r Context Sensitive “Grawme, © Recursive Enummerable danguage = ReGuammer/ Un vestyicted Grammer — The eet % vules is “Grammer” Formal danguageS ; — |S ee CEL Cseu REL danguoge (RL) | Lod | Grammer—7 “Regular 2 ee, CS& REG [ vevestyiced Grammer (RE) Gvam mex l J L Automata—y Finite push down dincey Bound Turi ng Automata Automata Avtomata Machine CFA) CPdad CLBaD on 7 Neal Typc-o@ ? Turwing Machine CSG Type-' * Jincor Bound Autemeta CFG Type» Pesh Down Automata R@/ Type 3 7 Finite putemeta [Fink te State Mac [RL CcrlLCcse erel| = © Alphabets - The non-empty finite set Of symbols 4s known = o> Alphabets and 4 js clenoted by the Syerbel ex O Binary danguage Y =fo1§ Decimal danguage Sys dona... ah english u M+ Save. 29/ Sab,..24 ® string the Sequence of symbols & choosen from the alphabets 3, ts known as String and it fs denoted by Lei Exe ST 240,14 5 Ws oto , W,= lot, Wa= lolotoo ., Be $48,245 l= Flat » Wee FTIT, Wy: x¥2K- Ds $032,995 Ws 934, We onsy, Ws Bus => dength o o stingy 46 LW fs Gay string defined over the alphabet Sy then Number 2b symbols involved in 4Be string iS known as dengin 06 @ String. Denoted as {id} ext “gt: olol Wa = R@orer Wo = 489623 IWley \an Jes Irayl = 6 i ‘ lengtR 10' fs Q 8B cong String ab a string Raving eng ots Empty >, - (ov) A string ua ith Bere occurrences of Symbols 5, ) called Empty string. — Dereted by epsilon E NeteiO9§ Nfs any string then IW20 ( fLl=0 @) Liles, Sb hy e —> Iulo ; Shing ‘sie l te Contotencton ane O10-€= oto ® €-€=€ @ det Uv are 2 strings and lah IV) ave feng Hf > Sub strings Jeg U,0 be the StgS Chine over 5} then u ts said +o be Substring % TL thet! Mioretysaets a: wn wn oe Ws: cse Yror vy u=e, 5, €, c5, sc, eA x x eS CeCe eee Wee plat UFE, FL L,A,T, FL, LA, AT, FLA, LAT, FLAT Noter © every String is a substring for Ttselg © Empty String Cé) is g Substring fen 36 uu is Bub string wo! ep en fvegthing fel e tity Types of substrings © Trivial Substrings / 4esor per substvings © Non- Trivial substrings / Proper Substrings Trivial Substring -- IE 'W'ts any string defined over Z then the subst, ‘Wa! ttselg and empty string ‘e' ore called as Tula Substrings - Ts: fe,ny Non- Trivial Substring + 96 YL! is any stsing defined over Sj Ren every - 1 ' substrings o6 OW other than Wi itself and empty Steing |! is known as Non- Trivial Substyings . We cse Trivial substrings = €,cse Non = Trivial = OS €,¢8,5€ exe Wecse W = ElaAT l-oye - '- T ia a Lei Seared 4 Ph Cn ey SBE er 4225 FL LAL AT~ & Ler 3 Csse -2 123 =) ELA LAT — 2b 32> cseé -!loa@ peut) flare t-T — Notes 45 IW! bs any string defined over a S and bay Cayuming all the symbols are distinct ) — Number of oubstvings = Nt) 1, 2 sayy —> Nawmber OF Trivial substyings cn —> Number 06 non-Trivel substrings = Sin-t Pref ine The sequence of feading bY Starting symbole ere W = Ccse Prebix ;- CCS, 8€, cse, € Sugbxt The Sequence o¢ Ending or tailing symbols Subbxe e, cs€, &, S€ Note; O Trivial substrings o% W acts as both prepixeS and Subbines. © $60 IWien then NO + oF prefines- Nig, 06 Sub bixes = H+] & dan 4a9¢ + Co . ergea4) llection o% strings ckfined over SF Exe Ss $0,714 beg 00,0) , 10, 1 Le E We Sor4X/IW 3G DS 000,001, 010, oF 1005 for, Hay" nn 2 PO 1° / =o) Lif n2i§ Or jot, oF Or, pow , door . nan Lz Zo! .0 [roy = 010, 0ol!,60, oooit) 060,. -- nom Le go / meny = > ON, 601, v0, DooU, .. on L- so! [ meny = > Ol, ONT, BIN, OWT power ob _ alphabets $6 SS ts any alphabet then x is Re set strings over the os alphabet Praver Bb LengtR exactly I! K Bo = EWC $0,14*/ tate rey Xr Se g0,1§ Swe (leo) 5 € =o \ = Clz1) 5 0,1) - 2! Ss sve CDe2) 5 00,01, 10,18 = 2” Za ° wie = (2-3) =) 000,0001-- = * 7 4, Stooc cleu) =) 0000, ---- - > °° wpe Bo = (hes) = 00000; 7 > nit = 2 ss (L209 oH tt 2? * => fbleen closure @ s* . '4=S po sitive closure ° \ SWosiuso atu... on . Us = Swe s*/iwstz04 @ Bt sus usto.. a at > HA US’ = § Wee*/sizr4 ict fe = £ ©, 0,1, 00, 01) 10,11, 000,- +s. = - § ss. 29,1, 00, 0,10, W,000,---.-2°° Note: © 3* is called as Universal Language @ stcat ® st. xt vgey ® a. s ~ fey @ 5 ust=. s* is any fanguage defined Over 4g theo \ ia sls © alphabet = oys a Put of aad exe == fo, 14 z.€ « s*_ oe ; =F os'ucty oe Pan o,! + a af fee x: 00, Ol,1o,u 4 = 0 > _y set ® Collection of = styings Set | —_- | Emptyset Non-sEmpty set Cset with o IN ts, eee elements) Finite set — Inginite set Célements ave Célement ave Countable) Uncountable > AN Countable Uncountable set set = danguage * Set of Strings Language Empty Non - Empty dang wage danguage Cdanguoge with yo © elements) Finite Language Anfinite Longuage — emphy danguage The danguage which — doesn't Contain even a empty string 'e! is called as el L is empty danguage ES ILl=0 = OLeSy — > Non Empty onguage + a the danguage "L" which contains atleast 4 Sting is called as Non-empty — danguage. Lis non-empty [Ll #0 fur Leso1y sy feler L=-$ eG = [Llet P= Sor/ienzios = [Us9 > Finite Le fo"/n2z!¥ = led i Ankinite LsfoPol/mra 4 lao aay Jeinite danguage & The fanguage contain Ginite no of 8tyings Rey Length of each and every String fs ginite. és as finite danguage: known es L=fot,104 L= $01, 00,100, 101, 10104 L=$5°/netoo§ EF =$0,t4 = fhengthh-w to 6 2 stil ve {E™ hn zh Us! * ist ~ Sn finite dan guage z the danguage ushich Contain gnginite no ot abig where Re Length of each and Cvny String ts finite is called Sn finite donquase ee Le fo" /ne ih Le $0" /men Le EO" mony —7 Empty dan guage 5 Gan beg RL cee > Inbinite~ PL 7 ; NRL) — ~~ Finite aed Shi => pL eCsk © . a ee crl Ncpl esl cSt Nest Pel : Per weet ball pote Biz fo,1h power set CE) =§ €, $04, {14 $0,144 24 Ez Alphabet Lo py x“ E = set ol all Strings defined over & * ra = PE, 0,1, OD, O's (O, 1, 000, Ia =~: & & No. of strings Ts un Countable * powerset CE™ ) = Oncountable set * No.of elements in power sett @ Oncountable —_ rh Countable Countable By Countable (RL) YY Countable _s finite Automata] Finite stete machine | Esa Autmotar gt is a abstract mode! ob @ machine Rat Pevborm Computation ¢ on input by ™oving through a sevies °6 States fs Applications O devical’ Analusi nalysis — Tokenizotion Ccan be acheived by © text editing ween Fa) @® Computer Net Working i You axe faving a Ty ie actor" a\ Switch on se) ob Conditien Switch o7b On condition 40 order 40 ob b and on, we Should perform some actos “7 Finite Automate ™ odelling és an oo/ ; O66 Switch push Ge CHE and on diggerent push States Transitions arrow moxk Indicates initial state Finite state machine States ¢ States ave vepresented by Circles ® @ © @ Start state Final state 6) One (of) mobe FS Jalso called Acceptirg stole | @O, A-—- ree circles Trasitions Move byvom one state to other state @——@ SEF fov, bo ead Pado L 4 , empty e 0 r —o- © keyword ince Lbvery SHU Contino ton 1S Reve and poy . Qa vd. @uet while Mjuwerd Final stag O-@-e@—_@ Gad 5G) => : - 56 8 word fs fin bial stote then ft tsa keyword in ¢ Bibraryy by devica| analysis. ub Schaby a ae a det us Consider =4 Stotes > a, ,,%,, 0 > Ve > Anitial state Ni? Final stot DO —*> Dead state @ / Snput YB a 7 a o~\ ae ‘ a7 ~ By Ya; a. © baab @ obab @ ab © aabba > Abter veadling the string ih it is Final state ten tt 4S accepted by FA. —? Block clingyam Ok FA —? FSM Consists +hyee parts Oo Anput tape @ Tape Header ® finite contro doput -tapey Snput tape is altvided trto cells and each cel fas capabilt +o Store one symbol faa id at Any point of +Hme. — The Input tape Contains only ape jalel] J..- ATT. one Input Stott > Tape Headey (1) — Tape Headley yeads the input symbol from +e. ang tope Starting gvom the Left most end. —? Af any point of time the Tope Header Point + Only one input symbol. —> Abter faking input sym bol prom input tape The Tape Header moves to exactly one cell A Beadey towarels vight Side. > The movement of TH tn FA jis unidévectivna | Clegt to Right) 7 Because of 4g 75 untelirection, the FA can he used for Scanning ob the strings. , — Finite Control 7 Finite contyo] Manages the te whether transitiong ob FA is Moving tp right input signal ov not, > dist Sicle of tor taking this : 5 Thete are ali taken cove & system state oy FA — 4n FA, At Yejular intervals the TH veads énput and one Sym bo) ‘hen enters a new state. -> The neo state depen ds only on +e current and +k symbol just read, 5 pecptanee by AY det We be any String defined owe SS > covesponding +o LI, 9b Reve existed transition patf which starts at initial state and ends %n any one ob the Final state. > ‘the sting Wig accepted by FA[ sm => the set ob all Sting which ave accepted by pa is called as danguage 06 FA. Lera) = fla / SC r= FSy > Block cliagvam “I fe °b String ( £09 BD Gait tere © B gl itt “ \e oe + | Finite contcol Complete An] CHeart of FA) the stote 6 FA A a NOW State moves to b (tape Headley ) ¢ b Formal Definition of — Finite Automata — A Finite state Automation M és a bive TYPE Coutn, variable M= £$Q,216,% F4 where Quis a finite set of states = is a Gioite set 06 input Symbols / alphabet % tn Q@ is the 4nftial state 06 M FE @ is the set of Final states & is mapping &yorn Q@xX= into @ CTrans tion bunction) in $3 Qxs—> O— set ob 5 tates J Set of states * OL Bi oY XO ag Cov) 80%, o=q,7 from this exe Alphabet 2 QOxa— > @ dob Jd Current Cunent het Stoti of °6 FA State 0 Fa —7? Repreentetion ob FA © Transition Diagyam © Tronsition Table 4 Frasition Program > Transition Diagram ( To) boy a FA is MEGS bay Fg is a graph QS follows O Fev each state tm ® there is a node mapping €Ca,a)=p, then TD must have an Axe byom node @ 4 +here is te Node Pp labeled unth a, a @ there. must be aN arrow into start state Vo, Label uth yeapect to accepting states CFinal states degined ave maked by double céveles. as start. ® Nodes eur OT, 0 M=$Q,5,8,%F4 Qe FMVs 2%$ ST =Sab4 »Vo= 244 Gs $ Cae) <4, r= tat GC 4, bd: a, 8Ca,,bd=%, DY $04, ,ad=a, %CQ, A) =% CA, \by=a, EA — > Transition Table — TT is a convental +eblilay yepresentation ok a funchon( Tr) ike & that takes eae arguments d yeturns a@ value _Next State CS taput symby, an © Row of a table corresponds +o states in Q ® Columns 06 a table Corresponds +o jn put Symbol @ the entry for the vow wrt State a any the column with. ve spect to input a fs Be State $C4,a) Ti: 4% or @&® A ho Van ta R= Fav oV.4 Z= 8a,by, vot FS, 4 5. 8Cq,.ar2 a, $C 465, bd =%, FC ouad-%, $04.0) =%, SCO, byw, % C% bd =a, genet O Mr EQ@yE,%, 8 FY Qa EHV, 41h Yr ivo4 , E=$a.4 , F-Saby Gi SCY 0, 9) = Ve $CM, 00-4, $C) bd = % 5a, b= av, $C% 0) = Vy GCU, bd = WL @) Construct the Tp ® constvuct the Tr ¢) prepare a List of strings accepted by FA (LCFA)) aan wy [w |e) Language 6 FAL © abobb © ab bv ® abab finite Automata A _ formato finite Autornata Flaite Aw" ith output wotthout output . / aN ot ‘\ . ~ -peferministic — MOE pel deterministic Non- Deferenint 7 ‘ conte Autornad@ finite- Avtomato Machine Machine finite CFA) Gries) —> Deterministic Finite Automata C DFA): The mathematical model 66 DFA M fs define as 5 tuple variable Cum tuple) M= $Q,2,8,4,, £4 where Q@ba Ginite set of states = IS & finite se€ of input symbols / alphabets Ve fs Jnttal state Finite set of Emil states FEO transition tunction * Bi QxXE-5 Q Note 7 By cle fault the FA fs DFA —7 DFA has vaigee Sia! state —> DFA n 7 > Do can fave any umber of final states No ob Fs 6 Dea js 0 oy For more 2 — the FA shoule be Determi nig tic @— Hg He ; _-> DFA is complete system which vesponses for each and every imput symbol. nence we need +p dlehine the tyansition for each and every symbol! yom gach and wey gtote- Ss 40 DFA after veoling Symbol from a stote DEA exactly moves to only ome stote as Newt state SS 0 = @--@ ora @ QB v © 1 / DFA @ @H4 (aJ/ pra Cgatiint wertinal © AG, ~ DEA ond alse complete DEA ee NO: 06 transition: NCE)an(g L286 Hanson: NCE antsy > Zeho14 | =F” fs river fongucge clebined over ¢ £2 S€,0,1, 01, 10, 00,11, ---. ye Osi =O 35". con® E= Soh | T* = (10,00, 000, o000,........ § = oF S-y = s*. Se,tume, tir, oo... One tl r= $0,th a) £8 ec FeO, 00,10, 01,01, -..-~ = cote co” 2 2%. se,or, 0101, orotor, --- § — stote Notes © db FA accepts the empty string “e" 2s gritial state is ginal state ew L- $e4 FA t § $C4%.,€) = Ve © Unreachable stoter the state «which cant be veached from +he initial state ts Onveachable, state. ad —@-® L= 6 ph Oh No strings accepleel US =a, ety o eB 6 QO-@ a,b L-é Go..---b, aa wihoud Final State accepts = Empty — Language m ut F @ FA wire a an Qb ) 8 838 a L=6 iB ly Unveachas, lee 5% @® fA in aohich all the binal states. ave such FA accept emp Language 6 Q. = “es © cs © =< ° Q a,b el op (a © The FA in ashich all the states are final states fe, the — Universa] Language. 5 = fa,by . | 01 . . : Cory. 2X Cans “ a Dead state: the tates bom cob rep on called dead state — 6) ° © 0,1 1 Go, Dead state Cannot comme hacle is ote + x AFA can have atmest one dead state pou 0 construct DFA for the language clined over = fohon pf WE Cor* Seo frase even number 6 Start, with o and ends with 14 L2$ 01, O01, Oll, OOC!, BOI, O1ol, ON. J * RL = O Cos) | t (Not DFA) becouse tt fs a non-d gy ZX! : I ' eterministic stot. oO D construct DFA for the Language defined over ¢ Ot-$ wee atb)* / ese sting stor with abs Of Wwe Carb)* / evey stving strat wit® and fends — usitp a4 ® i-gueCarb™ /tut

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