
<p> Chapter 4 Properties of Regular Languages 2/14/03 ==> 10/1/03</p><p>Note: text cross-references in parenthesis are for 2nd ed.</p><p>NOTE: The “prime” symbol (as in L’) means complement</p><p> Closure</p><p>If L1 and L2 are regular languages, </p><p>Then so are L1L2, L1L2, L1L2, L1’, and L*</p><p> Regular languages are closed under reversal.</p><p> Homomorphism:</p><p>Let and be two alphabets.</p><p> h: * is a homomorphism: h(ai) = u *, ai extending to strings we have:</p><p> w = a1a2...an</p><p> h(w) = h(a1)h(a2)...h(an)</p><p> Homomorphic image:</p><p>If L is a language on , then homomorphic image of L is</p><p> h(L) = { h(w) : w L }, h = homomorphism</p><p> Example 4.2, 4.3</p><p> Theorem 4.3</p><p>Let h be a homomorphism.</p><p>If L is a regular language, then its homomorphic image h(L) is also regular.</p><p>==> Regular languages are closed under homomorphisms.</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 1 Definition 4.2 Right Quotient</p><p>Let L1 and L2 be languages on same .</p><p>Then right quotient is defined as </p><p>L1/L2 = {x: xy L1, for some y L2}</p><p>==> “Set of all strings in L1 that have a suffix in L2 with this suffix removed”</p><p> n m Example: L1 = {a b : n 1, m 0} {ba} m L2 = {b : m 1} n m L1/L2 = {a b : n 1, m 0}</p><p> aaabbbbb L1 aaabb L1/L2 bbb is suffix</p><p>==> aaab L1/L2</p><p>==> aaa L1/L2 Theorem 4.4</p><p>If L1 and L2 are regular languages over , then L1/L2 is also regular</p><p>==> Family of regular languages is closed under right quotient with a regular language.</p><p>See examples 4.4 and 4.5</p><p> Elementary questions about regular languages (4.2) - or - Regular questions about elementary languages!</p><p> Standard representation</p><p>A regular language is given in standard representation (SR) if, and only if, it is described by:</p><p>(1) Finite automaton, (2) Regular expression, or (3) Regular grammar</p><p>Informal descriptions and set notation are excluded.</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 2 Theorem 4.5</p><p>Given a standard representation of a regular language L on and any w *, then an algorithm determining whether or not w L.</p><p>==> Construct DFA for L and test w.</p><p>Theorem 4.6</p><p> an algorithm for determining whether a regular language in standard representation form is empty, finite, or infinite.</p><p>==> Construct DFA. If simple path (no edge or vertex repeated) from q0 ==> qf then non-empty.</p><p>Question: Does any walk from q0 ==> qf implies a simple path also? If q0 ==> qf path passes through vertex which is base of cycle then infinite</p><p>Theorem 4.7</p><p>Given two regular languages L1 and L2 in standard representation form, an algorithm to determine if/(if not) L1 = L2.</p><p>==> Define regular language: L3 = (L1 L2’) (L1’ L2) = L1 L2 ... “Exclusive OR” </p><p>Since L3 is a regular language, DFA M accepting L3.</p><p>Use Theorem 4.6 to see if L3 is empty.</p><p>L3 = if, and only if, L1 = L2. (Why?)</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 3 Identifying Non-Regular Languages (Sect 4.3)</p><p> Pigeon hole principle (a target of denial)</p><p> Put n objects into m boxes.</p><p>If n > m, then at least one box must have more than one item in it.</p><p> Can prove L is non-regular language by assuming contrary ==> denying pigeon hole property.</p><p>Example 4.6 Prove L = {anbn : n 0} is non-regular</p><p>Assume contrary: (Assume L is regular language)</p><p>==> DFA, M = (Q, {a,b}, , q0, F)</p><p> i Consider *(q0, a ) i > 0</p><p>==> infinite number of is and finite number of states.</p><p> n m ==> q Q and some n, m (n m) such that *(q0, a ) = q = *(q0, a ) due to pigeon hole principle. ... q would be the first state to repeat for a sufficiently long string of a’s. But since, by assumption (contrary),</p><p> n n n M accepts a b , we have *(q, b ) = qf F</p><p>[Uses: *(q,w1w2) = *(*(q,w1),w2)]</p><p>But also,</p><p> m n m n n *(q0,a b ) = *(*(q0,a ),b ) = *(q, b ) = qf F</p><p>Contradiction since m n and ambn should be rejected. QED</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 4 “Pumping Lemma” (another object of denial)</p><p> Application of pigeon hole principle</p><p>Theorem 4.8</p><p>Let L be an infinite regular language.</p><p>Then, some integer m > 0 such that w L and |w| m,</p><p> we can decompose w as </p><p> w = xyz </p><p> with |xy| m</p><p>|y| 1</p><p> i such that wi = xy z, i 0 (pumped up w) is also in L.</p><p>Proof: L is regular language ==> DFA M with states q0, q1, q2, ..., qn , (n+1 states)</p><p>Let w L such that |w| m = n + 1</p><p>M goes through the following sequence of states as it processes w:</p><p> q0, qi, qj, ..., qf</p><p>Since |w| n + 1,</p><p>Number of states in walk = |w| + 1 > n + 1 See example below ... Number of states in walk > number of states</p><p>==> at least 1 repeated state (pigeon hole principle)</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 5 Example: w = abc</p><p> number of states = |w|+1 = 3+1. = 4. Sequence looks like:</p><p> q0 , qi , qj , ..., qr , ..., qr , ..., qf ------x y</p><p> substrings x, y, z such that</p><p>*(q0 , x) = qr</p><p>*(qr , y) = qr</p><p>*(qr ,z) = qf</p><p> with |xy| n + 1 and |y| 1 Note: Reason for |xy| n + 1 =m: If qr is the first occurrence of a vertex which will be also the next repeated one, st Then it (1 qr) will occur no later than nth move since there are only n+1 states in going from q0 to qf . Since there can be no repetitions of states in the “y loop or segment”, and we need at least 1 move to complete the loop, it follows that number of moves in xy = |xy| number of states = n+1 = m. Remember the example above relating number of moves (string length) with number of states.</p><p> nd Thus *(q0 , xz) = qf skip the loops, and |xy| n + 1 = m … see p. 116 (120, 2 ed)</p><p> i and *(q0 , xy z) = qf i 0 any number of loops will work</p><p> xyiz = pumped string is accepted QED</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 6 Observation: - If assuming a language L is a regular language (accepted by DFA)</p><p>And pumping lemma is denied in the process, then L is not a regular language (contradiction)</p><p>- We are guaranteed existence of m as well as the decomposition xyz</p><p>But</p><p>We do not know what they are. - Cannot claim contradiction just because the pumping lemma is violated for some specific value of m or specific xyz … see middle p. 117 (bottom p. 120).</p><p>- But: Pumping Lemma holds w L, |w| m and all i.</p><p>Thus If Pumping Lemma is violated for even one w or i, then L is not a regular language.</p><p> Game Theory Approach to Applying Pumping Lemma</p><p>1. Opponent picks m</p><p>2. Given m, we pick w L such that |w| m (totally free to choose)</p><p>3. Opponent chooses decomposition xyz with |xy| m and |y| 1. Opponent makes optimal choice.)</p><p> i 4. We try to pick some particular i such that the pumped string wi = xy z is not in L. … make no assumptions on what partition is – must guarantee violation for all possible partitions …</p><p>If we can do this, we win.</p><p>Else inconclusive (opponent wins).</p><p>CS373 Fall 2003 Chapter 4 N. Guydosh Page 7</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-