
- Automata Theory - Applications
- Automata Terminology
- Basics of String in Automata
- Set Theory for Automata
- Finite Sets and Infinite Sets
- Algebraic Operations on Sets
- Relations Sets in Automata Theory
- Graph and Tree in Automata Theory
- Transition Table in Automata
- What is Queue Automata?
- Compound Finite Automata
- Complementation Process in DFA
- Closure Properties in Automata
- Concatenation Process in DFA
- Language and Grammars
- Language and Grammar
- Grammars in Theory of Computation
- Language Generated by a Grammar
- Chomsky Classification of Grammars
- Context-Sensitive Languages
- Finite Automata
- What is Finite Automata?
- Finite Automata Types
- Applications of Finite Automata
- Limitations of Finite Automata
- Two-way Deterministic Finite Automata
- Deterministic Finite Automaton (DFA)
- Non-deterministic Finite Automaton (NFA)
- NDFA to DFA Conversion
- Equivalence of NFA and DFA
- Dead State in Finite Automata
- Minimization of DFA
- Automata Moore Machine
- Automata Mealy Machine
- Moore vs Mealy Machines
- Moore to Mealy Machine
- Mealy to Moore Machine
- Myhill–Nerode Theorem
- Mealy Machine for 1’s Complement
- Finite Automata Exercises
- Complement of DFA
- Regular Expressions
- Regular Expression in Automata
- Regular Expression Identities
- Applications of Regular Expression
- Regular Expressions vs Regular Grammar
- Kleene Closure in Automata
- Arden’s Theorem in Automata
- Convert Regular Expression to Finite Automata
- Conversion of Regular Expression to DFA
- Equivalence of Two Finite Automata
- Equivalence of Two Regular Expressions
- Convert Regular Expression to Regular Grammar
- Convert Regular Grammar to Finite Automata
- Pumping Lemma in Theory of Computation
- Pumping Lemma for Regular Grammar
- Pumping Lemma for Regular Expression
- Pumping Lemma for Regular Languages
- Applications of Pumping Lemma
- Closure Properties of Regular Set
- Closure Properties of Regular Language
- Decision Problems for Regular Languages
- Decision Problems for Automata and Grammars
- Conversion of Epsilon-NFA to DFA
- Regular Sets in Theory of Computation
- Context-Free Grammars
- Context-Free Grammars (CFG)
- Derivation Tree
- Parse Tree
- Ambiguity in Context-Free Grammar
- CFG vs Regular Grammar
- Applications of Context-Free Grammar
- Left Recursion and Left Factoring
- Closure Properties of Context Free Languages
- Simplifying Context Free Grammars
- Removal of Useless Symbols in CFG
- Removal Unit Production in CFG
- Removal of Null Productions in CFG
- Linear Grammar
- Chomsky Normal Form (CNF)
- Greibach Normal Form (GNF)
- Pumping Lemma for Context-Free Grammars
- Decision Problems of CFG
- Pushdown Automata
- Pushdown Automata (PDA)
- Pushdown Automata Acceptance
- Deterministic Pushdown Automata
- Non-deterministic Pushdown Automata
- Construction of PDA from CFG
- CFG Equivalent to PDA Conversion
- Pushdown Automata Graphical Notation
- Pushdown Automata and Parsing
- Two-stack Pushdown Automata
- Turing Machines
- Basics of Turing Machine (TM)
- Representation of Turing Machine
- Examples of Turing Machine
- Turing Machine Accepted Languages
- Variations of Turing Machine
- Multi-tape Turing Machine
- Multi-head Turing Machine
- Multitrack Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- K-dimensional Turing Machine
- Enumerator Turing Machine
- Universal Turing Machine
- Restricted Turing Machine
- Convert Regular Expression to Turing Machine
- Two-stack PDA and Turing Machine
- Turing Machine as Integer Function
- Post–Turing Machine
- Turing Machine for Addition
- Turing Machine for Copying Data
- Turing Machine as Comparator
- Turing Machine for Multiplication
- Turing Machine for Subtraction
- Modifications to Standard Turing Machine
- Linear-Bounded Automata (LBA)
- Church's Thesis for Turing Machine
- Recursively Enumerable Language
- Computability & Undecidability
- Turing Language Decidability
- Undecidable Languages
- Turing Machine and Grammar
- Kuroda Normal Form
- Converting Grammar to Kuroda Normal Form
- Decidability
- Undecidability
- Reducibility
- Halting Problem
- Turing Machine Halting Problem
- Rice's Theorem in Theory of Computation
- Post’s Correspondence Problem (PCP)
- Types of Functions
- Recursive Functions
- Injective Functions
- Surjective Function
- Bijective Function
- Partial Recursive Function
- Total Recursive Function
- Primitive Recursive Function
- μ Recursive Function
- Ackermann’s Function
- Russell’s Paradox
- Gödel Numbering
- Recursive Enumerations
- Kleene's Theorem
- Kleene's Recursion Theorem
- Advanced Concepts
- Matrix Grammars
- Probabilistic Finite Automata
- Cellular Automata
- Reduction of CFG
- Reduction Theorem
- Regular expression to ∈-NFA
- Quotient Operation
- Parikh’s Theorem
- Ladner’s Theorem
Linear Grammar in Automata Theory
We have explained different types of grammars in automata including regular grammar and contextfree grammar. Related to regular grammar, there is another class of grammars called the linear grammars.
Linear grammar plays a crucial role in the theory of computation. In this chapter, we will explore the fundamentals of linear grammar, its types, and provide practical examples for a better understanding.
Grammar in Automata Theory
Grammar in automata theory refers to a set of rules that define the structure of strings in a language. These rules are used to generate all possible strings in a particular language, thereby defining the language itself.
It has several types, including −
- Type 0 (Unrestricted Grammar) − These have no restrictions on production rules.
- Type 1 (Context-Sensitive Grammar) − Here, the length of the output string must be greater than or equal to the length of the input string.
- Type 2 (Context-Free Grammar) − Production rules have a single non-terminal symbol on the left side.
- Type 3 (Regular Grammar) − These have strict production rules with either a single terminal or a terminal followed by a non-terminal.
Linear grammar falls under Type 3 (Regular Grammar), which has the idea of linear production rules.
What is Linear Grammar?
A linear grammar is a type of formal grammar where each production rule has at most one non-terminal symbol on the right-hand side of the production.
Linear grammar is significant because it describes a subset of regular languages and plays an important role in the design and analysis of finite automata.
Left-Linear and Right-Linear Grammar
Linear grammar can be further divided into two categories −
- Left-Linear Grammar − In this type, the non-terminal appears at the left end of the production rule. For example, a rule like is left-linear because the non-terminal appears on the left.
- Right-Linear Grammar − Here, the non-terminal appears at the right end of the production rule. For example, is right-linear as the non-terminal is on the right.
Both left-linear and right-linear grammars generate regular languages, which can be recognized by finite automata.
Examples of Linear Grammar
Let us see the idea of linear grammar through examples. We will see both the left and right linear grammars one by one for a better understanding.
Example of Left-Linear Grammar
Consider the following left-linear grammar production rules −
$$\mathrm{S \: \rightarrow \: Ab}$$
$$\mathrm{A \: \rightarrow \: Bb}$$
$$\mathrm{B \: \rightarrow \: a}$$
- The start symbol S produces Ab.
- The non-terminal A produces Bb.
- Finally, B produces a.
Example of Right-Linear Grammar
Consider the following right-linear grammar production rules −
$$\mathrm{S \: \rightarrow \: aA}$$
$$\mathrm{A \: \rightarrow \: bB}$$
$$\mathrm{B \: \rightarrow \: c}$$
- The start symbol S produces aA.
- The non-terminal A produces bB.
- Finally, B produces c.
Let us take another practical example. Consider a practical scenario where you need to design a finite automaton to recognize a language consisting of strings ending with a particular character, say "b". You could create a right-linear grammar for this language with the following rules −
$$\mathrm{S \: \rightarrow \: aS}$$
$$\mathrm{S \: \rightarrow \: b}$$
This grammar will generate strings like "ab", "aab", "aaab", etc., all ending with the terminal 'b'.
The Importance of Linear Grammar
Linear grammar is useful in several cases −
- Simplicity in Design − Linear grammar's simplicity makes it ideal for designing simple compilers and parsers, where efficiency is key.
- Finite Automata Representation − Linear grammars can easily be converted to finite automata, which are used in pattern matching, lexical analysis, and designing algorithms.
- Theoretical Foundations − Understanding linear grammar helps in understanding more complex topics like context-free grammars and pushdown automata, which are essential for advanced computation theory.
Conclusion
Linear grammar, particularly left-linear and right-linear grammars, is a fundamental concept in the theory of computation. In this chapter, we explored the concept of linear grammar including left and right linear grammars with examples. We also analysed where we need such grammars in automata theory.