SlideShare a Scribd company logo
Prof.Neeraj Bhargava
Abhishek Kumar
Department of Computer Science
School of Engineering & System Sciences,
MDS, University Ajmer, Rajasthan, India
1
 A grammar express languages with the help of
four tuples:-
(Vn , ∑ , R , S)
• V is a finite set of variables/non-terminals
• Σ is a finite set of terminals
• S ∈ V is the start symbol
• R ⊆ (Σ∪V )∗×(Σ∪V )∗ is a finite set of
rules/productions.
We say γ1 α γ2 ⇒G γ1 β γ2 ,
iff (α → β) ∈ R. And L(G) = {w ∈ Σ∗|S ∗ ⇒G w}
2
Grammar Rules Languages
 Type 3 A → aB or A → a Regular
 Type 2 A → α Context
Free
 Type 1 α → β with |α|≤|β Context
Sensitive
 Type 0 α → β
Recursively
Enumerable
 Figure 2: In the above table, α,β ∈ (Σ∪V )∗,
A,B ∈ V and a ∈ Σ∪{}
3
 Example 2. Consider the grammar G with Σ = {a} with
S → $Ca# | a | ∈ Ca → aaC
$D → $C C# → D# | E a
D → Da aE → Ea
$E → ∈
The following are derivations in this grammar
S ⇒ $Ca# ⇒ $aaC# ⇒ $aaE ⇒ $aEa ⇒ $Eaa ⇒ aa
S ⇒ $Ca# ⇒ $aaC# ⇒ $aaD# ⇒ $aDa# ⇒ $Daa#
⇒ $Caa# ⇒ $aaCa# ⇒ $aaaaC# ⇒ $aaaaE
⇒ $aaaEa ⇒ $aaEaa ⇒ $aEaaa ⇒ $Eaaaa ⇒ aaaa
L(G) = {ai |i is a power of 2}
4
 Example 8. Consider the grammar G with Σ =
{a,b,c}, V = {S,B,C,H} and
S → aSBC | aBC CB → HB
HB → HC HC → BC
aB → ab bB → bb
bC → bc cC → cc
L(G) = {anbncn |n ≥ 0}
5
6

More Related Content

PPTX
2.5 ambiguity in context free grammars
PPTX
2.3 context free grammars and languages
PPTX
2.4 derivations and languages
PPTX
SET AND ITS OPERATIONS
PPTX
I lustrating sets using venn diagram
PPSX
Set Language And Notation
PPTX
Identifying subsets of a set
PDF
Lesson 47
2.5 ambiguity in context free grammars
2.3 context free grammars and languages
2.4 derivations and languages
SET AND ITS OPERATIONS
I lustrating sets using venn diagram
Set Language And Notation
Identifying subsets of a set
Lesson 47

What's hot (16)

PPTX
Mathematical skills II - Rearranging Equations
PPT
2.3 notes
PPTX
The principle of inclusion and exclusion for three sets by sharvari
PPTX
Principal of inclusion & exclusion for two sets by vishal maher
DOC
Mat 222 week 5 composition and inverse (ash)
PPTX
Aug 27th
PPT
Chapter1.5
PPT
Algerba in everyday Life
PPTX
Himpunan plpg
PPT
02 more on sets
PPTX
Discrete mathematics presentation
PPT
7.7 Transforming Formulas
PPTX
Maths designed in interactive way examples
DOCX
Rearranging formulas A1
PPT
Unit rate from convenience store
PPTX
Number System & Set Theory
Mathematical skills II - Rearranging Equations
2.3 notes
The principle of inclusion and exclusion for three sets by sharvari
Principal of inclusion & exclusion for two sets by vishal maher
Mat 222 week 5 composition and inverse (ash)
Aug 27th
Chapter1.5
Algerba in everyday Life
Himpunan plpg
02 more on sets
Discrete mathematics presentation
7.7 Transforming Formulas
Maths designed in interactive way examples
Rearranging formulas A1
Unit rate from convenience store
Number System & Set Theory
Ad

Similar to Grammar generated by language iii (20)

