{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# l3 - Lecture 3-NFAs and Regular Expressions David Dill...

This preview shows pages 1–8. Sign up to view the full content.

Lecture 3: ǫ -NFAs and Regular Expressions David Dill Department of Computer Science 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Outline ǫ -NFAs More operations on languages Regular expression syntax and semantics 2
ǫ -NFA Idea; Allow state changes that don’t consume input symbols (“silent moves”). Choice of whether to take ǫ -transition is non-deterministic. q0 q1 1 q2 0 0 e 1 e (“e” in the drawing is ǫ ) The input “ 001 ” is accepted. The path followed is q 0 q 2 q 1 q 0 q 1 q 2 . 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Definition of ǫ -NFA The only difference in the mathematical definition is in δ : δ : Q × ∪ { ǫ } ) 2 Q 4
ǫ -closure Preliminary: the ǫ -closure of state q , ECLOSE ( q ) , is the set of all states reachable from q by silent moves. ECLOSE ( q 0 ) = { q 0 } ECLOSE ( q 1 ) = { q 1 , q 2 } ECLOSE ( q 2 ) = { q 1 , q 2 } 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Definition of ECLOSE Def: S is the least set satisfying property P if whenever P ( S ) holds, S S . ECLOSE ( q ) is the least set satisfying: q ECLOSE ( q ) δ ( s, ǫ ) ECLOSE ( q ) for all s ECLOSE ( q ) Also, ECLOSE ( S ) = uniontext { ECLOSE ( q ) | q S } (“Extend to sets” – this is overloading) 6
Acceptance by an ǫ -NFA We can define ˆ δ for an ǫ -NFA taking ECLOSE into account. Here is a recursive definition on the structure of strings: Base: w = ǫ : ˆ δ ( q, ǫ ) = ECLOSE ( q ) Induction: w = xa : ˆ δ ( q, xa ) = ECLOSE ( uniontext s ˆ δ ( q,x ) δ ( s, a )) (Same as ˆ δ for NFA, with ECLOSE wrapped around state sets.) L ( E ) = { x | ˆ δ ( q 0 , x ) F negationslash = ∅} Example: ˆ δ ( q 0 , 001) = { q

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}