Conversion of PDA Into Context Free Grammar and Vice Versa | PDA in TOC in hindi | Push Down Automata in Hindi | Context Free Grammar in Hindi
Conversion of PDA Into Context Free Grammar and Vice Versa | PDA in TOC in hindi | Push Down Automata in Hindi | Context Free Grammar in Hindi
यदि एक grammar G context-free है, तो हम equivalent nondeterministic PDA बना सकते हैं जो context-free grammar G द्वारा produced language को accept करता है। grammar G के लिए एक parser बनाया जा सकता है।
इसके अलावा, यदि P एक pushdown automaton है, तो एक equivalent context-free grammar G का निर्माण किया जा सकता है
L(G) = L(P)
Next two topic में, हम discuss करेंगे कि कैसे PDS से CFG में convert करें और vice versa।
Algorithm to find PDA corresponding to a given CFG
Input − A CFG, G = (V, T, P, S)
Output − Equivalent PDA, P = (Q, ∑, S, δ, q0, I, F)
Step 1 − CFG के production को GNF में बदलें।
Step 2 − PDA के पास केवल एक state {Q} होगा।
Step 3- CFG का start symbol PDA में start symbol होगा।
Step 4 - CFG के All non-terminals PDA के stack symbols होंगे और CFG के all terminals PDA के input symbols होंगे।
Step 5 - A → aX के रूप में each production के लिए जहां A terminal है और A, aX terminals और non-terminals का combination है, एक transition δ (q, a, A) बनाते हैं।
Problem
Construct a PDA from the following CFG.
G = ({S, X}, {a, b}, P, S)
where the productions are −
S → XS | ε , A → aXb | Ab | ab
Solution
Let the equivalent PDA,
P = ({q}, {a, b}, {a, b, X, S}, δ, q, S)
where δ −
δ(q, ε , S) = {(q, XS), (q, ε )}
δ(q, ε , X) = {(q, aXb), (q, Xb), (q, ab)}
δ(q, a, a) = {(q, ε )}
δ(q, 1, 1) = {(q, ε )}
किसी दिए गए PDA के corresponding CFG find के लिए Algorithm
Input − A CFG, G = (V, T, P, S)
Output − Equivalent PDA, P = (Q, ∑, S, δ, q0, I, F) such that the non- terminals of the grammar G will be {Xwx | w,x ∈ Q} and the start state will be Aq0,F.
Step 1 − For every w, x, y, z ∈ Q, m ∈ S and a, b ∈ ∑, if δ (w, a, ε) contains (y, m) and (z, b, m) contains (x, ε), add the production rule Xwx → a Xyzb in grammar G.
Step 2 − For every w, x, y, z ∈ Q, add the production rule Xwx → XwyXyx in grammar G.
Step 3 − For w ∈ Q, add the production rule Xww → ε in grammar G.
Related Post
- What is Automata machine in hindi | Examples of automata machines
- Finite Automata as a language acceptor and translator | Deterministic Finite Automata (DFA) | Nondeterministic Finite Automata(NFA) in Hindi
- What is Moore machines and mealy machines in Hindi
- What is Turing machine (composite machine) in toc in hindi
- Conversion from Mealy to Moore and vice versa in Hindi
- Non Deterministic Finite Automata in Hindi (NDFA)
- Deterministic Finite Automaton in Hindi (DFA) | Deterministic Finite-State Machine (DFSM)
- Conversion of NDFA to DFA in Hindi
- Arden's Theorem in TOC in Hindi
- Minimization of DFA in Hindi (Minimization of Automata Machines)
- Regular Expression in TOC in Hindi
- Union process in DFA | What is Union process in TOC
- Intersection of Finite Automata in Hindi
- Properties of Context Free Languages Hindi
- Two-way Deterministic Finite Automaton (2DFA) in Hindi
- Types of Grammar in TOC in Hindi | Chomsky Hierarchy in Theory of Computation
- Derivation Tree in TOC in Hindi
- Ambiguity in Grammar in TOC in Hindi
- Simplification of context free grammar in Hindi
- Conversion of grammar to automata machine and vice versa in Hindi
- Chomsky normal form and Greibach normal form in hindi
- What is Pushdown Automata in TOC in Hindi
- Example of PDA in Hindi | Example of Pushdown Automata in Hindi
- Deterministic pushdown automaton And Non-Deterministic pushdown automaton in Hindi
- Conversion of PDA Into Context Free Grammar and Vice Versa | PDA in TOC in hindi | Push Down Automata in Hindi | Context Free Grammar in Hindi
- CFG equivalent to PDA in hindi | context free grammar equivalent to push down automata in hindi | toc tutorial in hindi | theory of computation in hindi
- Petri Net Model in Hindi | Theory of Computation (TOC) Explained
- Techniques for Turing Machine Construction in Hindi
- Universal Turing Machine and Multitape in Hindi
- Multihead Turing Machine और Multidimensional Turing Machine की विशेषताएँ और अंतर
- NP Complete Problem in Hindi