# Definition of a grammar

I am learning about context free grammars and have been through few texts in a undetailed manner on these topic . I think I should know the exact , rigorous ,technical definition of what exactly a "grammar" means .

I could see that ,in all of these lessons, a sequence of equations as follow :

 a = bc
b = ed
c = gh


I was tempted to conclude that "a grammar is a collection of symbols which are related by a set of equations which dictate rules for substitution of a symbol by a series of symbols "

Then I got to know that , not in all series of equations can we substitute one symbol by a series of another symbol .We can do it only in case of "context-free grammars " . Then I went through one of the stackexchange post and through a brilliant answer got to know what context free exactly means .

So , I thought before I proceed ahead I better seek for the exact rigorous definition of a grammar . What exactly is the mathematical/technical definition of a grammar ?

• Any textbook covering formal languages provides a formal definition of a grammar, i.e., regular, context-free, context sensitive, etc. What is unclear with these definitions? Why do you think they are not "mathematical/technical "? – fade2black Nov 1 '17 at 20:35
• @fade2black : Need to check my book again . Actually it's not a book on theory of formal languages but is basically headed towards compiler design . – Eddie Dorphy Nov 15 '17 at 19:27