0, let s = (some string depending on p) Clearly, s ε L and lsl >= p. Given strings x, y, z such that xyz = s, ' lxyl <= p, and lyl > 0, let i = (some integer >= 0). Then clearly, xyiz ε L." [If your answers work, then no explanation is needed.]"> 0, let s = (some string depending on p) Clearly, s ε L and lsl >= p. Given strings x, y, z such that xyz = s, ' lxyl <= p, and lyl > 0, let i = (some integer >= 0). Then clearly, xyiz ε L." [If your answers work, then no explanation is needed.]">
Download presentation
Presentation is loading. Please wait.
Published byAfonso Caldeira Barreiro Modified over 6 years ago
1
Lecture Closure Properties for Regular Languages
CSCE 355 Foundations of Computation Lecture Closure Properties for Regular Languages Topics: Strings distinguishing states Equivalence relation October 13, 2009
2
CSCE 355 Fall 2OO9 Quiz 7 Fill in the underlined values for s and i in the following proof that the language L = {0m1n : m < n} is not pumpable: "Given p > 0, let s = (some string depending on p) Clearly, s ε L and lsl >= p. Given strings x, y, z such that xyz = s, ' lxyl <= p, and lyl > 0, let i = (some integer >= 0). Then clearly, xyiz ε L." [If your answers work, then no explanation is needed.]
3
Proposition 7.1. If L and M are regular languages, then so is L ∪ M.
4
Proposition 7.2. If L is regular, then L’ is regular.
Proof. Let A = (Q,Σ, δ, q0, F) be a DFA for L. Define B = (Q, Σ, δ, q0, ???).
5
Proof Approaches Transform regular expressions Transform a DFA
Transform an NFA or ε-NFA.
6
Recall wR is the reversal of the string w.
LR := {wR | w is in L} If L = {abb, abc, ε} What is LR ? Note (wR)R = w But is (LR)R = L ?
7
Proposition 7.3. If L is regular, then so is LR.
Proof based on transforming any regular expression for L to one for LR. Define a recursive construction Basis steps ∅ R =∅, {}R ={}, For any symbol a ∈ Σ, {a}R = {a}, Recursive steps: for any two languages L and M, (L U M) R = LR U MR , (L M) R = MR U LR , (L*) R = (LR )*
8
Proof of (L U M) R = LR U MR
11
Find rR where r = b(a + bc*)*
For example, let’s use the rules to find rR where r = b(a + bc*)*. (b(a + bc*)*) R = ((a + bc*)*) RbR = ((a + bc*) R)*b = (aR + (bc*) R)*b = (a + (c*) RbR)*b = (a + (cR)*b)*b = (a + c*b)*b.
12
Proposition 7.4. If L and M are regular, then so is L ∩M.
13
Corollary 7.5. If L and M are regular (and over the same alphabet), then L −M is regular.
14
string homomorphisms A string homomorphism is a function on strings that works by substituting a particular string for each symbol Definition 7.6. Let Σ and T be alphabets. A string homomorphism (or just a homomorphism) from Σ* to T* is a function h that takes any string w ∈ Σ* and produces a string in T* (that is, if w ∈ Σ*, then h(w) ∈ T*) such that h preserves concatenation, i.e., if w and x are any strings in Σ*, then h(wx) = h(w)h(x).
15
Example Note h(w) = h(w1w2 · · ·wn) = h(w1)h(w2 · · ·wn) = · · ·
= h(w1)h(w2) · · · h(wn) For example, let Σ = {a, b, c} and let T = {0, 1}. Define the homomorphism h by h(a) = 01, h(b) = 110, and h(c) = Then h(abaccab) =
16
Definition 7.7. Let Σ and T be alphabets, and let h be a homomorphism from Σ* to T*. For any language L ⊆ Σ*, we define the language h(L) ⊆ T* as h(L) = {h(w) | w is in L}.
17
Image of L under h, h(L) Suppose L is the language denoted by (a+b)*c Then the image of L under h (the same h)
18
Inverse image of M under h, h-1(M)
h−1(M) = {w ∈ Σ* | h(w) is in M}.
19
Proposition 7.8. Let H be a homomorphism h: Σ T and let L, and M be languages over Σ and T respectively. If L is regular, then so is h(L). If M is regular, then so is h−1(M).
20
Proof of “If L is regular, then so is h(L)” by transforming reg expr.
23
h(b(a + bc. ). ) = [h(b(a + bc. ))]. = (h(b)h(a + bc. ))
h(b(a + bc*)*) = [h(b(a + bc*))]* = (h(b)h(a + bc*))* = (h(b)(h(a) + h(bc*))* = (h(b)(h(a) + h(b)h(c*)))* = (h(b)(h(a) + h(b)h(c)*))* = (110( (*)))* = (110( ))* = ( )*.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.