Download presentation
Presentation is loading. Please wait.
Published byVirgil Ellis Modified over 8 years ago
1
Grammar G = (V N, V T, P, S) –V N : Nonterminal symbols –V T : Terminal symbols V N V T = , V N ∪ V T = V – P : a finite set of production rules α β, α ∈ V +, β ∈ V * – S : start symbol(sentence symbol)
2
Chomsky Hierarchy 생성 규칙 α -> β ∈ P 의 종류에 따라 –Type 0 : No restrictions(unrestricted grammar) –Type 1 : Context-sensitive grammar(CSG). -> β, | | | β| –Type 2 : Context-free grammar(CFG). A -> , where A ∈ V N S, ∈ V * –Type 3 : Regular grammar(RG). A -> tB or A -> t, (right-linear) A -> Bt or A -> t, (left-linear) where, A, B ∈ V N S, t ∈ V T *
3
Examples –Type 3 : Regular grammar G 1 =({S}, {a, b}, P, S) P: S aS, S Sb, S a, S b, S 정규식 : a * b * 언어 L(G 1 ) = {a n b m | n 0, m 0} “ aab ” 의 유도 과정 : S aS (by S aS) aaS (by S aS) aab (by S b)
4
Examples –Type 2 : Context Free Grammar G 2 =({S}, {a, b}, P, S) P: S aSb, S ab 정규식 : a n b n 언어 L(G 2 ) = {a n b n | n 1} “ aaabbb ” 의 유도 과정 : S aSb (by S aSb) aaSbb (by S aSb) aaabbb (by S ab)
5
Examples –Type 1 : Context Sensitive Grammar G 3 =({S,A,C}, {a, b}, P, S) P: S A, A abC, bB bb, A aABC, CB BC, bC bb 정규식 : a n b n 언어 L(G 3 ) = {a n b n | n 1}
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.