Toc - Unit-Ii
Toc - Unit-Ii
E.g.,
iv. E T | E+T
v. T F | T*F
vi. F I | (E)
vii. I a | b | Ia | Ib | I0 | I1
How to eliminate unit productions?
viii. Replace E T with E F | T*F
ix. Then, upon recursive application wherever there is a unit production:
i. E F | T*F | E+T (substituting for T)
ii. E I | (E) | T*F| E+T (substituting for F)
iii. E a | b | Ia | Ib | I0 | I1 | (E) | T*F | E+T (substituting
for I)
iv. Now, E has no unit productions
Similarly, eliminate for the remainder of the unit productions
PART-A
PART-B
1. a) Let G be a CFG and let a=>w in G. Then show that there is a leftmost
derivation of w.
b) Let G=(V,T,P,S) be a Context free Grammar then prove that if S=> αthen there is a
δ(q0,b,z0)={(q0,zz0)}
δ(q0,b,z)={(q0,zz)}
δ(q0,a,z)={(q1,z)}
δ(q1,b,z)={(q1, ε)}
δ(q1,a,z0)={(q0,z0)}
5. a)If L is Context free language then prove that there exists PDA M such that L=N(M).
b)Define deterministic Push Down Automata DPDA. Is it true that DPDA and PDA are
equivalent in the sense of language acceptance is concern? Justify Your answer.
b)Find the left most and right most derivation corresponding to the tree.