Automata Week4

You might also like

Download as pdf
Download as pdf
You are on page 1of 10
Weer 4: Lecture Notes Requlay Expressions: + Lr a Pwite set of Symbols li, le, L > language over & cz" « Concetenation of Ly and ly bls fay |aeti yet f Uv: fe c L uu fox (1 + Kleene Closure of L uv. Oe ico + Positive Closure ie o Li -> contains £ iff L does ic Example: bis flor, ty+ fou, nj Ltrs fF toon, ron, von, 1114 Eromple : te {ro} ia . fe 10, MW, \oto, tou, Ito, mm, J + Z > om alphabet The vequlay expressions over Z and the sets Clanguages) thal they denote are dehned recursively a isa regular expression oma denotes the empty set i) & is a sequlay enpression and denotes the set {é} fi) jor each acl, ais o regular expression ond denotes the set fat wif rand 5 axe zegular expressions denoting the language Rand $ respectively , then (r+s), (18) and (¥*) ave tegular enpressions that denote the sets RUS, RS and R* wes pectively. Precedence of Regular Eapression operations °* has higher precedence than concatenation or + * concatenation has higher precedence than + Example: (to any) + 0) => o"4+0 * YT is same as 1* Notation: “Tra regular expression + Ll) > the set | lonquage denoted by 1 “Lae &, Lele E, clode fa} elves): EY ULG), Elys): LG) Ls). Enomple: Consider the la mage consisting of rings of a's and Ve containing ool + (ord) nav (are)® Enample: : : Set of all stings of OS and !> with atleast two consecutive 0's (o41)* 60 (o+d* Enample: Lloo) « foo} gL (cos* ) e fon} Enample: (1410)" . fe, U,10, 11, 110, 1.09, 1010, «+ 5 all binary stings begining usitlh 1 amd not having tuso consecutive O's (rare)! binary shing begining with 1, not having two conse cubive 0's, having 1 rumbey of 3%, Neto: tetortort-t 6 (ten)® ve * lose) (1410): all binary stings tat do net ove 4we consecutive O'S. Loa on: all binary rings ending in 0" OTN" 2": omy number of O's , followed ey ony number of 1'5, fellowed by ony number of 2's oo 11" pa": String in O12" with atleast one of each symbol > of ytor Algebraic Laws for teqular eapressions . commutativity for union FF S = 847 + associativity fox union (a 4r,)474 © H+ (te 4%y) . assotiativity for concatenation (meta) ty 2 av ltrs) + NOT commutative for concatenation Whe byt; ad ol#¥ 10, where 20, weed. wb tte TH aT (# is the identity Sor union) o Fs Tee + Ce is the identity fox concate notion) © ate the ¢ (% is the annihilator for concatenation) + Esv ed T unless 7 contains € + Distributive laws ef concatenation over union nbsp ats) = Tr, + NTs (at) ts 6 Wy 4 27% * Idempotent law rayne Laws imvelvi ng closures P Goa. 7 | 4.77? » stce + oe . ate tt UT > Ue Tate TTT pre sete atte--: cathe r* » ov fae Other Laws: + (ves)" > (vt st ys [are)”: set of all strings of a's and bs lo* uv)” : get of all sivimas of o's and bs she The 05 of sek of oll stxings of a's ofat : set of all strings of a's + Hate x (tats) % os atba ond larble one different requier enpre ssions eq. string aa is nek im Llatba) but Risin L (lasv)a) Equivalence of g- NFA and tequila expressions Theovem: Let 7 be a seqular expression. then J an £-NFA that accepts Ll). Proof: By induction on the number of operators in ¥, we will shou that there is on £- NFA 11, having one Pinal state and no transition out of this fimnol stote, st. Liv) Ll) Gase: (zero opevaters) 2 € ~ + a2 fay, AG 2: aa ® 52) ®) ra * ®) Tuduction: lone ov more operators) Assume that the theorem is true for regular expressions with jewer than t operators, i>]. Lek 7 have i operations . Case T: Ye WAT?» Tet, must have Sewer tran i operations LD E-APATS Mm ste ble bl) Ll): LLM) le ome £8, Svteh. 8.4, i49$ Moe § Oe, & vfeh, 8,40, 64254 where 8, 98,2 > Construct aw e- NFA m .(A,u8,U fa, F3, HU Su ted, $4, bd) where § 18 defined by 4p. new inital state - $l, 2: $4, ast jo. new Hnal state ~ 8laa)> 5, (a) gr 4 68, - fh}, ae % ute} ~ glaja)s bs (4.2) fo qe Br lied, ae Z,uses ~ (4h ed: Sltn e) = Jo On Of Je ~~ to: poth labeled a in ML iF either dy mad path labeled a mM er 4, ~>j2 path laleled a in TM, . Case I Tet ty mM: (8,08, £,U4,0 te}, 5, 4a, {223) where 6 is defined by ~Sla.a)+ & laa) jor q68,- 143 ond oc Zufed ~ Slg.2) 2 Etsh - 5(4,a)+ $2(%0) jor qe Bz and a6 &ufe§ 1“ ww ift 4,44 44 4h Lt) s [ny Lace LOM), ge Elma) J © CU) LLM) Case Case II re 7," LUm): tly) as 1 has Fewer than i operators. Construct Ms {8 Lfre fo}, £ofeh, 8a, Fo} é stont ; —™ . —@ © € 8 15 dehued by -gla,e* {tthe dldr e) ~glte.ad= 8 (ta) Jor FE 8- $34 ordi ce 0 1e8 yp Soe in ML ft é 10> Jo ov é * e.% yea eh Bh bab Se here — i Mr ye ME etl) and Me WAg ee Hi jer some 7170 Cie oO meandS 2%? t) Ltm)- (L td) stad & nample: ete Oa Le Tate 5 Me Os Tred _©-© Shot LY 8 He OF eet | Tye 0, Tye d® ° —®--© Sort * * oye 1 Me, eed x OOO & & eo THe Wsy%y € 25 2 -@)-OSEEOSE) ee HAT £ HOOD £ (eB ©+©

You might also like