1 / 8

Regular Languages Cont’d

Regular Languages Cont’d. Reading: 3.2. What we know so far…. A language is regular iff it can be described with a finite state automata. A regular expression necessarily defines a regular language. Conjecture: Every regular language can be described using a regular expression.

randi
Télécharger la présentation

Regular Languages Cont’d

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Regular Languages Cont’d Reading: 3.2

  2. What we know so far… • A language is regular iff it can be described with a finite state automata. • A regular expression necessarily defines a regular language. • Conjecture: Every regular language can be described using a regular expression

  3. Generalized Transition Graphs • FSA’s whose transitions are labeled with regular expressions rather than symbols from the alphabet. a c* a + b

  4. Algorithm for creating a GTG from a FSA • Create arcs such that there is only one final state and that the initial state is not a final state. • Change each transition to be a regular expression • Sequentially remove each node that is not the accept state or the initial state. • Rewrite the 2-node NFA as a regular expression

  5. e c d q q2 q1 a b ce*b ce*d ae*d q1 q2 ae*b Removing a node

  6. Example: Convert to GTG b a,b b a b q0 q1 q2 a

  7. r1 r3 q1 q2 r2 Writing the final regular expression r4 Regular expression is: r = r1*r2(r4+r3r1*r2)*

  8. Example: a+b b+ab*a Regular expression is: ab*b q1 q2

More Related