38 views

Uploaded by Taqi Shah

Attribution Non-Commercial (BY-NC)

- CMI Ugmath2012 Solutions
- 4678045.pdf
- ServerGuideJS12
- Recognition of Tokens
- Deep Packet Inspection with Regular Expression Matching
- 1-s2.0-0012365X93E0128Q-main
- Truth Tables1
- Mamat Manpages
- 1
- CAT Lesson11j
- Lecture on DFA to RE
- TheoryOfComputation_C1
- lesson 4 data sheet
- Working Draft Ecma-262 Edition 6 7-8-12
- handout-04
- Manual Guide RENAMER (Updated)
- 41 Weblist of f.e. Sem i Cbcgs Sem II Cbcgs Cbsgs 01.04.19
- AI_Lecture_9
- moreo2013
- ctrgg123456.pdf

You are on page 1of 62

Any NFA can be converted to an equivalent NFA with a single final state

a a b

Example

NFA

a a b b P

Equivalent NFA

P

3

NFA

In General

Equivalent NFA

P P P

Courtesy Costas Busch - RPI

4

Extreme Case

NFA without final state

For regular languages we will prove that: Union: Concatenation: Star: Reversal: Complement: Intersection:

L1 and L2

L1 L2

L1L2 L1 *

R L1 Are regular Languages

L1

Courtesy Costas Busch - RPI

L1 L2

We say: Regular languages are closed under Union: Concatenation: Star: Reversal: Complement: Intersection:

L1 L2

L1L2 L1 *

R L1

L1

Courtesy Costas Busch - RPI

L1 L2

Regular language

L1

Regular language

L2

LM1
! L1

NFA

LM 2
! L2

NFA

M1

M2

9

Example

nu0

M1

a

b

L1 ! {a b}

M2 L2 ! _ a ba

b a

10

Union

NFA for

L1 L2 M1

P P

M2

11

Example

NFA for

L1 L2 ! {a b} {ba} L1 ! {a b}

a

b

P P

n

L2 ! {ba}

b

a

12

Concatenation

NFA for

L1L2 M1

P

M2

P

13

Example

NFA for

n

L1 ! {a b}

a b P

L2 ! {ba}

b a P

14

Star Operation

NFA for L1 *

M1

P

P

P L1 *

P

Courtesy Costas Busch - RPI 15

Example

NFA for

L1* ! {a b} *

P

w ! w1w2 . wk wi L1 n

L1 ! {a b}

a

P P

16

Reverse

NFA for

L1

M1

L1 d M1

1. Reverse all transitions 2. Make initial state final state and vice versa

Courtesy Costas Busch - RPI 17

Example

M1

a

L1 ! {a b}

a

R L1

d M1

b

! {ba }

18

Complement

L1

M1

L1

d M1

1. Take the DFA that accepts L1 2. Make final states non-final, and vice-versa

Courtesy Costas Busch - RPI 19

Example

M1

a

a, b

L1 ! {a b}

a, b

a L1 ! {a, b} * {a b}

n

a, b

d M1

b

Courtesy Costas Busch - RPI

a, b

20

Intersection

DeMorgans Law:

L1 L2 ! L1 L2

regular regular regular regular regular

21

L1 , L2 L1 , L2 L1 L2 L1 L2 L1 L2

Example

n

L1 L2 ! {ab}

regular

22

Regular Expressions

23

Regular Expressions

Regular expressions describe regular languages

Example:

(a b c) *

describes the language

Courtesy Costas Busch - RPI 24

Recursive Definition

Primitive regular expressions: Given regular expressions

, P, E

r1 and r2

r1 r2 r1 r2 r1 *

Are regular expressions

r1

Courtesy Costas Busch - RPI 25

Examples

A regular expression:

a b c * (c )

a b

26

Example

27

Definition

For primitive regular expressions:

L
! LP
! _Pa La
! _aa

Courtesy Costas Busch - RPI 28

Definition (continued)

For regular expressions r and r2 1

Lr1 r2
! Lr1
Lr2
Lr1 r2
! Lr1
Lr2
Lr1 *
! Lr1
* Lr1
! Lr1

Courtesy Costas Busch - RPI 29

Example

Regular expression:

a b a *

La b
a *
! La b
La *
! La b
La *
! La
Lb
La
* ! _aa _ a
_aa
* b ! _a, ba_P , a, aa, aaa,...a ! _a, aa, aaa,..., b, ba, baa,...a

Courtesy Costas Busch - RPI 30

Example

Regular expression

r ! a b * a bb

31

Example

Regular expression

r ! aa * bb * b

Lr ! {a b

2n 2m

b : n, m u 0}

32

Example

Regular expression

r ! (0 1) * 00 (0 1) *

two consecutive 0 }

33

Example

Regular expression

r ! (1 01) * (0 P )

two consecutive 0 }

34

Definition: Regular expressions are equivalent if

r1 and r2 L(r1) ! L( r2 )

