The language {aᵐbⁿcᵐdⁿ | m, n ∈ ℕ} #
For letters a, b, c and d, Language.ambncmdn a b c d is the language of the words
aᵐbⁿcᵐdⁿ, in which the a block is matched by the c block and the b block by the d block,
so that the two dependencies cross. For distinct letters it is not context-free; it is the
language to which the argument of [Shi85] that Swiss German is not weakly context-free
reduces.
The pumping argument shows more: a language that contains aⁿbⁿcⁿdⁿ for infinitely many n, and
whose words have no more a than c and no more b than d, is not context-free. Pumping
aⁿbⁿcⁿdⁿ down and up forces the pumped window to carry as many a as c and as many b as
d, and a window no longer than the pumping length meets neither pair.
Main definitions #
Language.ambncmdn a b c d: the language{aᵐbⁿcᵐdⁿ | m, n ∈ ℕ}.
Main results #
Language.not_isContextFree_of_replicate_mem_of_count_le: a language containing infinitely many of the wordsaⁿbⁿcⁿdⁿ, whose words have no moreathancand no morebthand, is not context-free.Language.not_isContextFree_ambncmdn: for distinct letters,{aᵐbⁿcᵐdⁿ}is not context-free.
References #
The language {aᵐbⁿcᵐdⁿ | m, n ∈ ℕ} of the words consisting of m copies of the letter a,
n copies of b, m copies of c and n copies of d.
Equations
- Language.ambncmdn a b c d = {w : List α | ∃ (m : ℕ) (n : ℕ), List.replicate m a ++ List.replicate n b ++ List.replicate m c ++ List.replicate n d = w}
Instances For
A language containing aⁿbⁿcⁿdⁿ for infinitely many n, whose words have no more a than
c and no more b than d, is not context-free.
For distinct letters, {aᵐbⁿcᵐdⁿ} is not context-free.