Regular Expression -&gt; NFA with an input string

1 / 14

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

Regular Expression -&gt; 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.

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

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

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

### Regular Expression -> NFA with an input string

Brian K. Strickland

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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!