Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Let G be the grammar S -> 0B | 1A, A -> 0 | 0S | 1AA, B ->1 | 1S | 0BB.
For the string 00110101, find (a) the leftmost derivation, (b) the rightmost derivation, and (c) the derivation tree.
00110101
Module-2 Context Free Grammer and Push Down Autometa.pptx
S ->aAS Ia, A->SbA ISS Iba
Module-2 Context Free Grammer and Push Down Autometa.pptx
If G is the grammar S  SbS | a, show that G is ambiguous.
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Build the reduced Context-free Grammar without null productions equivalent to the following grammar:
S→ABAC
A→aA | ϵ
B→aB | ϵ
C→c
Module-2 Context Free Grammer and Push Down Autometa.pptx
Build the simplified Context-free Grammars equivalent to the given grammars.
(i) SAB
Aa | B
Bb | C
CaC
Db
(ii) S0A0 | 1B1 | BB
AC
BA
Cε
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
1. (i) Do left factoring for the following grammar:
S  AS | AbS | A | a
A  aB | aBS | a
B  bA | b
(ii) Do left factoring for the following grammar:
A  aAB | aA | a
B  bB | b
(ii) Do left factoring for the following grammar:
A  aAB | aA | a
B  bB | b
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Find a grammar in Chomsky normal form equivalent to S  aAbB, A  aA | a. B  bB | b.
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Reduce the following grammar G to CNF. G is S  aAD, A  aB I bAB, B  b. D  d.
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Find a grammar in GNF equivalent to the grammar
E  E + T | T,
T  T * F | F
F  (E) | a
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
S A0, A  0B. B  A0, B ---j 1
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
DefInition 7.1 A pushdown automaton consists of
(i) a finite nonempty set of states denoted by Q,
(ii) a finite nonempty set of input symbols denoted by :,
(iii) a finite nonempty set of pushdown symbols denoted by r,
(iv) a special state called the initial state denoted by qo,
(v) a special pushdown symbol called the initial symbol on the
pushdown store denoted by Zo.
(vi) a set of final states, a subset of Q denoted by F, and
(vii) a transition function δ from Q × ( u {A}) x r to the
set of finite subsets of Q × r*.
Symbolically. a pda is a 7-mple, namely (Q, , r, δ, qo, Zo, F).
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Construct the PDA to the following grammar:
S→aAA, A→aS | bS | a
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Convert the following Push Down Automata to Context Free Grammar
M = ({q0,q1},{a,b}{z0,za},δ,q0,z0,φ) where δ is given by
δ(q0,a,z0) =(q0, zaz0)
δ(q0,a, za) =(q0,zaza)
δ(q0,b, za) =(q1,Є)
δ(q1,b, za) =(q1,Є)
δ(q1, Є, z0) =(q1,Є)
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Construct CFG for the PDA M=({q0,q1},{0,1},{R,Z0},δ, q0,Z0,φ) where δ is given
by
δ(q0,1,Z0)={(q0,RZ0)}
δ(q0,1,R)={(q0,RR)}
δ(q0,0,R)={(q1,R)}
δ(q1,0,Z0)={(q0,Z0)}
δ(q0,ε,Z0)={(q0,ε)}
δ(q1,1,R)={(q1,ε)}
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Construct CFG for the PDA M=({q0,q1},{0,1},{R,Z0},δ, q0,Z0,φ) where δ is given
by
δ(q0,1,Z0)={(q0,RZ0)}
δ(q0,1,R)={(q0,RR)}
δ(q0,0,R)={(q1,R)}
δ(q1,0,Z0)={(q0,Z0)}
δ(q0,ε,Z0)={(q0,ε)}
δ(q1,1,R)={(q1,ε)}
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx
Module-2 Context Free Grammer and Push Down Autometa.pptx

More Related Content

PPT
Normal-forms-for-Context-Free-Grammars.ppt
PPT
Integrated Fundamental and Technical Analysis of Select Public Sector Oil Com...
PPTX
Theory of Automata and CGFG for learning
PDF
Formal Languages and Automata Theory unit 3
PPT
2. context free langauages
PPT
Simplifiaction of grammar
PDF
Chomsky hierarchy
PDF
Context free langauges
Normal-forms-for-Context-Free-Grammars.ppt
Integrated Fundamental and Technical Analysis of Select Public Sector Oil Com...
Theory of Automata and CGFG for learning
Formal Languages and Automata Theory unit 3
2. context free langauages
Simplifiaction of grammar
Chomsky hierarchy
Context free langauges

Similar to Module-2 Context Free Grammer and Push Down Autometa.pptx (20)

