Wednesday, 14 February 2018

Formal Definition of Context-Free Grammars || Automata Theory



A context free grammar is a method for (recursively) describing the grammar of a given language. A CFG is a set of variables, each of which represents a language. The language, represented by the variables, is described in terms of primitive symbols called Terminals. The rules relating to the variables are called Productions.

A CFG, G, is formally defined as 4-tuple
                                                          G=(V, T, P, S)
Where V- A finite set of variables or non-terminals.
              T- A finite set of terminals.
               P- A finite set of production rules.
              S- Start symbol, SϵV.

Each production is of the form A ->α, where A is variable, α may be either terminal or non-terminal, i.e., AV and α (V T)

No comments:

Post a Comment