{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
Lecture 3: ǫ -NFAs and Regular Expressions David Dill Department of Computer Science 1
Background image of page 1

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

View Full Document Right Arrow Icon
Outline ǫ -NFAs More operations on languages Regular expression syntax and semantics 2
Background image of page 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
Background image of page 3

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

View Full Document Right Arrow Icon
Definition of ǫ -NFA The only difference in the mathematical definition is in δ : δ : Q × ∪ { ǫ } ) 2 Q 4
Background image of page 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
Background image of page 5

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

View Full Document Right Arrow Icon
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
Background image of page 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
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}