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

Automata Equipped with Auxiliary Data Structures and Regular Realizability Problems

Alexander Rubtsov Faculty of Computer Science, National Research University Higher School of Economics, Pokrovsky boulevard 11, Moscow, 109028, Russia, [email protected]    Mikhail Vyalyi Faculty of Computer Science, National Research University Higher School of Economics, Pokrovsky boulevard 11, Moscow, 109028, Russia, [email protected]
Abstract

We consider general computational models: one-way and two-way finite automata, and logarithmic space Turing machines, all equipped with an auxiliary data structure (ADS). The definition of an ADS is based on the language of protocols of work with the ADS. We describe the connection of automata-based models with ‘‘Balloon automata’’ that are another general formalization of automata equipped with an ADS presented by Hopcroft and Ullman in 1967. This definition establishes the connection between the non-emptiness problem for one-way automata with ADS, languages recognizable by nondeterministic log-space Turing machines equipped with the same ADS, and a regular realizability problem (NRR) for the language of ADS’ protocols. The NRR problem is to verify whether the regular language on the input has a non-empty intersection with the language of protocols. The computational complexity of these problems (and languages) is the same up to log-space reductions.

Keywords: Finite automata; Balloon automata; Auxiliary data structures

1 Introduction

Many computational models are derived from (one-way) finite automata (FAs) via equipping them with an auxiliary data structure (ADS). The best-known model of this kind is pushdown automata (PDAs), the deterministic version of which is widely used in compilers. Other examples are kk-counter automata, (k,r)(k,r)-reversal-bounded counter automata (equipped with kk counters each of which can switch between increasing and decreasing modes at most rr times), stack automata, nested stack automata, bag automata [5], set automata (SAs) [8] and their another variant [9]; more examples can be found in [7].

During the investigation of balloon automata (BAs) [7], Hopcroft and Ullman connected the decidability of the membership and the emptiness problems for one-way and two-way models; we denote them as M-xyBAM\text{-}xyBA and E-xyBAE\text{-}xyBA respectively, where x=1x=1 denotes one-way and x=2x=2 denotes two-way models, and y{D,N}y\in\{D,N\} stands for determinism or nondeterminism respectively. Eq. (1) summarizes results on decidability questions from [7], where T\mathop{\leq_{\mathrm{T}}} is a Turing-reduction and {A,B}\{A,B\} means that ATBA\mathop{\leq_{\mathrm{T}}}B and BTAB\mathop{\leq_{\mathrm{T}}}A.

{M-1DBA,M-2DBA}T{E-1DBA,E-1NBA,M-1NBA,M-2NBA}TTE-2DBATE-2NBA.\displaystyle\begin{split}\{\mathrm{M}\text{-}1\mathrm{DBA},\mathrm{M}\text{-}2\mathrm{DBA}\}&\mathop{\leq_{\mathrm{T}}}\{\mathrm{E}\text{-}1\mathrm{DBA},\mathrm{E}\text{-}1\mathrm{NBA},\mathrm{M}\text{-}1\mathrm{NBA},\mathrm{M}\text{-}2\mathrm{NBA}\}\mathop{\leq_{\mathrm{T}}}\\ &\mathop{\leq_{\mathrm{T}}}\mathrm{E}\text{-}2\mathrm{DBA}\mathop{\leq_{\mathrm{T}}}\mathrm{E}\text{-}2\mathrm{NBA}.\end{split} (1)

We remark that the relation E-1NBATE-1DBA\mathrm{E}\text{-}1\mathrm{NBA}\mathop{\leq_{\mathrm{T}}}\mathrm{E}\text{-}1\mathrm{DBA} was proved for the case of at least a two-letter input alphabet.

While a lot of models can be described as BA, it is hard to invent such a model with good computational properties. One of the reasons is that the equipment of finite automata with a complex data structure (or with several simple data structures) often leads to a universal computational model. For example, FAs equipped with two pushdown stores are equivalent to Turing machines (TMs), as well as FAs equipped with two non-restricted counters.

In this paper, we investigate the computational power of FAs equipped with an ADS. We describe the model using the language of correct protocols of work with the ADS. We provide a general approach to analyze the complexity of the emptiness problem and prove the following non-trivial result. If FAs are equipped with an ADS and nondeterministic logarithmic space TMs (log-TM{\log}\text{-}\mathrm{TM}s, see the definition in [16]) are equipped with the same ADS, then the FAs’ non-emptines problem and the TMs-recognizable languages are of the same complexity (up to log-space reductions). Our key tool is the regular realizability problem (see Definition 1 below).

1.1 Our Contribution

BAs were initially defined as automata with access to additional storage of unspecified structure—the balloon. A rather general axioms were imposed for the balloon and the interaction of the balloon and the automaton (see Definition 4 below). In this paper, we propose another definition based on a language of the ADS’ protocols that we denote as 𝖯\mathsf{P}, so we refer to the ADS as B𝖯\mathrm{B_{\mathsf{P}}}. We prove that languages recognizable by 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} form not just a rational cone as in the case of 1NBA1\mathrm{NBA} [7], but a principal rational cone generated by 𝖯\mathsf{P} (we provide the definition in Section 2.2).

This reformulation guarantees good structural properties, some of them follow from the connection with BA (Section 4), and provides the relation between E-1NB𝖯A\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} and the nondeterministic regular realizability problem.

Definition 1.

Fix a formal language FF called a filter, the parameter of regular realizability problems DRR(F)\mathrm{DRR}(F) and NRR(F)\mathrm{NRR}(F) that are the problems of verifying non-emptiness of the intersection of the filter FF with a regular language L(𝒜)L({\cal A}) described via the DFA or NFA 𝒜{\cal A} respectively. Formally,

NRR(F)={𝒜𝒜 is an NFA and L(𝒜)F},\displaystyle\mathrm{NRR}(F)=\{{\cal A}\mid{\cal A}\text{ is an NFA and }L({\cal A})\cap F\neq\varnothing\},
DRR(F)={𝒜𝒜 is a DFA and L(𝒜)F}.\displaystyle\mathrm{DRR}(F)=\{{\cal A}\mid{\cal A}\text{ is a DFA and }L({\cal A})\cap F\neq\varnothing\}.

RR problems have independently been studied under the name regular intersection emptiness problems [21, 22]. A restricted version of RR problem (for context-free filters only) is a well-known CFL-reachability problem, which is related to problems in interprocedural program analysis [4, 6, 23, 10, 11, 3].

In this paper we focus on the computational complexity, so we use the weakest reduction suitable for our needs, the deterministic log-space reduction that we denote as log\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}. If AlogBA\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}B and BlogAB\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}A we write AlogBA\sim_{\log}B and say that AA and BB are log-space equivalent. Note that in our constructions, emptiness and membership problems are the sets of instances’ descriptions with positive answers, i.e., E-xyB𝖯A={ML(M)=}\mathrm{E}\text{-}xy\mathrm{B_{\mathsf{P}}}\mathrm{A}=\{\langle M\rangle\mid L(M)=\varnothing\}, M-xyB𝖯A={M,wwL(M)}\mathrm{M}\text{-}xy\mathrm{B_{\mathsf{P}}}\mathrm{A}=\{\langle M,w\rangle\mid w\in L(M)\}, where MM is a xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} and x\langle x\rangle is the description of xx. So, E-xyB𝖯A¯={ML(M)}\overline{\mathrm{E}\text{-}xy\mathrm{B_{\mathsf{P}}}\mathrm{A}}=\{\langle M\rangle\mid L(M)\neq\varnothing\}. We prove that E-1NB𝖯A¯logNRR(𝖯)\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}}\sim_{\log}\mathrm{NRR}(\mathsf{P}). Based on this result, we establish computational universality of E-1NB𝖯A¯\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}} (see Theorem 34 below). Note that in the universality result we need Turing reductions in polynomial time instead of log-space reductions.

We equip with ADS not only FAs but also log-TM{\log}\text{-}\mathrm{TM}s. We denote deterministic and nondeterministic log-TM{\log}\text{-}\mathrm{TM}s equipped with an ADS B𝖯\mathrm{B_{\mathsf{P}}} as DB𝖯log-TM\mathrm{D}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM} and NB𝖯log-TM\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM} respectively. We prove that

NRR(𝖯)log(NB𝖯log-TM)={LLlogNRR(𝖯)},\mathrm{NRR}(\mathsf{P})\sim_{\log}{\mathscr{L}}(\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P})\}, (2)

hereinafter (model){\mathscr{L}}(\text{model}) is the class of languages recognizable by the model. If PP is a problem (formal language) and SS is a set of problems (class of formal languages) the reductions mean as follows. PSP\leq S means that PS:PP\exists P^{\prime}\in S:P\leq P^{\prime} and SPS\leq P means that PS:PP\forall P^{\prime}\in S:P^{\prime}\leq P; SPS\sim P means (PS)(SP)(P\leq S)\land(S\leq P).

It is easy to verify that in the original proofs in [7], Turing reductions in (1) can be replaced by the log-space reductions provided we replace the emptiness problems with non-emptiness ones. So, we obtain

{M-1DB𝖯A,M-2DB𝖯A}log{E-1DB𝖯A¯,E-1NB𝖯A¯,M-1NB𝖯A,M-2NB𝖯A,NRR(𝖯),(NB𝖯log-TM)}logE-2DBA¯logE-2NBA¯logE-NB𝖯log-TM¯.\displaystyle\begin{split}&\{\mathrm{M}\text{-}1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A},\mathrm{M}\text{-}2\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}\}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\{\overline{\mathrm{E}\text{-}1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}},\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}},\mathrm{M}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A},\mathrm{M}\text{-}2\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A},\\ &\mathrm{NRR}(\mathsf{P}),{\mathscr{L}}(\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})\}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\overline{\mathrm{E}\text{-}2\mathrm{DBA}}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\overline{\mathrm{E}\text{-}2\mathrm{NBA}}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\overline{\mathrm{E}\text{-}\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}}.\end{split} (3)

We also prove the reduction

M-1DB𝖯AlogDRR(𝖯).\mathrm{M}\text{-}1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P}). (4)

Results (3) combined with known facts imply assertions (5-8), where S is the set data structure as in SA, S1 is the set data structure that supports the insertion of at most one word, that cannot be removed further but can be tested if a query-word in the set. In S1,|Γ|=1 the word in the set is over an unary alphabet, 𝐏𝐒𝐏𝐀𝐂𝐄-c{\mathbf{PSPACE}}\textbf{\text{-}c} and 𝐍𝐏-c{\mathbf{NP}}\textbf{\text{-}c} are subclasses of complete languages.

𝐏=(NPDlog-TM), where PD is Pushdown store,\displaystyle{\mathbf{P}}={\mathscr{L}}(\mathrm{NPD}{\log}\text{-}\mathrm{TM}),\text{ where PD is Pushdown store}, (5)
𝐏𝐒𝐏𝐀𝐂𝐄(NSlog-TM),L(NSlog-TM):L𝐏𝐒𝐏𝐀𝐂𝐄-c,\displaystyle{\mathbf{PSPACE}}\supseteq{\mathscr{L}}(\mathrm{NS}{\log}\text{-}\mathrm{TM}),\exists L\in{\mathscr{L}}(\mathrm{NS}{\log}\text{-}\mathrm{TM}):L\in{\mathbf{PSPACE}}\textbf{\text{-}c}, (6)
𝐏𝐒𝐏𝐀𝐂𝐄(NS1log-TM),L(NS1log-TM):L𝐏𝐒𝐏𝐀𝐂𝐄-c,\displaystyle{\mathbf{PSPACE}}\supseteq{\mathscr{L}}(\mathrm{NS}_{1}{\log}\text{-}\mathrm{TM}),\exists L\in{\mathscr{L}}(\mathrm{NS}_{1}{\log}\text{-}\mathrm{TM}):L\in{\mathbf{PSPACE}}\textbf{\text{-}c}, (7)
𝐍𝐏(NS1,|Γ|=1log-TM),,L(NS1,|Γ|=1log-TM):L𝐍𝐏-c.\displaystyle{\mathbf{NP}}\supseteq{\mathscr{L}}(\mathrm{NS}_{1,|\Gamma|=1}{\log}\text{-}\mathrm{TM}),,\exists L\in{\mathscr{L}}(\mathrm{NS}_{1,|\Gamma|=1}{\log}\text{-}\mathrm{TM}):L\in{\mathbf{NP}}\textbf{\text{-}c}. (8)

Assertion (5) is a well-known fact. Our technique here just shows a new connection: (5) directly follows from the fact that the emptiness problem for PDA is 𝐏{\mathbf{P}}-complete. Assertions (6-8) are new results to the best of our knowledge, we prove them in Section 6. Assertions (7-8) lead to (3) for the corresponding classes of automata. For (6), we have already obtained the result in [14] in the same way and present in this paper the generalized technique.

2 Definitions

2.1 Notation on binary relations

We associate with a binary relation RA×BR\subseteq A\times B the corresponding mappings A2BA\to 2^{B} and 2A2B2^{A}\to 2^{B} that are denoted by the same letter RR, so R(a)={b:aRb}R(a)=\{b:aRb\} and R(S)=aSR(a)R(S)=\cup_{a\in S}R(a). A relation RR is the composition of the relations PA×CP\subseteq A\times C and QC×BQ\subseteq C\times B if R={(a,b)c:aPccQb}R=\{(a,b)\mid\exists c:aPc\land cQb\}; we denote the composition as QPQ\circ P. In the case of a set SCS\subseteq C we treat SS as a binary relation SC×{0,1}S\subseteq C\times\{0,1\} in the composition SP=SS\circ P=S^{\prime} that returns the set SAS^{\prime}\subseteq A. We denote the reflexive and transitive closure of RA×AR\subseteq A\times A by RR^{*}; the symbol * can also be placed above the relation, e.g., \vdash^{\!\!\!{}^{*}}. We denote by R1B×AR^{-1}\subseteq B\times A the inverse relation, i.e., aRbbR1aaRb\iff bR^{-1}a.

2.2 Rational Transductions

Our technique is based on the connection of NRR problems with rational cones. We recall the definitions borrowing them from the book [2]. A finite state transducer (FST) is a nondeterministic finite automaton with an output tape, and DFST is the deterministic version of FST. For the deterministic version, it is important that a transducer can write a word (but not only a single symbol) on the output tape on processing a letter from the input tape. Let TT be an FST; we also denote by TT the corresponding relation, i.e., uTvuTv if there exists a run of TT on the input uu from the initial state to a final state such that at the end of the run the word vv is written on the output tape. The rational dominance relation AratBA\mathop{\leq_{\mathrm{rat}}}B holds if there exists an FST TT such that A=T(B)A=T(B), here AA and BB are languages. The relations computable by FSTs are known as rational relations. The following lemmata are algorithmic versions of well-known facts (see [2], Chapter III), the first one is the algorithmic version of the Elgot-Mezei theorem. The log-space algorithms follow from straight-forward constructions.

Lemma 2.

For FSTs T1T_{1} and T2T_{2} such that T1Σ×ΔT_{1}\subseteq\Sigma^{*}\times\Delta^{*}, T2Δ×ΓT_{2}\subseteq\Delta^{*}\times\Gamma^{*}, and FA 𝒜{\cal A} such that L(𝒜)ΔL({\cal A})\subseteq\Delta^{*}, there exists an FST TT such that T=T2T1Σ×ΓT=T_{2}\circ T_{1}\subseteq\Sigma^{*}\times\Gamma^{*}, and NFA {\cal B} recognizing the language T11L(𝒜)T_{1}^{-1}L({\cal A}). So, the relation rat\mathop{\leq_{\mathrm{rat}}} is transitive. Moreover, TT and {\cal B} are constructible in logarithmic space. We denote FST TT and NFA {\cal B} as T2T1T_{2}\circ T_{1} and 𝒜T1{\cal A}\circ T_{1} respectively.

Lemma 3.

For each FST TT there exists an FST T1T^{-1} that computes the inverse relation of the relation TT. FST T1T^{-1} is log-space constructible by FST TT.

A rational cone is a family of languages 𝐂\mathbf{C} that is closed under the rational dominance relation: AratBA\mathop{\leq_{\mathrm{rat}}}B and B𝐂B\in\mathbf{C} imply A𝐂A\in\mathbf{C}. If there exists a language F𝐂F\in\mathbf{C} such that LratFL\mathop{\leq_{\mathrm{rat}}}F for any L𝐂L\in\mathbf{C}, then 𝐂\mathbf{C} is a principal rational cone generated by FF; we denote it as 𝐂=𝒯(F)\mathbf{C}={\cal T}(F).

Rational transductions for context-free languages were thoroughly investigated in the 1970s, particularly by the French school. The main results of this research were published in Berstel’s book [2]. As described in [2], it follows from the Chomsky-Schützenberger theorem that 𝖢𝖥𝖫{\mathsf{CFL}} is a principal rational cone: 𝖢𝖥𝖫=𝒯(D2){\mathsf{CFL}}={\cal T}(D_{2}), where D2D_{2} is the Dyck language on two types of brackets.

2.3 Computational Models

Firstly, we define BA. We provide the definition that is equivalent to the original definition from [7] but has technical differences, for the sake of convenience. Then we provide the definitions of other models: the refined definition of Balloon automata in terms of protocols and computational models based on log-TM{\log}\text{-}\mathrm{TM} that are connected with NRR\mathrm{NRR}-problem as well as with 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}.

As it said, the balloon is a storage medium of unspecified structure. Thus its states are represented by (a subset of) positive integers. A BA can get limited information about the state of the balloon (the balloon information function in the definition below) and can modify the states of the balloon (the balloon control function). Here we need 1BAs only. So we give the definition for them. The definitions for 2BAs are similar, they are provided in [7].

Definition 4.

A 11-way balloon automaton (1BA) is defined by a tuple

S,Σ,BS,BI,𝗀𝖾𝗍𝖡𝖨,𝗎𝗉𝖽𝖡𝖲,F,s0,δ,where\langle S,\Sigma_{\vartriangleright\vartriangleleft},B_{S},B_{I},\mathsf{get}_{\mathsf{B_{I}}},\mathsf{upd}_{\mathsf{B_{S}}},F,s_{0},\delta\rangle,\quad\text{where}
  • SS is the finite set of automaton states.

  • Σ=Σ{,}\Sigma_{\vartriangleright\vartriangleleft}=\Sigma\cup\{\vartriangleright,\vartriangleleft\}, where Σ\Sigma is the finite input alphabet and ,{\vartriangleright,\vartriangleleft} are the endmarkers. The input has the form w,wΣ\vartriangleright\!w\!\vartriangleleft,\,w\in\Sigma^{*}.

  • BS>0B_{S}\subseteq\mathbb{Z}_{>0} is the set of the balloon states.

  • BIB_{I} is the finite set of the balloon information states.

  • 𝗀𝖾𝗍𝖡𝖨:BSBI\mathsf{get}_{\mathsf{B_{I}}}:B_{S}\to B_{I} is a total computable function (balloon information function).

  • 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} is a partially computable function from S×BSS\times B_{S} to BSB_{S} (balloon control function).

  • FSF\subsetneq S is the set of the final states.

  • s0SFs_{0}\in S\setminus F is the initial state.

  • δ\delta is the transition relation (a partial function for deterministic automata) defined as δ(S×Σ,ε×BI)×S\delta\subseteq(S\times\Sigma_{\vartriangleright\vartriangleleft,\varepsilon}\times B_{I})\times S; hereinafter Γε=Γ{ε}\Gamma_{\varepsilon}=\Gamma\cup\{\varepsilon\} for any alphabet Γ\Gamma.

Definition 5.

A configuration of a 1BA1\mathrm{BA} is a triple (q,u,i)S×Σ×BS(q,u,i)\in S\times\Sigma_{\vartriangleright\vartriangleleft}^{*}\times B_{S}, where uu is the unprocessed part of the input ww so uu is either w\vartriangleright\!w\!\vartriangleleft or a suffix of ww\!\vartriangleleft. The initial configuration of 1BA1\mathrm{BA} is (s0,w,1)(s_{0},\vartriangleright\!w\!\vartriangleleft,1), a move of 1BA1\mathrm{BA} is defined by the relation \vdash on configurations as follows: (q,σu,i)(p,u,j)(q,\sigma u,i)\vdash(p,u,j), where σΣ,ε\sigma\in\Sigma_{\vartriangleright\vartriangleleft,\varepsilon} if j=𝗎𝗉𝖽𝖡𝖲(p,i),pδ(q,σ,𝗀𝖾𝗍𝖡𝖨(i))j=\mathsf{upd}_{\mathsf{B_{S}}}(p,i),\,p\in\delta(q,\sigma,\mathsf{get}_{\mathsf{B_{I}}}(i)). A 1BA1\mathrm{BA} accepts the input ww if there exists a sequence of moves (computational path) such that after processing of w\vartriangleright\!w\!\vartriangleleft the final state is reached, i.e., (s0,w,1)(qf,ε,i)(s_{0},\vartriangleright\!w\!\vartriangleleft,1)\vdash^{\!\!\!{}^{*}}(q_{f},\varepsilon,i), where qfF,iBSq_{f}\in F,\,i\in B_{S}.

It is not easy to define classes of balloon automata (like PDAs or SAs) since one needs to define valid families of functions 𝗀𝖾𝗍𝖡𝖨\mathsf{get}_{\mathsf{B_{I}}} and 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}}. One can see an example of PDAs definition in terms of BA in [7]. We suggest another approach for the definition of BA classes in Section 4. The approach simplifies the definitions since it is only needed to define a language of correct protocols to define an ADS.

We define a protocol as a sequence of triples pi=ui𝗊i𝗋ip_{i}=u_{i}\mathsf{q}_{i}\mathsf{r}_{i} of the query-word uiu_{i}, the query 𝗊i\mathsf{q}_{i} and the response 𝗋i\mathsf{r}_{i} on the query. Numerous extra conditions are listed in the following formal definition.

Definition 6.

Let Γwrite,Γ𝗊𝗎𝖾𝗋𝗒,Γ𝗋𝖾𝗌𝗉\Gamma_{\textsf{write}},\Gamma_{\mathsf{query}},\Gamma_{\mathsf{resp}} be finite disjoint alphabets such that Γ𝗊𝗎𝖾𝗋𝗒,Γ𝗋𝖾𝗌𝗉\Gamma_{\mathsf{query}}\neq\varnothing,\Gamma_{\mathsf{resp}}\neq\varnothing. Let 𝗏𝖺𝗅𝗂𝖽Γ𝗊𝗎𝖾𝗋𝗒×Γ𝗋𝖾𝗌𝗉\mathsf{valid}\subseteq\Gamma_{\mathsf{query}}\times\Gamma_{\mathsf{resp}} be a relation that provides the correspondence between queries and possible responses. A protocol is a word pp such that p=p1pnp=p_{1}\cdots p_{n}, where n0n\geq 0, pi=ui𝗊i𝗋ip_{i}=u_{i}\mathsf{q}_{i}\mathsf{r}_{i}, uiΓwriteu_{i}\in\Gamma_{\textsf{write}}^{*}, qiΓ𝗊𝗎𝖾𝗋𝗒q_{i}\in\Gamma_{\mathsf{query}}, riΓ𝗋𝖾𝗌𝗉r_{i}\in\Gamma_{\mathsf{resp}}, and 𝗋i𝗏𝖺𝗅𝗂𝖽(𝗊i)\mathsf{r}_{i}\in\mathsf{valid}(\mathsf{q}_{i}). We call a word pip_{i} a query block. We say that a language 𝖯(ΓwriteΓ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉)\mathsf{P}\subseteq(\Gamma_{\textsf{write}}^{*}\Gamma_{\mathsf{query}}\Gamma_{\mathsf{resp}})^{*} is a language of correct protocols if the axioms (i-v) hold:

  1. (i)

    ε𝖯\varepsilon\in\mathsf{P};

  2. (ii)

    p𝖯:p\forall p\in\mathsf{P}:p is a protocol;

  3. (iii)

    p𝖯:\forall p\in\mathsf{P}: if p=p1p2p=p_{1}p_{2} and p1p_{1} is a protocol, then p1𝖯p_{1}\in\mathsf{P};

  4. (iv)

    p𝖯uΓwrite𝗊Γ𝗊𝗎𝖾𝗋𝗒𝗋Γ𝗋𝖾𝗌𝗉:pu𝗊𝗋𝖯\forall p\in\mathsf{P}\;\forall u\in\Gamma_{\textsf{write}}^{*}\;\forall\mathsf{q}\in\Gamma_{\mathsf{query}}\;\exists\mathsf{r}\in\Gamma_{\mathsf{resp}}:pu\mathsf{q}\mathsf{r}\in\mathsf{P};

  5. (v)

    pu𝗊𝗋𝖯:\forall pu\mathsf{q}\mathsf{r}\in\mathsf{P}: if p𝖯p^{\prime}\in\mathsf{P} and p=pu𝗊𝗋sp^{\prime}=pu\mathsf{q}\mathsf{r}^{\prime}s, then 𝗋=𝗋\mathsf{r}^{\prime}=\mathsf{r};

  6. (vi)

    𝗊Γ𝗊𝗎𝖾𝗋𝗒,𝗋Γ𝗋𝖾𝗌𝗉p1,p2𝖯:p1𝗊𝗋p2𝖯\exists\mathsf{q}\in\Gamma_{\mathsf{query}},\mathsf{r}\in\Gamma_{\mathsf{resp}}\;\forall p_{1},p_{2}\in\mathsf{P}:p_{1}\mathsf{q}\mathsf{r}p_{2}\in\mathsf{P}.

Axiom (vi) does not hold in the general case, e.g., for SAs and counter automata without zero tests. It is needed to describe the connection of automata with an ADS with BAs in Section 4.

A language of correct protocols 𝖯\mathsf{P} generates the corresponding class of languages, the principal rational cone 𝒯(𝖯){\cal T}(\mathsf{P}). All examples of BAs languages classes in [7] can be presented as 𝒯(𝖯){\cal T}(\mathsf{P}). We provide here only two examples.

Example 7.

It is well-known [2] that 𝖢𝖥𝖫=𝒯(D2){\mathsf{CFL}}={\cal T}(D_{2}), where D2D_{2} is the Dyck language with two types of parentheses. It is also well-known that a Dyck word is a protocol of the stack. We transform the language D2D_{2} into a language of protocols 𝖣𝟤-𝖯𝖱𝖮𝖳{\mathsf{D_{2}}\text{-}\mathsf{PROT}} as follows.

We define the alphabets Γwrite=\Gamma_{\textsf{write}}=\varnothing, Γ𝗊𝗎𝖾𝗋𝗒={𝗉𝗎𝗌𝗁(,𝗉𝗎𝗌𝗁[,𝗉𝗈𝗉}\Gamma_{\mathsf{query}}=\{\mathsf{push}_{\textsf{(}},\mathsf{push}_{\textsf{[}},\mathsf{pop}\}, Γ𝗋𝖾𝗌𝗉={(,),[,]}\Gamma_{\mathsf{resp}}=\{\textsf{(},\textsf{)},\textsf{[},\textsf{]}\}, 𝗏𝖺𝗅𝗂𝖽={(𝗉𝗎𝗌𝗁[,[),(𝗉𝗎𝗌𝗁(,(),(𝗉𝗈𝗉,]),(𝗉𝗈𝗉,))}\mathsf{valid}=\{(\mathsf{push}_{\textsf{[}},\textsf{[}\,),(\mathsf{push}_{\textsf{(}},\textsf{(}\,),(\mathsf{pop},\textsf{]}\,),(\mathsf{pop},\textsf{)}\,)\}. To define correct protocols we use an FST TT that erases all symbols from Γ𝗊𝗎𝖾𝗋𝗒\Gamma_{\mathsf{query}} of the input. So,

𝖣𝟤-𝖯𝖱𝖮𝖳={pT(p)D2}.{\mathsf{D_{2}}\text{-}\mathsf{PROT}}=\{p\mid T(p)\in D_{2}\}.

By the definition D2rat𝖣𝟤-𝖯𝖱𝖮𝖳D_{2}\mathop{\leq_{\mathrm{rat}}}{\mathsf{D_{2}}\text{-}\mathsf{PROT}}, so we have that 𝒯(D2)𝒯(𝖣𝟤-𝖯𝖱𝖮𝖳){\cal T}(D_{2})\subseteq{\cal T}({\mathsf{D_{2}}\text{-}\mathsf{PROT}}). It is also easy to show that 𝖣𝟤-𝖯𝖱𝖮𝖳ratD2{\mathsf{D_{2}}\text{-}\mathsf{PROT}}\mathop{\leq_{\mathrm{rat}}}D_{2}, so 𝒯(𝖣𝟤-𝖯𝖱𝖮𝖳)=𝒯(D2)=𝖢𝖥𝖫{\cal T}({\mathsf{D_{2}}\text{-}\mathsf{PROT}})={\cal T}(D_{2})={\mathsf{CFL}}.

Note that we set here Γwrite=\Gamma_{\textsf{write}}=\varnothing for the sake of simplicity. One can use another variant: Γwrite={(,[}\Gamma_{\textsf{write}}=\{\textsf{(},\textsf{[}\}, Γ𝗊𝗎𝖾𝗋𝗒={multipush,𝗉𝗈𝗉}\Gamma_{\mathsf{query}}=\{\textsf{multipush},\mathsf{pop}\}, Γ𝗋𝖾𝗌𝗉={pushed,),]}\Gamma_{\mathsf{resp}}=\{\textsf{pushed},\textsf{)},\textsf{]}\}. ∎

The following example is a starting point for the generalization presented in this paper.

Example 8.

The data structure Set consists of the set SS\SS which is initially empty. Set supports the following operations: 𝗂𝗇(x):SSSS{x}\mathsf{in}(x):\SS\to\SS\cup\{x\}, 𝗈𝗎𝗍(x):SSSS{x}\mathsf{out}(x):\SS\to\SS\setminus\{x\}, 𝗍𝖾𝗌𝗍(x):x?SS\mathsf{test}(x):x\stackrel{{\scriptstyle?}}{{\in}}\SS. We define the protocol language SA-PROT consistently with [13, 14], so the elements of alphabets below are individual symbols while they are words in [13, 14]. Γwrite={a,b}\Gamma_{\textsf{write}}=\{a,b\}, Γ𝗊𝗎𝖾𝗋𝗒={#𝗂𝗇,#𝗈𝗎𝗍,#𝗍𝖾𝗌𝗍},Γ𝗋𝖾𝗌𝗉={#,+#,#},𝗏𝖺𝗅𝗂𝖽={(#𝗂𝗇,#),(#𝗈𝗎𝗍,#),(#𝗍𝖾𝗌𝗍,+#),(#𝗍𝖾𝗌𝗍,#)}\Gamma_{\mathsf{query}}=\{\#\mathsf{in},\#\mathsf{out},\#\mathsf{test}\},\Gamma_{\mathsf{resp}}=\{\#,+\#,-\#\},\mathsf{valid}=\{(\#\mathsf{in},\#),(\#\mathsf{out},\#),(\#\mathsf{test},+\#),(\#\mathsf{test},-\#)\}.

It was proved in [13] that (1NSA)=𝒯(SA-PROT){\mathscr{L}}(1\mathrm{NSA})={\cal T}({\text{\sf{SA\text{-}PROT}}}). ∎

Definition 9.

Fix a language of correct protocols 𝖯\mathsf{P}. An automaton equipped with auxiliary data structure B𝖯\mathrm{B_{\mathsf{P}}} (defined by 𝖯\mathsf{P}) is defined by a tuple

S,Σ,Γwrite,Γ𝗊𝗎𝖾𝗋𝗒,Γ𝗋𝖾𝗌𝗉,F,s0,δ, where\langle S,\Sigma_{\vartriangleright\vartriangleleft},\Gamma_{\textsf{write}},\Gamma_{\mathsf{query}},\Gamma_{\mathsf{resp}},F,s_{0},\delta\rangle,\text{ where}
  • SS, Σ\Sigma_{\vartriangleright\vartriangleleft}, FF, s0s_{0} are the same as in Definition 4, so as Σ,ε\Sigma_{\vartriangleright\vartriangleleft,\varepsilon}.

  • S=SwriteS𝗊𝗎𝖾𝗋𝗒S=S_{\textsf{write}}\cup S_{\mathsf{query}}, SwriteS𝗊𝗎𝖾𝗋𝗒=S_{\textsf{write}}\cap S_{\mathsf{query}}=\varnothing.

  • 𝖯(ΓwriteΓ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉)\mathsf{P}\subseteq(\Gamma_{\textsf{write}}^{*}\Gamma_{\mathsf{query}}\Gamma_{\mathsf{resp}})^{*}.

  • δ\delta is the transition relation defined as

    δ([Swrite×Σ,ε]×[Γwrite×S])(S𝗊𝗎𝖾𝗋𝗒×Γ𝗊𝗎𝖾𝗋𝗒×Γ𝗋𝖾𝗌𝗉×Swrite).\delta\subseteq([S_{\textsf{write}}\times\Sigma_{\vartriangleright\vartriangleleft,\varepsilon}]\times[\Gamma_{\textsf{write}}^{*}\times S])\cup(S_{\mathsf{query}}\times\Gamma_{\mathsf{query}}\times\Gamma_{\mathsf{resp}}\times S_{\textsf{write}}).

The automaton has a one-way write-only query tape. During the processing of the input, it writes query-words uiΓwriteu_{i}\in\Gamma_{\textsf{write}}^{*} on the query tape, performs queries 𝗊i\mathsf{q}_{i}, and receives responses 𝗋i\mathsf{r}_{i} such that u1𝗊1𝗋1un𝗊n𝗋n𝖯u_{1}\mathsf{q}_{1}\mathsf{r}_{1}\cdots u_{n}\mathsf{q}_{n}\mathsf{r}_{n}\in\mathsf{P}. After each query, the query tape is erased.

A configuration of an ADS-automaton is a tuple

(s,v,u,p)S×Σ×Γwrite×(ΓwriteΓ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉),(s,v,u,p)\in S\times\Sigma_{\vartriangleright\vartriangleleft}^{*}\times\Gamma_{\textsf{write}}^{*}\times(\Gamma_{\textsf{write}}^{*}\Gamma_{\mathsf{query}}\Gamma_{\mathsf{resp}})^{*},

where vv is the unprocessed part of the input ww, i.e., vv is the suffix of w\vartriangleright\!w\!\vartriangleleft, uu is the content of the work tape, and pp is the protocol of the automaton operating with the data structure. A move of an automaton is defined via the relation \vdash on configurations which is defined as follows:

(s,av,u,p)\displaystyle(s,av,u,p) (s,v,ux,p),\displaystyle\vdash(s^{\prime},v,ux,p), if sSwrite,(s,a,x,s)δ,\displaystyle\text{ if }s\in S_{\textsf{write}},\,(s,a,x,s^{\prime})\in\delta, (9)
(s,v,u,p)\displaystyle(s,v,u,p) (s,v,ε,pu𝗊𝗋),\displaystyle\vdash(s^{\prime},v,\varepsilon,pu\mathsf{q}\mathsf{r}), if sS𝗊𝗎𝖾𝗋𝗒,(s,𝗊,𝗋,s)δ,pu𝗊𝗋𝖯.\displaystyle\text{ if }s\in S_{\mathsf{query}},\,(s,\mathsf{q},\mathsf{r},s^{\prime})\in\delta,\,pu\mathsf{q}\mathsf{r}\in\mathsf{P}. (10)

A configuration is initial if it has the form (s0,w,ε,ε)(s_{0},\vartriangleright\!w\!\vartriangleleft,\varepsilon,\varepsilon), a configuration is accepting if it has the form (sf,ε,ε,p)(s_{f},\varepsilon,\varepsilon,p), where sfF,p𝖯s_{f}\in F,p\in\mathsf{P}. A word ww is accepted by an automaton with ADS if (s0,w,ε,ε)(sf,ε,ε,p)(s_{0},\vartriangleright\!w\!\vartriangleleft,\varepsilon,\varepsilon)\vdash^{\!\!\!{}^{*}}(s_{f},\varepsilon,\varepsilon,p). An automaton is deterministic if for all configurations c,c1,c2c,c_{1},c_{2} from cc1c\vdash c_{1} and cc2c\vdash c_{2} follows c1=c2c_{1}=c_{2}.

For the next two models, we provide the definitions on the implementation level only.

Definition 10.

A DB𝖯log-TM\mathrm{D}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM} (NB𝖯log-TM\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}) is a deterministic (nondeterministic) log-TM{\log}\text{-}\mathrm{TM} MM equipped with an ADS defined by the language of correct protocols 𝖯\mathsf{P}. I.e., MM is equipped with an additional write-only one-way query tape that is used to write down a query word uiu_{i} and perform a query. After a query 𝗊i\mathsf{q}_{i} is performed, the tape is erased and the finite state control of MM receives the result 𝗋i\mathsf{r}_{i} of the query 𝗊i\mathsf{q}_{i}. The query results are consistent with 𝖯\mathsf{P}, i.e., p1pn𝖯p_{1}\cdots p_{n}\in\mathsf{P}, pi=ui𝗊i𝗋ip_{i}=u_{i}\mathsf{q}_{i}\mathsf{r}_{i}.

A configuration of B𝖯log-TM\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM} is a triple (c,u,p)(c,u,p) where cc is the configuration of log-TM{\log}\text{-}\mathrm{TM}-part, uu is the word written on the query tape, and p𝖯p\in\mathsf{P} is the protocol that is the result of all the performed queries. A B𝖯log-TM\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM} MM accepts a word ww if (c0(w),ε,ε)(cf,ε,p)(c_{0}(w),\varepsilon,\varepsilon)\vdash^{\!\!\!{}^{*}}(c_{f},\varepsilon,p), where c0(w)c_{0}(w) is the initial configuration of the log-TM{\log}\text{-}\mathrm{TM}-part of MM, cfc_{f} is the accepting configuration of log-TM{\log}\text{-}\mathrm{TM}-part of MM, and p𝖯p\in\mathsf{P}, the relation \vdash corresponds to the MM’s moves.

Definition 11.

Let FF be an arbitrary formal language (filter). A DAFlog-TM\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM} (NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM}) is a deterministic (non-deterministic) log-space TM equipped with a read-only one-way infinite tape called advice tape. At the beginning of the computation, the advice tape contains a word yΛy\Lambda^{\infty}, where yFy\in F and Λ\Lambda is a symbol that indicates empty cells.

A configuration of an AFlog-TM\mathrm{A}_{F}{\log}\text{-}\mathrm{TM} MM is a pair (c,u)(c,u) where cc is the configuration of the log-TM{\log}\text{-}\mathrm{TM}-part of MM, uu is the unprocessed part of yy. MM accepts a word xx if there exists yFy\in F such that (c0(x),y)(cf,ε)(c_{0}(x),y)\vdash^{\!\!\!{}^{*}}(c_{f},\varepsilon), where c0(x)c_{0}(x) is the initial configuration of the log-TM{\log}\text{-}\mathrm{TM}-part of MM, cfc_{f} is the accepting configuration of the log-TM{\log}\text{-}\mathrm{TM}-part of MM.

An equivalent model to DAFlog-TM\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM}s appeared in [17] and its journal version [19] under the name ‘‘models of generalized nondeterminism (GNA)’’ and lead to the appearance of the DRR(F)\mathrm{DRR}(F) problem. In this paper we repeat the steps of [17, 19] to establish the connection between NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM} and NRR(F)\mathrm{NRR}(F) problem in Section 5 to prove one of the main results of the paper Eq. (2). We also show the equivalence between DAFlog-TM\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM}s and GNA. The difference is that in GNA it is allowed not to process the advice till the end of the word, so it was demanded for FF to be a prefix-closed language in [17, 19].

3 Principal Rational Cones and
the NRR-Problem

In this section, we provide the core of our technique. We prove that (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) is a principal rational cone generated by the language of correct protocols 𝖯\mathsf{P}, i.e., (1NB𝖯A)=𝒯(𝖯){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A})={\cal T}(\mathsf{P}); it is the first main result of the section. This fact yields structural results about the family (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}), as well as the results on the complexity of the emptiness problem. We focus in this section on the connection between the non-emptiness problem and the NRR(𝖯)\mathrm{NRR}(\mathsf{P}) problem. We prove that these problems are equivalent under log-space reductions, it is the second main result of the section. It leads us to the main results of the paper in Section 5. We provide in this section structural results that naturally arise in the proofs. Other structural results are discussed in Section 4 since their relation to [7].

Most of the results of this section directly generalize the results of [13, Section 3] (see the full journal version [15]). In most cases, to get a generalized result, one can substitute SA protocols (see Example 8) with general protocols as defined in Definition 6. So, our general approach comes from the generalization of the technique that was developed for SAs. One can also find in [15] more technically detailed proofs.

Lemma 12.

There exists a 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} M𝖯M_{\mathsf{P}} recognizing 𝖯\mathsf{P}.

Proof.

Let us assume that M𝖯M_{\mathsf{P}} has on the input the word of the form p1pnp_{1}\cdots p_{n}, where pi=ui𝗊i𝗋ip_{i}=u_{i}\mathsf{q}_{i}\mathsf{r}_{i} (since it is a regular condition). M𝖯M_{\mathsf{P}} writes a word uiu_{i} on the query tape, performs the query 𝗊i\mathsf{q}_{i} and tests that the responce is 𝗋i\mathsf{r}_{i}. If all tests are correct than pp is accepted; otherwise, it is rejected. ∎

Lemma 13.

For each language of correct protocols 𝖯(ΓwriteΓ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉)\mathsf{P}\subseteq(\Gamma_{\textsf{write}}^{*}\Gamma_{\mathsf{query}}\Gamma_{\mathsf{resp}})^{*} there exists a language of correct protocols 𝖯{a,b}({a,b}Γ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉)\mathsf{P}_{\{a,b\}}\subseteq(\{a,b\}^{*}\Gamma_{\mathsf{query}}\Gamma_{\mathsf{resp}})^{*}, provided (Γ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉){a,b}=(\Gamma_{\mathsf{query}}\cup\Gamma_{\mathsf{resp}})\cap\{a,b\}=\varnothing, such that the following properties hold

  • (1NB𝖯A)=(1NB𝖯{a,b}A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A})={\mathscr{L}}(1\mathrm{NB}_{\mathsf{P}_{\{a,b\}}}\mathrm{A}),

  • (1DB𝖯A)=(1DB𝖯{a,b}A){\mathscr{L}}(1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A})={\mathscr{L}}(1\mathrm{DB}_{\mathsf{P}_{\{a,b\}}}\mathrm{A}),

  • There exists a DFST TT such that T(𝖯)=𝖯{a,b}T(\mathsf{P})=\mathsf{P}_{\{a,b\}} and T1T^{-1} is a DFST,

  • For each 1xB𝖯A1x\mathrm{B_{\mathsf{P}}}\mathrm{A} MM there exists an equivalent 1xB𝖯{a,b}A1x\mathrm{B}_{\mathsf{P}_{\{a,b\}}}\mathrm{A} M{a,b}M_{\{a,b\}} such that M{a,b}M_{\{a,b\}} is log-space constructible by MM and vice versa (x{N,D}x\in\{N,D\}).

Proof.

Enumerate all letters from Γwrite\Gamma_{\textsf{write}} and encode the ii-th letter as abiaab^{i}a. Such encoding is computable by a DFST TT and the inverse encoding is computed by T1T^{-1} that is a DFST as well. So, 𝖯{a,b}=T(𝖯)\mathsf{P}_{\{a,b\}}=T(\mathsf{P}) (we assume that TT preserves letters from Γ𝗊𝗎𝖾𝗋𝗒Γ𝗋𝖾𝗌𝗉\Gamma_{\mathsf{query}}\cup\Gamma_{\mathsf{resp}}). Now we show that for each 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} MM there exists an equivalent 1NB𝖯{a,b}A1\mathrm{NB}_{\mathsf{P}_{\{a,b\}}}\mathrm{A} M{a,b}M_{\{a,b\}}.

By our construction, M{a,b}M_{\{a,b\}} simulates MM, i. e., M{a,b}M_{\{a,b\}} has states of the form (s,𝖺𝗎𝗑)(s,\mathsf{aux}) where ss is a state of MM and 𝖺𝗎𝗑\mathsf{aux} is an auxiliary information needed for simulation; so for each configuration ((s,𝖺𝗎𝗑),v,u,p)((s,\mathsf{aux}),v,u^{\prime},p^{\prime}) of M{a,b}M_{\{a,b\}} there is a corresponding configuration (s,v,u,p)(s,v,u,p) of MM, where p=T(p)p^{\prime}=T(p) and uu^{\prime} is a prefix of T(u)T(u). M{a,b}M_{\{a,b\}} computes T(u)T(u) by simulation of TT via finite control and information of this simulation is stored in 𝖺𝗎𝗑\mathsf{aux}; the other part of finite control simulates MM’s transitions.

Each 1NB𝖯{a,b}A1\mathrm{NB}_{\mathsf{P}_{\{a,b\}}}\mathrm{A} M{a,b}M_{\{a,b\}} can be simulated by a 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} MM in the same way, one shall use T1T^{-1} instead of TT. Note that described simulations preserve determinism and the transformations between MM and M{a,b}M_{\{a,b\}} are log-space computable. ∎

Lemma 14.

Let TT be an FST with the input alphabet Δ\Delta and the output alphabet Σ\Sigma and MM be a 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} over the alphabet Σ\Sigma. There exists a 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} M=MTM^{\prime}=M\circ T recognizing the language T1(L(M))T^{-1}(L(M)). If TT is a DFST and MM is a 1DB𝖯A1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A} then MM^{\prime} is a 1DB𝖯A1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A} as well.

Proof.

The simulation is performed in a straight-forward way. MM^{\prime} guesses an image wT(w)w\in T(w^{\prime}) of the input word ww^{\prime} such that wL(M)w\in L(M) if T(w)L(M)T(w^{\prime})\cap L(M)\neq\varnothing, computes ww by simulation of TT and simulates MM on the input ww. MM^{\prime} has configurations of the form ((s,𝖺𝗎𝗑),v,u,p)((s,\mathsf{aux}),v^{\prime},u,p) that correspond to configurations (s,v,u,p)(s,v,u,p) of MM. As in the proof of Lemma 13, the 𝖺𝗎𝗑\mathsf{aux} information is used to simulate TT via finite state control. The construction preserves determinism of 1DB𝖯A1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A} if TT is a DFST. ∎

Lemma 15.

Let MM be a 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}. There exists an FST TMT_{M} such that wL(M)w\in L(M) iff TM(w)𝖯T_{M}(w)\cap\mathsf{P}\neq\varnothing. Moreover, pTM(w)p\in T_{M}(w) iff MM has a run on ww such that (s0,w,ε,ε)(sf,ε,ε,p)(s_{0},w,\varepsilon,\varepsilon)\vdash^{\!\!\!{}^{*}}(s_{f},\varepsilon,\varepsilon,p).

We denote by s𝑥𝑎ss\xrightarrow[x]{a}s^{\prime} the move of TMT_{M} from the state ss to the state ss^{\prime} on which it reads aa from the input tape and writes xx on the output tape.

Proof.

One can construct TMT_{M} by MM as follows. TMT_{M} has the same states as MM (and the same initial state and set of accepting states). In the case of move (9), TMT_{M} has the move s𝑥𝑎ss\xrightarrow[x]{a}s^{\prime}, and in the case of move (10), TMT_{M} has moves s𝗊𝗋𝜀ss\xrightarrow[\mathsf{q}\mathsf{r}^{\prime}]{\varepsilon}s^{\prime} for all 𝗋\mathsf{r}^{\prime} such that (s,𝗊,𝗋,s)δM(s,\mathsf{q},\mathsf{r}^{\prime},s^{\prime})\in\delta_{M}.

Assertion pTM(w)𝖯p\in T_{M}(w)\cap\mathsf{P} implies that MM has the corresponding run by axiom (v) in Definition 6. So, if TM(w)T_{M}(w) contains a correct protocol pp then MM has the run (s0,w,ε,ε)(sf,ε,ε,p)(s_{0},w,\varepsilon,\varepsilon)\vdash^{\!\!\!{}^{*}}(s_{f},\varepsilon,\varepsilon,p). The implication in the other direction directly follows from the construction of TMT_{M}. ∎

Definition 16.

An FST TMT_{M} from Lemma 15 called extractor (of protocols).

Theorem 17.

(1NB𝖯A)=𝒯(𝖯){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A})={\cal T}(\mathsf{P}).

Proof.

Lemma 15 implies that for each 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} MM there exists an extractor TMT_{M} such that L(M)=TM1(𝖯)L(M)=T_{M}^{-1}(\mathsf{P}), and by Lemma 3 there exists FST T=TM1T=T_{M}^{-1} such that L(M)=T(𝖯)L(M)=T(\mathsf{P}), so L(M)rat𝖯L(M)\mathop{\leq_{\mathrm{rat}}}\mathsf{P} and therefore (1NB𝖯A)𝒯(𝖯){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A})\subseteq{\cal T}(\mathsf{P}).

The inclusion 𝒯(𝖯)(1NB𝖯A){\cal T}(\mathsf{P})\subseteq{\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) follows from Lemmata 12 and 14: for each L=T(𝖯)L=T^{\prime}(\mathsf{P}) we take an FST T=T1T=T^{\prime-1} and apply the lemmata. ∎

Theorem 18.

E-1NB𝖯A¯logNRR(𝖯)logE-1NB𝖯A¯\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}}.

Proof.

Let MM be the input of the non-emptiness problem E-1NB𝖯A¯\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}} and TMT_{M} be the corresponding extractor. By Lemma 15, wL(M)TM(w)𝖯w\in L(M)\iff T_{M}(w)\cap\mathsf{P}\neq\varnothing. So, L(M)TM(Σ)𝖯L(M)\neq\varnothing\iff T_{M}(\Sigma^{*})\cap\mathsf{P}\neq\varnothing. Construct an NFA 𝒜{\cal A} recognizing TM(Σ)T_{M}(\Sigma^{*}) by Lemma 2 in log space. So,

L(M)L(𝒜)𝖯Def. 1𝒜NRR(𝖯).L(M)\neq\varnothing\iff L({\cal A})\cap\mathsf{P}\neq\varnothing\stackrel{{\scriptstyle\text{Def.~{}\ref{def:RR}}}}{{\iff}}{\cal A}\in\mathrm{NRR}(\mathsf{P}).

So we have proved E-1NB𝖯A¯logNRR(𝖯)\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P}).

The reduction NRR(𝖯)logE-1NB𝖯A¯\mathrm{NRR}(\mathsf{P})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}} follows from Lemmata 12 and 14. We construct by 𝒜{\cal A} on the input of NRR(𝖯)\mathrm{NRR}(\mathsf{P}) the automaton M=M𝖯TM=M_{\mathsf{P}}\circ T, where xTy(x=y)(xL(𝒜))xTy\iff(x=y)\land(x\in L({\cal A})). ∎

Theorem 19.

M-1DB𝖯AlogDRR(𝖯)\mathrm{M}\text{-}1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P}).

Proof.

We construct a DFA 𝒜{\cal A} on the input of DRR(𝖯)\mathrm{DRR}(\mathsf{P}) by (w,M)(w,M) on the input of M-1DB𝖯A\mathrm{M}\text{-}1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A} via a log-space transducer. The idea is that 𝒜{\cal A} simulates MM’s run on the input ww and checks the correctness of the protocol by reading the input word, that is a protocol p𝖯p\in\mathsf{P}. The protocol pp is accepted iff pp is the protocol of MM on processing of ww and MM accepts ww.

A state of 𝒜{\cal A} is a tuple (s,i,𝖺𝗎𝗑)(s,i,\mathsf{aux}) where sSMs\in S_{M}, ii is the index of the letter wiw_{i} over the MM’s head and 𝖺𝗎𝗑\mathsf{aux} is the auxiliary information needed for the simulation. To simulate a transition of MM, the following actions are performed by 𝒜{\cal A}. If MM writes a word vv (a subword of the future query word) to the query tape, 𝒜{\cal A} stores vv in the finite memory (a part of 𝖺𝗎𝗑\mathsf{aux} component of its states) and checks whether the unprocessed part of its input begins with vv (if not, the input word pp is rejected). If MM performs a query 𝗊\mathsf{q}, 𝒜{\cal A} verifies that the unprocessed part of its input begins with 𝗊𝗋\mathsf{q}\mathsf{r} and performs the transition that MM does after receiving 𝗋\mathsf{r} as a response. 𝒜{\cal A} accepts the input pp if it was not rejected during the simulation, i=|w|+1i=|w|+1 (i.e., MM’s head is over \vartriangleleft) and MM is in accepting state.

It follows from the construction that 𝒜{\cal A} accepts pp iff pp is the protocol of MM processing the input ww. Note that this protocol is unique since MM is a 1DB𝖯A1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}. Also since MM is 1DB𝖯A1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}, 𝒜{\cal A} is log-space constructible. Finally, L(𝒜)𝖯wL(M)L({\cal A})\cap\mathsf{P}\neq\varnothing\iff w\in L(M), so M-1DB𝖯AlogDRR(𝖯)\mathrm{M}\text{-}1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P}). ∎

4 Connection with Balloon Automata

We provide a high-level description of classes B{\mathscr{M}}_{B} of BAs. The definition in a more formal style could be found in [7].

Definition 20.

A subset of BAs B{\mathscr{M}}_{B} is a class of BAs if the following conditions hold.

  1. (I)

    B{\mathscr{M}}_{B} contains all automata with 𝗀𝖾𝗍𝖡𝖨\mathsf{get}_{\mathsf{B_{I}}} such that, for each state ss,𝗎𝗉𝖽𝖡𝖲(s,i)\mathsf{upd}_{\mathsf{B_{S}}}(s,i) is either ii for all ii or 𝗎𝗉𝖽𝖡𝖲(s,i)=j\mathsf{upd}_{\mathsf{B_{S}}}(s,i)=j for all ii and some constant jj.

  2. (II)

    If 𝒜,B{\cal A},{\cal B}\in{\mathscr{M}}_{B}, 𝗎𝗉𝖽𝖡𝖲𝒜,𝗀𝖾𝗍𝖡𝖨\mathsf{upd}_{\mathsf{B_{S}}}^{\cal A},\mathsf{get}_{\mathsf{B_{I}}}^{\cal B}, 𝗎𝗉𝖽𝖡𝖲𝒜,𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}}^{\cal A},\mathsf{upd}_{\mathsf{B_{S}}}^{\cal B} are the corresponding functions of 𝒜{\cal A} and {\cal B}, then B{\mathscr{M}}_{B} includes each automaton 𝒞{\cal C} such that 𝗀𝖾𝗍𝖡𝖨𝒞\mathsf{get}_{\mathsf{B_{I}}}^{\cal C} and 𝗎𝗉𝖽𝖡𝖲𝒞\mathsf{upd}_{\mathsf{B_{S}}}^{\cal C} are the functions that are obtained from the functions of 𝒜{\cal A} and {\cal B} via finite control, i.e., for each state sS𝒞s\in S_{\cal C} 𝗀𝖾𝗍𝖡𝖨𝒞(s,i)\mathsf{get}_{\mathsf{B_{I}}}^{\cal C}(s,i) equals to either 𝗀𝖾𝗍𝖡𝖨𝒜(s,i)\mathsf{get}_{\mathsf{B_{I}}}^{\cal A}(s,i) or 𝗀𝖾𝗍𝖡𝖨(s,i)\mathsf{get}_{\mathsf{B_{I}}}^{\cal B}(s,i) for all ii, for each i,ji,j if 𝗎𝗉𝖽𝖡𝖲𝒞(i)𝗎𝗉𝖽𝖡𝖲𝒞(j)\mathsf{upd}_{\mathsf{B_{S}}}^{\cal C}(i)\neq\mathsf{upd}_{\mathsf{B_{S}}}^{\cal C}(j) then either 𝗎𝗉𝖽𝖡𝖲𝒜(i)𝗎𝗉𝖽𝖡𝖲𝒜(j)\mathsf{upd}_{\mathsf{B_{S}}}^{\cal A}(i)\neq\mathsf{upd}_{\mathsf{B_{S}}}^{\cal A}(j) or 𝗎𝗉𝖽𝖡𝖲(i)𝗎𝗉𝖽𝖡𝖲𝒜(j)\mathsf{upd}_{\mathsf{B_{S}}}^{\cal B}(i)\neq\mathsf{upd}_{\mathsf{B_{S}}}^{\cal A}(j).

Property (I) implies that B{\mathscr{M}}_{B} contains automata that can reset any state ii of the balloon to the initial state 11 (or to some fixed state jj as well). Together with Property (II) it implies that the balloon has a reset operation that sets the balloon’s state to the initial state. This property does not hold for SAs, so there is no direct correspondence between classes of languages of BAs and automata with an ADS in the general case.

Theorem 21.

For each ADS B𝖯\mathrm{B_{\mathsf{P}}} there exists a balloon B\mathrm{B} and a subset of BAs B{\mathscr{M}}_{B} such that the corresponding classes of languages coincide, i.e. (xyB𝖯A)=(xyBA){\mathscr{L}}(xy\mathrm{B_{\mathsf{P}}}\mathrm{A})={\mathscr{L}}(xy\mathrm{BA}) and Property (II) holds. If 𝖯\mathsf{P} has the reset operation (vi), Property (I) also holds, i.e B{\mathscr{M}}_{B} is a class (in terms of Definition 20).

Proof.

We begin with the construction of the balloon BB and the bijection from xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} to xyBAxy\mathrm{BA} such that xyBAxy\mathrm{BA} form the set B{\mathscr{M}}_{B} satisfying Property (II). A state of the balloon BB is an integer that is the encoding of pairs of words (p,u)(p,u), where pp is the current protocol, i.e., the protocol of all previous operations before the upcoming move, and uu is the word on the query-tape. We enumerate all p𝖯p\in\mathsf{P} and all uΣu\in\Sigma^{*} and use the standard enumeration of pairs of integers.

Firstly, we define functions 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} and 𝗀𝖾𝗍𝖡𝖨\mathsf{get}_{\mathsf{B_{I}}} for the BA M𝖯BM^{B}_{\mathsf{P}} recognizing 𝖯\mathsf{P}. Recall that for any language of correct protocols 𝖯\mathsf{P} there exists 1DB𝖯A1\mathrm{D}\mathrm{B_{\mathsf{P}}}\mathrm{A} M𝖯M_{\mathsf{P}} recognizing 𝖯\mathsf{P} by Lemma 12. The function 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} simulates write operations and queries: it just updates the ballon’s state according to the encoding. The function 𝗀𝖾𝗍𝖡𝖨:>0Γ𝗋𝖾𝗌𝗉{}\mathsf{get}_{\mathsf{B_{I}}}:\mathbb{Z}_{>0}\to\Gamma_{\mathsf{resp}}\cup\{\bot\} returns responses or \bot if there were no query. For an arbitrary xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} MM the xyBAxy\mathrm{BA} MBM^{B} is constructed as follows. The function 𝗀𝖾𝗍𝖡𝖨M\mathsf{get}_{\mathsf{B_{I}}}^{M} is the same as for M𝖯BM^{B}_{\mathsf{P}} for any MBM^{B}. The function 𝗎𝗉𝖽𝖡𝖲M\mathsf{upd}_{\mathsf{B_{S}}}^{M} is a modification of the function for M𝖯BM^{B}_{\mathsf{P}} according to the finite state control of MM. We define the class (𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}(\mathsf{upd}_{\mathsf{B_{S}}}) more formally below to show that Property (II) holds.

As the result, the states of the ballon BB just encode the part of xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} that describes the data structures, and 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} and 𝗀𝖾𝗍𝖡𝖨\mathsf{get}_{\mathsf{B_{I}}} simulate the work with the data structure defined by 𝖯\mathsf{P}. So we provided the bijection between xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} and xyBAxy\mathrm{BA}.

We move to a formal definition of the class (𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}(\mathsf{upd}_{\mathsf{B_{S}}}). At first, we define 1(𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}_{1}(\mathsf{upd}_{\mathsf{B_{S}}}) satisfying Property (II). Assume that M𝖯M_{\mathsf{P}} writes at most one letter to the query tape per move and it also has a state sεs_{\varepsilon} in which it neither writes nor performs query. So, 𝗎𝗉𝖽𝖡𝖲(sε,i)=i\mathsf{upd}_{\mathsf{B_{S}}}(s_{\varepsilon},i)=i for all ii (hereinafter in M𝖯BM_{\mathsf{P}}^{B}). We mark a state ss as sas_{a} if M𝖯M_{\mathsf{P}} writes aa on the output tape and mark a state ss as s𝗊s_{\mathsf{q}} if MM performs query 𝗊\mathsf{q}. From definition follows that 𝗎𝗉𝖽𝖡𝖲(sm,i)=𝗎𝗉𝖽𝖡𝖲(sm,i)\mathsf{upd}_{\mathsf{B_{S}}}(s_{m},i)=\mathsf{upd}_{\mathsf{B_{S}}}(s^{\prime}_{m},i) for all states ss and ss^{\prime} marked by the same mark (aa, ε\varepsilon or 𝗊\mathsf{q}). So we define a function 𝗎𝗉𝖽𝖡𝖲𝖯:(Γwrite,εΓ𝗊𝗎𝖾𝗋𝗒)×>0>0\mathsf{upd}_{\mathsf{B_{S}}}^{\mathsf{P}}:(\Gamma_{\textsf{write},\varepsilon}\cup\Gamma_{\mathsf{query}})\times\mathbb{Z}_{>0}\to\mathbb{Z}_{>0} so that 𝗎𝗉𝖽𝖡𝖲𝖯(m,i)=𝗎𝗉𝖽𝖡𝖲(sm,i)\mathsf{upd}_{\mathsf{B_{S}}}^{\mathsf{P}}(m,i)=\mathsf{upd}_{\mathsf{B_{S}}}(s_{m},i). So for any xyBAxy\mathrm{BA} MM the function 𝗎𝗉𝖽𝖡𝖲M\mathsf{upd}_{\mathsf{B_{S}}}^{M} defined as follows. The states of MM are marked by symbols from Γwrite,εΓ𝗊𝗎𝖾𝗋𝗒\Gamma_{\textsf{write},\varepsilon}\cup\Gamma_{\mathsf{query}} and 𝗎𝗉𝖽𝖡𝖲M(sm,i)=𝗎𝗉𝖽𝖡𝖲𝖯(m,i)\mathsf{upd}_{\mathsf{B_{S}}}^{M}(s_{m},i)=\mathsf{upd}_{\mathsf{B_{S}}}^{\mathsf{P}}(m,i). It is easy to see that from our definition of 1(𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}_{1}(\mathsf{upd}_{\mathsf{B_{S}}}) follows the bijection between xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} and xyBAxy\mathrm{BA} and Property (II) holds as well.

If 𝖯\mathsf{P} has the reset operation (vi), then we shall modify the interpretation of BB since (𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}(\mathsf{upd}_{\mathsf{B_{S}}}) does not satisfy our definition anymore. Firstly we describe the interpretation of 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} functions for xyBAxy\mathrm{BA} MBM^{B} from Property (I). If 𝗎𝗉𝖽𝖡𝖲(s,i)=j\mathsf{upd}_{\mathsf{B_{S}}}(s,i)=j, ii and jj encode pairs (pi,ui)(p_{i},u_{i}) and (pj,uj)(p_{j},u_{j}) respectively and (pj,uj)(p_{j},u_{j}) is not obtained from (pi,ui)(p_{i},u_{i}) by a single move of M𝖯BM^{B}_{\mathsf{P}}, then we interpretate the state change iji\to j as follows. The corresponding to MBM^{B} xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} MM performs the reset operation and then performs sequence of queries that move the configuration from (ε,ε)(\varepsilon,\varepsilon) to (pj,uj)(p_{j},u_{j}) during ε\varepsilon moves. Note that by the definition of Property (I) MBM^{B} has finitely many jj’s in the range of 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} so MM is well-defined. Denote 𝗎𝗉𝖽𝖡𝖲\mathsf{upd}_{\mathsf{B_{S}}} functions for automata from Property (I) as I(𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}_{I}(\mathsf{upd}_{\mathsf{B_{S}}}). So (𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}(\mathsf{upd}_{\mathsf{B_{S}}}) is a closure of I(𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}_{I}(\mathsf{upd}_{\mathsf{B_{S}}}) and 1(𝗎𝗉𝖽𝖡𝖲){\mathscr{F}}_{1}(\mathsf{upd}_{\mathsf{B_{S}}}) in terms of Property (II). From Property (II) and our construction of xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A}’s for Property (I) follows the construction of xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A} for any of xyBAxy\mathrm{BA} from the closure in terms of Property (II). So, we have proved the second part of the theorem. ∎

So all the results from [7] that do not rely on (I) hold for B𝖯B_{\mathsf{P}}-automata. We are most interested in (1) and its complexity analogue (3). Many structural results from [7] follow from the fact that (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) is a principal cone (Theorem 17), namely, closure of (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) over union and rational transductions111Intersection and quotient with regular languages, gsm forward mapping are the partial cases of rational transductions.. We shall also mention the closure over gsm inverse mappings proved in [7] for all xyBAxy\mathrm{BA} that implies the same closure for all xyB𝖯Axy\mathrm{B_{\mathsf{P}}}\mathrm{A}.

Lemma 22.

If B𝖯\mathrm{B_{\mathsf{P}}} contains the reset operation then (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) is closed over concatenation and iteration.

Proof.

We construct 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}’s M2M^{2} and MM^{*} by 1NB𝖯A1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A} MM recognizing L(M)L(M)L(M)\cdot L(M) and L(M)L(M)^{*} respectively in a straight-forward way. M2M^{2} simulates MM and nondeterministically guess the split of the input uvuv such that u,vL(M)u,v\in L(M) at the end of the uu. If after processing of uu, MM is in an accepting state, M2M^{2} performs the reset operation and simulates MM on vv. MM^{*} guesses the split of the input into u1u2um,uiL(M)u_{1}u_{2}\ldots u_{m},u_{i}\in L(M) and acts in the similar way. ∎

The standard technique from [2] implies the following lemma.

Lemma 23.

If 𝖯#𝖯rat𝖯\mathsf{P}\#\mathsf{P}\mathop{\leq_{\mathrm{rat}}}\mathsf{P}, #Γ\#\not\in\Gamma, then (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) is closed over concatenation. If (𝖯#)rat𝖯(\mathsf{P}\#)^{*}\mathop{\leq_{\mathrm{rat}}}\mathsf{P}, #Γ\#\not\in\Gamma, then (1NB𝖯A){\mathscr{L}}(1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}) is closed over iteration.

Proof idea.

The construction is similar to the one from the proof of Lemma 22. FSTs TL2T_{L^{2}} and TLT_{L^{*}} uses marks #\# to split the input and simulate an FST TLT_{L} corresponding to the language LL, i.e., L=TL(𝖯)L=T_{L}(\mathsf{P}). ∎

Remark 24.

We leave open the question of the reduction in the opposite direction. I.e., does for each class of BAs exist a language of correct protocols 𝖯\mathsf{P} such that BAs recognize the same class of languages as B𝖯\mathrm{B_{\mathsf{P}}} automata? The essence of the problem is as follows. If axioms (I-II) for the class of BAs are satisfied, does it imply that there exists a ‘‘universal’’ BA MUM_{U} such that (1NBA)=𝒯(L(MU)){\mathscr{L}}(1\mathrm{NBA})={\cal T}(L(M_{U})) and for each M1NBAM\in 1\mathrm{NBA} there exists an FST TT such that L(M)=L(MUT)L(M)=L(M_{U}\circ T)?

5 RR Problems and 𝐥𝐨𝐠-𝐓𝐌{\log}\text{-}\mathrm{TM} Models

5.1 𝐀𝑭𝐥𝐨𝐠-𝐓𝐌\mathrm{A}_{F}{\log}\text{-}\mathrm{TM} models

In [17, 19] it was shown that DRR(Pref(FΛ))\mathrm{DRR}(\mathrm{Pref}(F\Lambda^{*})) is a complete problem in the class of languages recognizable by GNA with advices from FF (this model corresponds to DAFlog-TM\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM}, Pref(L)\mathrm{Pref}(L) is the set of all prefixes of LL). We prove that DRR(Pref(FΛ))\mathrm{DRR}(\mathrm{Pref}(F\Lambda^{*})) and DRR(F)\mathrm{DRR}(F) are complete problems in the class (DAFlog-TM){\mathscr{L}}(\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM}). We begin with the proof of similar result for NRR(F)\mathrm{NRR}(F) and (NAFlog-TM){\mathscr{L}}(\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM}). We introduce the following auxiliary lemma for the sake of the proof.

Lemma 25 (​​[12]).

F1ratF2NRR(F1)logNRR(F2)F_{1}\mathop{\leq_{\mathrm{rat}}}F_{2}\Rightarrow\mathrm{NRR}(F_{1})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(F_{2}).

Lemma 26.

(NAFlog-TM)logNRR(F){\mathscr{L}}(\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(F).

Proof.

An NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM} MM takes on the input a word xx and also takes yFy\in F on the advice tape. xL(M)yF:M(x,y)=1x\in L(M)\iff\exists y\in F:M(x,y)=1, where M(x,y)=1M(x,y)=1 if MM halts in an accepting state, M(x,y)=0M(x,y)=0 if MM halts in a rejecting state.

A surface-configuration of a NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM} is a tuple (q,𝗆𝖾𝗆,i,j)(q,\mathsf{mem},i,j) of the state qq, log-space memory configuration 𝗆𝖾𝗆\mathsf{mem} and the positions ii of the head on the input tape and jj of the head on the advice (one-way) tape. The tuples (q,𝗆𝖾𝗆,i)(q,\mathsf{mem},i) are the states of finite automata 𝒜{\cal A} on the input of NRR(F)\mathrm{NRR}(F) problem constructed by MM and xx. The initial state is (q0,,0)(q_{0},\varnothing,0), where q0q_{0} is the initial state of the NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM}, accepting states are states of the form (qf,𝗆𝖾𝗆,i)(q_{f},\mathsf{mem},i) where qfq_{f} is an accepting state of the NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM}. The transitions between the states are determined by letters of yy, i.e. (q,𝗆𝖾𝗆,i,j)(q,𝗆𝖾𝗆,i,j)(q,\mathsf{mem},i,j)\vdash(q^{\prime},\mathsf{mem}^{\prime},i^{\prime},j^{\prime}), i{i1,i,i+1}i^{\prime}\in\{i-1,i,i+1\}, j{j,j+1}j^{\prime}\in\{j,j+1\} if (q,𝗆𝖾𝗆,i)δ𝒜((q,𝗆𝖾𝗆,i,j),yj)(q^{\prime},\mathsf{mem}^{\prime},i^{\prime})\in\delta_{\cal A}((q,\mathsf{mem},i,j),y_{j}). The list of the 𝒜{\cal A}’s transitions δ𝒜\delta_{\cal A} is log-space computable so as the set of the 𝒜{\cal A}’s states as well.

Without loss of generality, we assume that MM always processes yy till the end, i.e. till mits Λ\Lambda on the advice tape. So, by the construction of 𝒜{\cal A}, we obtain

xL(M)\displaystyle x\in L(M) yF:M(x,y)yF,k0:yΛkL(𝒜)\displaystyle\iff\exists y\in F:M(x,y)\iff\exists y\in F,k\geq 0:y\Lambda^{k}\in L({\cal A})\iff
𝒜NRR(FΛ)Lemma 25𝒜NRR(F),\displaystyle\iff{\cal A}\in\mathrm{NRR}(F\Lambda^{*})\stackrel{{\scriptstyle\text{Lemma~{}\ref{lemma:leratRR}}}}{{\iff}}{\cal A}^{\prime}\in\mathrm{NRR}(F),

where 𝒜{\cal A}^{\prime} is constructed by 𝒜{\cal A} due to the reduction in Lemma 25. Since MM is fixed, we get that

x?L(M)log𝒜?NRR(FΛ)log𝒜?NRR(F),x\stackrel{{\scriptstyle?}}{{\in}}L(M)\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}{\cal A}\stackrel{{\scriptstyle?}}{{\in}}\mathrm{NRR}(F\Lambda^{*})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}{\cal A}^{\prime}\stackrel{{\scriptstyle?}}{{\in}}\mathrm{NRR}(F),

and we obtain that (NAFlog-TM)logNRR(F){\mathscr{L}}(\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(F) by the transitivity of the log-space reductions. ∎

Remark 27.

Note that FratFΛratPref(FΛ)F\mathop{\sim_{\mathrm{rat}}}F\Lambda^{*}\mathop{\sim_{\mathrm{rat}}}\mathrm{Pref}(F\Lambda^{*}) so the NRR\mathrm{NRR} problems for these filters are equivalent (up to log\mathop{\leq^{\mathrm{}}_{\mathrm{log}}} reductions). The equivalence holds since nondeterministic FST’s can have several images for the same word, particularly write many Λ\Lambda’s at the end of the word. It does not hold for deterministic FSTs, so FΛdratFF\Lambda^{*}\xcancel{\leq}_{\mathrm{drat}}F. So to obtain the corresponding lemma for DAFlog-TM\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM} we need to modify the proof of Lemma 26.

Lemma 28.

(DAFlog-TM)logDRR(F){\mathscr{L}}(\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(F).

Proof.

We repeat the steps of the proof of Lemma 26. Note that 𝒜{\cal A} is a DFA, since MM is a deterministic machine. To construct 𝒜{\cal A}^{\prime} we construct an auxiliary DFA 𝒜′′{\cal A}^{\prime\prime} by 𝒜{\cal A} as follows. 𝒜′′{\cal A}^{\prime\prime} has the states (q,Λ)(q,\bcancel{\Lambda}) and (q,Λ)(q,\Lambda) for each state qq of 𝒜{\cal A}. The auxiliary bit of a state indicates whether 𝒜′′{\cal A}^{\prime\prime} met Λ\Lambda. So for each transition qΛpq\xrightarrow{\Lambda}p of 𝒜{\cal A} there are two corresponding transitions (q,b)Λ(p,Λ)(q,b)\xrightarrow{\Lambda}(p,\Lambda), b{Λ,Λ}b\in\{\Lambda,\bcancel{\Lambda}\}. For states (q,Λ)(q,\Lambda) 𝒜{\cal A}^{\prime} has only transitions by Λ\Lambda. For the transitions q𝑎pq\xrightarrow{a}p, aΛa\neq\Lambda, 𝒜′′{\cal A}^{\prime\prime} has transitions (q,Λ)𝑎(p,Λ)(q,\bcancel{\Lambda})\xrightarrow{a}(p,\bcancel{\Lambda}). A state (q,b)(q,b) is an accepting if qq is an accepting state of 𝒜{\cal A}.

Now we construct 𝒜{\cal A}^{\prime}. It is obtained from 𝒜{\cal A} by removing all Λ\Lambda-transitions. Each 𝒜{\cal A}’s accepting state is an accepting for 𝒜{\cal A}^{\prime} and 𝒜{\cal A}^{\prime} also has accepting states determined as follows. If (q,Λ)(q,\bcancel{\Lambda}) has Λ\Lambda-path to an accepting state (qf,Λ)(q_{f},\Lambda) in 𝒜′′{\cal A}^{\prime\prime}, then qq is an accepting state in 𝒜{\cal A}^{\prime}. It is easy to see that yL(𝒜)k0yΛkL(𝒜)y\in L({\cal A}^{\prime})\iff\exists k\geq 0\;y\Lambda^{k}\in L({\cal A}) and 𝒜′′{\cal A}^{\prime\prime} is log-space computable from 𝒜{\cal A} and 𝒜{\cal A}^{\prime} is log-space computable from 𝒜{\cal A} and 𝒜′′{\cal A}^{\prime\prime}. ∎

Lemma 29.

NRR(F)log(NAFlog-TM)\mathrm{NRR}(F)\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}{\mathscr{L}}(\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM}) and DRR(F)log(DAFlog-TM)\mathrm{DRR}(F)\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}{\mathscr{L}}(\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM}). Moreover, there exist an NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM} MNRRM_{\mathrm{NRR}} that recognizes the problem NRR(F)\mathrm{NRR}(F) and MDRRM_{\mathrm{DRR}} that recognizes DRR(F)\mathrm{DRR}(F) as well.

Proof.

The proof is straightforward. MNRRM_{\mathrm{NRR}} gets on the input an NFA 𝒜{\cal A} and verifies whether 𝒜{\cal A} accepts the word yFy\in F written on the advice tape. If yL(𝒜)y\in L({\cal A}), MNRRM_{\mathrm{NRR}} nondeterministically guesses the 𝒜{\cal A}’s run on yy. So, by Definition 11, 𝒜L(MNRR){\cal A}\in L(M_{\mathrm{NRR}}) iff yF:yL(𝒜)𝒜NRR(F)\exists y\in F:y\in L({\cal A})\iff{\cal A}\in\mathrm{NRR}(F).

The construction for MDRRM_{\mathrm{DRR}} is the same. ∎

Theorem 30.
(NAFlog-TM)={LLlogNRR(F)},\displaystyle{\mathscr{L}}(\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(F)\},
(DAFlog-TM)={LLlogDRR(F)}.\displaystyle{\mathscr{L}}(\mathrm{DA}_{F}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(F)\}.
Proof.

By the definition of log\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}, LlogNRR(F)L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(F) iff there exists a log-TM{\log}\text{-}\mathrm{TM} transducer TT that maps the input xx of the problem x?Lx\stackrel{{\scriptstyle?}}{{\in}}L to the input T(x)T(x) of the problem NRR(F)\mathrm{NRR}(F). We construct an NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM} MM recognizing LL via the composition of TT and NAFlog-TM\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM} MNRRM_{\mathrm{NRR}} from Lemma 29.

So {LLlogNRR(F)}(NAFlog-TM)\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(F)\}\subseteq{\mathscr{L}}(\mathrm{NA}_{F}{\log}\text{-}\mathrm{TM}); the opposite inclusion follows from Lemma 26. We repeat the same arguments for the deterministic case and apply Lemma 28 for the opposite inclusion. ∎

5.2 𝐁𝗣𝐥𝐨𝐠-𝐓𝐌\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM} models

In Section 3 we exploited the following idea. In the case of a nondeterministic model, performing queries one by one and proceeding the computation depending on the queries’ results computationally equivalent to guessing all the queries results and verifying whether all the results were correct in the end (by testing whether obtained protocol was correct). In fact, this idea works even in the case of a deterministic model in Theorem 19. Now we exploit it again for log-TM{\log}\text{-}\mathrm{TM}-based models.

Lemma 31.
M-NA𝖯log-TMlogM-NB𝖯log-TMandM-DB𝖯log-TMlogM-DA𝖯log-TM.\mathrm{M}\text{-}\mathrm{NA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM}\sim_{\log}\mathrm{M}\text{-}\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}\ \text{and}\ \mathrm{M}\text{-}\mathrm{D}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{M}\text{-}\mathrm{DA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM}.

We provide only the proof idea since the proof follows our general technique that we have applied above a lot.

Proof idea.

Let MAM_{A} be a NA𝖯log-TM\mathrm{NA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM}, MBM_{B} be a NB𝖯log-TM\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}, and xx be an input word. Since both kinds of log-TM{\log}\text{-}\mathrm{TM}s are nondeterministic, MAM_{A} can guess and verify MBM_{B}’s successful run on xx provided that MBM_{B}’s protocol is written on the advice tape; MBM_{B} can guess y𝖯y\in\mathsf{P} and a successful run of MAM_{A} on (x,y)(x,y), and verify it: the transitions on configurations are simulated on log space and the fact y𝖯y\in\mathsf{P} is verified by performing subsequently the queries from the sequence yy.

The case of deterministic models is similar to Theorem 19. MAM_{A} just simulates MBM_{B} and tests whether the query words on the advice tape, queries an the results are the same as MBM_{B} has during processing of the input. ∎

Combining all together, we obtain the main theorem of the section.

Theorem 32.
NRR(𝖯)log(NB𝖯log-TM)={LLlogNRR(𝖯)},\displaystyle\mathrm{NRR}(\mathsf{P})\sim_{\log}{\mathscr{L}}(\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P})\}, (11)
(DB𝖯log-TM)logDRR(𝖯),\displaystyle{\mathscr{L}}(\mathrm{D}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P}), (12)
(DB𝖯log-TM){LLlogDRR(𝖯)}.\displaystyle{\mathscr{L}}(\mathrm{D}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})\subseteq\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P})\}. (13)
Proof.

We begin with the proof of (11). By Lemma 31

M-NB𝖯log-TMlogM-NA𝖯log-TM.\mathrm{M}\text{-}\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}\sim_{\log}\mathrm{M}\text{-}\mathrm{NA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM}. (14)

By Lemmata 26 and 29

(NA𝖯log-TM)logNRR(𝖯).{\mathscr{L}}(\mathrm{NA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM})\sim_{{\log}}\mathrm{NRR}(\mathsf{P}). (15)

Eqs. (14) and (15) imply

(NB𝖯log-TM)logNRR(𝖯).{\mathscr{L}}(\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})\sim_{\log}\mathrm{NRR}(\mathsf{P}). (16)

By Theorem 30

(NA𝖯log-TM)={LLlogNRR(𝖯)}.{\mathscr{L}}(\mathrm{NA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P})\}. (17)

Eqs. (14) and (17) imply

(NB𝖯log-TM)={LLlogNRR(𝖯)}.{\mathscr{L}}(\mathrm{N}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P})\}. (18)

Eqs. (16) and (18) form (11).

Now we move to the proof of (12) and (13). By Lemma 28

(DA𝖯log-TM)logDRR(𝖯).{\mathscr{L}}(\mathrm{DA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P}). (19)

By Lemma 31

M-DB𝖯log-TMlogM-DA𝖯log-TM.\mathrm{M}\text{-}\mathrm{D}\mathrm{B_{\mathsf{P}}}{\log}\text{-}\mathrm{TM}\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{M}\text{-}\mathrm{DA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM}. (20)

Eqs. (19) and (20) imply (12). By Theorem 30

(DA𝖯log-TM)={LLlogDRR(𝖯)}.{\mathscr{L}}(\mathrm{DA}_{\mathsf{P}}{\log}\text{-}\mathrm{TM})=\{L\mid L\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{DRR}(\mathsf{P})\}. (21)

Eqs. (20) and (21) imply (13). ∎

6 Applications

In this section we prove the applications (5-8) described in Section 1.1.

Theorem 33.

Assertions (5-8) hold.

Proof.

SA-PROT was defined in Example 8. It was proved in [14] that the problems E-1NSA¯logNRR(SA-PROT)\overline{\mathrm{E\text{-}1NSA}}\sim_{\log}\mathrm{NRR}({\text{\sf{SA\text{-}PROT}}}) are 𝐏𝐒𝐏𝐀𝐂𝐄{\mathbf{PSPACE}}-complete. So we obtain (6) by applying Theorem 32. We prove (5) in the same way by combining the facts 𝖣𝟤-𝖯𝖱𝖮𝖳ratD2{\mathsf{D_{2}}\text{-}\mathsf{PROT}}\sim_{\mathrm{rat}}D_{2} (Example 7) and NRR(D2)\mathrm{NRR}(D_{2}) is P-complete [12], and apply Lemma 25 and Theorem 32.

To prove (7-8) we use facts about the filters Perk={(w#)kwΣk}\mathrm{Per}_{k}=\{(w\#)^{k}\mid w\in\Sigma_{k}\}, where Σk\Sigma_{k} is a kk-letter alphabet. The problem NRR(Per1)\mathrm{NRR}(\mathrm{Per}_{1}) is 𝐍𝐏{\mathbf{NP}}-complete and NRR(Perk)\mathrm{NRR}(\mathrm{Per}_{k}), k>1k>1, is 𝐏𝐒𝐏𝐀𝐂𝐄{\mathbf{PSPACE}}-complete [1, 18]. We construct set-protocols based on these languages as follows. Let Γwrite=Σk\Gamma_{\textsf{write}}=\Sigma_{k}, Γ𝗊𝗎𝖾𝗋𝗒={𝗂𝗇,𝗍𝖾𝗌𝗍}\Gamma_{\mathsf{query}}=\{\mathsf{in},\mathsf{test}\}, Γ𝗋𝖾𝗌𝗉={+,}\Gamma_{\mathsf{resp}}=\{+,-\}. The response to the 𝗂𝗇\mathsf{in}-query is positive only for the first query, 𝗍𝖾𝗌𝗍\mathsf{test}-queries are the same as in Example 8. We denote the language of correct protocols with Γwrite=Σk\Gamma_{\textsf{write}}=\Sigma_{k} as 𝖲𝟣,𝗄𝖯𝖱𝖮𝖳{\mathsf{S_{1,k}PROT}}. It is easy to see that Perkrat𝖲𝟣,𝗄𝖯𝖱𝖮𝖳\mathrm{Per}_{k}\mathop{\leq_{\mathrm{rat}}}{\mathsf{S_{1,k}PROT}}: an FST TT maps words of the form w𝗂𝗇+w𝗍𝖾𝗌𝗍+w𝗍𝖾𝗌𝗍+w\mathsf{in}+w\mathsf{test}+\cdots w\mathsf{test}+ to w#w#w#w\#w\#\cdots w\# by replacing queries and responses by #\#; the sequence of queries with responses 𝗂𝗇+,𝗍𝖾𝗌𝗍+,,𝗍𝖾𝗌𝗍+\mathsf{in}+,\mathsf{test}+,\ldots,\mathsf{test}+ is verifiable via a finite state control (the inputs with invalid sequence are rejected by the FST), so NRR(Perk)logNRR(𝖲𝟣,𝗄𝖯𝖱𝖮𝖳)\mathrm{NRR}(\mathrm{Per}_{k})\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}({\mathsf{S_{1,k}PROT}}) by Lemma 25.

Now we prove that 𝖲𝟣,𝗄𝖯𝖱𝖮𝖳ratPerk{\mathsf{S_{1,k}PROT}}\mathop{\leq_{\mathrm{rat}}}\mathrm{Per}_{k}. The FST TT takes on the input a word (w#)n(w\#)^{n} and acts as follows. While translating a block w#w\# to the output, it has the following options: (i) change at least one letter, (ii) erase at least one letter and maybe change others, (iii) add at least one letter and maybe change others, (iv) do not change ww. Until TT has not write 𝗂𝗇\mathsf{in}, it replaces #\# by 𝗍𝖾𝗌𝗍\mathsf{test}- in the cases (i-iii), and either by 𝗍𝖾𝗌𝗍\mathsf{test}- or by 𝗂𝗇+\mathsf{in}+ in the case (iv). After TT wrote 𝗂𝗇+\mathsf{in}+, it replaces #\# by 𝗍𝖾𝗌𝗍+\mathsf{test}+ in the case (iv) and either by 𝗍𝖾𝗌𝗍\mathsf{test}- or by 𝗂𝗇\mathsf{in}- in the cases (i-iii). It is easy to see that T((w#)n)T((w\#)^{n}) consists of all correct protocols with either ww first 𝗂𝗇\mathsf{in}-query or without 𝗂𝗇\mathsf{in}-queries at all, and exactly nn queries. So T(Perk)=𝖲𝟣,𝗄𝖯𝖱𝖮𝖳T(\mathrm{Per}_{k})={\mathsf{S_{1,k}PROT}} and assertions (7-8) follows from Lemma 25 and Theorem 32. ∎

7 On computational complexity
of correct protocol languages

Theorem 18 essentially says that the computational complexity of the non-emptiness problem for ADS-automata is the same as the computational complexity of the NRR problem for the corresponding correct protocols languages. It can be used to answer the question about the range of complexities of the non-emptiness problems for ADS-automata. It extends the known results about the complexity of RR problems [20]. It appears that these complexities are almost universal. It means that for any nonempty language XX there exists a language of correct protocols 𝖯\mathsf{P} such that XX is reducible to E-1NB𝖯A¯\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}}. The reductions in the two directions differ. In one direction it is a log-space mm-reduction. In the other, we present the proof only for Turing reductions in polynomial time.

Theorem 34.

For any nonempty language X{0,1}X\subseteq\{0,1\}^{*} there exists a language of correct protocols 𝖯\mathsf{P} such that

XlogE-1NB𝖯A¯logTh. 18logNRR(𝖯)TPX.X\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\overline{\mathrm{E}\text{-}1\mathrm{N}\mathrm{B_{\mathsf{P}}}\mathrm{A}}\;\stackrel{{\scriptstyle\text{Th.~{}\ref{th:RReqNonEmp}}}}{{\sim_{\log}}}\;\mathrm{NRR}(\mathsf{P})\mathop{\leq^{\mathrm{P}}_{\mathrm{T}}}X.

In the proof of Theorem 34 we use the language of protocols defined as follows. Set Γwrite={0,1}\Gamma_{\textsf{write}}=\{0,1\}, Γ𝗊𝗎𝖾𝗋𝗒={#,r}\Gamma_{\mathsf{query}}=\{\#,r\}, Γ𝗋𝖾𝗌𝗉={+,,r}\Gamma_{\mathsf{resp}}=\{+,-,r\}. The relation 𝗏𝖺𝗅𝗂𝖽\mathsf{valid} is defined as follows: 𝗏𝖺𝗅𝗂𝖽(#)={+,}\mathsf{valid}(\#)=\{+,-\}, 𝗏𝖺𝗅𝗂𝖽(r)={r}\mathsf{valid}(r)=\{r\}. The language of correct protocols 𝖯\mathsf{P} consists of protocols such that, for every query block ui𝗊i𝗋iu_{i}\mathsf{q}_{i}\mathsf{r}_{i}, either 𝗊i=𝗋i=r\mathsf{q}_{i}=\mathsf{r}_{i}=r and ui=εu_{i}=\varepsilon, or 𝗊i=#\mathsf{q}_{i}=\#, 𝗋i=+\mathsf{r}_{i}=+ and uiLu_{i}\in L, or 𝗊i=#\mathsf{q}_{i}=\#, 𝗋i=\mathsf{r}_{i}=- and uiLu_{i}\notin L. Here L{0,1}L\subseteq\{0,1\}^{*} is a language depending on XX in the statement of the theorem.

The exact choice of LL is complicated. So we start with the presentation of basic ideas behind the proof of Theorem 34. We encode binary words using a log-space computable injective map sq:{0,1}{0,1}\mathrm{sq}\colon\{0,1\}^{*}\to\{0,1\}^{*} such that sq(X)L\mathrm{sq}(X)\subseteq L and sq(X¯)L¯\mathrm{sq}(\bar{X})\subseteq\bar{L}. It suffices for the first reduction in the theorem, XlogNRR(𝖯)X\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P}), since the protocol sq(x)#+\mathrm{sq}(x)\#+ is correct iff xXx\in X.

For the second reduction, i.e., NRR(𝖯)TPX\mathrm{NRR}(\mathsf{P})\mathop{\leq^{\mathrm{P}}_{\mathrm{T}}}X, we need much more requirements. Let 𝒜{\cal A} be an input automaton for NRR(𝖯)\mathrm{NRR}(\mathsf{P}) and SS be its state set. We are going to decide L(𝒜)𝖯L({\cal A})\cap\mathsf{P}\neq\varnothing in polynomial time using oracle calls of the oracle XX. For this purpose we reduce the question L(𝒜)𝖯L({\cal A})\cap\mathsf{P}\neq\varnothing to the question RR\neq\varnothing for some regular language R{y,n,#,+,,r}R\in\{y,n,\#,+,-,r\}^{*}. By definition, wRw\in R if there exists an accepting run of 𝒜{\cal A} that processes a correct protocol pp such that pp is obtained from ww by substitutions of letters yy and nn with words of LL and L¯\bar{L} respectively (different words may be used for different occurrences of the letters). To check the correctness of the run processing the protocol, we need to compute, for all pairs s,s′′Ss^{\prime},s^{\prime\prime}\in S, all possible transitions from ss^{\prime} to s′′s^{\prime\prime} by processing words from LL only as well as all possible transitions from ss^{\prime} to s′′s^{\prime\prime} by processing words from L¯\bar{L} only.

Thus, the main part of the reduction consists of solving NRR problems L(𝒜ss′′)LL({\cal A}_{s^{\prime}s^{\prime\prime}})\cap L\neq\varnothing and L(𝒜ss′′)L¯L({\cal A}_{s^{\prime}s^{\prime\prime}})\cap\bar{L}\neq\varnothing for all pairs s,s′′Ss^{\prime},s^{\prime\prime}\in S. Here 𝒜ss′′{\cal A}_{s^{\prime}s^{\prime\prime}} are auxiliary automata. The states and the transitions of 𝒜ss′′{\cal A}_{s^{\prime}s^{\prime\prime}} coincide with the states and the transitions of 𝒜{\cal A}. The initial state of 𝒜ss′′{\cal A}_{s^{\prime}s^{\prime\prime}} is ss^{\prime} and the only accepting state is s′′s^{\prime\prime}.

Note that L(𝒜ss′′)L({\cal A}_{s^{\prime}s^{\prime\prime}}) may be infinite and it causes the first difficulty: one need to consider arbitrary long words in the protocol language. To avoid this difficulty we require that any infinite regular language intersects both LL and L¯\bar{L}. Therefore L(𝒜ss′′)LL({\cal A}_{s^{\prime}s^{\prime\prime}})\cap L\neq\varnothing and L(𝒜ss′′)L¯L({\cal A}_{s^{\prime}s^{\prime\prime}})\cap\bar{L}\neq\varnothing if L(𝒜ss′′)L({\cal A}_{s^{\prime}s^{\prime\prime}}) is infinite.

If L(𝒜ss′′)L({\cal A}_{s^{\prime}s^{\prime\prime}}) is finite, it means that the transition graph is DAG (after removing states that are not reachable and coreachable in 𝒜ss′′{\cal A}_{s^{\prime}s^{\prime\prime}}). The second difficulty: it might be exponentially many words in L(𝒜ss′′)L({\cal A}_{s^{\prime}s^{\prime\prime}}). Again, to overcome it, we pose specific requirements on LL to guarantee that that verifying L(𝒜ss′′)LL({\cal A}_{s^{\prime}s^{\prime\prime}})\cap L\neq\varnothing and L(𝒜ss′′)L¯L({\cal A}_{s^{\prime}s^{\prime\prime}})\cap\bar{L}\neq\varnothing requires polynomially many oracle calls of the oracle XX.

Now we provide formal arguments for the above plan of proof. We encode binary words by the injective map

sq:xβ(x)11β(x)11,\mathrm{sq}\colon x\mapsto\beta(x)11\beta(x)11, (22)

where β:{0,1}{0,1}\beta\colon\{0,1\}^{*}\to\{0,1\}^{*} is the morphism defined on the symbols as β(0)=01\beta(0)=01, β(1)=10\beta(1)=10.

For an NFA 𝒜{\cal A} with the state set SS we define a relation

s𝑢s′′s^{\prime}\xhookrightarrow{u}s^{\prime\prime}

that holds if 𝒜{\cal A} can reach s′′s^{\prime\prime} on processing uu starting from the state ss^{\prime}.

Now we list the requirements on the language LL.

  1. 1.

    As it mentioned before, sq(X)L\mathrm{sq}(X)\subseteq L and sq(X¯)L¯\mathrm{sq}(\bar{X})\subseteq\bar{L}.

  2. 2.

    There exists a language W{0,1}W\subseteq\{0,1\}^{*} such that both WLW\cap L and WL¯W\cap\bar{L} are recognized in polynomial time, and, for any NFA 𝒜{\cal A} over the alphabet {0,1}\{0,1\} and any pair of its states s1s_{1}, s2s_{2}, either L(𝒜s1s2)L({\cal A}_{s_{1}s_{2}}) is finite, or there exist w1LWw_{1}\in L\cap W, w2L¯Ww_{2}\in\bar{L}\cap W such that w1L(𝒜s1s2)w_{1}\in L({\cal A}_{s_{1}s_{2}}) and w2L(𝒜s1s2)w_{2}\in L({\cal A}_{s_{1}s_{2}}).

  3. 3.

    The language WW is sparse: |W{0,1}n|=poly(n)|W\cap\{0,1\}^{\leq n}|=\mathop{\mathrm{poly}}\nolimits(n). Moreover, the lists of words in LW{0,1}nL\cap W\cap\{0,1\}^{\leq n} and, respectively, in L¯W{0,1}n\bar{L}\cap W\cap\{0,1\}^{\leq n} can be generated in polynomial time.

  4. 4.

    If |u|=|v||u|=|v|, uvu\neq v, and uvWuv\notin W then uvLuv\in L iff uvu\prec v, where \prec is the lexicographical order.

  5. 5.

    If |w||w| is odd and wWw\notin W then wLw\in L. If w=xxw=xx and wsq({0,1})Ww\notin\mathrm{sq}(\{0,1\}^{*})\cup W then wLw\in L.

The sets of LL-transitions and L¯\bar{L}-transitions are defined as follows:

δ𝒜L(s)={sS:us𝑢s,uL},δ𝒜L¯(s)={sS:us𝑢s,uL¯}.\delta^{L}_{{\cal A}}(s)=\big{\{}s^{\prime}\in S:\exists u\ s\xhookrightarrow{u}s^{\prime},\ u\in L\big{\}},\quad\delta^{\bar{L}}_{{\cal A}}(s)=\big{\{}s^{\prime}\in S:\exists u\ s\xhookrightarrow{u}s^{\prime},\ u\in\bar{L}\big{\}}.

The main part of the proof of Theorem 34 is the following lemma.

Lemma 35.

Let LL be a language satisfying Requirements 15. Then there exists a polynomial time algorithm with the oracle XX that outputs the sets δ𝒜L(s)\delta^{L}_{{\cal A}}(s), δ𝒜L¯(s)\delta^{\bar{L}}_{{\cal A}}(s), where 𝒜{\cal A} is an input of NRR(𝖯)\mathrm{NRR}(\mathsf{P}) and ss is its state.

Before presenting the algorithm from the lemma, we analyze the most difficult case separately.

Proposition 36.

Let LL be a language satisfying Requirements 15 and 𝒜{\cal A} be an NFA with the initial state s0s_{0} and the unique accepting state sfs_{f} such that L(𝒜)L({\cal A}) is finite, L(𝒜)W=L({\cal A})\cap W=\varnothing, and each word in L(𝒜)L({\cal A}) has an even length. Then conditions sfδ𝒜L(s0)s_{f}\in\delta^{L}_{{\cal A}}(s_{0}) and sfδ𝒜L¯(s0)s_{f}\in\delta^{\bar{L}}_{{\cal A}}(s_{0}) can be verified by a polynomial time algorithm with the oracle XX.

Proof.

By solving the reachability problem, one can detect the set of reachable and coreachable states of 𝒜{\cal A}. All other states can be deleted without affecting L(𝒜)L({\cal A}). From now on, we assume that all the states sSs\in S are reachable and coreachable.

Since L(𝒜)L({\cal A}) is finite, the transition graph of 𝒜{\cal A} is a DAG as well as all its subgraphs. For each pair of states s1,s2Qs_{1},s_{2}\in Q, let (s1,s2)\ell(s_{1},s_{2}) be the set

{k:us1𝑢s2and|u|=k}.\big{\{}k:\exists u\ s_{1}\xhookrightarrow{u}s_{2}\ \text{and}\ |u|=k\big{\}}.

Using topological sorting, one can construct all the sets (s1,s2)\ell(s_{1},s_{2}) in polynomial time by the backward induction based on the relation

(s1,s2)=sN(s1)(1+(s,s2)),\ell(s_{1},s_{2})=\bigcup_{s\in N(s_{1})}\big{(}1+\ell(s,s_{2})\big{)},

where N(s1)N(s_{1}) is the set of states that are reachable from ss in one move and 1+X={y:y=1+x,xX}1+X=\{y:y=1+x,\;x\in X\}.

For a positive integer \ell and a state ss of 𝒜{\cal A}, we define

Left(s,)={u:s0𝑢s,|u|=},Right(s,)={u:s𝑢sf,|u|=}.\mathrm{Left}(s,\ell)=\big{\{}u:s_{0}\xhookrightarrow{u}s,\ |u|=\ell\big{\}},\quad\mathrm{Right}(s,\ell)=\big{\{}u:s\xhookrightarrow{u}s_{f},\ |u|=\ell\big{\}}.

We order the sets Left(s,)\mathrm{Left}(s,\ell) and Right(s,)\mathrm{Right}(s,\ell) in the lexicographical order. Let min0(s,)\min_{0}(s,\ell) be the minimal word in Left(s,)\mathrm{Left}(s,\ell), and max0(s,)\max_{0}(s,\ell) be the maximal word in Left(s,)\mathrm{Left}(s,\ell), and min1(s,)\min_{1}(s,\ell) be the minimal word in Right(s,)\mathrm{Right}(s,\ell), and max1(s,)\max_{1}(s,\ell) be the maximal word in Right(s,)\mathrm{Right}(s,\ell).

There exists an inductive procedure that computes min0(s,)\min_{0}(s,\ell), max0(s,)\max_{0}(s,\ell), min1(s,)\min_{1}(s,\ell), and max1(s,)\max_{1}(s,\ell) in polynomial time. The procedure also verifies the conditions Left(s,)\mathrm{Left}(s,\ell)\neq\varnothing, Right(s,)\mathrm{Right}(s,\ell)\neq\varnothing. We describe computation of min0(s,)\min_{0}(s,\ell), the other words are computed similarly.

Suppose that uu is the prefix of min0(s,)\min_{0}(s,\ell) of the length 0k<0\leq k<\ell (if k=k=\ell, then the procedure returns uu and stops). Let Sk={s:s0𝑢s}S_{k}=\{s^{\prime}:s_{0}\xhookrightarrow{u}s^{\prime}\}. This set can be computed in polynomial time. If there exists sSks^{\prime}\in S_{k} and s′′Ss^{\prime\prime}\in S such that s′′δ𝒜(s,0)s^{\prime\prime}\in\delta_{{\cal A}}(s^{\prime},0) and k1(s′′,s)\ell-k-1\in\ell(s^{\prime\prime},s), then u0u0 is a prefix of min0(s,)\min_{0}(s,\ell) of the length k+1k+1. Otherwise, if there exists sSks^{\prime}\in S_{k} and s′′Ss^{\prime\prime}\in S such that s′′δ𝒜(s,1)s^{\prime\prime}\in\delta_{{\cal A}}(s^{\prime},1) and k1(s′′,s)\ell-k-1\in\ell(s^{\prime\prime},s), then u1u1 is a prefix of min0(s,)\min_{0}(s,\ell). If both conditions are not satisfied, then Left(s)=\mathrm{Left}(s)=\varnothing.

According to Requirement 4 on LL, if there exist a state ss and an integer \ell such that min0(s,)max1(s,)\min_{0}(s,\ell)\prec\max_{1}(s,\ell), then sfδ𝒜L(s0)s_{f}\in\delta^{L}_{{\cal A}}(s_{0}). Otherwise, max1(s,)min0(s,)\max_{1}(s,\ell)\preceq\min_{0}(s,\ell) for all ss, \ell. Since L(𝒜)W=L({\cal A})\cap W=\varnothing, in this case sfδ𝒜L(s0)s_{f}\in\delta^{L}_{{\cal A}}(s_{0}) if and only if there exist a state ss and an integer \ell such that min0(s,)=max1(s,)\min_{0}(s,\ell)=\max_{1}(s,\ell) and either min0(s,)=β(x)11\min_{0}(s,\ell)=\beta(x)11 and xXx\in X or min0(s,)max1(s,)sq({0,1})\min_{0}(s,\ell)\max_{1}(s,\ell)\notin\mathrm{sq}(\{0,1\}^{*}) due to Requirements 1, 5. The condition xXx\in X can be verified by an oracle call, the rest of conditions can be verified in polynomial time.

A similar check can be done for the condition sfδ𝒜L¯(s0)s_{f}\in\delta^{\bar{L}}_{{\cal A}}(s_{0}). It is equivalent to the following: there exist a state ss and an integer \ell such that either min1(s,)max0(s,)\min_{1}(s,\ell)\prec\max_{0}(s,\ell), or min1(s,)=max0(s,)=β(x)11\min_{1}(s,\ell)=\max_{0}(s,\ell)=\beta(x)11 and xXx\notin X. ∎

Proof of Lemma 35.

The algorithm maintains the sets S+SS^{+}\subseteq S, SSS^{-}\subseteq S. Initially, S+=S=S^{+}=S^{-}=\varnothing. We will prove that at the end S+=δ𝒜L(s)S^{+}=\delta^{L}_{{\cal A}}(s), S=δ𝒜L¯(s)S^{-}=\delta^{\bar{L}}_{{\cal A}}(s). The algorithm analyzes states sSs^{\prime}\in S one by one and adds ss^{\prime} to the sets S+S^{+}, SS^{-} according to the following rules.

In the first step, the algorithm decides whether L(𝒜ss)L({\cal A}_{ss^{\prime}}) is infinite. It can be done in polynomial time. If the answer is ‘yes’, then the algorithm adds ss^{\prime} to both sets S+S^{+}, SS^{-} and continues with the next state. The correctness of this step is guaranteed by Requirement 2.

If the answer at the first step is ‘no’, the lengths of words in L(𝒜ss)L({\cal A}_{ss^{\prime}}) do not exceed |S||S| (otherwise, there exists a run of 𝒜{\cal A} from ss to ss^{\prime} containing a cycle, which implies that L(𝒜ss)L({\cal A}_{ss^{\prime}}) is infinite). In the second step, the algorithm checks whether L(𝒜ss)LWL({\cal A}_{ss^{\prime}})\cap L\cap W\neq\varnothing and, respectively, whether L(𝒜ss)L¯WL({\cal A}_{ss^{\prime}})\cap\bar{L}\cap W\neq\varnothing. It can be done in polynomial time due to Requirement 3. If the first condition holds, then the algorithm adds ss^{\prime} to S+S^{+}. If the second condition holds, then the algorithm adds ss^{\prime} to SS^{-}.

In the third step, the algorithm constructs an NFA 𝒜{\cal A}^{\prime} recognizing L(𝒜ss)WL({\cal A}_{ss^{\prime}})\setminus W. Let PP be the set of prefixes of all words in W{0,1}|S|W\cap\{0,1\}^{\leq|S|}. Due to Requirement 3, |P|=poly(|S|)|P|=\mathop{\mathrm{poly}}\nolimits(|S|) and PP can be constructed in polynomial time. The states of 𝒜{\cal A}^{\prime} are the pairs (s~,p)(\tilde{s},p), s~S\tilde{s}\in S, pP{}p\in P\cup\{\bot\}. The set of transitions δ𝒜((s,p),a)\delta_{{\cal A}^{\prime}}((s,p),a) consists of pairs (s~,p)(\tilde{s},p^{\prime}) such that s~δ𝒜(s,a)\tilde{s}\in\delta_{{\cal A}}(s,a) and p=paPp^{\prime}=pa\in P, and pairs (s~,)(\tilde{s},\bot) such that s~δ𝒜(s,a)\tilde{s}\in\delta_{{\cal A}}(s,a) and p=paPp^{\prime}=pa\notin P. The set of transitions δ𝒜((s,),a)\delta_{{\cal A}^{\prime}}((s,\bot),a) consists of pairs (s~,)(\tilde{s},\bot) such that s~δ𝒜(s,a)\tilde{s}\in\delta_{{\cal A}}(s,a). The initial state is (s,ε)(s,\varepsilon). Accepting states are pairs (s,)(s^{\prime},\bot) and (s,p)(s^{\prime},p), where pWp\notin W. This definition implies that 𝒜{\cal A}^{\prime} can be constructed in polynomial time. To prove the correctness of the construction, note that processing a word wW{0,1}|S|w\in W\cap\{0,1\}^{\leq|S|} from (s,ε)(s,\varepsilon) finishes at the state (s,w)(s^{\prime},w) which is not accepting. For a word wL(𝒜ss)Ww\in L({\cal A}_{ss^{\prime}})\setminus W there exists an accepting run of 𝒜ss{\cal A}_{ss^{\prime}}. The corresponding run of 𝒜{\cal A}^{\prime} finishes at a state of the form (s,w)(s^{\prime},w) or (s,)(s^{\prime},\bot). Thus, ww is accepted by AA^{\prime}.

In the fourth step, the algorithm checks whether L(𝒜ss)WL({\cal A}_{ss^{\prime}})\setminus W contains a word of odd length. It can be done in polynomial time since words of odd length form a regular language and the intersection of this language with L(𝒜ss)WL({\cal A}_{ss^{\prime}})\setminus W is recognized by an NFA with 2|S|2|S^{\prime}| states, where SS^{\prime} is the state set of 𝒜{\cal A}^{\prime}. If the answer is ‘yes’, then the algorithm adds qq^{\prime} to S+S^{+}. The correctness of this step is guaranteed by Requirement 5.

In the fifth step, the algorithm constructs an NFA 𝒜′′{\cal A}^{\prime\prime} that accepts exactly the words of even length from L(𝒜ss)WL({\cal A}_{ss^{\prime}})\setminus W, apply to it the algorithm of Proposition 36, updates S+S^{+}, SS^{-} if necessary, and continues with the next state.

It is clear from the above remarks that at the end S+δ𝒜L(s)S^{+}\subseteq\delta^{L}_{{\cal A}}(s), Sδ𝒜L¯(s)S^{-}\subseteq\delta^{\bar{L}}_{{\cal A}}(s).

Suppose that sδ𝒜L(s)s^{\prime}\in\delta^{L}_{{\cal A}}(s). If L(𝒜ss)L({\cal A}_{ss^{\prime}}) is infinite then ss^{\prime} is added to S+S^{+} at the first step. If L(𝒜ss)WL{0,1}|Q|L({\cal A}_{ss^{\prime}})\cap W\cap L\cap\{0,1\}^{\leq|Q|}\neq\varnothing, then ss^{\prime} is added at the second step. Otherwise, (L(𝒜ss)L)W(L({\cal A}_{ss^{\prime}})\cap L)\setminus W should be non-empty. If there are words of odd length in L(𝒜ss)WL({\cal A}_{ss^{\prime}})\setminus W, then ss^{\prime} is added at the fourth step. And, finally, if L(𝒜ss)WL({\cal A}_{ss^{\prime}})\setminus W consists of words of even length only, ss^{\prime} is added at the fifth step due to Proposition 36. Therefore, S+=δ𝒜L(s)S^{+}=\delta^{L}_{{\cal A}}(s) at the end of the algorithm.

Suppose that sδ𝒜L¯(s)s^{\prime}\in\delta^{\bar{L}}_{{\cal A}}(s). If L(𝒜ss)L({\cal A}_{ss^{\prime}}) is infinite then ss^{\prime} is added to SS^{-} at the first step. If L(𝒜ss)WL¯{0,1}|S|L({\cal A}_{ss^{\prime}})\cap W\cap\bar{L}\cap\{0,1\}^{\leq|S|}\neq\varnothing, then ss^{\prime} is added at the second step. Otherwise, (L(𝒜ss)L¯)W(L({\cal A}_{ss^{\prime}})\cap\bar{L})\setminus W\neq\varnothing and ss^{\prime} is added at the fifth step due to Proposition 36. Therefore, S=δ𝒜L¯(s)S^{-}=\delta^{\bar{L}}_{{\cal A}}(s) at the end of the algorithm. ∎

Now we prove that Requirements 15 on LL are compatible.

Lemma 37.

There exists LL satisfying Requirements 15.

Proof.

We define WW at first. For each triple a,b,ca,b,c of non-empty binary words there are two words in WW in the form ab2r(a,b,c)cab^{2r(a,b,c)}c and ab2q(a,b,c)+1cab^{2q(a,b,c)+1}c and for each wWw\in W there exists a unique triple a,b,ca,b,c such that either w=ab2r(a,b,c)cw=ab^{2r(a,b,c)}c or w=ab2q(a,b,c)+1cw=ab^{2q(a,b,c)+1}c. The definition of WW is inductive. Order all triples x,y,zx,y,z of non-empty binary words with respect to the length of xyzxyz and order the triples with the same length of xyzxyz with respect to the lexicographical order on the triples of binary words (binary words are also ordered lexicographically).

Assume that for all (x,y,z)(x,y,z) less than (a,b,c)(a,b,c) we have defined s(x,y,z)s(x,y,z) and t(x,y,z)t(x,y,z) properly. Thus the set WWW^{\prime}\subseteq W has been already defined. The total number of (x,y,z)(x,y,z) less than (a,b,c)(a,b,c) does not exceed (|abc|12)(2|abc|1)\binom{|abc|-1}{2}\cdot(2^{|abc|}-1). Thus, there are at most 2(|abc|12)(2|abc|1)2\binom{|abc|-1}{2}\cdot(2^{|abc|}-1) words from WW^{\prime} having lengths in the range [23|abc|+3,23|abc|+41][2^{3|abc|+3},2^{3|abc|+4}-1]. So, there exist at least

23|abc|+32(|abc|12)(2|abc|1)1>2|abc|>2|b|\frac{2^{3|abc|+3}}{2\binom{|abc|-1}{2}\cdot(2^{|abc|}-1)}-1>2|abc|>2|b|

consecutive integers ii in the range such that no word in WW^{\prime} has the length ii. At least |b||b| of them are even and at least |b||b| of them are odd. It guarantees that the sets

E={j:ab2jcW, 23|abc|+3|ab2jc|<23|abc|+4}and\displaystyle E=\{j:ab^{2j}c\notin W^{\prime},\ 2^{3|abc|+3}\leq|ab^{2j}c|<2^{3|abc|+4}\}\ \text{and}
O={j:ab2j+1cW, 23|abc|+3|ab2j+1c|<23|abc|+4}\displaystyle O=\{j:ab^{2j+1}c\notin W^{\prime},\ 2^{3|abc|+3}\leq|ab^{2j+1}c|<2^{3|abc|+4}\}

are non-empty. Set r(a,b,c)r(a,b,c) be the minimal jj in EE and q(a,b,c)q(a,b,c) be the minimal jj in OO.

To define LL, we require that the words from WW in the form ab2q(a,b,c)+1cab^{2q(a,b,c)+1}c are in LL, while the words from WW in the form ab2r(a,b,c)cab^{2r(a,b,c)}c are in L¯\bar{L}. Note that it implies Requirement 2, since any infinite regular language contains all words in the form abkcab^{k}c, k>0k>0, for some aa, bb, cc.

By construction, for each wWw\in W the length of defining triple a,b,ca,b,c is logarithmic in the length of ww. Thus |W{0,1}n|=poly(n)|W\cap\{0,1\}^{\leq n}|=\mathop{\mathrm{poly}}\nolimits(n). To construct the list of words in LW{0,1}nL\cap W\cap\{0,1\}^{\leq n} and the list of words in L¯W{0,1}n\bar{L}\cap W\cap\{0,1\}^{\leq n} one need to perform only polynomial number of steps of the defining procedure and each step can be performed in polynomial time. Therefore, Requirement 3 is satisfied.

The rest of LL is defined to satisfy Requirements 14, and 5. Note that sq({0,1})W=\mathrm{sq}(\{0,1\}^{*})\cap W=\varnothing, since, for each x{0,1}x\in\{0,1\}^{*}, sq(x)\mathrm{sq}(x) does not contain proper periodic subwords of length greater |sq(x)|/2|\mathrm{sq}(x)|/2 but each word in WW do contain such words. It means that the construction of WW does not conflict with Requirement 1. ∎

Now Theorem 34 follows from Lemma 35 and Lemma 37.

Proof of Theorem 34.

Choose LL as in the proof of Lemma 37. The reduction XlogNRR(𝖯)X\mathop{\leq^{\mathrm{}}_{\mathrm{log}}}\mathrm{NRR}(\mathsf{P}) is given by a map xsq(x)#+x\mapsto\mathrm{sq}(x)\#+. It is clear that the map is computed in logarithmic space. The correctness of reduction follows from Requirement 1.

Now we describe the second reduction, NRR(𝖯)TPX\mathrm{NRR}(\mathsf{P})\mathop{\leq^{\mathrm{P}}_{\mathrm{T}}}X. Let 𝒜{\cal A} be an input NFA for NRR(𝖯)\mathrm{NRR}(\mathsf{P}). The reducing algorithm computes all sets δ𝒜L(s)\delta^{L}_{{\cal A}}(s), δ𝒜L¯(s)\delta^{\bar{L}}_{{\cal A}}(s) using Lemma 35.

Let {\cal B} be an NFA with the same state set as 𝒜{\cal A}. The alphabet of BB is {y,n,#,+,,r}\{y,n,\#,+,-,r\}. Transitions δ(s,a)\delta_{{\cal B}}(s,a) coincide with transitions δ𝒜(s,a)\delta_{{\cal A}}(s,a) for a{#,+,,r}a\in\{\#,+,-,r\}. For the rest of transitions, δ(s,y)=δ𝒜L(s)\delta_{{\cal B}}(s,y)=\delta^{L}_{{\cal A}}(s) and δ(s,n)=δ𝒜L¯(s)\delta_{{\cal B}}(s,n)=\delta^{\bar{L}}_{{\cal A}}(s). The initial state and the accepting states of {\cal B} and of 𝒜{\cal A} coincide.

Let R=L()(y#+n#rr)R=L({\cal B})\cap\big{(}y\#+\mid n\#-\mid rr\big{)}^{*}. Then L(𝒜)𝖯L({\cal A})\cap\mathsf{P}\neq\varnothing iff RR\neq\varnothing. The latter condition is verified in polynomial time since RR is regular. ∎

Acknowledgments

This work is supported by the Russian Science Foundation grant 20–11–20203.

References

  • [1] T. Anderson, J. Loftus, N. Rampersad, N. Santean, and J. Shallit. Special Issue: LATA 2008 Detecting palindromes, patterns and borders in regular languages. Information and Computation, 207(11):1096–1118, 2009.
  • [2] J. Berstel. Transductions and context-free languages. Ed. Teubner, 1979.
  • [3] A. Bouajjani, J. Esparza, and O. Maler. Reachability analysis of pushdown automata: Application to model-checking. In International Conference on Concurrency Theory, pages 135–150. Springer, 1997.
  • [4] D. Chistikov, R. Majumdar, and P. Schepper. Subcubic certificates for cfl reachability. Proc. ACM Program. Lang., 6(POPL), jan 2022.
  • [5] M. Daley, M. Eramian, and I. Mcquillan. The bag automaton: A model of nondeterministic storage. J. Autom. Lang. Comb., 13(3):185–206, June 2008.
  • [6] D. Dolev, S. Even, and R. Karp. On the security of ping-pong protocols. Information and Control, 55(1):57–68, 1982.
  • [7] J. E. Hopcroft and J. D. Ullman. An approach to a unified theory of automata. In SWAT 1967, pages 140–147, 1967.
  • [8] M. Kutrib, A. Malcher, and M. Wendlandt. Set automata. International Journal of Foundations of Computer Science, 27(02):187–214, 2016.
  • [9] K.-J. Lange and K. Reinhardt. Set automata. In Combinatorics, Complexity and Logic; Proceedings of the DMTCS’96, pages 321–329. Springer, 1996.
  • [10] D. Melski and T. Reps. Interconvertibility of a class of set constraints and context-free-language reachability. Theoretical Computer Science, 248(1-2):29–98, 2000.
  • [11] T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’95, page 49–61, New York, NY, USA, 1995. Association for Computing Machinery.
  • [12] A. Rubtsov and M. Vyalyi. Regular realizability problems and context-free languages. In DCFS 2015, volume 9118 of LNCS, pages 256–267. Springer, 2015.
  • [13] A. Rubtsov and M. Vyalyi. On computational complexity of set automata. In DLT 2017, pages 332–344, Cham, 2017. Springer International Publishing.
  • [14] A. Rubtsov and M. Vyalyi. On emptiness and membership problems for set automata. In CSR 2018, pages 295–307, Cham, 2018. Springer International Publishing.
  • [15] A. Rubtsov and M. Vyalyi. On computational complexity of set automata. Information and Computation, to appear.
  • [16] M. Sipser. Introduction to the theory of computation. Cengage Learning, 2013.
  • [17] M. Vyalyi. On models of a nondeterministic computation. In CSR 2009, pages 334–345, Berlin, Heidelberg, 2009. Springer Berlin Heidelberg.
  • [18] M. Vyalyi. On the models of nondeterminizm for two-way automata (in Russian). Proceedings of VIII international conference <<Discrete models in the theory of control systems>>., pages 54–60, 2009.
  • [19] M. N. Vyalyi. On regular realizability problems. Probl. Inf. Transm., 47(4):342–352, 2011.
  • [20] M. N. Vyalyi. On expressive power of regular realizability problems. Probl. Inf. Transm., 49(3):276–291, 2013.
  • [21] P. Wolf. On the decidability of finding a positive ilp-instance in a regular set of ilp-instances. In DCFS 2019, volume 11612 of LNCS, pages 272–284. Springer, 2019.
  • [22] P. Wolf and H. Fernau. Regular intersection emptiness of graph problems: Finding a needle in a haystack of graphs with the help of automata. CoRR, abs/2003.05826, 2020.
  • [23] M. Yannakakis. Graph-theoretic methods in database theory. In Proceedings of the Ninth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, PODS ’90, page 230–242, New York, NY, USA, 1990. Association for Computing Machinery.