35

Example

two consecutive 0 }

are equivalent regular expr.

36

37

Theorem

Languages Generated by Regular Expressions

Regular Languages

38

Theorem - Part 1

Languages Generated by Regular Expressions Regular Languages

Courtesy Costas Busch - RPI 39

Theorem - Part 2

Languages Generated by Regular Expressions Regular Languages

40

Proof - Part 1

41

Induction Basis

Primitive Regular Expressions: NFAs

, P, E

a

regular languages

L( M 3 ) ! {a} ! L(a )

Courtesy Costas Busch - RPI 42

Inductive Hypothesis

Assume for regular expressions r and r2 1 that L(r1 ) and L(r2 ) are regular languages

43

Inductive Step

We will prove:

Lr1 r2 Lr1 r2 Lr1 * Lr1

44

Lr1 r2
! Lr1
Lr2
Lr1 r2
! Lr1
Lr2
Lr1 *
! Lr1
* Lr1
! Lr1

Courtesy Costas Busch - RPI 45

We also know: Regular languages are closed under: Union Concatenation Star

Lr1 Lr2 Lr1 Lr2

Lr1
*

Courtesy Costas Busch - RPI 46

Therefore:

Lr1 r2
! Lr1
Lr2
Lr1 r2
! Lr1
Lr2
Lr1 *
! Lr1
*

Courtesy Costas Busch - RPI 47

And trivially:

48

Proof Part 2

49

L( M ) ! L

Courtesy Costas Busch - RPI 50

in which transition labels are regular expressions

Example:

M

a

a, b

Courtesy Costas Busch - RPI

a

ab

51

Another Example:

b a q0 b q1 a, b

b q2

b a q0 b

Courtesy Costas Busch - RPI

q1 a b q2

52

b a

q0 b

q1 a b q2

bb * a q0 bb * ( a b)

b q2

53

bb * a q0

bb * ( a b)

q2

Courtesy Costas Busch - RPI 54

Removing states:

In General e g d qi

a

q

b

f

qj

ae * d

g ceced d **

ce * b

qi f aeb b ae * *

Courtesy Costas Busch - RPI

qj

55

r1 r3

r4

q0

r2

qf

L(r ) ! L( M ) ! L

Courtesy Costas Busch - RPI 56

Theorem

If L ! L ( A) for some DFA A Then there is a regular expression R such that

L ! L(R)

Proof: (by induction on the size of R) Let As states be {1, 2, , n} for some integer n Construct a collection of regular expressions that describe progressively broader sets of paths in DFA A

57

Let R be the regex that represent the set of strings w such that w is the label of a path from state i to j in A, and that path has no intermediate state whos label is greater than k. Note: beginning & end points, i.e. i & j are not intermediate so they can be greater than k

(k ) ij

58

Inductive Definition

Basis: k = 0 Since all states are >= 1, restriction on the paths is that the path must have no intermediate states at all. If i j An arc from i to j ( 0) Depending of the DFA A Rij may be , a or

( 0) ij

! a1 a2 . am

59

Inductive Definition

If i = j all loops from i to itself legal paths of length 0

(0) ij

! P a1 a2 . am

60

Inductive Definition

Induction: Suppose that there is a path from i to j that goes through no state with label higher than k. Consider two cases path does not go thru state k at all.

j

(k ) ij

!R

( k 1) ij

61

path goes thru state k at least once - More than once once

R R

( k 1) ik

