Professional Documents
Culture Documents
Theory of Computing
Theory of Computing
Theory of Computing
Theory Of Computing
Part-I
Automata Theory
Context Free Language (CFL)
&
Context Free Grammar (CFG)
# Contents
What is the Theory of Computation ?
What are the benefits of studying theory of
computation ?
Three Major Branches
Context Free Language (CFL)
S SS
S (S)
S ()
Language Recognizer :
Think yourself as a language processor
Recognizer can accept valid strings
Finite automata, Regular expression are
formalized type of recognizer.
Language Generation:
Consists of language that have recursive structure
Context Free Grammar (CFG) is the method of
generating class of context free language using
some rule
Used mostly in compilers and interpreter to
design parser
Context Free Grammar
• Grammar G1:
A 0A1
A B
B #
Non-Terminal:
Nonterminal are the non-leaf nodes in a parse tree. In
the Expression grammar, E, T, and F are nonterminal.
Sometimes nonterminal are enclosed between angle
brackets to distinguish them from terminals.
Context Free Grammar(cont.)
• Grammar G1 Generates the string 000#111 .
The sequence of substitution to obtain a string is
called deviation
The deviation for that string is :
A0A1 00A11 000A111 000B111 000#111
In shortly :
Any language generated by CFG is called CFL
Context Free Grammar(cont.)
• Prove using the regular expression R=a(a* U b*)b
that CFG is a language Generator