2.Regular Grammars§
Here is another way to describe a language: Use a grammar.
Grammar G=(V,T,S,P)
V, T, and P are finite sets.
Here is another way to describe a language: Use a grammar.
Grammar G=(V,T,S,P)
V, T, and P are finite sets.
Note: x is a string of length 0 or more.
Definition:
Any right-linear or left-linear grammar is defined to be a regular grammar.
(Some books use a more restrictive definition in which the length of x is ≤1.)
<< What language is this? >>
Cannot mix left/right rules! This is not a regular grammar.
<< What language is this? >>
This is a right linear grammar representing the language L={strings with an even number of a's},Σ={a,b}
Theorem: L is a regular language iff ∃ regular grammar G such that L=L(G).
Theorem: L is a regular language iff ∃ regular grammar G such that L=L(G).
<< What is the machine for Example 2? >>
<< See 4.4.2 >>
Theorem: L is a regular language iff ∃ regular grammar G such that L=L(G).
(⟹) Given a DFA M, construct regular grammar G such that L(G)=L(M)
<<See 4.4.3>>
L={anbn∣n>0}
Is language L regular? Can you draw a DFA, regular expression, or Regular grammar for this language?