arXiv:2609.08571cs.FLSep 2026

Manuscript Offprint

arXiv:2609.08571

Solution to Bucher's density problem for context-free languages

Rastko Maslic, Jeffrey Shallit

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In 1980 Bucher asked whether, given context-free languages L⊆UL \subseteq U with U∖LU \setminus L infinite, there must be a context-free language KK between them for which both K∖LK \setminus L and U∖KU \setminus K are infinite. We give a negative answer.

We first construct an infinite language DD with context-free complement such that, for every regular language RR, either D∩RD \cap R or D∖RD \setminus R is finite. The words of DD encode computations of factorials; repetition of letters ensures that each finite automaton either accepts all but finitely many words of DD or rejects all but finitely many words of DD, while a one-counter automaton recognizes errors in the encodings. We then construct LL and UU from the complement of DD. A grammar argument shows that any context-free intermediate language KK would divide DD in the same way as some regular language. This proves the required impossibility. Both LL and UU can be taken over a binary alphabet.

1 Bucher’s problem and the main theorem