PPTX
RegularLanguageProperties [Autosaved].pptx
PPT
Simplifiaction of grammar
PPT
163692498 grammar
PPT
Normal-forms-for-Context-Free-Grammars.ppt
PDF
05 8640 (update email) multiset cs closure propertie (edit lafi)2
PDF
Syntax Analyzer.pdf
PPTX
Ch2 automata.pptx
PPT
computer Languages and Grammars.pptx and
PPT
Context free grammars
PPTX
Open course(programming languages) 20150211
PPTX
Open course(programming languages) 20150211
PPT
Class5
PPTX
Natural Language Processing - Writing Grammar
PPTX
Automata and Language Theory-Context Free Grammars
PPTX
language , grammar and automata
PPTX
lec02-Syntax Analysis and LL(1) (2).pptx
PDF
Flat unit 3
PPT
INFO-2950-Languages-and-Grammars.ppt
PDF
lec02-Syntax Analysis and LL(1).pdf
PPT
Integrated Fundamental and Technical Analysis of Select Public Sector Oil Com...
RegularLanguageProperties [Autosaved].pptx
Simplifiaction of grammar
163692498 grammar
Normal-forms-for-Context-Free-Grammars.ppt
05 8640 (update email) multiset cs closure propertie (edit lafi)2
Syntax Analyzer.pdf
Ch2 automata.pptx
computer Languages and Grammars.pptx and
Context free grammars
Open course(programming languages) 20150211
Open course(programming languages) 20150211
Class5
Natural Language Processing - Writing Grammar
Automata and Language Theory-Context Free Grammars
language , grammar and automata
lec02-Syntax Analysis and LL(1) (2).pptx
Flat unit 3
INFO-2950-Languages-and-Grammars.ppt
lec02-Syntax Analysis and LL(1).pdf
Integrated Fundamental and Technical Analysis of Select Public Sector Oil Com...
Ad

More from Dr. ABHISHEK K PANDEY (20)

PPTX
Digital to digital
PPTX
Digital to analog
PPTX
Analog to analog
PPTX
Wcdma interface sakshi
PPT
Utran architecture(rashmi)
PPTX
PPTX
Network topologies(chetan)
PPTX
Multiplexing II
PPTX
Est umts speech cells
PPTX
Digital to analog piyush sen
PPTX
Reguler grammar cfg
PPTX
Regular languag regular set
PPTX
Regular expression for dfa
PPTX
Pumping lemma
PPTX
Pumping lemma numerical
PPT
Pumping lemma for cfg
PPTX
Power of authomata
Digital to digital
Digital to analog
Analog to analog
Wcdma interface sakshi
Utran architecture(rashmi)
Network topologies(chetan)
Multiplexing II
Est umts speech cells
Digital to analog piyush sen
Reguler grammar cfg
Regular languag regular set
Regular expression for dfa
Pumping lemma
Pumping lemma numerical
Pumping lemma for cfg
Power of authomata

Recently uploaded (20)

PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPT
Occupational Health and Safety Management System
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
737-MAX_SRG.pdf student reference guides
PPTX
Fundamentals of Mechanical Engineering.pptx
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPT
introduction to datamining and warehousing
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
R24 SURVEYING LAB MANUAL for civil enggi
Abrasive, erosive and cavitation wear.pdf
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Occupational Health and Safety Management System
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
737-MAX_SRG.pdf student reference guides
Fundamentals of Mechanical Engineering.pptx
Information Storage and Retrieval Techniques Unit III
UNIT 4 Total Quality Management .pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Fundamentals of safety and accident prevention -final (1).pptx
introduction to datamining and warehousing
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Nature of X-rays, X- Ray Equipment, Fluoroscopy
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...

Grammar generated by language iii

  • 1. Prof.Neeraj Bhargava Abhishek Kumar Department of Computer Science School of Engineering & System Sciences, MDS, University Ajmer, Rajasthan, India 1
  • 2.  A grammar express languages with the help of four tuples:- (Vn , ∑ , R , S) • V is a finite set of variables/non-terminals • Σ is a finite set of terminals • S ∈ V is the start symbol • R ⊆ (Σ∪V )∗×(Σ∪V )∗ is a finite set of rules/productions. We say γ1 α γ2 ⇒G γ1 β γ2 , iff (α → β) ∈ R. And L(G) = {w ∈ Σ∗|S ∗ ⇒G w} 2
  • 3. Grammar Rules Languages  Type 3 A → aB or A → a Regular  Type 2 A → α Context Free  Type 1 α → β with |α|≤|β Context Sensitive  Type 0 α → β Recursively Enumerable  Figure 2: In the above table, α,β ∈ (Σ∪V )∗, A,B ∈ V and a ∈ Σ∪{} 3
  • 4.  Example 2. Consider the grammar G with Σ = {a} with S → $Ca# | a | ∈ Ca → aaC $D → $C C# → D# | E a D → Da aE → Ea $E → ∈ The following are derivations in this grammar S ⇒ $Ca# ⇒ $aaC# ⇒ $aaE ⇒ $aEa ⇒ $Eaa ⇒ aa S ⇒ $Ca# ⇒ $aaC# ⇒ $aaD# ⇒ $aDa# ⇒ $Daa# ⇒ $Caa# ⇒ $aaCa# ⇒ $aaaaC# ⇒ $aaaaE ⇒ $aaaEa ⇒ $aaEaa ⇒ $aEaaa ⇒ $Eaaaa ⇒ aaaa L(G) = {ai |i is a power of 2} 4
  • 5.  Example 8. Consider the grammar G with Σ = {a,b,c}, V = {S,B,C,H} and S → aSBC | aBC CB → HB HB → HC HC → BC aB → ab bB → bb bC → bc cC → cc L(G) = {anbncn |n ≥ 0} 5
  • 6. 6