SlideShare a Scribd company logo
2
Most read
3
Most read
8
Most read
Regular Grammar ( Theory of Computation)
A grammar is a 4-tuple G = (V,T,P,S)
 V: set of variables or nonterminals
 T: set of terminal symbols (terminals)
 P: set of productions
 S: a start symbol from V
 V = { S }, T = { 0, 1 }
 Productions:
S  
S  0S1
This grammar
represents strings
such as:
0011
000111
01

 Leftmost derivation: the leftmost variable is
always the one replaced when applying a
production
 Rightmost derivation: rightmost variable is
replaced
 A tree in graph theory is a set of nodes such
that
› There is a special node called the root
› Nodes can have zero or more child nodes
› Nodes without children are called leaves
› Interior nodes: nodes that are not leaves
 A parse tree for a grammar G is a tree such that
the interior nodes are non-terminals in G and
children of a non-terminal correspond to the
body of a production in G
 Yield: concatenation of leaves from left to
right
 If the root of the tree is the start symbol, and
all leaves are terminal symbols, then the
yield is a string in L(G)
 Note: a derivation always corresponds to
some parse tree
 Regular Language – Regular Language are
those languages which are accepted by finite
automaton.
 Regular Expression – Regular Expression
are used to denote Regular Languages.
 Regular Set – Any set that represent the
value of Regular Expression.
 In order to find out a regular expression of a
finite automaton we use Arden's theorem.
 Statement 1 - Let P & Q be two regular
expression.
 Statement 2 – If P doesn’t contain null string,
then R = Q + R P ( has a unique solution)
 i.e. , R= Q P*
 R = Q + R P
R = Q + ( Q + R P ) P
R = Q + Q P + R P 2
R = Q + Q P + ( Q + R P ) P 2
R = Q + Q P + Q P 2 + R P 3
R = Q ( Ф + P + P 2 + _ _ _ ) + R P n+ 1
R = Q ( P * ) + R P n + 1
R = Q P * + R P n + 1
 Union of two regular language are always be regular.
 Intersection of two regular language are always be
regular.
 Complement of two regular language are always be
regular.
 Difference of two regular language are always be
regular.
 Kleen closure operation over a regular language
always be a regular.
 Concatenation of two regular language are
always be regular.
 Reverse of two regular language are always
be regular.
 Pumping Lemma is used as a proof for
irregularity of a language. Thus, if a
language is regular, it always satisfies
pumping lemma. If there exists at least one
string made from pumping which is not in L,
then L is surely not regular.
 The opposite of this may not always be true.
That is, if Pumping Lemma holds, it does not
mean that the language is regular.
 It always consist of three variables i.e., x, y,
I, z.
 Where, X can be null or can hold value
 y can not be null and has a value in it.
 I is the power upon y which increment by
step .
 Z can be null or can hold value .
 x y z
Ф aa Ф
wxyiz i>0
Ф(aa)iФ = (aa)I
aaФL i=1
aaaФL i=2
Regular Grammar

More Related Content

PPT
Spiral model presentation
PPTX
UNIVERSITY MANAGEMENT SYSTEM.pptx
PPTX
Matlab simulink introduction
PPTX
STEAM AND GAS TURBINES ppt
PPTX
1s and 2s complement
PPTX
Presentation on science and technology
PPTX
Types of Compilers
PPTX
Bridge,types of bridges
Spiral model presentation
UNIVERSITY MANAGEMENT SYSTEM.pptx
Matlab simulink introduction
STEAM AND GAS TURBINES ppt
1s and 2s complement
Presentation on science and technology
Types of Compilers
Bridge,types of bridges

What's hot (20)

