Convert the CFG(s) in the following problems into equivalent PDAs:
a.
E → E + T | T
T → T x F | F
F → (E) | a
b.
R → XRX | S
S → aT b | bT a
T → XT X | X | ε
X → a | b
c.
A → BAB | B | ε
B → 00 | ε



Convert the CFG(s) in the following problems into equivalent PDAs: a. E → E + T...
Question 2 (20%) Convert the following CFG into an equivalent CFG in Chomsky normal form using the procedure discussed in the textbook. Show every step in the conversion. A → ABC A → a | ε B → b C → c
Convert the grammar which given below into Chomsky normal form R → XRX | S S → aTb | bTa T → XTX | X | ε X → a | b Automata and Computation
Exercise 3. Convert the following CFG into an equivalent CFG in Chomsky normal form using the procedure seen in class.
Problem 2. Consider the following CFG G-(V. Σ' R, S) where V-(S, U, W), Σ- {a, b), the start variable is S, and the rules R are: Convert G to an equivalent PDA using the construction described in Lemma 2.21
For the following problems assume y = Χβ + ε and assume E(e) 0 and var(e) σ21. 3. Show that έ (1-X (XTX)-XT) ε. (Hint: Use the assumption that y + ε)
12. Use the following SDT to convert an infix expression (9*3+2) to it post-fix equivalent. Semantic rules Production (print(")) ) (priot ()) () (print (num.lval)) E E+T T TP- [5 marks F num 13. Briefly explain the relevance of DAG and TAC at the Intermediate code generation phase. Give an example of DAG(Directed Acyclic Graph) with its equivalent TAC(Three-Address Code). [6 marks 14. Parser table is very important in predictive parsing; construct a parser table for the following CFG: S...
The following context-free grammar (CFG) generates palindromes. This CFG has the following rules: S → ε, S → a, S → b, ..., S → z, S → aSa, S → bSb, ..., S → zSz. On an example of a palindrome cattac, show, step-by-step, how this palindrome will be generated by this grammar.
Theory of Computation - Push Down Automata (PDA) and Context
Free Grammars (CFG)
Problem 1. From a language description to a PDA Show state diagrams of PDAs for the following languages: a. The set of strings over the alphabet fa, b) with twice as many a's as b's. Hint: in class, we showed a PDA when the number of as is the same as the number of bs, based on the idea of a counter. + Can we use a...
Consider the context-free grammar with the rules (E is start variable) E → E + T | T T → T × F | F F → ( E ) | a Convert CFG to an equivalent PDA using the procedure given in Theorem 2.20.
Convert the following bearings to azimuths: a. N 22 59’ 00” E b. S 29 46’ 00” W c. N 2934’ 00” W d. S 4618’ 00” E e. N 8101’ 00” W Convert the following azimuths to bearings: f. 45 30’ 00” g. 13200’ 00” h. 18128’ 00” i. 269 59’ 59” j. What is the angle between a. and c. above