- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- 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
How to convert FA to Right Linear Regular Grammar?
A grammar with at most one variable at the right side of production is called linear grammar.
Right Linear Grammar
A grammar is right linear grammar where all the non terminals in the right hand sides are at the right end.
Algorithm for conversion
The algorithm to convert the finite automata (FA) to the right linear grammar is as follows −
Step 1 − Begin the process from the start state.
Step 2 − Repeat the process for each state.
Step 3 − Write the production as the output followed by the state on which the transition is going.
Step 4 − And at last, add € (epsilon) to end the derivation.
Let’s consider a Finite automaton (FA) as given below −
Pick the start state A and output is on symbol ‘a’ going to state B
Now we will pick state B and then we will go on each output
Final right linear grammar is as follows −
Start with state A which is an initial state the output on symbol ‘a’ goes to A and B and the output on symbol ‘b’ goes to A. Now the production rule of right linear grammar is −
Now pick state B and then go on each output the right linear grammar is −
The final right linear grammar for the given finite automata is −
Kickstart Your Career
Get certified by completing the courseGet Started