A grammar is inyutively a set of rules which are used to construct a language contained in , for some alphabet . These rules allow us to replace symbols or strings of symbols with other symbols or strings until we finally have strings of symbols contained in allowing us to form an element of the language.
By placing restrictions on the rules, we shall see that can develop different types of languages. In particular we can restrict our rules to produce desirable qualities in our langauge.
A formal grammar, or phrase structure grammar .denoted by the 4-tuple which consists of a finite set of nonterminal symbols , a finite set of terminal symbols , an element called the start symbol and a finite set of productions , which is a relation in such that each first element is an ordered pair of contains a symbol from and at least one production as the left string in some ordered pair.