- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the simplification of context free grammar in TOC
A context free grammar (CFG) is a forma grammar which is used to generate all possible patterns of strings in a given formal language.
It is defined as four tuples −
G=(V,T,P,S)
Where,
- G is a grammar, which consists of a set of production rules. It is used to generate the strings of a language.
- T is the final set of terminal symbols. It is denoted by lower case letters.
- V is the final set of non-terminal symbols. It is denoted by capital letters
- P is a set of production rules, which is used for replacing non-terminal symbols (on the left side of production) in a string with other terminals (on the right side of production).
- S is the start symbol used to derive the string
All grammars are not always optimized, which means the grammar may consist of some extra symbols(non-terminals) which increase the length of grammar.
So, we have to reduce the grammar by removing useless symbols.
Properties
The properties to reduce the grammar are as follows −
- Each non-terminal and terminal of G appears in the derivation of some word in L.
- There should not be any production as X->Y where X and Y are non-terminals.
- If epsilon is not in language L then there need not be in the production X-> ε.
The uses of reducing the grammar are explained below −
- Related Articles
- Explain removing unit productions in context free grammar
- What is context free grammar? Explain with examples
- Explain about CYK Algorithm for Context Free Grammar
- What is Context-Free Grammar?
- Convert the given Context free grammar to CNF
- Explain the concept of grammar in TOC
- How to generate the language for context free grammar?
- Explain Type-0 grammar in TOC
- Explain Type-1 grammar in TOC
- Generate a CNF for a given context free grammar
- How to convert context free grammar to push down automata?
- Explain the relationship between grammar and language in TOC
- Generate a Context-free grammar for the language L = {anbm| m≠n}?
- Explain about left linear regular grammar in TOC
- Explain Operator grammar and precedence parser in TOC

Advertisements