50 likes | 197 Vues
This text provides a comprehensive overview of the Chomsky hierarchy, detailing the classifications of formal grammars into four types: Type 0 (unrestricted), Type 1 (context-sensitive), Type 2 (context-free), and Type 3 (regular). It outlines the components of grammars including nonterminal symbols (VN), terminal symbols (VT), and production rules (P). Examples for each grammar type are provided, illustrating their respective structures and languages, along with derivation processes for specific strings. This insight is essential for understanding the foundations of computational linguistics and formal language theory.
E N D
Grammar • G = (VN, VT, P, S) • VN : Nonterminal symbols • VT : Terminal symbols • VN VT = , VN∪ VT = V • P : a finite set of production rules • α β, α∈ V+, β∈ V* • S : start symbol(sentence symbol)
Chomsky Hierarchy • 생성 규칙 α -> β ∈ P의 종류에 따라 • Type 0 : No restrictions(unrestricted grammar) • Type 1 : Context-sensitive grammar(CSG). -> β, | | | β| • Type 2 : Context-free grammar(CFG). A -> , where A ∈ VN S, ∈ V* • Type 3 : Regular grammar(RG). A -> tB or A -> t, (right-linear) A -> Bt or A -> t, (left-linear) where, A, B ∈ VNS, t ∈ VT*
Examples • Type 3 : Regular grammar • G1=({S}, {a, b}, P, S) • P: S aS, S Sb, S a, S b, S • 정규식: a*b* • 언어 L(G1) = {anbm| n0, m0} • “aab”의 유도 과정: S aS (by S aS) aaS (by S aS) aab (by S b)
Examples • Type 2 : Context Free Grammar • G2=({S}, {a, b}, P, S) • P: S aSb, S ab • 정규식: anbn • 언어 L(G2) = {anbn| n1} • “aaabbb”의 유도 과정: S aSb (by S aSb) aaSbb (by S aSb) aaabbb (by S ab)
Examples • Type 1 : Context Sensitive Grammar • G3=({S,A,C}, {a, b}, P, S) • P: S A, A abC, bB bb, A aABC, CB BC, bC bb • 정규식: anbn • 언어 L(G3) = {anbn| n1}