HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Conjecture: a half of a pairing context-free language must be a regular language

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
pairingmustfreeregularlanguageconjecturecontexthalf

Problem

If $A$ and $B$ are languages, let $A\bowtie B$ denote the set of strings made by concatenating any word from $A$ and any word from $B$ of equal length.

$$A\bowtie B \equiv \{ ab : a\in A,\;b\in B, |a|=|b|\}.$$

You can prove using regular grammars that if $A$ and $B$ are regular, then $A\bowtie B$ is context free. I am wondering about the converse. Specifically, this conjecture:

Conjecture: If $A\bowtie B$ is context-free, and the strings in $A$ and $B$ have the same lengths $\{|a| : a\in A\}=\{|b| : b\in B\}$, then $A$ and $B$ are regular.

The intuition behind the conjecture is that the pushdown stack can be used to ensure that $A$ and $B$ are the same length, or to generate complex internal structure within $A$ and $B$ (such as palindromes or matching character counts) but not both simultaneously.

I haven't been able to prove this, even for the simple case where $B$ is the language of all strings. Unfortunately, I've also not been able to find a counterexample.

So far I have tried:

  • Using Parikh's theorem, Odgen's lemma, and the pumping lemma for CFLs.



  • Using generating functions—regular languages have rational gfs and unambiguous cfls have algebraic gfs, but not conversely.



  • Using the Chomsky-Schutzenberger theorem and trying to catalogue parentheses based on whether their image is always in the left/right half of the derived string.



  • Showing that the conjecture holds when the alphabets are distinct. This turns out to be easy to prove (using Chomsky normal form). But I don't have any indication that if $A\bowtie B$ is context free then it is also the homomorphic image of a context free language $A^\prime \bowtie B^\prime$, where $A$ and $B$ have distinct alphabets.



Any advice is appreciated.

Solution

No, this conjecture is not true.

Consider $A=\{0^n1^n \mid n\geqslant0 \}$ and $B=\{1^{2n}\mid n\geqslant0\}$.

We have $\{|a| : a\in A\}=\{|b| : b\in B\}=\{2n\mid n\geqslant0\}$ and $A\bowtie B = \{ 0^n1^{3n}\mid n\geqslant0\}$.

While $A\bowtie B$ is context-free, $A$ is not regular.

Context

StackExchange Computer Science Q#151275, answer score: 12

Revisions (0)

No revisions yet.