Regular Expression Grammar

What are the steps of the procedure for finding a regular expression that accepts the same language of a given grammar?

  • S β†’ b | AA
  • A β†’ aA | Abb | Ξ΅
+3
source share
2 answers

I'm writing something trying to figure it out (hope this helps):

  • According to the S --> bstring 'b'is a string in the grammar language.

  • Using Aproductions A --> aA | &, we can generate: " Afollowed by any number As", or in RE: a*A(* due to epsilon)

  • , A ---> Abb | &, " bb, A", RE: A(bb)* (* - epsilon)

  • 2 3 A, : a*(bb)*

  • , , A A, bb &.

  • 4, AA, : a*(bb)*a(bb)*.

, , , b + a*(bb)*a(bb)*

: RE , , .

+2

:

  • S β†’ AS | a
  • A β†’ SA | b

    • S β†’ a a .
    • A β†’ b, b .
    • A β†’ SA, A β†’ SA; A β†’ SSA; A β†’ SSSA;...
    • S β†’ AS, S β†’ AS; S β†’ AAS; S β†’ AAAS;...

, ?


?

  • x = yx + t y * t
  • x = xy + t ty *

S = AS + ; = . + ​​p >

S = A * a; = * ​​p >


A = SA + b S = ​​AS + a

  • A = S * b S = ​​S * bS + a
  • S = (S * b) * a
  • S = ( * ) *

@GrijeshChauhan??

0

All Articles