1
$\begingroup$

Suppose $L$ is an arbitrary formal language over a finite alphabet $A$, and suppose that $L$ is closed under prefixes (i.e. if $w \in L$, and $u$ is any prefix of $w$, then $u \in L$).

Knowing only this, can you give any positive or negative decidability or complexity results about $L$?

Thanks! :)

$\endgroup$

2 Answers 2

1
$\begingroup$

If $P$ and $Q$ are languages closed under prefix, then $P\cup Q$, $P\cap Q$, $P \cdot Q$, $P/Q$ are also closed under prefix. Also you can think of such a language $L$ as a directed tree. Define the graph/tree $G = (V,E)$ where $V = L$ and $$E = \{(\mathit{prefix}(w),w) \mid w\in L \}$$ (the words are the nodes and the parent of every word is its prefix). Note that I assume that $\mathit{prefix}(x) = \varepsilon$ for all $x\in\Sigma$, meaning that the prefix of a single symbol is the empty word. Thus the root of the tree constructed above is the empty word. The constructed tree can be easily transformed to a DFA recognizing the language (I think you can see how).

$\endgroup$
0
$\begingroup$

Let $L$ be an arbitrary language. Since the set of all words is countable, we can think of $L$ as a subset of $\mathbb{N}$. Let $\ell_i = 1$ if $i \in L$, and $\ell_i = 0$ if $i \notin L$. Define the language $L'$ of all words of the form $\ell_1 \ldots \ell_n$. The language $L'$ inherits many properties of $L$, and is prefix-closed.

$\endgroup$
5
  • $\begingroup$ Properties like what? And do you need some special property of the injection from $L$ to $\mathbb{N}$ or will any injection $L \rightarrow \mathbb{N}$ work? $\endgroup$ Commented Sep 17, 2020 at 21:19
  • $\begingroup$ I will use the injection $\epsilon,0,1,00,01,10,11,000,\ldots$ (take binary representation of $n+1$ and remove leading $1$). The language $L'$ is computable iff $L$ is, for example. You can try your favorite properties to see whether they are also preserved. $\endgroup$ Commented Sep 17, 2020 at 21:20
  • $\begingroup$ You are assuming L is a binary language, but that answers my question well enough anyway (i.e. you need a particular injection). This isn't so interesting then because all you are doing is a simple change of alphabet so of course a computable image of a computable language is computable and a computable image of a non-computable language is not (tautologically). That is not even specific to prefix-closed languages but holds for any language and so doesn't answer my question at all. $\endgroup$ Commented Sep 17, 2020 at 23:09
  • $\begingroup$ My point is that there is absolutely nothing special about prefix-closed languages. $\endgroup$ Commented Sep 17, 2020 at 23:11
  • $\begingroup$ If $L$ is not over the binary alphabet, then this makes absolutely no difference. Use your imagination to generalize everything to arbitrary finite alphabets. $\endgroup$ Commented Sep 17, 2020 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.