Problem Detail: For a formal language $L subseteq Sigma^{*}$ I define the set Pref(L) to be: $text{pref}(L) = {alpha in Sigma^{*} : exists beta in Sigma^{*} text{ such that } alpha beta in L}$ ie. the set of all (not necessarily proper) prefixes of words in $L$. I know that if $L$ is context-free then pref(L) is context-free but if $L$ is deterministic context-free then is pref(L) deterministic context-free? I am sure this is known but I cannot find the answer anywhere and it’s not in Hopcroft and Ullman.
Asked By : Sam Jones
Answered By : Sam Jones
DCFL are known to be closed under quotient with regular languages, but the quotient of $L$ with $Sigma^{*}$ is precisely $text{pref}(L)$ so yes, if $L$ is a DCFL then $text{pref}(L)$ is a DCFL.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/4924