Where p s aa a aa bb b ab bc c ac ? a ba ba other

This preview shows page 5 - 13 out of 18 pages.

), where P = { S aA A aA | bB B aB | bC C aC | λ } a + ba * ba * Other examples: Examples 3.29, 3.2.10, 3.2.11, 3.2.12
Image of page 5

Subscribe to view the full document.

6 6.2 Expression Graphs Claim(2) . Every language accepted by a FSA is regular . Defn. 6.2.1 An expression graph is a labeled digraph in which arcs are labeled by regular expressions . Paths in expression graphs generate regular expressions Algorithm 6.2.2 Construction of regular expression from a FSA. Produce an arbitrary expression graph by repeatedly removing nodes from the state diagram. Produce the language of the FSA by the union of the sets of strings whose processing successfully terminates in one of the accepting states Case 1.2.1 (i) (ii) w j , i w i , k k i j j k w j , i w i , k w i , i k j k j i w j , i w i , k w j , i ( w i , i )* w i , k
Image of page 6
7 6.2 Expression Graphs Note. If there are multiple final states in the given FSA M , then for each accepting state F , we produce an expression for the strings accepted by F . The language accepted by M is the union of the regular expressions.
Image of page 7

Subscribe to view the full document.

8 6.2 Expression Graphs 6.2.2 j k i i j k cc cc
Image of page 8
9 6.2 Expression Graphs i j = k There is no such i that is neither the start state nor a final state
Image of page 9

Subscribe to view the full document.

10 6.3 Regular Grammars and FA Given a regular grammar G , there exists a NFA M such that L ( G ) = L ( M ) Theorem. 6.3.1 Let G = ( V , , P , S ) be a regular grammar. Define the NFA M = ( Q , , δ , S , F ) as follows: a) V { Z }, where Z V , if P contains a rule A a V O.W. b) δ ( A , a) = B whenever A aB P δ ( A , a) = Z whenever A a P c) { A | A λ P } { Z }, if Z Q { A | A λ P } O.W. Then L ( M ) = L ( G ) Q = F =
Image of page 10
11 6.3 Regular Grammars and FA Example 6.3.1 Given G = ( V , , P , S ), where V = { S , B }, = { a , b }, and P = { S aS | bB | a , B bB | λ }, the corresponding NFA M = ( Q , , δ , S , F ), where Q = { S , B , Z }, = { a , b }, δ ( S , a ) = S, δ ( S , b ) = B , δ ( S , a ) = Z , δ ( B , b ) = B, F = { B , Z } Theorem 6.3.2 Given an NFA M , there exists a regular grammar G . 220d . L ( M ) = L ( G ). (i) V = Q (ii) The transition δ ( A , a ) = B yields the rule A aB in G (iii) For each accepting state C , create the rule C λ in G Example 6.3.4 P : S bB , S aA ; A aS , A bC ; B bS , B aC , B λ ; C bA , C aB ;
Image of page 11

Subscribe to view the full document.

12 6.4 Regular Languages A language over an alphabet is regular if it is i) a regular set/expression over ii) accepted by DFA / NFA / NFA- λ iii) generated by a regular grammar Regular languages are closed under , , *, ¯ , and
Image of page 12
Image of page 13
You've reached the end of this preview.
  • Winter '12
  • DennisNg
  • Formal language, Regular expression, Regular language, Nondeterministic finite state machine

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern