regular expression nfa with an input string
Download
Skip this Video
Download Presentation
Regular Expression -> NFA with an input string

Loading in 2 Seconds...

play fullscreen
1 / 14

Regular Expression -> NFA with an input string - PowerPoint PPT Presentation


  • 74 Views
  • Uploaded on

Regular Expression -> NFA with an input string . Brian K. Strickland. Λ -NFA for Regular Expression ( aab )*(a + aba )*. a. 1. 2. a. a. b. Λ. 0. 3. a. a. 4. 5. b. Computation Tree for Input String: aababa. Λ. a. a. 0. 0. a. 1. 1. 4. 5. 4. 4. 2. 5. a. a. a. b.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Regular Expression -> NFA with an input string ' - cecile


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide3

Computation Tree for Input String: aababa

Λ

a

a

0

0

a

1

1

4

5

4

4

2

5

a

a

a

b

b

Λ

3

3

3

3

3

3

3

a

a

a

a

b

a

regular expression aab a aba input string aababa
Regular Expression: (aab)*(a + aba)*Input String: aababa

2

0

5

5

1

1

0

4

4

4

a

Λ

1

2

a

a

a

a

a

b

a

a

a

Λ

3

3

3

3

3

3

3

b

b

0

3

Λ

a

a

a

a

a

a

b

4

5

b

a

regular expression aab a aba input string aababa1
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression a ab a aba input string a ababa
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression a a b a aba input string a a baba
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression aa b a aba input string aa b aba
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression aab a aba input string aa b aba
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression aab a a ba input string aab a ba
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression aab a a b a input string aaba b a
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression aab a ab a input string aabab a
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

regular expression aab a aba input string aababa2
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

Accepted!

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

Accepted!

regular expression aab a aba input string aababa3
Regular Expression: (aab)*(a + aba)*Input String: aababa

1

a

Λ

1

2

0

a

a

a

a

1

a

b

4

a

a

a

2

Λ

4

0

Accepted!

3

3

3

3

3

3

3

b

b

3

Λ

0

5

a

a

a

a

a

a

4

b

4

5

b

5

a

  • The key is the lambda transition from the Kleene star operation (*) which allows the regular expression to transition to the accepting state of the NFA.

Accepted!

ad