Title: Lecture Closure Properties for Regular Languages
1Lecture Closure Properties for Regular
Languages
CSCE 355 Foundations of Computation
- Topics
- Strings distinguishing states
- Equivalence relation
October 13, 2009
2CSCE 355 Fall 2OO9 Quiz 7
- Fill in the underlined values for s and i in the
following proof that the language L 0m1n m lt
n is not pumpable - "Given p gt 0, let s (some string depending on
p) - Clearly, s e L and lsl gt p.
- Given strings x, y, z such that xyz s, ' lxyl
lt p, - and lyl gt 0, let i (some integer gt 0).
- Then clearly, xyiz e L."
- If your answers work, then no explanation is
needed.
3Proposition 7.1. If L and M are regular
languages, then so is L ? M.
4Proposition 7.2. If L is regular, then L is
regular.
- Proof. Let A (Q,S, d, q0, F) be a DFA for L.
- Define B (Q, S, d, q0, ???).
5Proof Approaches
- Transform regular expressions
- Transform a DFA
- Transform an NFA or e-NFA.
6- Recall wR is the reversal of the string w.
- LR wR w is in L
- If L abb, abc, e What is LR ?
- Note (wR)R w
- But is (LR)R L ?
7Proposition 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 ? S, aR 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 )
8Proof of (L U M) R LR U MR
9(No Transcript)
10(No Transcript)
11Find rR where r b(a bc)
- For example,
- lets 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 cb)b.
12Proposition 7.4. If L and M are regular, then so
is L nM.
13Corollary 7.5. If L and M are regular (and over
the same alphabet), then L -M is regular.
14string homomorphisms
- A string homomorphism is a function on strings
that works by substituting a particular string
for each symbol - Definition 7.6. Let S and T be alphabets. A
string homomorphism (or just a homomorphism) from
S to T is a function h that takes any string w
? S and produces a string in T (that is, if w ?
S, then h(w) ? T) - such that h preserves concatenation, i.e., if w
and x are any strings in S, then h(wx)
h(w)h(x).
15Example
- Note h(w) h(w1w2 wn)
- h(w1)h(w2 wn)
-
- h(w1)h(w2) h(wn)
- For example, let S 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 S and T be alphabets, and let
h be a homomorphism from S to T. For any
language L ? S, we define the language h(L) ? T
as h(L) h(w) w is in L.
17Image of L under h, h(L)
- Suppose L is the language denoted by (ab)c
- Then the image of L under h (the same h)
18Inverse image of M under h, h-1(M)
- h-1(M) w ? S h(w) is in M.
19- Proposition 7.8. Let H be a homomorphism h S ?
T and let L, and M be languages over S and T
respectively. - If L is regular, then so is h(L).
- If M is regular, then so is h-1(M).
20Proof of If L is regular, then so is h(L) by
transforming reg expr.
21(No Transcript)
22(No Transcript)
23- 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(01 110()))
- (110(01 110))
- (11001 110110).
24(No Transcript)
25(No Transcript)