0% found this document useful (0 votes)
39 views

Regular Language Presentation

This document discusses regular languages and their closure properties. Regular languages are those recognized by deterministic finite automata (DFAs). The three regular operations are union, concatenation, and star. It is shown that regular languages are closed under union by constructing a DFA to recognize the union of two regular languages by tracking their transitions simultaneously. Closure under concatenation and star will be proven similarly once non-deterministic finite automata are introduced.

Uploaded by

Jada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Regular Language Presentation

This document discusses regular languages and their closure properties. Regular languages are those recognized by deterministic finite automata (DFAs). The three regular operations are union, concatenation, and star. It is shown that regular languages are closed under union by constructing a DFA to recognize the union of two regular languages by tracking their transitions simultaneously. Closure under concatenation and star will be proven similarly once non-deterministic finite automata are introduced.

Uploaded by

Jada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Theory of Computation

Chapter 1

Regular Languages Part 1


Turing-Recognizable Languages

Turing-Decidable Languages

Context-Free Languages

Regular Languages
All Languages

Regular Languages
DFA = NFA = RE
Closed under ∪, ◦, ∗

CMSC 303 – Theory of Computation 1 Regular Languages Part 1


Regular Languages

I A is a regular language if there is a finite


automaton (DFA) M, that recognizes it: L(M) = A.
I Regular languages are the set of languages that are
recognizable by deterministic finite automata.

CMSC 303 – Theory of Computation 2 Regular Languages Part 1


Closure of Regular Languages
I Given two regular languages A and B, which
operations applied to A and B produce a new
regular language C ?
I There are three regular operations:
I Union: A ∪ B = {x|x ∈ A or x ∈ B}
I Concatenation: A ◦ B = {xy |x ∈ A and y ∈ B}
I Star: A∗ = {x1 · · · xk |k ≥ 0 and xi ∈ A for all 1 ≤ i ≤ k}
(k = 0 is okay → empty string, ε, which is always in A∗ )
I Regular operations are helpful and allow us to break
up complex languages into smaller, simpler pieces
and to combine them using regular operations.

CMSC 303 – Theory of Computation 3 Regular Languages Part 1


Closure of Regular Languages

I There are three regular operations:


I Union: A ∪ B = {x|x ∈ A or x ∈ B}
I Concatenation: A ◦ B = {xy |x ∈ A and y ∈ B}
I Star: A∗ = {x1 · · · xk |k ≥ 0 and xi ∈ A for all 1 ≤ i ≤ k}
(k = 0 is okay → empty string, ε, which is always in A∗ )

I Ex: S = {a, b}, T = {0, 1}, Σ = {0, 1, a, b}


I S ∪ T = {a, b, 0, 1}
I S ◦ T = {a0, a1, b0, b1}
I S ∗ = {a, b}∗ = {ε, a, b, aa, ab, ba, bb, aaa, · · · }

CMSC 303 – Theory of Computation 3 Regular Languages Part 1


Definition of Closure

, ◦, and ∗ ?
S
I Are regular languages closed under
I What is closure?
I If a class of languages is closed under an operation,
then, when that operation is performed on
languages in that class, the result is always a
language within that class of languages.
I Ex: Adding one integer to another always gives an
integer; so integers are closed under addition.
I Ex: Dividing one integer by another does not always give
an integer; so integers are not closed under division.

CMSC 303 – Theory of Computation 4 Regular Languages Part 1


Closure of Regular Languages
Ques: Are regular languages closed under taking union?

Proof Ex: 0 0,1 0 1


1
M1 : start q0 1 q1 M2 : start r0 r1
0
I M3 recognizes L(M1 ) ∪ L(M2 )
0 0
I Combines states
in all possible
combinations. M3 : start q0 /r0 q1 /r0
I Shows the 1 0
0
transitions 1
simultaneously. q0 /r1 1 q1 /r1 1
CMSC 303 – Theory of Computation 5 Regular Languages Part 1
Closure of Regular Languages, cont.
Are regular languages closed under taking union?
I Let Q1 and Q2 be sets of states for the
finite automata M1 and M2 recognizing
the languages A and B, respectively.
I States to recognize A ∪ B are Q1 × Q2 .
I Track transitions for both M1 and M2 at same time.
I Accept only if we end in state (qi , rj ) and either
qi is an accepting state in M1 or
rj is an accepting state in M2 .

CMSC 303 – Theory of Computation 6 Regular Languages Part 1


Closure of Regular Languages, cont.
Proof: Regular languages are closed under union.
Let M1 recognize A1 where M1 = (Q1 , Σ, δ1 , q1 , F1 )
and M2 recognize A2 where M2 = (Q2 , Σ, δ2 , q2 , F2 ).
Construct M3 = (Q3 , Σ, δ3 , q3 , F3 ) such that
L(M3 ) = A1 ∪ A2 (M3 recognizes A1 ∪ A2 ).
1. Q3 = Q1 × Q2 = {(r1 , r2 )|r1 ∈ Q1 , r2 ∈ Q2 }
2. Σ is the same.
3. For all (r1 , r2 ) ∈ Q3 , and all a ∈ Σ,
let δ3 ((r1 , r2 ), a) = (δ1 (r1 , a), δ2 (r2 , a)).
4. q3 = (q1 , q2 )
5. F3 = {(r1 , r2 )|r1 ∈ F1 or r2 ∈ F2 }
CMSC 303 – Theory of Computation 7 Regular Languages Part 1
Summary: Closure of Regular Languages

I We just showed that we can formally prove that


regular languages are closed under taking union.
I The same is true for applying the concatenation and
star operations, but the proofs will be easier once
we study non-deterministic finite automata (NFAs).
I We will learn about NFAs soon.

CMSC 303 – Theory of Computation 8 Regular Languages Part 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy