Header Ads

  • Highlights

    👩🏻‍💻 Hello Readers 🧑🏻‍💻!!! Would you like to Explore more ? Hit on ⓘ(Ads)... ✨🌹

    What is Noam Chomsky Grammar Classification?

    Noam Chomsky Grammar Classification

    Noam Chomsky Grammar Classification

    Hierarchy means an organized structure in which items are arranged according to their rank or level. Chomsky has proposed such kind of hierarchy in which he has given different levels to grammar. Levels are given in terms of  Type-0Type-1Type-2Type-3 on the basis of their unrestricted to restricted behavior. This behavior is based on the representation or arrangement of terminal and nonterminal in the grammar.

    Noam Chomsky Grammar Type 0 :

    This type of grammar is unrestricted, or phase structured, which generates all types of languages that can be recognized by a Turing machine. These languages are called recursive enumerable language. Unrestricted means these grammar have very less restrictions. Unrestricted grammar (G) = L → R (L is left side and R is in right side of production) , where L, R  (V  T)* means any combination of terminal or non terminal on left hand side i,e. L as well as on right hand side  i,e. R and one left side mean “L” must have at least one variable. V stands for variable and T for terminals. 

    Example of Type 0 grammar : All in red are L and in blue are R

                                            L → R 

                                            → aSb/λ

                                            A → aA/aB/Cb

                                            Ba → a/Da

    Noam Chomsky Grammar Type 1 :

    This is context-sensitive grammar (CSG) which is used to generate context-sensitive languages. CSG (G) = L → R, where L,R  (V  T)* and “L” must have at least one variable. There is one additional rule also, |L| ≤ |R|, which means length of “L” should be less than or equal to “R”. In simple words we can say on left of production there should be less number of terminal or non terminal as compare to right hand side of production.

    Example of Type 1 grammar : All in red are L and in blue are R

                                        L → R     

                                            → aSb/λ

                                            Aa → aAB/aB/Cb

                                            B → a/Da

    Noam Chomsky Grammar Type 2 :

    This is context-free grammar (CFG) which is used to generate context-free languages. CFG (G)= L → R, where R  (V  T)* and |L| ≤ |R|. In addition to the CSG grammar, one extra rule, that is, only single variable is allowed in “L”.

                                        L → R                                        

                                            → aSb/λ

                                            A → aA/aB/Cb

                                            B → a/Da

    Noam Chomsky Grammar Type 3:

    This is regular grammar, therefore language generated by these grammars is called regular languages. Regular grammar (G) = L → R, where L ≤ R , {R  (T*, T*V, VT*) and u  V} and “u” has only one variable.

                                        L → R    

                                            S → aS/λ

                                            A → aA/aB/Cb

                                            B → a/Da

    Also, Study about: 

    Also Read, some interview tips

    No comments

    Post Bottom Ad

    Powered by Blogger.