0% found this document useful (0 votes)
32 views15 pages

Chapter 4

The document discusses operations on regular languages including concatenation, union, Kleene closure, intersection, complementation, and reducing the number of states in a finite automaton. Concatenation combines languages by appending strings. Union combines languages. Kleene closure repeats strings zero or more times. Intersection finds strings that are in both languages. Complementation switches accepting and non-accepting states. Reduction of states uses indistinguishability to minimize an automaton.

Uploaded by

Elias Khoury
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)
32 views15 pages

Chapter 4

The document discusses operations on regular languages including concatenation, union, Kleene closure, intersection, complementation, and reducing the number of states in a finite automaton. Concatenation combines languages by appending strings. Union combines languages. Kleene closure repeats strings zero or more times. Intersection finds strings that are in both languages. Complementation switches accepting and non-accepting states. Reduction of states uses indistinguishability to minimize an automaton.

Uploaded by

Elias Khoury
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/ 15

Chapter 4:

Operations On regular languages

1
Closure properties
• Concatenation (r = r1.r2)

• Union (r = r1 + r2)

• Kleene closure (r = r1*)

• Intersection

• Complementation

• Reduction of the number of states in Finite Automata


2
Concatenation
Let A1 and A2 be two automata. The associated language is composed of strings

resulting from concatenating a string from A1 to a string from A2 . The concatenation

A1. A2 is realized as follows :

3
A = A1.A2

with:

4
Concatenation
Add an empty transition from every final sates of A1 to the start state of A2

The start state will be the start state of A1 and the set final states will be the set of

final states of A2

5
Union
Let A1 and A2 be two nfa. The nfa obtained by the union A = A1  A2 is as

follows :

6
Union
The nfa obtained by the union A = A1  A2 is as follows :

Add a new state as a start state of A , and add an empty transition from this

new state to every start state of A1 and A2

7
Kleene Closure

A = A1*

8
Kleene Closure
• Add a new state as a start state of A

• Add an empty transition from this new start state to the start state of A1

• Add an empty transition from every final states of A1 to the start sate of A1

9
Intersection

• Let A1 and A2 be two dfa. The dfa obtained by A1  A2 is as follows :

• The initial state is {q0, q’0} where q0 and q’0 are respectively the initial state of

A1 and the initial state of A2;

 There is an edge labeled with the symbol a from the state {q1, q’1} to the

state {q2, q’2} if and only if there is in A1 an edge labeled by the symbol a

from q1 to q2 and in A2 an edge labeled by the symbol a from q’1 to q’2 ;

 A final state {qf, q’f} where qf is a final state in A1 and q’f final state in A2 .

10
Complementation

• Let A be an automaton. The complement A is obtained as follows :

 First we add a new state q

 Next we add an edge from every state q to the state q labeled

with symbol a in case there is no other edge from q labeled with this

symbol a

 The initial state is always the initial state of A;

 The final states are all the states except the final states of A.
11
• Remark 1: If we have NFA rather than DFA, we must
first convert it to DFA before swapping states to get its
complement.

• Remark 2: Since a language is regular if and only if it


is accepted by some NFA, the complement of a
regular language is a regular language.

12
Reduction of the number of states in
finite Automata
• Any dfa defines a unique language, but the converse is
not true. For a given language, there are many dfa’s that
accept it
• Definition: In a dfa two states p and q are called
indistinguishable, if for every string w:
*(p, w)  F  *(q, w)  F
and
*(p, w)  F  *(q, w) F

13
Minimization Algorithm

• Algorithm:
Step 1: Remove unreachable states
Step 2: Mark the distinguishable pairs of states.
to achieve this task, we first mark all pairs p, q where p  F and q  F as
distinguishable. Then we proceed as follows:
repeat
for all non-marked pairs p, q do
for each symbol a do
if the pair (p, a), (q, a) is marked
then mark p, q

Until no new pairs are marked

14
Minimization Algorithm

Step 3: Construct the reduced automaton Â.


We first determine the equivalence classes of the indistinguishability
relation. For each state q, the equivalence class of q consists of all
states p for which the pair p, q is not marked in step 2.
The states of  are the equivalence classes. The initial state qˆ0 is this
equivalence class that contains q 0 . The final state F̂ are these
equivalence classes that consist of final states of A. The transition
function ˆ is defined as follows. To determine ˆ(X , a ), for some
equivalence class X, pick any q  X and set ˆ(X , a ) Y, where Y is the
equivalence class that contain ˆ(q , a )

15

You might also like