nfa closure properties. nfas also have closure properties we have given constructions for showing...

7
NFA Closure Properties

Upload: adam-horton

Post on 24-Dec-2015

219 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection

NFA Closure Properties

Page 2: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection

NFAs also have closure properties

• We have given constructions for showing that DFAs are closed under1. Complement2. Intersection3. Difference4. Union

• We will now establish that NFAs are closed under1. Reversal2. Kleene star3. Concatenation

Page 3: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection

Reversal of L-NFAs

• Closure under reversal is easy using L-NFAs. If you take such an automaton for L, you need to make the following changes to transform it into an automaton for LRev:

1. Reverse all arcs

2. The old start state becomes the only new final state.

3. Add a new start state, and an L-arc from it to all old final states.

Page 4: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection

Example

1. Reverse all arcs

2. The old start state becomes the only new final state.

3. Add a new start state, and an L-arc from it to all old final states.

Page 5: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection

Concatentation

• L R = { x y | x in L and y in R}

• To form a new L-NFA that recognizes the concatenation of two other L-NFAs with the same alphabet do the following– Union the states (you might have to rename them)– Add an L transition from each final state of the

first to the start state of the second.

Page 6: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection

Formally

• Let – L =(QL,A,sL,FL,TL)

– R =(QR,A,sR,FR,TR)

• L R = =(QLQR,A,sL,FR,T)

Where T s L | sЄFL = SR

T s c | sЄQL = TL s c

T s c | sЄQR = TR s c

Page 7: NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection