This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Simplest Non-Regular Deterministic Context-Free Language

Petr Jančar Dept of Computer Science, Faculty of Science, Palacký University Olomouc, Czechiapetr.jancar@upol.cz Jiří Šíma Institute of Computer Science of the Czech Academy of Sciences, Prague, Czechiasima@cs.cas.cz
Abstract

We introduce a new notion of 𝒞\mathcal{C}-simple problems for a class 𝒞\mathcal{C} of decision problems (i.e. languages), w.r.t. a particular reduction. A problem is 𝒞\mathcal{C}-simple if it can be reduced to each problem in 𝒞\mathcal{C}. This can be viewed as a conceptual counterpart to 𝒞\mathcal{C}-hard problems to which all problems in 𝒞\mathcal{C} reduce. Our concrete example is the class of non-regular deterministic context-free languages (DCFL), with a truth-table reduction by Mealy machines (which proves to be a preorder). The main technical result is a proof that the DCFL language L#={0n1nn1}L_{\#}=\{0^{n}1^{n}\mid n\geq 1\} is DCFL-simple, which can thus be viewed as the simplest problem in the class DCFL.

This result has already provided an application, to the computational model of neural networks 1ANN at the first level of analog neuron hierarchy. This model was proven not to recognize L#L_{\#}, by using a specialized technical argument that can hardly be generalized to other languages in DCFL. By the result that L#L_{\#} is DCFL-simple, w.r.t. the reduction that can be implemented by 1ANN, we immediately obtain that 1ANN cannot accept any language in DCFL.

It thus seems worthwhile to explore if looking for 𝒞\mathcal{C}-simple problems in other classes 𝒞\mathcal{C} under suitable reductions could provide effective tools for expanding the lower-bound results known for single problems to the whole classes of problems.

Keywords: deterministic context-free language, truth-table reduction, Mealy automaton, pushdown automaton

1 Introduction

We introduce a new notion of 𝒞\mathcal{C}-simple problems for a class 𝒞\mathcal{C} of decision problems (i.e. languages). A problem is 𝒞\mathcal{C}-simple if it can be reduced to each problem in 𝒞\mathcal{C}; if this problem is, moreover, in 𝒞\mathcal{C}, it can be viewed as a simplest problem in 𝒞\mathcal{C}. The 𝒞\mathcal{C}-simple problems are thus a conceptual counterpart to the common 𝒞\mathcal{C}-hard problems (like, e.g., NP-hard problems) to which conversely any problem in 𝒞\mathcal{C} reduces. These definitions (of 𝒞\mathcal{C}-simple and 𝒞\mathcal{C}-hard problems) are parametrized by a chosen reduction that does not have a higher computational complexity than the class 𝒞\mathcal{C} itself. Therefore, it may be said that if a 𝒞\mathcal{C}-hard problem has a (computationally) “easy” solution, then each problem in 𝒞\mathcal{C} has an “easy” solution. On the other hand, if we prove that a 𝒞\mathcal{C}-simple problem is not “easy”, in particular that it cannot be solved by machines of a type \mathcal{M} that can implement the respective reduction, then all problems in 𝒞\mathcal{C} are not “easy”, that is, are not solvable by \mathcal{M}; this extends a lower-bound result for one problem to the whole class of problems.

In this paper, we consider 𝒞\mathcal{C} to be the class of non-regular deterministic context-free languages, which we denote by DCFL; we thus have DCFL = DCFL \smallsetminus REG (where REG denotes the class of regular languages). We use a truth-table reduction by Mealy machines (which is motivated below). Hence a DCFL-simple problem is a language L0ΣL_{0}\subseteq\Sigma^{*} (over an alphabet Σ\Sigma) that can be reduced to each DCFL language LΔL\subseteq\Delta^{*} by a Mealy machine 𝒜\mathcal{A} with an oracle LL, denoted 𝒜L\mathcal{A}^{L}. More precisely, the finite-state transducer 𝒜\mathcal{A} transforms a given input word wΣw\in\Sigma^{*} to a prefix 𝒜(w)Δ\mathcal{A}(w)\in\Delta^{*} of queries for the oracle LL. In addition, each state qq of 𝒜L\mathcal{A}^{L} is associated with a finite tuple σq=(sq1,,sqrq)\sigma_{q}=(s_{q1},\ldots,s_{qr_{q}}) of rqr_{q} query suffixes from Δ\Delta^{*}, and with a truth table fq:{0,1}rq{0,1}f_{q}:\{0,1\}^{r_{q}}\rightarrow\{0,1\}. After 𝒜L\mathcal{A}^{L} reads an input word ww (translating it to 𝒜(w)\mathcal{A}(w)), by which it enters a state qq, for each i{1,2,,rq}i\in\{1,2,\dots,r_{q}\} it queries whether or not the string 𝒜(w)sqi\mathcal{A}(w)\cdot s_{qi} is in LL (or, equivalently, whether or not 𝒜(w)\mathcal{A}(w) belongs to the quotient L/sqi={vΔvsqiL}L/s_{qi}=\{v\in\Delta^{*}\mid v\cdot s_{qi}\in L\}), and aggregates the answers by the truth table fqf_{q} for deciding if ww is accepted.

This truth-table reduction by Mealy machines proves to be a preorder, denoted as ttA\leq_{tt}^{\textsc{A}}. The main technical result of this paper is that the DCFL language L#={0n1nn1}L_{\#}=\{0^{n}1^{n}\mid n\geq 1\} (over the binary alphabet {0,1}\{0,1\}) is DCFL-simple, since L#ttALL_{\#}\leq_{tt}^{\textsc{A}}L for each language LL in DCFL. The class DCFLS of DCFL-simple languages comprises REG and is a strict subclass of DCFL; e.g., the DCFL language LR={wcwRw{a,b}}L_{R}=\left\{wcw^{R}\mid w\in\{a,b\}^{*}\right\} over the alphabet {a,b,c}\{a,b,c\} proves to be not DCFL-simple. The closure properties of DCFLS are similar to that of DCFL as the class DCFLS is closed under complement and intersection with regular languages, while being not closed under concatenation, intersection, and union.

The above definition of DCFL-simple problems has originally been motivated by the analysis of the computational power of neural network (NN) models which is known to depend on the (descriptive) complexity of their weight parameters [8, 11]. The so-called analog neuron hierarchy [9] of binary-state NNs with increasing number of α\alpha extra analog-state neurons, denoted as α\alphaANN for α0\alpha\geq 0, has been introduced for studying NNs with realistic weights between integers (finite automata) and rational numbers (Turing machines). We use the notation α\alphaANN also for the class of languages accepted by α\alphaANNs, which can clearly be distinguished by the context. The separation 1ANN \subsetneq 2ANN has been witnessed by the DCFL language L#L_{\#}\in 2ANN \setminus 1ANN. The proof of L#L_{\#}\notin 1ANN is rather technical (based on the Bolzano-Weierstrass theorem) which could hardly be generalized to other DCFL languages, while it was conjectured that LL\notin 1ANN for all DCFL languages LL, that is, DCFL(2ANN1ANN)\mbox{DCFL${}^{\prime}$}\subseteq(\mbox{2ANN}\,\setminus\,\mbox{1ANN}) (implying 1ANNDCFL=0ANN=REG\mbox{1ANN}\,\cap\,\mbox{DCFL}=\mbox{0ANN}=\mbox{REG}). An idea how to prove this conjecture is to show that L#L_{\#}\notin 1ANN is in some sense the simplest problem in the class DCFL, namely, to reduce L#L_{\#} to any DCFL language LL by using a reduction that can be carried out by 1ANNs, which are at least as powerful as finite automata. This would imply that LL cannot be accepted by any 1ANN since it is at least as hard as L#L_{\#} that has been proven not to be recognized by 1ANNs.

The idea why L#L_{\#} should serve as the simplest language in the class DCFL comes from the fact that any reduced context-free grammar GG generating a non-regular language LΔL\subseteq\Delta^{*} is self-embedding [3, Theorem 4.10]. This means that there is a so-called self-embedding nonterminal AA admitting the derivation AxAyA\Rightarrow^{*}xAy for some non-empty strings x,yΔ+x,y\in\Delta^{+}. Since GG is reduced, there are strings v,w,zΔv,w,z\in\Delta^{*} such that SvAzS\Rightarrow^{*}vAz and AwA\Rightarrow^{*}w where SS is the start nonterminal in GG, which implies SvxmwymzLS\Rightarrow^{*}vx^{m}wy^{m}z\in L for every m0m\geq 0. It is thus straightforward to suggest to reduce an input word 0m1n{0,1}0^{m}1^{n}\in\{0,1\}^{*} where m,n1m,n\geq 1, to the string vxmwynzΔvx^{m}wy^{n}z\in\Delta^{*} (while the inputs outside 0+1+0^{+}1^{+} are mapped onto some fixed string outside LL) since 0m1nL#0^{m}1^{n}\in L_{\#} entails vxmwynzLvx^{m}wy^{n}z\in L.

However, the suggested (one-one) reduction from L#L_{\#} to LL is not consistent because vxmwynzLvx^{m}wy^{n}z\in L does not necessarily imply 0m1nL#0^{m}1^{n}\in L_{\#}. For example, consider the DCFL language L1={0m1n1mn}L_{1}=\{0^{m}1^{n}\mid 1\leq m\leq n\} over the binary alphabet Δ={0,1}\Delta=\{0,1\} for which there are no words v,x,w,y,zΔv,x,w,y,z\in\Delta^{*} such that vxmwynzL1vx^{m}wy^{n}z\in L_{1} would ensure m=nm=n. Nevertheless, we can pick two inputs 0m1n10^{m}1^{n-1} and 0m1n0^{m}1^{n} instead of one, that is, x=0x=0, y=1y=1, and v=w=z=εv=w=z=\varepsilon (ε\varepsilon denoting the empty string), which satisfy 0m1nL#0^{m}1^{n}\in L_{\#} iff m=nm=n iff vxmwyn1zL1vx^{m}wy^{n-1}z\notin L_{1} and vxmwynzL1vx^{m}wy^{n}z\in L_{1}. It turns out that this can be generalized to any DCFL language. Namely, we prove in this paper that for DCFL language LΔL\subseteq\Delta^{*} over any alphabet Δ\Delta, there are non-empty words v,x,w,y,zΔ+v,x,w,y,z\in\Delta^{+} and a language L{L,L¯}L^{\prime}\in\{L,\overline{L}\}, where L¯=ΔL\overline{L}=\Delta^{*}\smallsetminus L is the complement of LL, such that 0m1nL#0^{m}1^{n}\in L_{\#} iff vxmwyn1zLvx^{m}wy^{n-1}z\notin L^{\prime} and vxmwynzLvx^{m}wy^{n}z\in L^{\prime}.

Therefore, the simple many-one (in fact, one-one) reduction from L#L_{\#} with one query to the oracle LL is replaced by a truth-table reduction, that is, by a special Turing reduction in which all its finitely many (in our case two) oracle queries are presented at the same time and there is a Boolean function (a truth table) which, when given the answers to the queries, produces the final answer of the reduction. This truth-table reduction from L#L_{\#} to LL can be implemented by a deterministic finite-state transducer (a Mealy machine) 𝒜\mathcal{A} with the oracle LL: It transforms the input 0m1n0^{m}1^{n} where m,n1m,n\geq 1 (the inputs outside 0+1+0^{+}1^{+} are rejected), to the output vxmwyn1Δ+vx^{m}wy^{n-1}\in\Delta^{+} and carries out two queries to LL that arise by concatenation of this output with two fixed suffixes zz and yzyz; hence the queries are vxmwyn1z?Lvx^{m}wy^{n-1}z\stackrel{{\scriptstyle?}}{{\in}}L and vxmwynz?Lvx^{m}wy^{n}z\stackrel{{\scriptstyle?}}{{\in}}L. The truth table is defined so that the input 0m1n0^{m}1^{n} is accepted by 𝒜L\mathcal{A}^{L} iff the two answers to these queries are distinct and at same time, the first answer is negative in the case L=LL^{\prime}=L, and positive in the case L=L¯L^{\prime}=\overline{L}, which is equivalent to 0m1nL#0^{m}1^{n}\in L_{\#}.

It follows that the DCFL language L#L_{\#} is DCFL-simple under the truth-table reduction by Mealy machines. Since this reduction can be implemented by 1ANNs, we achieve the desired stronger separation DCFL(2ANN1ANN)\mbox{DCFL${}^{\prime}$}\subseteq(\mbox{2ANN}\,\setminus\,\mbox{1ANN}) in the analog neuron hierarchy [10]. This result constitutes a non-trivial application of the proposed concept of DCFL-simple problem. Moreover, if we could generalize the result to (nondeterministic) context-free languages (CFL), e.g. by proving that some DCFL language is CFL-simple (where CFL== CFL\smallsetminus REG), which would imply that L#L_{\#} is CFL-simple by the transitivity of reduction, then we would achieve even stronger separation CFL(2ANN1ANN)\mbox{CFL${}^{\prime}$}\subseteq(\mbox{2ANN}\,\setminus\,\mbox{1ANN}). We note the interesting fact that L#L_{\#} cannot be CSL-simple (under our reduction), since 1ANN accepts some context-sensitive languages outside CFL [9].

In general, if we show that some 𝒞\mathcal{C}-simple problem under a given reduction cannot be computed by a computational model \mathcal{M} that implements this reduction, then all problems in the class 𝒞\mathcal{C} are not solvable by \mathcal{M} either. The notion of 𝒞\mathcal{C}-simple problems can thus be useful for expanding known (e.g. technical) lower-bound results for individual problems to the whole classes of problems at once, as it was the case of the DCFL-simple problem L#1ANNL_{\#}\notin\,\mbox{1ANN}, expanding to DCFL1ANN=\mbox{DCFL${}^{\prime}$}\cap\,\mbox{1ANN}\,=\emptyset. It seems worthwhile to explore if looking for 𝒞\mathcal{C}-simple problems in other complexity classes 𝒞\mathcal{C} could provide effective tools for strengthening known lower bounds.

We remark that the hardest context-free language by Greibach [2] can be viewed as CFL-hard under a special type of our reduction ttA\leq_{tt}^{\textsc{A}}. Related line of study concerns the types of reductions used in finite or pushdown automata with oracle. For example, nondeterministic finite automata with oracle complying with many-one restriction have been applied to establishing oracle hierarchies over the context-free languages [7]. For the same purpose, oracle pushdown automata have been used for many-one, truth-table, and Turing reducibilities, respectively, inducing the underlying definitions also to oracle nondeterministic finite automata [13]. In addition, nondeterministic finite automata whose oracle queries are completed by the prefix of an input word that has been read so far and the remaining suffix, have been employed in defining a polynomial-size oracle hierarchy [1].

In the preliminary study [12], some considerations about the simplest DCFL language have appeared, yet without formal definitions of DCFL-simple problems, that included only sketches of incomplete proofs of weaker results based on the representation of DCFL by so-called deterministic monotonic restarting automata [5], which have initiated investigations of non-regularity degrees in DCFL [6].

In this paper we achieve a complete argument for L#L_{\#} to be a DCFL-simple problem, within the framework of deterministic pushdown automata (DPDA) by using some ideas on regularity of pushdown processes from [4]. We now give an informal overview of the proof. Given a DPDA \mathcal{M} recognizing a non-regular language LΔL\subseteq\Delta^{*}, it is easy to realize that some computations of \mathcal{M} (from the initial configuration) must be reaching configurations where the stack is arbitrarily large while it can be (almost) erased afterwards. Hence the existence of words v,x,w,y,zΔ+v,x,w,y,z\in\Delta^{+} such that vxmwymzLvx^{m}wy^{m}z\in L for all m0m\geq 0 is obvious. However, we aim to guarantee that for all m,nm,n the equality m=nm=n holds if, and only if, vxmwyn1zLvx^{m}wy^{n-1}z\notin L^{\prime} and vxmwynzLvx^{m}wy^{n}z\in L^{\prime}, where LL^{\prime} is either the language LL or its complement. This is not so straightforward but it is confirmed by our detailed analysis (in section 3). We study the computation of \mathcal{M} on an infinite word a1a2a3a_{1}a_{2}a_{3}\cdots that visits infinitely many pairwise non-equivalent configurations. We use a natural congruence property of language equivalence on the set of configurations, and avoid some tedious technical details by a particular use of Ramsey’s theorem. This allows us to extract the required tuple v,x,w,y,zΔ+v,x,w,y,z\in\Delta^{+} from the mentioned infinite computation. We note that determinism of \mathcal{M} is essential in the presented proof; we leave open if it can be relaxed to show that L#L_{\#} is even CFL-simple.

The rest of the paper is organized as follows. In section 2 we recall basic definitions and notation regarding DPDA and Mealy machines, introduce the novel concept of DCFL-simple problems under truth-table reduction by Mealy machines and show some simple properties of the class DCFLS of DCFL-simple problems. In section 3 we present the proof of the main technical result which shows that L#L_{\#} is DCFL-simple. Finally, we summarize the results and list some open problems in section 4.

2 DCFL-Simple Problem Under Truth-Table Mealy Reduction

In this section we define the truth-table reduction by Mealy machines, introduce the notion of DCFL-simple problems, show their basic properties, and formulate the main technical result (theorem 1). But first we recall standard definitions of pushdown automata.

A pushdown automaton (PDA) is a tuple =(Q,Σ,Γ,R,q0,X0,F)\mathcal{M}=(Q,\Sigma,\Gamma,R,q_{0},X_{0},F) where QQ is a finite set of states including the start state q0Qq_{0}\in Q and the set FQF\subseteq Q of accepting states, while the finite sets Σ\Sigma\not=\emptyset and Γ\Gamma\not=\emptyset represent the input and stack alphabets, respectively, with the initial stack symbol X0ΓX_{0}\in\Gamma. In addition, the set RR contains finitely many transition rules pX𝑎qγpX\xrightarrow{a}q\gamma with the meaning that \mathcal{M} in state pQp\in Q, on the input aΣε=Σ{ε}a\in\Sigma_{\varepsilon}=\Sigma\cup\{\varepsilon\} (recall ε\varepsilon denotes the empty string), and with XΓX\in\Gamma as the topmost stack symbol may read aa, change the state to qQq\in Q, and pop XX, replacing it by pushing γΓ\gamma\in\Gamma^{*}.

By a configuration of \mathcal{M} we mean pαQ×Γp\alpha\in Q\times\Gamma^{*}, and we define relations 𝑎\xrightarrow{a} for aΣεa\in\Sigma_{\varepsilon} on Q×ΓQ\times\Gamma^{*}: each rule pX𝑎qγpX\xrightarrow{a}q\gamma in RR induces pXα𝑎qγαpX\alpha\xrightarrow{a}q\gamma\alpha for all αΓ\alpha\in\Gamma^{*}; these relations are naturally extended to 𝑤\xrightarrow{w} for wΣw\in\Sigma^{*}. For a configuration pαp\alpha we define (pα)={wΣpα𝑤qβ for some qF and βΓ}\mathcal{L}(p\alpha)=\{w\in\Sigma^{*}\mid p\alpha\xrightarrow{w}q\beta\mbox{ for some }q\in F\mbox{ and }\beta\in\Gamma^{*}\}, and ()=(q0X0)\mathcal{L}(\mathcal{M})=\mathcal{L}(q_{0}X_{0}) is the language accepted by \mathcal{M}. A PDA \mathcal{M} is deterministic (a DPDA) if there is at most one rule pX𝑎..pX\xrightarrow{a}.. for each tuple pQp\in Q, XΓX\in\Gamma, aΣεa\in\Sigma_{\varepsilon}; moreover, if there is a rule pX𝜀..pX\xrightarrow{\varepsilon}.., then there is no rule pX𝑎..pX\xrightarrow{a}.. for aΣa\in\Sigma. We also use the standard assumption that all ε\varepsilon-steps are popping, that is, in each rule pX𝜀qγpX\xrightarrow{\varepsilon}q\gamma in RR we have γ=ε\gamma=\varepsilon.

The languages accepted by (deterministic) pushdown automata constitute the class of (deterministic) context-free languages; the classes are denoted by DCFL and CFL, respectively, whereas DCFL== DCFL \smallsetminus REG.

In the following theorem we formulate the main technical result: any language in DCFL includes a certain “projection” of the language L#={0n1nn1}L_{\#}=\{0^{n}1^{n}\mid n\geq 1\}, which means that L#L_{\#} is in some sense the simplest language in the class DCFL. The theorem, whose proof will be presented in section 3, thus provides an interesting property of DCFL.

Theorem 1.

Let LΔL\subseteq\Delta^{*} be a non-regular deterministic context-free language over an alphabet Δ\Delta. There exist non-empty words v,x,w,y,zΔ+v,x,w,y,z\in\Delta^{+} and a language L{L,L¯}L^{\prime}\in\{L,\overline{L}\} (where L¯=ΔL\overline{L}=\Delta^{*}\smallsetminus L is the complement of LL) such that for all m0m\geq 0 and n>0n>0 we have

(vxmwyn1zL and vxmwynzL)iffm=n.\left(vx^{m}wy^{n-1}z\notin L^{\prime}\mbox{ and }\,vx^{m}wy^{n}z\in L^{\prime}\right)\quad\mbox{if{f}}\quad m=n\,. (1)

In order to formalize the DCFL-simple problems, we now define a Mealy machine 𝒜\mathcal{A} with an oracle: it is a tuple 𝒜=(Q,Σ,Δ,δ,λ,q0,{(σq,fq)qQ})\mathcal{A}=(Q,\Sigma,\Delta,\delta,\lambda,q_{0},\{(\sigma_{q},f_{q})\mid q\in Q\}) where QQ is a finite set of states including the start state q0Qq_{0}\in Q, and the finite sets Σ\Sigma\not=\emptyset and Δ\Delta\not=\emptyset represent the input and output (oracle) alphabets, respectively. Moreover, δ:Q×ΣQ\delta:Q\times\Sigma\rightarrow Q is a (partial) state-transition function which extends to input strings as δ:Q×ΣQ\delta:Q\times\Sigma^{*}\rightarrow Q where δ(q,ε)=q\delta(q,\varepsilon)=q for every qQq\in Q, while δ(q,wa)=δ(δ(q,w),a)\delta(q,wa)=\delta(\delta(q,w),a) for all qQq\in Q, wΣw\in\Sigma^{*}, aΣa\in\Sigma. Similarly, λ:Q×ΣΔ\lambda:Q\times\Sigma\rightarrow\Delta^{*} is an output function which extends to input strings as λ:Q×ΣΔ\lambda:Q\times\Sigma^{*}\rightarrow\Delta^{*} where λ(q,ε)=ε\lambda(q,\varepsilon)=\varepsilon for all qQq\in Q, and λ(q,wa)=λ(q,w)λ(δ(q,w),a)\lambda(q,wa)=\lambda(q,w)\cdot\lambda(\delta(q,w),a) for all qQq\in Q, wΣw\in\Sigma^{*}, aΣa\in\Sigma. In addition, for each qQq\in Q, the tuple σq=(sq1,,sqrq)\sigma_{q}=(s_{q1},\ldots,s_{qr_{q}}) of strings in Δ\Delta^{*} contains rqr_{q} query suffixes, while fq:{0,1}rq{0,1}f_{q}:\{0,1\}^{r_{q}}\rightarrow\{0,1\} is a truth table that aggregates the answers to the rqr_{q} oracle queries.

The above Mealy machine 𝒜\mathcal{A} starts in the start state q0q_{0} and operates as a deterministic finite-state transducer that transforms an input word wΣw\in\Sigma^{*} to the output string 𝒜(w)=λ(q0,w)Δ\mathcal{A}(w)=\lambda(q_{0},w)\in\Delta^{*} written to a so-called oracle tape. The oracle tape is a semi-infinite, write-only tape which is empty at the beginning and its contents are only extended in the course of computation by appending the strings to the right. Namely, given a current state qQq\in Q and an input symbol aΣa\in\Sigma, the machine 𝒜\mathcal{A} moves to the next state δ(q,a)Q\delta(q,a)\in Q and writes the string λ(q,a)Δ\lambda(q,a)\in\Delta^{*} to the oracle tape, if δ(q,a)\delta(q,a) is defined; otherwise 𝒜\mathcal{A} rejects the input. After reading the whole input word wΣw\in\Sigma^{*}, the machine 𝒜\mathcal{A} is in the state p=δ(q0,w)Qp=\delta(q_{0},w)\in Q, while the oracle tape contains the output 𝒜(w)=λ(q0,w)Δ\mathcal{A}(w)=\lambda(q_{0},w)\in\Delta^{*}.

Finally, the Mealy machine 𝒜\mathcal{A}, equipped with an oracle LΔL\subseteq\Delta^{*}, in this case denoted 𝒜L\mathcal{A}^{L}, queries the oracle whether 𝒜(w)\mathcal{A}(w) belongs to the (right) quotient L/spi={uΔuspiL}L/s_{pi}=\{u\in\Delta^{*}\mid u\cdot s_{pi}\in L\}, for each suffix spis_{pi} in σp\sigma_{p}, and the answers are aggregated by the truth table fpf_{p}. Thus, the oracle Mealy machine 𝒜L\mathcal{A}^{L} accepts the input word wΣw\in\Sigma^{*} iff

fp(χL/sp1(𝒜(w)),χL/sp2(𝒜(w)),,χL/sprp(𝒜(w)))=1f_{p}\left(\chi_{L/s_{p1}}(\mathcal{A}(w)),\chi_{L/s_{p2}}(\mathcal{A}(w)),\ldots,\chi_{L/s_{pr_{p}}}(\mathcal{A}(w))\right)=1

where p=δ(q0,w)p=\delta(q_{0},w) and χL/spi:Δ{0,1}\chi_{L/s_{pi}}:\Delta^{*}\rightarrow\{0,1\} is the characteristic function of L/spiL/s_{pi}, that is, χL/spi(u)=1\chi_{L/s_{pi}}(u)=1 if uspiLu\cdot s_{pi}\in L, and χL/spi(u)=0\chi_{L/s_{pi}}(u)=0 if uspiLu\cdot s_{pi}\notin L. The language accepted by the machine 𝒜L\mathcal{A}^{L} is defined as (𝒜L)={wΣw\mathcal{L}(\mathcal{A}^{L})=\{w\in\Sigma^{*}\mid w is accepted by 𝒜L}\mathcal{A}^{L}\}.111Note that the described protocol works also for non-prefix-free languages since for any input prefix that has been read so far, the output value from the truth table determines whether the oracle Mealy machine is in an “accepting” state, deciding about this prefix analogously as a deterministic finite automaton. The truth-table reduction only requires that the given oracle answers do not influence further computation when subsequent input symbols are read.

We say that L1ΣL_{1}\subseteq\Sigma^{*} is truth-table reducible to L2ΔL_{2}\subseteq\Delta^{*} by a Mealy machine, which is denoted as L1ttAL2L_{1}\leq_{tt}^{\textsc{A}}L_{2}, if L1=(𝒜L2)L_{1}=\mathcal{L}(\mathcal{A}^{L_{2}}) for some Mealy machine 𝒜\mathcal{A} running with the oracle L2L_{2}. The following lemma shows that we can chain these reductions together since the relation ttA\leq_{tt}^{\textsc{A}} is a preorder.

Lemma 2.

The relation ttA\leq_{tt}^{\textsc{A}} is reflexive and transitive.

Proof:  The relation ttA\leq_{tt}^{\textsc{A}} is reflexive since L=(𝒜L)ΣL=\mathcal{L}(\mathcal{A}^{L})\subseteq\Sigma^{*} for the oracle Mealy machine 𝒜L=({q},Σ,Σ,δ,λ,q,{(σq,fq)})\mathcal{A}^{L}=(\{q\},\Sigma,\Sigma,\delta,\lambda,q,\{(\sigma_{q},f_{q})\}) where δ(q,a)=q\delta(q,a)=q and λ(q,a)=a\lambda(q,a)=a for every aΣa\in\Sigma, σq=(ε)\sigma_{q}=(\varepsilon), and fqf_{q} is the identity.

Now we show that the relation ttA\leq_{tt}^{\textsc{A}} is transitive. Let L1ttAL2L_{1}\leq_{tt}^{\textsc{A}}L_{2} and L2ttAL3L_{2}\leq_{tt}^{\textsc{A}}L_{3} which means L1=(𝒜1L2)ΣL_{1}=\mathcal{L}(\mathcal{A}_{1}^{L_{2}})\subseteq\Sigma^{*} and L2=(𝒜2L3)ΔL_{2}=\mathcal{L}(\mathcal{A}_{2}^{L_{3}})\subseteq\Delta^{*} for some oracle Mealy machines 𝒜1L2=(Q1,Σ,Δ,δ1,λ1,q01,{(πq,gq)qQ1})\mathcal{A}_{1}^{L_{2}}=(Q_{1},\Sigma,\Delta,\delta_{1},\lambda_{1},q_{0}^{1},\{(\pi_{q},g_{q})\mid q\in Q_{1}\}) and 𝒜2L3=(Q2,Δ,Θ,δ2,λ2,q02,{(ϱq,hq)qQ2})\mathcal{A}_{2}^{L_{3}}=(Q_{2},\Delta,\Theta,\delta_{2},\lambda_{2},q_{0}^{2},\{(\varrho_{q},h_{q})\mid q\in Q_{2}\}), respectively. We will construct the oracle Mealy machine 𝒜L3=(Q,Σ,Θ,δ,λ,q0,{(σq,fq)qQ})\mathcal{A}^{L_{3}}=(Q,\Sigma,\Theta,\delta,\lambda,q_{0},\{(\sigma_{q},f_{q})\mid q\in Q\}) such that L1=(𝒜L3)ΣL_{1}=\mathcal{L}(\mathcal{A}^{L_{3}})\subseteq\Sigma^{*} which implies the transitivity L1𝒜L3L_{1}\leq^{\mathcal{A}}L_{3}. We define Q=Q1×Q2Q=Q_{1}\times Q_{2} with q0=(q01,q02)q_{0}=(q_{0}^{1},q_{0}^{2}), δ((q1,q2),a)=(δ1(q1,a),δ2(q2,λ1(q1,a)))\delta((q_{1},q_{2}),a)=(\delta_{1}(q_{1},a),\delta_{2}(q_{2},\lambda_{1}(q_{1},a))) and λ((q1,q2),a)=λ2(q2,λ1(q1,a))\lambda((q_{1},q_{2}),a)=\lambda_{2}(q_{2},\lambda_{1}(q_{1},a)) for every (q1,q2)Q(q_{1},q_{2})\in Q and aΣa\in\Sigma, which ensures 𝒜(w)=λ(q0,w)=λ2(q02,λ1(q01,w))=𝒜2(𝒜1(w))Θ\mathcal{A}(w)=\lambda(q_{0},w)=\lambda_{2}(q_{0}^{2},\lambda_{1}(q_{0}^{1},w))=\mathcal{A}_{2}(\mathcal{A}_{1}(w))\in\Theta^{*} for every wΣw\in\Sigma^{*}. For each state p=(p1,p2)Qp=(p_{1},p_{2})\in Q in 𝒜\mathcal{A}, we define the tuple of query suffixes from Θ\Theta^{*},

σp=(λ2(p2,sp1,i)sp2(i),j|i=1,,rp1,j=1,,rp2(i))\sigma_{p}=\left(\lambda_{2}(p_{2},s_{p_{1},i})\cdot s_{p_{2}(i),j}\,\big{|}\,i=1,\ldots,r_{p_{1}}\,,\,j=1,\ldots,r_{p_{2}(i)}\right)

where πp1=(sp1,1,sp1,2,sp1,rp1)Δrp1\pi_{p_{1}}=(s_{p_{1},1},s_{p_{1},2}\ldots,s_{p_{1},r_{p_{1}}})\in\Delta^{r_{p_{1}}} and ϱp2(i)=(sp2(i),1,sp2(i),2,sp2(i),rp2(i))Θrp2(i)\varrho_{p_{2}(i)}=(s_{p_{2}(i),1},s_{p_{2}(i),2}\ldots,s_{p_{2}(i),r_{p_{2}(i)}})\in\Theta^{r_{p_{2}(i)}} are the query suffixes associated with p1Q1p_{1}\in Q_{1} and p2(i)=δ2(p2,sp1,i)Q2p_{2}(i)=\delta_{2}(p_{2},s_{p_{1},i})\in Q_{2} for i{1,,rp1}i\in\{1,\ldots,r_{p_{1}}\}, respectively, and the truth table fp=gp1(hp2(1),,hp2(rp1))f_{p}=g_{p_{1}}(h_{p_{2}(1)},\ldots,h_{p_{2}(r_{p_{1}})}) aggregates the answers to the corresponding oracle queries, which ensures L1=(𝒜L3)ΣL_{1}=\mathcal{L}(\mathcal{A}^{L_{3}})\subseteq\Sigma^{*}. ∎

We say that a (decision) problem L0ΣL_{0}\subseteq\Sigma^{*} is DCFL-simple if L0ttALL_{0}\leq_{tt}^{\textsc{A}}L for every non-regular deterministic context-free language LΔL\subseteq\Delta^{*}. It follows from theorem 1 that the DCFL language L#L_{\#} is an example of a DCFL-simple problem. In addition, we denote by DCFLS the class of DCFL-simple problems and formulate its basic properties.

Corollary 3 (of theorem 1).

The non-regular deterministic context-free language L#={0n1nn1}L_{\#}=\{0^{n}1^{n}\mid n\geq 1\} is DCFL-simple.

Proof:  Let LΔL\subseteq\Delta^{*} be any DCFL language. According to theorem 1, there are v,x,w,y,zΔ+v,x,w,y,z\in\Delta^{+} and L{L,L¯}L^{\prime}\in\{L,\overline{L}\} such that condition (1) holds for LL^{\prime}. We define the Mealy machine 𝒜L=({q0,q1,q2},{0,1},Δ,δ,λ,q0,{(σq,fq)qQ})\mathcal{A}^{L}=(\{q_{0},q_{1},q_{2}\},\{0,1\},\Delta,\delta,\lambda,q_{0},\{(\sigma_{q},f_{q})\mid q\in Q\}) with the oracle LL, as δ(q0,0)=δ(q1,0)=q1\delta(q_{0},0)=\delta(q_{1},0)=q_{1}, δ(q1,1)=δ(q2,1)=q2\delta(q_{1},1)=\delta(q_{2},1)=q_{2}, λ(q0,0)=vx\lambda(q_{0},0)=vx, λ(q1,0)=x\lambda(q_{1},0)=x, λ(q1,1)=w\lambda(q_{1},1)=w, λ(q2,1)=y\lambda(q_{2},1)=y, σq2=(z,yz)\sigma_{q_{2}}=(z,yz), fq0=fq1=0f_{q_{0}}=f_{q_{1}}=0, fq2(0,0)=fq2(1,1)=0f_{q_{2}}(0,0)=f_{q_{2}}(1,1)=0, and fq2(1,0)=1fq2(0,1)f_{q_{2}}(1,0)=1-f_{q_{2}}(0,1) where fq2(0,1)=1f_{q_{2}}(0,1)=1 iff L=LL^{\prime}=L. It is easy to verify that L#=(𝒜L)L_{\#}=\mathcal{L}(\mathcal{A}^{L}), which implies L#ttALL_{\#}\leq_{tt}^{\textsc{A}}L. Hence, L#L_{\#} is DCFL-simple. ∎

Proposition 4.
  1. 1.

    REGDCFLS\mbox{REG}\,\subsetneq\,\mbox{DCFLS}.

  2. 2.

    DCFLSDCFL\mbox{DCFLS}\,\subsetneq\,\mbox{DCFL}, and LR={wcwRw{a,b}}DCFLDCFLSL_{R}=\{wcw^{R}\mid w\in\{a,b\}^{*}\}\in\mbox{DCFL}\smallsetminus\mbox{DCFLS}.

  3. 3.

    The class DCFLS is closed under complement and intersection with regular languages.

  4. 4.

    The class DCFLS is not closed under concatenation, intersection and union.

Proof: [Sketch.] 
1. For any regular language LL, consider a Mealy machine 𝒜L#\mathcal{A}^{L_{\#}} with the DCFL-simple oracle L#L_{\#}, that simulates a deterministic finite automaton recognizing LL, while its constant truth tables produce 1 iff associated with the accept states. Hence, LttAL#L\leq_{tt}^{\textsc{A}}L_{\#} which means LL is DCFL-simple according to lemma 2 and corollary 3 which also implies REGDCFLS\mbox{REG}\,\not=\,\mbox{DCFLS}.

2. We first observe that DCFLSDCFL\mbox{DCFLS}\,\subseteq\,\mbox{DCFL}. Let LL\in DCFLS be any DCFL-simple language which ensures LttAL#L\leq_{tt}^{\textsc{A}}L_{\#} by an oracle Mealy machine 𝒜L#\mathcal{A}^{L_{\#}}. The machine 𝒜L#\mathcal{A}^{L_{\#}} can be simulated by a DPDA \mathcal{M} which extends a suitable DPDA #\mathcal{M}_{\#} (e.g. with no ε\varepsilon-transitions) accepting L#=(#)L_{\#}=\mathcal{L}(\mathcal{M}_{\#}), so that the finite control of \mathcal{M} implements the finite-state transducer 𝒜\mathcal{A} whose output is presented online as an input to #\mathcal{M}_{\#}. Moreover, for each state qq of 𝒜\mathcal{A}, the finite control of \mathcal{M} evaluates the truth table fqf_{q} which aggregates the answers to the queries with rqr_{q} suffixes associated with qq, by inspecting at most constant number of topmost stack symbols. Hence L=()L=\mathcal{L}(\mathcal{M})\in DCFL.

In order to show that DCFLSDCFL\mbox{DCFLS}\,\not=\,\mbox{DCFL}, we prove that the DCFL LR={wcwRw{a,b}}L_{R}=\{wcw^{R}\mid w\in\{a,b\}^{*}\} over the alphabet {a,b,c}\{a,b,c\}^{*} is not DCFL-simple. For the sake of contradiction, suppose that LRttAL#L_{R}\leq_{tt}^{\textsc{A}}L_{\#} by a Mealy machine 𝒜L#=(Q,{a,b,c},{0,1},δ,λ,q0,{(σq,fq)qQ})\mathcal{A}^{L_{\#}}=(Q,\{a,b,c\}^{*},\{0,1\}^{*},\delta,\lambda,q_{0},\{(\sigma_{q},f_{q})\mid q\in Q\}) with the oracle L#={0n1nn1}L_{\#}=\{0^{n}1^{n}\mid n\geq 1\}, which means LR=(𝒜L#)L_{R}=\mathcal{L}(\mathcal{A}^{L_{\#}}). Consider all the 2k2^{k} possible prefixes w{a,b}kw\in\{a,b\}^{k} of inputs presented to 𝒜L#\mathcal{A}^{L_{\#}} that have the length |w|=k|w|=k. These strings can bring 𝒜L#\mathcal{A}^{L_{\#}} into a finite number |{δ(q0,w)w{a,b}k}||Q||\{\delta(q_{0},w)\mid w\in\{a,b\}^{k}\}|\leq|Q| of distinct states while the length |λ(q0,w)||\lambda(q_{0},w)| of outputs written to the oracle tape is bounded by O(k)O(k). For λ(q0,w)\lambda(q_{0},w) outside 010^{*}1^{*}, the acceptance of words wuwu where u{a,b,c}u\in\{a,b,c\}^{*}, depends only on the truth values fq(0,,0)f_{q}(0,\ldots,0) associated with the states qq from the finite set QQ, due to λ(q0,wu)L#/s\lambda(q_{0},wu)\notin L_{\#}/s for any s{0,1}s\in\{0,1\}^{*}. On the other hand, the number of distinct outputs λ(q0,w)\lambda(q_{0},w) in 010^{*}1^{*} is bounded by O(k)O(k). This means that for a sufficiently large k1k\geq 1, there must be two distinct prefixes w1,w2{a,b}kw_{1},w_{2}\in\{a,b\}^{k} such that δ(q0,w1)=δ(q0,w2)\delta(q_{0},w_{1})=\delta(q_{0},w_{2}) and λ(q0,w1)=λ(q0,w2)\lambda(q_{0},w_{1})=\lambda(q_{0},w_{2}) in 010^{*}1^{*}, which results in the contradiction w1cw2R(𝒜L#)LRw_{1}cw_{2}^{R}\in\mathcal{L}(\mathcal{A}^{L_{\#}})\smallsetminus L_{R}.

3. The class DCFLS is closed under complement since the truth tables can be negated. Furthermore, any oracle Mealy machine be can modified so that it simulates another given finite automaton in parallel and is forced to reject if this automaton rejects, which shows DCFLS to be closed under intersection with regular languages.

4. Observe that (L#)2(L_{\#})^{2} is not DCFL-simple under truth-table reduction. In addition, L1={0m1m0nm,n1}L_{1}=\{0^{m}1^{m}0^{n}\mid m,n\geq 1\} and L2={0m1n0nm,n1}L_{2}=\{0^{m}1^{n}0^{n}\mid m,n\geq 1\} are DCFL-simple while L1L2L_{1}\cap L_{2} is not context-free. The proof for union follows from 3 and De Morgan’s law. ∎

3 Proof of the Main Result (Theorem 1)

Theorem 1 follows from the (more specific) next lemma that we prove in this section.

By \mathbb{N} we denote the set {0,1,2,}\{0,1,2,\dots\}, and by [i,j][i,j] the set {i,i+1,,j}\{i,i{+}1,\dots,j\} (for i,ji,j\in\mathbb{N}).

Lemma 5.

Let =(Q,Σ,Γ,R,p0,X0,F)\mathcal{M}=(Q,\Sigma,\Gamma,R,p_{0},X_{0},F) be a DPDA where L=(p0X0)L=\mathcal{L}(p_{0}X_{0}) is non-regular (hence LL belongs to DCFL). There are vΣv\in\Sigma^{*}, x,w,y,zΣ+x,w,y,z\in\Sigma^{+}, p,qQp,q\in Q, XΓX\in\Gamma, γΓ+\gamma\in\Gamma^{+}, δΓ\delta\in\Gamma^{*} such that the following four conditions hold:

  1. 1.

    p0X0𝑣pXδp_{0}X_{0}\xrightarrow{v}pX\delta and pX𝑥pXγpX\xrightarrow{x}pX\gamma,
    which entails the infinite (stack increasing) computation

    p0X0𝑣pXδ𝑥pXγδ𝑥pXγγδ𝑥pXγγγδ𝑥;p_{0}X_{0}\xrightarrow{v}pX\delta\xrightarrow{x}pX\gamma\delta\xrightarrow{x}pX\gamma\gamma\delta\xrightarrow{x}pX\gamma\gamma\gamma\delta\xrightarrow{x}\cdots; (2)
  2. 2.

    pX𝑤qpX\xrightarrow{w}q;

  3. 3.

    qγ𝑦qq\gamma\xrightarrow{y}q,

    hence qγδyqδq\gamma^{\ell}\delta^{\prime}\xrightarrow{y^{\ell}}q\delta^{\prime} for all \ell\in\mathbb{N} and δΓ\delta^{\prime}\in\Gamma^{*};

  4. 4.

    one of the following cases is valid (depending on whether z(qδ)z\in\mathcal{L}(q\delta) or z(qδ)z\not\in\mathcal{L}(q\delta)):

    1. (a)

      (qγkδ)yz\mathcal{L}(q\gamma^{k}\delta)\ni y^{\ell}z iff k=k=\ell (for all k,k,\ell\in\mathbb{N}), or (qγkδ)yz\mathcal{L}(q\gamma^{k}\delta)\ni y^{\ell}z iff kk\leq\ell (for all k,k,\ell\in\mathbb{N});

    2. (b)

      (qγkδ)yz\mathcal{L}(q\gamma^{k}\delta)\ni y^{\ell}z iff kk\neq\ell (for all k,k,\ell\in\mathbb{N}), or (qγkδ)yz\mathcal{L}(q\gamma^{k}\delta)\ni y^{\ell}z iff k>k>\ell (for all k,k,\ell\in\mathbb{N}).

We note that p0X0𝑣pXδxmpXγmδ𝑤qγmδymqδp_{0}X_{0}\xrightarrow{v}pX\delta\xrightarrow{x^{m}}pX\gamma^{m}\delta\xrightarrow{w}q\gamma^{m}\delta\xrightarrow{y^{m}}q\delta (for each mm\in\mathbb{N}); hence vxmwymzLvx^{m}wy^{m}z\in L iff z(qδ)z\in\mathcal{L}(q\delta) (since zz is nonempty). Theorem 1 indeed follows from the lemma: there is L{L,L¯}L^{\prime}\in\{L,\overline{L}\} such that either vxmwynzLvx^{m}wy^{n}z\in L^{\prime} iff m=nm=n (for all m,nm,n\in\mathbb{N}), or vxmwynzLvx^{m}wy^{n}z\in L^{\prime} iff mnm\leq n (for all m,nm,n\in\mathbb{N}). (In theorem 1 we also stated that vv is nonempty. If v=εv=\varepsilon here, then we simply take vxvx and yzyz as the new v,zv,z, respectively.)

Proof of Lemma 5

In the rest of this section we provide a proof of lemma 5, assuming a fixed DPDA =(Q,Σ,Γ,R,p0,X0,F)\mathcal{M}=(Q,\Sigma,\Gamma,R,p_{0},X_{0},F) where L=(p0X0)L=\mathcal{L}(p_{0}X_{0}) is non-regular. The proof structure is visible from the auxiliary claims that we state and prove on the way.

Convention. W.l.o.g. we assume that \mathcal{M} always reads the whole input wΣw\in\Sigma^{*} from p0X0p_{0}X_{0}. This can be accomplished in the standard way, by adding a special bottom-of-stack symbol \bot and a (non-accepting) fail-state. (Each empty-stack configuration qεq\varepsilon becomes qq\bot, and each originally stuck computation enters the fail-state where it loops. We also recall that all ε\varepsilon-steps are popping, and thus infinite ε\varepsilon-sequences are impossible.) Hence for any infinite word a1a2a3a_{1}a_{2}a_{3}\cdots in Σω\Sigma^{\omega} there is the unique infinite computation of \mathcal{M} starting in p0X0p_{0}X_{0}; it stepwise reads the whole infinite word a1a2a3a_{1}a_{2}a_{3}\cdots.

The left quotient of LL by uΣu\in\Sigma^{*} is the set u\L={vΣuvL}u\backslash L=\{v\in\Sigma^{*}\mid uv\in L\}; concatenation has priority over \\backslash, hence u1u2\L=(u1u2)\Lu_{1}u_{2}\backslash L=(u_{1}u_{2})\backslash L. (The next claim is valid for any non-regular LL.)

Claim 6.

We can fix an infinite word a1a2a3a_{1}a_{2}a_{3}\cdots in Σω\Sigma^{\omega} (aiΣa_{i}\in\Sigma) such that a1a2ai\La1a2aj\La_{1}a_{2}\cdots a_{i}\backslash L\neq a_{1}a_{2}\cdots a_{j}\backslash L for all iji\neq j.

Proof:  Let us consider the labelled transition system 𝒯=(LQ(L),Σ,(𝑎)aΣ)\mathcal{T}=(\textsc{LQ}(L),\Sigma,(\xrightarrow{a})_{a\in\Sigma}) where LQ(L)={u\LuΣ}\textsc{LQ}(L)=\{u\backslash L\mid u\in\Sigma^{*}\} and 𝑎={(L,a\L)LLQ(L)}\mathop{\xrightarrow{a}}=\{(L^{\prime},a\backslash L^{\prime})\mid L^{\prime}\in\textsc{LQ}(L)\}. (We recall that L=u\LL^{\prime}=u\backslash L entails a\L=ua\La\backslash L^{\prime}=ua\backslash L.) Since LL is non-regular, the set of states reachable from L=ε\LL=\varepsilon\backslash L in 𝒯\mathcal{T} is infinite. The out-degree of states in 𝒯\mathcal{T} is finite (in fact, bounded by |Σ||\Sigma|), hence an application of König’s lemma yields an infinite acyclic path La1L1a2L2a3L\xrightarrow{a_{1}}L_{1}\xrightarrow{a_{2}}L_{2}\xrightarrow{a_{3}}\cdots. ∎

We call a configuration pαp\alpha of \mathcal{M} unstable if α=Yβ\alpha=Y\beta and RR contains a rule pY𝜀qpY\xrightarrow{\varepsilon}q (we recall that ε\varepsilon-steps are only popping); otherwise pαp\alpha is stable. Since \mathcal{M} is a deterministic PDA, for each unstable pαp\alpha we can soundly define the stable successor of pαp\alpha as the unique stable configuration pαp^{\prime}\alpha^{\prime} where pα𝜀pαp\alpha\xrightarrow{\varepsilon}p^{\prime}\alpha^{\prime} (α\alpha^{\prime} being a suffix of α\alpha). The path pα𝜀pαp\alpha\xrightarrow{\varepsilon}p^{\prime}\alpha^{\prime} might (not) go via an accepting state (in FF), hence (pα)=(pα)\mathcal{L}(p\alpha)=\mathcal{L}(p^{\prime}\alpha^{\prime}) or (pα)={ε}(pα)\mathcal{L}(p\alpha)=\{\varepsilon\}\cup\mathcal{L}(p^{\prime}\alpha^{\prime}). (We note that the configurations in the computation (2) that start with pXpX are necessarily stable.)

Claim 7.

Each configuration is visited at most twice by

the computation of \mathcal{M} from p0X0p_{0}X_{0} on a1a2a3a_{1}a_{2}a_{3}\cdots that is fixed by 6. (3)

Proof:  The computation (3) is infinite, stepwise reading the whole word a1a2a3a_{1}a_{2}a_{3}\cdots, and it can be presented as

r0γ0a1r1γ1a2r2γ2a3r_{0}\gamma_{0}\xrightarrow{a_{1}}r_{1}\gamma_{1}\xrightarrow{a_{2}}r_{2}\gamma_{2}\xrightarrow{a_{3}}\cdots (for r0γ0=p0X0r_{0}\gamma_{0}=p_{0}X_{0})

where each riγir_{i}\gamma_{i} is stable; each segment riγiai+1ri+1γi+1r_{i}\gamma_{i}\xrightarrow{a_{i+1}}r_{i+1}\gamma_{i+1} starts with a (visible) ai+1a_{i+1}-step that is followed by a (maybe empty) sequence of (popping) ε\varepsilon-steps via unstable configurations. Since such an ε\varepsilon-sequence might go through an accepting state, we can have riγi=rjγjr_{i}\gamma_{i}=r_{j}\gamma_{j} for iji\neq j though a1a2ai\La1a2aj\La_{1}a_{2}\cdots a_{i}\backslash L\neq a_{1}a_{2}\cdots a_{j}\backslash L; in this case LL contains precisely one of the words a1a2aia_{1}a_{2}\cdots a_{i} and a1a2aja_{1}a_{2}\cdots a_{j}, and the languages a1a2ai\La_{1}a_{2}\cdots a_{i}\backslash L and a1a2aj\La_{1}a_{2}\cdots a_{j}\backslash L differ just on ε\varepsilon. Nevertheless, this reasoning entails that we cannot have riγi=rjγj=rγr_{i}\gamma_{i}=r_{j}\gamma_{j}=r_{\ell}\gamma_{\ell} for pairwise different i,j,i,j,\ell.

Since each segment riγiai+1ri+1γi+1r_{i}\gamma_{i}\xrightarrow{a_{i+1}}r_{i+1}\gamma_{i+1} visits any unstable configuration at most once and ri+1γi+1r_{i+1}\gamma_{i+1} is the stable successor for all unstable configurations in the segment, we deduce that also each unstable configuration can be visited at most twice in the computation (3). ∎

Claim 8.

The computation (3) on a1a2a3a_{1}a_{2}a_{3}\cdots can be “stair-factorized”, that is, written

p0X0v0p1X1α1v1p2X2α2α1v2p3X3α3α2α1v3p_{0}X_{0}\xrightarrow{v_{0}}p_{1}X_{1}\alpha_{1}\xrightarrow{v_{1}}p_{2}X_{2}\alpha_{2}\alpha_{1}\xrightarrow{v_{2}}p_{3}X_{3}\alpha_{3}\alpha_{2}\alpha_{1}\xrightarrow{v_{3}}\cdots (4)

so that for each ii\in\mathbb{N} we have viΣ+v_{i}\in\Sigma^{+} and piXivipi+1Xi+1αi+1p_{i}X_{i}\xrightarrow{v_{i}}p_{i+1}X_{i+1}\alpha_{i+1} where αi+1\alpha_{i+1} is a nonempty suffix of the right-hand side of a rule in RR (i.e., a nonempty suffix of γ\gamma in a rule pX𝑎qγpX\xrightarrow{a}q\gamma).

Proof:  We consider the computation (3), and call a stable configuration pXβpX\beta a level, with position ii\in\mathbb{N}, if p0X0a1aipXβp_{0}X_{0}\xrightarrow{a_{1}\cdots a_{i}}pX\beta and all configurations visited by the computation pXβai+1ai+2pX\beta\xrightarrow{a_{i+1}a_{i+2}\cdots} after pXβpX\beta have the stack longer than |Xβ||X\beta|; we note that each level pXβpX\beta has a unique position pos(pXβ)\textsc{pos}(pX\beta). Since each configuration is visited at most twice in (3), the set of levels is infinite, with elements p0X0p^{\prime}_{0}X^{\prime}_{0}, p1X1β1p_{1}X_{1}\beta_{1}, p2X2β2p_{2}X_{2}\beta_{2}, \dots where 0pos(p0X0)<pos(p1X1β1)<pos(p2X2β2)<0\leq\textsc{pos}(p^{\prime}_{0}X^{\prime}_{0})<\textsc{pos}(p_{1}X_{1}\beta_{1})<\textsc{pos}(p_{2}X_{2}\beta_{2})<\cdots. The computation (3) can thus be presented as

p0X0v0p0X0v0′′p1X1β1v1p2X2β2v2p3X3β3v3p_{0}X_{0}\xrightarrow{v^{\prime}_{0}}p^{\prime}_{0}X^{\prime}_{0}\xrightarrow{v^{\prime\prime}_{0}}p_{1}X_{1}\beta_{1}\xrightarrow{v_{1}}p_{2}X_{2}\beta_{2}\xrightarrow{v_{2}}p_{3}X_{3}\beta_{3}\xrightarrow{v_{3}}\cdots

where |v0|=pos(p0X0)|v^{\prime}_{0}|=\textsc{pos}(p^{\prime}_{0}X^{\prime}_{0}), and |v0v1vj1|=pos(pjXjβj)|v_{0}v_{1}\cdots v_{j-1}|=\textsc{pos}(p_{j}X_{j}\beta_{j}) for j1j\geq 1, putting v0=v0v0′′v_{0}=v^{\prime}_{0}v^{\prime\prime}_{0}.

Each segment pXβ𝑣pXβpX\beta\xrightarrow{v}p^{\prime}X^{\prime}\beta^{\prime} between two neighbouring levels can be obviously written as pXβ𝑎qγ1γ2βvpXγ2βpX\beta\xrightarrow{a}q\gamma_{1}\gamma_{2}\beta\xrightarrow{v^{\prime}}p^{\prime}X^{\prime}\gamma_{2}\beta where pX𝑎qγ1γ2pX\xrightarrow{a}q\gamma_{1}\gamma_{2} is a rule in RR, both γ1\gamma_{1} and γ2\gamma_{2} are nonempty, v=avv=av^{\prime}, and qγ1vpXq\gamma_{1}\xrightarrow{v^{\prime}}p^{\prime}X^{\prime}. Hence the validity of the claim is clear. ∎

We define the natural equivalence relation \sim on the set of configurations of \mathcal{M}: we put pαqβp\alpha\sim q\beta if (pα)=(qβ)\mathcal{L}(p\alpha)=\mathcal{L}(q\beta).

We fix the presentation (4), calling piXiαiαi1α1p_{i}X_{i}\alpha_{i}\alpha_{i-1}\cdots\alpha_{1} the level-configurations (for all ii\in\mathbb{N}). Since we have (piXiαiαi1α1){ε}=(v0v1vi1\L){ε}\mathcal{L}(p_{i}X_{i}\alpha_{i}\alpha_{i-1}\cdots\alpha_{1})\smallsetminus\{\varepsilon\}=(v_{0}v_{1}\cdots v_{i-1}\backslash L)\smallsetminus\{\varepsilon\}, there cannot be three level-configurations in the same \sim-class (i.e., in the same equivalence class w.r.t. \sim). Hence any infinite set of level-configurations represents infinitely many \sim-classes. Now we show a congruence-property that might enable to shorten a level-configuration while keeping its \sim-class. We use the notation DS(pα)\textsc{DS}(p\alpha) (the “down-states” of pαp\alpha), putting

DS(pα)={qpα𝑤q\textsc{DS}(p\alpha)=\{q\mid p\alpha\xrightarrow{w}q for some wΣ}w\in\Sigma^{*}\}.

Claim 9.

If qγqγq\gamma\sim q\gamma^{\prime} for each qDS(pβ)q\in\textsc{DS}(p\beta), then pβγpβγp\beta\gamma\sim p\beta\gamma^{\prime}.

Proof:  Let us consider wΣw\in\Sigma^{*}. If w(pβ)w\in\mathcal{L}(p\beta), then w(pβμ)w\in\mathcal{L}(p\beta\mu) for all μΓ\mu\in\Gamma^{*}. If w(pβ)w\not\in\mathcal{L}(p\beta) and there is no prefix vv of ww such that pβ𝑣qp\beta\xrightarrow{v}q, then w(pβμ)w\not\in\mathcal{L}(p\beta\mu) for all μΓ\mu\in\Gamma^{*}. If w(pβ)w\not\in\mathcal{L}(p\beta) and w=vvw=vv^{\prime} where pXβ𝑣qpX\beta\xrightarrow{v}q (necessarily for some qDS(pXβ)q\in\textsc{DS}(pX\beta)), then w(pβμ)w\in\mathcal{L}(p\beta\mu) iff v(qμ)v^{\prime}\in\mathcal{L}(q\mu). Hence the claim is clear. ∎

The next claim is an immediate corollary.

Claim 10.

Any computation p0X0w1pXβ1w2pXβ2β1w3pXβ3β2β1p_{0}X_{0}\xrightarrow{w_{1}}pX\beta_{1}\xrightarrow{w_{2}}pX\beta_{2}\beta_{1}\xrightarrow{w_{3}}p^{\prime}X^{\prime}\beta_{3}\beta_{2}\beta_{1} where pXw2pXβ2pX\xrightarrow{w_{2}}pX\beta_{2} (w2Σ+w_{2}\in\Sigma^{+}), pXw3pXβ3pX\xrightarrow{w_{3}}p^{\prime}X^{\prime}\beta_{3}, and qβ2β1qβ1q\beta_{2}\beta_{1}\sim q\beta_{1} for each qDS(pXβ3)q\in\textsc{DS}(p^{\prime}X^{\prime}\beta_{3}) can be shortened to p0X0w1pXβ1w3pXβ3β1p_{0}X_{0}\xrightarrow{w_{1}}pX\beta_{1}\xrightarrow{w_{3}}p^{\prime}X^{\prime}\beta_{3}\beta_{1} where pXβ3β1pXβ3β2β1p^{\prime}X^{\prime}\beta_{3}\beta_{1}\sim p^{\prime}X^{\prime}\beta_{3}\beta_{2}\beta_{1}.

The ii-th level-configuration in (4) is reached by the computation p0X0v0v1vi1piXiαiαi1α1p_{0}X_{0}\xrightarrow{v_{0}v_{1}\cdots v_{i-1}}p_{i}X_{i}\alpha_{i}\alpha_{i-1}\cdots\alpha_{1}. It can happen that there are j1,j2j_{1},j_{2}, 0j1<j2i0\leq j_{1}<j_{2}\leq i such that pj1Xj1=pj2Xj2p_{j_{1}}X_{j_{1}}=p_{j_{2}}X_{j_{2}} and qαj2αj21α1qαj1αj11α1q\alpha_{j_{2}}\alpha_{j_{2}-1}\cdots\alpha_{1}\sim q\alpha_{j_{1}}\alpha_{j_{1}-1}\cdots\alpha_{1} for all qDS(piXiαiαi1αj2+1)q\in\textsc{DS}(p_{i}X_{i}\alpha_{i}\alpha_{i-1}\cdots\alpha_{j_{2}+1}). In this case we can shorten the computation as in 10, where vj1vj1+1vj21v_{j_{1}}v_{j_{1}+1}\cdots v_{j_{2}-1} corresponds to the omitted w2w_{2}. The resulting shorter computation might be possible to be repeatedly shortened further (if it can be presented so that the conditions of 10 are satisfied). Now for each i1i\geq 1 we fix a (stair-factorized) computation

pi,0Xi,0vi,0pi,1Xi,1αi,1vi,1pi,2Xi,2αi,2αi,1vi,ni1pi,niXi,niαi,niαi,ni1αi,1p_{i,0}X_{i,0}\xrightarrow{v_{i,0}}p_{i,1}X_{i,1}\alpha_{i,1}\xrightarrow{v_{i,1}}p_{i,2}X_{i,2}\alpha_{i,2}\alpha_{i,1}\ \cdots\ \xrightarrow{v_{i,n_{i}-1}}p_{i,n_{i}}X_{i,n_{i}}\alpha_{i,n_{i}}\alpha_{i,n_{i}-1}\cdots\alpha_{i,1} (5)

that has arisen by a maximal sequence of the above shortenings of the prefix

p0X0v0v1vi1piXiαiαi1α1p_{0}X_{0}\xrightarrow{v_{0}v_{1}\cdots v_{i-1}}p_{i}X_{i}\alpha_{i}\alpha_{i-1}\cdots\alpha_{1} of (4).

Hence  pi,0Xi,0=p0X0p_{i,0}X_{i,0}=p_{0}X_{0},  pi,niXi,ni=piXip_{i,n_{i}}X_{i,n_{i}}=p_{i}X_{i},  αi,ni,αi,ni1,,αi,1\alpha_{i,n_{i}},\alpha_{i,n_{i}-1},\dots,\alpha_{i,1} is a subsequence of
αi,αi1,,α1\alpha_{i},\alpha_{i-1},\dots,\alpha_{1},  and  pi,niXi,niαi,niαi,ni1αi,1piXiαiαi1α1p_{i,n_{i}}X_{i,n_{i}}\alpha_{i,n_{i}}\alpha_{i,n_{i}-1}\cdots\alpha_{i,1}\sim p_{i}X_{i}\alpha_{i}\alpha_{i-1}\cdots\alpha_{1}.

Claim 11.

For each \ell\in\mathbb{N} there is ii such that ni>n_{i}>\ell (where nin_{i} is from (5)).

Proof:  As already discussed, the set of level-configurations represents infinitely many \sim-classes. The last configurations of computations (5) represent the same infinite set of \sim-classes, and their lengths thus cannot be bounded; since the lengths of all αi,j\alpha_{i,j} are bounded (they are shorter than the longest right-hand sides of the rules in RR), the claim is clear. ∎

Now we come to a crucial claim in our proof of lemma 5. Besides the notation DS(pα)\textsc{DS}(p\alpha) we also introduce ES(pα)\textsc{ES}(p\alpha) (the by-ε\varepsilon-reached down-states of pαp\alpha), by putting

ES(pα)={qpα𝜀q}\textsc{ES}(p\alpha)=\{q\mid p\alpha\xrightarrow{\varepsilon}q\}.

Hence ES(pα)DS(pα)\textsc{ES}(p\alpha)\subseteq\textsc{DS}(p\alpha), and |ES(pα)|1|\textsc{ES}(p\alpha)|\leq 1 (due to the determinism of the DPDA \mathcal{M}).

We recall that pαqβp\alpha\sim q\beta means (pα)=(qβ)\mathcal{L}(p\alpha)=\mathcal{L}(q\beta). To handle the special case of the empty word ε\varepsilon, we also define a (much) coarser equivalence 0\sim_{0}: we put pα0qβp\alpha\sim_{0}q\beta if ε\varepsilon either belongs to both (pα)\mathcal{L}(p\alpha) and (qβ)\mathcal{L}(q\beta), or belongs to none of them.

Claim 12.

There is a constant B\textsc{B}\in\mathbb{N} determined by the DPDA \mathcal{M} such that for all ii\in\mathbb{N} where ni>Bn_{i}>B the final configuration in (5) can be written as

pi,niXi,niαi,niαi,ni1αi,1=p¯X¯βγδp_{i,n_{i}}X_{i,n_{i}}\alpha_{i,n_{i}}\alpha_{i,n_{i}-1}\cdots\alpha_{i,1}=\bar{p}\bar{X}\beta\gamma\delta

where the following conditions hold:

  1. 1.

    γ=αi,jαi,j1αi,j+1\gamma=\alpha_{i,j}\alpha_{i,j-1}\cdots\alpha_{i,j^{\prime}{+}1} where nij>jniBn_{i}\geq j>j^{\prime}\geq n_{i}{-}B and pi,jXi,j=pi,jXi,jp_{i,j}X_{i,j}=p_{i,j^{\prime}}X_{i,j^{\prime}}
    (and β=αi,niαi,ni1αi,j+1\beta=\alpha_{i,n_{i}}\alpha_{i,n_{i}-1}\cdots\alpha_{i,j{+}1}, δ=αi,jαi,j1αi,1\delta=\alpha_{i,j^{\prime}}\alpha_{i,j^{\prime}-1}\cdots\alpha_{i,1});

  2. 2.

    the sets DS(p¯X¯β)\textsc{DS}(\bar{p}\bar{X}\beta) and DS(p¯X¯βγ)\textsc{DS}(\bar{p}\bar{X}\beta\gamma) are equal, further being denoted by Q¯\bar{Q};

  3. 3.

    for each qQ¯q\in\bar{Q}, if ES(qγ)={q}\textsc{ES}(q\gamma)=\{q^{\prime}\}, then ES(qγ)={q}\textsc{ES}(q^{\prime}\gamma)=\{q^{\prime}\} (and qQ¯q^{\prime}\in\bar{Q});

  4. 4.

    each qQ¯q^{\prime}\in\bar{Q} belongs to DS(qγ)\textsc{DS}(q\gamma) for some self-containing qQ¯q\in\bar{Q}, where qQ¯q\in\bar{Q} is self-containing if qDS(qγ)q\in\textsc{DS}(q\gamma);

  5. 5.

    there is a state qQ¯q^{\prime}\in\bar{Q} for which qγδ≁qδq^{\prime}\gamma\delta\not\sim q^{\prime}\delta and qγδ0qδq^{\prime}\gamma\delta\sim_{0}q^{\prime}\delta.

Proof:  We fix some ii with nin_{i} larger than a constant BB determined by \mathcal{M} as described below (there are such ii by 11). For convenience we put pi,niXi,ni=p¯X¯p_{i,n_{i}}X_{i,n_{i}}=\bar{p}\bar{X}, ni=nn_{i}=n, and αi,j=α¯j\alpha_{i,j}=\bar{\alpha}_{j}, hence the final configuration in (5) is pi,niXi,niαi,niαi,ni1αi,1=p¯X¯α¯nα¯n1α¯1p_{i,n_{i}}X_{i,n_{i}}\alpha_{i,n_{i}}\alpha_{i,n_{i}-1}\cdots\alpha_{i,1}=\bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\cdots\bar{\alpha}_{1}. We view the n+1n{+}1 prefixes

p¯X¯,p¯X¯α¯n,p¯X¯α¯nα¯n1,p¯X¯α¯nα¯n1α¯n2,,p¯X¯α¯nα¯n1α¯1\bar{p}\bar{X},\ \bar{p}\bar{X}\bar{\alpha}_{n},\ \bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1},\ \bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\bar{\alpha}_{n-2},\ \dots,\ \bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\cdots\bar{\alpha}_{1}

as the vertices of a complete graph with coloured edges.

For p¯X¯α¯nα¯n1α¯1=p¯X¯μνρ\bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\cdots\bar{\alpha}_{1}=\bar{p}\bar{X}\mu\nu\rho, where μ=α¯nα¯n1α¯j+1\mu=\bar{\alpha}_{n}\bar{\alpha}_{n-1}\cdots\bar{\alpha}_{j{+}1}, ν=α¯jα¯j1α¯j+1\nu=\bar{\alpha}_{j}\bar{\alpha}_{j-1}\cdots\bar{\alpha}_{j^{\prime}{+}1}, and ρ=α¯jα¯j1α¯1\rho=\bar{\alpha}_{j^{\prime}}\bar{\alpha}_{j^{\prime}-1}\cdots\bar{\alpha}_{1}, nj>j0n\geq j>j^{\prime}\geq 0, the edge between the vertices p¯X¯μ\bar{p}\bar{X}\mu and p¯X¯μν\bar{p}\bar{X}\mu\nu has the following tuple as its colour:

(pi,jXi,j,pi,jXi,j,DS(p¯X¯μ),DS(p¯X¯μν),(DS(qν),ES(qν))qDS(p¯X¯μ),Q≁,Q0)\left(\,p_{i,j}X_{i,j},\ p_{i,j^{\prime}}X_{i,j^{\prime}},\ \textsc{DS}(\bar{p}\bar{X}\mu),\ \textsc{DS}(\bar{p}\bar{X}\mu\nu),\ (\textsc{DS}(q\nu),\textsc{ES}(q\nu))_{q\in\textsc{DS}(\bar{p}\bar{X}\mu)},\ \textsc{Q}_{\not\sim},\ \textsc{Q}_{0}\right)

where Q≁={qDS(p¯X¯μ)qνρ≁qρ}\textsc{Q}_{\not\sim}=\{q^{\prime}\in\textsc{DS}(\bar{p}\bar{X}\mu)\mid q^{\prime}\nu\rho\not\sim q^{\prime}\rho\} and Q0={qQ≁qνρ0qρ}\textsc{Q}_{0}=\{q^{\prime}\in\textsc{Q}_{\not\sim}\mid q^{\prime}\nu\rho\sim_{0}q^{\prime}\rho\} (and pi,jXi,j,pi,jXi,jp_{i,j}X_{i,j},\ p_{i,j^{\prime}}X_{i,j^{\prime}} are taken from (5)).

Since the set of colours is bounded (by a constant determined by \mathcal{M}), Ramsey’s theorem yields a bound BB guaranteeing that there is a monochromatic clique of size 33 among the vertices p¯X¯\bar{p}\bar{X}p¯X¯α¯n\bar{p}\bar{X}\bar{\alpha}_{n}p¯X¯α¯nα¯n1\bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\dotsp¯X¯α¯nα¯n1α¯nB\bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\cdots\bar{\alpha}_{n-B}. (We have soundly chosen ii so that n=nin=n_{i} is bigger than BB.) We fix such a monochromatic clique MC, denoting its 33 vertices as

p¯X¯β\bar{p}\bar{X}\betap¯X¯βγ\bar{p}\bar{X}\beta\gammap¯X¯βγγ¯\bar{p}\bar{X}\beta\gamma\bar{\gamma}, and its colour as C=(pX,pX,Q¯,Q¯,(𝒟q,q)qQ¯,Q,Q0)\,\textsc{C}=(p^{\prime}X^{\prime},p^{\prime}X^{\prime},\bar{Q},\bar{Q},(\mathcal{D}_{q},\mathcal{E}_{q})_{q\in\bar{Q}},Q^{\prime},Q^{\prime}_{0}).

This is sound, since the fact that both edges {p¯X¯β,p¯X¯βγ}\{\bar{p}\bar{X}\beta,\bar{p}\bar{X}\beta\gamma\} and {p¯X¯βγ,p¯X¯βγγ¯}\{\bar{p}\bar{X}\beta\gamma,\bar{p}\bar{X}\beta\gamma\bar{\gamma}\} have the same colour entails that the first component in this colour is the same as the second component, and the third component is the same as the fourth component.

We now show that the conditions 1155 are satisfied for the presentation of p¯X¯α¯nα¯n1α¯1\bar{p}\bar{X}\bar{\alpha}_{n}\bar{\alpha}_{n-1}\cdots\bar{\alpha}_{1} as p¯X¯βγδ\bar{p}\bar{X}\beta\gamma\delta, where δ=γ¯α¯kα¯k1α¯1\delta=\bar{\gamma}\bar{\alpha}_{k}\bar{\alpha}_{k-1}\cdots\bar{\alpha}_{1} for the respective kk.

Conditions 11 and 22 are trivial (due to the colour C).

Condition 3: Let qQ¯q\in\bar{Q} and ES(qγ)={q}\textsc{ES}(q\gamma)=\{q^{\prime}\} (hence also qQ¯q^{\prime}\in\bar{Q}). Then q=ES(qγ)=ES(qγγ¯)={q}\mathcal{E}_{q}=\textsc{ES}(q\gamma)=\textsc{ES}(q\gamma\bar{\gamma})=\{q^{\prime}\} (since MC is monochromatic). This entails ES(qγ¯)={q}\textsc{ES}(q^{\prime}\bar{\gamma})=\{q^{\prime}\}, hence q={q}\mathcal{E}_{q^{\prime}}=\{q^{\prime}\}, which in turn entails ES(qγ)={q}\textsc{ES}(q^{\prime}\gamma)=\{q^{\prime}\}.

Condition 44: We first note a general fact: DS(pμν)=qDS(pμ)DS(qν)\textsc{DS}(p\mu\nu)=\bigcup_{q\in\textsc{DS}(p\mu)}\textsc{DS}(q\nu). Since Q¯=DS(p¯X¯β)=DS(p¯X¯βγ)=DS(p¯X¯βγγ¯)\bar{Q}=\textsc{DS}(\bar{p}\bar{X}\beta)=\textsc{DS}(\bar{p}\bar{X}\beta\gamma)=\textsc{DS}(\bar{p}\bar{X}\beta\gamma\bar{\gamma}), for each qQ¯q^{\prime}\in\bar{Q} there is thus qQ¯q\in\bar{Q} such that q𝒟qq^{\prime}\in\mathcal{D}_{q}. We also have the following “transitivity”: if q1,q2,q3Q¯q_{1},q_{2},q_{3}\in\bar{Q}, q1𝒟q2q_{1}\in\mathcal{D}_{q_{2}}, and q2𝒟q3q_{2}\in\mathcal{D}_{q_{3}}, then q1𝒟q3q_{1}\in\mathcal{D}_{q_{3}} (since MC is monochromatic). For any qQ¯q^{\prime}\in\bar{Q} there is clearly a “chain” q=q1,q2,q3,,qq^{\prime}=q_{1},q_{2},q_{3},\dots,q_{\ell} where >1\ell>1, qj𝒟qj+1q_{j}\in\mathcal{D}_{q_{j+1}} for all j[1,1]j\in[1,\ell{-}1], and qj=qq_{j}=q_{\ell} for some j<j<\ell. By the above transitivity, qq_{\ell} is self-containing (q𝒟qq_{\ell}\in\mathcal{D}_{q_{\ell}} and thus qDS(qγ)q_{\ell}\in\textsc{DS}(q_{\ell}\gamma)) and q𝒟qq^{\prime}\in\mathcal{D}_{q_{\ell}} (hence qDS(qγ)q^{\prime}\in\textsc{DS}(q_{\ell}\gamma)).

Condition 55: For any three configurations at least two belong to the same 0\sim_{0}-class. Since the edges among the vertices p¯X¯β\bar{p}\bar{X}\beta, p¯X¯βγ\bar{p}\bar{X}\beta\gamma, p¯X¯βγγ¯\bar{p}\bar{X}\beta\gamma\bar{\gamma} have the same Q0Q^{\prime}_{0} in their colour C, we get that Q0=QQ^{\prime}_{0}=Q^{\prime}, and thus also qγδ0qδq^{\prime}\gamma\delta\sim_{0}q^{\prime}\delta for all qQ¯q^{\prime}\in\bar{Q} such that qγδ≁qδq^{\prime}\gamma\delta\not\sim q^{\prime}\delta. Now if for all qQ¯q^{\prime}\in\bar{Q} we had qγδqδq^{\prime}\gamma\delta\sim q^{\prime}\delta (which includes the case Q¯=\bar{Q}=\emptyset), then we would get a contradiction with our choice of (5) since it could have been shortened as in 10. ∎

Now we are already close to lemma 5:

Claim 13.

There are vΣv\in\Sigma^{*}, x,w,y,zΣ+x,w,y,z\in\Sigma^{+}, p,qQp,q\in Q, XΓX\in\Gamma, γΓ+\gamma\in\Gamma^{+}, δΓ\delta\in\Gamma^{*} such that p0X0𝑣pXδp_{0}X_{0}\xrightarrow{v}pX\delta, pX𝑥pXγpX\xrightarrow{x}pX\gamma, pX𝑤qpX\xrightarrow{w}q, qγ𝑦qq\gamma\xrightarrow{y}q, and

  • either z(qδ)z\in\mathcal{L}(q\delta) and z(qγδ)z\not\in\mathcal{L}(q\gamma^{\ell}\delta) for all >0\ell>0,

  • or z(qδ)z\not\in\mathcal{L}(q\delta) and z(qγδ)z\in\mathcal{L}(q\gamma^{\ell}\delta) for all >0\ell>0.

Proof:  We fix one p¯X¯βγδ\bar{p}\bar{X}\beta\gamma\delta guaranteed by 12 (satisfying the respective conditions 1155). There are vΣv\in\Sigma^{*}, x,w,y,z¯Σ+x,w,y,\bar{z}\in\Sigma^{+}, p,qQp,q\in Q, XΓX\in\Gamma, γΓ+\gamma\in\Gamma^{+}, δΓ\delta\in\Gamma^{*}, qDS(qγ)q^{\prime}\in\textsc{DS}(q\gamma) such that

p0X0𝑣pXδp_{0}X_{0}\xrightarrow{v}pX\delta, pX𝑥pXγpX\xrightarrow{x}pX\gamma, pX𝑤qpX\xrightarrow{w}q, qγ𝑦qq\gamma\xrightarrow{y}q, and (qγδ)\mathcal{L}(q^{\prime}\gamma\delta) and (qδ)\mathcal{L}(q^{\prime}\delta) differ on z¯\bar{z}

(i.e., z¯((qγδ)(qδ))((qδ)(qγδ))\bar{z}\in(\mathcal{L}(q^{\prime}\gamma\delta)\smallsetminus\mathcal{L}(q^{\prime}\delta))\cup(\mathcal{L}(q^{\prime}\delta)\smallsetminus\mathcal{L}(q^{\prime}\gamma\delta)).
(Indeed: The respective computation (5) can be written p0X0𝑣pXδ𝑥pXγδwp¯X¯βγδp_{0}X_{0}\xrightarrow{v}pX\delta\xrightarrow{x}pX\gamma\delta\xrightarrow{w^{\prime}}\bar{p}\bar{X}\beta\gamma\delta where xx and γ\gamma are nonempty. The claimed qq^{\prime} and [nonempty] z¯\bar{z} are guaranteed by 55 in 12, and qq is a respective self-containing state from 44. Since qDS(p¯X¯β)q\in\textsc{DS}(\bar{p}\bar{X}\beta) and qDS(qγ)q\in\textsc{DS}(q\gamma), we get pXγδww′′qγδ𝑦qδpX\gamma\delta\xrightarrow{w^{\prime}w^{\prime\prime}}q\gamma\delta\xrightarrow{y}q\delta, where w′′εw^{\prime\prime}\neq\varepsilon. We also have yεy\neq\varepsilon, since otherwise DS(qγ)=ES(qγ)={q}\textsc{DS}(q\gamma)=\textsc{ES}(q\gamma)=\{q\}, q=qq^{\prime}=q, and we could not have qγδ≁qδq\gamma\delta\not\sim q\delta and qγδ0qδq\gamma\delta\sim_{0}q\delta.)

Since qDS(qγ)q^{\prime}\in\textsc{DS}(q\gamma), we can fix zz^{\prime} such that qγzqq\gamma\xrightarrow{z^{\prime}}q^{\prime}. Hence the languages (qγγδ)\mathcal{L}(q\gamma\gamma\delta) and (qγδ)\mathcal{L}(q\gamma\delta) differ on z=zz¯z=z^{\prime}\bar{z}; more generally, (qγ+1γδ)\mathcal{L}(q\gamma^{\ell+1}\gamma\delta) and (qγγδ)\mathcal{L}(q\gamma^{\ell}\gamma\delta) differ on yzy^{\ell}z for all 0\ell\geq 0. Now we aim to find out for which \ell we have z(qγδ)z\in\mathcal{L}(q\gamma^{\ell}\delta).

We recall that Q¯=DS(p¯X¯β)=DS(p¯X¯βγ)\bar{Q}=\textsc{DS}(\bar{p}\bar{X}\beta)=\textsc{DS}(\bar{p}\bar{X}\beta\gamma); hence q¯Q¯DS(q¯γ)=Q¯\bigcup_{\bar{q}\in\bar{Q}}\textsc{DS}(\bar{q}\gamma)=\bar{Q}. Since qQ¯q\in\bar{Q}, we get that DS(qγd)Q¯\textsc{DS}(q\gamma^{d})\subseteq\bar{Q} for all dd\in\mathbb{N} (by induction). We now distinguish two cases:

  1. 1.

    For each prefix z1z_{1} of zz and each d|z|d\leq|z| we have: if qγdz1q¯q\gamma^{d}\xrightarrow{z_{1}}\bar{q}, then ES(q¯γ)=\textsc{ES}(\bar{q}\gamma)=\emptyset.

  2. 2.

    There are a prefix z1z_{1} of zz, d|z|d\leq|z|, and q¯,q′′Q¯\bar{q},q^{\prime\prime}\in\bar{Q} such that qγdz1q¯q\gamma^{d}\xrightarrow{z_{1}}\bar{q} and ES(q¯γ)={q′′}\textsc{ES}(\bar{q}\gamma)=\{q^{\prime\prime}\}.

In the case 11 we clearly have either >|z|:z(qγδ)\forall\ell>|z|:z\in\mathcal{L}(q\gamma^{\ell}\delta) or >|z|:z(qγδ)\forall\ell>|z|:z\not\in\mathcal{L}(q\gamma^{\ell}\delta) (here δ\delta plays no role). In the case 22 we recall that q¯γ𝜀q′′\bar{q}\gamma\xrightarrow{\varepsilon}q^{\prime\prime} entails that q¯γkδ𝜀q′′δ\bar{q}\gamma^{k}\delta\xrightarrow{\varepsilon}q^{\prime\prime}\delta for all k1k\geq 1 (since ES(q′′γ)={q′′}\textsc{ES}(q^{\prime\prime}\gamma)=\{q^{\prime\prime}\} by 33 in 12). Hence we have either >|z|+1:z(qγδ)\forall\ell>|z|+1:z\in\mathcal{L}(q\gamma^{\ell}\delta) or >|z|+1:z(qγδ)\forall\ell>|z|+1:z\not\in\mathcal{L}(q\gamma^{\ell}\delta).

Since (qγ2δ)\mathcal{L}(q\gamma^{2}\delta) and (qγ1δ)\mathcal{L}(q\gamma^{1}\delta) differ on zz, we deduce that there is 01\ell_{0}\geq 1 such that either z(qγ0δ)z\in\mathcal{L}(q\gamma^{\ell_{0}}\delta) and z(qγδ)z\not\in\mathcal{L}(q\gamma^{\ell}\delta) for all >0\ell>\ell_{0}, or z(qγ0δ)z\not\in\mathcal{L}(q\gamma^{\ell_{0}}\delta) and z(qγδ)z\in\mathcal{L}(q\gamma^{\ell}\delta) for all >0\ell>\ell_{0}. Hence for δ¯=γ0δ\bar{\delta}=\gamma^{\ell_{0}}\delta we have either z(qδ¯)z\in\mathcal{L}(q\bar{\delta}) and z(qγδ¯)z\not\in\mathcal{L}(q\gamma^{\ell}\bar{\delta}) for all >0\ell>0, or z(qδ¯)z\not\in\mathcal{L}(q\bar{\delta}) and z(qγδ¯)z\in\mathcal{L}(q\gamma^{\ell}\bar{\delta}) for all >0\ell>0. Since for v¯=vx0\bar{v}=vx^{\ell_{0}} we have p0X0v¯pXδ¯p_{0}X_{0}\xrightarrow{\bar{v}}pX\bar{\delta}, the claim is proven. ∎

Claim 13 is a weaker version of lemma 5; it shows that there is L{L,L¯}L^{\prime}\in\{L,\overline{L}\} such that vxmwymzLvx^{m}wy^{m}z\in L^{\prime} and vxmwynzLvx^{m}wy^{n}z\not\in L^{\prime} for m>nm>n. To handle the case m<nm<n, we have to find out for which \ell we have yz(qδ)y^{\ell}z\in\mathcal{L}(q\delta). We thus look at the computation from qδq\delta on the infinite word yωy^{\omega} (recalling our convention that this computation is infinite, stepwise reading the word yyyyyy\cdots), and use the obvious fact that after a prefix this computation becomes “periodic” (either cycling among finitely many configurations, or increasing the stack forever).

Claim 14.

For any configuration qδq\delta and words y,zy,z there are numbers k0k\geq 0 and p>0\textsc{p}>0 (“period”) such that for all k\ell\geq k the remainder (modp)(\ell\bmod\textsc{p}) determines whether or not (qδ)yz\mathcal{L}(q\delta)\ni y^{\ell}z.

Proof:  We assume yεy\neq\varepsilon (otherwise the claim is trivial). For the infinite computation from qδq\delta on yyyyyy\cdots there are obviously k10k_{1}\geq 0, k2>0k_{2}>0, q¯Q\bar{q}\in Q, and ρ,μ,νΓ\rho,\mu,\nu\in\Gamma^{*} such that the computation can be written qδyk1q¯ρνyk2q¯ρμνyk2q¯ρμμνyk2q¯ρμμμνyk2q\delta\xrightarrow{y^{k_{1}}}\bar{q}\rho\nu\xrightarrow{y^{k_{2}}}\bar{q}\rho\mu\nu\xrightarrow{y^{k_{2}}}\bar{q}\rho\mu\mu\nu\xrightarrow{y^{k_{2}}}\bar{q}\rho\mu\mu\mu\nu\xrightarrow{y^{k_{2}}}\cdots where q¯ρyk2q¯ρμ\bar{q}\rho\xrightarrow{y^{k_{2}}}\bar{q}\rho\mu. (We have μ=ε\mu=\varepsilon if the computation visits only finitely many configurations, and otherwise we consider the stair-factorization of the computation.)

For each j[0,k21]j\in[0,k_{2}{-}1] we put q¯ρyjq¯ρj\bar{q}\rho\xrightarrow{y^{j}}\bar{q}\rho_{j}, and we have two possible cases:

  1. 1.

    There is d00d_{0}\geq 0 such that for all dd0d\geq d_{0} performing zz from q¯ρjμdν\bar{q}\rho_{j}\mu^{d}\nu does not reach ν\nu at the bottom.

  2. 2.

    There are d00d_{0}\geq 0, a prefix zz^{\prime} of zz, qQq^{\prime}\in Q, and d¯[1,|Q|]\bar{d}\in[1,|Q|] such that q¯ρjμd0zq\bar{q}\rho_{j}\mu^{d_{0}}\xrightarrow{z^{\prime}}q^{\prime} and qμd¯𝜀qq^{\prime}\mu^{\bar{d}}\xrightarrow{\varepsilon}q^{\prime}.

In the case 11 either (qδ)ydk2+jz\mathcal{L}(q\delta)\ni y^{d\cdot k_{2}+j}z for all dd0d\geq d_{0}, or (qδ)∌ydk2+jz\mathcal{L}(q\delta)\not\ni y^{d\cdot k_{2}+j}z for all dd0d\geq d_{0}.
In the case 22, for each d0d\geq 0 we have qμd𝜀qdq^{\prime}\mu^{d}\xrightarrow{\varepsilon}q_{d} where qd1=qd2q_{d_{1}}=q_{d_{2}} if d1d2(modd¯)d_{1}\equiv d_{2}\ (\bmod\ \bar{d}). Hence for each dd0d\geq d_{0}, the (non)membership of ydk2+jzy^{d\cdot k_{2}+j}z in (qδ)\mathcal{L}(q\delta) is determined by (dmodd¯)(d\bmod\bar{d}).

The claim is thus clear. ∎

Now we finish the proof of lemma 5. We take the notation from 13; for the respective qδ,y,zq\delta,y,z we add k,pk,\textsc{p} from 14. Let k0k_{0} be a multiple of p that is bigger than kk. We now view xk0x^{k_{0}}, yk0y^{k_{0}}, γk0\gamma^{k_{0}} as new x,y,γx,y,\gamma, respectively. Claims 13 and 14 now yield the statement of lemma 5.

4 Conclusion and Open Problems

In this paper, we have introduced a new notion of the 𝒞\mathcal{C}-simple problem that reduces to each problem in 𝒞\mathcal{C}, being thus a conceptual counterpart to the 𝒞\mathcal{C}-hard problem to which each problem in 𝒞\mathcal{C} reduces. We have illustrated this concept on the definition of the DCFL-simple problem that reduces to each DCFL language under the truth-table reduction by Mealy machines. We have proven that the DCFL language L#={0n1nn1}L_{\#}=\{0^{n}1^{n}\mid n\geq 1\} is DCFL-simple, and thus represents the simplest languages in the class DCFL. This result finds its application in expanding the known lower bound for L#L_{\#}, namely that L#L_{\#} cannot be recognized by the neural network model 1ANN, to all DCFL languages. Moreover, the class DCFLS of DCFL-simple problems containing the regular languages is a strict subclass of DCFL and has similar closure properties as DCFL.

We note that the hardest context-free language L0L_{0} by Greibach [2], where each LL in CFL is an inverse homomorphic image of L0L_{0} or L0{ε}L_{0}\smallsetminus\{\varepsilon\}, can be viewed as CFL-hard w.r.t. a many-one reduction based on Mealy machines realizing the respective homomorphisms. Our aims in the definition of DCFL-simple problems cannot be achieved by such a many-one reduction, hence we have generalized it to a truth-table reduction. We can alternatively consider a general Turing reduction that is implemented by a Mealy machine which queries the oracle at special query states, each associated with a corresponding query suffix, while its next transition from the query state depends on the given oracle answer. The oracle Mealy machine then accepts an input word if it reaches an accept state after reading the input. The language L#L_{\#} proves to be DCFL-simple under this Turing reduction allowing for an unbounded number of online oracle queries; this can be shown by 13 (a weaker version of lemma 5).

It is natural to try extending our result to non-regular nondeterministic (or at least unambiguous) context-free languages, by possibly showing that L#L_{\#} is CFL-simple. Another important challenge for further research is looking for 𝒞\mathcal{C}-simple problems for other complexity classes 𝒞\mathcal{C} and suitable reductions. This could provide an effective tool for strengthening lower-bounds results known for single problems to the whole classes of problems, which deserves a deeper study.

Acknowledgements

Presented research has been partially supported by the Czech Science Foundation, grant GA19-05704S, and by the institutional support RVO: 67985807 (J. Šíma). J. Šíma also thanks Martin Plátek for his intensive collaboration at the first stages of this research.

References

  • [1] Anabtawi, M., Hassan, S., Kapoutsis, C.A., Zakzok, M.: An oracle hierarchy for small one-way finite automata. In: Proceedings of LATA 2019. pp. 57–69. LNCS 11417, Springer (2019). https://doi.org/10.1007/978-3-030-13435-8_4
  • [2] Greibach, S.A.: The hardest context-free language. SIAM J. Comput. 2(4), 304–310 (1973). https://doi.org/10.1137/0202025
  • [3] Hopcroft, J.E., Ullman, J.D.: Formal languages and their relation to automata. Addison-Wesley (1969), https://www.worldcat.org/oclc/00005012
  • [4] Jančar, P.: Deciding semantic finiteness of pushdown processes and first-order grammars w.r.t. bisimulation equivalence. J. Comput. Syst. Sci. 109, 22–44 (2020). https://doi.org/10.1016/j.jcss.2019.10.002
  • [5] Jančar, P., Mráz, F., Plátek, M., Vogel, J.: Restarting automata. In: Proceedings of FCT 1995. pp. 283–292. LNCS 965, Springer (1995). https://doi.org/10.1007/3-540-60249-6_60
  • [6] Mráz, F., Pardubská, D., Plátek, M., Šíma, J.: Pumping deterministic monotone restarting automata and DCFL. In: Proceedings of ITAT 2020. pp. 51–58. CEUR Workshop Proceedings 2718 (2020), http://ceur-ws.org/Vol-2718/paper13.pdf
  • [7] Reinhardt, K.: Hierarchies over the context-free languages. In: Proceedings of IMYCS 1990. pp. 214–224. LNCS 464, Springer (1990). https://doi.org/10.1007/3-540-53414-8_44
  • [8] Siegelmann, H.T.: Neural networks and analog computation – Beyond the Turing limit. Birkhäuser (1999)
  • [9] Šíma, J.: Analog neuron hierarchy. Neural Netw. 128, 199–215 (2020). https://doi.org/10.1016/j.neunet.2020.05.006
  • [10] Šíma, J.: Stronger separation of analog neuron hierarchy by deterministic context-free languages (2021), arXiv:2102.01633 (submitted to a journal)
  • [11] Šíma, J., Orponen, P.: General-purpose computation with neural networks: A survey of complexity theoretic results. Neural Comput. 15(12), 2727–2778 (2003). https://doi.org/10.1162/089976603322518731
  • [12] Šíma, J., Plátek, M.: One analog neuron cannot recognize deterministic context-free languages. In: Proceedings of ICONIP 2019, Part III. pp. 77–89. LNCS 11955, Springer (2019). https://doi.org/10.1007/978-3-030-36718-3_7
  • [13] Yamakami, T.: Oracle pushdown automata, nondeterministic reducibilities, and the hierarchy over the family of context-free languages. In: Proceedings of SOFSEM 2014. pp. 514–525. LNCS 8327, Springer (2014). https://doi.org/10.1007/978-3-319-04298-5_45, (full version arXiv:1303.1717)