PPT
Context free grammars
PDF
Formal Languages and Automata Theory unit 4
PPT
NORMAL-FORMS.ppt
PPT
NORMAL-FORMS.ppt
PPTX
Theory of Computation Unit 3
PDF
Syntax Analysis PPTs for Third Year Computer Sc. and Engineering
DOCX
V cse cs6503 model qb1 1
PPT
context free grammars automata therory and compiler design
DOCX
Normal Forms for Context Free Grammers.docx
PPT
Context Free Languages by S.Mandal-1.ppt
PDF
contextfreegrammars-120925004035-phpapp02.pdf
PPTX
Natural Language Processing - Writing Grammar
PPT
Chomsky_Greibach-Hector-Chavez.ppt
PPT
Chomsky_GreibachNF.ppt
PPTX
5-Introduction to Parsing and Context Free Grammar-09-05-2023.pptx
PPT
FiniteAutomata.ppt
PPT
FiniteAutomata (1).ppt
PDF
L3 cfg
PPT
Chapter Three(2)
Context free grammars
Formal Languages and Automata Theory unit 4
NORMAL-FORMS.ppt
NORMAL-FORMS.ppt
Theory of Computation Unit 3
Syntax Analysis PPTs for Third Year Computer Sc. and Engineering
V cse cs6503 model qb1 1
context free grammars automata therory and compiler design
Normal Forms for Context Free Grammers.docx
Context Free Languages by S.Mandal-1.ppt
contextfreegrammars-120925004035-phpapp02.pdf
Natural Language Processing - Writing Grammar
Chomsky_Greibach-Hector-Chavez.ppt
Chomsky_GreibachNF.ppt
5-Introduction to Parsing and Context Free Grammar-09-05-2023.pptx
FiniteAutomata.ppt
FiniteAutomata (1).ppt
L3 cfg
Chapter Three(2)
Ad

Recently uploaded (20)

PPTX
Microsoft User Copilot Training Slide Deck
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
SaaS reusability assessment using machine learning techniques
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Advancing precision in air quality forecasting through machine learning integ...
Microsoft User Copilot Training Slide Deck
Connector Corner: Transform Unstructured Documents with Agentic Automation
SaaS reusability assessment using machine learning techniques
Enhancing plagiarism detection using data pre-processing and machine learning...
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
MuleSoft-Compete-Deck for midddleware integrations
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Electrocardiogram sequences data analytics and classification using unsupervi...
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
Basics of Cloud Computing - Cloud Ecosystem
Co-training pseudo-labeling for text classification with support vector machi...
SGT Report The Beast Plan and Cyberphysical Systems of Control
Rapid Prototyping: A lecture on prototyping techniques for interface design
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Convolutional neural network based encoder-decoder for efficient real-time ob...
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Advancing precision in air quality forecasting through machine learning integ...
Ad

Module-2 Context Free Grammer and Push Down Autometa.pptx

  • 18. Let G be the grammar S -> 0B | 1A, A -> 0 | 0S | 1AA, B ->1 | 1S | 0BB. For the string 00110101, find (a) the leftmost derivation, (b) the rightmost derivation, and (c) the derivation tree. 00110101
  • 20. S ->aAS Ia, A->SbA ISS Iba
  • 22. If G is the grammar S  SbS | a, show that G is ambiguous.
  • 30. Build the reduced Context-free Grammar without null productions equivalent to the following grammar: S→ABAC A→aA | ϵ B→aB | ϵ C→c
  • 32. Build the simplified Context-free Grammars equivalent to the given grammars. (i) SAB Aa | B Bb | C CaC Db (ii) S0A0 | 1B1 | BB AC BA Cε
  • 43. 1. (i) Do left factoring for the following grammar: S  AS | AbS | A | a A  aB | aBS | a B  bA | b (ii) Do left factoring for the following grammar: A  aAB | aA | a B  bB | b
  • 44. (ii) Do left factoring for the following grammar: A  aAB | aA | a B  bB | b
  • 51. Find a grammar in Chomsky normal form equivalent to S  aAbB, A  aA | a. B  bB | b.
  • 54. Reduce the following grammar G to CNF. G is S  aAD, A  aB I bAB, B  b. D  d.
  • 57. Find a grammar in GNF equivalent to the grammar E  E + T | T, T  T * F | F F  (E) | a
  • 64. S A0, A  0B. B  A0, B ---j 1
  • 68. DefInition 7.1 A pushdown automaton consists of (i) a finite nonempty set of states denoted by Q, (ii) a finite nonempty set of input symbols denoted by :, (iii) a finite nonempty set of pushdown symbols denoted by r, (iv) a special state called the initial state denoted by qo, (v) a special pushdown symbol called the initial symbol on the pushdown store denoted by Zo. (vi) a set of final states, a subset of Q denoted by F, and (vii) a transition function δ from Q × ( u {A}) x r to the set of finite subsets of Q × r*. Symbolically. a pda is a 7-mple, namely (Q, , r, δ, qo, Zo, F).
  • 86. Construct the PDA to the following grammar: S→aAA, A→aS | bS | a
  • 90. Convert the following Push Down Automata to Context Free Grammar M = ({q0,q1},{a,b}{z0,za},δ,q0,z0,φ) where δ is given by δ(q0,a,z0) =(q0, zaz0) δ(q0,a, za) =(q0,zaza) δ(q0,b, za) =(q1,Є) δ(q1,b, za) =(q1,Є) δ(q1, Є, z0) =(q1,Є)
  • 94. Construct CFG for the PDA M=({q0,q1},{0,1},{R,Z0},δ, q0,Z0,φ) where δ is given by δ(q0,1,Z0)={(q0,RZ0)} δ(q0,1,R)={(q0,RR)} δ(q0,0,R)={(q1,R)} δ(q1,0,Z0)={(q0,Z0)} δ(q0,ε,Z0)={(q0,ε)} δ(q1,1,R)={(q1,ε)}
  • 97. Construct CFG for the PDA M=({q0,q1},{0,1},{R,Z0},δ, q0,Z0,φ) where δ is given by δ(q0,1,Z0)={(q0,RZ0)} δ(q0,1,R)={(q0,RR)} δ(q0,0,R)={(q1,R)} δ(q1,0,Z0)={(q0,Z0)} δ(q0,ε,Z0)={(q0,ε)} δ(q1,1,R)={(q1,ε)}