PPTX
Chomsky classification of Language
PPT
Regular expressions-Theory of computation
PDF
Parse Tree
PPTX
1.10. pumping lemma for regular sets
PDF
Ch3 4 regular expression and grammar
PPTX
LL(1) parsing
PPTX
Context free grammar
PPTX
Pumping lemma
PPTX
RECURSIVE DESCENT PARSING
PPTX
Turing machine by_deep
PPTX
Pumping lemma Theory Of Automata
PDF
Theory of Computation Lecture Notes
PPTX
Pushdown Automata Theory
PPTX
Introduction TO Finite Automata
PDF
Formal Languages and Automata Theory Unit 1
PPT
Turing Machine
PPTX
Turing machine
PPTX
First and follow set
PDF
Hill climbing algorithm in artificial intelligence
PPTX
Automata theory -RE to NFA-ε
Chomsky classification of Language
Regular expressions-Theory of computation
Parse Tree
1.10. pumping lemma for regular sets
Ch3 4 regular expression and grammar
LL(1) parsing
Context free grammar
Pumping lemma
RECURSIVE DESCENT PARSING
Turing machine by_deep
Pumping lemma Theory Of Automata
Theory of Computation Lecture Notes
Pushdown Automata Theory
Introduction TO Finite Automata
Formal Languages and Automata Theory Unit 1
Turing Machine
Turing machine
First and follow set
Hill climbing algorithm in artificial intelligence
Automata theory -RE to NFA-ε
Ad

Similar to Regular Grammar (20)

PPTX
hghghghhghghgggggggggggggggggggggggggggggggggg
PPTX
Unit-2. Regular Expressions and Languages.pptx
PDF
A new technique for proving non regularity based on the measure of a language
PDF
Formal Languages and Automata Theory unit 2
PPTX
Ch2 automata.pptx
PPTX
Chapter 4_Regular Expressions in Automata.pptx
PPT
Logic (PROPOSITIONS)
PPTX
Thoery of Computaion and Chomsky's Classification
PDF
Unit ii
PPTX
THEORYOFAUTOMATATHEORYOFAUTOMATATHEORYOFAUTOMATA.pptx
PPTX
dms.pptx
PDF
Flat unit 2
PPT
Closure Properties of Regular Languages.ppt
PDF
PDF
Prove that is L is regular and h is a homomorphism, then h(L) is.pdf
PDF
week01, the language of propositional logic.pdf
PPTX
Unit2 Toc.pptx
PPTX
Regular expressions
PDF
Tree Based Regular Languages
PPT
regular expression smmlmmmmmmmmmmmmm.ppt
hghghghhghghgggggggggggggggggggggggggggggggggg
Unit-2. Regular Expressions and Languages.pptx
A new technique for proving non regularity based on the measure of a language
Formal Languages and Automata Theory unit 2
Ch2 automata.pptx
Chapter 4_Regular Expressions in Automata.pptx
Logic (PROPOSITIONS)
Thoery of Computaion and Chomsky's Classification
Unit ii
THEORYOFAUTOMATATHEORYOFAUTOMATATHEORYOFAUTOMATA.pptx
dms.pptx
Flat unit 2
Closure Properties of Regular Languages.ppt
Prove that is L is regular and h is a homomorphism, then h(L) is.pdf
week01, the language of propositional logic.pdf
Unit2 Toc.pptx
Regular expressions
Tree Based Regular Languages
regular expression smmlmmmmmmmmmmmmm.ppt
Ad

More from Ruchika Sinha (20)

PPT
Python Programming Introduction - Loops & Boolean
PPTX
Difference Between Normal & Smart/Automated Home
PPT
Greedy Algorithms WITH Activity Selection Problem.ppt
PPT
Greedy with Task Scheduling Algorithm.ppt
PPT
Greedy Algorithms Huffman Coding.ppt
PPT
DynProg_Knapsack.ppt
PPT
Dijkstra.ppt
PPT
Greedy with Task Scheduling Algorithm.ppt
PPT
Clipping
PPT
Lec22 intel
PPTX
Pc assembly
PPT
PPTX
Installation of motherboard
PPT
Shortest path
PPT
Bellman ford algorithm
PPTX
Python material
PPT
Python3
PPT
Optimization problems
PPTX
Software Teting
PPTX
Backtrack search-algorithm
Python Programming Introduction - Loops & Boolean
Difference Between Normal & Smart/Automated Home
Greedy Algorithms WITH Activity Selection Problem.ppt
Greedy with Task Scheduling Algorithm.ppt
Greedy Algorithms Huffman Coding.ppt
DynProg_Knapsack.ppt
Dijkstra.ppt
Greedy with Task Scheduling Algorithm.ppt
Clipping
Lec22 intel
Pc assembly
Installation of motherboard
Shortest path
Bellman ford algorithm
Python material
Python3
Optimization problems
Software Teting
Backtrack search-algorithm

