Difference between a regular language and a regular grammar

Ramy Al Zuhouri picture Ramy Al Zuhouri · Feb 5, 2012 · Viewed 7.5k times · Source

My book gives similar but slightly different explanations of regular grammar and regular language. I doubt it's wrong, is a regular language the same thing of a regular grammar? The definition of my book is: A grammar is regular if all the productions are V-> aW or V->Wa with V,W non terminal or terminal symbols, "a" terminal symbol.W can also be empty or be the same of V.

Answer

buc picture buc · Feb 5, 2012

Regular grammars and regular languages are two different terms:

  1. A language is a (possibly infinite) set of valid sequences of terminal symbols.
  2. A grammar defines which are the valid sequences.

The same language could be represented with different class of grammars (regular, context free, etc.). A language is said to be regular if it can be represented with a regular grammar. On the othet hand, a regular grammar always defines a regular language. What you have posted is the definition of the regular grammar.

See this Wikipedia post for further information.