1 / 7

Regular Grammars

Regular Grammars. Right-linear Grammar. A grammar G=(V,T,S,P) is right-linear if all productions are of the form A -> xB, or A -> x where A,B  V, and x  T*. Language of RL Grammar. Claim: For all right-linear grammars G, L(G) is regular Proof by construction. A RL Grammar for a RL.

Télécharger la présentation

Regular Grammars

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 Grammars

  2. Right-linear Grammar • A grammar G=(V,T,S,P) is right-linear if all productions are of the form • A -> xB, or • A -> x where A,B  V, and x  T*

  3. Language of RL Grammar • Claim: For all right-linear grammars G, L(G) is regular • Proof by construction

  4. A RL Grammar for a RL • For any regular language L over alphabet ∑, there is a right-linear grammar G=(V,∑,S,P) such that L = L(G) • Proof by construction

  5. Questions (1/3) • Is the language of the grammar G1 = ({S,A},{a,b},S,{S -> aS | A, A -> bA}) a regular language? • If it is, give an FA with the same language.

  6. Questions (2/3) • Is the language of the grammar G2 = ({S,B}, {a,b}, S, {S -> aB | λ, B -> Sb}) a regular language? • If so, give an FA with the same language as G2.

  7. Questions (3/3) • Give a regular grammar with the same language as the following DFA. c q1 a,b b a,b,c a q0 q3 c b q2 c a

More Related