So the question: Any regular language is context-free
So here is my proof by construction :
Let M=(Q,Σ,δ,q_0,F) be some DFA that accepts a regular language L. We construct a grammar G=(V,Σ,R,S) such that L(G)= L(M) as follows:
V={| q ∈ Q }
S=;where
is the start symbol of M
R =∪
where
→ ϵ iff δ(q,a) = f,where f∈F}
R={→a
iff δ(q,a)= r }
The above construction works because if the DFA goes from a stateto a state
for an input x∈Σ then the CFG does something similar. That is, the CFG generates x and the goes onto the next variable that is, it
generates
thus effectively, going to the next variable. We also add a rule the handle accepting states, that is if
goes to the state
where
∈F, then our CFG just terminates outputting epsilon. So we see that our CFG generates the input read from the DFA M, thusL(G)= L(M).
Is the construction correct? Is the above explanation sufficient to show that the construction is correct? Please check it for technical loop holes. Thanks for helping me again. Seems like your the only one that knows their stuff


LinkBack URL
About LinkBacks

