+ All Categories
Home > Documents > Properties of Regular Languages

Properties of Regular Languages

Date post: 12-Feb-2016
Category:
Upload: lenci
View: 39 times
Download: 0 times
Share this document with a friend
Description:
Properties of Regular Languages. Union:. Concatenation:. Are regular Languages. For regular languages and we will prove that:. Star:. Reversal:. Complement:. Intersection:. Union:. Concatenation:. We say: Regular languages are closed under. Star:. Reversal:. - PowerPoint PPT Presentation
29
Fall 2006 Costas Busch - RPI 1 Properties of Regular Languages
Transcript
Page 1: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 1

Properties of Regular Languages

Page 2: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 2

1L 2L

21LLConcatenation:*1LStar:

21 LL Union:

Are regularLanguages

For regular languages and we will prove that:

1L

21 LL

Complement:Intersection:

RL1Reversal:

Page 3: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 3

We say: Regular languages are closed under

21LLConcatenation:*1LStar:

21 LL Union:

1L

21 LL

Complement:Intersection:

RL1Reversal:

Page 4: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 4

a

b

ba

NFA

Equivalent NFA

a

b

ba

A useful transformation: use one accept state

2 accept states

1 accept state

Page 5: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 5

NFA

Equivalent NFASingleacceptingstate

In General

Page 6: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 6

NFA without accepting state

Add an accepting statewithout transitions

Extreme case

Page 7: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 7

1LRegular language

11 LML

1M

Single accepting state

NFA 2M

2L

Single accepting state

22 LML

Regular language

NFA

Take two languages

Page 8: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 8

}{1 baL na

b

1M

baL 2ab

2M

0n

Example

Page 9: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 9

UnionNFA for

1M

2M

21 LL

Page 10: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 10

ab

ab

}{1 baL n

}{2 baL

}{}{21 babaLL n NFA forExample

Page 11: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 11

Concatenation

NFA for 21LL

1M 2M

Page 12: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 12

NFA for

ab ab

}{1 baL n}{2 baL

}{}}{{21 bbaababaLL nn

Example

Page 13: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 13

Star OperationNFA for *1L

1M

*1L

1

21

Lwwwww

i

k

Page 14: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 14

NFA for *}{*1 baL n

ab

}{1 baL n

Example

Page 15: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 15

ReverseRL1

1M

NFA for

1M

1. Reverse all transitions

2. Make initial state accepting state and vice versa

1L

Page 16: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 16

}{1 baL na

b

1M

}{1nR baL

ab

1M

Example

Page 17: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 17

Complement

1. Take the DFA that accepts 1L

1M1L 1M1L

2. Make accepting states non-final, and vice-versa

Page 18: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 18

}{1 baL n

ab

1M

ba,

ba,

}{*},{1 babaL n a

b

1M

ba,

ba,

Example

Page 19: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 19

Intersection

1L regular

2L regularWe show 21 LL

regular

Page 20: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 20

DeMorgan’s Law: 2121 LLLL

21 , LL regular

21 , LL regular

21 LL regular

21 LL regular21 LL regular

Page 21: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 21

Example

}{1 baL n

},{2 baabL

regular

regular}{21 abLL

regular

Page 22: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 22

1Lfor for 2LDFA1M

DFA2M

Construct a new DFA that accepts

Machine Machine

M 21 LL

Msimulates in parallel and 1M 2M

Another Proof for Intersection Closure

Page 23: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 23

States in M

ji pq ,

1M 2MState in State in

Page 24: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 24

1M 2M

1q 2qa

transition1p 2pa

transition

DFA DFA

11, pq a

New transition

MDFA

22 , pq

Page 25: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 25

0q

initial state0p

initial state

New initial state00 , pq

1M 2MDFA DFA

MDFA

Page 26: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 26

iq

accept state

jp

accept states

New accept states

ji pq ,

kp

ki pq ,

1M 2MDFA DFA

MDFA

Both constituents must be accepting states

Page 27: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 27

Example:

}{1 baL n

ab

1M

0n

}{2mabL

b

b

2M

0q 1q 0p 1p

0m

2q 2pa

a

ba, ba,

ba,

Page 28: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 28

00, pq

Automaton for intersection}{}{}{ ababbaL nn

10, pqa

21, pq

b

ab 11, pq

20, pq

a

12, pq

22, pq

b

ba,

a

b

ba,

b

a

Page 29: Properties of  Regular Languages

Fall 2006 Costas Busch - RPI 29

M simulates in parallel and 1M 2M

M accepts string w if and only if:accepts string w1M

and accepts string w2M

)()()( 21 MLMLML


Recommended