Is language of prefixes of context-sensitive language context-sensitive

46 Views Asked by At

Given is a context-sensitive language $L$. Is the language ${\sf pref}(L)$, containing all prefixes of $L$ words, also context-sensitive?

${\sf pref}(L)=\{w \mid \exists w', ww' \in L \}$

Alternatively, are CSLs closed under quotient with regular languages?

Similar results for deterministic CSLs will also be appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

No. Consider the language $L_{\text{halts-in}}$ that contains the words $\text{enc}(T) c^n$ such that the Turing machine $T$ that uses a binary tape alphabet halts in exactly $n$ steps on empty input. Here $\text{enc}$ is any reasonable encoding of such machines into words over $\{a,b\}$. This language is deterministic context-sensitive since a universal Turing machine can simulate $n$ steps of any binary Turing machine $T$ in linear space (I leave the details to the reader). Finally, $\text{enc}(T) c \in \text{pref}(L_{\text{halts-in}})$ if and only if $T$ eventually halts on empty input, which is uncomputable, so $\text{pref}(L_{\text{halts-in}})$ is an uncomputable language. In particular it's not context-sensitive.