(R

( k 1) ij

( k 1) * kk

R

( k 1) * kk

( k 1) kj

(k ) ij

!R

R

( k 1) ik

(R

) R

( k 1) kj

62

- CMI Ugmath2012 SolutionsUploaded byHimansu Mookherjee
- 4678045.pdfUploaded byKonrad Alvarado
- ServerGuideJS12Uploaded bykimhoang
- Recognition of TokensUploaded byVasantha Kumari
- Deep Packet Inspection with Regular Expression MatchingUploaded byATS
- 1-s2.0-0012365X93E0128Q-mainUploaded byhungkg
- Truth Tables1Uploaded bycooks8212
- Mamat ManpagesUploaded byneo
- 1Uploaded bykannanchammy
- CAT Lesson11jUploaded byBryan Seow
- Lecture on DFA to REUploaded byਕੁਲਵਿੰਦਰ ਸਿੰਘ
- TheoryOfComputation_C1Uploaded byanVicVictory
- lesson 4 data sheetUploaded byapi-250152415
- Working Draft Ecma-262 Edition 6 7-8-12Uploaded byThanatip Sriviroonchai
- handout-04Uploaded byamos4354
- Manual Guide RENAMER (Updated)Uploaded byAlitha Maz Juanez
- 41 Weblist of f.e. Sem i Cbcgs Sem II Cbcgs Cbsgs 01.04.19Uploaded byGaurav Didshe
- AI_Lecture_9Uploaded byArsalan Ahmed
- moreo2013Uploaded byPrimanaOky
- ctrgg123456.pdfUploaded bymakroum
- 2157317Uploaded byWei Gao
- Recursive sequences solution.pdfUploaded byChai Usajai Usajai
- Ascona Moscoso Elvis Dante_inversion en BolsaUploaded byelvis
- 7Uploaded byPrakash Katwal
- PrelimUploaded byWaseem Tariq
- Modeling Musical Structure with Parametric GrammarsUploaded bymagiraud
- DISCRIMINATION OF OUTER MEMBRANE PROTEINS USING REFORMULATED SUPPORT VECTOR MACHINE BASED ON NEUTROSOPHIC SETUploaded byAnonymous 0U9j6BLllB
- Timbal ECE41L Experiment 4Uploaded byLime Hexa Studios
- Metalogic ReviewUploaded byFred_Mayweather
- Consider the tasks.docxUploaded byTerry Vincenzo

- Software Testing StrategiesUploaded byTaqi Shah
- Software Testing TechniquesUploaded byTaqi Shah
- Analysis ModelingUploaded byTaqi Shah
- Software Cost and Effort Estimation in Software Engineering ProcessUploaded byTaqi Shah
- Tutorial Week 7 - Class and Entity-Relationship DiagramsUploaded bySab707
- ERD database modeling.Uploaded byTaqi Shah
- Software Cost and Effort EstimationUploaded byTaqi Shah
- Lect 5 Team OrgnizationUploaded bySheikh Waqas Iqbal
- Well Meadows Hospital NormalizationUploaded byTaqi Shah
- Ch03Uploaded byTaqi Shah
- Lect 4 Cost EstimationUploaded byTaqi Shah
- Lect 3 Project ManagementUploaded byTaqi Shah
- Cmmi Uaar Seminar 2012Uploaded byTaqi Shah
- Lect 4 Req Engin ProcessUploaded byTaqi Shah
- Software Engineering 1- Lec 5 Software Project ManagmentUploaded byTaqi Shah
- Normalization Exercise AnswerUploaded bymanisgurlz
- ch05Uploaded byTaqi Shah
- HW1_solUploaded byTaqi Shah
- Normalization NotesUploaded byShenna Kim Casinillo
- ERD To Relational Model ExampleUploaded byTaqi Shah
- S.E chap ModelsUploaded byTaqi Shah
- Conceptual Data ModelingUploaded byTaqi Shah
- entity relationship diagramsUploaded bybunty142001
- Lesson 3: An Introduction to Data ModelingUploaded byabhi1banerjeee
- English Solution2 - Class 10 EnglishUploaded byTaqi Shah
- Ch01Uploaded byTaqi Shah
- Ch02Uploaded byTaqi Shah
- S.E Lec 2Uploaded byTaqi Shah
- English Solution - Class 10 EnglishUploaded byTaqi Shah
- Hardware Tutorial Solution 09Uploaded byTaqi Shah

- Normalization for s 4Uploaded byMarcela Quispe Cruz
- FLA - TutA4Uploaded bycrazymaniac90
- Fallsem2015 16 Cp3066 Qz01ans Pdnf and PcnfUploaded byKrishnendu S
- The Ceva TheoremUploaded by918goody
- multiplication_0402_all.pdfUploaded byIntan Baiduri
- Mathematical Induction practiseUploaded byRizul thakur
- Mathematical InductionUploaded byManP13
- proof by contradictionUploaded byapi-315354740
- 1_Basic_Proportionality_Theorem.pdfUploaded byAtul Sharma
- Kakutani's Fixed Point Theorem Counter ExamplesUploaded bycothom_3192
- Method of ProofUploaded byChai Jin Ying
- Proof by InductionUploaded byWes Swinson
- senos y cosenosUploaded byFer Zul
- Fermat's Last TheoremUploaded bytimwuu
- Gödel.Kurt..(by Hao Kim) - Complete Proofs of Godel Incompleteness TheoremsUploaded byMustafa Galois
- Indeterminate Forms and LHopitals RuleUploaded byS.m. Chandrashekar
- MTH314-w19-assign05-pass (pdf.io).pdfUploaded byhaseabamin
- Aaby, Proof Methods in Logic [16 pgs]Uploaded bygzalzalkovia
- Nice and Hard InequalitiesUploaded bylialoo
- Chapter iUploaded byGag Paf
- Cauchy Criterion, Bolzano-Weierstrass TheoremUploaded bypeeyushtewari
- class6.pptUploaded byabcd
- Real Analysis Notes9Uploaded byMathsisCoolV1
- 1003 PrimesUploaded byDot Kolor
- Exercises on ProvingUploaded byericmilamattim
- 18.100A-PS14Uploaded byEric Emer
- review1Uploaded byapi-241959879
- Question Sheet 1Uploaded byRanu Games
- A Brief Introduction to InequalitiesUploaded bytonypr100
- Inmultirea ZU x ZUUploaded byTeach With Jyoti