Recently uploaded (20)

PPTX
Sustainable Sites - Green Building Construction
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PDF
PPT on Performance Review to get promotions
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PDF
composite construction of structures.pdf
DOCX
573137875-Attendance-Management-System-original
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
Sustainable Sites - Green Building Construction
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Digital Logic Computer Design lecture notes
Automation-in-Manufacturing-Chapter-Introduction.pdf
OOP with Java - Java Introduction (Basics)
PPT on Performance Review to get promotions
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
R24 SURVEYING LAB MANUAL for civil enggi
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Internet of Things (IOT) - A guide to understanding
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
composite construction of structures.pdf
573137875-Attendance-Management-System-original
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Operating System & Kernel Study Guide-1 - converted.pdf

Regular Grammar

  • 1. Regular Grammar ( Theory of Computation)
  • 2. A grammar is a 4-tuple G = (V,T,P,S)  V: set of variables or nonterminals  T: set of terminal symbols (terminals)  P: set of productions  S: a start symbol from V
  • 3.  V = { S }, T = { 0, 1 }  Productions: S   S  0S1 This grammar represents strings such as: 0011 000111 01 
  • 4.  Leftmost derivation: the leftmost variable is always the one replaced when applying a production  Rightmost derivation: rightmost variable is replaced
  • 5.  A tree in graph theory is a set of nodes such that › There is a special node called the root › Nodes can have zero or more child nodes › Nodes without children are called leaves › Interior nodes: nodes that are not leaves  A parse tree for a grammar G is a tree such that the interior nodes are non-terminals in G and children of a non-terminal correspond to the body of a production in G
  • 6.  Yield: concatenation of leaves from left to right  If the root of the tree is the start symbol, and all leaves are terminal symbols, then the yield is a string in L(G)  Note: a derivation always corresponds to some parse tree
  • 7.  Regular Language – Regular Language are those languages which are accepted by finite automaton.  Regular Expression – Regular Expression are used to denote Regular Languages.  Regular Set – Any set that represent the value of Regular Expression.
  • 8.  In order to find out a regular expression of a finite automaton we use Arden's theorem.  Statement 1 - Let P & Q be two regular expression.  Statement 2 – If P doesn’t contain null string, then R = Q + R P ( has a unique solution)  i.e. , R= Q P*
  • 9.  R = Q + R P R = Q + ( Q + R P ) P R = Q + Q P + R P 2 R = Q + Q P + ( Q + R P ) P 2 R = Q + Q P + Q P 2 + R P 3 R = Q ( Ф + P + P 2 + _ _ _ ) + R P n+ 1 R = Q ( P * ) + R P n + 1 R = Q P * + R P n + 1
  • 10.  Union of two regular language are always be regular.  Intersection of two regular language are always be regular.  Complement of two regular language are always be regular.  Difference of two regular language are always be regular.  Kleen closure operation over a regular language always be a regular.
  • 11.  Concatenation of two regular language are always be regular.  Reverse of two regular language are always be regular.
  • 12.  Pumping Lemma is used as a proof for irregularity of a language. Thus, if a language is regular, it always satisfies pumping lemma. If there exists at least one string made from pumping which is not in L, then L is surely not regular.
  • 13.  The opposite of this may not always be true. That is, if Pumping Lemma holds, it does not mean that the language is regular.
  • 14.  It always consist of three variables i.e., x, y, I, z.  Where, X can be null or can hold value  y can not be null and has a value in it.  I is the power upon y which increment by step .  Z can be null or can hold value .
  • 15.  x y z Ф aa Ф wxyiz i>0 Ф(aa)iФ = (aa)I aaФL i=1 aaaФL i=2