SlideShare a Scribd company logo
1 of 5
Concept Of Programming
Language
구문 구조
문자열 집합과 연산
• 문자열 접합 연산 (concatenation)
• "ab" • "cd" = "abcd"
• "ab"• ε = ε • "ab" = "ab"
( ε = 빈문자열)
• 문자열 집합 접합 연산
• {"a", "ab"} • {"c", "d"}
= {"ac", "ad", "abc", "abd"}
= { ac, ad, abc, abd }
• {"a", "b"} • {}
= {} • {"a", "b"}
= {"a", "b"} = {a, b}
• {"a", "b"} • {ε, "c"}
= {"a", "ac", "b", "bc"}
= {a, ac, b, bc}
• 문자열 연산의 간략형
• {a, b} • {a, b}
= {a, b}²
= {aa, ab, ba, bb}
• {a, b}•{a, b}•{a, b}
= {a, b}³
= {aaa, aab, aba, abb, bab, bba, bbb}
• {a, b}1 = {a, b}
• {a, b}0 = {ε}
• 클레이니 클로저(Kleene Closure)
• 문자 a, b로 이루어진 모든 문자열들의 집합
• {a, b}*
= {a, b}ⁿ
= {a, b}^0 ∪ {a, b}¹ ∪ {a, b}² ∪ …
언어 집합
• 추론 규칙
• 공리: a 문자열은 Simple의 원소
여기에 수식을 입력하십시오.
• 𝑎 ∈ 𝑆𝑖𝑚𝑝𝑙𝑒
• 추론 규칙:
• 만약 w 문자열이 Simple의 원소라면
wb 문자열도 Simple의 원소
•
𝑤 ∈ 𝑆𝑖𝑚𝑝𝑙𝑒
𝑤𝑏 ∈ 𝑆𝑖𝑚𝑝𝑙𝑒
• 귀납 정의
• 무한 집합을 유한하게 표현하는 방법
• 생성 규칙 :
• 화살표 좌변의 기호열을 우변의 기호열로
교채(대치) 할 수 있음을 의미
• S -> a
• S -> Sb
• 문장 abb가 Simple의 원소임을 증명하
는 유도(derivation)
• S -> Sb -> Sbb -> abb
• 문장 형태 (Sentential form) :
• 시작기호로부터 문장에 이르기까지
유도에 등장하는 기호열
언어의 문법
• 정형 문법 G=(T.N.S.P)
• ex) G1
• 터미널 기호 집합 T (⊆ ∑) :
• ex) T={a, b}
• 넌터미널 기호 집합 N
• ex) N = {S}
• 시작 기호 S (∈ N)
• ex) S
• 생성규칙의 집합 P
• ex) P = {S->a, S->Sb} = {S=> a | Sb}
• BNF(Backus-Naur Form)
• 프로그래밍 언어의 문법을 표현하기 위한 표
기법
• Algol60 정의에 처음 사용함
• 프로그래밍 언어의 대부분을 표기하기 위해
사용함
• 앞에서 표현된 생성규칙을 포함하여 다양한
변형이 존재함
(-> vs ::=, <> vs 대문자 표시)
• EBNF(Extended BNF)
• BNF 표기법에 다양한 매크로를 추가하여
편리하게 사용할 수 있도록 함
• 반복 {} : 0번 또는 그 이상
• 옵션 [] : 한 번 나오거나 나오지 않음을 의미
• 다중선택 () : 여러 개에서 하나를 선택
언어 Simple의 알파벳 ∑ = {a, b}
Simple = {a, ab, abb, abbb, abbbb, …}
Simple ⊆ ∑*
Simple = { w | 문자열 w는 어떤 조건을 만족한다.}
= { w | 문자열 w는 맨 앞에 a가 나오고
그 다음에 0개 이상의 b가 나온다}
언어 분류
• Chomsky의 분류
• 타입 0 : 무제한 문법 (Unrestricted Grammar)
• Ex) 𝞪 -> 𝞫 생성규칙 형태에 제한이 없음
• 타입 1 : 문맥 민감 문법 (Context Sensitive Grammar)
• Ex) 𝞪A𝞫 -> 𝞪𝞬𝞫 𝞪와 𝞫에 둘러싸였을 때만 A를 𝞬로 대치
할 수 있음
• 타입 2 : 문맥 자유 문법 (Context Free Grammar)
• Ex) A -> 𝞪 언제든지 A를 𝞪로 대치할 수 있음
• 타입 3 : 정규 문법 (Regular Grammar)
• Ex) A -> a | Ba A를 단 하나의 터미널이나 넌터미널 하나
와 터미널 하나로 된 문장 형태로 대치할 수 있음
• 타입 i+1는 타입 i의 특수한 형태임.
• 따라서 단계적인 포함 관계를 가진다. 3 ⊆ 2 ⊆ 1 ⊆ 0
문법 언어 인식 기계
타입 0 : 무제한 문법 재귀나열 언어
(Recursively Enumerable
Language)
튜링 기계
(Turing Machine)
타입 1 : 문맥 민감 문
법
문맥 민감 언어
(Context-Sensitive
Language)
선형 바운드 오토마타
(Linear-Bounded
Automata)
타입 2 : 문맥 자유 문
법
문맥 자유 언어
(Context-Free Language) 푸쉬다운 오토마타
(Push-Down Automata)
타입 3 : 정규 문법 정규 언어
(Regular Language)
유한 상태 기계
(Finite State Machine)

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Lightning talk - 2

  • 2. 문자열 집합과 연산 • 문자열 접합 연산 (concatenation) • "ab" • "cd" = "abcd" • "ab"• ε = ε • "ab" = "ab" ( ε = 빈문자열) • 문자열 집합 접합 연산 • {"a", "ab"} • {"c", "d"} = {"ac", "ad", "abc", "abd"} = { ac, ad, abc, abd } • {"a", "b"} • {} = {} • {"a", "b"} = {"a", "b"} = {a, b} • {"a", "b"} • {ε, "c"} = {"a", "ac", "b", "bc"} = {a, ac, b, bc} • 문자열 연산의 간략형 • {a, b} • {a, b} = {a, b}² = {aa, ab, ba, bb} • {a, b}•{a, b}•{a, b} = {a, b}³ = {aaa, aab, aba, abb, bab, bba, bbb} • {a, b}1 = {a, b} • {a, b}0 = {ε} • 클레이니 클로저(Kleene Closure) • 문자 a, b로 이루어진 모든 문자열들의 집합 • {a, b}* = {a, b}ⁿ = {a, b}^0 ∪ {a, b}¹ ∪ {a, b}² ∪ …
  • 3. 언어 집합 • 추론 규칙 • 공리: a 문자열은 Simple의 원소 여기에 수식을 입력하십시오. • 𝑎 ∈ 𝑆𝑖𝑚𝑝𝑙𝑒 • 추론 규칙: • 만약 w 문자열이 Simple의 원소라면 wb 문자열도 Simple의 원소 • 𝑤 ∈ 𝑆𝑖𝑚𝑝𝑙𝑒 𝑤𝑏 ∈ 𝑆𝑖𝑚𝑝𝑙𝑒 • 귀납 정의 • 무한 집합을 유한하게 표현하는 방법 • 생성 규칙 : • 화살표 좌변의 기호열을 우변의 기호열로 교채(대치) 할 수 있음을 의미 • S -> a • S -> Sb • 문장 abb가 Simple의 원소임을 증명하 는 유도(derivation) • S -> Sb -> Sbb -> abb • 문장 형태 (Sentential form) : • 시작기호로부터 문장에 이르기까지 유도에 등장하는 기호열
  • 4. 언어의 문법 • 정형 문법 G=(T.N.S.P) • ex) G1 • 터미널 기호 집합 T (⊆ ∑) : • ex) T={a, b} • 넌터미널 기호 집합 N • ex) N = {S} • 시작 기호 S (∈ N) • ex) S • 생성규칙의 집합 P • ex) P = {S->a, S->Sb} = {S=> a | Sb} • BNF(Backus-Naur Form) • 프로그래밍 언어의 문법을 표현하기 위한 표 기법 • Algol60 정의에 처음 사용함 • 프로그래밍 언어의 대부분을 표기하기 위해 사용함 • 앞에서 표현된 생성규칙을 포함하여 다양한 변형이 존재함 (-> vs ::=, <> vs 대문자 표시) • EBNF(Extended BNF) • BNF 표기법에 다양한 매크로를 추가하여 편리하게 사용할 수 있도록 함 • 반복 {} : 0번 또는 그 이상 • 옵션 [] : 한 번 나오거나 나오지 않음을 의미 • 다중선택 () : 여러 개에서 하나를 선택 언어 Simple의 알파벳 ∑ = {a, b} Simple = {a, ab, abb, abbb, abbbb, …} Simple ⊆ ∑* Simple = { w | 문자열 w는 어떤 조건을 만족한다.} = { w | 문자열 w는 맨 앞에 a가 나오고 그 다음에 0개 이상의 b가 나온다}
  • 5. 언어 분류 • Chomsky의 분류 • 타입 0 : 무제한 문법 (Unrestricted Grammar) • Ex) 𝞪 -> 𝞫 생성규칙 형태에 제한이 없음 • 타입 1 : 문맥 민감 문법 (Context Sensitive Grammar) • Ex) 𝞪A𝞫 -> 𝞪𝞬𝞫 𝞪와 𝞫에 둘러싸였을 때만 A를 𝞬로 대치 할 수 있음 • 타입 2 : 문맥 자유 문법 (Context Free Grammar) • Ex) A -> 𝞪 언제든지 A를 𝞪로 대치할 수 있음 • 타입 3 : 정규 문법 (Regular Grammar) • Ex) A -> a | Ba A를 단 하나의 터미널이나 넌터미널 하나 와 터미널 하나로 된 문장 형태로 대치할 수 있음 • 타입 i+1는 타입 i의 특수한 형태임. • 따라서 단계적인 포함 관계를 가진다. 3 ⊆ 2 ⊆ 1 ⊆ 0 문법 언어 인식 기계 타입 0 : 무제한 문법 재귀나열 언어 (Recursively Enumerable Language) 튜링 기계 (Turing Machine) 타입 1 : 문맥 민감 문 법 문맥 민감 언어 (Context-Sensitive Language) 선형 바운드 오토마타 (Linear-Bounded Automata) 타입 2 : 문맥 자유 문 법 문맥 자유 언어 (Context-Free Language) 푸쉬다운 오토마타 (Push-Down Automata) 타입 3 : 정규 문법 정규 언어 (Regular Language) 유한 상태 기계 (Finite State Machine)