s cribing
Download
Skip this Video
Download Presentation
S cribing

Loading in 2 Seconds...

play fullscreen
1 / 10

S cribing - PowerPoint PPT Presentation


  • 104 Views
  • Uploaded on

S cribing. K SAMPATH KUMAR 11CS10022. scribing. Definition of a Regular Expression. R is a regular expression if it is : a for some a in the alphabet  , standing for the language {a} ε, standing for the language {ε} Ø, standing for the empty language

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 ' S cribing' - osric


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
s cribing

Scribing

K SAMPATH KUMAR 11CS10022

scribing

slide2

Definition of a Regular Expression

  • R is a regular expression if it is:
    • a for some a in the alphabet , standing for the language {a}
    • ε, standing for the language {ε}
    • Ø, standing for the empty language
    • R1+R2 where R1 and R2 are regular expressions, and + signifies union (sometimes | is used)
    • R1R2 where R1 and R2 are regular expressions and this signifies concatenation
    • R* where R is a regular expression and signifies closure
    • (R) where R is a regular expression, then a parenthesized R is also a regular expression

scribing

nondeterministic finite automata nfa
Nondeterministic Finite Automata (NFA)
  • A set of states S
  • A set of input symbols 
  • A transition function move that maps state-symbol pairs to sets of states
  • A state s0 that is distinguished as the start (initial) state
  • A set of states F distinguished as accepting (final) states.

scribing

conversion of regular expression to nfa
Conversion of Regular Expression to NFA
  • Thompson’s construction - an NFA from a regular expression
  • Input: a regular expression r over an alphabet .
  • Output: an NFA N accepting L(r)

scribing

slide5

Step 1

  • First parse r into its constituent subexpressions.
  • Construct NFA’s for each of the basic symbols in r.
    • for 
    • for a in 

scribing

slide6

Step 2

  • For the regular expression s|t,
  • For the regular expression st,

scribing

slide7

Step 3

  • For the regular expression s*,
  • For the parenthesized regular expression (s), use N(s) itself as the NFA.

Every time we construct a new state, we give it a distinct name.

scribing

slide8

Step 4

  • Finally suppose r = (s) .Then L(r) = L(s)
  • so we can use NFA N(s) as N(r).

scribing

slide9

N(r) has at most twice as many states as there are operators and operands in r. This bound follows from the fact that each step of the algorithm creates at most two new states.

  • N(r) has one start state and one accepting state. The accepting state has no outgoing transitions, and the start state has no incoming transitions.
  • Each state of N (r) other than the accepting state has either one outgoing transition on a symbol in C or two outgoing transitions, both on E.

scribing

slide10

(ab+a)* NFA

ε

a

ε

b

ε

ε

ε

ε

a

ε

ε

ε

scribing

ad