Loading [MathJax]/jax/output/HTML-CSS/jax.js
Close
Close Window

| About   «  2.2. Regular Grammars   ::   Contents   ::   3.1. Identifying Non-regular Languages  »

2.3. Closure Properties of Regular Languages

2.3.1. Closure Properties

Definition: A set is closed over a (binary) operation if, whenever the operation is applied to two members of the set, the result is a member of the set.

Consider L={xx is a positive even integer }
Is L is closed under the following?
addition? Yes. [How do you know?]
multiplication? Yes. [How do you know?]
subtraction? No. 610=4. [Now you know!]
division? No. 4/4=1. [Now you know!]

2.3.2. Closure of Regular Languages (1)

Consider regular languages L1 and L2. In other words, regular expressions r1 and r2 such that L1=L(r1) and L2=L(r2).

These we already know:
r1+r2 is a regular expression denoting L1L2. So, regular languages are closed under union.
r1r2 is a regular expression denoting L1L2. So, regular languages are closed under concatenation.
r1 is a regular expression denoting L1. So, regular languages are closed under star-closure.

2.3.3. Proof: Complementation

Proof: Regular languages are closed under complementation.

L1 is a regular language a DFA M such that L1=L(M).
Construct DFA M such that:
final states in M are nonfinal states in M.
nonfinal states in M are final states in M.
wL(M)wˉL closed under complementation.

Why a DFA, will an NFA work? Must be NFA with trap states.

2.3.4. Proof: Intersection

Proof: Regular languages are closed under intersection.

  1. DeMorgan’s Law: L1L2=¯¯L1¯L2

(2) L1 and L2 are regular languages DFAs M1 and M2 such that L1=L(M1) and L2=L(M2).
L1=L(M1) and L2=L(M2)
M1=(Q,Σ,δ1,q0,F1)
M2=(Q,Σ,δ2,p0,F2)

The idea is to construct a DFA so that it accepts only if both M1 and M2 accept. There is an algorithm for that.

2.3.5. More Closure Properties (1)

Regular languages are closed under these operations

Reversal: LR

Difference: L1L2

2.3.6. Right Quotient (1)

Right quotient: L1L2={xxyL1 for some yL2}.
In other words, it is prefixs of appropriate strings in L1. Example:
L1={abba}
L2={bnn is even, n>0}
L1L2={ab}

2.3.7. Right Quotient (2)

Theorem: If L1 and L2 are regular, then L1L2 is regular.

Proof: (sketch)
DFA M1=(Q,Σ,δ,q0,F) such that L1=L(M1), and DFA M2=(Q,Σ,δ,q0,F) such that L2=L(M2).
Construct DFA M from M1 and M2. This turns out to be identical to M1, except for altering the set of final states.
For each state qi of M1, if there is a wal labeled with any string L2 to a final state in M1, we mark qi as final in M.

2.3.8. Homomorphism

Homomorphism: Let Σ,Γ be alphabets. A homomorphism is a function h:ΣΓ

Homomorphism means to substitute a single letter with a string.

Example
Σ={a,b,c},Γ={0,1}
h(a)=11
h(b)=00
h(c)=0
h(bc)=h(b)h(c)=000
h(ab)=h(a)h(b)=11(h(b))=11(00)

2.3.9. Questions about Reg Languages (1)

L is a regular language.
Given L,Σ,wΣ, is wL?
Answer: Construct a FA and test if it accepts w.
Is L empty?
Example: L={anbm|n>0,m>0}{bnam|n>1,m>1} is empty.
Construct a FA. If there is a path from start state to a final state, then L is not empty.

2.3.10. Questions about Reg Languages (2)

Is L infinite?
Construct a FA. Determine if any of the vertices on a path from the start state to a final state are the base of some cycle. If so, then L is infinite.
Does L1=L2?
Construct L3=(L1¯L2)(¯L1L2). If L3=, then L1=L2.

   «  2.2. Regular Grammars   ::   Contents   ::   3.1. Identifying Non-regular Languages  »

Close Window