The \(\mathsf{AC}^0\)-Complexity Of Visibly Pushdown Languages


Abstract

We study the question of which visibly pushdown languages (VPLs) are in the complexity class \(\mathsf{AC}^0\) and how to effectively decide this question. Our contribution is to introduce a particular subclass of one-turn VPLs, called intermediate VPLs, for which the raised question is entirely unclear: to the best of our knowledge our research community is unaware of containment or non-containment in \(\mathsf{AC}^0\) for any language in our newly introduced class. Our main result states that there is an algorithm that, given a visibly pushdown automaton, correctly outputs exactly one of the following: that its language \(L\) is in \(\mathsf{AC}^0\), some \(m\geq 2\) such that \(L\) is \(\mathsf{ACC}^0(m)\)-hard (implying that \(L\) is not in \(\mathsf{AC}^0\)), or a finite disjoint union of intermediate VPLs that \(L\) is constant-depth equivalent to. In the latter of the three cases one can moreover effectively compute \(k,l\in\mathbb{N}_{>0}\) with \(k\not=l\) such that the concrete intermediate VPL \(L(S\rightarrow \varepsilon\mid a c^{k-1} S b_1\mid ac^{l-1}Sb_2)\) is constant-depth reducible to the language \(L\). Due to their particular nature we conjecture that either all intermediate VPLs are in \(\mathsf{AC}^0\) or all are not. As a corollary of our main result we obtain that in case the input language is a visibly counter language our algorithm can effectively determine if it is in \(\mathsf{AC}^0\) — hence our main result generalizes a result by Krebs et al. stating that it is decidable if a given visibly counter language is in \(\mathsf{AC}^0\) (when restricted to well-matched words).

For our proofs we revisit so-called \(\mathop{\mathrm{Ext}}\)-algebras (introduced by Czarnetzki et al.), which are closely related to forest algebras (introduced by Bojańczyk and Walukiewicz), and use Green’s relations.

1

[a]

[b]

1 Introduction↩︎

This paper studies the circuit complexity of formal word languages. It is well-known that the regular word languages are characterized as the languages recognizable by finite monoids. When restricting the finite monoids to be aperiodic Schützenberger proved that one obtains precisely the star-free regular languages [1]. In terms of logic, these correspond to the languages definable in first-order logic \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{<}] } { \mathsf{FO}_{\null}[\mathsf{<}] }\) by a result of McNaughton and Papert [2]. The more general class of regular languages expressible in \(\mathsf{FO}[\mathsf{arb}]\), i.e. first-order logic with arbitrary numerical predicates, coincides with the regular languages in \(\mathsf{AC}^0\) [3], [4]. These can be characterized algebraically as the regular languages whose syntactic morphism is quasi-aperiodic [5]. The latter algebraic characterization also shows that it is decidable if a regular language is in \(\mathsf{AC}^0\).

Generalizing regular languages, Mehlhorn introduced input-driven languages [6]. They are described by pushdown automata whose input alphabet is partitioned into letters that are either of type call, internal, or return. Rediscovered by Alur and Madhusudan in 2004 [7] under the name of visibly pushdown languages (VPLs), it was shown that they enjoy many of the desirable effective closure properties of the regular languages. For instance, the visibly pushdown languages form an effective Boolean algebra. Algebraically, VPLs were characterized by Alur et al. [8] by congruences on well-matched words of finite index. Extending upon these, Czarnetzki et al. introduced so-called \(\mathop{\mathrm{Ext}}\)-algebras [9]; these involve pairs of monoids \((R,O)\) where \(O\) is a submonoid of \(R^R\). Being tailored towards recognizing word languages, \(\mathop{\mathrm{Ext}}\)-algebras are closely connected to forest algebras, introduced by Bojańczyk and Walukiewicz [10]: in [9] it is shown that a language of well-matched words is visibly pushdown if, and only if, its syntactic \(\mathop{\mathrm{Ext}}\)-algebra is finite. While context-free languages are generally in \(\mathsf{LOGCFL}=\mathsf{SAC}^1\), the visibly pushdown languages, as the regular languages, are known to be in \(\mathsf{NC}^1\) [11]. By a famous result of Barrington [12], there already exist regular languages that are \(\mathsf{NC}^1\)-hard.

Related work. Visibly pushdown languages (VPLs) were introduced [7] via deterministic visibly pushdown automata (DVPA for short). Inspired by forest algebras [10] the paper [9] introduces \(\mathop{\mathrm{Ext}}\)-algebras. Unfortunately, the definition of \(\mathop{\mathrm{Ext}}\)-algebra morphisms in [9] is incorrect in that it provably does not lead to freeness.

The regular languages that are in \(\mathsf{AC}^0\) were effectively characterized by Barrington et al. [5]. By an automata-theoretic approach, Krebs et al. [13] effectively characterized the visibly counter languages that are in \(\mathsf{AC}^0\). These are particular VPLs that are essentially accepted by visibly pushdown automata that use only one stack symbol. In his PhD thesis [14] Ludwig already considers the question of which VPLs are in \(\mathsf{AC}^0\). Unfortunately, his conjectural characterization contains several serious flaws.

Our contribution. We reintroduce \(\mathop{\mathrm{Ext}}\)-algebras, fix the notion of \(\mathop{\mathrm{Ext}}\)-algebra morphisms and define the languages they recognize. We also reintroduce the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of languages of well-matched words. We rigorously prove classical results like freeness and minimality of syntactic \(\mathop{\mathrm{Ext}}\)-algebras with respect to recognition. We prove that a language of well-matched words is a VPL if, and only if, it is recognizable by a finite \(\mathop{\mathrm{Ext}}\)-algebra. While these results essentially revisit the constructions of [9], we use \(\mathop{\mathrm{Ext}}\)-algebras as a technical tool for studying the complexity of visibly pushdown languages.

Fix a visibly pushdown alphabet \(\Sigma\), i.e.\(\Sigma\) is partitioned into \(\Sigma_\text{call}\) (call letters), \(\Sigma_\text{int}\) (internal letters), and \(\Sigma_\text{ret}\) (return letters). Denoting \(\Delta(u)\) as the difference between the number of occurrences of call and return letters in \(u\in\Sigma^*\), a word \(w\in\Sigma^*\) is well-matched if \(\Delta(w)=0\) and \(\Delta(u)\geq 0\) for all prefixes \(u\) of \(w\). A context is a pair \((u,v)\) such that \(uv\) is well-matched — contexts have a natural composition operation: \((u,v)\circ(u',v')=(uu',v'v)\).

A set of contexts \(\mathcal{R}\) is length-synchronous if \(|u|/|v|=|u'|/|v'|\) for all \((u,v),(u',v')\in\mathcal{R}\) with \(\Delta(u),\Delta(u')>0\) and weakly length-synchronous if \(u=u'\) implies \(|v|=|v'|\) and \(v=v'\) implies \(|u|=|u'|\) for all \((u,v),(u',v')\in\mathcal{R}\) with \(\Delta(u),\Delta(u')>0\). Any language \(L\) of well-matched words induces a congruence \(\equiv_L\) on contexts: \((u,v)\equiv_L(u',v')\) if \(xuwvy\in L\Leftrightarrow xu'wv'y\in L\) for all contexts \((x,y)\) and all well-matched words \(w\). We introduce the notion of quasi-counterfreeness: a language is quasi-counterfree if for all contexts \(\sigma\in\Sigma^k\times\Sigma^l\) with \(k,l\in\mathbb{N}\) arbitrary at least one of the following holds: (1) there exists some \(n\in\mathbb{N}\) such that \(\sigma^n\equiv_L\sigma^{n+1}\) or (2) no context in \(\Sigma^k\times\Sigma^l\) is \(\equiv_L\)-equivalent to \(\sigma\circ\sigma\). Finally, we introduce our central class of intermediate VPLs: a VPL is intermediate if it is quasi-counterfree and generated by a context-free grammar containing the production \(S\rightarrow_G \varepsilon\), where \(S\) is the start nonterminal and whose other productions are of the form \(T\rightarrow_G u T'v\) where \(uv\) is well-matched, \(u\in(\Sigma_\text{int}^*\Sigma_\text{call}\Sigma_\text{int}^*)^+\) and \(v\in(\Sigma_\text{int}^*\Sigma_\text{ret}\Sigma_\text{int}^*)^+\), such that the set of contexts \(\{(u,v)\mid S\Rightarrow_G^*uSv\}\) is weakly length-synchronous but not length-synchronous. Note that intermediate VPLs are particular one-turn visibly pushdown languages, that is, visibly pushdown languages that are subsets of \((\Sigma\setminus\Sigma_\text{ret})^*(\Sigma\setminus\Sigma_\text{call})^*\). As an example, for all \(k,l\geq 1\) with \(k\not=l\), a concrete intermediate VPL, denoted by \(\mathcal{L}_{k,l}\), is the one that is generated by the context-free grammar \(S\rightarrow \varepsilon\mid a c^{k-1} S b_1\mid ac^{l-1}Sb_2\): here \(a\) is a call letter, \(c\) is an internal letter and \(b_1\) and \(b_2\) are return letters.

As far as we know the techniques known to our community do not directly suffice to show whether at all there is some intermediate VPL that is provably in \(\mathsf{AC}^0\) or provably not in \(\mathsf{AC}^0\) — analogous remarks apply to \(\mathsf{ACC}^0\). Our main result states that there is an algorithm that, given a DVPA \(A\) correctly outputs exactly one of the following: \(L(A)\in\mathsf{AC}^0\), some \(m\geq 2\) such that \(L(A)\) is \(\mathsf{ACC}^0(m)\)-hard (implying that \(L(A)\not\in\mathsf{AC}^0\)), or a non-empty disjoint finite union of intermediate VPLs that \(L(A)\) is constant-depth equivalent to. In the latter of the three cases one can moreover effectively compute \(k,l\in\mathbb{N}_{>0}\) with \(k\not=l\) such that the above-mentioned \(\mathcal{L}_{k,l}\) is constant-depth reducible to \(L(A)\). We conjecture that either all intermediate VPLs are in \(\mathsf{AC}^0\) or all are not: note that together with our main result this conjecture implies the existence of an algorithm that can effectively determine if a given visibly pushdown language is in \(\mathsf{AC}^0\). As a corollary of our main result we obtain that in case the input language is a visibly counter language our algorithm can effectively determine if it is in \(\mathsf{AC}^0\), hence our main result generalizes a result by Krebs et al. stating that it is decidable if a given visibly counter lanugage is in \(\mathsf{AC}^0\) (when restricted to well-matched words).

For our main result we extensively study \(\mathop{\mathrm{Ext}}\)-algebras, the syntactic morphisms of VPLs, and make use of Green’s relations.

Organization. Our paper is organized as follows. We introduce notation and give an overview of our main result in Section 2. In Section 3 we first recall general algebraic concepts and then revisit \(\mathop{\mathrm{Ext}}\)-algebras and their correspondence to visibly pushdown languages. Section 4 introduces central notions like length-synchronicity and weak length-synchronicity for \(\mathop{\mathrm{Ext}}\)-algebra morphisms and visibly pushdown languages. The proof of our main result is content of Section 5. In Section 6 we concern ourselves with the computability of the syntactic \(\mathop{\mathrm{Ext}}\)-algebra as well as decidability of quasi-aperiodicity and (weak) length-synchronicity. We conclude in Section 7.

2 Preliminaries↩︎

By \(\mathbb{N}\) we denote the non-negative integers and by \(\mathbb{N}_{>0}\) the positive integers. For integers \(i,j\in\mathbb{Z}\) we denote by \([i,j]\) the set \(\{i,\ldots,j\}\). For any function \(f\colon X\rightarrow Y\) and any subset \(Z\subseteq X\) we denote by \({f|}_{Z}\colon Z\rightarrow Y\) the restriction of \(f\) to domain \(Z\), i.e. \({f|}_{Z}(z)=f(z)\) for all \(z\in Z\).

For all words \(w=w_1\cdots w_n\), where \(w_i\in\Sigma\) for all \(i\in[1,n]\), and for subsets \(\Gamma\subseteq\Sigma\), let \(\left|w\right|_\Gamma=|\{i\in[1,|w|]\mid w_i\in\Gamma\}|\) denote the number of occurrences of letters in \(\Gamma\). For all \(a\in\Sigma\) we write \(\left|w\right|_a\) to denote \(\left|w\right|_{\{a\}}\). Given a finite set \(I\) and languages \(L_i \subseteq \Sigma^*\) for all \(i \in I\), we call disjoint union of the \(L_i\)’s and denote by \(\biguplus_{i \in I} L_i\) the union \(\bigcup_{i \in I} \$^{\sigma(i)} L_i\) for an arbitrary ordering bijection \(\sigma\colon I \to [1, \left|I\right|]\) and a letter \(\$ \notin \Sigma\). We define the languages

  • \(\mathrm{EQUALITY}=\bigl\{w\in\{0,1\}^* \mathrel{\big|}|w|_0=|w|_1\bigr\}\), and

  • \(\mathrm{MOD}_m=\bigl\{w\in\{0,1\}^* \mathrel{\big|}m\text{ divides } |w|_{1}\bigr\}\) for each \(m\geq 2\).

A visibly pushdown alphabet is a finite alphabet \(\Sigma=\Sigma_\text{call} \cup\Sigma_\text{int} \cup\Sigma_\text{ret}\), where the alphabets \(\Sigma_\text{call},\Sigma_\text{int}\), and \(\Sigma_\text{ret}\) are pairwise disjoint.

The set of well-matched words over a visibly pushdown alphabet \(\Sigma\), denoted by \(\Sigma^\triangle\), is the smallest set satisfying the following:

  • \(\varepsilon \in \Sigma^\triangle\) and \(c \in \Sigma^\triangle\) for all \(c \in \Sigma_\text{int}\),

  • \(a w b \in \Sigma^\triangle\) for all \(w \in \Sigma^\triangle\), \(a \in \Sigma_\text{call}\) and \(b \in \Sigma_\text{ret}\), and

  • \(u v \in \Sigma^\triangle\) for all \(u, v \in \Sigma^\triangle \setminus \{\varepsilon\}\).

A well-matched word \(w\in\Sigma^\triangle\) is one-turn if \(w\in(\Sigma\setminus\Sigma_\text{ret})^*(\Sigma\setminus\Sigma_\text{call})^*\). A language \(L\subseteq\Sigma^\triangle\) is one-turn if it contains only one-turn words. Let \(\Sigma\) be a visibly pushdown alphabet. We define \(\Delta\colon \Sigma^* \to \mathbb{Z}\) to be the height monoid morphism such that \(\Delta(w) = \left|w\right|_{\Sigma_\text{call}}-\left|w\right|_{\Sigma_\text{ret}}\) for all \(w \in \Sigma^*\).

A context is a pair \((u,v)\in\Sigma^*\times\Sigma^*\) such that \(uv\in\Sigma^\triangle\). The composition of two contexts \((u,v),(x,y)\in\mathsf{Con}(\Sigma)\) is defined as \((u,v)\circ(x,y)=(ux,yv)\). For \(\sigma\in\mathsf{Con}(\Sigma)\) by \(\sigma^k\) we denote the \(k\)-fold composition \(\sigma\circ\dots\circ\sigma\). For any context \((u,v)\in\mathsf{Con}(\Sigma)\) and well-matched word \(w\in\Sigma^\triangle\) we define \((u,v)w=uwv\). An equivalence relation \(\equiv\) on \(\mathsf{Con}(\Sigma)\) is a congruence if for all \(\chi,\chi',\sigma,\tau\in\mathsf{Con}(\Sigma)\) we have that \(\sigma\equiv\tau\) implies \(\chi\circ\sigma\circ\chi'\equiv\chi\circ\tau\circ\chi'\). Given a congruence \(\equiv\) over \(\mathsf{Con}(\Sigma)\) we denote by \(\lbrack \sigma\rbrack_{\equiv}\) the equivalence class of \(\sigma\). Given a language of well-matched words \(L\subseteq\Sigma^\triangle\) we write \(\sigma\equiv_L\tau\) if for all \(\chi\in\mathsf{Con}(\Sigma)\) and all \(w\in\Sigma^\triangle\) we have \((\chi\circ\sigma)w\in L\) if, and only if, \((\chi\circ\tau)w\in L\). Clearly, \(\equiv_L\) is a congruence.

A context-free grammar is a tuple \(G=(V,\Sigma,P,S)\), where \(V\) is a finite set of nonterminals, \(\Sigma\) is a non-empty finite alphabet, \(P\subseteq V\times(V\cup\Sigma)^*\) is a finite set of productions, and \(S\in V\) is the start nonterminal. We write \(T\rightarrow_Gy\) whenever \((T,y)\in P\). The binary relation \(\Rightarrow_G\) over \((V\cup\Sigma)^*\) is defined as \(u\Rightarrow_G v\) if there exists a production \(T\rightarrow_Gy\) and \(x,z\in(V\cup\Sigma)^*\) such that \(u=xTz\) and \(v=xyz\). By \(L(G)=\{w\in\Sigma^*\mid S\Rightarrow_G^*w\}\) we denote the language of \(G\), where \(\Rightarrow_G^*\) is the reflexive transitive closure of \(\Rightarrow_G\).

In the following we introduce deterministic visibly pushdown automata, remarking that nondeterministic visibly pushdown automata are determinizable [7].

A deterministic visibly pushdown automaton (DVPA) is a tuple \(A = (Q, \Sigma, \Gamma, \delta, q_0, F, \bot)\), where

  • \(Q\) is a finite set of states,

  • \(\Sigma\) is a visibly pushdown alphabet, the input alphabet,

  • \(\Gamma\) is a finite alphabet, the stack alphabet,

  • \(q_0 \in Q\) is the initial state,

  • \(F \subseteq Q\) is the set of final states,

  • \(\bot \in \Gamma\) is the bottom-of-stack symbol, and

  • \(\delta\colon Q \times \Sigma \times \Gamma \to Q \times \bigl(\{\varepsilon\} \cup \Gamma \cup (\Gamma \setminus \{\bot\}) \Gamma \bigr)\) is the transition function such that for all \(q \in Q, a \in \Sigma, \alpha \in \Gamma\):

    • if \(a \in \Sigma_\text{call}\), then \(\delta(q, a, \alpha) \in Q \times (\Gamma \setminus \{\bot\}) \alpha\),

    • if \(a \in \Sigma_\text{ret}\), then \(\delta(q, a, \alpha) \in Q \times \{\varepsilon\}\), and

    • if \(a \in \Sigma_\text{int}\), then \(\delta(q, a, \alpha) \in Q \times \{\alpha\}\).

We define the extended transition function \(\widehat{\delta}\colon Q \times \Sigma^* \times \Gamma^* \to Q \times \Gamma^*\) inductively as

  • \(\widehat{\delta}(q, \varepsilon, \beta) = (q, \beta)\) for all \(q \in Q\) and \(\beta\in \Gamma^*\),

  • \(\widehat{\delta}(q, w, \varepsilon) = (q, \varepsilon)\) for all \(q \in Q\) and \(w \in \Sigma^+\), and

  • \(\widehat{\delta}(q, a w, \alpha \beta) = \widehat{\delta}(p, w, \gamma \beta)\), where \(\delta(q, a, \alpha) = (p, \gamma)\) for all \(q \in Q\), \(a \in \Sigma\), \(w \in \Sigma^*\), \(\alpha \in \Gamma\) and \(\beta\in \Gamma^*\).

The language accepted by \(A\) is the language \(L\mathopen{}\left(A\right)\mathclose{} = \{w \in \Sigma^* \mid \widehat{\delta}(q_0, w, \bot) \in F \times \{\bot\}\}\). We call such a language a visibly pushdown language (VPL). We remark that visibly pushdown languages are always subsets of \(\Sigma^\triangle\).

We refer to [15] for further details on formal language theory.

Semi-linear sets.

Given \(d \in \mathbb{N}_{>0}\), for \(\vec{x}=(x_1,\ldots,x_d),\vec{y}=(y_1,\ldots,y_d)\in\mathbb{N}^d\) we define \(\vec{x}+\vec{y}=(x_1+y_1,\ldots,x_d+y_d)\). We define the norm of a vector \(\vec{x}\in\mathbb{N}^d\) as \(\lVert \vec{x} \rVert=\max\{x_i\mid i\in[1,d]\}\). For \(X,Y\subseteq\mathbb{N}^d\) define \(X+Y=\{\vec{x}+\vec{y}\mid\vec{x}\in X,\vec{y}\in Y\}\). For \(\vec{x}=(x_1,\ldots,x_d)\in\mathbb{N}^d\) and \(n\in\mathbb{N}\) we define \(n\vec{x}=(nx_1,\ldots,nx_d)\) and \(\mathbb{N}\vec{x}=\{n\vec{x}\mid n\in\mathbb{N}\}\). A set \(X\subseteq\mathbb{N}^d\) is linear if \(X=\vec{y}+\sum_{i=1}^k\mathbb{N}\vec{x}_i\) for \(k\in\mathbb{N}\) and \(y, x_1, \ldots, x_k \in \mathbb{N}^d\) and it is semilinear if \(X\) is a finite union of linear sets.

2.1 Complexity and logic↩︎

We assume familiarity with standard circuit complexity, we refer to [16], [17] for an introduction to the topic. Recall the following Boolean functions: the AND-function, the OR-function, the majority function (that outputs \(1\) if the majority of its inputs are \(1\)s), and the \(\text{mod}_m\) function (that outputs \(1\) if the number of its inputs that are \(1\)s is divisible by \(m\)) for all \(m\geq 2\).

A circuit family \((C_n)_{n\in\mathbb{N}}\) decides a binary language \(L\subseteq\{0,1\}^*\) if \(C_n\) is a circuit with \(n\) inputs such that \(L\cap\{0,1\}^n=\bigl\{x_1\dots x_n\in\{0,1\}^n \mathrel{\big|}C_n(x_1,\dots,x_n)=1\bigr\}\) for all \(n\in\mathbb{N}\). In this paper, we will consider circuits deciding languages over arbitrary finite alphabets: to do this, we just consider implicitly that any language over an arbitrary finite alphabet comes with a fixed binary encoding that encodes each letter as a block of bits of fixed size. By \(\leq_{\mathrm{cd}}\) we mean constant-depth truth table reducibility (or just constant-depth reducibility) as introduced in [18]. Formally for two languages \(K \subseteq \Gamma^*\) and \(L \subseteq \Sigma^*\) for finite alphabets \(\Sigma, \Gamma\), we write \(K\leq_{\mathrm{cd}}L\) in case there is a polynomial \(p\), a constant \(d\in\mathbb{N}\), and circuit family \((C_n)_{n\in\mathbb{N}}\) deciding \(K\) such that each circuit \(C_n\) satisfies the following: it is of depth at most \(d\) and size at most \(p(n)\) and its non-input gates are either AND-labeled, OR-labeled, or so-called oracle gates, labeled by \(L\), that are gates deciding \(L \cap \Sigma^m\), where \(m\leq p(n)\), such that there is no path from the output of an oracle gate to an input of another oracle gate. We write \(K =_{\mathrm{cd}}L\) if \(K \leq_{\mathrm{cd}}L\) and \(L \leq_{\mathrm{cd}}K\); we also say that \(K\) and \(L\) are constant-depth equivalent. We say a language \(L\) is hard for a complexity class \(\mathsf{C}\) (or just \(\mathsf{C}\)-hard) if \(L' \leq_{\mathrm{cd}}L\) for all \(L'\in\mathsf{C}\). We say \(L\) is \(\mathsf{C}\)-complete if \(L\) is \(\mathsf{C}\)-hard and \(L\in\mathsf{C}\). The following complexity classes are relevant in this paper:

  • \(\mathsf{AC}^0\) is the class of all languages decided by circuit families with NOT gates, AND, OR gates of unbounded fan-in, constant depth and polynomial size;

  • \(\mathsf{ACC}^0(m)\) is the class of all languages decided by circuit families with NOT gates, AND, OR and \(\text{mod}_m\) gates of unbounded fan-in, constant depth and polynomial size;

  • \(\mathsf{ACC}^0=\bigcup_{m\geq 2}\mathsf{ACC}^0(m)\) is the class of all languages decided by circuit families with NOT gates, AND, OR and modular gates (for some fixed \(m\)) of unbounded fan-in, constant depth and polynomial size;

  • \(\mathsf{TC}^0\) is the class of all languages decided by circuit families with NOT gates, AND, OR and majority gates of unbounded fan-in, constant depth and polynomial size;

  • \(\mathsf{NC}^1\) is the class of all languages decided by circuit families with NOT gates, AND, OR gates of bounded fan-in, logarithmic depth and polynomial size.

We also consider the framework of first order logic over finite words. (See [2], [19] for a proper introduction to the topic.) A numerical predicate of arity \(r \in \mathbb{N}_{>0}\) is a symbol of arity \(r\) associated to a subset of \({\mathbb{N}_{>0}}^r\). Given a class \(\mathcal{C}\) of numerical predicates and a finite alphabet \(\Sigma\), we call \(\mathsf{FO}_\Sigma[\mathcal{C}]\)-formula a first order formula over finite words using the alphabet \(\Sigma\) and numerical predicates from the class \(\mathcal{C}\). On occasions, we might also consider \(\mathsf{FO}_{\Sigma, \leftrightsquigarrow}[\mathcal{C}]\)-formulas that in comparison to the previous ones can use an additional binary predicate \(\leftrightsquigarrow\) and are interpreted on structures \((w, M)\) with \(w \in \Sigma^*\) and \(M \subseteq [1, \mathopen{}\left|w\right|\mathclose{}]^2\), where everything is interpreted as for \(\mathsf{FO}_\Sigma[\mathcal{C}]\)-formulas on \(w\) excepted for \(\leftrightsquigarrow\) that is interpreted by \(M\). Given a class \(\mathcal{C}\) of numerical predicates, by \(\mathsf{FO}[\mathcal{C}]\) we denote the class of all languages over any finite alphabet \(\Sigma\) defined by a \(\mathsf{FO}_\Sigma[\mathcal{C}]\)-sentence. A classical result at the interplay of circuit complexity and logic is that \(\mathsf{AC}^0= \mathsf{FO}[\mathsf{arb}]\), where \(\mathsf{arb}\) denotes the class of all numerical predicates (see [2] or [19]). The other numerical predicates that we will encounter in this paper are \(<\), \(+\) and \(\mathsf{MOD}_m\) for all \(m \in \mathbb{N}_{>0}\) (gathered together in the set \(\mathsf{MOD}= \{\mathsf{MOD}_m\mid m>0\}\)), where \(\mathsf{MOD}_m\) holds for those positions that are divisible by \(m\).

2.2 Main result↩︎

The notion of length-synchronicity and weak length-synchronicity will be a central notion in our main result. In the following \(\Sigma\) always denotes a visibly pushdown alphabet.

Let \(\mathcal{R}\subseteq\mathsf{Con}(\Sigma)\) be a set of contexts.

  • \(\mathcal{R}\) is length-synchronous if \(\mathopen{}\left|u\right|\mathclose{}/\mathopen{}\left|v\right|\mathclose{}=\mathopen{}\left|u'\right|\mathclose{}/\mathopen{}\left|v'\right|\mathclose{}\) for all \((u,v),(u',v')\in \mathcal{R}\) with \(\Delta(u),\Delta(u')>0\).

  • \(\mathcal{R}\) is weakly length-synchronous if \(u=u'\) implies \(\mathopen{}\left|v\right|\mathclose{}=\mathopen{}\left|v'\right|\mathclose{}\) and \(v=v'\) implies \(|u|=|u'|\) for all \((u,v),(u',v')\in \mathcal{R}\) with \(\Delta(u),\Delta(u')>0\).

Note that a set of contexts \(\mathcal{R}\) is weakly length-synchronous if \(\mathcal{R}\) is length-synchronous. Indeed, if, say \((u,v),(u,v')\in\mathcal{R}\), where \(\mathopen{}\left|v\right|\mathclose{}\not=\mathopen{}\left|v'\right|\mathclose{}\) and \(\Delta(u)>0\), then \(\mathopen{}\left|u\right|\mathclose{},\mathopen{}\left|v\right|\mathclose{},\mathopen{}\left|v'\right|\mathclose{}>0\) and so the quotients \(\frac{\mathopen{}\left|u\right|\mathclose{}}{\mathopen{}\left|v\right|\mathclose{}}\) and \(\frac{\mathopen{}\left|u\right|\mathclose{}}{\mathopen{}\left|v'\right|\mathclose{}}\) are distinct, thus violating length-synchronicity of \(\mathcal{R}\).

A VPL \(L\subseteq\Sigma^\triangle\)  is quasi-counterfree if for all contexts \(\sigma\in\Sigma^k\times\Sigma^l\) with \(k,l\in\mathbb{N}\) arbitrary at least one of the following holds: (1) there exists some \(n\in\mathbb{N}\) such that \(\sigma^n\equiv_L\sigma^{n+1}\) or (2) no context in \(\Sigma^k\times\Sigma^l\) is \(\equiv_L\)-equivalent to \(\sigma\circ\sigma\).

We will later show that quasi-counterfreeness of a VPL \(L\subseteq\Sigma^\triangle\) is equivalent to the condition that every set of contexts in \(\mathsf{Con}(\Sigma)\) forming a non-trivial group when considering the associated equivalence classes with respect to \(\equiv_L\) contains two contexts one of which is in \(\Sigma^k\times\Sigma^l\) the other of which is in \(\Sigma^{k'}\times\Sigma^{l'}\) where moreover \((k,l)\not=(k',l')\), or equivalently there is no \(k,l\in\mathbb{N}\) such that there is a subset of \(\mathsf{Con}(\Sigma)\cap\Sigma^k\times\Sigma^l\) that forms a non-trivial group when considering the associated equivalence classes with respect to \(\equiv_L\) (Proposition [prop32quasi-counterfree]).

Consider the visibly pushdown alphabet \(\Sigma\), where \(\Sigma_\text{call}=\{a\}\), \(\Sigma_\text{int}=\{c\}\) and \(\Sigma_\text{ret}=\{b_1,b_2\}\). For all \(k, l \in \mathbb{N}_{>0}\) satisfying \(k \neq l\), consider the language \(\mathcal{L}_{k, l}\) generated by the context-free grammar \(S\rightarrow ac^{k - 1} S b_1 \mid ac^{l - 1} S b_2 \mid \varepsilon \,\,\text{.}\) We have that the set of contexts \(\{(u,v)\in\mathsf{Con}(\Sigma)\mid S\Rightarrow_G^*uSv\}\) is weakly length-synchronous since both the relation and its reverse is a partial function — however, it is not length-synchronous. It is also not hard to see that \(\mathcal{L}_{k,l}\) is quasi-counterfree. Indeed, given \((u, v) \in \mathsf{Con}(\Sigma)\), if \(u\) contains the letter \(b_1\) or \(b_2\), or \(v\) contains the letter \(a\) or the letter \(c\) along with the letter \(b_1\) or \(b_2\), we have that \((\chi\circ(u,v)^2)w \notin \mathcal{L}_{k,l}\) for all \(\chi\in\mathsf{Con}(\Sigma)\) and all \(w\in\Sigma^\triangle\), so \((u, v)^2 \equiv_{\mathcal{L}_{k,l}} (u, v)^3\). If \(u\) and \(v\) happen to contain the letter \(c\) and only this letter, we can argue similarly. In the cases remaining, \(u\) contains only letters from \(\{a,c\}\) and \(v\) letters from \(\{b_1,b_2\}\).

We say a context-free grammar \(G=(V,\Sigma,P,S)\) is vertically visibly pushdown if the underlying alphabet \(\Sigma\) is a visibly pushdown alphabet, \(S\rightarrow_G\varepsilon\), and all other productions of \(G\) are of the form \(T\rightarrow_G uT'v\), where \(uv\in\Sigma^\triangle\) is one-turn such that \(u\in (\Sigma_\text{int}^*\Sigma_\text{call}\Sigma_\text{int}^*)^+\) and \(v\in(\Sigma_\text{int}^*\Sigma_\text{ret}\Sigma_\text{int}^*)^+\). Note that each grammar generating \(\mathcal{L}_{k,l}\) in Example [example32SM] is vertically visibly pushdown. The following remark is obvious.

The languages generated by vertically visibly pushdown grammars are one-turn VPLs.

A VPL \(L\) is intermediate if it is quasi-counterfree and \(L=L(G)\) for some vertically visibly pushdown grammar \(G\) for which \[\mathcal{R}(G)=\{(u,v)\in\mathsf{Con}(\Sigma)\mid S\Rightarrow_G^* uSv\}\] is weakly length-synchronous but not length-synchronous.

Thus the languages \(\mathcal{L}_{k,l}\) from Example [example32SM] are all intermediate VPLs. Loosely speaking, they are the simplest intermediate VPLs. We remark that every intermediate language is in \(\mathsf{TC}^0\). We have the following conjecture.

There is no intermediate VPL that is in \(\mathsf{ACC}^0\) or \(\mathsf{TC}^0\)-hard.

In fact, the authors are not even aware of any intermediate VPL that is provably not in \(\mathsf{AC}^0\). An indication for the inadequacy of known techniques to prove the latter is that the robustness [17] of intermediate VPLs can be proven to be constant. Further techniques, based for instance on the switching lemma [20] or on the polynomial method [21] also do not seem to be applicable.

Our main result is the following theorem.

There is an algorithm that, given a DVPA \(A\), correctly outputs either

  • \(L(A)\in\mathsf{AC}^0\),

  • \(m\geq 2\) such that \(L\) is \(\mathsf{ACC}^0(m)\)-hard (hence implying that \(L(A)\not\in\mathsf{AC}^0\)),

  • vertically visibly pushdown grammars \(G_1,\dots,G_m\) each generating intermediate VPLs such that \(L=_{\mathrm{cd}}\biguplus_{i\in[1,m]}L(G_i)\). In this case one can moreover effectively compute \(k,l\in\mathbb{N}\) with \(k\not=l\) such that \(\mathcal{L}_{k,l}\leq_{\mathrm{cd}}L(A)\).

Theorem [thm32main] and the following conjecture imply the existence of an algorithm that decides if a given visibly pushdown language is in \(\mathsf{AC}^0\).

Either all intermediate VPLs are in \(\mathsf{AC}^0\) or all are not.

2.3 Corollary for visibly counter languages↩︎

A visibly counter automaton with threshold \(m\) (\(m\)-VCA) over a visibly pushdown alphabet \(\Sigma\) is a tuple \(A=(Q,\Sigma,q_0,F,\delta_0,\dots,\delta_m)\), where \(Q\) is a finite set of states, \(q_0\) is the initial state, \(F\subseteq Q\) is a set of final states, \(m\geq 0\) is a threshold, and \(\delta_i\colon Q\times\Sigma\rightarrow Q\) is a transition function for each \(i\in[0,m]\).

A configuration of \(A\) is an element of \(Q\times\mathbb{N}\). For any two configurations \((q,n),(q',n')\) and any \(x\in\Sigma\) we define \((q,n)\xrightarrow{x}_A(q',n')\) if \(q'=\delta_{\min(n,m)}(q,x)\) and \(n'=n+\Delta(x)\). The relation \(\xrightarrow{x}_A\) is naturally extended to \(\xrightarrow{w}_A\) for \(w\in\Sigma^*\). By \(L(A)=\{w\in\Sigma^\triangle\mid \exists q\in F : (q_0,0)\xrightarrow{w}_A(q,0)\}\) we denote the language (of well-matched words) of \(A\). We remark that the language of any \(m\)-VCA is a visibly pushdown language. We also remark that the languages of \(m\)-VCAs are defined to be sets of well-matched words as in [22], whereas in [13] the well-matched requirement is not present.

The following corollary of Theorem [thm32main] implies the main result of [13] when restricted to well-matched words.

There is an algorithm that, given an \(m\)-VCA \(A\), correctly outputs either that \(L(A)\) is in \(\mathsf{AC}^0\) or some \(m\geq 2\) such that \(L(A)\) is \(\mathsf{ACC}^0(m)\)-hard (hence implying \(\mathrm{MOD}_m\leq_{\mathrm{cd}}L(A)\) and thus \(L(A)\not\in\mathsf{AC}^0\)).

For the proof of Corollary [corollary32OCA] we refer to Section 5.5.

3 Language-theoretic and algebraic foundations and Ext-Algebras↩︎

3.1 Basic algebraic automata theory↩︎

For a thorough introduction to algebraic automata theory, we refer the reader to the two classical references of the domain by Eilenberg [23], [24] and Pin [25], but also to the following central reference in automata theory [26].

A semigroup is a pair \((M,\cdot)\), where \(M\) is a non-empty set and \(\cdot\) is a binary operation on \(M\) that is associative, i.e. \(x\cdot (y\cdot z)=(x\cdot y)\cdot z\) for all \(x,y,z\in M\). Usually, when the operation is clear from the context, we write it multiplicatively and write just \(M\) instead of \((M,\cdot)\). The semigroup \(M\) is trivial if \(\left|M\right|=1\), and non-trivial otherwise. A subsemigroup of \(M\) is a semigroup \(N\) such that \(N\) is a subset of \(M\) and the operation of \(N\) is the restriction of the operation of \(M\) to \(N\). We often just write \(xy\) to denote \(x \cdot y\). An idempotent of a semigroup \(M\) is an element \(x\in M\) satisfying \(x=xx\). The idempotent power of a finite semigroup \(M\) is the smallest positive integer \(\omega\) such that \(x^\omega\) is an idempotent for all \(x\in M\). The zero of a semigroup \(M\) is the unique element \(x\in M\) (if it exists) satisfying \(xy=yx=x\) for all \(y\in M\). A monoid is a semigroup \(M\) with a neutral element, that is, an element \(e \in M\) such that \(x \cdot e = e \cdot x = x\) for all \(x\in M\). We usually denote the neutral element of a monoid \(M\) by \(1_M\). A submonoid of \(M\) is a monoid \(N\) that is a subsemigroup of \(M\) containing \(1_M\) (which is thus also the neutral element of \(N\)). Consider some monoid \(M\). A congruence on \(M\) is an equivalence relation \(\sim\) on \(M\) that satisfies \(v x z\sim vyz\) for all \(v,z\in M\) and all \(x,y\in M\) with \(x\sim y\). We denote by \([x]_\sim\) the equivalence class of \(x\in M\). The quotient of \(M\) with respect to a congruence \(\equiv\) is the monoid \(M\mathclose{}/\mathopen{}\equiv\) with base set \(M\mathclose{}/\mathopen{}\equiv = \{[m]_\equiv\mid m\in M\}\) and operation given by \([x]_\equiv\cdot[y]_\equiv=[xy]_\equiv\) for all \(x,y\in M\).

A group is a monoid \(M\) in which for all \(x\in M\) there exists an inverse, that is, an element \(x' \in M\) such that \(xx'=x'x=1_M\). Each element in a group \(M\) has a unique inverse, so we denote by \(x^{-1}\) the unique inverse of an \(x \in M\). A subgroup of a group \(M\) is a submonoid of \(M\) that is a group. Given a semigroup \(M\), a set \(S \subseteq M\) and a subsemigroup \(N\) of \(M\), whenever \(N \subseteq S\), \(N\) is said to be contained in \(S\). A semigroup \(M\) is aperiodic if it does not contain any non-trivial group. It is well-known that a finite semigroup \(M\) is aperiodic if, and only if, given \(\omega\) the idempotent power of \(M\), it holds that \(x^\omega=x^{\omega+1}\) for all \(x\in M\) if, and only if, there exists \(k \in \mathbb{N}_{>0}\) such that \(x^k = x^{k + 1}\) for all \(x \in M\).

A morphism from a monoid \(M\) to a monoid \(N\) is a mapping \(\varphi\colon M\to N\) such that \(\varphi(1_M)=1_N\) and \(\varphi(xy)=\varphi(x)\varphi(y)\) for all \(x,y\in M\). If \(M=\Sigma^*\) and \(N=\Gamma^*\) where \(\Sigma\) and \(\Gamma\) are finite alphabets, we call \(\varphi\) length-multiplying whenever there exists \(k \in \mathbb{N}\) such that \(\varphi(\Sigma) \subseteq \Gamma^k\). Let \(\varphi\colon \Sigma^*\to M\) be a morphism, where \(\Sigma\) is a finite alphabet and \(M\) is finite. Then there exists \(l\in\mathbb{N}_{>0}\) such that \(\varphi(\Sigma^l)=\varphi(\Sigma^{2l})\): this implies that \(\varphi(\Sigma^l)\) is a semigroup. The smallest such \(l\) is called the stability index of the morphism \(\varphi\). It is easily shown that if \(\varphi(\Sigma^n)\) contains a non-trivial group for some \(n\in\mathbb{N}\), then so does \(\varphi(\Sigma^l)\). We say that \(h\) is quasi-aperiodic if \(\varphi(\Sigma^n)\) does not contain any non-trivial group for all \(n\in\mathbb{N}\), which is equivalent to the fact that \(\varphi(\Sigma^l)\) is aperiodic. (See [2], [5] for the original definition and [27] for the definition using the stability index, though it has been only formulated for surjective morphisms.)

A language \(L\) over a finite alphabet \(\Sigma\) is recognized by a monoid \(M\) if there is a morphism \(\varphi\colon \Sigma^* \to M\) and \(F \subseteq M\) such that \(L = \varphi^{-1}(F)\). The syntactic monoid of a language \(L\subseteq\Sigma^*\) is the quotient of \(\Sigma^*\) by the congruence \(\sim_L\) (called the syntactic congruence of \(L\)) defined by \(x \sim_L y\) for \(x, y \in \Sigma^*\) whenever for all \(u, v \in \Sigma^*\), \(uxv \in L \Leftrightarrow uyv \in L\). The syntactic monoid of \(L\) recognizes \(L\) via the syntactic morphism of \(L\) sending any word \(w \in \Sigma^*\) to \([w]_{\sim_L}\). A fundamental and well-known result is that a language \(L\) is regular if, and only if, it is recognized by a finite monoid if, and only if, its syntactic monoid is finite.

3.2 Ext-algebras↩︎

This section builds on [9], but identifies an inaccuracy in the definition of \(\mathop{\mathrm{Ext}}\)-algebra morphisms to establish freeness.

Let \((M,\cdot,1_M)\) be a monoid. For each \(m \in M\), we shall respectively denote by \(\mathrm{left}_{m}\) and \(\mathrm{right}_{m}\) the left-multiplication map \(x \mapsto m \cdot x\) and the right-multiplication map \(x \mapsto x \cdot m\).

An \(\mathop{\mathrm{Ext}}\)-algebra \((R, O, \cdot, \circ)\) consists of a monoid \((R, \cdot, 1_R)\) and a monoid \((O, \circ, 1_O)\) that is a submonoid of \((R^R, \circ)\) containing the maps \(\mathrm{left}_{r}\) and \(\mathrm{right}_{r}\) for each \(r \in R\).

We note that \((O,\circ)\) completely determines \((R,\cdot)\), indeed \(xy=\mathrm{right}_{y}(x)\).

Let \((R, O)\) and \((S, P)\) be \(\mathop{\mathrm{Ext}}\)-algebras. An \(\mathop{\mathrm{Ext}}\)-algebra morphism from \((R, O)\) to \((S, P)\) is a pair \((\varphi, \psi)\) of monoid morphisms \(\varphi\colon R \to S\) and \(\psi\colon O \to P\) such that:

  • for all \(e \in O\) and \(r \in R\) we have \(\psi(e)(\varphi(r)) = \varphi(e(r))\);

  • for all \(r \in R\) we have \(\psi(\mathrm{left}_{r}) = \mathrm{left}_{\varphi(r)}\) and \(\psi(\mathrm{right}_{r}) = \mathrm{right}_{\varphi(r)}\).

We write \((\varphi, \psi)\colon (R, O) \to (S, P)\). The morphism \((\varphi, \psi)\) is called surjective (respectively bijective) if both \(\varphi\) and \(\psi\) are surjective (respectively bijective).

When it is clear from the context, we shall write morphism to mean \(\mathop{\mathrm{Ext}}\)-algebra morphism.

In the above definition, \(\varphi\) is totally determined by \(\psi\), because for each \(r \in R\), we have \(\varphi(r) = \varphi(\mathrm{left}_{r}(1_R)) = \psi(\mathrm{left}_{r})(\varphi(1_R)) = \psi(\mathrm{left}_{r})(1_S)\).

Let \((R, O)\) and \((S, P)\) be \(\mathop{\mathrm{Ext}}\)-algebras. Then

  • \((R, O)\) is a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((S, P)\) whenever \(R\) is a submonoid of \(S\) and there exists a submonoid \(O'\) of \(P\) such that \(O = \{{e|}_{R} \mid e \in O'\}\), so that we may denote \(O\) by \({O'|}_{R}\).

  • \((R, O)\) is a quotient of \((S, P)\) whenever there exists a surjective morphism from \((S, P)\) to \((R, O)\).

  • \((R, O)\) divides \((S, P)\) whenever \((R, O)\) is a quotient of a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((S, P)\).

For the rest of this section, let us fix some visibly pushdown alphabet \(\Sigma\).

For all \((u, v) \in\mathsf{Con}(\Sigma)\), consider the function \(\mathop{\mathrm{ext}}_{u, v}\colon \Sigma^\triangle \to \Sigma^*\) such that \(\mathop{\mathrm{ext}}_{u, v}(x) = u x v\) for all \(x \in \Sigma^\triangle\). We call \[\mathop{\mathrm{ext}}_{x_1,y_1}\circ\cdots\circ\mathop{\mathrm{ext}}_{x_m,y_m}\] a factorization of \(\mathop{\mathrm{ext}}_{u,v}\) if \(u=x_1\cdots x_m\) and \(v=y_m\cdots y_1\).

The following lemma states that each \(\mathop{\mathrm{ext}}_{u,v}\) has a unique factorization when restricting the \((x_i,y_i)\) to be from \(\Sigma^\triangle\times\Sigma^\triangle\) or from \(\Sigma_\text{call}\times\Sigma_\text{ret}\) and minimizing the number of \((x_i,y_i)\in\Sigma^\triangle\times\Sigma^\triangle\): we obtain its so-called stair factorization.

For all \(\mathop{\mathrm{ext}}_{u,v}\) there exists a unique factorization \[\mathop{\mathrm{ext}}_{u,v} \quad=\quad \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \quad\cdots\quad \circ \mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}} \circ \mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}} \circ \mathop{\mathrm{ext}}_{x_h,y_h}\] satisfying \(h\geq 1\), \(x_i,y_i\in\Sigma^\triangle\) for all \(i\in[1,h]\) and \(a_i\in\Sigma_\text{call}\) and \(b_i\in\Sigma_\text{ret}\) for all \(i \in [1,h - 1]\). In particular, \(\mathop{\mathrm{ext}}_{u,v}\) is in fact a function from \(\Sigma^\triangle\) to \(\Sigma^\triangle\).

Proof. We show additionally that the required factorization must satisfy \(h=\Delta(u)+1\). We prove the statement by induction on \(|uv|\). In case \(|uv|\leq 1\), then either \(\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{\varepsilon,\varepsilon}\), or there is some \(c\in\Sigma_\text{int}\) such that \(\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{\varepsilon,c}\) or \(\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{c,\varepsilon}\). In any of these cases, we uniquely factorize \(\mathop{\mathrm{ext}}_{u, v}\) as \(\mathop{\mathrm{ext}}_{x_1, y_1}\) with \(x_1 = u\) and \(y_1 = v\).

Let us consider the case when \(|uv|\geq 2\) and let \(h=\Delta(u)+1\). Note that since \(uv\in\Sigma^\triangle\) we have \(u\in\Sigma^\triangle\) if, and only if, \(v\in\Sigma^\triangle\). In case \(u,v\in\Sigma^\triangle\) we have \(\Delta(u)=0\), hence the only factorization of the desired form is indeed \(\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{x_1,y_1}\), where \(x_1=u\) and \(y_1=v\). Let us finally treat the case when \(u,v\notin\Sigma^\triangle\), thus \(\Delta(u)\geq 1\) and hence \(h\geq 2\). Let \(x\) be the maximal prefix of \(u\) satisfying \(x\in\Sigma^\triangle\) and let \(y\) be the maximal suffix of \(v\) satisfying \(y\in\Sigma^\triangle\). Due to maximality of \(x\) and \(y\) there must exist \(a\in\Sigma_\text{call}\), \(b\in\Sigma_\text{ret}\), and \(u',v'\in\Sigma^*\) such that \(u=xau'\), \(v=v'by\) and \(u'v'\in\Sigma^\triangle\) with \(\Delta(u')=\Delta(u)-1=h-2\). Let \(\mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_{h-2},y_{h-2}} \circ \mathop{\mathrm{ext}}_{a_{h-2},b_{h-2}} \circ \mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}}\) be the unique factorization of the desired form for \(\mathop{\mathrm{ext}}_{u',v'}\) by induction hypothesis. We claim that \[\mathop{\mathrm{ext}}_{x,y} \circ \mathop{\mathrm{ext}}_{a,b} \circ \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_{h-2},y_{h-2}} \circ \mathop{\mathrm{ext}}_{a_{h-2},b_{h-2}} \circ \mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}}\] is the unique factorization of the desired form for \(\mathop{\mathrm{ext}}_{u,v}\). Indeed, since \(\Delta(u) \geq 1\) any potential factorization of the desired form for \(\mathop{\mathrm{ext}}_{u,v}\) must be of the form \(\mathop{\mathrm{ext}}_{x',y'}\circ\mathop{\mathrm{ext}}_{a',b'}\circ\pi\), where \(x'\) is a prefix of \(u\) satisfying \(x'\in\Sigma^\triangle\), \(y'\) is a suffix of \(v\) satisfying \(y'\in\Sigma^\triangle\), \(a'\in\Sigma_\text{call}\), and \(b'\in\Sigma_\text{ret}\). In particular \(x'\) is a prefix of \(x\) and \(y'\) is suffix of \(y\). In case \(x'=x\) and \(y'=y\) it follows \(a'=a\) and \(b'=b\) and uniqueness follows from induction hypothesis. It remains to consider the case when \(x'\) is a strict prefix of \(x\) or \(y'\) is a strict suffix of \(y\). We only treat the former case. It must hold \(x=x'a's\) for some \(s\in\Sigma^+\) such that \(a's\in\Sigma^\triangle\). But then \(\pi\) is a factorization for \(\mathop{\mathrm{ext}}_{su',v'z}\) for some \(z\in\Sigma^*\) which is a contradiction since \(\Delta(s)=-1\) due to \(a's\in\Sigma^\triangle\). ◻

In the following we will denote the unique factorization provided by Lemma [lemma32ext] as the stair factorization of \(\mathop{\mathrm{ext}}_{u,v}\). Consider now the set \(\mathcal{O}(\Sigma^\triangle)\) of all functions \(\mathop{\mathrm{ext}}_{u, v}\) for \((u, v) \in \mathsf{Con}(\Sigma)\): it is a subset of \((\Sigma^\triangle)^{\Sigma^\triangle}\) closed under composition. Thus, \((\mathcal{O}(\Sigma^\triangle), \circ)\) is a submonoid of \(((\Sigma^\triangle)^{\Sigma^\triangle}, \circ)\). Since for all \(w\in\Sigma^\triangle\) we have \(\mathrm{left}_{w}=\mathop{\mathrm{ext}}_{w,\varepsilon}\) and \(\mathrm{right}_{w}=\mathop{\mathrm{ext}}_{\varepsilon,w}\), the set \(\mathcal{O}(\Sigma^\triangle)\) contains the functions \(\mathrm{left}_{w}\) and \(\mathrm{right}_{w}\) for all \(w \in \Sigma^\triangle\). Hence, \((\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle), \cdot, \circ)\) is an \(\mathop{\mathrm{Ext}}\)-algebra. The following important proposition establishes freeness of \((\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\).

Let \((R, O)\) be an \(\mathop{\mathrm{Ext}}\)-algebra and consider two functions \(\varphi\colon \Sigma_\text{int}\to R\) and \(\psi\colon\{\mathop{\mathrm{ext}}_{a, b}\mid a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\} \to O\). Then there exists a unique \(\mathop{\mathrm{Ext}}\)-algebra morphism \((\overline{\varphi}, \overline{\psi})\) from \((\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle))\) to \((R, O)\) satisfying \(\overline{\varphi}(c) = \varphi(c)\) for each \(c \in \Sigma_\text{int}\) and \(\overline{\psi}(\mathop{\mathrm{ext}}_{a, b}) = \psi(\mathop{\mathrm{ext}}_{a, b})\) for each \(a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\).

Proof. We define \(\overline{\varphi}\) based on a refinement of the structural definition of well-matched words. For each \(w\in\Sigma^\triangle\) we inductively define: \[\overline{\varphi}(w) = \begin{cases} 1_R & \text{if w=\varepsilon (type 1)}\\ \varphi(c) & \text{if w=c\in\Sigma_\text{int} (type 2)}\\ \psi(\mathop{\mathrm{ext}}_{a,b})(\overline{\varphi}(x)) & \text{if w=axb for a\in\Sigma_\text{call}, b\in\Sigma_\text{ret} and x\in\Sigma^\triangle (type 3)}\\ \overline{\varphi}(x)\overline{\varphi}(y) & \text{if w=xy for x,y\in\Sigma^\triangle\setminus\{\varepsilon\}, where |x| is minimal (type 4)} \end{cases}\] Observe that the four above types give unique decompositions. For proving that \(\overline{\varphi}\) is indeed a monoid morphism one proves that for all \(w,v\in\Sigma^\triangle\) we have \(\overline{\varphi}(wv)=\overline{\varphi}(w)\overline{\varphi}(v)\) by structural induction on \(w\) given by the four types. The case \(v=\varepsilon\) is direct, we only treat the case \(v\in\Sigma^\triangle\setminus\{\varepsilon\}\) in the following. If \(w\) is of type 1 we have \(\overline{\varphi}(wv)=\overline{\varphi}(v)=1_R\cdot \overline{\varphi}(v)=\overline{\varphi}(w)\overline{\varphi}(v)\). If \(w\) is of type 2 or 3, then \(wv\) is of type 4 and \(w\) is the shortest prefix of \(wv\) with \(w\in\Sigma^\triangle\setminus\{\varepsilon\}\), hence \(\overline{\varphi}(wv)=\overline{\varphi}(w)\overline{\varphi}(v)\). If \(w\) is of type 4, then \(w=xy\) for some \(x,y\in\Sigma^\triangle\setminus\{\varepsilon\}\), where \(x\) is of minimal length. Then \(wv\) is of type 4, where \(wv=x(yv)\) and \(x\) is the shortest prefix of \(wv\) with \(x\in\Sigma^\triangle\setminus\{\varepsilon\}\). Hence \(\overline{\varphi}(wv)=\overline{\varphi}(x)\overline{\varphi}(yv)= \overline{\varphi}(x)\overline{\varphi}(y)\overline{\varphi}(v)= \overline{\varphi}(xy)\overline{\varphi}(v)=\overline{\varphi}(w)\overline{\varphi}(v)\), where the first equality follows by definition of \(\overline{\varphi}\) and the second and third equality follow from the induction hypothesis. Given any \(\mathop{\mathrm{ext}}_{u,v}\in\mathcal{O}(\Sigma^\triangle)\) let \[\mathop{\mathrm{ext}}_{u,v} \quad=\quad \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \quad\cdots\quad \circ \mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}} \circ \mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}} \circ \mathop{\mathrm{ext}}_{x_h,y_h}\] be the unique stair factorization given by Lemma [lemma32ext]. We define \[\overline{\psi}(\mathop{\mathrm{ext}}_{u,v})= \bigcirc_{i=1}^{h-1} \bigl( \mathrm{left}_{\overline{\varphi}(x_i)} \circ \mathrm{right}_{\overline{\varphi}(y_i)} \circ \psi(\mathop{\mathrm{ext}}_{a_i,b_i}) \bigr) \circ \mathrm{left}_{\overline{\varphi}(x_h)} \circ \mathrm{right}_{\overline{\varphi}(y_h)} \,\,\text{.}\] For showing that \(\overline{\psi}\) is indeed a monoid morphism, one proves \(\overline{\psi}(\mathop{\mathrm{ext}}_{uu',v'v}) = \overline{\psi}(\mathop{\mathrm{ext}}_{u,v}) \circ \overline{\psi}(\mathop{\mathrm{ext}}_{u',v'})\) for all \(\mathop{\mathrm{ext}}_{u, v}, \mathop{\mathrm{ext}}_{u', v'} \in \mathcal{O}(\Sigma^\triangle)\) by observing simply that the unique stair factorization of \(\mathop{\mathrm{ext}}_{u u', v' v}\) is obtained by composing the unique stair factorizations of \(\mathop{\mathrm{ext}}_{u, v}\) and \(\mathop{\mathrm{ext}}_{u', v'}\).

We now show that \((\overline{\varphi},\overline{\psi})\) is in fact an \(\mathop{\mathrm{Ext}}\)-algebra morphism. The discussion above first shows that both \(\overline{\varphi}\colon\Sigma^\triangle\rightarrow R\) and \(\overline{\psi}\colon\mathcal{O}(\Sigma^\triangle)\rightarrow O\) are monoid morphisms. Next, let us prove that for all \(\mathop{\mathrm{ext}}_{u,v}\in\mathcal{O}(\Sigma^\triangle)\) and \(w\in\Sigma^\triangle\) we have \(\overline{\psi}(\mathop{\mathrm{ext}}_{u,v})(\overline{\varphi}(w))=\overline{\varphi}(\mathop{\mathrm{ext}}_{u,v}(w))\). Let \[\mathop{\mathrm{ext}}_{u,v} \quad=\quad \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \quad\cdots\quad \circ \mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}} \circ \mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}} \circ \mathop{\mathrm{ext}}_{x_h,y_h}\] be the unique stair factorization of \(\mathop{\mathrm{ext}}_{u,v}\) provided by Lemma [lemma32ext]. If \(h = 1\), then \[\overline{\psi}(\mathop{\mathrm{ext}}_{u,v})(\overline{\varphi}(w)) = \mathrm{left}_{\overline{\varphi}(x_h)} \circ \mathrm{right}_{\overline{\varphi}(y_h)}(\overline{\varphi}(w)) = \overline{\varphi}(x_hwy_h) = \overline{\varphi}(\mathop{\mathrm{ext}}_{u, v}(w)) \,\,\text{.}\] Otherwise, we have \[\begin{align} & \overline{\psi}(\mathop{\mathrm{ext}}_{u,v})(\overline{\varphi}(w))\\ =& \bigcirc_{i=1}^{h-1} \bigl( \mathrm{left}_{\overline{\varphi}(x_i)} \circ \mathrm{right}_{\overline{\varphi}(y_i)} \circ \psi(\mathop{\mathrm{ext}}_{a_i,b_i}) \bigr) \circ \mathrm{left}_{\overline{\varphi}(x_h)}\circ\mathrm{right}_{\overline{\varphi}(y_h)} (\overline{\varphi}(w))\\ =& \bigcirc_{i=1}^{h-1} \bigl( \mathrm{left}_{\overline{\varphi}(x_i)} \circ \mathrm{right}_{\overline{\varphi}(y_i)} \circ \psi(\mathop{\mathrm{ext}}_{a_i,b_i}) \bigr) \bigl(\overline{\varphi}(x_hwy_h)\bigr)\\ =& \bigcirc_{i=1}^{h-2} \bigl( \mathrm{left}_{\overline{\varphi}(x_i)} \circ \mathrm{right}_{\overline{\varphi}(y_i)} \circ \psi(\mathop{\mathrm{ext}}_{a_i,b_i}) \bigr) \circ \\ & \mathrm{left}_{\overline{\varphi}(x_{h-1})}\circ\mathrm{right}_{\overline{\varphi}(y_{h-1})}\circ\psi(\mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}}) \bigl(\overline{\varphi}(x_hwy_h)\bigr)\\ =& \bigcirc_{i=1}^{h-2} \bigl( \mathrm{left}_{\overline{\varphi}(x_i)} \circ \mathrm{right}_{\overline{\varphi}(y_i)} \circ \psi(\mathop{\mathrm{ext}}_{a_i,b_i}) \bigr) \circ \\ & \mathrm{left}_{\overline{\varphi}(x_{h-1})}\circ\mathrm{right}_{\overline{\varphi}(y_{h-1})} \bigl(\overline{\varphi}(a_{h-1}x_hwy_hb_{h-1})\bigr)\\ =& \bigcirc_{i=1}^{h-2} \bigl( \mathrm{left}_{\overline{\varphi}(x_i)} \circ \mathrm{right}_{\overline{\varphi}(y_i)} \circ \psi(\mathop{\mathrm{ext}}_{a_i,b_i}) \bigr) \bigl(\overline{\varphi}(x_{h-1}a_{h-1}x_hwy_hb_{h-1}y_{h-1})\bigr)\\ =& \cdots\\ =& \overline{\varphi}(x_1a_1\cdots x_{h-1}a_{h-1}x_hwy_hb_{h-1}y_{h-1}\cdots b_1y_1)\\ =& \overline{\varphi}(\mathop{\mathrm{ext}}_{u,v}(w)) \,\,\text{.} \end{align}\]

Let us prove that for all \(w\in\Sigma^\triangle\) we have \(\overline{\psi}(\mathrm{left}_{w})=\mathrm{left}_{\overline{\varphi}(w)}\). Noting that the unique stair factorization of \(\mathrm{left}_{w}\) is \(\mathop{\mathrm{ext}}_{w,\varepsilon}\) we obtain \[\overline{\psi}(\mathrm{left}_{w})= \overline{\psi}(\mathop{\mathrm{ext}}_{w,\varepsilon})= \mathrm{left}_{\overline{\varphi}(w)}\circ\mathrm{right}_{\overline{\varphi}(\varepsilon)}= \mathrm{left}_{\overline{\varphi}(w)}\circ\mathrm{right}_{1_R}= \mathrm{left}_{\overline{\varphi}(w)}\circ 1_O = \mathrm{left}_{\overline{\varphi}(w)} \,\,\text{.}\] One proves \(\overline{\psi}(\mathrm{right}_{w})=\mathrm{right}_{\overline{\varphi}(w)}\) for all \(w \in \Sigma^\triangle\) analogously.

Therefore, \((\overline{\varphi}, \overline{\psi})\) is an \(\mathop{\mathrm{Ext}}\)-algebra morphism and it is the unique one satisfying \(\overline{\varphi}(c) = \varphi(c)\) for each \(c \in \Sigma_\text{int}\) and \(\overline{\psi}(\mathop{\mathrm{ext}}_{a, b}) = \psi(\mathop{\mathrm{ext}}_{a, b})\) for each \(a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\). Take indeed any such \(\mathop{\mathrm{Ext}}\)-algebra morphism \((\varphi', \psi')\): using the properties of \(\mathop{\mathrm{Ext}}\)-algebra morphisms, it is straightforward to prove that then \(\overline{\varphi}(w) = \varphi'(w)\) for all \(w \in \Sigma^\triangle\) by structural induction on \(w\) and then to prove that \(\overline{\psi}(\mathop{\mathrm{ext}}_{u, v}) = \psi'(\mathop{\mathrm{ext}}_{u, v})\) for all \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) by using the unique stair factorization of \(\mathop{\mathrm{ext}}_{u,v}\) provided by Lemma [lemma32ext]. ◻

The second condition in Definition [def32morphism], i.e.for all \(r\in R\) we have \(\psi(\mathrm{left}_{r})=\mathrm{left}_{\varphi(r)}\) and \(\psi(\mathrm{right}_{r})=\mathrm{right}_{\varphi(r)}\), does not appear in the definition of \(\mathop{\mathrm{Ext}}\)-algebra morphisms given in [9]. But this is actually problematic, because then Proposition [ptn:Freeness95Ext-algebras] would not hold in general.

Indeed, consider for instance the visibly pushdown alphabet \(\Gamma\) where \(\Gamma_\text{call}= \{a\}\), \(\Gamma_\text{int}= \emptyset\) and \(\Gamma_\text{ret}= \{b\}\), where \(R\) the is semi-lattice on two elements \(\{0, 1\}\) such that \(1 \cdot 1 = 1\) and \(0 \cdot 1 = 1 \cdot 0 = 0 \cdot 0 = 0\); and moreover \(O\) is defined as \(\{\mathrm{id}, \mathbf{0}, \mathbf{1}\}\) with \(\mathbf{0}(0) = \mathbf{0}(1) = 0\) and \(\mathbf{1}(0) = \mathbf{1}(1) = 1\). Then \((R, O)\) is an \(\mathop{\mathrm{Ext}}\)-algebra. Let us define the function \(\varphi\colon \Gamma^\triangle \to R\) by \(\varphi(w) = 1\) for all \(w \in \Gamma^\triangle\) and the function \(\psi\colon \mathcal{O}(\Gamma^\triangle) \to O\) by \(\psi(\mathop{\mathrm{ext}}_{a^n, b^n}) = \mathrm{id}\) for all \(n \in \mathbb{N}\) and \(\psi(\mathop{\mathrm{ext}}_{u, v}) = \mathbf{1}\) for all \(u, v \in \Gamma^*\) with \(u v \in \Gamma^\triangle\) and \((u \in a \Gamma^* b \Gamma^*\) or \(v \in \Gamma^* a \Gamma^* b)\). The pair \((\varphi, \psi)\) forms a morphism from \((\Gamma^\triangle, \mathcal{O}(\Gamma^\triangle))\) to \((R, O)\), but it is not the only one sending \(\mathop{\mathrm{ext}}_{a, b}\) to \(\mathrm{id}\), because we could also take \(\psi\) to send all elements of \(\mathcal{O}(\Gamma^\triangle)\) to \(\mathrm{id}\).

A language \(L \subseteq \Sigma^\triangle\) is recognized by an \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) whenever there exists a morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) such that \(L = \varphi^{-1}(F)\) for some \(F \subseteq R\).

Consider the language \(L = \mathcal{L}_{1,2}=L(S\rightarrow a S b_1 \mid ac S b_2 \mid \varepsilon)\) from Example [example32SM] over the visibly pushdown alphabet \(\Gamma\), where \(\Gamma_\text{int}=\{c\}\), \(\Gamma_\text{call}=\{a\}\) and \(\Gamma_\text{ret}=\{b_1,b_2\}\). Set \(R_L=\{\lbrack acb_1\rbrack_{\sim_L}, \lbrack\varepsilon\rbrack_{\sim_L}, \lbrack c\rbrack_{\sim_L},\lbrack cab_1\rbrack_{\sim_L}, \lbrack ab_1\rbrack_{\sim_L}\}\), and, given for all \((u,v)\in\mathsf{Con}(\Sigma)\) the function \(f_{u,v} \in (R_L)^{R_L}\) satisfying \(f_{u,v}(\lbrack x\rbrack_{\sim_L}])=\lbrack uxv\rbrack_{\sim_L}\) for all \(x\in\Sigma^\triangle\), set \[O_L = \{f_{acb_1,\varepsilon}, f_{\varepsilon,\varepsilon}, f_{c,\varepsilon}, f_{\varepsilon,c}, f_{ab_1,\varepsilon}, f_{\varepsilon,ab_1}, f_{cab_1,\varepsilon}, f_{a,b_2}, f_{ca,b_2}, f_{ca,ab_1b_2}, f_{ca,b_1}, f_{a,ab_1b_2}, f_{a,b_1}\} \,\,\text{.}\] For instance, note that \(\lbrack ab_1\rbrack_{\sim_L}=\lbrack acb_2\rbrack_{\sim_L}\), that \(\lbrack acb_1\rbrack_{\sim_L}\) is the zero of \(R_L\) and that \(f_{acb_1,\varepsilon}\) is the zero of \(O_L\). Then \((R_L, O_L)\) is an \(\mathop{\mathrm{Ext}}\)-algebra recognizing \(L\) thanks to the morphism \((\varphi_L,\psi_L)\colon (\Gamma^\triangle,\mathcal{O}(\Gamma^\triangle))\to (R_L,O_L)\) satisfying \(\varphi_L(c)=\lbrack c\rbrack_{\sim_L}\), \(\psi_L(\mathop{\mathrm{ext}}_{a,b_1})=f_{a,b_1}\) and \(\psi_L(\mathop{\mathrm{ext}}_{a,b_2})=f_{a,b_2}\). Note that \(L=\varphi_L^{-1}(\{\lbrack\varepsilon\rbrack_{\sim_L}, \lbrack ab_1\rbrack_{\sim_L}\})\). Finally, note that for instance \(\psi_L(\mathop{\mathrm{ext}}_{ca,ab_1b_2})=f_{ca,ab_1b_2} \not=f_{a,ab_1b_2}=\psi_L(\mathop{\mathrm{ext}}_{a,ab_1b_2})\) since we have \[\psi_L(\mathop{\mathrm{ext}}_{a,b_2})\circ \psi_L(\mathop{\mathrm{ext}}_{ca,ab_1b_2})(\lbrack c\rbrack_{\sim_L})= \lbrack acacab_1b_2b_2\rbrack_{\sim_L} =\lbrack ab_1\rbrack_{\sim_L}\] whereas \[\psi_L(\mathop{\mathrm{ext}}_{a,b_2})\circ \psi_L(\mathop{\mathrm{ext}}_{a,ab_1b_2})(\lbrack c\rbrack_{\sim_L})= \lbrack aacab_1b_2b_2\rbrack_{\sim_L}=\lbrack acb_1\rbrack_L\,\,\text{.}\]

Let \((R, O)\) be an \(\mathop{\mathrm{Ext}}\)-algebra. An equivalence relation on \((R, O)\) is an equivalence relation \(\sim\) on \(R\). We say an equivalence relation \(\sim\) is a congruence on \((R, O)\) whenever for all \(e \in O\) and for all \(x, y \in R\) we have that \(x \sim y\) implies \(e(x) \sim e(y)\). In case \(\sim\) is a congruence we denote by \((R,O)\mathclose{}/\mathopen{}\sim\) the pair \((R\mathclose{}/\mathopen{}\sim,O')\), where \[O' = \{e' \in (R \mathclose{}/\mathopen{}\sim)^{R \mathclose{}/\mathopen{}\sim} \mid \exists e \in O\;\forall x \in R\colon e'([x]_\sim) = [e(x)]_\sim\}.\]

The following lemma actually shows that \((R,O)\mathclose{}/\mathopen{}\sim\) is again an \(\mathop{\mathrm{Ext}}\)-algebra, that we call the quotient of \((R,O)\) by \(\sim\).

Let \((R, O)\) be an \(\mathop{\mathrm{Ext}}\)-algebra and \(\sim\) be a congruence on \((R, O)\). Then \((R \mathclose{}/\mathopen{}\sim, O')\), with \[O' = \{e' \in (R \mathclose{}/\mathopen{}\sim)^{R \mathclose{}/\mathopen{}\sim} \mid \exists e \in O\;\forall x \in R\colon e'([x]_\sim) = [e(x)]_\sim\}\] a submonoid of \((R \mathclose{}/\mathopen{}\sim)^{R \mathclose{}/\mathopen{}\sim}\), is an \(\mathop{\mathrm{Ext}}\)-algebra and the pair \((\varphi, \psi)\) of functions \(\varphi\colon R \to R \mathclose{}/\mathopen{}\sim\) and \(\psi\colon O \to O'\) satisfying \(\varphi(r) = [r]_\sim\) for all \(r \in R\) and \(\psi(e)([r]_\sim) = [e(r)]_\sim\) for all \(e \in O\) and \(r \in R\) is a surjective morphism from \((R, O)\) to \((R \mathclose{}/\mathopen{}\sim, O')\).

Proof. Let \(u, v \in R\) such that \(u \sim v\). Take any \(x, y \in R\): we have that \[x u y = \mathrm{right}_{y} \circ \mathrm{left}_{x}(u) \sim \mathrm{right}_{y} \circ \mathrm{left}_{x}(v) = x v y\] by definition of congruence. Thus, \(\sim\) is a congruence on \(R\). This implies that \(R \mathclose{}/\mathopen{}\sim\) is a monoid.

Let \(e', f' \in O'\): this means there exist \(e, f \in O\) such that \(e'([r]_\sim) = [e(r)]_\sim\) and \(f'([r]_\sim) = [f(r)]_\sim\) for all \(r \in R\). Given any \(r \in R\), we thus have \[e' \circ f'([r]_\sim) = e'([f(r)]_\sim) = [e(f(r))]_\sim = [e \circ f(r)]_\sim \,\,\text{,}\] so that \(e' \circ f' \in O'\). Therefore, \(O'\) is a submonoid of \((R \mathclose{}/\mathopen{}\sim)^{R \mathclose{}/\mathopen{}\sim}\) that contains the functions \(\mathrm{left}_{[r]_{\sim}}\) and \(\mathrm{right}_{[r]_{\sim}}\) for all \([r]_\sim\in R\mathclose{}/\mathopen{}\sim\). Thus, \((R\mathclose{}/\mathopen{}\sim,O')\) is an \(\mathop{\mathrm{Ext}}\)-algebra.

Now define the functions \(\varphi\colon R \to R \mathclose{}/\mathopen{}\sim\) and \(\psi\colon O \to O'\) by respectively \(\varphi(r) = [r]_\sim\) for all \(r \in R\) and \(\psi(e) = e'\) with \(e' \in O'\) such that \(e'([r]_\sim) = [e(r)]_\sim\) for all \(r \in R\): this is well-defined because \(\sim\) is a congruence on \((R, O)\). Since \(\sim\) is a congruence on \(R\), \(\varphi\) is a surjective monoid morphism. Further, let \(e, f \in O\). We have \[\begin{align} \psi(e) \circ \psi(f) ([r]_\sim) & = \psi(e)([f(r)]_\sim)\\ & = [e(f(r))]_\sim\\ & = [e \circ f(r)]_\sim\\ & = \psi(e \circ f)([r]_\sim) \end{align}\] for all \(r \in R\), so that \(\psi(e) \circ \psi(f) = \psi(e \circ f)\). Therefore, as \(\psi(1_O)([r]_\sim) = [1_O(r)]_\sim = [r]_\sim\) for all \(r \in R\), it follows that \(\psi\) is also a monoid morphism, that is obviously surjective. By construction, we do of course have that \[\psi(e)(\varphi(r)) = \psi(e)([r]_\sim) = [e(r)]_\sim = \varphi(e(r))\] for all \(e \in O\) and \(r \in R\). Moreover, for all \(r \in R\), it holds that \[\psi(\mathrm{left}_{r})([x]_\sim) = [\mathrm{left}_{r}(x)]_\sim = [r x]_\sim = [r]_\sim [x]_\sim = \mathrm{left}_{\varphi(r)}([x]_\sim)\] for all \(x \in R\), so that \(\psi(\mathrm{left}_{r}) = \mathrm{left}_{\varphi(r)}\). Similarly, we can prove that \(\psi(\mathrm{right}_{r}) = \mathrm{right}_{\varphi(r)}\) for all \(r \in R\). Thus, \((\varphi, \psi)\) is a surjective morphism from \((R, O)\) to \((R \mathclose{}/\mathopen{}\sim, O')\). ◻

The lemma also proves that the pair \((\varphi, \psi)\) of functions \(\varphi\colon R \to R \mathclose{}/\mathopen{}\sim\) and \(\psi\colon O \to O'\) satisfying \(\varphi(r) = [r]_\sim\) for all \(r \in R\) and \(\psi(e)([r]_\sim) = [e(r)]_\sim\) for all \(e \in O\) and \(r \in R\) is a surjective morphism from \((R, O)\) to \((R,O)\mathclose{}/\mathopen{}\sim\). We also call this pair \((\varphi,\psi)\) the morphism associated to the congruence \(\sim\).

The syntactic congruence of a language \(L\subseteq\Sigma^\triangle\) is the congruence \(\sim_L\) on \((\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle))\) defined by \(u \sim_L v\) for \(u, v \in \Sigma^\triangle\) whenever

\(xuy\in L \Leftrightarrow xvy\in L\) for all \((x,y)\in\mathsf{Con}(\Sigma)\). We define the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of \(L\) to be \((R_L,O_L)=(\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \mathclose{}/\mathopen{}\sim_L\) and the syntactic morphism of \(L\) to be the morphism \((\varphi_L,\psi_L)\) associated to \(\sim_L\).

Note that the syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\) of \(L\) recognizes \(L\) via the syntactic morphism \((\varphi_L,\psi_L)\). Indeed, for all \(u, v \in \Sigma^\triangle\), we have that if \(u \sim_L v\), then \(u \in L \Leftrightarrow v \in L\). This implies that \(L = \varphi_L^{-1}(\varphi_L(L))\). For instance, it can be proven that the \(\mathop{\mathrm{Ext}}\)-algebra recognizing the language \(\mathcal{L}_{1,2}\) in Example [example32L2] is in fact a certain presentation of the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of \(\mathcal{L}_{1,2}\).

The next lemma states that all languages recognized by an \(\mathop{\mathrm{Ext}}\)-algebra are also recognized by the \(\mathop{\mathrm{Ext}}\)-algebras it divides.

Let \((R, O)\) and \((S, P)\) be two \(\mathop{\mathrm{Ext}}\)-algebras such that \((R, O)\) divides \((S, P)\). Then any language \(L \subseteq \Sigma^\triangle\) recognized by \((R, O)\) is also recognized by \((S, P)\).

Proof. Let \(L \subseteq \Sigma^\triangle\) be a language recognized by \((R, O)\). This means that there exists a morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) such that \(L = \varphi^{-1}(F)\) for some \(F \subseteq R\). We will prove the lemma by combining the following two points:

(1) if \((R,O)\) is a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((S,P)\), then so does \((S,P)\) recognize \(L\), and

(2) if \((R,O)\) is a quotient of \((S,P)\), then so does \((S,P)\) recognize \(L\).

For Point (1), assume that \((R, O)\) is a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((S, P)\). This means that \(R\) is a submonoid of \(S\) and that there exists a submonoid \(O'\) of \(P\) satisfying \(O = {O'|}_{R}\). Take an arbitrary function \(\sigma\colon O \to P\) such that \({\sigma(e)|}_{R} = e\) for all \(e \in O\). Let us consider the unique morphism \((\varphi', \psi')\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (S, P)\) such that \(\varphi'(c) = \varphi(c)\) for all \(c \in \Sigma_\text{int}\) and \(\psi'(\mathop{\mathrm{ext}}_{a, b}) = \sigma(\psi(\mathop{\mathrm{ext}}_{a, b}))\) for all \(a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\), given to us by Proposition [ptn:Freeness95Ext-algebras]. We can prove by induction on \(w\) that \(\varphi'(w) = \varphi(w)\) for all \(w \in \Sigma^\triangle\):

  • \(w = \varepsilon\). Then \(\varphi'(w) = 1_S = 1_R = \varphi(w)\).

  • \(w = c\) for some \(c \in \Sigma_\text{int}\). Then \(\varphi'(w) = \varphi'(c) = \varphi(c) = \varphi(w)\).

  • \(w = a w' b\) for some \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(w' \in \Sigma^\triangle\). Then \[\begin{align} \varphi'(w) & = \varphi'(\mathop{\mathrm{ext}}_{a, b}(w'))\\ & = \psi'(\mathop{\mathrm{ext}}_{a, b})(\varphi'(w'))\\ & \stackrel{\text{IH}}{=}\sigma(\psi(\mathop{\mathrm{ext}}_{a, b}))(\varphi(w'))\\ & = {\sigma(\psi(\mathop{\mathrm{ext}}_{a, b}))|}_{R}(\varphi(w'))\\ & = \psi(\mathop{\mathrm{ext}}_{a, b})(\varphi(w'))\\ & = \varphi(\mathop{\mathrm{ext}}_{a, b}(w'))\\ & = \varphi(w) \,\,\text{.} \end{align}\]

  • \(w = u v\) for some \(u, v \in \Sigma^\triangle \setminus \{\varepsilon\}\). Then \[\varphi'(w) = \varphi'(u) \varphi'(v) \stackrel{\text{IH}}{=} \varphi(u) \varphi(v) = \varphi(w) \,\,\text{.}\]

Thus, \(\varphi'^{-1}(F) = L\), which implies that \((S, P)\) recognizes \(L\).

For Point (2), assume that \((R, O)\) is a quotient of \((S, P)\). This means that there exists a surjective morphism \((\alpha, \beta)\colon (S, P) \to (R, O)\). Let us define an arbitrary function \(\rho\colon \Sigma_\text{int}\to S\) such that \(\rho(c) \in \alpha^{-1}(\varphi(c))\) for all \(c \in \Sigma_\text{int}\) as well as an arbitrary function \(\sigma\colon\{\mathop{\mathrm{ext}}_{a, b}\mid a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\} \to P\) such that \(\sigma(\mathop{\mathrm{ext}}_{a, b}) \in \beta^{-1}(\psi(\mathop{\mathrm{ext}}_{a, b}))\) for all \(a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\). Now, take the unique morphism \((\varphi', \psi')\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (S, P)\) given by Proposition [ptn:Freeness95Ext-algebras] for \(\rho\) and \(\sigma\): we claim that it is such that \(\alpha(\varphi'(w)) = \varphi(w)\) for all \(w \in \Sigma^\triangle\). We can prove it by induction on \(w\):

  • \(w = \varepsilon\). Then \(\alpha(\varphi'(w)) = \alpha(1_S) = 1_R = \varphi(w)\).

  • \(w = c\) for some \(c \in \Sigma_\text{int}\). Then \(\alpha(\varphi'(w)) = \alpha(\rho(c)) = \varphi(c) = \varphi(w)\).

  • \(w = a w' b\) for some \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(w' \in \Sigma^\triangle\). Then \[\begin{align} \alpha(\varphi'(w)) & = \alpha\bigl(\varphi'(\mathop{\mathrm{ext}}_{a, b}(w'))\bigr)\\ & = \alpha\bigl(\psi'(\mathop{\mathrm{ext}}_{a, b})(\varphi'(w'))\bigr)\\ & = \beta(\psi'(\mathop{\mathrm{ext}}_{a, b}))\bigl(\alpha(\varphi'(w'))\bigr)\\ & \stackrel{\text{IH}}{=} \beta(\sigma(\mathop{\mathrm{ext}}_{a, b}))(\varphi(w'))\\ & = \psi(\mathop{\mathrm{ext}}_{a, b})(\varphi(w'))\\ & = \varphi(\mathop{\mathrm{ext}}_{a, b}(w'))\\ & = \varphi(w) \,\,\text{.} \end{align}\]

  • \(w = u v\) for some \(u, v \in \Sigma^\triangle \setminus \{\varepsilon\}\). Then \[\alpha(\varphi'(w)) = \alpha(\varphi'(u)) \alpha(\varphi'(v)) \stackrel{\text{IH}}{=} \varphi(u) \varphi(v) = \varphi(w) \,\,\text{.}\]

Therefore, \(\varphi'^{-1}(\alpha^{-1}(F)) = L\), which implies that \((S, P)\) recognizes \(L\). ◻

Next, we show that any language recognized by an \(\mathop{\mathrm{Ext}}\)-algebra is also recognized by one of its sub-\(\mathop{\mathrm{Ext}}\)-algebras via a surjective morphism.

Let \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) be a morphism and let \(L \subseteq \Sigma^\triangle\) be a language recognized by \((R, O)\) via \((\varphi, \psi)\). Then \(\bigl(\varphi(\Sigma^\triangle), {\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)} \bigr)\) is a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((R, O)\) recognizing \(L\) via the surjective morphism \((\varphi, \psi')\) where \(\psi'(\mathop{\mathrm{ext}}_{u, v}) = {\psi(\mathop{\mathrm{ext}}_{u, v})|}_{\varphi(\Sigma^\triangle)}\) for all \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\).

Proof. Since \((R, O)\) recognizes \(L\) via \((\varphi, \psi)\), this means that there exists \(F \subseteq R\) such that \(\varphi^{-1}(F) = L\). We have that \(\varphi(\Sigma^\triangle)\) is a submonoid of \(R\) and \(\psi(\mathcal{O}(\Sigma^\triangle))\) is a submonoid of \(O\). Observe that for all \(e \in \psi(\mathcal{O}(\Sigma^\triangle))\) and \(r \in \varphi(\Sigma^\triangle)\), we have \[e(r) = \psi(\mathop{\mathrm{ext}}_{u, v})(\varphi(w)) = \varphi(u w v) \in \varphi(\Sigma^\triangle)\] because \(\psi(\mathop{\mathrm{ext}}_{u,v}) = e\) for \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) and \(r = \varphi(w)\) for \(w \in \Sigma^\triangle\). Moreover, for all \(e, f \in \psi(\mathcal{O}(\Sigma^\triangle))\), it holds that \({e|}_{\varphi(\Sigma^\triangle)} \circ {f|}_{\varphi(\Sigma^\triangle)} = {(e \circ f)|}_{\varphi(\Sigma^\triangle)}\). Therefore, \({\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)}\) is a submonoid of \(\varphi(\Sigma^\triangle)^{\varphi(\Sigma^\triangle)}\). In addition, for each \(r \in \varphi(\Sigma^\triangle)\), we have that \(r = \varphi(w)\) for some \(w \in \Sigma^\triangle\) and thus that \[\mathrm{left}_{r} = \mathrm{left}_{\varphi(w)} = {\psi(\mathrm{left}_{w})|}_{\varphi(\Sigma^\triangle)} = {\psi(\mathop{\mathrm{ext}}_{w, \varepsilon})|}_{\varphi(\Sigma^\triangle)}\] as well as \(\mathrm{right}_{r} = {\psi(\mathop{\mathrm{ext}}_{\varepsilon, w})|}_{\varphi(\Sigma^\triangle)}\). Thus, \(\bigl(\varphi(\Sigma^\triangle), {\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)} \bigr)\) is a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((R, O)\).

It is clear that \(\varphi\) is a surjective monoid morphism from \(\Sigma^\triangle\) to \(\varphi(\Sigma^\triangle)\). Further, \[\begin{align} \psi'(\mathop{\mathrm{ext}}_{u, v}) \circ \psi'(\mathop{\mathrm{ext}}_{u', v'}) & = {\psi(\mathop{\mathrm{ext}}_{u, v})|}_{\varphi(\Sigma^\triangle)} \circ {\psi(\mathop{\mathrm{ext}}_{u', v'})|}_{\varphi(\Sigma^\triangle)}\\ & = \bigl(\psi(\mathop{\mathrm{ext}}_{u, v}) \circ \psi(\mathop{\mathrm{ext}}_{u', v'})\bigr) \big|_{\varphi(\Sigma^\triangle)}\\ & = {\psi(\mathop{\mathrm{ext}}_{u, v} \circ \mathop{\mathrm{ext}}_{u', v'})|}_{\varphi(\Sigma^\triangle)}\\ & = \psi'(\mathop{\mathrm{ext}}_{u, v} \circ \mathop{\mathrm{ext}}_{u', v'}) \end{align}\] for all \(\mathop{\mathrm{ext}}_{u, v}, \mathop{\mathrm{ext}}_{u', v'} \in \mathcal{O}(\Sigma^\triangle)\), hence since \(\psi'(\mathop{\mathrm{ext}}_{\varepsilon, \varepsilon}) = {1_O|}_{\varphi(\Sigma^\triangle)}\), it follows that \(\psi'\) is a surjective monoid morphism from \(\mathcal{O}(\Sigma^\triangle)\) to \({\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)}\). Moreover, we have

  • \(\psi'(\mathop{\mathrm{ext}}_{u, v})(\varphi(w)) = {\psi(\mathop{\mathrm{ext}}_{u, v})|}_{\varphi(\Sigma^\triangle)}(\varphi(w)) = \psi(\mathop{\mathrm{ext}}_{u, v})(\varphi(w)) = \varphi(\mathop{\mathrm{ext}}_{u, v}(w))\) for all \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) and \(w \in \Sigma^\triangle\);

  • \(\psi'(\mathrm{left}_{w}) = {\psi(\mathop{\mathrm{ext}}_{w, \varepsilon})|}_{\varphi(\Sigma^\triangle)} = \mathrm{left}_{\varphi(w)}\) and \(\psi'(\mathrm{right}_{w}) = \mathrm{right}_{\varphi(w)}\) for all \(w \in \Sigma^\triangle\).

Therefore, \((\varphi, \psi')\) is a surjective morphism recognizing \(L\). ◻

The following lemma states that a language is recognized by an \(\mathop{\mathrm{Ext}}\)-algebra via a surjective morphism if, and only if, the syntactic morphism of the language factors through the former morphism.

Let \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) be a surjective morphism, let \(L \subseteq \Sigma^\triangle\) and let \((\varphi_L, \psi_L)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R_L, O_L)\) be the syntactic morphism of \(L\). Then \((R, O)\) recognizes \(L\) via \((\varphi, \psi)\) if and only if there is a surjective morphism \((\alpha, \beta)\colon (R, O) \to (R_L, O_L)\) such that \(\varphi_L = \alpha \circ \varphi\) (we say that \((\varphi_L, \psi_L)\) factors through \((\varphi, \psi)\)).

Proof. Assume first that there is a surjective morphism \((\alpha, \beta)\colon (R, O) \to (R_L, O_L)\) such that \(\varphi_L = \alpha \circ \varphi\). Then \[\varphi^{-1}\bigl(\alpha^{-1}(\varphi(L))\bigr) = (\alpha \circ \varphi)^{-1}\bigl(\varphi_L(L)) = \varphi_L^{-1}(\varphi_L(L)) = L \,\,\text{,}\] hence \((R, O)\) recognizes \(L\) via \((\varphi, \psi)\).

Assume now that \((R, O)\) recognizes \(L\) via \((\varphi, \psi)\). This means that there exists \(F \subseteq R\) satisfying \(\varphi^{-1}(F) = L\). Take \(w, w' \in \Sigma^\triangle\) such that \(\varphi(w) = \varphi(w')\). Then, given any \(e \in \mathcal{O}(\Sigma^\triangle)\), we have that \[\varphi(e(w)) = \psi(e)(\varphi(w)) = \psi(e)(\varphi(w')) = \varphi(e(w')) \,\,\text{.}\] Therefore, since \(\varphi^{-1}(F) = L\), it holds that \(w \sim_L w'\), that is, \(\varphi_L(w) = \varphi_L(w')\).

Take \(\mathop{\mathrm{ext}}_{u, v}, \mathop{\mathrm{ext}}_{u', v'} \in \mathcal{O}(\Sigma^\triangle)\) such that \(\psi(\mathop{\mathrm{ext}}_{u, v}) = \psi(\mathop{\mathrm{ext}}_{u', v'})\). Then, for each \(w \in \Sigma^\triangle\), we have that \[\varphi(\mathop{\mathrm{ext}}_{u, v}(w)) = \psi(\mathop{\mathrm{ext}}_{u, v})(\varphi(w)) = \psi(\mathop{\mathrm{ext}}_{u', v'})(\varphi(w)) = \varphi(\mathop{\mathrm{ext}}_{u', v'}(w)) \,\,\text{,}\] that is, \(\mathop{\mathrm{ext}}_{u, v}(w) \sim_L \mathop{\mathrm{ext}}_{u', v'}(w)\). Hence, \(\psi_L(\mathop{\mathrm{ext}}_{u, v}) = \psi_L(\mathop{\mathrm{ext}}_{u', v'})\).

We can now define the functions \(\alpha\colon R \to R_L\) and \(\beta\colon O \to O_L\) such that \(\alpha(\varphi(w)) = \varphi_L(w)\) for all \(w \in \Sigma^\triangle\) and \(\beta(\psi(\mathop{\mathrm{ext}}_{u, v})) = \psi_L(\mathop{\mathrm{ext}}_{u, v})\) for all \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\): those are well-defined by surjectivity of \((\varphi, \psi)\) and what we have proven just above. Since \((\varphi_L, \psi_L)\) is a surjective morphism from \((\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle))\) to \((R_L, O_L)\), we can easily prove that \((\alpha, \beta)\) is a surjective morphism from \((R, O)\) to \((R_L, O_L)\) that does of course satisfy \(\varphi_L = \alpha \circ \varphi\). ◻

The following proposition shows that the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of a given language of well-matched words is the least \(\mathop{\mathrm{Ext}}\)-algebra recognizing this language.

An \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) recognizes a language \(L \subseteq \Sigma^\triangle\) if, and only if, its syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\) divides \((R, O)\).

Proof. Let \((R, O)\) be an \(\mathop{\mathrm{Ext}}\)-algebra and let \(L \subseteq \Sigma^\triangle\) be a language. Consider also its syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\) and its syntactic morphism \((\varphi_L, \psi_L)\).

3.2.0.0.1 Implication from right to left.

Assume that the syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L, O_L)\) of \(L\) divides \((R, O)\). We have that \((R_L,O_L)\) recognizes \(L\) and we then use Lemma [lem:Division95and95recognisability] to conclude that \((R, O)\) does also recognize \(L\).

3.2.0.0.2 Implication from left to right.

Assume that \((R, O)\) recognizes \(L\) through a morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\). By Lemma [lem:Surjective95recognition], we have that \(\bigl(\varphi(\Sigma^\triangle), {\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)} \bigr) = (R', O')\) is a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((R, O)\) recognizing \(L\) via the surjective morphism \((\varphi, \psi')\) where \(\psi'(\mathop{\mathrm{ext}}_{u, v}) = {\psi(\mathop{\mathrm{ext}}_{u, v})|}_{\varphi(\Sigma^\triangle)}\) for all \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\). Then, by Lemma [lem:Factorization95surjective95recognition], there exists a surjective morphism \((\alpha, \beta)\colon (R', O') \to (R_L, O_L)\) such that \(\varphi_L = \alpha \circ \varphi\). Thus, we have that \((R_L, O_L)\) divides \((R, O)\). ◻

We say that an \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) is finite whenever \(R\) is finite (which is the case if and only if \(O\) is finite). The following theorem establishes the equivalence between visibly pushdown languages and languages recognizable by finite \(\mathop{\mathrm{Ext}}\)-algebras. Its proof provides effective translations from DVPAs to \(\mathop{\mathrm{Ext}}\)-algebras and vice versa.

A language \(L \subseteq \Sigma^\triangle\) is a VPL if, and only if, it is recognized by a finite \(\mathop{\mathrm{Ext}}\)-algebra.

Proof. Let \(L \subseteq \Sigma^\triangle\) be a language. Before we prove the theorem we have the following claim, which can be easily proven by induction on \(|u|\) and structural induction on \(w\), respectively.

3.2.0.0.3 Claim.

Let \(A = (Q, \Sigma, \Gamma, \delta, q_0, F, \bot)\) be a DVPA. We denote by \(\pi_Q\) the projection of \(Q \times \Gamma^*\) on \(Q\) and by \(\pi_{\Gamma^*}\) the projection of \(Q \times \Gamma^*\) on \(\Gamma^*\). It holds that \(L\mathopen{}\left(A\right)\mathclose{} \subseteq \Sigma^\triangle\) and additionally we have that \[\widehat{\delta}(q, u v, \sigma) = \widehat{\delta}\bigl(\pi_Q(\widehat{\delta}(q, u, \sigma)), v, \pi_{\Gamma^*}(\widehat{\delta}(q, u, \sigma)) \bigr)\] and \[\widehat{\delta}(q, w, \alpha \sigma) = \bigl(\pi_Q(\widehat{\delta}(q, w, \alpha)), \alpha \sigma\bigr)\] for all \(q \in Q\), \(u, v \in \Sigma^*\), \(\sigma \in \Gamma^*\), \(w \in \Sigma^\triangle\) and \(\alpha \in \Gamma\).

3.2.0.0.4 Implication from left to right.

Assume that \(L\) is a VPL. This means there exists a DVPA \(A = (Q, \Sigma, \Gamma, \delta, q_0, F, \bot)\) such that \(L\mathopen{}\left(A\right)\mathclose{} = L\). Consider the operation \(*\) on \(R=Q^{Q \times \Gamma}\) defined so that for all \(f, g \in R\), we have \(f * g(q, \alpha) = g(f(q, \alpha), \alpha)\) for all \(q \in Q\) and \(\alpha \in \Gamma\). Observe that for all \(f, g, h \in Q^{Q \times \Gamma}\), we have \[(f * g) * h(q, \alpha) = h(f * g(q, \alpha), \alpha) = h(g(f(q, \alpha), \alpha), \alpha) = g * h(f(q, \alpha), \alpha) = f * (g * h)(q, \alpha)\] for all \(q \in Q\) and \(\alpha \in \Gamma\). Thus \(*\) is associative and since it also has \(i \in R\) with \(i(q, \alpha) = q\) for all \(q \in Q\) and \(\alpha \in \Gamma\) as an identity, we have that \(R = Q^{Q \times \Gamma}\) with operation \(*\) forms a monoid. Take \(O\) to be the monoid \(R^R\) (for composition). Since \(O\) clearly contains the functions \(\mathrm{left}_{r}\) and \(\mathrm{right}_{r}\) for all \(r\in R\), it follows that \((R, O)\) is a finite \(\mathop{\mathrm{Ext}}\)-algebra. We now prove that it recognizes \(L\). For each \(w \in \Sigma^\triangle\), define \(f_w \in R\) by \(f_w(q, \alpha) = \pi_Q(\widehat{\delta}(q, w, \alpha))\) for all \(q \in Q\) and \(\alpha \in \Gamma\). Let us consider the unique morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\), given by Proposition [ptn:Freeness95Ext-algebras], such that for each \(c \in \Sigma_\text{int}\), we have \(\varphi(c) = f_c\) and for each \(a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}\), we have that \(\psi(\mathop{\mathrm{ext}}_{a, b})\) sends any \(f \in R\) to \(g \in R\) satisfying that \(g(q, \alpha) = \pi_Q\bigl(\delta(f(p, \beta), b, \beta)\bigr)\) with \(\delta(q, a, \alpha) = (p, \beta \alpha)\) for all \(q \in Q\) and \(\alpha \in \Gamma\). We claim that for all \(w \in \Sigma^\triangle\), we have that \(\varphi(w) = f_w\). We prove it by induction on \(w\).

  • \(w = \varepsilon\). Then \(\varphi(w) = i = f_w\).

  • \(w = c\) for some \(c \in \Sigma_\text{int}\). Then \(\varphi(w) = f_c = f_w\).

  • \(w = a w' b\) for some \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(w' \in \Sigma^\triangle\). Then \[\varphi(w) = \varphi(\mathop{\mathrm{ext}}_{a, b}(w')) = \psi(\mathop{\mathrm{ext}}_{a, b})(\varphi(w')) \stackrel{\text{IH}}{ = } \psi(\mathop{\mathrm{ext}}_{a, b})(f_{w'}) \,\,\text{.}\] So \(\varphi(w) = g\) such that for all \(q \in Q\) and \(\alpha \in \Gamma\), if we set \(\delta(q, a, \alpha) = (p, \beta\alpha)\), we have, recalling that \(\widehat{\delta}\) extends \(\delta\), \[\begin{align} g(q, \alpha) & = \pi_Q\bigl(\delta(f_{w'}(p, \beta), b, \beta)\bigr)\\ & = \pi_Q\Bigl(\delta\bigl(\pi_Q(\widehat{\delta}(p,w',\beta)), b, \beta \bigr)\Bigr) \\ & = \pi_Q\Bigl(\widehat{\delta}\bigl(\pi_Q(\widehat{\delta}(p,w',\beta)), b, \beta \bigr)\Bigr) \\ & = \pi_Q\Bigl(\widehat{\delta} \bigl(\pi_Q(\widehat{\delta}(q, a w', \alpha)), b, \pi_{\Gamma^*}(\widehat{\delta}(q, a w', \alpha)) \bigr)\Bigr)\\ & = \pi_Q(\widehat{\delta}(q, a w' b, \alpha))\\ & = f_{a w' b}(q, \alpha)\\ & = f_w(q,\alpha) \,\,\text{.} \end{align}\] Thus \(\varphi(w) = f_w\).

  • \(w = u v\) for some \(u, v \in \Sigma^\triangle \setminus \{\varepsilon\}\). Then \(\varphi(w) = \varphi(u) * \varphi(v) \stackrel{\text{IH}}{=} f_u * f_v\). But \[\begin{align} f_u * f_v(q, \alpha) & = f_v(f_u(q, \alpha), \alpha)\\ & = f_v\bigl(\pi_Q(\widehat{\delta}(q, u, \alpha)), \alpha\bigr)\\ & = \pi_Q\Bigl(\widehat{\delta} \bigl(\pi_Q(\widehat{\delta}(q, u, \alpha)), v, \alpha\bigr)\Bigr)\\ & = \pi_Q\Bigl(\widehat{\delta} \bigl(\pi_Q(\widehat{\delta}(q, u, \alpha)), v, \pi_{\Gamma^*}(\widehat{\delta}(q, u, \alpha)) \bigr)\Bigr)\\ & = \pi_Q(\widehat{\delta}(q, u v, \alpha))\\ & = f_{u v}(q, \alpha) \end{align}\] for all \(q \in Q\) and \(\alpha \in \Gamma\). Therefore \(\varphi(w) = f_w\).

Finally, set \(P = \{f \in R \mid f(q_0, \bot) \in F\}\). It holds that \[\begin{align} \varphi^{-1}(P) & = \{w \in \Sigma^\triangle \mid f_w(q_0, \bot) \in F\}\\ & = \{w \in \Sigma^\triangle \mid \pi_Q(\widehat{\delta}(q_0, w, \bot)) \in F\}\\ & = \{w \in \Sigma^\triangle \mid \widehat{\delta}(q_0, w, \bot) \in F \times \{\bot\}\}\\ & = L\mathopen{}\left(A\right)\mathclose{}\\ & = L \,\,\text{.} \end{align}\] Therefore, \((R, O)\) recognizes \(L\).

3.2.0.0.5 Implication from right to left.

Assume there exists a finite \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) that recognizes \(L\). This means that there exists a morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) such that \(L = \varphi^{-1}(F)\) for some \(F \subseteq R\). Let us now define the DVPA \[A = (Q, \Sigma, \Gamma, \delta, 1, F, \bot),\] where \(Q=R\), \(1=1_R\), \(\Gamma=R \times \Sigma_\text{call}\cup \{\bot\}\), and \[\delta(r, a, \alpha) = \begin{cases} (1, (r, a) \alpha) & \text{if a \in \Sigma_\text{call}}\\ (s \psi(\mathop{\mathrm{ext}}_{b, a})(r), \varepsilon) & \text{if a \in \Sigma_\text{ret} and \alpha = (s, b) \in R \times \Sigma_\text{call}}\\ (r, \varepsilon) & \text{if a \in \Sigma_\text{ret} and \alpha = \bot}\\ (r \varphi(c), \alpha) & \text{if a \in \Sigma_\text{int}} \end{cases}\] for all \(r \in R\), \(a \in \Sigma\) and \(\alpha \in \Gamma\). We prove that \(\widehat{\delta}(r, w, \sigma) = (r \varphi(w), \sigma)\) for all \(r \in R\), \(w \in \Sigma^\triangle\) and \(\sigma \in \Gamma^* \bot\) by induction on \(w\).

  • \(w = \varepsilon\). Then \(\widehat{\delta}(r, w, \sigma) = (r, \sigma) = (r \varphi(w), \sigma)\).

  • \(w = c\) for some \(c \in \Sigma_\text{int}\). Then \(\widehat{\delta}(r, w, \sigma) = (r \varphi(c), \sigma) = (r \varphi(w), \sigma)\).

  • \(w = a w' b\) for some \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(w' \in \Sigma^\triangle\). Then \[\begin{align} \widehat{\delta}(r, w, \sigma) & = \widehat{\delta}(1, w' b, (r, a) \sigma)\\ & = \widehat{\delta}\bigl(\pi_Q(1, w', (r, a) \sigma), b, \pi_{\Gamma^*}(1, w', (r, a) \sigma) \bigr)\\ & \stackrel{\text{IH}}{=} \widehat{\delta}(\varphi(w'), b, (r, a) \sigma)\\ & = \bigl(r \psi(\mathop{\mathrm{ext}}_{a, b})(\varphi(w')), \sigma\bigr)\\ & = (r \varphi(w), \sigma) \,\,\text{.} \end{align}\]

  • \(w = u v\) for some \(u, v \in \Sigma^\triangle \setminus \{\varepsilon\}\). Then \[\begin{align} \widehat{\delta}(r, w, \sigma) & = \widehat{\delta}\bigl(\pi_Q(\widehat{\delta}(r, u, \sigma)), v, \pi_{\Gamma^*}(\widehat{\delta}(r, u, \sigma))\bigr)\\ & \stackrel{\text{IH}}{=} \widehat{\delta}(r \varphi(u), v, \sigma)\\ & \stackrel{\text{IH}}{=} (r \varphi(u) \varphi(v), \sigma)\\ & = (r \varphi(w), \sigma) \,\,\text{.} \end{align}\]

Hence, \[\begin{align} L\mathopen{}\left(A\right)\mathclose{} & = \{w \in \Sigma^\triangle \mid \widehat{\delta}(1, w, \bot) \in F \times \{\bot\}\}\\ & = \{w \in \Sigma^\triangle \mid \pi_Q(\widehat{\delta}(1, w, \bot)) \in F\}\\ & = \{w \in \Sigma^\triangle \mid \varphi(w) \in F\}\\ & = \varphi^{-1}(F) = L \,\,\text{.} \end{align}\] Therefore, \(L\) is a VPL. ◻

4 (Weak) length-synchronicity, nesting depth, and quasi-aperiodicity↩︎

For the rest of this section let us fix a visibly pushdown alphabet \(\Sigma\), a finite \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) and consider a morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\). Suitably adjusting the pumping lemma for context-free languages we introduce a pumping lemma for \(\mathop{\mathrm{Ext}}\)-algebra morphisms in Section 4.1. In Section 4.2 we extend the notions of weak length-synchronicity and length-synchronicity to \(\mathop{\mathrm{Ext}}\)-algebra morphisms and to visibly pushdown languages. It is shown that for languages generated by vertically visibly pushdown grammars, (weak) length-synchronicity of the word relation of the generating grammar coincides with (weak) length-synchronicity of the language. We concern ourselves with the nesting depth of visibly pushdown languages in Section 4.3. Finally in Section 4.4 we introduce quasi-aperiodicity of \(\mathop{\mathrm{Ext}}\)-algebra morphisms and prove that a VPL is quasi-counterfree if, and only if, its syntactic morphism is quasi-aperiodic.

4.1 A pumping lemma for Ext-algebra morphisms↩︎

The following is an adaption of the pumping lemma for context-free languages to \(\mathop{\mathrm{Ext}}\)-algebra morphisms. It states that if \(uv\in\Sigma^\triangle\) and \(u\) (resp. \(v\)) contains a well-matched factor that is sufficiently long, we can pump certain infixes of \(u\) (resp. \(v\)): thus, one can find longer and longer words \(u_1,u_2, \ldots\) (resp.\(v_1,v_2,\ldots)\) such that \(u_1 v, u_2 v, \ldots \in \Sigma^\triangle\) (resp. \(u v_1, u v_2, \ldots \in \Sigma^\triangle\)) and the morphism \(\psi\) sends \(\mathop{\mathrm{ext}}_{u,v}\) to the same element in \(O\) as \(\mathop{\mathrm{ext}}_{u_i,v}\) (resp.as \(\mathop{\mathrm{ext}}_{u,v_i}\)).

There exists \(n \in \mathbb{N}_{>0}\) such that for all \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) we have:

  • If there exists a factor \(w \in \Sigma^\triangle\) of \(u\) satisfying \(\mathopen{}\left|w\right|\mathclose{} \geq n\), then \(u = s x z y t\) with \(s, x, z, y, t \in \Sigma^*\) such that \(\mathopen{}\left|x y\right|\mathclose{} \geq 1\), \(\mathopen{}\left|x z y\right|\mathclose{} \leq n\) and for all \(i \in \mathbb{N}\), \(s x^i z y^i t v \in \Sigma^\triangle\) and \(\psi(\mathop{\mathrm{ext}}_{u, v}) = \psi(\mathop{\mathrm{ext}}_{s x^i z y^i t, v})\).

  • If there exists a factor \(w \in \Sigma^\triangle\) of \(v\) satisfying \(\mathopen{}\left|w\right|\mathclose{} \geq n\), then \(v = s x z y t\) with \(s, x, z, y, t \in \Sigma^*\) such that \(\mathopen{}\left|x y\right|\mathclose{} \geq 1\), \(\mathopen{}\left|x z y\right|\mathclose{} \leq n\) and for all \(i \in \mathbb{N}\), \(u s x^i z y^i t \in \Sigma^\triangle\) and \(\psi(\mathop{\mathrm{ext}}_{u, v}) = \psi(\mathop{\mathrm{ext}}_{u, s x^i z y^i t})\).

Proof. For each \(r \in R\), let \(n_r \in \mathbb{N}_{>0}\) be the pumping constant for the context-free language \(\varphi^{-1}(r)\): it is a VPL and hence a context-free language by Theorem [thm:vpl:ext]. We set \(n = \max_{r \in R} n_r\). Let \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) be such that there exists a factor \(w \in \Sigma^\triangle\) of \(u\) satisfying \(\mathopen{}\left|w\right|\mathclose{} \geq n\). Let \[\mathop{\mathrm{ext}}_{u,v} \quad=\quad \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \quad\cdots\quad \circ \mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}} \circ \mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}} \circ \mathop{\mathrm{ext}}_{x_h,y_h}\] be the stair factorization of \(\mathop{\mathrm{ext}}_{u,v}\) provided by Lemma [lemma32ext]. Since no factor of \(u\) spanning one of the \(a_j\)’s in the factorization can be well-matched, there must exist some \(j \in [1, h]\) satisfying \(\mathopen{}\left|x_j\right|\mathclose{} \geq n\), so that if we set \(u' = x_1 a_1 \cdots x_{j - 1} a_{j - 1}\), \(v' = b_{j - 1} y_{j - 1} \cdots b_1 y_1\), \(u'' = a_j x_{j + 1} \cdots a_{h - 1} x_h\) and \(v'' = y_h b_{h - 1} \cdots y_{j + 1} b_j y_j\), we have \(u'v', u''v'' \in \Sigma^\triangle\) and \(\mathop{\mathrm{ext}}_{u, v} = \mathop{\mathrm{ext}}_{u', v'} \circ \mathop{\mathrm{ext}}_{x_j, \varepsilon} \circ \mathop{\mathrm{ext}}_{u'', v''}\). By the pumping lemma for context-free languages we have \(x_j = x' x z y y'\) with \(x', x, z, y, y' \in \Sigma^*\) such that \(\mathopen{}\left|x y\right|\mathclose{} \geq 1\), \(\mathopen{}\left|x z y\right|\mathclose{} \leq n\) and for all \(i \in \mathbb{N}\), \(x' x^i z y^i y' \in \Sigma^\triangle\) and \(\varphi(x_j) = \varphi(x' x^i z y^i y')\). This implies that if we set \(s = u' x'\) and \(t = y' u''\), then for all \(i \in \mathbb{N}\), we have \(s x^i z y^i t v = \mathop{\mathrm{ext}}_{u', v'} \circ \mathop{\mathrm{ext}}_{x' x^i z y^i y', \varepsilon} \circ \mathop{\mathrm{ext}}_{u'', v''}(\varepsilon) \in \Sigma^\triangle\) and \[\begin{align} \psi(\mathop{\mathrm{ext}}_{u, v}) & = \psi(\mathop{\mathrm{ext}}_{u', v'}) \circ \mathrm{left}_{\varphi(x_j)} \circ \psi(\mathop{\mathrm{ext}}_{u'', v''})\\ & = \psi(\mathop{\mathrm{ext}}_{u', v'}) \circ \mathrm{left}_{\varphi(x' x^i z y^i y')} \circ \psi(\mathop{\mathrm{ext}}_{u'', v''})\\ & = \psi(\mathop{\mathrm{ext}}_{u', v'}) \circ \psi(\mathop{\mathrm{ext}}_{x' x^i z y^i y', \varepsilon}) \circ \psi(\mathop{\mathrm{ext}}_{u'', v''})\\ & = \psi(\mathop{\mathrm{ext}}_{s x^i z y^i t, v}) \,\,\text{.} \end{align}\]

We handle the case where for \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) there exists a factor \(w \in \Sigma^\triangle\) of \(v\) such that \(\mathopen{}\left|w\right|\mathclose{} \geq n\) symmetrically. ◻

4.2 Weak length-synchronicity and length-synchronicity↩︎

In this section we introduce the notions of weak length-synchronicity and length-synchronicity for \(\mathop{\mathrm{Ext}}\)-algebra morphisms and visibly pushdown languages. Before we do that, let us give some motivation how \(\mathsf{TC}^0\)-hardness can be proven if the syntactic morphism maps certain \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v}\) with \(|u|\not=|u'|\) to particular idempotents. For these we require the following notion of reachability.

For \(F \subseteq R\) we say that an element \(r\in R\) is \(F\)-reaching if \(e(r) \in F\) for some \(e\in O\). We say \(e\in O\) is \(F\)-reaching if \(e(r)\) is \(F\)-reaching for some \(r\in R\). Although we will mainly study \(F\)-reaching elements over finite \(\mathop{\mathrm{Ext}}\)-algebras we remark that the notion of \(F\)-reachability is defined over any \(\mathop{\mathrm{Ext}}\)-algebra, in particular over \((\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\).

Fix any VPL \(L\), its syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\) along with its syntactic morphism \((\varphi_L,\psi_L)\). Assume there exists some idempotent \(e\in O_L\) that is \(\varphi(L)\)-reaching. We claim that if \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u',v})=e\) and \(\Delta(u),\Delta(u')>0\) for some \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v}\in\mathcal{O}(\Sigma^\triangle)\) with \(|u|\not=|u'|\), then \(L\) is \(\mathsf{TC}^0\)-hard. We remark that we must have \(\Delta(u)=\Delta(u')\). Exploiting the fact that \(|u|\not=|u'|\) we give a constant-depth reduction from the \(\mathsf{TC}^0\)-complete language \(\mathrm{EQUALITY}\) to \(L\). As \(\psi_L(\mathop{\mathrm{ext}}_{u,v})\) is \(\varphi(L)\)-reaching, we can fix some \(x,y,z\in\Sigma^*\) such that \(xuyvz\in L\). Given a word \(w\in\{0,1\}^*\) of length \(2n\) (binary words of odd length can directly be rejected) we map it to \(xh(w)yv^{n\cdot(|u|+|u'|)}z\), where \(h\colon\{0,1\}^*\rightarrow\Sigma^*\) is the length-multiplying morphism (i.e. \(\exists l\in\mathbb{N}:h(0),h(1)\in\Sigma^l\)) satisfiying \(h(0)=u^{|u'|}\) and \(h(1)=u'^{|u|}\). We have \(w\in\mathrm{EQUALITY}\) if, and only if, \(|w|_0=|w|_1=n\) if, and only if, \(\Delta(h(w))=n\cdot(|u|+|u'|)\cdot\Delta(u)= -n\cdot(|u|+|u'|)\cdot\Delta(v)\) if, and only if, \(h(w)v^{n\cdot(|u|+|u'|)}\in\Sigma^\triangle\). Hence, since \(\psi_L(\mathop{\mathrm{ext}}_{u^s,v^s})=\psi_L(\mathop{\mathrm{ext}}_{(u')^t,v^t})=e\) for all \(s,t\geq 1\) it follows that \(w\in\mathrm{EQUALITY}\) if, and only, if \(xh(w)yv^{n\cdot(|u|+|u'|)}z\in\Sigma^\triangle\) if, and only if, \(xh(w)yv^{n\cdot(|u|+|u'|)}z\in L\).

Dually, one can show that \(L\) is \(\mathsf{TC}^0\)-hard in case \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u,v'})=e\) and \(\Delta(u)>0\) for some \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u,v'}\in\mathcal{O}(\Sigma^\triangle)\) with \(|v|\not=|v'|\).

The following definition of weak length-synchronicity captures the situation when such idempotents do not exist — it adapts the notion of weak length-synchronicity of sets of contexts, given in Definition [def32synchronicity], to morphisms and VPLs, respectively. Recall that \(\mathcal{R}\subseteq\mathsf{Con}(\Sigma)\) is defined to be weakly length-synchronous if \(u=u'\) implies \(\mathopen{}\left|v\right|\mathclose{}=\mathopen{}\left|v'\right|\mathclose{}\) and \(v=v'\) implies \(\mathopen{}\left|u\right|\mathclose{}=\mathopen{}\left|u'\right|\mathclose{}\) for all \((u,v),(u',v')\in \mathcal{R}\) satisfying \(\Delta(u),\Delta(u')>0\).

For all \(e\in O\) define the sets of contexts \(\mathcal{R}_e\) and \(\mathcal{U}_e\) as follows: \[\mathcal{R}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid \psi(\mathop{\mathrm{ext}}_{u,v})=e\} \quad\text{ and }\quad \mathcal{U}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid e\circ\psi(\mathop{\mathrm{ext}}_{u,v})=e\}\]

The morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) is \(F\)-weakly-length-synchronous (where \(F\subseteq R\)) if for all \(F\)-reaching idempotents \(e\in O\) the set of contexts \(\mathcal{R}_e\) is weakly length-synchronous. We call a VPL \(L\subseteq\Sigma^\triangle\) weakly length-synchronous if its syntactic morphism \((\varphi_L,\psi_L)\) is \(\varphi_L(L)\)-weakly-length-synchronous.

In fact, \(F\)-weak-length-synchronicity actually implies weak length-synchronicity of the set of contexts associated to any subsemigroup of \(F\)-reaching elements.

For all \(F \subseteq R\) and subsemigroup \(P\) of \(O\), if all elements in \(P\) are \(F\)-reaching and \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous, then \(\bigcup_{e \in P} \mathcal{R}_e\) is weakly length-synchronous.

Proof. Let \(F \subseteq R\) and \(P\) be a subsemigroup of \(O\). Assume all elements in \(P\) are \(F\)-reaching and \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous.

Let \((u, v), (u', v) \in \mathsf{Con}(\Sigma)\) be such that \(\Delta(u), \Delta(u') > 0\) and \(\psi(\mathop{\mathrm{ext}}_{u, v}), \psi(\mathop{\mathrm{ext}}_{u', v}) \in P\). Set \(e = \psi(\mathop{\mathrm{ext}}_{u, v})\) and \(f = \psi(\mathop{\mathrm{ext}}_{u', v})\). By hypothesis, given \(\omega \in \mathbb{N}_{>0}\) the idempotent power of \(O\), we have \((e^\omega f^\omega)^\omega \in P\), hence \((e^\omega f^\omega)^\omega\) is an \(F\)-reaching idempotent and thus \(\mathcal{R}_{(e^\omega f^\omega)^\omega}\) is weakly length-synchronous. But \[\psi(\mathop{\mathrm{ext}}_{(u^{2\cdot\omega}u'^\omega)^\omega, v^{3\cdot\omega^2}}) = (e^\omega f^\omega)^\omega = \psi(\mathop{\mathrm{ext}}_{(u^{\omega}u'^{2\cdot\omega})^\omega, v^{3\cdot\omega^2}})\] so since \(\Delta((u^{2\cdot\omega}u'^\omega)^\omega) = \Delta((u^{\omega}u'^{2\cdot\omega})^\omega) > 0\), we obtain \[\arraycolsep=1.4pt\def\arraystretch{1.7} \begin{array}{lrcl} &\quad{\omega \cdot (2\cdot\omega\cdot |u|+ \omega\cdot |u'|)}& =& \omega\cdot(\omega\cdot|u|+2\cdot\omega\cdot |u'|)\\ \Longleftrightarrow\quad & {2\cdot|u|+|u'|} &=& {|u|+2\cdot|u'|}\\ \Longleftrightarrow\quad & |u| &=& |u'| \,\,\text{.} \end{array}\] In the same way, one can prove that for all \((u, v), (u, v') \in \mathsf{Con}(\Sigma)\) such that \(\Delta(u) > 0\) and \(\psi(\mathop{\mathrm{ext}}_{u, v}), \psi(\mathop{\mathrm{ext}}_{u, v'}) \in P\), we have \(\mathopen{}\left|v\right|\mathclose{} = \mathopen{}\left|v'\right|\mathclose{}\).

Therefore, \(\bigcup_{e \in P} \mathcal{R}_e\) is weakly length-synchronous. ◻

Instead of considering those pairs \((u,v)\) such that \(\mathop{\mathrm{ext}}_{u,v}\) is being mapped to an \(F\)-reaching idempotent, the following characterization of weak length-synchronicity consider pairs \((u,v)\) such that \(\mathop{\mathrm{ext}}_{u,v}\) is being mapped to an element that behaves neutrally with respect to right multiplication with an \(F\)-reaching element that is not necessarily idempotent.

For all \(F\subseteq R\) we have that \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous if, and only if, for all \(F\)-reaching \(e\in O\) the set of contexts \(\mathcal{U}_e\) is weakly length-synchrononous.

Proof. Let \(F \subseteq R\).

If \(\mathcal{U}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid e\circ\psi(\mathop{\mathrm{ext}}_{u,v})=e\}\) is weakly length-synchronous for all \(F\)-reaching \(e\in O\), then in particular the set of contexts \(\mathcal{R}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid \psi(\mathop{\mathrm{ext}}_{u,v})=e\}\) is weakly length-synchronous for all \(F\)-reaching idempotents \(e\in O\).

Conversely, assume that \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous. Fix any \(F\)-reaching \(e\in O\). We need to prove that \(\mathcal{U}_e\) is weakly length-synchronous. It is clear that \(P = \{f \in O \mid e \circ f = e\}\) forms a subsemigroup of \(O\) whose elements are all \(F\)-reaching, by \(F\)-reachability of \(e\). Therefore, by Lemma [lem:Weak95length-synchronicity95subsemigroups], \(\bigcup_{f \in P} \mathcal{R}_f = \mathcal{U}_e\) is weakly length-synchronous. ◻

Using Lemma [lem:Ext95pumping] and Proposition [ptn:Weak95length-synchronicity95equivalence], the following proposition follows immediately.

Let \(n\) be the pumping constant from Lemma [lem:Ext95pumping], let \(F\subseteq R\), let \(e\in O\) be \(F\)-reaching, and let \(\mathop{\mathrm{ext}}_{u,v}\) be such that \(\Delta(u)>0\) and \(e\circ\psi(\mathop{\mathrm{ext}}_{u,v})=e\). If \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous, then the stair factorization \[\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\dots \circ\mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}}\circ\mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}}\circ\mathop{\mathrm{ext}}_{x_h,y_h}\] satisfies \(|x_i|,|y_i|\leq n\) for all \(i\in[1,h]\),

As above, the following definition adapts the notion of length-synchronicity of sets of contexts, given in Definition [def32synchronicity], to \(\mathop{\mathrm{Ext}}\)-algebra morphisms and VPLs, respectively.

The morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) is \(F\)-length-synchronous (where \(F\subseteq R\)) if for all \(F\)-reaching idempotents \(e\in O\) the set of contexts \(\mathcal{R}_e\) is length-synchronous. We call a VPL \(L\subseteq\Sigma^\triangle\) length-synchronous if its syntactic morphism \((\varphi_L,\psi_L)\) is \(\varphi_L(L)\)-length-synchronous.

Consider our running example \(\mathcal{L}_{1,2}=L(S\rightarrow a S b_1 \mid ac S b_2 \mid \varepsilon)\). Recall that the monoid \(O_{\mathcal{L}_{1,2}}\) of the syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_{\mathcal{L}_{1,2}},O_{\mathcal{L}_{1,2}})\) and syntactic morphism \((\varphi_{\mathcal{L}_{1,2}},\psi_{\mathcal{L}_{1,2}})\) of \(\mathcal{L}_{1,2}\), given in Example [example32L2], has the idempotents \((\varepsilon,\varepsilon)\), \((acb_1,\varepsilon)\) and \((a,b_1)\). Also recall that \(\varphi_{\mathcal{L}_{1,2}}(\mathcal{L}_{1,2}) =\{\varepsilon,ab_1\}\). Since \(\psi_{\mathcal{L}_{1,2}}^{-1}((\varepsilon,\varepsilon))= \{\mathop{\mathrm{ext}}_{\varepsilon,\varepsilon}\}\) and \((acb_1,\varepsilon)\) is a zero we have that \(O_{\mathcal{L}_{1,2}}\)’s only idempotent that is \(\{\varepsilon,ab_1\}\)-reaching and whose pre-image under \(\psi_{\mathcal{L}_{1,2}}\) contains at least one \(\mathop{\mathrm{ext}}_{u,v}\) with \(\Delta(u)>0\) is the idempotent \((a,b_1)\). However, both \(\mathop{\mathrm{ext}}_{a,b_1}\) and \(\mathop{\mathrm{ext}}_{ac,b_2}\), where \(\Delta(a)=\Delta(ac)=1>0\), are sent to the idempotent \((a,b_1)=(a,b_2)\circ(c,\varepsilon)\). Since \(|a|/|b_1|=1\not=2=|ac|/|b_2|\), we have that \(\mathcal{L}_{1,2}\) is not length-synchronous. On the other hand, note that if any \(\mathop{\mathrm{ext}}_{u,v}\) and \(\mathop{\mathrm{ext}}_{u',v}\) (resp. \(\mathop{\mathrm{ext}}_{u,v}\) and \(\mathop{\mathrm{ext}}_{u,v'}\)) are sent to \((a,b_1)\) then \(u=u'\) and thus \(|u|=|u'|\) (resp. \(v=v'\) and thus \(|v|=|v'|\)). Hence, \(\mathcal{L}_{1,2}\) is weakly length-synchronous.

As above, \(F\)-length-synchronicity actually implies length-synchronicity of the set of contexts associated to any subsemigroup of \(F\)-reaching elements.

For all \(F \subseteq R\) and subsemigroup \(P\) of \(O\), if all elements in \(P\) are \(F\)-reaching and \((\varphi,\psi)\) is \(F\)-length-synchronous, then \(\bigcup_{e \in P} \mathcal{R}_e\) is length-synchronous.

Proof. Let \(F \subseteq R\) and \(P\) be a subsemigroup of \(O\). Assume all elements in \(P\) are \(F\)-reaching and \((\varphi,\psi)\) is \(F\)-length-synchronous.

Let \((u, v), (u', v') \in \mathsf{Con}(\Sigma)\) be such that \(\Delta(u), \Delta(u') > 0\) and \(\psi(\mathop{\mathrm{ext}}_{u, v}), \psi(\mathop{\mathrm{ext}}_{u', v'}) \in P\). Set \(e = \psi(\mathop{\mathrm{ext}}_{u, v})\) and \(f = \psi(\mathop{\mathrm{ext}}_{u', v'})\). By hypothesis, given \(\omega \in \mathbb{N}_{>0}\) the idempotent power of \(O\), we have \((e^\omega f^\omega)^\omega \in P\), hence \((e^\omega f^\omega)^\omega\) is an \(F\)-reaching idempotent and thus \(\mathcal{R}_{(e^\omega f^\omega)^\omega}\) is length-synchronous. But \[\psi(\mathop{\mathrm{ext}}_{(u^{2 \cdot \omega} u'^\omega)^\omega, (v'^\omega v^{2 \cdot \omega})^\omega}) = (e^\omega f^\omega)^\omega = \psi(\mathop{\mathrm{ext}}_{(u^\omega u'^{2 \cdot \omega})^\omega, (v'^{2 \cdot \omega} v^\omega)^\omega})\] so since \(\Delta((u^{2\cdot\omega}u'^\omega)^\omega), \Delta((u^{\omega}u'^{2\cdot\omega})^\omega) > 0\), setting \((x, y) = ((u^{2 \cdot \omega} u'^\omega)^\omega, (v'^\omega v^{2 \cdot \omega})^\omega)\) and \((x', y') = ((u^\omega u'^{2 \cdot \omega})^\omega, (v'^{2 \cdot \omega} v^\omega)^\omega)\), we obtain (using that for \(a,b,c,d>0\) we have that \(\frac{a}{b}=\frac{c}{d}\) implies \(\frac{a}{b}=\frac{c}{d}=\frac{a+c}{b+d}\) and, if additionally \(a>c\), it implies \(\frac{a}{b}=\frac{c}{d}=\frac{a-c}{b-d}\)) \[\begin{align} \frac{|x|}{|y|}=\frac{|x'|}{|y'|} & \quad\Longrightarrow\quad & \frac{|x|}{|y|}=\frac{|x'|}{|y'|}=\frac{|x|+|x'|}{|y|+|y'|}= \frac{\omega^2\cdot(|u|+|u'|)}{\omega^2\cdot(|v|+|v'|)}\nonumber\\ &\quad\Longrightarrow\quad& \frac{|x|-\omega^2\cdot(|u|+|u'|)}{|y|-\omega^2\cdot(|v|+|v'|)}= \frac{|x'|-\omega^2\cdot(|u|+|u'|)}{|y'|-\omega^2\cdot(|v|+|v'|)} \label{E32square}\\ &\quad\Longrightarrow\quad& \frac{|u|}{|v|}= \frac{\omega^2\cdot|u|}{\omega^2\cdot|v|} \stackrel{(\ref{E32square})}{=} \frac{\omega^2\cdot|u'|}{\omega^2\cdot|v'|}= \frac{|u'|}{|v'|}\nonumber \,\,\text{.} \end{align}\tag{1}\]

Therefore, \(\bigcup_{e \in P} \mathcal{R}_e\) is length-synchronous. ◻

The two following propositions characterize length-synchronicity of \(\mathop{\mathrm{Ext}}\)-algebra morphisms, which will be of particular importance when approximating the matching relation of a length-synchronous VPL in terms of \(\mathsf{FO}[+]\). This will be an important ingredient to proving that VPLs that both are length-synchronous and have a quasi-aperiodic syntactic morphism (a notion to be defined in Subsection 4.4) are in \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\) and thus in \(\mathsf{AC}^0\).

For all \(F \subseteq R\), we have that \((\varphi,\psi)\) is \(F\)-length-synchronous if, and only if, for all \(F\)-reaching \(e\in O\) the set of contexts \(\mathcal{U}_e\) is length-synchronous.

Proof. Let \(F \subseteq R\).

If \(\mathcal{U}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid e\circ\psi(\mathop{\mathrm{ext}}_{u,v})=e\}\) is length-synchronous for all \(F\)-reaching \(e\in O\), then in particular the set of contexts \(\mathcal{R}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid \psi(\mathop{\mathrm{ext}}_{u,v})=e\}\) is length-synchronous for all \(F\)-reaching idempotents \(e\in O\).

Conversely, assume that \((\varphi,\psi)\) is \(F\)-length-synchronous. Fix any \(F\)-reaching \(e\in O\). We need to prove that \(\mathcal{U}_e\) is length-synchronous. It is clear that \(P = \{f \in O \mid e \circ f = e\}\) forms a subsemigroup of \(O\) whose elements are all \(F\)-reaching, by \(F\)-reachability of \(e\). Therefore, by Lemma [lem:Length-synchronicity95subsemigroups], \(\bigcup_{f \in P} \mathcal{R}_f = \mathcal{U}_e\) is length-synchronous. ◻

Let \(F \subseteq R\) and assume \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous. Then for all \(F\)-reaching \(e\in O\) the following two statements are equivalent.

  1. The set of contexts \(\mathcal{U}_e\) is length-synchronous.

  2. There exist \(\alpha \in \mathbb{Q}_{>0}\), \(\beta \in \mathbb{N}\), \(\gamma \in \mathbb{N}_{>0}\) such that for all \((u,v)\in\mathcal{U}_e\) with \(\Delta(u) > 0\) we have:

    1. \(\frac{\mathopen{}\left|u\right|\mathclose{}}{\mathopen{}\left|v\right|\mathclose{}} = \alpha\).

    2. For all \(u', v' \in \Sigma^+\) with \(u'\) prefix of \(u\) and \(v'\) suffix of \(v\) such that \(\frac{\mathopen{}\left|u'\right|\mathclose{}}{\mathopen{}\left|v'\right|\mathclose{}} = \alpha\), we have that \(-\Delta(v') - \beta \leq \Delta(u') \leq -\Delta(v') + \beta\).

    3. For all factors \(u' \in \Sigma^*\) of \(u\) such that \(\mathopen{}\left|u'\right|\mathclose{} = \gamma\), we have \(\Delta(u') \geq 1\).

    4. For all factors \(v' \in \Sigma^*\) of \(v\) such that \(\mathopen{}\left|v'\right|\mathclose{} = \gamma\), we have \(\Delta(v') \leq -1\).

Proof. The implication from Point 2 to Point 1 is trivial since Point 2 (a) implies Point 1.

Let us now prove that Point 1 implies Point 2. Fix any \(e\in O\) that is \(F\)-reaching and assume that \(\mathcal{U}_e\) is length-synchronous. Point 2 (a) follows immediately from length-synchronicity of \(\mathcal{U}_e\). We can hence write \(\alpha=\frac{A}{B}\) for some \(A,B\in\mathbb{N}_{>0}\).

For proving Point 2 (b), we define \(\beta= (n+1)\cdot(|O|+\max(A,B)+1)\), where \(n\) is the constant taken from Lemma [lem:Ext95pumping]. Let \((u,v)\in\mathcal{U}_e\) with \(\Delta(u) > 0\) and let \[\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ \dots \circ\mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}}\circ\mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}}\circ\mathop{\mathrm{ext}}_{x_h,y_h}\] be the stair factorization of \(\mathop{\mathrm{ext}}_{u,v}\) according to Lemma [lemma32ext]. Since our morphism \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous by assumption, we have \(|x_i|,|y_i|\leq n\) by Lemma [ptn:hill95small]. Let \(u'\in\Sigma^*\) be a prefix of \(u\) and \(v'\) be a suffix of \(v\) such that \(\frac{|u'|}{|v'|}=\alpha\). If \((u',v')=(u,v)\) we are done since then \(\Delta(u')=-\Delta(v')\). Thus, it remains to consider the case when \(u'\) is a strict prefix of \(u\) and \(v'\) is a strict suffix of \(v\): indeed, due to \(\frac{|u|}{|v|}=\frac{|u'|}{|v'|}=\alpha\) we have that \(u'\) is a strict prefix of \(u\) if, and only if, \(v'\) is a strict suffix of \(v\).

Let \(j\in[1,h]\) be maximal such that \(x_1\cdots a_{j-1}x_j\) is a prefix of \(u'\) and \(y_jb_{j-1}\cdots y_1\) is a suffix of \(v'\). If \(j = 1\) we are done, since then \(\min\{\mathopen{}\left|u'\right|\mathclose{}, \mathopen{}\left|v'\right|\mathclose{}\} \leq n\), so that \(|\Delta(u')+\Delta(v')| \leq \mathopen{}\left|u'\right|\mathclose{} + \mathopen{}\left|v'\right|\mathclose{} \leq n + n \cdot \max(A, B) \leq \beta\). So assume now that \(j > 1\), which implies that \(\Delta(u'') > 0\). Note that \(j<h\) since \((u',v')\not=(u,v)\). Hence there exist unique words \(s,t\in\Sigma^*\) such that \(u'=u''s\) and \(v'=tv''\), where \(u''=x_1\cdots a_{j-1}x_j\) and \(v''=y_jb_{j-1}\cdots y_1\). By maximality of \(j\) we have \(\min\{|s|,|t|\}\leq n\). Setting \(f=\psi(\mathop{\mathrm{ext}}_{u'',v''})\) and \(g=\psi(\mathop{\mathrm{ext}}_{a_jx_{j+1}\cdots a_{h-1}x_h,y_h b_{h-1} \cdots y_{j+1}b_j})\) we have \(\psi(\mathop{\mathrm{ext}}_{u,v})=f\circ g\). We claim that there exist \(\mathop{\mathrm{ext}}_{x_g,y_g}\in\mathcal{O}(\Sigma^\triangle)\) such that \(\psi(\mathop{\mathrm{ext}}_{x_g,y_g})=g\) and \(|x_g|,|y_g|\leq |O|\cdot (n+1)\): indeed, by the pigeonhole principle and Lemma [ptn:hill95small] (as \(e \circ f \circ g = e\) and \(\Delta(u'') > 0\)), any \(\mathop{\mathrm{ext}}_{x,y}\in\mathcal{O}(\Sigma^\triangle)\) such that \(\psi(\mathop{\mathrm{ext}}_{x,y})=g\) and \(\max(|x|,|y|)>|O|\cdot (n+1)\) must have a stair factorization according to Lemma [lemma32ext] with an \(h > \left|O\right|\) and can thus be factorized as \(\mathop{\mathrm{ext}}_{x,y}=\mathop{\mathrm{ext}}_{x',y'}\circ\mathop{\mathrm{ext}}_{x'',y''}\circ\mathop{\mathrm{ext}}_{x''',y'''}\) such that \(\psi(\mathop{\mathrm{ext}}_{x,y})=\psi(\mathop{\mathrm{ext}}_{x',y'})\circ\psi(\mathop{\mathrm{ext}}_{x''',y'''})\), where moreover \((x'',y'')\in\Sigma^+\times\Sigma^+\). Thus, \(\psi(\mathop{\mathrm{ext}}_{u''x_g,y_gv''})=\psi(\mathop{\mathrm{ext}}_{u,v})\) and therefore \((u''x_g,y_gv'')\in\mathcal{U}_e\) with \(\Delta(u''x_g) > 0\). It follows \(\alpha=\frac{|u''x_g|}{|y_gv''|}= \frac{|u'|-|s|+|x_g|}{|y_g|+|v'|-|t|}\), or equivalently, using \(\frac{|u'|}{|v'|}=\alpha\): \[\begin{align} |s|&=&|u'|+|x_g|+\alpha(|t|-|y_g|-|v'|)= |x_g|+\alpha(|t|-|y_g|)\tag{2}\\ |t|&=&\frac{|s|-|u'|-|x_g|}{\alpha}+|y_g|+|v'|= \frac{|s|-|x_g|}{\alpha}+|y_g|\tag{3} \,\,\text{.} \end{align}\] Finally, we obtain \[\begin{align} |\Delta(u')+\Delta(v')| & = &|\Delta(u''s)+\Delta(tv'')|\\ &\stackrel{\Delta(u'')=-\Delta(v'')}{=}&|\Delta(s)+\Delta(t)|\\ &\leq & |s|+|t|\\ &=& \min(|s|,|t|)+\max(|s|,|t|)\\ &\leq& n+\max(|s|,|t|)\\ &\stackrel{(\ref{eq32s}),(\ref{eq32t})}{\leq}& n+\max\left(|x_g|+\alpha(n-|y_g|), \frac{n-|x_g|}{\alpha}+|y_g|\right)\\ &\leq& n+|O|\cdot (n+1)+n\cdot\max(A,B)\\ &\leq&(n+1)\cdot(|O|+\max(A,B)+1)\\ &=&\beta \,\,\text{.} \end{align}\] This proves Point 2 (b).

For Point 2 (c) and Point 2 (d) we set \(\gamma=(\lceil\frac{n}{2}\rceil+1)\cdot(n+1)+n\) and remark that \(\gamma\) does not depend on \(u\) nor \(v\). We only prove Point 2 (c), the proof of Point 2 (d) is analogous. As above, let \[\mathop{\mathrm{ext}}_{u,v}=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ \dots \circ\mathop{\mathrm{ext}}_{x_{h-1},y_{h-1}}\circ\mathop{\mathrm{ext}}_{a_{h-1},b_{h-1}}\circ\mathop{\mathrm{ext}}_{x_h,y_h}\] be the stair factorization of \(\mathop{\mathrm{ext}}_{u,v}\) according to Lemma [lemma32ext]. Let \(u'\) with \(|u'|\geq\gamma\) be a factor of \(u\) and hence of \(x_1a_1x_2\cdots x_{h-1}a_{h-1}x_h\). By definition of stair factorization we have \(\Delta(x_i)=0\) for all \(i\in[1,h]\) and \(\Delta(a_i)=1\) for all \(i\in[1,h-1]\). Let \(w\) be the longest prefix of \(u'\) such that \(\Delta(w)=\min\{\Delta(x)\mid\text{x is a prefix of u'}\}\). Since \(|x_1|,|y_1|,\dots,|x_h|,|y_h|\leq n\), it immediately follows \(\Delta(w)\geq -\frac{n}{2}\) and \(|w|\leq n\). By the same reason, every prefix of the form \(ws\) of \(u'\) satisfies \(\Delta(ws)\geq \Delta(w)+\frac{|s|}{n+1}\). Thus we have \[\Delta(u')\geq \Delta(w)+\frac{|u'|-|w|}{n+1} \geq -\frac{n}{2}+ \frac{((\lceil\frac{n}{2}\rceil+1)\cdot(n+1)+n)-n}{n+1} \geq 1 \,\,\text{.} \qedhere\] ◻

The following proposition relates, for languages \(L\) generated by vertically visibly pushdown grammars \(G\), (weak) length-synchronicity of \(L\) with (weak) length-synchronicity of \(\mathcal{R}(G)\).

Let \(L=L(G)\) for some vertically visibly pushdown grammar \(G=(V,\Sigma,P,S)\). Moreover, let \(\mathcal{R}(G)=\{(u,v)\in\mathsf{Con}(\Sigma)\mid S\Rightarrow_G^*uSv\}\). Then the following equivalences hold:

  1. \(L(G)\) is length-synchronous if, and only if, \(\mathcal{R}(G)\) is length-synchronous.

  2. \(L(G)\) is weakly length-synchronous if, and only if, \(\mathcal{R}(G)\) is weakly length-synchronous.

Proof. Let \(L=L(G)\) for a vertically visibly pushdown grammar \(G=(V,\Sigma,P,S)\). Moreover, let \((\varphi_L,\psi_L)\colon (\mathcal{O}(\Sigma),\Sigma^\triangle)\to(R_L,O_L)\) be the syntactic morphism. For all \(e\in O_L\) recall the set of contexts \(\mathcal{R}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid\psi_L(\mathop{\mathrm{ext}}_{u,v})=e\}\).

Let \(F=\{e\in O_L\mid\exists\mathop{\mathrm{ext}}_{u,v}\in\psi_L^{-1}(e) : (u,v) \in\mathcal{R}(G)\}\). Observe that \(F\) is a submonoid of \(O_L\) all of whose elements are \(\varphi_L(L)\)-reaching since \(G\) is vertically visibly pushdown. Also observe that \(\mathcal{R}(G)=\bigcup_{f \in F} \mathcal{R}_f\). We claim that since \(G\) is vertically visibly pushdown, there exists a constant \(C>0\) such that \(\frac{1}{C}\leq\frac{|x|}{|y|}\leq C\) for all \((x,y)\in\mathcal{R}(G)\setminus\{(\varepsilon,\varepsilon)\}\): indeed, one can take \(C=\frac{A}{B}\) where \(A = \max\bigl\{\max\{\mathopen{}\left|u\right|\mathclose{}, \mathopen{}\left|v\right|\mathclose{}\} \mathrel{\big|} T\rightarrow_GuT'v\bigr\}\) and \(B = \min\bigl\{\min\{\mathopen{}\left|u\right|\mathclose{}, \mathopen{}\left|v\right|\mathclose{}\} \mathrel{\big|} T\rightarrow_GuT'v\bigr\}\) since whenever \(T \Rightarrow_G^* x T' y\) thanks to a derivation comprising \(k \in \mathbb{N}_{>0}\) steps, we have \[\frac{1}{C} = \frac{k \cdot B}{k \cdot A} \leq \frac{\mathopen{}\left|x\right|\mathclose{}}{\mathopen{}\left|y\right|\mathclose{}} \leq \frac{k \cdot A}{k \cdot B} = C \,\,\text{.}\]

Next, we prove that for all \(\varphi_L(L)\)-reaching idempotents \(e\in O_L\) there exist \(g,h\in O_L\) such that \(g\circ e\circ h\in F\). Fix any such \(\varphi_L(L)\)-reaching idempotent \(e\in O_L\). Without loss of generality let us assume that \(e\) is not the identity in \(O_L\) (indeed, if \(e\) is the identity in \(O_L\), then we are done since we can then choose \(g=h=e\in F\)). Thus there exist \(g\in O_L\) and \(r\in R_L\) such that \((g\circ e)(r)\in\varphi_L(L)\). Moreover, let \(\mathop{\mathrm{ext}}_{u',v'}\in\psi_L^{-1}(g),\mathop{\mathrm{ext}}_{u,v}\in\psi_L^{-1}(e)\), and \(w\in\varphi_L^{-1}(r)\). Observe that we must have \((u,v)\not=(\varepsilon,\varepsilon)\) since \(\psi_L(\mathop{\mathrm{ext}}_{\varepsilon,\varepsilon})\) is the identity in \(O_L\). Since \(e\) is an idempotent we have that \(u'u^nwv^nv'\in L\) for all \(n\geq 1\). Fix a sufficiently large \(N\geq 1\) such that \(\frac{|u'|+|u|}{(N-1)|u|+|w|+N|v|+|v'|}\leq\frac{1}{C}\) and \(\frac{|u'|+N|u|+|w|+(N-1)|v|}{|v|+|v'|}\geq C\), which exists due to \((u,v)\not=(\varepsilon,\varepsilon)\). Since \(u'u^Nwv^Nv'\in L\) there exists \((x,y)\in\mathcal{R}(G)\setminus\{(\varepsilon,\varepsilon)\}\) such that \(xy=u'u^Nwv^Nv'\), \(S\Rightarrow_G^* xSy\), \(|x|\geq|u'u|\), and \(|y|\geq |vv'|\). Let \((x',y')\in\Sigma^*\times\Sigma^*\) be such that \((x,y)=(u'ux',y'vv')\). As \((u',v'),(u,v),(x,y)\in\mathsf{Con}(\Sigma)\), \(x'\in(\Sigma\setminus\Sigma_\text{ret})^*\), and \(y'\in(\Sigma\setminus\Sigma_\text{call})^*\), we can conclude \((x',y')\in\mathsf{Con}(\Sigma)\). That is, \((x,y)=(u',v')\circ(u,v)\circ(x',y')\in\mathcal{R}(G)\). Hence, \[g\circ e\circ\psi_L(\mathop{\mathrm{ext}}_{x',y'})=\psi_L(\mathop{\mathrm{ext}}_{u'ux',y'vv'})=\psi_L(\mathop{\mathrm{ext}}_{x,y})\in F.\]

We are now ready to prove Point 1. For the first direction, let us assume that \(L(G)\) is length-synchronous. Recalling that \(F\) is a submonoid of \(O_L\) all of whose elements are \(\varphi_L(L)\)-reaching, we obtain that \(R(G)=\bigcup_{f \in F} \mathcal{R}_f\) is length-synchronous by Lemma [lem:Length-synchronicity95subsemigroups].

Conversely, let us assume that \(\mathcal{R}(G)\) is length-synchronous. Assume by contradiction that \(L(G)\) is not length-synchronous. Hence \(\mathcal{R}_e\) is not length-synchronous for some \(\varphi_L(L)\)-reaching idempotent \(e\in O_L\), i.e. \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u',v'})=e\) for some \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v'}\in\mathcal{O}(\Sigma^\triangle)\) such that \(\Delta(u),\Delta(u')>0\) and \(\frac{|u|}{|v|}\not=\frac{|u'|}{|v'|}\). Without loss of generality we may assume that \(|v|=|v'|\) (indeed, if \(|v|\not=|v'|\), then \(\mathop{\mathrm{ext}}_{u^{|v'|},v^{|v'|}},\mathop{\mathrm{ext}}_{(u')^{|v|},(v')^{|v|}}\) satisfies the desired property). As a consequence we have \(|u|\not=|u'|\), say \(|u|<|u'|\) without loss of generality. Since \(e\) is a \(\varphi_L(L)\)-reaching idempotent, as argued above, there exist \(g,h\in O_L\) such that \(g\circ e\circ h=f'\) for some \(f'\in F\). Let us fix \(\mathop{\mathrm{ext}}_{x_h,y_h}\in\psi_L^{-1}(h)\) and \(\mathop{\mathrm{ext}}_{x_g,y_g}\in\psi_L^{-1}(g)\). We have \(\psi_L(\mathop{\mathrm{ext}}_{x_gux_h,y_hvy_g}) = f' = \psi_L(\mathop{\mathrm{ext}}_{x_gu'x_h,y_hv'y_g})\). Since \(|x_g u x_h|<|x_g u' x_h|\) and \(|y_h v y_g|=|y_h v' y_g|\) it follows that \(\mathcal{R}_{f'}\) is not length-synchronous, contradicting our assumption that \(R(G)=\bigcup_{f \in F} \mathcal{R}_f\) is length-synchronous.

Let us next prove Point 2.

Let us first assume that \(L(G)\) is weakly length-synchronous. Again, since \(F\) is a submonoid of \(O_L\) all of whose elements are \(\varphi_L(L)\)-reaching, we obtain that \(R(G)=\bigcup_{f \in F} \mathcal{R}_f\) is weakly length-synchronous by Lemma [lem:Weak95length-synchronicity95subsemigroups].

Conversely, assume \(\mathcal{R}(G)\) is weakly length-synchronous. Assume by contradiction that \(\mathcal{R}_e\) is not weakly length-synchronous for some \(\varphi_L(L)\)-reaching idempotent \(e\in O_L\). Thus, \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u',v'})=e\) for some \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v'}\in\mathcal{O}(\Sigma^\triangle)\) such that \(\Delta(u),\Delta(u')>0\) and moreover either \(u=u'\) and \(|v|\not=|v'|\) or \(v=v'\) and \(|u|\not=|u'|\). Without loss of generality let us assume that \(u=u'\) and \(|v|\not=|v'|\). As mentioned above, there exist \(g,h\in O_L\) such that \(g\circ e\circ h=f'\) for some \(f'\in F\). Fix some \(\mathop{\mathrm{ext}}_{x_g,y_g}\in\psi_L^{-1}(g)\) and some \(\mathop{\mathrm{ext}}_{x_h,y_h}\in\psi_L^{-1}(h)\). Analogously, as argued above, we have \(\psi_L(\mathop{\mathrm{ext}}_{x_gux_h,y_hvy_g})=\psi_L(\mathop{\mathrm{ext}}_{x_gux_h,y_hv'y_g})=f'\), \(\Delta(x_gux_h)>0\), and \(|y_hvy_g|\not=|y_hv'y_g|\), implying that \(\mathcal{R}_{f'}\) is not weakly length-synchronous, a contradiction to our assumption that \(\mathcal{R}(G)=\bigcup_{f\in F} \mathcal{R}_f\) is weakly length-synchronous. ◻

4.3 The nesting depth of visibly pushdown languages↩︎

Another central notion is the nesting depth of well-matched words, which is the Horton-Strahler number [28] of the underlying trees.

The nesting depth of well-matched words is given by the function \(\mathop{\mathrm{nd}}\colon \Sigma^\triangle \to \mathbb{N}\) defined inductively as follows:

  • \(\mathop{\mathrm{nd}}(\varepsilon) = 0\);

  • \(\mathop{\mathrm{nd}}(c) = 0\) for each \(c \in \Sigma_\text{int}\);

  • \(\mathop{\mathrm{nd}}(u v) = \max\{\mathop{\mathrm{nd}}(u), \mathop{\mathrm{nd}}(v)\}\) for each \(u \in \Sigma_\text{call}\Sigma^\triangle \Sigma_\text{ret}\cup \Sigma_\text{int}\) and \(v \in \Sigma^\triangle \setminus \{\varepsilon\}\);

  • \(\mathop{\mathrm{nd}}(a w b) = \begin{cases} \mathop{\mathrm{nd}}(w) + 1 & \text{if w = u v with u, v \in \Sigma^\triangle and \mathop{\mathrm{nd}}(w) = \mathop{\mathrm{nd}}(u) = \mathop{\mathrm{nd}}(v)}\\ \mathop{\mathrm{nd}}(w) & \text{otherwise} \end{cases}\) for each \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(w \in \Sigma^\triangle\).

An important property of weakly length-synchronous VPLs is that their words have bounded nesting depth.

For each weakly length-synchronous VPL \(L \subseteq \Sigma^\triangle\) there exists a constant \(d \in \mathbb{N}\) such that \(L \subseteq \{w \in \Sigma^\triangle \mid \mathop{\mathrm{nd}}(w) \leq d\}\).

Proposition [ptn:Bounded95nesting-depth] is proved in several steps. For these we introduce a factorization that can be seen as one that witnesses the nesting depth of a word.

A nesting-maximal stair factorization of \(w\in\Sigma^\triangle\) with \(\mathop{\mathrm{nd}}(w)\geq 1\) is a factorization of \(w\) as \[w = \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_{k},y_{k}} \circ \mathop{\mathrm{ext}}_{a_{k},b_{k}} (w')\] such that \(k\geq 0\), \(x_i,y_i\in\Sigma^\triangle\), \(a_i\in\Sigma_\text{call}\), and \(b_i\in\Sigma_\text{ret}\) for all \(i \in [1,l]\), and \(w' \in \Sigma_\text{int}^*\) satisfying that for all \(i \in [1, k]\) we have \[\mathop{\mathrm{nd}}(\mathop{\mathrm{ext}}_{x_i,y_i}(w_i))=\mathop{\mathrm{nd}}(w_i),\] where \(w_i=\mathop{\mathrm{ext}}_{a_i,b_i}\circ\mathop{\mathrm{ext}}_{x_{i+1},y_{i+1}}\circ\cdots\circ\mathop{\mathrm{ext}}_{a_{k},b_{k}}(w')\).

All words \(w \in \Sigma^\triangle\) have a nesting-maximal stair factorization.

Proof. The proof goes by structural induction on \(w\).

  • \(w = \varepsilon\). Then we are done because \(w\) contains only internal letters.

  • \(w = c\) for a \(c \in \Sigma_\text{int}\). Then we are again done because \(w\) contains only internal letters.

  • \(w = a w' b\) for \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(w' \in \Sigma^\triangle\). By using the inductive hypothesis, \(w'\) has a nesting-maximal stair factorization \(\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1, b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_{k},y_k}\circ\mathop{\mathrm{ext}}_{a_{k}, b_{k}} (w'')\). It directly follows that \(\mathop{\mathrm{ext}}_{a,b}\circ\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1, b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_{k},y_k}\circ\mathop{\mathrm{ext}}_{a_{k}, b_{k}} (w'')\) is a nesting-maximal stair factorization of \(w\).

  • \(w = u v\) for \(u, v \in \Sigma^\triangle \setminus \{\varepsilon\}\). Then \(w\) can be decomposed as \(z_1 \cdots z_m\) with \(z_1, \ldots, z_m \in \Sigma_\text{call}\Sigma^\triangle \Sigma_\text{ret}\cup \Sigma_\text{int}\) and \(m \in \mathbb{N}, m \geq 2\). In this case, either \(z_i \in \Sigma_\text{int}\) for all \(i \in [1, m]\) and thus we are done because \(w\) contains only internal letters, or there exists some \(i \in [1, m]\) such that \(z_i \in \Sigma_\text{call}\Sigma^\triangle \Sigma_\text{ret}\) and has maximal nesting depth, i.e.\(\mathop{\mathrm{nd}}(w) = \mathop{\mathrm{nd}}(z_i)\). In this second subcase, we have that \(z_i = a z_i' b\) with \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) and \(z_i' \in \Sigma^\triangle\). By using the inductive hypothesis, \(z_i'\) has a nesting-maximal stair factorization \(\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{ a_1, b_1}\circ \cdots \circ \mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k} (w'')\). Therefore, \[\mathop{\mathrm{ext}}_{z_1 \cdots z_{i - 1}, z_{i + 1} \cdots z_k}\circ \mathop{\mathrm{ext}}_{a,b}\circ\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ \dots\mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k}(w'')\] is a nesting-maximal stair factorization of \(w\).

 ◻

The following lemma will be a useful tool for proofs by induction on the nesting depth of well-matched words.

Let \(u=a_1vb_1\in\Sigma^\triangle\) for some \(a_1\in\Sigma_\text{call}\), \(b_1\in\Sigma_\text{ret}\), and \(v\in\Sigma^\triangle\) such that \(\mathop{\mathrm{nd}}(u)=d>0\). Moreover, let \(u=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_{k},y_{k}}\circ\mathop{\mathrm{ext}}_{a_{k},b_{k}}(u')\) be a nesting-maximal stair factorization of \(u\) (i.e. \(x_1=y_1=\varepsilon\)). Then there exists \(h\in[1,k]\) such that, setting \(u_i=\mathop{\mathrm{ext}}_{a_i,b_i}\circ\mathop{\mathrm{ext}}_{x_{i+1},y_{i+1}} \circ\cdots\circ\; \mathop{\mathrm{ext}}_{a_k,b_k}(u')\) for all \(i \in [1, k]\) and \(u_{k + 1} = u'\), we have

  1. \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(u_h)=d\),

  2. \(\mathop{\mathrm{nd}}(u_{h+1})=d-1\), and

  3. \(\mathop{\mathrm{nd}}(x_1),\mathop{\mathrm{nd}}(y_1),\dots,\mathop{\mathrm{nd}}(x_h),\mathop{\mathrm{nd}}(y_h)<d\).

Proof. Let \(u_j=\mathop{\mathrm{ext}}_{a_j,b_j}\circ\mathop{\mathrm{ext}}_{x_{j+1},y_{j+1}} \circ\cdots\circ\; \mathop{\mathrm{ext}}_{a_{k},b_{k}}(u')\) for all \(j\in[1,k]\). Note that we have \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(u_1)=d>0\) by assumption. Moreover, \(\mathop{\mathrm{nd}}(u_{j})\geq\mathop{\mathrm{nd}}(u_{j+1})\) for all \(j\in[1,k-1]\) by definition of nesting depth. Thus, since \(\mathop{\mathrm{nd}}(u_k) = 1 > 0 = \mathop{\mathrm{nd}}(u_{k + 1})\), it follows that \[h=\min\{j\in[1,k]\mid\mathop{\mathrm{nd}}(u_j)>\mathop{\mathrm{nd}}(u_{j+1})\}\] is well-defined and \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(u_1)=\mathop{\mathrm{nd}}(u_h)=d\), thus showing Point 1. Since \[d=\mathop{\mathrm{nd}}(u_h)\leq\mathop{\mathrm{nd}}(u_{h+1})+1\] and \(\mathop{\mathrm{nd}}(u_{h+1})<\mathop{\mathrm{nd}}(u_h)=d\) it follows \(\mathop{\mathrm{nd}}(u_{h+1})=d-1\), thus showing Point 2. To prove Point 3, assume by contradiction that \(\mathop{\mathrm{nd}}(x_j)\geq d\) or \(\mathop{\mathrm{nd}}(y_j)\geq d\) for some \(j\in[1,h]\). Without loss of generality assume \(\mathop{\mathrm{nd}}(x_j)\geq d\). Since \(x_1=y_1=\varepsilon\) and \(d>0\) we must have \(j\in[2,h]\). It follows \[\mathop{\mathrm{nd}}(u)\geq\mathop{\mathrm{nd}}(u_{j-1})=\mathop{\mathrm{nd}}(a_{j-1}x_ju_jy_jb_{j-1})\geq \min(\mathop{\mathrm{nd}}(x_j),\mathop{\mathrm{nd}}(u_j))+1\geq d+1>d=\mathop{\mathrm{nd}}(u)\,\,\text{,}\] which is a contradiction. ◻

We are now ready to prove Proposition [ptn:Bounded95nesting-depth].

Proof of Proposition [ptn:Bounded95nesting-depth]. Let \(L\subseteq\Sigma^\triangle\) be a weakly length-synchronous VPL. We claim that \(\mathop{\mathrm{nd}}(L)\leq n+1\), where \(n\) is the pumping constant from Lemma [lem:Ext95pumping]. Assume by contradiction that \(\mathop{\mathrm{nd}}(u)=d\) for some \(u\in L\) and some \(d>n+1\). Let \[u=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\dots\circ \mathop{\mathrm{ext}}_{x_{k},y_{k}}\circ\mathop{\mathrm{ext}}_{a_k,b_k}(u')\] be a nesting-maximal stair factorization of \(u\) according to Lemma [lem:Maximal95stair95factorization]. According to Lemma [L32nesting32induction] there exists \(i\in[1,k]\) such that, setting \[u_j=\mathop{\mathrm{ext}}_{a_j,b_j}\circ\mathop{\mathrm{ext}}_{x_{j+1},y_{j+1}}\circ\cdots\circ \mathop{\mathrm{ext}}_{a_k,b_k}(u')\] for all \(j \in [1, k]\) and \(u_{k + 1} = u'\), we have \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(u_i)=d\) and \(\mathop{\mathrm{nd}}(u_{i+1})=d-1\). Since \(d - 1 > n > 0\), we must have \(i + 1 \leq k\), so that \(u_i=a_ix_{i+1}u_{i+1}y_{i+1}b_i\) with \(u_{i+1} \in \Sigma_\text{call}\Sigma^\triangle \Sigma_\text{ret}\) and \(\mathop{\mathrm{nd}}(x_{i+1}u_{i+1}y_{i+1})=\mathop{\mathrm{nd}}(u_{i+1})=d-1\). Hence it follows that \(\mathop{\mathrm{nd}}(x_{i+1})=d-1\) or \(\mathop{\mathrm{nd}}(y_{i+1})=d-1\). Without loss of generality let us assume \(\mathop{\mathrm{nd}}(y_{i+1})=d-1>n\). A simple induction shows that \(|x|\geq 2^{\mathop{\mathrm{nd}}(x)}-1\geq\mathop{\mathrm{nd}}(x)\) for all \(x\in\Sigma^\triangle\). Thus, we have \(|y_{i+1}|\geq\mathop{\mathrm{nd}}(y_{i+1})>n\), contradicting Proposition [ptn:hill95small]. ◻

4.4 Quasi-aperiodicity and its correspondence with quasi-counterfreeness↩︎

Let us revisit the notion of quasi-aperiodicity. Towards characterizing the circuit complexity of visibly pushdown languages it has already been defined for visibly pushdown languages in [14]. Let us define \(\mathcal{O}(\Sigma^\triangle)^{k,l} = \bigl\{\mathop{\mathrm{ext}}_{u,v} \in \mathcal{O}(\Sigma^\triangle) \mathrel{\big|}\mathopen{}\left|u\right|\mathclose{} = k, \mathopen{}\left|v\right|\mathclose{} = l\bigr\}\) for all \(k,l\in\mathbb{N}\). We say the morphism \((\varphi,\psi)\colon(\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle))\to (R,O)\) is quasi-aperiodic if all semigroups contained in the set \(\psi(\mathcal{O}(\Sigma^\triangle)^{k,l})\) are aperiodic for all \(k,l\in\mathbb{N}\).

The following proposition relates quasi-counterfreeness of a VPL with quasi-aperiodicity of its syntactic morphism.

A VPL \(L\subseteq\Sigma^\triangle\) is quasi-counterfree if, and only if, its syntactic morphism is quasi-aperiodic.

Proof. Recall that \((R_L,O_L)=(\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\mathclose{}/\mathopen{}\sim_L\) by Definition [def32syntactic]. Hence for all \((u,v),(u',v')\in\mathsf{Con}(\Sigma)\) we have \((u,v)\equiv_L(u',v')\) if, and only if, \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u',v'})\).

First, let us assume that \((\varphi_L,\psi_L)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\rightarrow(R_L,O_L)\) is quasi-aperiodic. Assume by contradiction that \(L\) is not quasi-counterfree. Thus, there exists some \(\sigma=(u,v)\in\mathsf{Con}(\Sigma)\) such that \(\sigma^n\not\equiv_L\sigma^{n+1}\) for all \(n\in\mathbb{N}\) and \(\tau\equiv_L\sigma\circ\sigma\) for some \(\tau=(x,y)\in\mathsf{Con}(\Sigma)\cap\Sigma^{|u|}\times \Sigma^{|v|}\). The latter can equivalently be rephrased as \(\psi_L(\mathop{\mathrm{ext}}_{x,y})=\psi_L(\mathop{\mathrm{ext}}_{u^2,v^2})\). By choice of \(\sigma\) and the fact that \(\equiv_L\) has finite index there exist \(s\geq 1\) and \(t\geq 2\) such that \(\sigma^{s+i}\equiv_L\sigma^{s+i+t}\) for all \(i\geq 0\) and \(\sigma^{s+i}\not\equiv_L\sigma^{s+j}\) for all \(i,j\in[0,t-1]\) with \(i\not=j\). It follows that the set \(G=\psi_L(\{\mathop{\mathrm{ext}}_{u^{s+i},v^{s+i}}\mid i\in[0,t-1]\})\) is a non-trivial group with identity \(g_0=\psi_L(\mathop{\mathrm{ext}}_{u^{s+k},v^{s+k}})\in\psi_L(\mathcal{O}(\Sigma^\triangle)^{(s+k)|u|,(s+k)|v|})\), where \(k\) is the unique integer in \([0,t-1]\) such that \(s+k\) is divisible by \(t\). Also observe that \(G\) is a cyclic group that is generated by \(g_1=\psi_L(\mathop{\mathrm{ext}}_{u^{s+k+1},v^{s+k+1}})\). That is \(G=\{g_0,g_1,\dots,g_{t-1}\}\), where \(g_i=g_1^i\) for all \(i\in[2,t-1]\). But note that due to \(\psi_L(\mathop{\mathrm{ext}}_{x,y})=\psi_L(\mathop{\mathrm{ext}}_{u^2,v^2})\) we obtain \(g_1=\psi_L(\mathop{\mathrm{ext}}_{u^{s+k+1},v^{s+k+1}})=\psi_L(\mathop{\mathrm{ext}}_{xu^{s+k-1},v^{s+k-1}y})\) and thus \(g_0,g_1\in\psi_L(\mathcal{O}(\Sigma^\triangle)^{(s+k)|u|,(s+k)|v|})\) due to \(|x|=|u|\) and \(|y|=|v|\). Since \(g_i=g_0^{t-1-i}g_1^i\) for all \(i\in[0,t-1]\) we obtain that \(G=\{g_0,g_1,\dots,g_{t-1}\}\) is contained in \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{(t-1)(s+k)|u|,(t-1)(s+k)|v|})\), hereby contradicting quasi-aperiodicity of \((\varphi_L,\psi_L)\).

For the converse direction, let us assume that \(L\) is quasi-counterfree. Assume by contradiction that \((\varphi_L,\psi_L)\) is not quasi-aperiodic. That is, for some \(k,l\in\mathbb{N}\) the set \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k,l})\) contains a non-trivial group \(G\). Let \(g_0\in G\) be the identity of \(G\). Fix some \(g\in G\) with \(g\not=g_0\) and some \(\mathop{\mathrm{ext}}_{u,v}\in\mathcal{O}(\Sigma^\triangle)^{k,l}\) such that \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=g\). Let \(\sigma=(u,v)\in\mathsf{Con}(\Sigma)\cap\Sigma^k\times\Sigma^l\). Since \(g\) is not the identity in \(G\) we have that \(\psi_L(\mathop{\mathrm{ext}}_{u^n,u^n})\not=\psi_L(\mathop{\mathrm{ext}}_{u^{n+1},v^{n+1}})\) for all \(n\in\mathbb{N}\), equivalently \(\sigma^n\not\equiv_L\sigma^{n+1}\) for all \(n\in\mathbb{N}\). But since moreover \(\psi_L(\mathop{\mathrm{ext}}_{u^n,v^n})\) is in \(G\) and thus in \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k,l})\) for all \(n\in\mathbb{N}\) it follows that \(\sigma\circ\sigma\equiv_L\tau\) for some \(\tau\in\mathsf{Con}(\Sigma)\cap\Sigma^{k}\times\Sigma^{l}\). We thus obtain a contradiction to our assumption that \(L\) is quasi-counterfree. ◻

5 Proof of the main theorem↩︎

Before giving an overview of the proof of Theorem [thm32main] we will state a proposition saying that the syntactic \(\mathop{\mathrm{Ext}}\)-algebra and the syntactic morphism of a given visibly pushdown language \(L\) is computable and that it is decidable if \(L\) is quasi-aperiodic, length-synchronous, and weakly length-synchronous, respectively. Its proof is the subject of Section 6.

The following computability and decidability results hold:

  1. Given a DVPA \(A\), one can effectively compute the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of \(L = L(A)\), its syntactic morphism \((\varphi_L, \psi_L)\) and \(\varphi_L(L)\).

  2. Given a morphism \((\varphi,\psi)\colon(\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to (R,O)\) for a visibly pushdown alphabet \(\Sigma\) and a finite \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\), all of the following are decidable for \((\varphi,\psi)\):

    1. Quasi-aperiodicity. In case \((\varphi,\psi)\) is not quasi-aperiodic, one can effectively compute \(k,l\in\mathbb{N}\) such that \(\psi(\mathcal{O}(\Sigma^\triangle)^{k,l})\) is not aperiodic.

    2. \(F\)-length-synchronicity for a given \(F\subseteq R\). In case \((\varphi,\psi)\) is not \(F\)-length-synchronous, one can effectively compute a quadruple \((k,l,k',l')\in\mathbb{N}_{>0}^4\) such that there exist \(uv,u'v'\in\Sigma^\triangle\) and some \(F\)-reaching idempotent \(e\in O\) such that \(\psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u',v'})=e\), \(\Delta(u)>0\), \(\Delta(u')>0\), \(k=|u|,l=|v|,k'=|u'|\), \(l'=|v'|\), and \(\frac{k}{l}\not=\frac{k'}{l'}\).

    3. \(F\)-weakly-length-synchronicity for a given \(F\subseteq R\).

5.1 Proof outline for Theorem [thm32main]↩︎

Towards proving our main result (Theorem [thm32main]), given a DVPA \(A\), where \(L=L(A)\) is a VPL over a visibly pushdown alphabet \(\Sigma\), we apply Proposition [prop32effectivity] and compute its syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\) along with its syntactic morphism \((\varphi_L,\psi_L)\) and the subset \(\varphi_L(L)\). Then we make the following effective case distinction which immediately implies Theorem [thm32main].

  1. If \(L\) is not weakly length-synchronous, then \(L\) is \(\mathsf{TC}^0\)-hard and hence not in \(\mathsf{AC}^0\) (Proposition [prop32not32wls] in Section 5.2). Thus, we can output any \(m\geq 2\) since \(\mathrm{MOD}_m\leq_{\mathrm{cd}}\mathrm{EQUALITY}\leq_{\mathrm{cd}}L\), so \(L\) is \(\mathsf{ACC}^0(m)\)-hard for any \(m\geq 2\).

  2. If \(L\) is not quasi-aperiodic, then one can effectively compute some \(m\geq 2\) such that \(\mathrm{MOD}_m\leq_{\mathrm{cd}}L\) (Proposition [prop32notAC0] in Section 5.2), so \(L\) is \(\mathsf{ACC}^0(m)\)-hard.

  3. If \(L\) is length-synchronous and \((\varphi_L,\psi_L)\) is quasi-aperiodic, then \(L\in\mathsf{AC}^0\) (Theorem [thm:Length-sync95and95quasi-aperiodic] in Section 5.3).

  4. If \(L\) is weakly length-synchronous but not length-synchronous, and its syntactic morphism \((\varphi_L,\psi_L)\) is quasi-aperiodic, one can effectively compute vertically visibly pushdown grammars \(G_1,\dots,G_m\) generating intermediate VPLs such that \(L=_{\mathrm{cd}}\biguplus_{i\in[1,m]} L(G_i)\) (Theorem [thm32equiv32union] in Section 5.4). Moreover, already if a VPL \(L\) is weakly length-synchronous but not length-synchronous, one can effectively compute \(k, l \in \mathbb{N}_{>0}\) with \(k \neq l\) such that \(\mathcal{L}_{k, l}\leq_{\mathrm{cd}}L\) (Proposition [prop32SM32lowerbound] in Section 5.4).

We refer to Section 5.5 for the proof of Corollary [corollary32OCA].

5.2 Lower bounds↩︎

The following visibly pushdown languages are helpful for proving lower bounds.

Let \(L \subseteq \Sigma^\triangle\) be a VPL. For each \(e \in O_L\) and for \(\#\not\in\Sigma\) a fresh internal letter we define \[L_e = \{u \# v \mid (u, v) \in \mathsf{Con}(\Sigma) : \psi_L(\mathop{\mathrm{ext}}_{u, v})=e\}\] and \[\begin{align} L_{e \uparrow} & = \{u\#v\mid (u, v) \in \mathsf{Con}(\Sigma) : \Delta(u) > 0, \psi(\mathop{\mathrm{ext}}_{u,v})=e\}\\& = L_e \cap \{u\#v\mid (u, v) \in \mathsf{Con}(\Sigma) : \Delta(u) > 0\}. \end{align}\]

The next lemma shows that both \(\varphi_L^{-1}(r)\) and \(L_e\) are constant-depth reducible to \(L\) in case \(r\in R_L\) and \(e\in O_L\) are \(\varphi_L(L)\)-reaching, respectively.

Let \(L \subseteq \Sigma^\triangle\) be a VPL. Then

  • \(\varphi_L^{-1}(r) \leq_{\mathrm{cd}}L\) for all \(\varphi_L(L)\)-reaching \(r \in R_L\), and

  • \(L_e \leq_{\mathrm{cd}}L\) for all \(\varphi_L(L)\)-reaching \(e \in O_L\).

Proof. To show the first point, let us fix some \(\varphi_L(L)\)-reaching \(r\in R_L\). Thus, there exist \(w_r\in\Sigma^\triangle\) and \((u_r,v_r)\in\mathsf{Con}(\Sigma)\) such that \(\varphi_L(w_r)=r\) and \(\varphi_L(u_rw_rv_r)\in \varphi_L(L)\). By definition of the syntactic morphism of \(L\) (Definition [def32syntactic]) for all \(r_1,r_2\in R_L\) with \(r_1\not=r_2\) there exists some \(e_{r_1,r_2}\in O_L\) such that \(e_{r_1,r_2}(r_1)\in \varphi_L(L)\Leftrightarrow e_{r_1,r_2}(r_2)\not\in \varphi_L(L)\). For each such \(e_{r_1,r_2}\in O_L\) fix \((u_{r_1,r_2},v_{r_1,r_2})\in\mathsf{Con}(\Sigma)\) with \(\psi_L(\mathop{\mathrm{ext}}_{u_{r_1,r_2},v_{r_1,r_2}})=e_{r_1,r_2}\).

Hence, for all \(w\in\Sigma^*\) we have \[w\in\varphi_L^{-1}(r)\quad\Longleftrightarrow\quad u_rwv_r\in L\;\wedge\; \bigwedge_{\substack{r'\in R_L\\r\not=r'}} u_{r,r'}wv_{r,r'}\in L\leftrightarrow u_{r,r'}w_rv_{r,r'}\in L \,\,\text{,}\] thus showing \(\varphi_L^{-1}(r)\leq_{\mathrm{cd}}L\).

For the second point, let us fix some \(\varphi_L(L)\)-reaching \(e\in O_L\). Fix some \((u_e,v_e)\in\mathsf{Con}(\Sigma)\) such that \(\psi_L(\mathop{\mathrm{ext}}_{u_e,v_e})=e\). Thus, again, there exist \(w_e\in\Sigma^\triangle\) and \((u_e',v_e')\in\mathsf{Con}(\Sigma)\) such that \(\varphi_L(u_e'u_ew_ev_ev_e')\in \varphi_L(L)\). Again by definition of the syntactic morphism of \(L\) (Definition [def32syntactic]), for all \(e_1,e_2\in O_L\) with \(e_1\not=e_2\) there exist some \(f_{e_1,e_2}\in O_L\) and some \(r_{e_1,e_2}\in R_L\) such that \(f_{e_1,e_2}(e_1(r_{e_1,e_2}))\in\varphi_L(L)\Leftrightarrow f_{e_1,e_2}(e_2(r_{e_1,e_2}))\not\in\varphi_L(L)\). For each such \(f_{e_1,e_2}\) and \(r_{e_1,e_2}\) fix, respectively, \((u_{e_1,e_2},v_{e_1,e_2})\in\mathsf{Con}(\Sigma)\) and \(w_{e_1,e_2}\in\Sigma^\triangle\) such that \(\psi_L(\mathop{\mathrm{ext}}_{u_{e_1,e_2},v_{e_1,e_2}}) = f_{e_1,e_2}\) and \(\varphi_L(w_{e_1,e_2})=r_{e_1,e_2}\), respectively. Hence, for all \(u\#v\in\Sigma^*\#\Sigma^*\) we have \[u\#v\in L_e\quad\Longleftrightarrow\quad\; u_e' u w_e v v_e' \in L\;\wedge\; \bigwedge_{\substack{e'\in O_L\\e\not=e'}} u_{e,e'} u w_{e,e'} v v_{e,e'}\in L\leftrightarrow u_{e,e'} u_e w_{e,e'} v_e v_{e,e'} \in L \,\,\text{,}\] thus showing \(L_e\leq_{\mathrm{cd}}L\). ◻

The following lower bound has already been sketched in Section 4.

If \(L\) is not weakly length-synchronous, then \(L\) is \(\mathsf{TC}^0\)-hard.

Proof. Recall that \((R_L, O_L)\) is the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of \(L\) and \((\varphi_L, \psi_L)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R_L, O_L)\) is its syntactic morphism. Assume that \((\varphi_L, \psi_L)\) is not \(\varphi_L(L)\)-weakly-length-synchronous.

Assume first there exist \(\mathop{\mathrm{ext}}_{u, v}, \mathop{\mathrm{ext}}_{u', v} \in \mathcal{O}(\Sigma^\triangle)\) satisfying that \(\psi_L(\mathop{\mathrm{ext}}_{u, v}) = \psi_L(\mathop{\mathrm{ext}}_{u', v})\) that is a \(\varphi_L(L)\)-reaching idempotent such that \(\Delta(u)\), \(\Delta(u') > 0\), but \(\mathopen{}\left|u\right|\mathclose{} \neq \mathopen{}\left|u'\right|\mathclose{}\). We exploit the fact that \(\mathopen{}\left|u\right|\mathclose{} \neq \mathopen{}\left|u'\right|\mathclose{}\) to reduce \(\mathrm{EQUALITY}=\bigl\{w\in\{0,1\}^* \mathrel{\big|}|w|_0=|w|_1\bigr\}\) to \(L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\). The constant-depth reduction works as follows on input \(w \in \{0, 1\}^*\):

  1. Check if \(\mathopen{}\left|w\right|\mathclose{} = 2 n\) for some \(n \in \mathbb{N}\), reject if it is not the case.

  2. Compute \(w'=\alpha(w)\), where \(\alpha\alpha\{0,1\}^*\rightarrow \Sigma^*\) is the length-multiplying morphism satisfying \(\alpha(1)=u^{\mathopen{}\left|u'\right|\mathclose{}}\) and \(\alpha(0)=u'^{\mathopen{}\left|u\right|\mathclose{}}\).

  3. Accept whenever \(w' \# v^{n (\mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{})} \in L_{\psi(\mathop{\mathrm{ext}}_{u, v})}\).

Bearing in mind that \(0<\Delta(u)=-\Delta(v)=\Delta(u')\), the latter forms a valid reduction, because given a word \(w \in \{0, 1\}^*\) of length \(2 n\) for an \(n \in \mathbb{N}\) that contains \(k \in [0, 2 n]\) many \(1\)’s, for \(w' \# v^{n (\mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{})}\) to be in \(L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\), it is in particular required that \(w' v^{n (\mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{})}\) is well-matched, so it is necessary and sufficient that \[\begin{array}{lrll} &k \cdot \Delta(u) \cdot \mathopen{}\left|u'\right|\mathclose{} + (2 n - k) \cdot \Delta(u') \cdot \mathopen{}\left|u\right|\mathclose{} & =& -n \cdot \Delta(v) \cdot (\mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{})\\ \Longleftrightarrow\qquad& (k - n) \cdot \Delta(u) \cdot \mathopen{}\left|u'\right|\mathclose{} + (n - k) \cdot \Delta(u') \cdot \mathopen{}\left|u\right|\mathclose{} & = &0\\ \Longleftrightarrow\qquad& (k - n) \cdot \Delta(u) \cdot (\mathopen{}\left|u'\right|\mathclose{} - \mathopen{}\left|u\right|\mathclose{}) & = &0\\ \Longleftrightarrow\qquad&k & =& n \,\,\text{.} \end{array}\] Additionally applying Lemma [lemma32reduction32element] we obtain \(\mathrm{EQUALITY}\leq_{\mathrm{cd}}L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})} \leq_{\mathrm{cd}}L\). Assume now there exist \(\mathop{\mathrm{ext}}_{u, v}, \mathop{\mathrm{ext}}_{u, v'} \in \mathcal{O}(\Sigma^\triangle)\) satisfying that \(\psi_L(\mathop{\mathrm{ext}}_{u, v}) = \psi_L(\mathop{\mathrm{ext}}_{u, v'})\) is an \(\varphi_L(L)\)-reaching idempotent such that \(\Delta(u) > 0\) but \(\mathopen{}\left|v\right|\mathclose{} \neq \mathopen{}\left|v'\right|\mathclose{}\). Symmetrically, one can prove that we also have \(\mathrm{EQUALITY}\leq_{\mathrm{cd}}L\) in this case.

In conclusion, as \(\mathrm{EQUALITY}\) is \(\mathsf{TC}^0\)-complete under constant-depth reductions, it follows that \(L\) is \(\mathsf{TC}^0\)-hard under constant-depth reductions. ◻

The following proposition has essentially already been shown in [14], yet with some inaccuracies that we fix here.

If \(L\) is not quasi-aperiodic, then one can effectively compute some \(m\geq 2\) such that \(\mathrm{MOD}_m\leq_{\mathrm{cd}}L\).

Proof. Since \(L\) is not quasi-aperiodic, by Point 2 (a) Proposition [prop32effectivity] one can effectively compute \(k,l\in\mathbb{N}\) such that \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k,l})\) is not aperiodic. Thus, one can compute \(m\geq 2\) such that \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k,l})\) contains the additive group \(G=([0,m-1],+,0)\) of \(\mathbb{Z}/m\mathbb{Z}\) for some prime number \(m\). Moreover, there exist \(\mathop{\mathrm{ext}}_{u_0,v_0}, \mathop{\mathrm{ext}}_{u_1,v_1}\in\mathcal{O}(\Sigma^\triangle)^{k,l}\) such that \(\psi_L(\mathop{\mathrm{ext}}_{u_0,v_0})=0_G\) and \(\psi_L(\mathop{\mathrm{ext}}_{u_1,v_1})=1_G\). Since \(G\) is a group both \(\psi_L(\mathop{\mathrm{ext}}_{u_0,v_0})\) and \(\psi_L(\mathop{\mathrm{ext}}_{u_1,v_1})\) are \(\varphi_L(L)\)-reaching. Moreover there exist \(xy,z\in\Sigma^\triangle\) such that \(xu_0zv_0y\in L\) if, and only if, \(xu_1zv_1y\not\in L\). Let us assume without loss of generality that \(xu_0zv_0y\not\in L\) and \(xu_1zv_1y\in L\) (the case when \(xu_0zv_0y\in L\) and \(xu_1zv_1y\not\in L\) can be proven analogously). Let \(h_\uparrow,h_\downarrow\colon \{0,1\}^*\rightarrow\Sigma^*\) be the length-multiplying morphisms satisfying \(h_\uparrow(i)=u_i\) and \(h_\downarrow(i)=v_i\) for all \(i\in\{0,1\}\). We claim that \[w\in\text{MOD}_m\Longleftrightarrow \bigwedge_{i=1}^{m-1}xh_\uparrow(w)^{i^{m-2}} zh_\downarrow(w^R)^{i^{m-2}}y\not\in L.\] Let \(w_i=xh_\uparrow(w)^{i^{m-2}} zh_\downarrow(w^R)^{i^{m-2}}y\) for all \(i\in[1,m-1]\). Observe that \(w_i\in\Sigma^\triangle\) for all \(i\in[1,m-1]\) directly by definition of the morphisms \(h_\uparrow\) and \(h_\downarrow\).

To show the above equivalence, let us first assume that \(|w|_1\) is divisible by \(m\). Then we have \(\psi_L(\mathop{\mathrm{ext}}_{h^\uparrow(w),h^\downarrow(w^R)})= \psi_L(\mathop{\mathrm{ext}}_{u_0,v_0})=0_G\), and consequently \(\psi_L(\mathop{\mathrm{ext}}_{h^\uparrow(w)^{i^{m-2}},h^\downarrow(w)^{i^{m-2}}})=0_G\) for all \(i\in[1,m-1]\). It follows \(w_i\not\in L\) for all \(i\in[1,m-1]\), as desired. Conversely, assume that \(|w|_1\) is not divisible by \(m\), i.e. \(|w|_1\equiv i\text{ mod }m\) for some \(i\in[1,m-1]\). Hence \(\psi_L(\mathop{\mathrm{ext}}_{h^\uparrow(w),h^\uparrow(w^R)})=i_G\not=0_G\) and thus \(\psi_L(\mathop{\mathrm{ext}}_{h^\uparrow(w)^{i^{m-2}},h^\uparrow(w^R)^{i^{m-2}}})= (i^{m-1}\text{ mod } m)_G=1_G\) by Fermat’s Little Theorem. Hence \(w_i\in L\) as required.

Altogether we obtain \(\text{MOD}_m\leq_{\mathrm{cd}}L\). ◻

5.2.1 The non-solvable case↩︎

In this additional section we prove a stronger lower bound, namely when the syntactic morphism not only is not quasi-aperiodic but the syntactic \(\mathop{\mathrm{Ext}}\)-algebra not solvable. For this we revisit solvable groups and introduce solvable \(\mathop{\mathrm{Ext}}\)-algebras.

Let \(G\) be a finite group. The word problem for \(G\) is the question, given a word \(w_1\cdots w_n\) over \(G\), to decide if their product \(w_1\cdots w_n\) in \(G\) evaluates to \(1_G\). The commutator of \(g,h\in G\) is \(ghg^{-1}h^{-1}\in G\), denoted by \(\lbrack g,h\rbrack\). The commutator subgroup \([G,G]\) of \(G\) is the subgroup of \(G\) that is generated by the commutators of \(G\). We say that \(G\) is perfect if \(G=\lbrack G,G\rbrack\). We say that \(G\) is solvable if in the series of commutator subgroups (a.k.a. derived series) \(G^{(0)},G^{(1)},\ldots\) a trivial group is contained, where \(G^{(0)}=G\) and \(G^{(i+1)}=\lbrack G^{(i)},G^{(i)}\rbrack\) for all \(i\in\mathbb{N}\). Thus, note that any non-solvable finite group contains a perfect nontrivial subgroup.

We say the \(\mathop{\mathrm{Ext}}\)-algebra \((R,O)\) is solvable if all subsets of \(R\) or \(O\) that are groups (under the multiplication of \(R\), resp.of \(O\)) are solvable. We remark that not every subset \(G\subseteq R\) (resp. \(G\subseteq O\)) that is a group is necessarily a submonoid of \(R\) (resp. \(O\)); in particular the neutral element of \(G\) need not necessarily be the neutral element of \(O\). Indeed, for instance assume \(R=\{1,a,b\}\) where \(1\cdot r=r \cdot 1=r\) for all \(r\in R\) and where \(a\cdot b=b\cdot a=b\) and \(a\cdot a=b\cdot b=a\); the subset \(\{a,b\}\) forms the additive group of \(\mathbb{Z}/2\mathbb{Z}\) with neutral element \(a\). It is also worth mentioning that since \(R\) is (isomorphic to) a submonoid of \(O\) we could have equivalently defined an \(\mathop{\mathrm{Ext}}\)-algebra to be solvable if all subsets of \(O\) that are groups are solvable. Let us mention additionally that one can prove that if \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\rightarrow(R,O)\) is quasi-aperiodic, then \((R,O)\) is solvable. In fact, one can prove that if \((\varphi, \psi)\) is quasi-aperiodic, then \((R, O)\) must contain only Abelian groups.

Our proof that \(L\) is \(\mathsf{NC}^1\)-hard (and thus \(\mathsf{TC}^0\)-hard) when \((R_L,O_L)\) is not solvable can be reduced to the case for words [12], by showing that already \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k,l})\) contains such a non-solvable group for some fixed \(k,l\geq 0\).

If \((R_L,O_L)\) is not solvable, then \(L\) is \(\mathsf{NC}^1\)-hard and thus not in \(\mathsf{AC}^0\).

Proof of Proposition [prop32notsolvable]. Assume \((R_L,O_L)\) is not solvable. Then there exists a subset \(G\subseteq O_L\), where \(G\) is a non-trivial perfect group, i.e. \(G=\lbrack G,G\rbrack\). Let \(\omega\) be the idempotent power of \(G\). For all \(g,h\in G\) there exist \(\mathop{\mathrm{ext}}_{u_g,v_g},\mathop{\mathrm{ext}}_{u_h,v_h}\in\mathcal{O}(\Sigma^\triangle)\) such that \[\lbrack g,h\rbrack=ghg^{-1}h^{-1}=ghg^{\omega-1}h^{\omega-1}= \psi_L\left(\mathop{\mathrm{ext}}_{u_gu_hu_g^{\omega-1}u_h^{\omega-1},v_h^{\omega-1}v_g^{\omega-1}v_hv_g}\right)\] and \(1_G=g^\omega h^\omega=\psi_L(\mathop{\mathrm{ext}}_{u_g^\omega u_h^\omega,v_h^\omega v_g^\omega})\). Therefore, for all \(g,h\in G\) we have \[\lbrack g,h\rbrack=\psi_L\left( \mathop{\mathrm{ext}}_{u_gu_hu_g^{\omega-1}u_h^{\omega-1},v_h^{\omega-1}v_g^{\omega-1}v_hv_g}\circ\; \mathop{\bigcirc}_{\substack{(g',h')\in G^2\\(g',h')\not=(g,h)}} \mathop{\mathrm{ext}}_{u_{g'}^\omega u_{h'}^\omega,v_{h'}^\omega, v_{g'}^\omega}\right) \,\,\text{.}\] Hence, \(\{\lbrack g,h\rbrack \mid g,h\in G\}\subseteq\mathcal{O}(\Sigma^\triangle)^{k,l}\) for \[k=\sum_{(g,h)\in G^2}(|u_g|+|u_h|)\cdot\omega\quad\text{and}\quad l=\sum_{(g,h)\in G^2}(|v_h|+|v_g|)\cdot\omega\quad.\] Since \(G=\lbrack G,G\rbrack\) every element of \(G\) can be written as the product of at most \(|G|\) elements in \(\{\lbrack g,h\rbrack\mid g,h\in G\}\) and, in fact, even as the product of exactly \(|G|\) elements in \(\{\lbrack g,h\rbrack\mid g,h\in G\}\), since it contains the identity \(1_G\). Thus, we can conclude that \(G\subseteq\psi_L(\mathcal{O}(\Sigma^\triangle)^{k\cdot |G|,l\cdot|G|}\). Since the word problem of any non-solvable finite group is \(\mathsf{NC}^1\)-hard by [12] and \(G\subseteq\psi_L(\mathcal{O}(\Sigma^\triangle)^{k\cdot|G|,l\cdot|G|}\), it follows that the word problem for \(G\) is constant-depth reducible to \(L\). Hence \(L\) is \(\mathsf{NC}^1\)-hard and in particular \(\mathsf{TC}^0\)-hard. ◻

5.3 In \(\mathsf{AC}^0\): Length-synchronous and quasi-aperiodic↩︎

This section is devoted to the following theorem.

If \(L\) is length-synchronous and \((\varphi_L,\psi_L)\) is quasi-aperiodic, then \(L\) is in \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\) and thus in \(\mathsf{AC}^0\).

For the rest of this section let us fix a VPL \(L\), its syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\), and its syntactic morphism \((\varphi_L,\psi_L)\colon(\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\rightarrow(R_L,O_L)\).

Before we explain our proof strategy we introduce approximate matchings and horizontal and vertical evaluation languages. Approximate matchings generalize the classical matching relation on well-matched words with respect to our VPL \(L\) in the sense that they are subsets of the matching relation but must equal the matching relation on all those words that are in \(L\). Approximate matchings in the context of visibly pushdown languages were introduced by Ludwig [14]. We then introduce suitably padded word languages mimicking the evaluation problem of the monoid \(R_L\) and the monoid \(O_L\), respectively.

5.3.0.1 Approximate matchings.

For any word \(w \in \Sigma^*\), we say that two positions \(i, j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) in \(w\) are matched whenever \(i < j\), \(w_i \in \Sigma_\text{call}\), \(w_j \in \Sigma_\text{ret}\) and \(w_{i + 1} \cdots w_{j - 1} \in \Sigma^\triangle\); we also say that \(i\) is matched to \(j\) in \(w\). Observe that a word \(w\) over \(\Sigma\) is well-matched if and only if for each position \(i \in [1, \mathopen{}\left|w\right|\mathclose{}]\),

  • if \(i \in \Sigma_\text{call}\), then there exists a position \(j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(i\) is matched to \(j\) in \(w\);

  • if \(i \in \Sigma_\text{ret}\), then there exists a position \(j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(j\) is matched to \(i\) in \(w\).

Given a word \(w \in \Sigma^\triangle\), we denote by \(M^\triangle\left(w\right)\) its matching relation (or matching), that is the relation \(\{(i, j) \in [1, \mathopen{}\left|w\right|\mathclose{}]^2 \mid \text{i is matched to j in w}\}.\) An approximate matching relative to \(L\subseteq\Sigma^\triangle\) is a function \(M\colon \Sigma^* \to {\mathbb{N}_{>0}}^2\) such that \(M(w) = M^\triangle\left(w\right)\) for all \(w \in L\) and \(M(w) \subseteq M^\triangle\left(w\right)\) for all \(w \in \Sigma^*\setminus L\).

5.3.0.2 Horizontal and vertical evaluation languages.

For all \(k \in \mathbb{N}\), we define \[\mathcal{O}(\Sigma^\triangle)^{k, *} = \bigl\{\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle) \mathrel{\big|}\mathopen{}\left|u\right|\mathclose{} = k\bigr\} \quad\text{and}\quad \mathcal{O}(\Sigma^\triangle)^{*, k} = \bigl\{\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle) \mathrel{\big|}\mathopen{}\left|v\right|\mathclose{} = k\bigr\} \,\,\text{.}\] We also define \(\mathcal{O}(\Sigma^\triangle)_\uparrow = \{\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle) \mid \Delta(u) > 0\}\) and finally for all \(k \in \mathbb{N}\), we define \[\mathcal{O}(\Sigma^\triangle)^{k, *}_\uparrow = \mathcal{O}(\Sigma^\triangle)^{k, *} \cap \mathcal{O}(\Sigma^\triangle)_\uparrow \quad\text{and}\quad \mathcal{O}(\Sigma^\triangle)^{*, k}_\uparrow = \mathcal{O}(\Sigma^\triangle)^{*, k} \cap \mathcal{O}(\Sigma^\triangle)_\uparrow \,\,\text{.}\]

Consider the alphabets \(\Gamma_{\varphi_L} = \varphi_L(\Sigma^\triangle \setminus \{\varepsilon\}) \cup \{\$\}\) and \(\Gamma_{\psi_L}= \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr) \cup \{\$\}\) for a letter \(\$\notin R_L \cup O_L\). We also define \[\mathcal{V}_{\varphi_L} = \{\$^k s \mid k \in \mathbb{N}, s \in \varphi_L(\Sigma^{k+1})\}^*\; \text{and}\;\mathcal{V}_{\psi_L} = \bigl\{\$^k f \mathrel{\big|} k \in \mathbb{N}, f \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{k + 1, *}_\uparrow\bigr)\bigr\}^* \;.\] Define the \(\varphi_L\)-evaluation morphism \(\mathop{\mathrm{eval}}_{\varphi_L}\colon \Gamma_{\varphi_L}^* \to R_L\) by \(\mathop{\mathrm{eval}}_{\varphi_L}(s) = s\) for all \(s \in \varphi_L(\Sigma^\triangle \setminus \{\varepsilon\})\) and \(\mathop{\mathrm{eval}}_{\varphi_L}(\$) = 1_R\). Similarly, define the \(\psi_L\)-evaluation morphism \(\mathop{\mathrm{eval}}_{\psi_L}\colon \Gamma_{\psi_L}^* \to O_L\) by \(\mathop{\mathrm{eval}}_{\psi_L}(f) = f\) for all \(f \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\) and \(\mathop{\mathrm{eval}}_{\psi_L}(\$) = 1_{O_L}\). Finally, for all \(r \in R_L\), we set \[\mathcal{E}_{\varphi_L, r} = \mathcal{V}_{\varphi_L} \cap \mathop{\mathrm{eval}}_{\varphi_L}^{-1}(r)\] and for all \(e \in O_L\), we set \[\mathcal{E}_{\psi_L, e} = \mathcal{V}_{\psi_L} \cap \mathop{\mathrm{eval}}_{\psi_L}^{-1}(e) \,\,\text{.}\]

5.3.1 Strategy for the proof of Theorem [thm:Length-sync95and95quasi-aperiodic]↩︎

We are now ready to give the proof strategy for Theorem [thm:Length-sync95and95quasi-aperiodic]. The proof consists of the following steps.

  1. Lemma [lemma32quasi]: \(\mathcal{V}_{\varphi_L}\) and \(\mathcal{V}_{\psi_L}\) are regular languages whose syntactic morphisms are quasi-aperiodic.

  2. Proposition [ptn:Quasi-aperiodicity95eval95languages]: Let \(L\) be a VPL whose syntactic morphism \((\varphi_L, \psi_L)\) is quasi-aperiodic.

    • For all \(r \in R_L\), the language \(\mathcal{E}_{\varphi_L, r}\) is regular and its syntactic morphism is quasi-aperiodic.

    • Let \(e \in O_L\) such that \(\mathcal{R}_f = \{(u,v) \in\mathsf{Con}(\Sigma) \mid \psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is length-synchronous for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) satisfying \(e = g \circ f \circ h\) with \(g, h \in O_L\). Then \(\mathcal{E}_{\psi_L, e}\) is a regular language whose syntactic morphism is quasi-aperiodic.

  3. Proposition [ptn:Approximate95matching95length-sync]: If \(L \subseteq \Sigma^\triangle\) is length-synchronous, then there exists an \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-formula \(\mu(x, y)\) such that \(M\colon \Sigma^* \to \mathfrak{P}(\mathbb{N}_{>0}^2)\) defined by \(M(w) = \{(i, j) \in [1, \mathopen{}\left|w\right|\mathclose{}]^2 \mid w \models \mu(i, j)\}\) for all \(w \in \Sigma^*\) is an approximate matching relative to \(L\).

  4. Proposition [ptn:Eval95languages95and95bounded95nesting-depth]: Assume a VPL \(L\) has bounded nesting depth and

    • \(\mathcal{E}_{\varphi_L, r}\) is a regular language whose syntactic morphism is quasi-aperiodic for all \(\varphi_L(L)\)-reaching \(r \in R_L\), and

    • \(\mathcal{E}_{\psi_L, e}\) is a regular language whose syntactic morphism is quasi-aperiodic for all \(\varphi_L(L)\)-reaching \(e \in O_L\).

    Then there exists an \(\ifthenelse{\equal{\Sigma, \leftrightsquigarrow}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma, \leftrightsquigarrow}[\mathsf{+}] }\)-sentence \(\eta\) such that for any approximate matching \(M\) relative to \(L\), we have \(w \in L\) if, and only if, \((w, M(w)) \models \eta\) for all \(w \in \Sigma^*\).

Let us argue that Points [stp:Quasi-aperiodicity95eval95languages], [stp:Approximate95matching95length-sync] and [stp:Eval95languages95and95bounded95nesting-depth] indeed imply Theorem [thm:Length-sync95and95quasi-aperiodic] (Point [stp:Quasi-aperiodicity95verif95languages] will be used in the proof of Point [stp:Quasi-aperiodicity95eval95languages]). Length-synchronicity of \(L\) implies weak length-synchronicity of \(L\) and thus bounded nesting depth of \(L\) (Proposition [ptn:Bounded95nesting-depth]). Point [stp:Quasi-aperiodicity95eval95languages] implies the other assumptions of Point [stp:Eval95languages95and95bounded95nesting-depth]: length-synchronicity of \(L\) means by definition that for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) we have that \(\mathcal{R}_f = \{(u,v) \in \mathsf{Con}(\Sigma) \mid\psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is length-synchronous, so Point [stp:Quasi-aperiodicity95eval95languages] implies that \(\mathcal{E}_{\varphi_L,r}\) and \(\mathcal{E}_{\psi_L,e}\) are quasi-aperiodic for all \(r\in R_L\) and all \(e\in O_L\), respectively. Finally, combining the \(\ifthenelse{\equal{\Sigma, \leftrightsquigarrow}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma, \leftrightsquigarrow}[\mathsf{+}] }\)-sentence of Point [stp:Eval95languages95and95bounded95nesting-depth] with the \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-formula given by Point [stp:Approximate95matching95length-sync] that defines an approximate matching relative to \(L\) yields an \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-sentence defining \(L\), thus proving Theorem [thm:Length-sync95and95quasi-aperiodic].

5.3.2 \(\mathcal{V}_{\varphi_L}\) and \(\mathcal{V}_{\psi_L}\) are quasi-aperiodic (Proof of Point 1)↩︎

Before proving Point 1 in the proof strategy for Theorem [thm:Length-sync95and95quasi-aperiodic] we require the following auxiliary lemma. It provides an important periodicity property of \(\mathop{\mathrm{Ext}}\)-algebra morphisms.

The following periodicity holds:

  1. There exist \(t\in \mathbb{N}\) and \(p\in \mathbb{N}_{>0}\) such that \(\varphi_L(\Sigma^\triangle \cap \Sigma^i) = \varphi_L(\Sigma^\triangle \cap \Sigma^j)\) for all \(i, j \in \mathbb{N}\) satisfying \(i, j \geq t\) and \(i \equiv j \pmod{p}\).

  2. There exist \(t\in \mathbb{N}\) and \(p\in \mathbb{N}_{>0}\) such that \(\psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{i, *}_\uparrow\bigr) = \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{j, *}_\uparrow\bigr)\) for all \(i, j \in \mathbb{N}\) satisfying \(i, j \geq t\) and \(i \equiv j \pmod{p}\).

  3. There exist \(t\in \mathbb{N}\) and \(p\in \mathbb{N}_{>0}\) such that \(\psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{*, i}_\uparrow\bigr) = \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{*, j}_\uparrow\bigr)\) for all \(i, j \in \mathbb{N}\) satisfying \(i, j \geq t\) and \(i \equiv j \pmod{p}\).

Proof. To prove Point 1 recall that \(\varphi_L^{-1}(r)\) is a VPL and hence a context-free language for all \(r\in R_L\). By Parikh’s Theorem [29] it follows that \(S_r=\bigl\{|w| \mathrel{\big|}w\in\Sigma^\triangle, \varphi_L(w)=r\bigr\}\subseteq\mathbb{N}\) is a semilinear set for all \(r\in R_L\). It follows that for all \(U\subseteq R_L\) the set \(S_U=\bigl\{|w| \mathrel{\big|}w\in\Sigma^\triangle, \varphi_L(w)\in U\bigr\}\subseteq \mathbb{N}\) is semilinear since semilinear sets are closed under union. Point 1 follows immediately from this observation.

Next we prove Point 2, Point 3 can be proven analogously. According to Lemma [lemma32Le] in Section 6.0.0.0.2 for \(\#\not\in\Sigma\) the language \(L_e=\{u\#v\mid uv\in\Sigma^\triangle : \psi_L(\mathop{\mathrm{ext}}_{u,v})=e\}\) is a VPL for all \(e\in O_L\). As the language \(K=\{u\#v\mid u,v\in\Sigma^\triangle\}\) is obviously a VPL, it follows that for all \(e\in O_L\) the language \[L_{e^\uparrow}=L_e\setminus K=\{u\#v\mid uv\in\Sigma^\triangle : \psi_L(\mathop{\mathrm{ext}}_{u,v})=e, \Delta(u)>0\}\subseteq L_e\] is a VPL as well. By Lemma [lemma32semilinear] in Section 6.0.0.0.2 the set \[S_e=\{(k,l)\in\mathbb{N}\times\mathbb{N}\mid \exists u\in\Sigma ^k, v\in^l : u \# v \in L_{e^\uparrow}\}\] is semilinear as well for all \(e\in O_L\). As a consequence we obtain that for all \(Y\subseteq O_L\) the set \[S_Y=\{(k,l)\in\mathbb{N}\times\mathbb{N}\mid \exists u\in\Sigma^k, v\in\Sigma^l,e\in Y : u \# v \in L_{e^\uparrow}\}\subseteq\mathbb{N}\times\mathbb{N}\] is semilinear as well since semilinear sets are closed under union. Since for all \(Y\subseteq O_L\) the set \(\{k\in\mathbb{N}\mid \psi_L(\mathcal{O}(\Sigma^\triangle)_\uparrow^{k,*}=Y\}\) is nothing but the projection of \(S_Y\) onto the first component and semilinear sets are closed under projection, Point 2 follows. ◻

The following lemma holds irrespective of whether the syntactic morphism \((\varphi_L,\psi_L)\) of \(L\) is quasi-aperiodic or not.

\(\mathcal{V}_{\varphi_L}\), \(\mathcal{V}_{\psi_L}\) are regular languages whose syntactic morphisms are quasi-aperiodic.

Proof. Take \(t \in \mathbb{N}\) and \(p \in \mathbb{N}_{>0}\) given by Lemma [lem:Finite95Ext-algebra95morphisms95stability] such that \(\psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{i, *}_\uparrow\bigr) = \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{j, *}_\uparrow\bigr)\) for all \(i, j \in \mathbb{N}\) satisfying \(i, j \geq t\) and \(i \equiv j \pmod{p}\). Define \(\theta_{t, p}\colon \mathbb{N}\to \mathbb{N}\) as \[\theta_{t, p}(n) = \begin{cases} n & \text{if n < t}\\ \min\{n' \in \mathbb{N}\mid n' \geq t \wedge n' \equiv n \pmod{p}\} & \text{otherwise} \end{cases}\] for all \(n \in \mathbb{N}\). Take \(M\) to be the syntactic monoid of \(\mathcal{V}_{\psi_L}\) and \(h\colon \Gamma_{\psi_L}^* \to M\) to be its syntactic morphism.

If there exists \(f \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\) and \(k \in \mathbb{N}\) such that \(\$^k f \notin \mathcal{V}_{\psi_L}\), let us fix some \(f_\bot\) and \(k_\bot\) that satisfy this. Observe that for all \(k \in \mathbb{N}\), we have that \(h(\$^k) = h(\$^{\theta_{t, p}(k)})\). Further, for all \(n \in \mathbb{N}_{>0}\), \(k_1, \ldots, k_{n + 1} \in \mathbb{N}\) and \(f_1, \ldots, f_n \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\), we have \(h(\$^{k_1} f_1 \cdots \$^{k_n} f_n \$^{k_{n + 1}}) = h(\$^{\theta_{t, p}(k_1)} f_1 \alpha \$^{\theta_{t, p}(k_{n + 1})})\), where \[\alpha = \begin{cases} \varepsilon & \text{if \$^{k_2} f_2 \cdots \$^{k_n} f_n \in \mathcal{V}_{\psi_L}}\\ \$^{k_\bot} f_\bot & \text{otherwise} \,\,\text{.} \end{cases}\] Therefore, \(M\) is finite and thus \(\mathcal{V}_{\psi_L}\) is regular. Let \(l \in \mathbb{N}_{>0}\) be the stability index of \(h\) and take \(q \in\mathbb{N}_{>0}\) such that \(q\cdot l\geq t\) and \(q \cdot l \equiv 0 \pmod{p}\). By definition, we have \(h(\Gamma_{\psi_L}^l) = h(\Gamma_{\psi_L}^{q \cdot l})\). Thus, to show that \(h\) is quasi-aperiodic it is sufficient to prove that for all \(m \in h(\Gamma_{\psi_L}^{q \cdot l})\), we have \(m^2 = m^3\). Indeed, given \(m \in h(\Gamma_{\psi_L}^{q \cdot l})\), only the following three cases can occur.

  1. \(m = h(\$^{q \cdot l})\). In this case, we have \[m^2 = h(\$^{2 \cdot q \cdot l}) = h(\$^{\theta_{t, p}(2 \cdot q \cdot l)}) = h(\$^{\theta_{t, p}(q \cdot l)}) = h(\$^{q \cdot l}) = m \,\,\text{,}\] where the third equality follows from \(\theta_{t,p}(2\cdot q\cdot l)=\theta_{t,p}(q\cdot l)\).

  2. \(m = h(\$^{k_1} f \$^{k_\bot} f_\bot \$^{k_2})\) for \(f \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\) and \(k_1, k_2 \in \mathbb{N}\) satisfying \(\theta_{t, p}(k_1) = k_1\) and \(\theta_{t, p}(k_2) = k_2\). In this case, we have \[m^2 = h(\$^{k_1} f \$^{k_\bot} f_\bot \$^{k_1 + k_2} f \$^{k_\bot} f_\bot \$^{k_2}) = h(\$^{k_1} f \$^{k_\bot} f_\bot \$^{k_2}) = m \,\,\text{,}\] where the second equality follows from \(\$^{k_\bot} f_\bot \$^{k_1 + k_2} f \$^{k_\bot} f_\bot \notin \mathcal{V}_{\psi_L}\).

  3. \(m = h(\$^{k_1} f \$^{k_2})\) for \(f \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\) and \(k_1, k_2 \in \mathbb{N}\) satisfying \(\theta_{t, p}(k_1) = k_1\) and \(\theta_{t, p}(k_2) = k_2\). If \(f \in \psi_L\bigr(\mathcal{O}(\Sigma^\triangle)^{k_1 + k_2 + 1, *}_\uparrow\bigl)\), then \[m^2 = h(\$^{k_1} f \$^{k_1 + k_2} f \$^{k_2}) = h(\$^{k_1} f \$^{k_2}) = m\] because \(\$^{k_1 + k_2} f \in \mathcal{V}_{\psi_L}\). Otherwise, \(f \notin \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{k_1 + k_2 + 1, *}_\uparrow\bigr)\) and then \[m^2 = h(\$^{k_1} f \$^{k_1 + k_2} f \$^{k_2}) = h(\$^{k_1} f \$^{k_\bot} f_\bot \$^{k_2})\] because \(\$^{k_1 + k_2} f \notin \mathcal{V}_{\psi_L}\), so \[m^3 = h(\$^{k_1} f \$^{k_\bot} f_\bot \$^{k_1 + k_2} f \$^{k_2}) = h(\$^{k_1} f \$^{k_\bot} f_\bot \$^{k_2}) = m^2\] because \(\$^{k_\bot} f_\bot \$^{k_1 + k_2} f \notin \mathcal{V}_{\psi_L}\).

Therefore, \(\mathcal{V}_{\psi_L}\) is a regular language whose syntactic morphism is quasi-aperiodic. ◻

5.3.3 Quasi-aperiodicity of evaluation languages \(\mathcal{E}_{\varphi_L,r}\) and \(\mathcal{E}_{\psi_L,e}\) (Proof of Point 2)↩︎

One important consequence of Lemma [lemma32quasi] is that for all \(r \in R_L\) and \(e \in O_L\), the languages \(\mathcal{E}_{\varphi_L, r}\) and \(\mathcal{E}_{\psi_L, e}\) are in fact regular languages. The following proposition gives conditions under which those languages have moreover quasi-aperiodic syntactic morphisms when the syntactic morphism of \(L\) itself is.

Let \(L\) be a VPL whose syntactic morphism \((\varphi_L, \psi_L)\) is quasi-aperiodic.

  • For all \(r \in R_L\), the language \(\mathcal{E}_{\varphi_L, r}\) is regular and its syntactic morphism is quasi-aperiodic.

  • Let \(e \in O_L\) such that \(\mathcal{R}_f = \{(u,v) \in\mathsf{Con}(\Sigma) \mid \psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is length-synchronous for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) satisfying \(e = g \circ f \circ h\) with \(g, h \in O_L\)2. Then \(\mathcal{E}_{\psi_L, e}\) is a regular language whose syntactic morphism is quasi-aperiodic.

Proof. We already know that for all \(r \in R_L\) and \(e \in O_L\), the languages \(\mathcal{E}_{\varphi_L, r}\) and \(\mathcal{E}_{\psi_L, e}\) are regular. To prove the lemma, we then just have to prove that

  • if there exists \(r \in R_L\) such that the syntactic morphism of \(\mathcal{E}_{\varphi_L, r}\) is not quasi-aperiodic, then there exists \(k \in \mathbb{N}\) such that \(\varphi(\Sigma^\triangle \cap \Sigma^k)\) contains a semigroup that is not aperiodic;

  • if there exists \(e \in O_L\) such that the syntactic morphism of \(\mathcal{E}_{\psi_L, e}\) is not quasi-aperiodic and for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) such that there exist \(f', f'' \in O_L\) satisfying \(e = f' \circ f \circ f''\) we have that \(\mathcal{R}_f = \{(u,v) \in \Sigma^* \times \Sigma^* \mid uv\in\Sigma^\triangle, \Delta(u)>0, \psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is length-synchronous, then there exist \(k, l \in \mathbb{N}\) such that \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k, l})\) contains a semigroup that is not aperiodic.

Indeed, the first point allows to conclude that \((\varphi_L, \psi_L)\) is not quasi-aperiodic, since if there exists a non-aperiodic semigroup \(S\) contained in \(\varphi_L(\Sigma^\triangle \cap \Sigma^k)\), then \(\{\mathrm{left}_{s} \mid s \in S\}\) is a semigroup contained in \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k, 0})\) (because for each \(s \in S\), there exists \(w \in \Sigma^\triangle \cap \Sigma^k\) satisfying \(\varphi_L(w) = s\), so that \(\psi_L(\mathop{\mathrm{ext}}_{w, \varepsilon}) = \mathrm{left}_{\varphi_L(w)} = \mathrm{left}_{s}\)). But this semigroup is non-aperiodic as well, since as \(S\) is non-aperiodic, it must be that for all \(i \in \mathbb{N}_{>0}\), there exists \(s \in S\) such that \(s^i \neq s^{i + 1}\), so that \({\mathrm{left}_{s}}^i \neq {\mathrm{left}_{s}}^{i + 1}\).

We only prove the second point, the first point can be proved in a similar way by leaving out the last paragraph of the following proof, that is the sole place where we need, given an \(e \in O_L\), length-synchronicity of \(\mathcal{R}_f\) for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) such that there exist \(f', f'' \in O_L\) satisfying \(e = f' \circ f \circ f''\).

Take \(t \in \mathbb{N}\) and \(p \in \mathbb{N}_{>0}\) given by Lemma [lem:Finite95Ext-algebra95morphisms95stability] such that \(\psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{i, *}_\uparrow\bigr) = \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{j, *}_\uparrow\bigr)\) for all \(i, j \in \mathbb{N}\) satisfying \(i, j \geq t\) and \(i \equiv j \pmod{p}\).

Assume there exists \(e \in O_L\) such that the syntactic morphism of \(\mathcal{E}_{\psi_L, e}\) is not quasi-aperiodic. Take \(M\) to be the syntactic monoid of \(\mathcal{E}_{\psi_L, e}\) and \(h\colon \Gamma_{\psi_L}^* \to M\) to be its syntactic morphism. Let \(s \in \mathbb{N}_{>0}\) be the stability index of \(h\) and let \(\omega \geq 2\) be a multiple both of the idempotent power of \(M\) and the idempotent power of \(O_L\). Non-quasi-aperiodicity of \(h\) implies that there exists \(g \in h(\Gamma_{\psi_L}^s)\) satisfying \(g^\omega \neq g^{\omega + 1}\).

By definition of the stability index, there exists \(w \in \Gamma_{\psi_L}^{q \cdot s}\) for \(q \in \mathbb{N}_{>0}\) such that \(q \cdot s \geq t\) and \(q \cdot s \equiv 0 \pmod{p}\) satisfying \(h(w) = g\). Since \(t \leq q \cdot s \leq q \cdot s \cdot \omega \leq q \cdot s \cdot (\omega + 1)\) and \(q \cdot s \equiv q \cdot s \cdot \omega \equiv q \cdot s \cdot (\omega + 1) \pmod{p}\), we cannot have \(w = \$^{q \cdot s}\), for otherwise we would have \(g^\omega = h(\$^{q \cdot s \cdot \omega}) = h(\$^{q \cdot s \cdot (\omega + 1)}) = g^{\omega + 1}\) because \(\psi_L\bigl( \mathcal{O}(\Sigma^\triangle)^{q \cdot s \cdot \omega + k + 1, *}_\uparrow \bigr) = \psi_L\bigl( \mathcal{O}(\Sigma^\triangle)^{q \cdot s \cdot (\omega + 1) + k + 1, *}_\uparrow \bigr)\) for all \(k \in \mathbb{N}\). Therefore, we have \(w = \$^{k_1} f_1 \cdots \$^{k_n} f_n \$^{k_{n + 1}}\) for \(n \in \mathbb{N}_{>0}\), \(k_1, \ldots, k_{n + 1} \in \mathbb{N}\) and \(f_1, \ldots, f_n \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\). Since \(g^\omega \neq g^{\omega + 1}\), there exist \(x, y \in \Gamma_{\psi_L}^*\) such that either \(x w^\omega y \in \mathcal{E}_{\psi_L, e}\) and \(x w^{\omega + 1} y \notin \mathcal{E}_{\psi_L, e}\), or \(x w^\omega y \notin \mathcal{E}_{\psi_L, e}\) and \(x w^{\omega + 1} y \in \mathcal{E}_{\psi_L, e}\). Assume the first case holds. Then we have \(x = x' \$^{k_x}\) and \(y = \$^{k_y} y'\) with \(k_x, k_y \in \mathbb{N}\) and \(x', y' \in \Gamma_{\psi_L}^*\) satisfying \(x', \$^{k_x + k_1} f_1, \$^{k_2} f_2, \ldots, \$^{k_n} f_n, \$^{k_{n + 1} + k_1} f_1, \$^{k_{n + 1} + k_y} y' \in \mathcal{V}_{\psi_L}\) and \(\mathop{\mathrm{eval}}_{\psi_L}(x')\circ (f_1 \circ \cdots \circ f_n)^\omega \circ \mathop{\mathrm{eval}}_{\psi_L}(y') = e\). Therefore, we also have \(x w^{\omega + 1} y \in \mathcal{V}_{\psi_L}\), hence since \(x w^{\omega + 1} y \notin \mathcal{E}_{\psi_L, e}\) we necessarily have \[\begin{align} e & = \mathop{\mathrm{eval}}_{\psi_L}(x') \circ (f_1 \circ \cdots \circ f_n)^\omega \circ \mathop{\mathrm{eval}}_{\psi_L}(y')\\ & \neq \mathop{\mathrm{eval}}_{\psi_L}(x w^{\omega + 1} y) = \mathop{\mathrm{eval}}_{\psi_L}(x') \circ (f_1 \circ \cdots \circ f_n)^{\omega + 1} \circ \mathop{\mathrm{eval}}_{\psi_L}(y') \,\,\text{.} \end{align}\] Thus we have \((f_1 \circ \cdots \circ f_n)^\omega \neq (f_1 \circ \cdots \circ f_n)^{\omega + 1}\) and \(\$^{k_{n + 1} + k_1} f_1 \$^{k_2} f_2 \cdots \$^{k_n} f_n \in \mathcal{V}_{\psi_L}\). This is also true for the case when \(x w^\omega y \notin \mathcal{E}_{\psi_L, e}\) and \(x w^{\omega + 1} y \in \mathcal{E}_{\psi_L, e}\).

Therefore, we have \((f_1 \circ \cdots \circ f_n)^\omega \neq (f_1 \circ \cdots \circ f_n)^{\omega + 1}\) with \[(f_1 \circ \cdots \circ f_n)^i \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{q \cdot s \cdot i, *}_\uparrow\bigr) = \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{q \cdot s, *}_\uparrow\bigr)\] for each \(i \in \mathbb{N}_{>0}\) because \(k_{n + 1} + k_1 + \cdots + k_n + n = q \cdot s \geq t\) and \(k_{n + 1} + k_1 + \cdots + k_n + n = q \cdot s \equiv 0 \pmod{p}\). But given \(\omega'\) the idempotent power of \(\{(f_1 \circ \cdots \circ f_n)^i \mid i \in \mathbb{N}_{>0}\}\), we have that \((f_1 \circ \cdots \circ f_n)^\omega = (f_1 \circ \cdots \circ f_n)^{\omega \omega'} = (f_1 \circ \cdots \circ f_n)^{\omega'}\), so that \((f_1 \circ \cdots \circ f_n)^{\omega'} \neq (f_1 \circ \cdots \circ f_n)^{\omega' + 1}\), hence \(\{(f_1 \circ \cdots \circ f_n)^i \mid i \in \mathbb{N}_{>0}\}\) is not aperiodic.

Assume additionally that for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) such that there exist \(f', f'' \in O_L\) satisfying \(e = f' \circ f \circ f''\) we have that \(\mathcal{R}_f = \{(u,v) \in \Sigma^* \times \Sigma^* \mid uv\in\Sigma^\triangle, \Delta(u)>0, \psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is length-synchronous. For each \(i \in \mathbb{N}_{>0}\), let \(\mathop{\mathrm{ext}}_{u_i, v_i} \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)^{q \cdot s, *}_\uparrow\bigr)\) such that \(\psi_L(\mathop{\mathrm{ext}}_{u_i, v_i}) = (f_1 \circ \cdots \circ f_n)^i\). If \((f_1 \circ \cdots \circ f_n)^\omega\) were not \(\varphi_L(L)\)-reaching, then it would imply that \(\mathop{\mathrm{ext}}_{u_\omega, v_\omega}\) is not \(L\)-reaching. This would in turn entail that for all \(z \in \Sigma^\triangle\) and \(\mathop{\mathrm{ext}}_{\alpha, \beta} \in \mathcal{O}(\Sigma^\triangle)\) we have \[\mathop{\mathrm{ext}}_{\alpha, \beta}(\mathop{\mathrm{ext}}_{u_\omega, v_\omega}(z)) \notin L \wedge \mathop{\mathrm{ext}}_{\alpha, \beta}(\mathop{\mathrm{ext}}_{u_1 u_\omega, v_\omega v_1}(z)) = \mathop{\mathrm{ext}}_{\alpha u_1, v_1 \beta}(\mathop{\mathrm{ext}}_{u_\omega, v_\omega}(z)) \notin L \,\,\text{,}\] so that it would follow that \[(f_1 \circ \cdots \circ f_n)^\omega = \psi_L(\mathop{\mathrm{ext}}_{u_\omega, v_\omega}) = \psi_L(\mathop{\mathrm{ext}}_{u_1 u_\omega, v_\omega v_1}) = (f_1 \circ \cdots \circ f_n)^{\omega + 1}\,\,\text{,}\] a contradiction. Hence, since \((f_1 \circ \cdots \circ f_n)^\omega\) is a \(\varphi_L(L)\)-reaching idempotent and \[e = \begin{cases} \mathop{\mathrm{eval}}_{\psi_L}(x') \circ (f_1 \circ \cdots \circ f_n)^\omega \circ \mathop{\mathrm{eval}}_{\psi_L}(y') & \text{if x w^\omega y \in \mathcal{E}_{\psi_L, e} and x w^{\omega + 1} y \notin \mathcal{E}_{\psi_L, e}}\\ \mathop{\mathrm{eval}}_{\psi_L}(x') \circ (f_1 \circ \cdots \circ f_n)^{\omega + 1} \circ \mathop{\mathrm{eval}}_{\psi_L}(y') & \text{o/w (x w^\omega y \notin \mathcal{E}_{\psi_L, e} and x w^{\omega + 1} y \in \mathcal{E}_{\psi_L, e})} \end{cases} \!\text{,}\] it follows that \(\mathcal{R}_{(f_1 \circ \cdots \circ f_n)^\omega}\) is length-synchronous. So for all \(i \in \mathbb{N}, i \geq 2\), since \(\psi_L(\mathop{\mathrm{ext}}_{u_1^\omega, v_1^\omega}) = \psi_L(\mathop{\mathrm{ext}}_{u_i^\omega, v_i^\omega}) = (f_1 \circ \cdots \circ f_n)^\omega\) with \(\Delta(u_1^\omega) > 0\) and \(\Delta(u_i^\omega) > 0\), since \(\mathopen{}\left|u_1\right|\mathclose{} = \mathopen{}\left|u_i\right|\mathclose{}\), we have \[\frac{\mathopen{}\left|u_1^\omega\right|\mathclose{}}{\mathopen{}\left|v_1^\omega\right|\mathclose{}} = \frac{\mathopen{}\left|u_i^\omega\right|\mathclose{}}{\mathopen{}\left|v_i^\omega\right|\mathclose{}} \Rightarrow \frac{\mathopen{}\left|u_1\right|\mathclose{}}{\mathopen{}\left|v_1\right|\mathclose{}} = \frac{\mathopen{}\left|u_i\right|\mathclose{}}{\mathopen{}\left|v_i\right|\mathclose{}} \Rightarrow \mathopen{}\left|v_1\right|\mathclose{} = \mathopen{}\left|v_i\right|\mathclose{} \,\,\text{.}\] To conclude, we obtain that the non-aperiodic semigroup \(\{(f_1 \circ \cdots \circ f_n)^i \mid i \in \mathbb{N}_{>0}\}\) is contained in \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{q \cdot s, \mathopen{}\left|v_1\right|\mathclose{}})\). ◻

The following remark states that the length-synchronicity precondition in the second point of Proposition [ptn:Quasi-aperiodicity95eval95languages] is important. In fact it shows that weak length-synchronicity is not sufficient.

For the second point of Proposition [ptn:Quasi-aperiodicity95eval95languages] it is generally not sufficient to assume, given \(e\), that for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) such that there exist \(g, h \in O_L\) satisfying \(e = g \circ f \circ h\) we have that \(\mathcal{R}_f = \{(u,v) \in \Sigma^* \times \Sigma^* \mid uv\in\Sigma^\triangle, \Delta(u)>0, \psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is weakly length-synchronous. Indeed, the VPL \(K\) generated by the grammar with rules \[\begin{align} S & \rightarrow a S b_1 \mid ac T b_2 \mid \varepsilon\\ T & \rightarrow a T b_1 \mid ac S b_2 \,\,\text{.} \end{align}\] using \(S\) as start symbol is not length-synchronous, but weakly length-synchronous, and has a quasi-aperiodic syntactic morphism. However, for the syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_K, O_K)\) and the syntactic morphism \((\varphi_K, \psi_K)\) of \(K\), we claim that there exists a \(\varphi_K(K)\)-reaching \(e \in O_K\) such that \(\mathcal{E}_{\psi_K, e}\) is a regular language whose syntactic morphism is not quasi-aperiodic while, as \(K\) is weakly length-synchronous, for each \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) we have that \(\mathcal{R}_f = \{(u,v) \in \Sigma^* \times \Sigma^* \mid uv\in\Sigma^\triangle, \Delta(u)>0, \psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is weakly length-synchronous.

Let \(\Gamma\) be the visibly pushdown alphabet of \(K\). Note that we have \(K\subset \mathcal{L}_{1,2}\), where \(\mathcal{L}_{1,2}=L(S\rightarrow aSb_1|acSb_2|\varepsilon)\) is the VPL initially introduced in Example [example32SM]. For all \(uv, u'v' \in \mathcal{L}_{1,2}\) with \(u, u' \in \{a, c\}^+\), \(v, v' \in \{b_1, b_2\}^+\), \(\mathopen{}\left|u\right|\mathclose{}_c \equiv \mathopen{}\left|u'\right|\mathclose{}_c \pmod{2}\) we have \(x u z v y \in K \Leftrightarrow x u' z v' y \in K\) for all \(x y, z \in \Gamma^\triangle\). This implies that if we set \(e_0 = \psi_K(\mathop{\mathrm{ext}}_{a, b_1})\) and \(e_1 = \psi_K(\mathop{\mathrm{ext}}_{a c, b_2})\), we have that for all \(u v \in \mathcal{L}_{1, 2}\) with \(u \in \{a, c\}^+\), \(v \in \{b_1, b_2\}^+\), it holds that \(\psi_K(\mathop{\mathrm{ext}}_{u, v}) = e_{\mathopen{}\left|u\right|\mathclose{}_c\!\! \mod 2}\). Therefore, while \(e_0 \neq e_1\), we have \(e_0 \circ e_1 = e_1 \circ e_0 = e_1\) and \(e_0 \circ e_0 = e_1 \circ e_1 = e_0\).

Consider the length-multiplying monoid morphism \(\beta\colon \{0, 1\}^* \to \Gamma_{\psi_K}^*\) such that \(\beta(0) = e_0 e_0\) and \(\beta(1) = \$ e_1\). Then \(\mathrm{MOD}_2 = \beta^{-1}(\mathcal{E}_{\psi_K, e_0})\), so \(\mathcal{E}_{\psi_K, e_0}\) cannot have a quasi-aperiodic syntactic morphism, for otherwise, by closure of the class of regular languages whose syntactic morphism is quasi-aperiodic under inverses of length-multiplying morphisms (see [27]), we would have that \(\mathrm{MOD}_2\) has a quasi-aperiodic syntactic morphism.

5.3.4 Approximate matching relation in \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\) (Proof of Point 3)↩︎

The following proposition states that there is a \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-definable approximate matching relative to any length-synchronous visibly pushdown language.

If \(L \subseteq \Sigma^\triangle\) is length-synchronous, then there exists an \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-formula \(\eta(x, y)\) such that \(M\colon \Sigma^* \to \mathfrak{P}(\mathbb{N}_{>0}^2)\) defined by \(M(w) = \{(i, j) \in [1, \mathopen{}\left|w\right|\mathclose{}]^2 \mid w \models \eta(i, j)\}\) for all \(w \in \Sigma^*\) is an approximate matching relative to \(L\).

The technical heart of the proof is the following lemma whose proof is postponed and will take most part of this subsubsection. This lemma realizes the characterization of length-synchronicity given by Proposition [ptn:Length-synchronicity95equivalences] via an \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-formula.

Assume that \((\varphi_L,\psi_L)\) is weakly length-synchronous. Let \(e \in O_L\) be \(\varphi_L(L)\)-reaching and assume that \(\mathcal{U}_e=\{(u,v) \in\mathsf{Con}(\Sigma)\mid e\circ\psi_L(\mathop{\mathrm{ext}}_{u,v})=e\}\) is length-synchronous. Then there exists an \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-formula \(\pi_e(x, x', y', y)\) such that for all \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\) the following holds,

  • if \(w\models \pi_e(i, i', j', j)\), then \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) and

  • if \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) and \((w_i\dots w_{i'},w_{j'}\dots w_j)\in \mathcal{U}_e\), then \(w\models \pi_e(i, i', j', j)\).

5.3.4.1 Building an approximate matching assuming predicates \(\pi_e\).

Let us prove Proposition [ptn:Approximate95matching95length-sync] by making use of Lemma [lem:Synchronous95element95matching].

Proof of Proposition [ptn:Approximate95matching95length-sync].. By assumption \((\varphi_L, \psi_L)\) is \(\varphi_L(L)\)-length-synchronous. Thus, the set of contexts \(\mathcal{U}_e\) is length-synchronous for all \(\varphi_L(L)\)-reaching \(e\in O_L\) by Proposition [prop32length32synchronous]. Moreover, there exists \(d_L \in \mathbb{N}\) bounding the nesting depth of the words in \(L\) Proposition [ptn:Bounded95nesting-depth]. For defining our desired formula \(\mu\), we will construct \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\) formulas \(\mu_d\) and \(\mu_d^\uparrow\) for all \(0\leq d\leq d_L\) with the following properties: for all \(w \in \Sigma^+\) and for all \(i, j \in [1, \mathopen{}\left|w\right|\mathclose{}]\), we have

  • if \(w\models \mu_d^\uparrow(i,j)\) or \(w\models\mu_d(i,j)\), then \(w_i \cdots w_j \in \Sigma^\triangle\),

  • if \(w\in L\), \(w_i\dots w_j\in\Sigma^\triangle\), \(\mathop{\mathrm{nd}}(w_i\dots w_j)\leq d\) and \(i\) is matched to \(j\) in \(w\), then \(w\models \mu_d^\uparrow(i,j)\), and

  • if \(w\in L\), \(\mathop{\mathrm{nd}}(w_i\dots w_j)\leq d\) and \(w_i\dots w_j\in\Sigma^\triangle\), then \(w\models\mu_d(i,j)\).

We therefore define \(\mu=\mu_{d_L}\). The construction of \(\mu_d^\uparrow\) and \(\mu_d\) is by induction on \(d\). We set \[\mu_0(i,j)=\bot \text{ and } \mu_0(i,j)=\forall z \bigl(x \leq z \leq y \rightarrow \Sigma_\text{int}(z)\bigr).\] Let us assume \(d>0\). The formula \(\mu_d\) is easily defined assuming \(\mu_d^\uparrow\). We define \[\begin{align} \mu_d(x,y)&\!\!=\!\!&\forall z\biggl[x\leq z\leq y\rightarrow\\ &&\quad\Bigl(\Sigma_\text{int}(z)\vee\exists z'\bigl( \begin{aligned}[t] & (\Sigma_\text{call}(z)\wedge\Sigma_\text{ret}(z')\wedge \mu_d^\uparrow(z,z'))\vee\\ & (\Sigma_\text{call}(z')\wedge\Sigma_\text{ret}(z)\wedge \mu_d^\uparrow(z',z)) \bigr)\Bigr)\biggl] \,\,\text{.} \end{aligned} \end{align}\] It remains to define \(\mu_d^\uparrow\). Let us assume \(u=w_i\dots w_j\in\Sigma^\triangle\), that \(i\) is matched to \(j\) in \(w\) and that \(\mathop{\mathrm{nd}}(u)=d>0\). Hence, \(u=a_1vb_1\in\Sigma^\triangle\) for some \(a_1\in\Sigma_\text{call}\), \(b_1\in\Sigma_\text{ret}\), and \(v\in\Sigma^\triangle\). We then apply Lemma [L32nesting32induction] which states that \(u\) has a nesting-maximal stair factorization \(u=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\dots \mathop{\mathrm{ext}}_{x_{k},y_{k}}\circ\mathop{\mathrm{ext}}_{a_{k},b_{k}}(u')\) such that for some \(h\in[1,k]\), setting \(u_\ell=\mathop{\mathrm{ext}}_{a_\ell,b_\ell}\circ\mathop{\mathrm{ext}}_{x_{\ell+1},y_{\ell+1}} \circ\cdots\circ\; \mathop{\mathrm{ext}}_{a_k,b_k}(u')\) for all \(\ell \in [1, k]\) and \(u_{k + 1} = u'\), we have

  1. \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(u_h)=d\),

  2. \(\mathop{\mathrm{nd}}(u_{h+1})=d-1\), and

  3. \(\mathop{\mathrm{nd}}(x_1),\mathop{\mathrm{nd}}(y_1),\dots,\mathop{\mathrm{nd}}(x_h),\mathop{\mathrm{nd}}(y_h)<d\).

We remark that \(x_1=y_1=\varepsilon\). Let \(i=i_1<\dots<i_h\) and \(j_h<\dots<j_1=j\) be the positions that correspond to the positions of the letters \(a_1,\dots,a_h\in\Sigma_\text{call}\) and \(b_1,\dots, b_h\in\Sigma_\text{ret}\) of \(u\) in \(w\), respectively: more precisely \(i_\ell=i+\mathopen{}\left|x_1\cdots a_{\ell-1}x_\ell\right|\mathclose{}\) and \(j_\ell=\mathopen{}\left|x_1a_1\cdots x_ka_ku'b_ky_k\cdots b_{\ell+1}y_{\ell+1}\right|\mathclose{}+1\) for all \(\ell\in[1,h]\). The formula \(\mu_{d}^\uparrow\) could guess the positions \(i=i_1<\dots<i_h\) and \(j_h<\dots<j_1=j\) and verify the following (recalling that \(x_1=y_1=\varepsilon\)):

(a) the infix \(w_{i_h+1}\cdots w_{j_h-1}=\mathop{\mathrm{ext}}_{x_{h+1},y_{h+1}}(u_{h+1})\) is well-matched, and

(b) the word \(w_{i_1}\cdots w_{i_{h}} w_{j_h}\cdots w_{j_1}\) is well-matched.

Point (a) can be realized via the formula \(\mu_{d-1}\) by making use of Point 2 from above, whereas Point (b) can be realized by the following ad-hoc formula, this time making use of Point 3 and from above: \[\kappa_h(x,x',y',y)=\exists x_1\cdots x_h\exists y_1\cdots y_h \biggl( \begin{align}[t] & x=x_1\wedge x'=x_h\wedge y'=y_h\wedge y=y_h\wedge\\ & \bigwedge_{t=1}^h \bigl(\Sigma_\text{call}(x_t)\wedge \Sigma_\text{ret}(y_t)\bigr)\wedge\\ & \bigwedge_{t=1}^{h-1} \bigl(\mu_{d-1}(x_t+1,x_{t+1}-1)\wedge \mu_{d-1}(y_{t+1}+1,y_t-1)\bigr) \biggr) \text{.} \end{align}\]

The problem with this approach is that the size of the formula depends on the size of \(w\). For instance, for \(a\in\Sigma_\text{call}\), \(b\in\Sigma_\text{ret}\), \(c\in\Sigma_\text{int}\), and \(u=a^ncb^n\) we have \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(acb)=1\) for all \(n\geq 1\). Hence we would have \(h=n-1\), so \(h\) would depend on \(u\) which is problematic. Therefore, towards expressing Point (b) by a formula whose size only depends on \(|O_L|\), let us define, for all \(\ell,\ell'\in[1,h]\), the product \[e_{\ell,\ell'}=\psi_L(\mathop{\mathrm{ext}}_{x_\ell,y_\ell}\circ \mathop{\mathrm{ext}}_{a_{\ell},b_{\ell}}\cdots\mathop{\mathrm{ext}}_{x_{\ell'},y_{\ell'}} \circ\mathop{\mathrm{ext}}_{a_{\ell'},b_{\ell'}})\quad\text{and}\quad e_\ell=e_{1,\ell}.\] We remark that all \(e_{\ell,\ell'}\) are \(\varphi_L(L)\)-reaching since \(w\) is assumed to be in \(L\). We say an interval \(I=[s,t]\subseteq[1,h]\) is repetitive if \(s<t\) and \(e_s=e_t\).

There exist indices \(1=t_0\leq s_1<t_1<s_2<t_2<\cdots <s_q<t_q\leq s_{q+1}=h\) such that \([s_1,t_1],\dots, [s_q,t_q]\) are all repetitive and for \(D_0=[t_0,s_1],D_1=[t_1,s_2],\dots,D_q=[t_q,s_{q+1}]\) we have \(q+\sum_{p=0}^q|D_p|\leq 3\left|O_L\right|\).

Proof of the Claim. For all \(z\in[1,h]\) let \(\lambda(z)=\max\{\ell\in[1,h]\mid e_\ell=e_z\}\). Observe \(\lambda(z)\geq z\) for all \(z\in[1,h]\) and that \(|\lambda([1,h])|\leq|O_L|\). We define \(t_0=1\). Let \(p>0\) and assume that we have already defined \(t_{p-1}\). In case \(t_{p-1}=h\) we are done and define \(q=p-1\) and \(s_{q+1}=h\). So let us assume \(t_{p-1}<h\). In case there exists \(z\in[t_{p-1},h]\) such that \(z<\lambda(z)\) we define \(s_p=\min\{z\in[t_{p-1},h]\mid z<\lambda(z)\}\) and \(t_p=\lambda(s_p)\), otherwise (i.e.in case \(z=\lambda(z)\) for all \(z\in[t_{p-1},h]\)) we are done and define \(q=p-1\) and \(s_{q+1}=h\). Immediately by definition we have \(1=t_0\leq s_1<t_1<s_2<t_2<\dots<s_q<t_q\leq s_{q+1}=h\) (because if we had \(t_{p-1} = s_p\) for a \(p \in [2, q]\), we would have \(e_{s_{p-1}} = e_{t_{p-1}} = e_{s_p}\), so \(\lambda(s_p) = \lambda(s_{p-1}) = t_{p-1} = s_p < \lambda(s_p)\), a contradiction) and \(e_{s_p}=e_{t_p}\) for all \(p \in [1, q]\). Moreover, the intervals \([s_1,t_1],\dots,[s_q,t_q]\) are indeed all repetitive. Since moreover \(t_p\in\lambda([1,h])\) for all \(p\in[1,q]\) and \(|\lambda([1,h])|\leq|O_L|\) we must have \(q\leq|O_L|\). Now let \(D_0=[t_0,s_1],D_1=[t_1,s_2],\dots,D_q=[t_q,s_{q+1}]\). Clearly, these sets are pairwise disjoint. Moreover, by construction, the only elements \(z \in \bigcup_{p = 0}^q D_p\) such that \(z < \lambda(z)\) are those in \(X=\{s_1, \ldots, s_q\}\), so that all elements \(z \in (\bigcup_{p = 0}^q D_p) \setminus X\) satisfy \(z=\lambda(z)\), i.e.are elements from \(\lambda([1,h])\). Thus, we obtain \(q+\sum_{p=0}^{q}\left|D_p\right| = q + \left|\bigcup_{p=0}^q D_p\right| \leq \left|O_L\right|+\left|X\right|+\left|\lambda([1,h])\right|=3\left|O_L\right|\). 0◻

Let \(1=t_0\leq s_1<t_1<s_2<t_2<\cdots< s_q<t_q\leq s_{q+1}=h\) be the indices satisfying Claim [claim32pigeon] along with \(D_0=[t_0,s_1],D_1=[t_1,s_2],\dots,D_q=[t_q,s_{q+1}]\). Let \(d_p=|D_p|\) for all \(p\in[0,q]\). Since, for all \(p\in[1,q]\), the non-empty interval \([s_p,t_p]\) is repetitive, we have \(e_{s_p}=e_{t_p}\) and thus obtain \[e_{s_p}=e_{t_p}= e_{s_p}\circ \psi_L(\mathop{\mathrm{ext}}_{x_{s_p+1}\cdots a_{t_p},b_{t_p}\cdots y_{s_p+1}}).\] Hence, we have \(w\models\pi_{e_{s_p}}(i_{s_p}+1,i_{t_p},j_{t_p},j_{s_p}-1)\) where \(\pi_{e_{s_p}}\) is the formula given by Lemma [lem:Synchronous95element95matching] (recall that \(e_{s_p}\) is \(\varphi_L(L)\)-reaching and that \(\mathcal{U}_{e_{s_p}}\) is length-synchronous). We can therefore use the formula \(\pi_{e_{s_p}}\) to witness that \(w_{i_{s_p}+1}\cdots w_{i_{t_p}}w_{j_{t_p}}\cdots w_{j_{s_p}-1}\) is indeed a well-matched word. It will thus remain to verify that \(w_{i_{t_p}}\cdots w_{i_{s_{p+1}}}w_{j_{s_{p+1}}}\cdots w_{i_{t_p}}\) is well-matched for all \(p\in[0,q]\): this can be guaranteed by evaluating \(\kappa_{d_p}(i_{t_p},i_{s_{p+1}},j_{s_{p+1}},i_{t_p})\). We can now define our final formula \(\mu_d^\uparrow\): \[\begin{align} \mu_d^\uparrow(x,y) = & \bigvee_{\substack{q\in[0,|O_L|]\\ d_0,\dots,d_q\geq 1:\\ q+d_0+\dots+d_q\leq 3|0|}}\exists x_1\dots x_{q+1}\exists x_0'\dots x_q' \exists y_1\dots y_{q+1}\exists y_1'\dots y_0'\\ & \biggl[ \begin{aligned}[t] & x_0\leq x_1<x_1'<x_2<\dots<x_q'<y_q'<y_q<\dots<y_1'<y_1\leq y_0'\wedge \\ & x_0'=x\wedge y_0'=y\wedge \mu_{d-1}(x_{q+1}+1,y_{q+1}-1)\wedge\\ & \bigwedge_{p=1}^q\left(\bigvee_{e\in O_L \text{ \varphi_L(L)-reaching}} \pi_e(x_p+1,x_p',y_p',y_p-1)\right) \wedge\\ & \bigwedge_{p=0}^{q} \kappa_{d_p}(x_p',x_{p+1},y_{p+1},y_p') \biggr] \,\,\text{.} & \qedhere \end{aligned} \end{align}\] ◻

The following remark is obvious but will be important in Section 5.4.

When constructing our predicate \(\mu_{d}^\uparrow\), we could have replaced any subset of the predicates \(\pi_e\), where \(e\) is \(\varphi_L(L)\)-reaching from above, by the predicate \(\pi_e^{\textsf{exact}}\) expressing that for all \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\) it holds: \[\begin{align} w\models\pi_e^{\textsf{exact}}(i,i',j',j)& \;\Longleftrightarrow\;& w_i\dots w_{i'}w_{j'}\dots w_{j}\in\Sigma^\triangle, e\circ\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j})=e, \text{ and }\\&&\Delta(w_i\cdots w_{i'})>0 \end{align}\]

It remains to prove Lemma [lem:Synchronous95element95matching].

Proof of Lemma [lem:Synchronous95element95matching]↩︎

In essence, our proof is inspired by the approach taken in [14], which is itself a flawed adaptation of the approach taken in [13].

Let \(\alpha_e \in \mathbb{Q}_{>0}\), \(\beta_e \in \mathbb{N}\) and \(\gamma_e \in \mathbb{N}_{>0}\) given by Proposition [ptn:Length-synchronicity95equivalences] for \(e\). There exist unique \(n_e, d_e \in \mathbb{N}_{>0}\) that are relatively prime such that \(\alpha_e = \frac{n_e}{d_e}\). We are going to build an \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\)-formula \(\pi_e(x, x', y', y)\) such that for all \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\), we have that \(w \models \pi_e(i, i', j', j)\) if, and only if, all of the following conditions are satisfied:

(i) \(\frac{i' - i + 1}{j - j' + 1} = \frac{n_e}{d_e}\);

(ii) \(-\beta_e \leq \Delta(w_i \cdots w_{i + k \cdot n_e - 1} w_{j - k \cdot d_e + 1} \cdots w_j) \leq \beta_e\) for all \(k \in \mathbb{N}_{>0}\) such that \(k \leq (j - j' + 1) / d_e\) and \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_j) = 0\);

(iii) \(\Delta(w_{i + (q - 1) \cdot \gamma_e} \cdots w_{i + q \cdot \gamma_e - 1}) \geq 1\) for all \(q \in \mathbb{N}_{>0}\) such that \(q \cdot \gamma_e \leq i' - i + 1\) and \(\Delta(w_i \cdots w_{i + p - 1}) \geq 0\) for all \(p \in [1, i' - i + 1]\);

(iv) \(\Delta(w_{j - q \cdot \gamma_e + 1} \cdots w_{j - (q - 1) \cdot \gamma_e}) \leq -1\) for all \(q \in \mathbb{N}_{>0}\) such that \(q \cdot \gamma_e \leq j - j' + 1\) and \(\Delta(w_{j - p + 1} \cdots w_j) \leq 0\) for all \(p \in [1, j - j' + 1]\).

Let us first prove that these four conditions whose conjunction the \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\)-formula \(\pi_e(x, x', y', y)\) will express, indeed imply the two conditions of the lemma.

If conditions [ctn:sync951] to [ctn:sync954] are satisfied for a \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\), we actually have that \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\). Indeed, condition [ctn:sync952] ensures that \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_j) = 0\). Conditions [ctn:sync953] and [ctn:sync954] then additionally imply that \(\Delta(w_i \cdots w_{i + p - 1}) \geq 0\) for all \(p \in [1, i' - i + 1]\) and \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_{j' + p - 1}) \geq 0\) for all \(p \in [1, j - j' + 1]\). This is because if there were a \(p \in [1, j - j' + 1]\) such that \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_{j' + p - 1}) < 0\), then it should be that \(\Delta(w_{j' + p} \cdots w_j) > 0\) with \(p \leq j - j'\) as we already know that \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_j) = 0\): this would be a contradiction to condition [ctn:sync954].

Conversely, let us fix some \(w \in \Sigma^+\) and indices \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(i \leq i' < j' \leq j\), \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\), \(\Delta(w_i \cdots w_{i'}) > 0\) and \(e \circ \psi_L(\mathop{\mathrm{ext}}_{w_i \cdots w_{i'}, w_{j'} \cdots w_j}) = e\). In the terminology of Proposition [ptn:Length-synchronicity95equivalences], for \(F=\varphi_L(L)\), we have \((w_i \cdots w_{i'}, w_{j'} \cdots w_j)\in\mathcal{U}_e\). We claim that Points [ctn:sync951] to [ctn:sync954] are actually satisfied. Indeed, recalling that \(L\) is length-synchronous by assumption, 2(a) of Proposition [ptn:Length-synchronicity95equivalences] for \(e\) in fact states that that Point [ctn:sync951] is satisfied. Next, since for all \(k \in \mathbb{N}_{>0}\) such that \(k \leq \frac{j - j' + 1}{d_e} = \frac{i' - i + 1}{n_e}\), the word \(w_i \cdots w_{i + k \cdot n_e - 1}\) is a prefix of \(w_i \cdots w_{i'}\) and the word \(w_{j - k \cdot d_e + 1} \cdots w_j\) is a suffix of \(w_{j'} \cdots w_j\) such that \(\frac{\mathopen{}\left|w_i \cdots w_{i + k \cdot n_e - 1}\right|\mathclose{}}{\mathopen{}\left|w_{j - k \cdot d_e + 1} \cdots w_j\right|\mathclose{}} = \frac{k \cdot n_e}{k \cdot d_e}=\alpha_e\), it must hold that \(-\beta_e \leq \Delta(w_i \cdots w_{i + k \cdot n_e - 1} w_{j - k \cdot d_e + 1} \cdots w_j) \leq \beta_e\) by Point 2(b) of Proposition [ptn:Length-synchronicity95equivalences]. We have that \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_j) = 0\) immediately follows from our assumption \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\), thus Point [ctn:sync952] holds. Another consequence of our assumption \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) is that \(\Delta(w_i \cdots w_{i + p - 1}) \geq 0\) for all \(p \in [1, i' - i + 1]\) and \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_{j' + p - 1}) \geq 0\) for all \(p \in [1, j - j' + 1]\). This implies that \(\Delta(w_{j - p + 1} \cdots w_j) \leq 0\) for all \(p \in [1, j - j' + 1]\), as already argued above. Since \(w_{i + (q - 1) \cdot \gamma_e} \cdots w_{i + q \cdot \gamma_e - 1}\) is a factor of \(w_i \cdots w_{i'}\) of length \(\gamma_e\) for all \(q \in \mathbb{N}_{>0}\) such that \(q \cdot \gamma_e \leq i' - i + 1\) and \(w_{j - q \cdot \gamma_e + 1} \cdots w_{j - (q - 1) \cdot \gamma_e}\) is a factor of \(w_{j'} \cdots w_j\) of length \(\gamma_e\) for all \(q \in \mathbb{N}_{>0}\) such that \(q \cdot \gamma_e \leq j - j' + 1\), by Points 2(c) and 2(d) of Proposition [ptn:Length-synchronicity95equivalences], we finally have that conditions [ctn:sync953] and [ctn:sync954] are also satisfied.

It now remains to construct the formula \(\pi_e(x, x', y', y)\). We set \[\begin{align} \pi_e(x, x', y', y) = & (x' - x + 1) \cdot d_e = (y - y' + 1) \cdot n_e \wedge\\ & \mu_{n_e, d_e, \beta_e}(x, x', y', y) \wedge\\ & \nu_{\gamma_e}^+(x, x') \wedge \nu_{\gamma_e}^-(y', y), \end{align}\] where the first line checks condition [ctn:sync951], the \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\)-formula \(\mu_{n_e, d_e, \beta_e}(x, x', y', y)\) will check condition [ctn:sync952] under the assumption condition [ctn:sync951] is satisfied and the \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\)-formulas \(\nu_{\gamma_e}^+(x, x')\) and \(\nu_{\gamma_e}^-(y', y)\) respectively will check conditions [ctn:sync953] and [ctn:sync954]. We now explain how to build those formulas.

Helper formulas.

For all \(k \in \mathbb{N}_{>0}\) and \(h \in \mathbb{Z}\) such that \(-k \leq h \leq k\), we let \[H_k^h(x) = \bigvee_{\substack{I, J \subseteq [1, k]\\I \cap J = \emptyset\\ \left|I\right| - \left|J\right| = h}} \Bigl( \bigwedge_{p \in I} \Sigma_\text{call}(x + p - 1) \wedge \bigwedge_{p \in J} \Sigma_\text{ret}(x + p - 1) \wedge \bigwedge_{p \in [1, k] \setminus (I \cup J)} \Sigma_\text{int}(x + p - 1) \Bigr)\] such that for all \(w \in \Sigma^+\) and \(i \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(i \leq \mathopen{}\left|w\right|\mathclose{} - k + 1\), we have \(w\models H_k^h(i)\) if, and only if, \(\Delta(w_i \cdots w_{i + k - 1}) = h\).

For all \(n, d \in \mathbb{N}_{>0}\) relatively prime and \(h \in \mathbb{Z}, -n - d \leq h \leq n + d\), we define \[D^h_{n, d}(x, y, z) = \bigvee_{\substack{-n \leq h_1 \leq n\\-d \leq h_2 \leq d\\ h_1 + h_2 = h}} \Bigl( H_n^{h_1}\bigl(x + (z - 1) \cdot n\bigr) \wedge H_d^{h_2}\bigl(y - z \cdot d + 1\bigr) \Bigr) \,\,\text{,}\] such that for all \(w \in \Sigma^+\) and \(i, j, k \in [1, \mathopen{}\left|w\right|\mathclose{}]\) with \(i + k \cdot n - 1 \leq \mathopen{}\left|w\right|\mathclose{}\) and \(j - k \cdot d + 1 \geq 1\), we have \(w\models D^h_{n, d}(i, j, k)\) if, and only if, \[\Delta(w_{i + (k - 1) \cdot n} \cdots w_{i + k \cdot n - 1} w_{j - k \cdot d + 1} \cdots w_{j - (k - 1) \cdot d}) = h \,\,\text{.}\]

Formula \(\mu_{n, d, q}(x, x', y', y)\).

For each \(p\in\mathbb{N}\) let \(\Gamma_p = \{a_{-p}, \ldots, a_{-1}, a_0, a_1, \ldots, a_p\}\) and define \(\Delta_p\colon \Gamma_p^* \to \mathbb{Z}\) to be the \(p\)-height monoid morphism satisfying \(\Delta_p(a_h) = h\) for all \(a_h \in \Gamma_p\). Consider the language \[L_{p, q} = \{w \in \Gamma_p^* \mid \Delta_p(w) = 0 \wedge \forall i \in [1, \mathopen{}\left|w\right|\mathclose{}], -q \leq \Delta_p(w_1 \cdots w_i) \leq q\} \,\,\text{.}\] We claim that this language is recognized by a finite aperiodic monoid. This implies, by a theorem by McNaughton and Papert (see [2]), that there exists an \(\ifthenelse{\equal{\Gamma_{n + d}}{\null}} { \mathsf{FO}[\mathsf{<}] } { \mathsf{FO}_{\Gamma_{n + d}}[\mathsf{<}] }\)-sentence \(\tilde{\mu}_{p, q}\) defining \(L_{p, q}\).

Let now \(n, d \in \mathbb{N}_{>0}\) relatively prime and \(q \in \mathbb{N}\). Consider \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(i \leq i' < j' \leq j\) and \(\frac{i' - i + 1}{j - j' + 1} = \frac{n}{d}\). We want to check whether we have \[-q \leq \Delta(w_i \cdots w_{i + k \cdot n - 1} w_{j - k \cdot d + 1} \cdots w_j) \leq q\] for all \(k \in \mathbb{N}_{>0}\) such that \(k \leq (j - j' + 1) / d\) and moreover \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_j) = 0\). Since \(n\) and \(d\) are relatively prime, this means that there exists \(l \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(i' - i + 1 = l \cdot n\) and \(j - j' + 1 = l \cdot d\). We can hence decompose \(w_i \cdots w_{i'}\) as \(u_1 \cdots u_l\) with \(u_1, \ldots, u_l \in \Sigma^n\) and \(w_{j'} \cdots w_j\) as \(v_l \cdots v_1\) with \(v_1, \ldots, v_l \in \Sigma^d\). Observe that \(\Delta(u_iv_i)\in[-n-d,n+d]\) for all \(i\in[1,l]\). Using this decomposition, we now need to check whether \(-q \leq \Delta(u_1 v_1) + \cdots + \Delta(u_k v_k) \leq q\) for all \(k \in [1, l]\) and \(\Delta(u_1 v_1) + \cdots + \Delta(u_l v_l) = 0\). This is equivalent to checking whether the word \(\tilde{w} = a_{\Delta(u_1 v_1)} \cdots a_{\Delta(u_l v_l)}\) in \(\Gamma_{n + d}^*\) belongs to \(L_{n + d, q}\).

We thus transform the \(\ifthenelse{\equal{\Gamma_{n + d}}{\null}} { \mathsf{FO}[\mathsf{<}] } { \mathsf{FO}_{\Gamma_{n + d}}[\mathsf{<}] }\)-sentence \(\tilde{\mu}_{n + d, q}\) into an \(\ifthenelse{\equal{\Sigma}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma}[\mathsf{+}] }\)-formula \(\mu_{n, d, q}(x, x', y', y)\) by

  • replacing any quantification \(\exists z \rho(z)\) by \(\exists z \bigl(z \leq (y - y' + 1) / d \wedge \rho(z)\bigr)\);

  • replacing any quantification \(\forall z \rho(z)\) by \(\forall z \bigl(z \leq (y - y' + 1) / d \rightarrow \rho(z)\bigr)\);

  • replacing any atomic formula of the form \(a_h(z)\) for \(a_h \in \Gamma_{n + d}\) by \(D^h_{n, d}(x, y, z)\).

By this translation for all \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) with \(i \leq i' < j' \leq j\) and \(\frac{i' - i + 1}{j - j' + 1} = \frac{n}{d}\) we have \(w\models \mu_{n, d, q}(i, i', j', j)\) if, and only if, \(-q \leq \Delta(w_i \cdots w_{i + k \cdot n - 1} w_{j - k \cdot d + 1} \cdots w_j) \leq q\) for all \(k \in \mathbb{N}_{>0}, k \leq (j - j' + 1) / d\) and \(\Delta(w_i \cdots w_{i'} w_{j'} \cdots w_j) = 0\).

It remains to show that \(L_{p, q}\) is recognized by a finite aperiodic monoid for all \(p, q \in \mathbb{N}\). Set \(Q_q = \{-q, \ldots, -1, 0, 1, \ldots, q, \bot\}\) and consider the monoid \({Q_q}^{Q_q}\) with function composition from left to right. For each \(a_h \in \Gamma_p\), we define the function \(f_{a_h}\colon Q_q \to Q_q\) to be such that \[f_{a_h}(h') = \begin{cases} h'+ h & \text{if h' \neq \bot and -q \leq h' + h \leq q}\\ \bot & \text{otherwise} \end{cases}\] for all \(h' \in Q_q\). We take \(M_{p, q}\) to be the submonoid of \({Q_q}^{Q_q}\) generated by \(\{f_{a_h} \mid a_h \in \Gamma_p\}\) and define \(\varphi_{p, q}\colon \Gamma_p^* \to M_{p, q}\) as the unique monoid morphism such that \(\varphi_{p, q}(a_h) = f_{a_h}\) for all \(a_h \in \Gamma_p\).

It is straightforward to show, by induction on the length of \(w\), that for all \(w \in \Gamma_p^*\) and all \(h \in Q_q\), we have \[\varphi_{p, q}(w)(h) = \begin{cases} h + \Delta_p(w) & \text{if h \neq \bot and -q \leq h + \Delta_p(w_1 \cdots w_i) \leq q for all i \in [1, \mathopen{}\left|w\right|\mathclose{}]}\\ \bot & \text{otherwise.} \end{cases}\] Thus \(L_{p, q} = \varphi_{p, q}^{-1}(\{f \in M_{p, q} \mid f(0) = 0\})\). We claim that the monoid \(M_{p, q}\) is aperiodic. Indeed, take \(f \in M_{p, q}\); we claim that \(f^{2 q + 1} = f^{2 q + 2}\). Since \(M_{p, q}\) is generated by \(\{f_{a_h} \mid a_h \in \Gamma_p\}\), there exists \(w \in \Gamma_p^*\) satisfying \(\varphi_{p, q}(w) = f\). There are three subcases to consider.

  • If \(\Delta_p(w) = 0\), then since \(h + \Delta_p(w^{n - 1} w_1 \cdots w_i) = h + \Delta_p(w_1 \cdots w_i)\) for all \(h \in \mathbb{Z}, -q \leq h \leq q\), for all \(n \in \mathbb{N}_{>0}\) and \(i \in [1, \mathopen{}\left|w\right|\mathclose{}]\), we have that \(f^n = f\) for all \(n \in \mathbb{N}_{>0}\).

  • If \(\Delta_p(w) > 0\), then since \(q < h + \Delta_p(w^{2 q + 1}) \leq h + \Delta_p(w^{2 q + 2})\) for all \(h \in \mathbb{Z}, -q \leq h \leq q\), both \(f^{2 q + 1}\) and \(f^{2 q + 2}\) must be equal to the function sending every element to \(\bot\).

  • If \(\Delta_p(w) < 0\), then since \(h + \Delta_p(w^{2 q + 2}) \leq h + \Delta_p(w^{2 q + 1}) < -q\) for all \(h \in \mathbb{Z}, -q \leq h \leq q\), both \(f^{2 q + 1}\) and \(f^{2 q + 2}\) must be equal to the function sending every element to \(\bot\).

Formula \(\nu_l^+(x, x')\).

For all \(l \in \mathbb{N}_{>0}\), we let \[\begin{align} \nu_l^+(x, x') = & \bigwedge_{p = 1}^{l^2} \Bigl(x' - x + 1 \geq p \rightarrow \bigwedge_{k = 1}^p \bigvee_{h = 0}^k H_k^h(x)\Bigr) \;\wedge\\ & \forall z \Bigl(z \cdot l \leq x' - x + 1 \rightarrow \bigvee_{h = 1}^l H_l^h\bigl(x + (z - 1) \cdot l\bigr) \Bigr) \,\,\text{.} \end{align}\]

Fix any \(w \in \Sigma^+\) and \(i, i' \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(i \leq i'\). We have \(w\models \nu_l^+(i, i')\) if, and only if, \(\Delta(w_i \cdots w_{i + p - 1}) \geq 0\) for all \(p \in [1, \min\{l^2, i' - i + 1\}]\) and \(\Delta(w_{i + (q - 1) \cdot l} \cdots w_{i + q \cdot l - 1}) \geq 1\) for all \(q \in \mathbb{N}_{>0}\) such that \(q \cdot l \leq i' - i + 1\). The latter is clearly equivalent to having \(\Delta(w_{i + (q - 1) \cdot l} \cdots w_{i + q \cdot l - 1}) \geq 1\) for all \(q \in \mathbb{N}_{>0}, q \cdot l \leq i' - i + 1\) and \(\Delta(w_i \cdots w_{i + p - 1}) \geq 0\) for all \(p \in [1, i' - i + 1]\), as required.

Formula \(\nu_l^-(y', y)\).

For all \(l \in \mathbb{N}_{>0}\), we let \[\begin{align} \nu_l^-(y', y) = & \bigwedge_{p = 1}^{l^2} \Bigl(y - y' + 1 \geq p \rightarrow \bigwedge_{k = 1}^p \bigvee_{h = 0}^k H_k^{-h}(y - k + 1) \Bigr)\;\wedge\\ & \forall z \Bigl(z \cdot l \leq y - y' + 1 \rightarrow \bigvee_{h = 1}^l H_l^{-h}\bigl(y - z \cdot l + 1\bigr) \Bigr) \,\,\text{.} \end{align}\] Therefore, analogously as for \(\nu_l^+(x, x')\), for all \(w \in \Sigma^+\) and \(j', j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) such that \(j' \leq j\), we have \(w\models \nu_l^-(j', j)\) if, and only if, \(\Delta(w_{j - q \cdot l + 1} \cdots w_{j - (q - 1) \cdot l}) \leq -1\) for all \(q \in \mathbb{N}_{>0}\) such that \(q \cdot l \leq j - j' + 1\) and \(\Delta(w_{j - p + 1} \cdots w_j) \leq 0\) for all \(p \in [1, j - j' + 1]\).

5.3.5 Evaluation in \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\) (Proof of Point 4)↩︎

The following proposition states a sufficient condition for a VPL to be \(\ifthenelse{\equal{\Sigma,\leftrightsquigarrow}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma,\leftrightsquigarrow}[\mathsf{+}] }\)-definable assuming that an approximate matching is present as built-in predicate. It makes use of bounded nesting depth and quasi-aperiodicity of both the vertical and horizontal evaluation language.

Let \(L\) be a VPL satisfying the following:

  • \(L\) has bounded nesting depth,

  • \(\mathcal{E}_{\varphi_L, r}\) is a regular language whose syntactic morphism is quasi-aperiodic for all \(\varphi_L(L)\)-reaching \(r \in R_L\), and

  • \(\mathcal{E}_{\psi_L, e}\) is a regular language whose syntactic morphism is quasi-aperiodic for all \(\varphi_L(L)\)-reaching \(e \in O_L\).

Then there exists an \(\ifthenelse{\equal{\Sigma, \leftrightsquigarrow}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma, \leftrightsquigarrow}[\mathsf{+}] }\)-sentence \(\eta\) such that for any approximate matching \(M\) relative to \(L\), we have \(w \in L\) if, and only if, \((w, M(w)) \models \eta\) for all \(w \in \Sigma^*\).

Proof. By hypothesis, there exists \(d_L \in \mathbb{N}\) bounding the nesting depth of the words in \(L\).

By hypothesis also, for each \(\varphi_L(L)\)-reaching \(r \in R_L\), the language \(\mathcal{E}_{\varphi_L, r}\) is regular and its syntactic morphism is quasi-aperiodic. This implies, by [2], that for each \(\varphi_L(L)\)-reaching \(r \in R_L\), there exists an \(\mathsf{FO}_{\Gamma_{\varphi_L}}[<, \mathsf{MOD}]\)-sentence \(\nu_{\varphi_L, r}\) defining \(\mathcal{E}_{\varphi_L, r}\).

Finally, by hypothesis, for each \(\varphi_L(L)\)-reaching \(e \in O_L\), the language \(\mathcal{E}_{\psi_L, e}\) is regular and its syntactic morphism is quasi-aperiodic. Again, by [2], for each \(\varphi_L(L)\)-reaching \(e \in O_L\), there exists an \(\mathsf{FO}_{\Gamma_{\psi_L}}[<, \mathsf{MOD}]\)-sentence \(\nu_{\psi_L, e}\) defining \(\mathcal{E}_{\psi_L, e}\).

5.3.5.0.1 Auxiliary formulas.

We introduce a few auxiliary formulas that all assume access to the full matching relation \(M^\triangle(w)\), represented by the relational symbol \(\leftrightsquigarrow\).

First let us define a formula \(A\) such that for all \(w \in \Sigma^\triangle\) and \(i, j, k \in [1, \mathopen{}\left|w\right|\mathclose{}]\) satisfying \(w_i \cdots w_j \in \Sigma^\triangle\), we have that \((w, M^\triangle\left(w\right)) \models A(i, j, k)\) if, and only if, \(i \leq k < j\) and \(\Delta(w_i \cdots w_k) > 0\). We let \[A(x, y, z) = \exists x' \exists y' (x \leq x' \leq z < y' \leq y \wedge x' \leftrightsquigarrow y') \,\,\text{.}\]

Next, we define a formula \(U\) such that for all \(w \in \Sigma^\triangle\) and \(i, i', k \in [1, \mathopen{}\left|w\right|\mathclose{}]\), we have that \((w, M^\triangle\left(w\right)) \models U(i, i', k)\) if, and only if, \(i \leq k \leq i'\) and \(k\) is matched to some position larger than \(i'\) in \(w\). We let \[U(x, x', z) = x \leq z \leq x' \wedge \exists t (z \leftrightsquigarrow t \wedge x' < t) \,\,\text{.}\]

The last formulas we introduce are \(N_d\) which express that the infix \(w_i\cdots w_j\in\Sigma^\triangle\) of \(w\in\Sigma^\triangle\) has nesting depth at least \(d\geq 0\). More precisely, for all \(d \in \mathbb{N}\), we introduce auxiliary formulas \(N_d\) such that for all \(w \in \Sigma^\triangle\) and \(i, j \in [1, \mathopen{}\left|w\right|\mathclose{}]\) satisfying \(w_i \cdots w_j \in \Sigma^\triangle\), we have that \((w, M^\triangle\left(w\right)) \models N_d(i, j)\) if, and only if, \(\mathop{\mathrm{nd}}(w_i \cdots w_j) \geq d\). The case \(d=0\) is trivial since we can set \(N_0(i,j) = \top\).

Take \(w \in \Sigma^\triangle\) such that \(\mathop{\mathrm{nd}}(w) = d' \geq 1\). Note that then \(w\) can be factorized as \(w=w_1uw_2\) such that \(w_1, w_2 \in \Sigma^\triangle\), \(u\in\Sigma_\text{call}\Sigma^\triangle\Sigma_\text{ret}\) and \(\mathop{\mathrm{nd}}(w)=\mathop{\mathrm{nd}}(u) = d'\). This means that \(u=a_1vb_1\) for \(a_1\in\Sigma_\text{call}\), \(b_1\in\Sigma_\text{ret}\) and \(v\in\Sigma^\triangle\). We then apply Lemma [lem:Maximal95stair95factorization] and Lemma [L32nesting32induction] implying that \(u\) has a nesting-maximal stair factorization \[u = \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_k,y_k} \circ \mathop{\mathrm{ext}}_{a_k,b_k}(u')\] for which there exists \(h\in[1,k]\) such that, setting \(u_i=\mathop{\mathrm{ext}}_{a_i,b_i}\circ\mathop{\mathrm{ext}}_{x_{i+1},y_{i+1}} \circ\cdots\circ\; \mathop{\mathrm{ext}}_{a_k,b_k}(u')\) for all \(i \in [1, k]\) and \(u_{k + 1} = u'\), we have \(\mathop{\mathrm{nd}}(u)=\mathop{\mathrm{nd}}(u_h) = d'\) and \[\mathop{\mathrm{nd}}(\mathop{\mathrm{ext}}_{x_{h+1},y_{h+1}} \circ \mathop{\mathrm{ext}}_{a_{h+1}, b_{h+1}} \circ \cdots \circ \mathop{\mathrm{ext}}_{a_k,b_k}(u')) = \mathop{\mathrm{nd}}(u_{h+1}) = d'-1\,\,\text{.}\] Thus, by definition of the nesting depth of a well-matched word, \(u_h=a_hz_1z_2b_h\) for \(z_1,z_2\in\Sigma^\triangle\) satisfying \(\mathop{\mathrm{nd}}(z_1) = \mathop{\mathrm{nd}}(z_2) = d'-1\).

Hence, we set \[N_1(x, y) = \exists x' \exists y' (x \leq x' < y' \leq y \wedge x' \leftrightsquigarrow y')\] and for \(d\geq 2\) we set \[N_d(x, y) = \exists x' \exists y' \exists z \bigl( \begin{align}[t] & x \leq x' < z < y' \leq y \wedge x' \leftrightsquigarrow y' \wedge \neg A(x'+1, y'-1, z) \wedge\\ & N_{d - 1}(x'+1, z) \wedge N_{d - 1}(z+1, y'-1) \bigr) \,\,\text{.} \end{align}\]

Main construction.

To build the \(\ifthenelse{\equal{\Sigma, \leftrightsquigarrow}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma, \leftrightsquigarrow}[\mathsf{+}] }\)-sentence \(\eta\), we build \(\ifthenelse{\equal{\Sigma, \leftrightsquigarrow}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\Sigma, \leftrightsquigarrow}[\mathsf{+}] }\)-formulas

  • \(\eta_{d, r}^\uparrow(x, y)\) for all \(d \in \mathbb{N}\) and all \(\varphi_L(L)\)-reaching \(r \in R_L\) and

  • \(\eta_{d, r}(x, y)\) for all \(d\in\mathbb{N}\) and all \(\varphi_L(L)\)-reaching \(r\in R_L\)

that also assume access to the full matching relation \(M^\Delta(w)\). They will have the following properties for all \(w\in\Sigma^\triangle\) and all \(i,j\in[1,\mathopen{}\left|w\right|\mathclose{}]\):

  • if \(i\) is matched to \(j\) in \(w\), then \((w, M^\triangle\left(w\right)) \models \eta_{d, r}^\uparrow(i, j)\) if, and only if, \(\mathop{\mathrm{nd}}(w_i \cdots w_j) \leq d\) and \(\varphi_L(w_i \cdots w_j) = r\) and

  • if \(w_i \cdots w_j \in \Sigma^\triangle\), then \((w, M^\triangle\left(w\right)) \models \eta_{d, r}(i, j)\) if, and only if, \(\mathop{\mathrm{nd}}(w_i \cdots w_j) \leq d\) and \(\varphi_L(w_i \cdots w_j) = r\).

Let the formula \(E\) be defined as \(\forall x (x \neq x)\) if \(\varepsilon\in L\) and \(\bot=\exists x (x\neq x)\) otherwise. Observe that \(w\models \forall x (x \neq x)\) if, and only if, \(w=\varepsilon\). Our final formula \(\eta\) will then be defined as \[\begin{align} \eta = & \forall z \exists t \bigl( (\Sigma_\text{call}(z) \rightarrow z \leftrightsquigarrow t) \wedge (\Sigma_\text{ret}(z) \rightarrow t \leftrightsquigarrow z) \bigr) \wedge\\ & \Bigl( E \vee \exists x \exists y \bigl( \neg \exists x' (x' < x) \wedge \neg \exists y' (y < y') \wedge \bigvee_{r \in \varphi_L(L)} \eta_{d_L, r}(x, y) \bigr) \Bigr). \end{align}\]

It now remains to build \(\eta_{d, r}^\uparrow(x, y)\) and \(\eta_{d, r}(x, y)\) for all \(d \in \mathbb{N}\) and \(\varphi_L(L)\)-reaching \(r \in R_L\). The construction is by induction on \(d\). Let \(r \in R_L\) that is \(\varphi_L(L)\)-reaching. We define \(\eta_{0,r}^\uparrow(x,y)=\bot\). We define \(\eta_{0,r}\) as \[\eta_{0,r}(x,y) = \neg N_1(x,y) \wedge \tau_0(\nu_{\varphi_L,r}) \,\,\text{,}\] where the translation \(\tau_0\) is inductively defined as follows:

  • \(\tau_0(z<z')=z<z'\);

  • \(\tau_0(s(z))= \bigvee_{c \in \varphi_L^{-1}(s) \cap \Sigma_\text{int}} c(z)\) for all \(s \in \varphi_L(\Sigma^\triangle \setminus \{\varepsilon\})\);

  • \(\tau_0(\mathsf{MOD}_m(z))= \exists t \bigl((z = x \rightarrow 1 = t \cdot m) \wedge (z \neq x \rightarrow z - x + 1 = t \cdot m)\bigr)\) for all \(m \in \mathbb{N}_{>0}\);

  • \(\tau_0(\$(z))=\bot\);

  • \(\tau_0(\rho_1(\boldsymbol{z}_1) \wedge \rho_2(\boldsymbol{z}_2))= \tau_0(\rho_1(\boldsymbol{z}_1))\wedge \tau_0(\rho_1(\boldsymbol{z}_2))\);

  • \(\tau_0(\neg\rho(\boldsymbol{z}))=\neg\tau_0(\rho(\boldsymbol{z}))\);

  • \(\tau_0(\exists z \rho(z,\boldsymbol{z}))= \exists z \bigl(x \leq z \leq y \wedge \tau_0(\rho(z,\boldsymbol{z}))\bigr)\).

Now let \(d>0\). Let us first define \(\eta_{d,r}\) when assuming that we have already defined \(\eta_{d,r}^\uparrow\). Given \(w\in\Sigma^\triangle \setminus \{\varepsilon\}\) and \(i,j\in[1,\mathopen{}\left|w\right|\mathclose{}]\) such that \(w_i \cdots w_j \in \Sigma^\triangle \setminus \{\varepsilon\}\), note that in case \(\mathop{\mathrm{nd}}(w_i \cdots w_j)\leq d\), then one can factorize \(w_i \cdots w_j\) as \(w_i \cdots w_j = u_1 \cdots u_m\) such that \(u_\ell\in\Sigma_\text{int}\cup \Sigma_\text{call}\Sigma^\triangle\Sigma_\text{ret}\) and \(\mathop{\mathrm{nd}}(u_\ell)\leq d\) for all \(\ell\in[1,m]\). Note also that if \(\varphi_L(w_i \cdots w_j) = r\), as \(r\) is \(\varphi_L(L)\)-reaching, then \(\varphi_L(u_\ell)\) is \(\varphi_L(L)\)-reaching for all \(\ell \in [1, m]\). Using these observations we define \[\eta_{d,r}(x,y) = \neg N_{d+1}(x,y) \wedge \forall z \Bigl( x \leq z \leq y \rightarrow \bigl( \tau_1(\$(z)) \vee \bigvee_{\substack{s \in \varphi_L(\Sigma^\triangle \setminus \{\varepsilon\})\\ \text{\varphi_L(L)-reaching}}} \tau_1(s(z)) \bigl) \Bigr) \wedge \tau_1(\nu_{\varphi_L,r}) \,\,\text{,}\] where the translation \(\tau_1\) agrees with the above translation \(\tau_0\) (where, as expected, occurrences of \(\tau_0\) are replaced by \(\tau_1\)) except for the following kinds of subformulas:

  • \(\tau_1(\$(z))=A(x,y,z)\);

  • \(\tau_1(s(z)) = \neg A(x, y, z) \wedge \Bigl(\bigvee_{c \in \varphi_L^{-1}(s) \cap \Sigma_\text{int}} c(z) \vee \exists t \bigl(x \leq t \leq y \wedge t \leftrightsquigarrow z \wedge \eta_{d, s}^\uparrow(t, z)\bigr) \Bigr)\) if \(s\) is \(\varphi_L(L)\)-reaching, \(\tau_1(s(z)) = \bot\) otherwise.

It remains to define \(\eta_{d,r}^\uparrow\).

We first construct for all \(\varphi_L(L)\)-reaching \(e\in O_L\) a formula \(\chi_{d,e}(x,x',y',y)\) such that for all \(w \in \Sigma^\triangle\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\) we have that if \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) and \(i'\) is matched to \(j'\) in \(w\), then given \[\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}= \mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k}\] the stair factorization of \(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}\) provided by Lemma [lemma32ext], we have \((w, M^\triangle\left(w\right)) \models \chi_{d,e}(i,i',j',j)\) if, and only if, \(\mathop{\mathrm{nd}}(x_\ell), \mathop{\mathrm{nd}}(y_\ell) < d\) for all \(\ell \in [1, k]\) and \(\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j})=e\). Given \(w, i, i', j', j\) and the associated stair factorization as above, note that whenever \(\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}) = e\), as \(e\) is \(\varphi_L(L)\)-reaching, then \(\varphi_L(x_\ell)\) and \(\varphi_L(y_\ell)\) are \(\varphi_L(L)\)-reaching for all \(\ell \in [1, k]\). If additionally \(\mathop{\mathrm{nd}}(x_\ell), \mathop{\mathrm{nd}}(y_\ell) < d\) for all \(\ell \in [1, k]\), we can inductively make use of the formulas \(\{\eta_{d-1,r'}\mid r'\in R_L \text{ \varphi_L(L)-reaching}\}\) in order to evaluate \(\varphi_L(x_1), \varphi_L(y_1), \ldots, \varphi_L(x_k), \varphi_L(y_k)\). Let \(p_1, \ldots, p_k \in [i, i']\) be the positions in \(w_i \cdots w_{i'}\) where, respectively, \(a_1, \ldots, a_k\) in the above factorization of \(\mathop{\mathrm{ext}}_{w_i \cdots w_{i'}, w_{j'} \cdots w_j}\) appear: the formula \(\chi_{d,e}\) will verify if \(\sigma_i\cdots\sigma_{i'}\in\mathcal{E}_{\psi_L,e}\), where \[\sigma_q= \begin{cases} \mathrm{left}_{\varphi_L(x_m)}\circ\mathrm{right}_{\varphi_L(y_m)} \circ\psi_L(\mathop{\mathrm{ext}}_{a_m,b_m}) & \text{if q = p_m for m \in [1, k]}\\ \$ & \text{otherwise} \end{cases}\] for all \(q \in [i, i']\). Hence we set \[\chi_{d, e}(x, x', y', y) = \forall z \Bigl( x \leq z \leq x' \rightarrow \bigl( \tau_2(\$(z)) \vee \bigvee_{\substack{f \in \psi_L \bigl( \mathcal{O}(\Sigma^\triangle)_\uparrow \bigr)\\ \text{\varphi_L(L)-reaching}}} \tau_2(f(z)) \bigl) \Bigr) \wedge \tau_2(\nu_{\psi_L,e}) \,\,\text{,}\] where the translation \(\tau_2\) agrees with translation \(\tau_0\) (where, as expected, occurrences of \(\tau_0\) are replaced by \(\tau_2\)) with the following exceptions:

  • \(\tau_2(\exists z \rho(z,\boldsymbol{z}))= \exists z \bigl(x \leq z \leq x' \wedge \tau_2(\rho(z,\boldsymbol{z}))\bigr)\)

  • \(\tau_2(\$(z))=\neg U(x,x',z)\)

  • \(\tau_2(f(z)) = \begin{cases} \exists t \Bigl( \begin{aligned}[t] & U(x, x', z) \wedge z \leftrightsquigarrow t \wedge\\ & \bigl(\iota_{d,f}(x,x',y',y,z,t)\vee \zeta_{d,f}(x,x',z,t)\bigr) \Bigr) \end{aligned} & \text{if f is \varphi_L(L)-reaching}\\ \bot & \text{otherwise} \end{cases}\) for each \(f \in \psi_L\bigl(\mathcal{O}(\Sigma^\triangle)_\uparrow\bigr)\), where \[\begin{align} \iota_{d,f}(x,x',y',y,z,t) = & \neg \exists z' \bigl(U(x, x', z') \wedge z' < z\bigl) \wedge\\ & \begin{aligned}[t] & \bigvee_{\substack{a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}, r', r'' \in R_L\\ f=\mathrm{left}_{r'} \circ \mathrm{right}_{r''}\circ \psi_L(\mathop{\mathrm{ext}}_{a, b})}} \biggl( \begin{align}[t] & a(z) \wedge b(t) \wedge\\ & \Bigl(\bigl(x < z \wedge \eta_{d - 1, r'}(x, z - 1)\bigr) \vee F_{r'}(x, z)\Bigr) \wedge\\ & \Bigl(\bigl(t < y \wedge \eta_{d - 1, r''}(t + 1, y)\bigr) \vee F_{r''}(y, t)\Bigr) \biggr) \end{aligned} \end{align} \end{align}\] with \(F_s(x, z) = \begin{cases} x = z & \text{if s = 1_{R_L}}\\ \bot & \text{otherwise} \end{cases}\) for all \(\varphi_L(L)\)-reaching \(s \in R_L\) and \[\zeta_{d,f}(x,x',z,t) = \exists z' \exists t' \biggl( \begin{align}[t] & U(x, x', z') \wedge z' < z \wedge \neg \exists z'' \bigl(z' < z'' < z \wedge U(x, x', z'')\bigr) \wedge z' \leftrightsquigarrow t' \wedge\\ & \bigvee_{\substack{a \in \Sigma_\text{call}, b \in \Sigma_\text{ret}, r', r'' \in R_L\\ f=\mathrm{left}_{r'} \circ \mathrm{right}_{r''}\circ \psi_L(\mathop{\mathrm{ext}}_{a, b})}} \Bigl( \begin{aligned}[t] a(z) \wedge b(t) \wedge \, & \eta_{d - 1, r'}(z' + 1, z - 1) \wedge\\ & \eta_{d - 1, r''}(t + 1, t' - 1) \Bigr)\biggr) \,\,\text{.} \end{aligned} \end{align}\]

We now construct \(\eta_{d,r}^\uparrow\) itself. Given \(w\in\Sigma^\triangle \setminus \{\varepsilon\}\) and \(i,j\in[1,\mathopen{}\left|w\right|\mathclose{}]\) such that \(i\) is matched to \(j\) in \(w\), observe first that the infix \(w_i \cdots w_j\) is of the form \(w_i \cdots w_j=a_1vb_1\in\Sigma^\triangle\) for some \(a_1\in\Sigma_\text{call}\), \(b_1\in\Sigma_\text{ret}\), and \(v\in\Sigma^\triangle\). As above, we can directly express \(\mathop{\mathrm{nd}}(w_i \cdots w_j)\leq d\) via the formula \(\neg N_{d+1}\). Assuming this holds, towards expressing that \(\varphi_L(w_i \cdots w_j)=r\), we make use of Lemma [lem:Maximal95stair95factorization] and Lemma [L32nesting32induction]: for the infix \(w_i \cdots w_j\) there is a nesting-maximal stair factorization \[w_i \cdots w_j = \mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_k,y_k} \circ \mathop{\mathrm{ext}}_{a_k,b_k}(u')\] such that we have

  1. \(\mathop{\mathrm{nd}}(x_1),\mathop{\mathrm{nd}}(y_1),\dots,\mathop{\mathrm{nd}}(x_k),\mathop{\mathrm{nd}}(y_k)<d\); and

  2. if \(\varphi_L(w_i \cdots w_j) = r\), as \(r\) is \(\varphi_L(L)\)-reaching, then \(\psi_L(\mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_k,y_k} \circ \mathop{\mathrm{ext}}_{a_k,b_k})\) and \(\varphi_L(u')\) are \(\varphi_L(L)\)-reaching.

By these points, we can use the formulas \(\{\chi_{d,e}(x,x',y',y) \mid e \in O_L \text{ \varphi_L(L)-reaching}\}\) to evaluate \(\psi_L(\mathop{\mathrm{ext}}_{x_1,y_1} \circ \mathop{\mathrm{ext}}_{a_1,b_1} \circ \cdots \circ \mathop{\mathrm{ext}}_{x_k,y_k} \circ \mathop{\mathrm{ext}}_{a_k,b_k})\) and the formulas \(\{\eta_{0,r'}\mid r'\in R_L \text{ \varphi_L(L)-reaching}\}\) to evaluate \(\varphi_L(u')\). We are now ready to give the formula \(\eta_{d,r}^\uparrow\). We set \[\eta_{d, r}^\uparrow(x, y) = \neg N_{d + 1}(x, y) \wedge \exists x' \exists y' \Bigl( \begin{align}[t] & x \leq x' < y' \leq y \wedge x' \leftrightsquigarrow y' \wedge\\ & \bigvee_{\substack{r' \in R_L, e \in O_L\\e(r') = r}} \bigl( \chi_{d, e}(x, x', y', y) \wedge \eta_{0, r'}(x' + 1, y' - 1) \bigl) \Bigr) \,\,\text{.} & \qedhere \end{align}\] ◻

5.4 The intermediate case↩︎

The following theorem effectively characterizes the remaining case, namely those VPLs that are weakly length-synchronous but not length-synchronous and whose syntactic morphism is quasi-aperiodic: such VPLs are shown to be constant-depth equivalent to a non-empty disjoint union of intermediate VPLs. The computability of \(k,l\in\mathbb{N}\) with \(k\not=l\) such that \(\mathcal{L}_{k,l}\leq_{\mathrm{cd}}L\) is subject of Section 5.4.2.

If \(L\) is weakly length-synchronous but not length-synchronous, and its syntactic morphism \((\varphi_L,\psi_L)\) is quasi-aperiodic, one can effectively compute vertically visibly pushdown grammars \(G_1,\dots,G_m\) generating intermediate VPLs such that \(L=_{\mathrm{cd}}\biguplus_{i\in[1,m]} L(G_i)\).

Before we give the proof of the theorem we need a bit of notation. Let \(L\subseteq\Sigma^\triangle\) be a VPL that is weakly length-synchronous, not length-synchronous, and whose syntactic morphism \((\varphi_L,\psi_L)\) is quasi-aperiodic. By Proposition [prop32effectivity] one can effectively compute its syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L, O_L)\), \((\varphi_L, \psi_L)\) and \(\varphi_L(L)\) from (a given DVPA for) \(L\).

For all \(e\in O_L\) recall that \[\mathcal{U}_e=\{(u,v)\in\mathsf{Con}(\Sigma)\mid e\circ\psi_L(\mathop{\mathrm{ext}}_{u,v})=e\}.\] For all \(\varphi_L(L)\)-reaching \(e\in O_L\) and some fresh internal letter \(\#\not\in\Sigma\) let \[M_e=\{u\#v\mid (u,v)\in\mathsf{Con}(\Sigma), \Delta(u)>0, e\circ\psi_L(\mathop{\mathrm{ext}}_{u,v})=e\}.\] Note that since \(L\) is assumed to be weakly length-synchronous, by Proposition [ptn:Weak95length-synchronicity95equivalence], \(\mathcal{U}_e\) is weakly length-synchronous for all \(\varphi_L(L)\)-reaching \(e\in O_L\).

We claim that one can effectively compute an \(\mathop{\mathrm{Ext}}\)-algebra recognizing \(M_e\). First note that \(M_e = \bigcup_{f\in O_L \text{ s.t. } e\circ f=e} L_f \cap \{u\#v\mid uv\in\Sigma^\triangle,\Delta(u)>0\}\). Second note that for all languages \(L_f\) one can effectively compute \(\mathop{\mathrm{Ext}}\)-algebras recognizing them by Lemma [lemma32Le]. Third note that one can effectively compute an \(\mathop{\mathrm{Ext}}\)-algebra recognizing the language \(\{u\#v\mid uv\in\Sigma^\triangle,\Delta(u)>0\}\). Thus, an \(\mathop{\mathrm{Ext}}\)-algebra recognizing \(M_e\) can be effectively computed since the languages recognizable by \(\mathop{\mathrm{Ext}}\)-algebras are effectively closed under Boolean operations. Next recall that the set \(S_e=\{(k,l) \in \mathbb{N}^2 \mid \exists (u, v)\in\Sigma^k\times\Sigma^l:u\#v\in M_e\}\subseteq\mathbb{N}_{>0}^2\) is hence effectively semilinear by Lemma [lemma32semilinear]. Note that the word relation \(\mathcal{U}_e\) is length-synchronous if, and only if, there exists some \(\alpha\in\mathbb{Q}_{>0}\) such that \(\frac{k}{l}=\alpha\) for all \((k,l)\in S_e\). Lemma [lemma32collinear] implies that the latter condition is decidable. As a consequence one can effectively compute the set \[\mathcal{Z}=\{e\in O_L\mid e\text{ is \varphi_L(L)-reaching and \mathcal{U}_e is not length-synchronous}\}.\] Observe that since \(L\) is not length-synchronous by assumption, we have \(\mathcal{Z}\not=\emptyset\) (Proposition [prop32length32synchronous]).

Let us introduce two fresh copies \(\widetilde{\Sigma}=\{\widetilde{\sigma}\mid \sigma\in\Sigma\}\) and \(\overline{\Sigma}=\{\overline{\sigma}\mid \sigma\in\Sigma\}\) of our alphabet \(\Sigma\). Let \(\widetilde{\vartheta}\colon (\widetilde{\Sigma}\cup\Sigma)^*\rightarrow\widetilde{\Sigma}^*\) and \(\overline{\vartheta}\colon (\overline{\Sigma}\cup\Sigma)^*\rightarrow\overline{\Sigma}^*\) be the (letter-to-letter and hence length-multiplying) morphisms satisfying \(\widetilde{\vartheta}(\sigma)= \widetilde{\vartheta}(\widetilde{\sigma})=\widetilde{\sigma}\) and \(\overline{\vartheta}(\sigma)= \overline{\vartheta}(\overline{\sigma})=\overline{\sigma}\) for all \(\sigma\in\Sigma\). Conversely, let \(\widetilde{\vartheta}^{-1}\colon (\widetilde{\Sigma}\cup\Sigma)^*\rightarrow\Sigma^*\) and \(\overline{\vartheta}^{-1}\colon (\overline{\Sigma}\cup\Sigma)^*\rightarrow\Sigma^*\) be the morphisms satisfying \(\widetilde{\vartheta}^{-1}(\widetilde{\sigma})= \widetilde{\vartheta}^{-1}(\sigma)=\sigma\) and \(\overline{\vartheta}^{-1}(\overline{\sigma}) = \overline{\vartheta}^{-1}(\sigma)=\sigma\) for all \(\sigma\in\Sigma\).

We define a new visibly pushdown alphabet \(\Upsilon=\Upsilon_\text{call}\cup\Upsilon_\text{int}\cup\Upsilon_\text{ret}\) where \(\Upsilon_\text{call}=\Sigma_\text{call}\), \(\Upsilon_\text{int}=\Sigma_\text{int}\cup\widetilde{\Sigma}\cup\overline{\Sigma}\cup\{\#\}\), and \(\Upsilon_\text{ret}=\Sigma_\text{ret}\).

For every word \(u\#v\in M_e\) consider the unique factorization \[u\#v=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k}\circ\mathop{\mathrm{ext}}_{x_{k+1},y_{k+1}}(\#)\] where \(k\geq 1\), \(x_1,\dots,x_{k+1},y_1,\dots,y_{k+1}\in\Sigma^\triangle\), \(a_1,\dots,a_k\in\Sigma_\text{call}\), and \(b_1,\dots,b_k\in\Sigma_\text{ret}\). (Existence and unicity of this factorization basically just follows from the unique stair factorization of \(\mathop{\mathrm{ext}}_{u, v}\) given by Lemma [lemma32ext] and from the fact that \(\Delta(u) > 0\).) For these we define \[(u\#v)^\ddagger= \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_1),\overline{\vartheta}(y_1)} \circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_{k}),\overline{\vartheta}(y_{k})} \circ\mathop{\mathrm{ext}}_{a_k,b_k}\circ \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_{k+1}),\overline{\vartheta}(y_{k+1})}(\varepsilon) \in\Upsilon^\triangle \,\,\text{.}\] Notably, \((u\#v)^\ddagger\) does not contain the letter \(\#\). Finally, for all \(e\in\mathcal{Z}\) we define the language \[N_e = \{(u\#v)^\ddagger\in\Upsilon^*\mid u\#v\in M_e\} \cup \{\varepsilon\} \subseteq\Upsilon^\triangle \,\,\text{.}\]

Let be \(n\in\mathbb{N}\) be the constant from Lemma [ptn:hill95small] for \(L\) and let \(e\in\mathcal{Z}\). When setting \(F=\varphi_L(L)\) and \((\varphi,\psi)=(\varphi_L,\psi_L)\), Lemma [ptn:hill95small] states that the factorization \[u\#v=\mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k}\circ\mathop{\mathrm{ext}}_{x_{k+1},y_{k+1}}(\#)\] of every word \(u\#v\in M_e\) satisfies \(\mathopen{}\left|x_1\right|\mathclose{},\dots,\mathopen{}\left|x_{k+1}\right|\mathclose{},\mathopen{}\left|y_1\right|\mathclose{},\dots,\mathopen{}\left|y_{k+1}\right|\mathclose{}\leq n\). As a consequence, for the corresponding factorization \[(u\#v)^\ddagger= \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_1),\overline{\vartheta}(y_1)} \circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_{k}),\overline{\vartheta}(y_{k})} \circ\mathop{\mathrm{ext}}_{a_k,b_k}\circ \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_{k+1}),\overline{\vartheta}(y_{k+1})}(\varepsilon)\] of every word \((u\#v)^\ddagger\in N_e \setminus \{\varepsilon\}\) we have \(\mathopen{}\left|\widetilde{\vartheta}(x_1)\right|\mathclose{},\dots,\mathopen{}\left|\widetilde{\vartheta}(x_{k+1})\right|\mathclose{}, \mathopen{}\left|\overline{\vartheta}(y_1)\right|\mathclose{},\dots,\mathopen{}\left|\overline{\vartheta}(y_{k+1})\right|\mathclose{}\leq n\).

5.4.1 Proof strategy↩︎

We are now ready to give the proof strategy for Theorem [thm32equiv32union]. The proof consists of the following steps.

  1. \(N_{e}\) is an intermediate VPL for all \(e\in\mathcal{Z}\). Moreover, one can effectively compute a vertically visibly pushdown grammar \(G_e\) witnessing that \(N_e\) is indeed intermediate (Lemma [L32intermediate32N]).

  2. \(N_e\leq_{\mathrm{cd}}M_e\) for all \(e\in\mathcal{Z}\) (Lemma [L32uncolor]).

  3. \(M_e\leq_{\mathrm{cd}}N_e\) for all \(e\in\mathcal{Z}\) (Lemma [L32color]).

  4. \(M_e\leq_{\mathrm{cd}}\biguplus_{\text{f\in O_L is \varphi_L(L)-reaching}} L_f\) for all \(e\in\mathcal{Z}\) (Lemma [L32to32old]).

  5. \(L\leq_{\mathrm{cd}}\biguplus_{e\in\mathcal{Z}} M_e\) (Lemma [L32main32intermediate]).

Let us argue that Theorem [thm32equiv32union] follows from the above steps. By Point 1 for all \(e\in\mathcal{Z}\) we have that \(N_e\) is an intermediate VPL, for which moreover one can effectively compute a vertically visibly pushdown grammar \(G_e\) witnessing that \(N_e\) is indeed intermediate. Recalling that \(\mathcal{Z}\not=\emptyset\), it remains to argue that \(L=_{\mathrm{cd}}\biguplus_{e\in\mathcal{Z}} N_e\). Before we prove this let us recall some basics of constant-depth reductions. For this, let \(K,L_1,\dots,L_n,K_1,\dots,K_n\) be languages. Firstly, observe that if \(L_i\leq_{\mathrm{cd}}K_i\) for all \(i\in[1,n]\), then \(\biguplus_{i\in[1,n]}L_i\leq_{\mathrm{cd}}\biguplus_{i\in[1,n]}K_i\). Secondly, if \(L_i\leq_{\mathrm{cd}}K\) for all \(i\in[1,n]\), then \(\biguplus_{i\in[1,n]} L_i \leq_{\mathrm{cd}}K\).

Hence we obtain the following sequence of reductions showing that \(L=_{\mathrm{cd}}\biguplus_{e\in\mathcal{Z}} N_e\). \[\begin{align} L&\stackrel{\text{Point 5}}{\leq_{\mathrm{cd}}}& \biguplus_{e\in\mathcal{Z}} M_e\\[0.2cm] &\stackrel{\text{Point 3}}{\leq_{\mathrm{cd}}}& \biguplus_{e\in\mathcal{Z}} N_e\\[0.2cm] &\stackrel{\text{Point 2}}{\leq_{\mathrm{cd}}}& \biguplus_{e\in\mathcal{Z}} M_e\\[0.2cm] &\stackrel{\text{Point 4}}{\leq_{\mathrm{cd}}}& \biguplus_{\text{f\in O_L is \varphi_L(L)-reaching}} L_f\\[0.2cm] &\stackrel{\text{Lemma~\ref{lemma32reduction32element}}}{\leq_{\mathrm{cd}}}& L \,\,\text{.} \end{align}\]

\(N_{e}\) is an intermediate language for all \(e\in\mathcal{Z}\). Moreover, one can effectively compute a vertically visibly pushdown grammar witnessing that \(N_e\) is indeed an intermediate VPL.

Proof. Let \(e\in\mathcal{Z}\). For showing that \(N_e\) is an intermediate VPL we first show that \(N_e\) is quasi-counterfree. To this end we show that the syntactic morphism \((\varphi_{N_e},\psi_{N_e})\) of \(N_e\) is quasi-aperiodic, which is equivalent by Proposition [prop32quasi-counterfree].

Assume by contradiction that \((\varphi_{N_e},\psi_{N_e})\) is not quasi-aperiodic. Then there exist \(k,l\in\mathbb{N}\) such that \(\psi_{N_e}(\mathcal{O}(\Upsilon^\triangle)^{k,l})\) contains a non-trivial group, say \(G\subseteq O_{N_e}\). Let \(g_0\) be the identity of \(G\) and let \(g_1\in G\) be such that \(g_1\not=g_0\). Thus, we have \(g_1^{i+1}\not=g_1^i\) for all \(\mathbb{N}_{>0}\). We claim that all \(g\in G\) are \(\varphi_{N_e}(N_e)\)-reaching: indeed, if \(g\in G\) were not \(\varphi_{N_e}(N_e)\)-reaching, then the same would hold for all \(g'\in G\) since \(g'=g'g^{-1}g\), hence implying that \(g'\) is the (one and only) zero of \(O_{N_e}\), contradicting that \(G\) is non-trivial. Fix some \(\mathop{\mathrm{ext}}_{u_0,v_0},\mathop{\mathrm{ext}}_{u_1,v_1}\in\mathcal{O}(\Upsilon^\triangle)^{k,l}\) such that \(\psi_{N_e}(\mathop{\mathrm{ext}}_{u_0,v_0})=g_0\) and \(\psi_{N_e}(\mathop{\mathrm{ext}}_{u_1,v_1})=g_1\). Note that we must have \(k>0\) or \(l>0\) for otherwise we would have \(u_0=u_1=\varepsilon\) and \(v_0=v_1=\varepsilon\), a contradiction to \(g_0\not=g_1\). We moreover claim that \(u_0,u_1\not\in\widetilde{\Sigma}^*\) and hence \(v_0,v_1\not\in\overline{\Sigma}^*\): indeed, a consequence of Remark [remark32flat] is that \(\mathop{\mathrm{ext}}_{u,v}\in\psi_{N_e}^{-1}(f)\cap\widetilde{\Sigma}^s\times \overline{\Sigma}^t\) implies \(s,t\leq n\) for all \(\varphi_{N_e}(N_e)\)-reaching \(f\in O_{N_e}\), yet the fact that \(\psi_{N_e}(\mathop{\mathrm{ext}}_{u^i,v^i})\) is in \(G\) and thus \(\varphi_{N_e}(N_e)\)-reaching for all \(i\geq 1\) contradicts this (recall that \(|u_1|>0\) or \(|v_1|>0\)). In other words, both \(u_0\) and \(u_1\) contain at least one letter from \(\Sigma_\text{call}\) and both \(v_0\) and \(v_1\) contain a letter from \(\Sigma_\text{ret}\).

Next we claim that neither \(u_0\) nor \(u_1\) contain any letter from \(\Sigma_\text{ret}\): indeed, without loss of generality if \(u_1\) were to contain a letter from \(\Sigma_\text{ret}\) then \(\psi_{N_e}(\mathop{\mathrm{ext}}_{u_1^2,v_1^2})\) would be the zero of \(O_{N_e}\), contradicting that \(\psi_{N_e}(\mathop{\mathrm{ext}}_{u_1^2,v_1^2})\) is in \(G\). It follows that \(u_0,u_1\in(\widetilde{\Sigma}^*\Sigma_\text{call}\widetilde{\Sigma}^*)^+\) and hence that \(v_0,v_1\in(\overline{\Sigma}^*\Sigma_\text{ret}\overline{\Sigma}^*)^+\).

Let \(u_0'=\widetilde{\vartheta}^{-1}(u_0)\), \(u_1'=\widetilde{\vartheta}^{-1}(u_1)\), \(v_0'=\overline{\vartheta}^{-1}(v_0)\), \(v_1'=\overline{\vartheta}^{-1}(v_1)\) and note that \(\mathop{\mathrm{ext}}_{u_0',v_0'},\mathop{\mathrm{ext}}_{u_1',v_1'} \in\mathcal{O}(\Sigma^{k,l})\). Since \(\mathfrak{P}(O_L)\) forms a monoid there exists \(p \in \mathbb{N}_{>0}\) such that \[\psi_L(\{\mathop{\mathrm{ext}}_{u_0', v_0'}, \mathop{\mathrm{ext}}_{u_1', v_1'}\})^p = \psi_L(\{\mathop{\mathrm{ext}}_{u_0', v_0'}, \mathop{\mathrm{ext}}_{u_1', v_1'}\})^{2 p} \,\,\text{.}\] This implies that for all \(i \in \mathbb{N}_{>0}\), we have \[\psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^i \in \psi_L(\{\mathop{\mathrm{ext}}_{u_0', v_0'}, \mathop{\mathrm{ext}}_{u_1', v_1'}\})^{i p} = \psi_L(\{\mathop{\mathrm{ext}}_{u_0', v_0'}, \mathop{\mathrm{ext}}_{u_1', v_1'}\})^p \,\,\text{.}\] Hence, as \(\mathopen{}\left|u_0\right|\mathclose{}=\mathopen{}\left|u_1\right|\mathclose{}=\mathopen{}\left|u_0'\right|\mathclose{} = \mathopen{}\left|u_1'\right|\mathclose{} = k\) and \(\mathopen{}\left|v_0\right|\mathclose{}=\mathopen{}\left|v_1\right|\mathclose{}=\mathopen{}\left|v_0'\right|\mathclose{} = \mathopen{}\left|v_1'\right|\mathclose{} = l\), the semigroup \(\{\psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^i \mid i \in \mathbb{N}_{>0}\}\) is contained in \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k p, l p})\). We show that the latter semigroup is not aperiodic by showing \(\psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^i\not= \psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^{i+1}\) for all \(i\in\mathbb{N}_{>0}\). Indeed, since \[\psi_{N_e}\left(\left(\mathop{\mathrm{ext}}_{u_0^{p-1}u_1,v_1v_0^{p-1}}\right)^{i+1}\right)=g_1^{i+1}\not= g_1^{i+2}=\psi_{N_e}\left(\left(\mathop{\mathrm{ext}}_{u_0^{p-1}u_1,v_1v_0^{p-1}} \right)^{i+2}\right)\] there exist \(\mathop{\mathrm{ext}}_{x,y}\in\mathcal{O}(\Upsilon^\triangle)\) and \(w\in\Upsilon^\triangle\) such that, without loss of generality \[\left(\mathop{\mathrm{ext}}_{x,y}\circ \left(\mathop{\mathrm{ext}}_{u_0^{p-1}u_1,v_1v_0^{p-1}}\right)^{i+1}\right)(w)\in N_e \;\:\text{and}\;\: \left(\mathop{\mathrm{ext}}_{x,y}\circ \left(\mathop{\mathrm{ext}}_{u_0^{p-1}u_1,v_1v_0^{p-1}}\right)^{i+2}\right)(w)\not\in N_e \,\,\text{.}\] Now since \(u_0,u_1\in(\widetilde{\Sigma}^*\Sigma_\text{call}\widetilde{\Sigma}^*)^+\) there exists a factorization \(u_0^{p-1}u_1wv_1v_0^{p-1}=x'y'\) such that \[\left(\mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x),\overline{\vartheta}^{-1}(y)}\circ \left(\mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(u_0^{p-1}u_1), \overline{\vartheta}^{-1}(v_1v_0^{p-1})}\right)^{i}\right)( \widetilde{\vartheta}^{-1}(x')\#\overline{\vartheta}^{-1}(y'))\in M_e\] and \[\left(\mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x),\overline{\vartheta}^{-1}(y)}\circ \left(\mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(u_0^{p-1}u_1), \overline{\vartheta}^{-1}(v_1v_0^{p-1})}\right)^{i+1}\right)( \widetilde{\vartheta}^{-1}(x')\#\overline{\vartheta}^{-1}(y'))\not\in M_e\] By definition of \(M_e\) we obtain \[\begin{align} e&=&e\circ\psi_L\left(\mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x(u_0^{p-1}u_1)^ix'), \overline{\vartheta}^{-1}(y'(v_1v_0^{p-1})^iy)}\right)\\ &=&e\circ\psi_L\left( \mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x),\overline{\vartheta}^{-1}(y)} \right) \circ \psi_L\left( \mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(u_0^{p-1}u_1), \overline{\vartheta}^{-1}(v_1v_0^{p-1})}\right)^i \circ \psi_L\left( \mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x'),\overline{\vartheta}^{-1}(y')} \right) \end{align}\] and \[\begin{align} e&\not=&e\circ\psi_L\left(\mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x(u_0^{p-1}u_1)^{i+1}x'), \overline{\vartheta}^{-1}(y'(v_1v_0^{p-1})^{i+1}y)}\right)\\ &=&e\circ\psi_L\left( \mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x),\overline{\vartheta}^{-1}(y)} \right) \circ \psi_L\left( \mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(u_0^{p-1}u_1), \overline{\vartheta}^{-1}(v_1v_0^{p-1})}\right)^{i+1} \circ \psi_L\left( \mathop{\mathrm{ext}}_{\widetilde{\vartheta}^{-1}(x'),\overline{\vartheta}^{-1}(y')} \right)\!. \end{align}\] Thus, we must have \(\psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^i\not= \psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^{i+1}\), as required. As this is true for each \(i \in \mathbb{N}_{>0}\), the semigroup \(\{\psi_L(\mathop{\mathrm{ext}}_{u_0'^{p - 1} u_1', v_1' v_0'^{p - 1}})^i \mid i \in \mathbb{N}_{>0}\}\) that is contained in \(\psi_L(\mathcal{O}(\Sigma^\triangle)^{k p, l p})\) is not aperiodic, contradicting quasi-aperiodicity of \((\varphi_L, \psi_L)\).

It remains to show that one can compute a vertically visibly pushdown grammar \(G_e\) with \(L(G_e)=N_e\) such that \(\mathcal{R}(G_e)\) is weakly length-synchronous but not length-synchronous. By Remark [remark32flat] each non-empty word in \(N_e\) is of the form \[(u\#v)^\ddagger= \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_1),\overline{\vartheta}(y_1)} \circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_{k}),\overline{\vartheta}(y_{k})} \circ\mathop{\mathrm{ext}}_{a_k,b_k}\circ \mathop{\mathrm{ext}}_{\widetilde{\vartheta}(x_{k+1}),\overline{\vartheta}(y_{k+1})}(\varepsilon)\] for some \(k\geq 1\) and some words \(x_1,\dots,x_{k+1},y_1,\dots,y_{k+1}\in\Sigma^\triangle\) all of which have length at most \(n\) such that moreover \(e\circ\psi_L(\mathop{\mathrm{ext}}_{u,v})=e\). We construct the grammar \(G_e=(V,\Upsilon,P,S_e)\) as follows. The set of nonterminals is \(V=\{S_f\mid f\in O_L\}\), \(S_e\in V\) is the start nonterminal, the set of productions consists of the union of \(\{S_e\rightarrow_{G_e}\varepsilon\}\) and \[\begin{align} \left\{\biggl.S_f\rightarrow_{G_e}\widetilde{\vartheta}(x_1)a\widetilde{\vartheta}(x_2)S_g \overline{\vartheta}(y_2)b\overline{\vartheta}(y_1)\right. \!\!\!&\bigm|&\!\!\! f,g\in O_L, x_1,x_2,y_1,y_2\in\Sigma^\triangle, |x_1|,|x_2|,|y_1|,|y_2|\leq n, \\ &&\!\!\! a\in\Sigma_\text{call},b\in\Sigma_\text{ret}, \left.\biggl.f\circ\psi_L(\mathop{\mathrm{ext}}_{x_1ax_2,y_2by_1})=g\right\}. \end{align}\] As a consequence we obtain \[\begin{align} \mathcal{R}(G_e)=\left\{\biggl.\left(\widetilde{\vartheta}(x_1)\dots a_k\widetilde{\vartheta}(x_{x+1}), \overline{\vartheta}(y_{k+1})b_k\dots \overline{\vartheta}(y_1)\right)\right. \!\!\!&\big|&\!\!\! x_1,\dots,x_{k+1},x_1,\dots,y_{k+1}\in\Sigma^\triangle,\\ && \!\!\!a_1,\dots,a_{k}\in\Sigma_\text{call}, b_1,\dots,b_{k}\in\Sigma_\text{ret},\\ &&\!\!\! \left.e\circ\psi_L(\mathop{\mathrm{ext}}_{a_1\dots a_{k}x_{k+1},y_{k+1}b_k\dots y_1})=e \biggl.\right\} \end{align}\] \[\begin{align} \phantom{\mathcal{R}(G_e)}=\left\{\biggl.\left(\widetilde{\vartheta}(x_1)\dots a_k\widetilde{\vartheta}(x_{x+1}), \overline{\vartheta}(y_{k+1})b_k\dots \overline{\vartheta}(y_1)\right)\right. \!\!\!&\big|&\!\!\! x_1,\dots,x_{k+1},x_1,\dots,y_{k+1}\in\Sigma^\triangle,\\ && \!\!\!a_1,\dots,a_{k}\in\Sigma_\text{call}, b_1,\dots,b_{k}\in\Sigma_\text{ret},\\ &&\!\!\! \left.\left(x_1\dots a_{k}x_{k+1},y_{k+1}b_k\dots y_1\right)\in \mathcal{U}_e\biggl.\right\}\!. \end{align}\] It follows that \(\mathcal{R}(G_e)\) is weakly length-synchronous since \(\mathcal{U}_e\) is: indeed, if \(\mathcal{R}(G_e)\) were not weakly length-synchronous and without loss of generality there were to exist \((u,v),(u',v')\in\mathcal{R}(G_e)\) with \(u=u'\) and \(|v|\not=|v'|\), then both \((\widetilde{\vartheta}^{-1}(u),\overline{\vartheta}^{-1}(v))\) and \((\widetilde{\vartheta}^{-1}(u'),\overline{\vartheta}^{-1}(v'))\) would be in \(\mathcal{U}_e\) by definition. Yet \(\widetilde{\vartheta}^{-1}(u)= \widetilde{\vartheta}^{-1}(u')\) and \(|\overline{\vartheta}^{-1}(v)|=|v|\not=|v'|=\overline{\vartheta}^{-1}(v')\), so this would contradict that \(\mathcal{U}_e\) is indeed weakly length-synchronous. Analogously it follows that \(\mathcal{R}(G_e)\) is not length-synchronous since \(\mathcal{U}_e\) is not length-synchronous by assumption. ◻

\(N_e\leq_{\mathrm{cd}}M_e\) for all \(e\in\mathcal{Z}\).

Proof. Assume we are given \(w\in\Upsilon^*\). To decide if \(w\in N_e\) using an oracle to \(M_e\) we do the following constant-depth computation:

  1. Accept if \(w = \varepsilon\), otherwise continue.

  2. Check if \(w=uv\) for some \(u\in(\widetilde{\Sigma}\cup\Sigma_\text{call})^*\) and some \(v\in(\overline{\Sigma}\cup\Sigma_\text{ret})^*\), reject if this is not the case.

  3. Check whether \(u\) can be factorized as \(u=x_1a_1\cdots x_ka_kx_{k+1}\), where \(k\geq 1\), \(x_1,\dots,x_{k+1}\in \{x \in \widetilde{\Sigma}^* \mid \mathopen{}\left|x\right|\mathclose{} \leq n \wedge \widetilde{\vartheta}^{-1}(x) \in \Sigma^\triangle\}\) and \(a_1,\dots,a_k\in\Sigma_\text{call}\) and whether \(v\) can be factorized as \(v=y_{l+1}b_ly_l\cdots a_1y_1\), where \(l\geq 1\), \(y_1,\dots,y_{l+1}\in \{y \in \overline{\Sigma}^* \mid \mathopen{}\left|y\right|\mathclose{} \leq n \wedge \overline{\vartheta}^{-1}(y) \in \Sigma^\triangle\}\) and \(b_1,\dots,b_l\in\Sigma_\text{ret}\). Reject if it is not possible. (Observe that this is doable by a constant depth and polynomial size circuit family since we test membership in finite sets that do not depend on the input.)

  4. Finally accept if, and only if, the word \[\widetilde{\vartheta}^{-1}(x_1)a_1\cdots \widetilde{\vartheta}^{-1}(x_{k-1}) a_k \widetilde{\vartheta}^{-1}(x_{k+1}) \# \overline{\vartheta}^{-1}(y_{l+1})b_l \overline{\vartheta}^{-1}(y_{l+1}) \cdots b_1 \overline{\vartheta}^{-1}(y_{1})\] is in \(M_e\).

 ◻

\(M_e\leq N_e\) for all \(e\in\mathcal{Z}\).

Proof. Assume we are given \(w\in(\Sigma\cup\{\#\})^*\), where \(w=w_1\cdots w_m\) and where \(w_i\in\Sigma\cup\{\#\}\) for all \(i\in[1,m]\). To decide if \(w\in M_e\) using an oracle to \(N_e\) we do the following constant-depth computation:

  1. Check if \(w=u\#v\) for some \(u\in\Sigma^+\) and some \(v\in\Sigma^+\), reject otherwise.

  2. For all return letters \(b\in\Sigma_\text{ret}\) and all positions \(j\) within \(u\) at which \(b\) appears, check whether there exists a position \(i\) within \(u\) such that \(1 \leq j - i \leq n - 1\) and the infix \(w_i\cdots w_j\) is in \(\Sigma^\triangle\). (As above, this is doable by a constant depth and polynomial size circuit family since we check well-matchedness of at most a fixed number of words that does not depend on the input.) Reject if it is not the case.

  3. For all call letters \(a\in\Sigma_\text{call}\) and all positions \(i\) within \(v\) at which \(a\) appears, check whether there exists a position \(j\) within \(v\) such that \(1 \leq j - i \leq n - 1\) and the infix \(w_i \cdots w_j\) is in \(\Sigma^\triangle\). Reject if it is not the case.

  4. For each position \(i\) within \(u\), compute \(P_\text{call}(i)\) where \(P_\text{call}\) is the unary predicate defined by \(w\models P_\text{call}(i)\) if, and only if, \(i\) is a position within \(u\), \(w_i\in\Sigma_\text{call}\), and there does not exist any position \(j\) within \(u\) such that \(1 \leq j - i \leq n - 1\) and the infix \(w_i\cdots w_j\) is in \(\Sigma^\triangle\).

  5. For each position \(j\) within \(v\), compute \(P_\text{ret}(j)\) where \(P_\text{ret}\) is the unary predicate defined by \(w\models P_\text{ret}(j)\) if, and only if, \(j\) is a position within \(v\), \(w_j\in\Sigma_\text{ret}\), and there does not exist any position \(i\) within \(v\) such that \(1 \leq j - i \leq n - 1\) and the infix \(w_i\cdots w_j\) is in \(\Sigma^\triangle\).

  6. Let \(1\leq i_1<i_2\dots <i_k\leq|u|\) be an enumeration of \(\{i\in[1,|u|]\mid w\models P_\text{call}(i)\}\) and let \(|u|+2\leq j_l<j_{l-1}\dots <j_1\leq m\) be an enumeration of \(\{j\in[|u|+2,m]\mid w\models P_\text{ret}(j)\}\). Build \[u'=\widetilde{\vartheta} (w_{1}\cdots w_{i_1-1})w_{i_1} \cdots \widetilde{\vartheta}(w_{i_{k-1}+1}\cdots w_{i_k-1})w_{i_k} \widetilde{\vartheta}(w_{i_{k+1}+1}\cdots w_{|u|})\] and \[v'=\overline{\vartheta}(w_{|u|+2}\cdots w_{j_{l+1}-1}) w_{j_l}\cdots \overline{\vartheta} (w_{j_2}+1\cdots w_{j_1-1})w_{j_1} \overline{\vartheta} (w_{j_1}+1\cdots w_{m}).\]

  7. Accept if, and only if, the word \(u'v'\) is in \(N_e\).

 ◻

\(M_e\leq_{\mathrm{cd}}\biguplus_{\text{f\in O_L is \varphi_L(L)-reaching}} L_f\) for all \(e\in\mathcal{Z}\).

Proof. Note that the following equivalence holds: \[u\#v \in M_e\quad\Longleftrightarrow\quad \text{\exists f\in O_L that is \varphi_L(L)-reaching}: e\circ f=e\wedge u\#v\in L_f\wedge \Delta(u)>0 \,\,\text{.}\] This holds because for \(\mathop{\mathrm{ext}}_{u, v} \in \mathcal{O}(\Sigma^\triangle)\) satisfying \(e \circ \psi_L(\mathop{\mathrm{ext}}_{u, v}) = e\), as \(e\) is \(\varphi_L(L)\)-reaching, \(\psi_L(\mathop{\mathrm{ext}}_{u, v})\) must also be \(\varphi_L(L)\)-reaching. Assume we are given \(w\in(\Sigma\cup\{\#\})^*\). To decide if \(w\in M_e\) we do the following constant-depth computation using oracles to \(\biguplus_{\text{f\in O_L is \varphi_L(L)-reaching}} L_f\):

  1. Check if \(w=u\#v\) for some \(u,v\in\Sigma^*\), reject otherwise.

  2. Check if \(u\#v\in L_f\) for some \(\varphi_L(L)\)-reaching \(f\in O_L\) satisfying \(e\circ f=e\), reject otherwise.

  3. Finally, accept if, and only if for all \(\varphi_L(L)\)-reaching \(f\in O_L\) we have \(u\#\not\in L_f\).

If the second check is successful, then \(\psi_L(\mathop{\mathrm{ext}}_{u,v})\) is necessarily \(\varphi_L(L)\)-reaching, so in that case when \(\Delta(u)=0\) it holds that \(u \in \Sigma^\triangle\) and \(\psi_L(\mathop{\mathrm{ext}}_{u, \varepsilon})\) is \(\varphi_L(L)\)-reaching. Hence, in combination with the second check, the third check is successful if, and only if \(\Delta(u)>0\). ◻

\(L\leq_{\mathrm{cd}}\biguplus_{e\in\mathcal{Z}} M_e\).

Proof. By assumption \(L\) is weakly length-synchronous but not length-synchronous, and its syntactic morphism \((\varphi_L,\psi_L)\) is quasi-aperiodic. There is a constant \(d_L\) such that all words in \(L\) have nesting depth at most \(d_L\) by Proposition [ptn:Bounded95nesting-depth].

By the first point of Proposition [ptn:Quasi-aperiodicity95eval95languages] we may assume that the evaluation language \(\mathcal{E}_{\varphi_L,r}\) is regular and its syntactic morphism is quasi-aperiodic for all \(\varphi_L(L)\)-reaching \(r\in R_L\). This implies, by [2], that for each \(\varphi_L(L)\)-reaching \(r \in R_L\), there exists an \(\mathsf{FO}_{\Gamma_{\varphi_L}}[<, \mathsf{MOD}]\)-sentence \(\nu_{\varphi_L, r}\) defining \(\mathcal{E}_{\varphi_L, r}\).

As \(L\) is not length-synchronous we cannot assume analogous sentences for the evaluation languages \(\mathcal{E}_{\psi_L,e}\) for all \(\varphi_L(L)\)-reaching \(e\in O_L\). Indeed, Remark [remark32not32weakly] provides an example of a weakly length-synchronous but non-length-synchronous VPL whose syntactic morphism is quasi-aperiodic but for which some evaluation language \(\mathcal{E}_{\psi_L,e}\) for \(e \in O_L\) that is \(\varphi_L(L)\)-reaching has a non-quasi-aperiodic syntactic morphism.

However, let \(e \in O_L\) be such that \(\mathcal{R}_e = \{(u,v) \in \mathsf{Con}(\Sigma) \mid\psi_L(\mathop{\mathrm{ext}}_{u,v})=e\}\) is length-synchronous. Take any \(\varphi_L(L)\)-reaching idempotent \(f \in O_L\) such that there exist \(g, h \in O_L\) satisfying \(e = g \circ f \circ h\). There exist \(\mathop{\mathrm{ext}}_{x_g, y_g}, \mathop{\mathrm{ext}}_{x_h, y_h} \in \mathcal{O}(\Sigma^\triangle)\) such that \(\psi_L(\mathop{\mathrm{ext}}_{x_g, y_g}) = g\) and \(\psi_L(\mathop{\mathrm{ext}}_{x_h, y_h}) = h\). Let \((u, v), (u', v') \in\mathsf{Con}(\Sigma)\) such that \(\Delta(u), \Delta(u') > 0\) and \(\psi_L(\mathop{\mathrm{ext}}_{u, v}) = \psi_L(\mathop{\mathrm{ext}}_{u', v'}) = f\). Because \(f\) is idempotent, we have that \(\psi_L(\mathop{\mathrm{ext}}_{u^{\mathopen{}\left|v'\right|\mathclose{}}, v^{\mathopen{}\left|v'\right|\mathclose{}}}) = \psi_L(\mathop{\mathrm{ext}}_{u'^{\mathopen{}\left|v\right|\mathclose{}}, v'^{\mathopen{}\left|v\right|\mathclose{}}}) = f\), thus \(\psi_L(\mathop{\mathrm{ext}}_{x_g u^{\mathopen{}\left|v'\right|\mathclose{}} x_h, y_h v^{\mathopen{}\left|v'\right|\mathclose{}} y_g}) = \psi_L(\mathop{\mathrm{ext}}_{x_g u'^{\mathopen{}\left|v\right|\mathclose{}} x_h, y_h v'^{\mathopen{}\left|v\right|\mathclose{}} y_g}) = e\). Therefore, because of length-synchronicity of \(\mathcal{R}_e\), it follows that \[\begin{align} \frac{\mathopen{}\left|x_g u^{\mathopen{}\left|v'\right|\mathclose{}} x_h\right|\mathclose{}}{\mathopen{}\left|y_h v^{\mathopen{}\left|v'\right|\mathclose{}} y_g\right|\mathclose{}} & = \frac{\mathopen{}\left|x_g u'^{\mathopen{}\left|v\right|\mathclose{}} x_h\right|\mathclose{}}{\mathopen{}\left|y_h v'^{\mathopen{}\left|v\right|\mathclose{}} y_g\right|\mathclose{}}\\ \frac{\mathopen{}\left|x_g\right|\mathclose{} + \mathopen{}\left|v'\right|\mathclose{} \cdot \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|x_h\right|\mathclose{}}{\mathopen{}\left|y_h\right|\mathclose{} + \mathopen{}\left|v'\right|\mathclose{} \cdot \mathopen{}\left|v\right|\mathclose{} + \mathopen{}\left|y_g\right|\mathclose{}} & = \frac{\mathopen{}\left|x_g\right|\mathclose{} + \mathopen{}\left|v\right|\mathclose{} \cdot \mathopen{}\left|u'\right|\mathclose{} + \mathopen{}\left|x_h\right|\mathclose{}}{\mathopen{}\left|y_h\right|\mathclose{} + \mathopen{}\left|v\right|\mathclose{} \cdot \mathopen{}\left|v'\right|\mathclose{} + \mathopen{}\left|y_g\right|\mathclose{}}\\ \mathopen{}\left|v'\right|\mathclose{} \cdot \mathopen{}\left|u\right|\mathclose{} & = \mathopen{}\left|v\right|\mathclose{} \cdot \mathopen{}\left|u'\right|\mathclose{}\\ \frac{\mathopen{}\left|u\right|\mathclose{}}{\mathopen{}\left|v\right|\mathclose{}} & = \frac{\mathopen{}\left|u'\right|\mathclose{}}{\mathopen{}\left|v'\right|\mathclose{}} \,\,\text{.} \end{align}\] So we can conclude that \(\mathcal{R}_f = \{(u,v) \in \mathsf{Con}(\Sigma)\mid\psi_L(\mathop{\mathrm{ext}}_{u,v})=f\}\) is length-synchronous. Thus, by the second point of Proposition [ptn:Quasi-aperiodicity95eval95languages] we may assume that the evaluation language \(\mathcal{E}_{\psi_L,e}\) is regular and its syntactic morphism is quasi-aperiodic for all \(\varphi_L(L)\)-reaching \(e\in O_L\) with \(\mathcal{R}_e\) length-synchronous. This implies again, by [2], that for each \(\varphi_L(L)\)-reaching \(e \in O_L\) with \(\mathcal{R}_e\) length-synchronous, there exists an \(\mathsf{FO}_{\Gamma_{\psi_L}}[<, \mathsf{MOD}]\)-sentence \(\nu_{\psi_L, e}\) defining \(\mathcal{E}_{\psi_L, e}\).

For proving \(L\leq_{\mathrm{cd}}\biguplus_{e\in\mathcal{Z}} M_e\) we must thus make use of the oracles to \(\biguplus_{e\in\mathcal{Z}} M_e\). All of the following predicates can be computed by a circuit family of constant depth and polynomial size with access to these oracles. More concretely, by accessing oracles to \(\biguplus_{e\in\mathcal{Z}} M_e\), for all \(e\in\mathcal{Z}\) we may assume that we have a predicate \(\pi_e^{\mathsf{exact}}\) such that for all \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\) the following holds: \[\begin{align} \label{P321} w\models\pi_e^{\mathsf{exact}}(i,i',j',j)&\quad\Longleftrightarrow\quad& w_i\cdots w_{i'} w_{j'} \cdots w_j\in\Sigma^\triangle,\\ && e\circ\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j})=e \text{ and }\nonumber\\&&\Delta(w_i\cdots w_{i'})>0\nonumber \end{align}\tag{4}\]

For all \(\varphi_L(L)\)-reaching \(e\in O_L\) that are not in \(\mathcal{Z}\) we may assume, by Lemma [lem:Synchronous95element95matching], that we have the \(\ifthenelse{\equal{\null}{\null}} { \mathsf{FO}[\mathsf{+}] } { \mathsf{FO}_{\null}[\mathsf{+}] }\)-definable (and hence constant-depth computable) predicate \(\pi_e\) at hand. It has the following properties: for all \(w \in \Sigma^+\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\):

  • if \(w\models \pi_e(i, i', j', j)\), then \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) and

  • if \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\), \(\Delta(w_i \cdots w_{i'}) > 0\) and \(e \circ \psi_L(\mathop{\mathrm{ext}}_{w_i \cdots w_{i'}, w_{j'} \cdots w_j}) = e\), then \(w\models \pi_e(i, i', j', j)\).

We can first build an approximate matching \(\mu\) relative to \(L\). This is done totally analogously as done in Section 5.3.4.1 by replacing the there appearing \(\pi_e\) for each \(e\in\mathcal{Z}\) by our predicate \(\pi_e^{\mathsf{exact}}\): indeed, Remark [remark32up] states that the predicates \(\pi_e\) from of Lemma [lem:Synchronous95element95matching] could have been replaced by the predicate \(\pi_e^{\mathsf{exact}}\).

Thus, as in the proof of Proposition [ptn:Eval95languages95and95bounded95nesting-depth] we may assume that we have full access to the matching relation \(M^\Delta(w)\) of our input word \(w\).

For verifying if a given word \(w\in\Sigma^\triangle\) is in \(L\) we follow the same approach as the main construction in Section 5.3.5. It is however important to stress that this time we cannot assume quasi-aperiodicity of the syntactic morphisms of the evaluation languages \(\mathcal{E}_{\psi_L,e}\) for all \(\varphi_L(L)\)-reaching \(e\in O_L\). Still, we build formulas

  • \(\overline{\eta}_{d, r}^\uparrow(x, y)\) for all \(d\in[0,d_L]\) and all \(\varphi_L(L)\)-reaching \(r \in R_L\) and

  • \(\overline{\eta}_{d, r}(x, y)\) for all \(d\in[0,d_L]\) and all \(\varphi_L(L)\)-reaching \(r\in R_L\)

that will have the following properties (as \(\eta_{d,r}\) and \(\eta_{d,r}^\uparrow\)) for all \(w\in\Sigma^\triangle\) and all \(i,j\in[1,\mathopen{}\left|w\right|\mathclose{}]\):

  • if \(i\) is matched to \(j\) in \(w\), then \((w, M^\triangle\left(w\right)) \models \overline{\eta}_{d, r}^\uparrow(i, j)\) if, and only if, \(\mathop{\mathrm{nd}}(w_i \cdots w_j) \leq d\) and \(\varphi_L(w_i \cdots w_j) = r\);

  • if \(w_i \cdots w_j \in \Sigma^\triangle\), then \((w, M^\triangle\left(w\right)) \models \overline{\eta}_{d, r}(i, j)\) if, and only if, \(\mathop{\mathrm{nd}}(w_i \cdots w_j) \leq d\) and \(\varphi_L(w_i \cdots w_j) = r\).

It remains to define the formulas \(\overline{\eta}_{d,r}\) and \(\overline{\eta}_{d,r}^\uparrow\) for all \(d\in[0,d_L]\) and all \(\varphi_L(L)\)-reaching \(r\in R_L\). For the definition of the \(\overline{\eta}_{0,r}^\uparrow\) and the \(\overline{\eta}_{0,r}\) we can simply reuse \(\eta_{0,r}\) and \(\eta_{0,r}^\uparrow\) as in the proof of Proposition [ptn:Eval95languages95and95bounded95nesting-depth] respectively (\(\eta_{0,r}\) will make use of our sentence \(\nu_{\varphi_L,r}\)). So let us assume \(d>0\).

We first construct for all \(\varphi_L(L)\)-reaching \(e\in O_L\) a formula \(\overline{\chi}_{d,e}(x,x',y',y)\) such that for all \(w \in \Sigma^\triangle\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\) we have that if \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) and \(i'\) is matched to \(j'\) in \(w\), then given \[\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}= \mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k}\] the stair factorization of \(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}\) provided by Lemma [lemma32ext], we have \((w, M^\triangle\left(w\right)) \models \overline{\chi}_{d,e}(i,i',j',j)\) if, and only if, \(\mathop{\mathrm{nd}}(x_\ell), \mathop{\mathrm{nd}}(y_\ell) < d\) for all \(\ell \in [1, k]\) and \(\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j})=e\). Given \(w, i, i', j', j\) and the associated stair factorization as above, note that whenever \(\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}) = e\), as \(e\) is \(\varphi_L(L)\)-reaching, then \(\varphi_L(x_\ell)\) and \(\varphi_L(y_\ell)\) are \(\varphi_L(L)\)-reaching for all \(\ell \in [1, k]\). If additionally \(\mathop{\mathrm{nd}}(x_\ell), \mathop{\mathrm{nd}}(y_\ell) < d\) for all \(\ell \in [1, k]\), we can inductively make use of the formulas \(\{\overline{\eta}_{d-1,r'}\mid r'\in R_L \text{ \varphi_L(L)-reaching}\}\) in order to evaluate \(\varphi_L(x_1), \varphi_L(y_1), \ldots, \varphi_L(x_k), \varphi_L(y_k)\).

As expected, the problems are, firstly, that we cannot necessarily access our evaluation languages \(\mathcal{E}_{\psi_L,e}\) and, secondly, that we have to build a formula that may not depend on \(k\). As in Section 5.3.4.1 we define the product \[e_{\ell,\ell'}= \psi_L(\mathop{\mathrm{ext}}_{x_\ell,y_\ell}\circ\mathop{\mathrm{ext}}_{a_{\ell},b_{\ell}}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_{\ell'},y_{\ell'}}\circ\mathop{\mathrm{ext}}_{a_{\ell'},b_{\ell'}})\quad \text{and}\quad e_\ell=e_{1,\ell}\] for all \(\ell,\ell'\in[1,k]\). We say an interval \(I=[s,t]\subseteq[1,k]\) is repetitive if \(s<t\) and \(e_s=e_t\).

By Claim [claim32pigeon] there exist indices \(1=t_0\leq s_1<t_1<s_2<t_2<\cdots<s_q<t_q\leq s_{q+1}=k\) such that \([s_1,t_1],\ldots, [s_q,t_q]\) are all repetitive and for \(D_0=[t_0,s_1],D_1=[t_1,s_2],\dots,D_q=[t_q,s_{q+1}]\) we have \(q+\sum_{p=0}^q\left|D_p\right|\leq 3\left|O_L\right|\). Let \(i=i_1<\cdots<i_k\) and \(j_k<\cdots<j_1=j\) be the positions that correspond to the positions of the letters \(a_1,\dots,a_k\in\Sigma_\text{call}\) and \(b_k,\dots, b_1\in\Sigma_\text{ret}\) of the factorization of \(\mathop{\mathrm{ext}}_{w_i \cdots w_{i'}, w_{j'} \cdots w_j}\) in \(w\), respectively: more precisely \(i_\ell=i+\mathopen{}\left|x_1\cdots a_{\ell-1}x_\ell\right|\mathclose{}\) and \(j_\ell=\mathopen{}\left|x_1 a_1 \cdots x_k a_k w_{i'+1} \cdots w_{j'-1} b_k y_{k} \cdots b_{\ell+1} y_{\ell+1}\right|\mathclose{}+1\) for all \(\ell\in[1,k]\). Since the non-empty interval \([s_p,t_p]\) is repetitive for all \(p\in[1,q]\), we have \(e_{s_p}=e_{t_p}\) and thus obtain \[e_{s_p}=e_{t_p}= e_{s_p}\circ\psi(\mathop{\mathrm{ext}}_{x_{s_p+1}\cdots a_{t_p},b_{t_p}\cdots y_{s_p+1}}) \,\,\text{.}\] Given \(p \in [1, q]\), if \(e_{s_p} \in \mathcal{Z}\), we can use the predicate \(\pi_{e_{s_p}}^{\mathsf{exact}}\) to check the above equality; we set \(\theta_{d, e_{s_p}}(x, x', y', y) = \pi_{e_{s_p}}^{\mathsf{exact}}(x, x', y', y)\). If \(e_{s_p}\notin\mathcal{Z}\) and is \(\varphi_L(L)\)-reaching, then \(\mathcal{U}_{e_{s_p}}\) is length-synchronous, so for all \(e' \in O_L\) such that \(e_{s_p} \circ e' = e_{s_p}\), we have that \(e'\) is \(\varphi_L(L)\)-reaching and \(\mathcal{R}_{e'} = \{(u,v) \in \mathsf{Con}(\Sigma) \mid \psi_L(\mathop{\mathrm{ext}}_{u,v})=e'\}\) is length-synchronous. So to check the above equality, we can use the formula \(\theta_{d, e_{s_p}}(x, x', y', y)\) built by taking the disjunction over all \(e' \in O_L\) such that \(e_{s_p} \circ e' = e_{s_p}\) of the formulas defined inductively completely analogously as \(\chi_{d, e'}(x, x', y', x')\) in Section 5.3.5 (using the sentence \(\nu_{\psi_L, e'}\) defining \(\mathcal{E}_{\psi_L, e'}\)): we simply replace every occurrence of \(\eta_{d-1,r}\) by \(\overline{\eta}_{d-1,r}\).

Next, for all \(m>0\) and all \(\varphi_L(L)\)-reaching \(f\in O_L\) we will construct a formula \(\alpha_{d, m, f}(x,x',y',y)\) such that for all \(w \in \Sigma^\triangle\) and \(i, i', j', j \in [1, \mathopen{}\left|w\right|\mathclose{}], i \leq i' < j' \leq j\) we have that if \(w_i \cdots w_{i'} w_{j'} \cdots w_j \in \Sigma^\triangle\) and \(i'\) is matched to \(j'\) in \(w\), then given \[\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}= \mathop{\mathrm{ext}}_{x_1,y_1}\circ\mathop{\mathrm{ext}}_{a_1,b_1}\circ\cdots\circ \mathop{\mathrm{ext}}_{x_k,y_k}\circ\mathop{\mathrm{ext}}_{a_k,b_k}\] the stair factorization of \(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j}\) provided by Lemma [lemma32ext], we have \((w, M^\triangle\left(w\right)) \models \alpha_{d,m,f}(i,i',j',j)\) if, and only if, \(\mathop{\mathrm{nd}}(x_\ell), \mathop{\mathrm{nd}}(y_\ell) < d\) for all \(\ell \in [1, k]\), \(\Delta(w_i \cdots w_{i'})=-\Delta(w_{j'} \cdots w_j)=m\) and \(\psi_L(\mathop{\mathrm{ext}}_{w_i\cdots w_{i'},w_{j'}\cdots w_j})=e\). For \(\boldsymbol{\sigma}=(\boldsymbol{\sigma}_1,\dots,\boldsymbol{\sigma}_m)\in{\Sigma_\text{call}}^m\), \(\boldsymbol{\xi}=(\boldsymbol{\xi}_1\dots,\boldsymbol{\xi}_m)\in{\Sigma_\text{ret}}^m\), \(\boldsymbol{r}=(\boldsymbol{r}_1,\dots,\boldsymbol{r}_m)\in {R_L}^m\), and \(\boldsymbol{r}^\dagger=(\boldsymbol{r}_1^\dagger,\dots,\boldsymbol{r}_m^\dagger)\in {R_L}^m\) we define \[\prod(\boldsymbol{\sigma},\boldsymbol{\xi},\boldsymbol{r},\boldsymbol{r}^\dagger)= \bigcirc_{g=1}^{m}\mathrm{left}_{\boldsymbol{r}_g}\circ \mathrm{right}_{\boldsymbol{r}_g^\dagger}\circ \psi_L(\mathop{\mathrm{ext}}_{\boldsymbol{\sigma}_g,\boldsymbol{\xi}_g}).\] The formula \(\alpha_{d, m, f}\) can be expressed as follows: \[\begin{align} \alpha_{d,m,f}(x,x',y',y) = & \bigvee_{\substack{\boldsymbol{\sigma} \in {\Sigma_\text{call}}^m, \boldsymbol{\xi}\in {\Sigma_\text{ret}}^m\\ \boldsymbol{r},\boldsymbol{r}^\dagger\in {R_L}^m: f=\prod(\boldsymbol{\sigma},\boldsymbol{\xi},\boldsymbol{r},\boldsymbol{r}^\dagger)}} \exists x_1,\dots, x_m\exists y_1,\dots,y_m\\ & \biggl( \begin{aligned}[t] & x'=x_m \wedge y'=y_m \wedge x\leq x_1<\cdots<x_m<y_m<\cdots<y_1\leq y\wedge\\ & \bigwedge_{g=1}^m \bigl(\boldsymbol{\sigma}_g(x_g) \wedge \boldsymbol{\xi}_g(y_g) \wedge x_g \leftrightsquigarrow y_g\bigr) \wedge\\ & \forall z \bigl((x \leq z \leq x' \wedge \bigwedge_{g=1}^m z \neq x_g) \rightarrow \neg U(x, x', z)\bigr) \wedge\\ & \Bigl(\bigl(x < x_1 \wedge \overline{\eta}_{d-1,\boldsymbol{r}_1}(x,x_1-1)\bigr) \vee F_{\boldsymbol{r}_1}(x, x_1)\Bigr) \wedge\\ & \Bigl(\bigl(y_1 < y \wedge \overline{\eta}_{d-1,\boldsymbol{r}_1^\dagger}(y_1+1,y)\bigr) \vee F_{\boldsymbol{r}_1^\dagger}(y_1, y)\Bigr) \wedge\\ & \bigwedge_{g=2}^m \overline{\eta}_{d-1,\boldsymbol{r}_g}(x_{g-1}+1,x_g-1) \wedge \bigwedge_{g=2}^m \overline{\eta}_{d-1,\boldsymbol{r}_g^\dagger}(y_g+1,y_{g-1}-1) \biggr) \end{aligned} \end{align}\] with \(F_s(x, z) = \begin{cases} x = z & \text{if s = 1_{R_L}}\\ \bot & \text{otherwise} \end{cases}\) for all \(\varphi_L(L)\)-reaching \(s \in R_L\).

We are now ready to define the formula \(\overline{\chi}_{d,e}\): \[\begin{align} \overline{\chi}_{d,e}(x,x',y',x) & = & \bigvee_{\substack{q\in[0,\left|O_L\right|]\\ m_0, \dots, m_{q-1}\geq 1 \wedge m_q \geq 0:\\ q+m_0+\dots+m_q\leq 3\left|O_L\right|}} \quad \bigvee_{\substack{e_0,f_0,e_1,\dots,f_{q-1},e_q,f_q\in O_L\\ e_0=1_{O_L}\wedge\forall j\in[1,q]:e_j=e_{j-1}\circ f_{j-1}\\ e=e_q\circ f_q}}\\ && \exists x_1, \dots, x_{q+1}\exists x_0', \dots, x_q' \exists y_1, \dots, y_{q+1}\exists y_1', \dots, y_0'\\ &&\Biggl( \begin{aligned} x_0'\leq x_1<x_1'<x_2<\dots<x_q' \leq x_{q+1}<\\ y_{q+1} \leq y_q'<y_q<\dots<y_1'<y_1\leq y_0' \end{aligned}\wedge \\ &&\quad x_0'=x\wedge y_0'=y\wedge x_{q+1}=x'\wedge y_{q+1}=y'\wedge\\ &&\quad \bigwedge_{p=1}^q (x_p \leftrightsquigarrow y_p \wedge x_p' \leftrightsquigarrow y_p') \wedge\\ &&\quad \forall z \Bigl(\bigl(x \leq z < x' \wedge \bigwedge_{p=1}^q (z \neq x_p \wedge z \neq x_p')\bigr) \rightarrow \neg U(x, x', z)\Bigr) \wedge\\ &&\quad \bigwedge_{p=1}^q\theta_{d, e_p}(x_p+1,x_p',y_p',y_p-1) \wedge\\ &&\quad \alpha_{d, m_0, f_0}(x_0',x_1,y_1,y_0') \wedge \bigwedge_{p=1}^{q-1} \alpha_{d, m_p,f_p}(x_p'+1,x_{p+1},y_{p+1},y_p'-1) \wedge\\ &&\quad \Bigl( \begin{align}[t] \bigl(x_q' < x_{q+1} \wedge \alpha_{d, m_q, f_q}(x_q'+1,x_{q+1},y_{q+1},y_q'-1)\bigr) \vee\\ F'_{q, m_q, f_q}(x_q',x_{q+1})\Bigr) \Biggr) \end{align} \end{align}\] with \(F'_{q, m, f}(x, z) = \begin{cases} \top & \text{if q = 0}\\ x = z & \text{if q > 0, m = 0 and f = 1_{O_L}}\\ \bot & \text{otherwise} \end{cases}\) for all \(q \in [0, \left|O_L\right|]\), \(m \in [0, 3\left|O_L\right|]\) and \(f \in O_L\).

The inductive definition of \(\overline{\eta}_{d,r}^\uparrow\) is completely analogous to the definition of \(\eta_{d,r}\) in Section 5.3.5: we simply replace every occurrence of \(\eta_{d-1,r}\) by \(\overline{\eta}_{d-1,r}\) and every occurrence of \(\chi_{d,e}\) by \(\overline{\chi}_{d,e}\).

The inductive definition of \(\overline{\eta}_{d,r}\) is completely analogous to the definition of \(\eta_{d,r}\) in Section 5.3.5: we access the horizontal evaluation languages \(\mathcal{E}_{\varphi_L,r}\) for all \(\varphi_L(L)\)-reaching \(r\in R_L\) by making use of the sentence \(\nu_{\varphi, r}\) and the already defined \(\overline{\eta}_{d,r}^\uparrow\). ◻

5.4.2 Computation of \(k,l\)↩︎

The following proposition implies the computability of \(k,l\in\mathbb{N}\) such that \(\mathcal{L}_{k,l}\leq_{\mathrm{cd}}L\) already when VPL \(L\) is weakly length-synchronous but not length-synchronous.

If a VPL \(L\) is weakly length-synchronous but not length-synchronous, one can effectively compute \(k, l \in \mathbb{N}_{>0}\) with \(k \neq l\) such that \(\mathcal{L}_{k, l}\leq_{\mathrm{cd}}L\) .

Proof. Let \(L \subseteq \Sigma^\triangle\) be a weakly length-synchronous VPL that is not length-synchronous. According to Point 2 (b) of Proposition [prop32effectivity] one can effectively compute a quadruple \((k_0,l_0,k_0',l_0')\in\mathbb{N}_{>0}^4\) for which there exist \(\mathop{\mathrm{ext}}_{u, v}, \mathop{\mathrm{ext}}_{u', v'} \in \mathcal{O}(\Sigma^\triangle)\) such that

  • \(|u|=k_0\), \(|v|=l_0\), \(|u'|=k_0'\), \(|v'|=l_0'\),

  • \(\psi_L(\mathop{\mathrm{ext}}_{u, v}) = \psi_L(\mathop{\mathrm{ext}}_{u', v'})\) is a \(\varphi_L(L)\)-reaching idempotent,

  • \(\Delta(u), \Delta(u') > 0\), and

  • \(\frac{k_0}{l_0}=\frac{\mathopen{}\left|u\right|\mathclose{}}{\mathopen{}\left|v\right|\mathclose{}} \neq \frac{\mathopen{}\left|u'\right|\mathclose{}}{\mathopen{}\left|v'\right|\mathclose{}}=\frac{k_0'}{l_0'}\).

We can explicitly compute such \(\mathop{\mathrm{ext}}_{u, v}\) and \(\mathop{\mathrm{ext}}_{u', v'}\) by just doing an exhaustive search. This enables us to assume without loss of generality while maintaining effective computability that \(\Delta(u)=\Delta(u')\): indeed, in case \(\Delta(u)\not=\Delta(u')\), we can consider \(\mathop{\mathrm{ext}}_{u_1,v_1}=\mathop{\mathrm{ext}}_{u^{\Delta(u')},v^{\Delta(u')}}\) and \(\mathop{\mathrm{ext}}_{u_2,v_2}=\mathop{\mathrm{ext}}_{(u')^{\Delta(u)},(v')^{\Delta(u)}}\) satisfying the desired properties.

Let us now define Green’s relations on \(O_L\) (see [25]). Let us consider two elements \(x,y\) of \(O_L\).

  • We write \(x \leq_{\mathfrak{J}}y\) whenever there are elements \(e,f\) of \(O_L\) such that \(x = e \circ y \circ f\). We write \(x \mathrel{\mathfrak{J}}y\) if \(x \leq_{\mathfrak{J}}y\) and \(y \leq_{\mathfrak{J}}x\). We write \(x <_{\mathfrak{J}}y\) if \(x \leq_{\mathfrak{J}}y\) and \(x \not\mathrel{\mathfrak{J}}y\).

  • We write \(x \leq_{\mathfrak{R}}y\) whenever there is an element \(e\) of \(O_L\) such that \(x = y \circ e\). We write \(x \mathrel{\mathfrak{R}}y\) if \(x \leq_{\mathfrak{R}}y\) and \(y \leq_{\mathfrak{R}}x\).

  • We write \(x \leq_{\mathfrak{L}}y\) whenever there is an element \(e\) of \(O_L\) such that \(x = e \circ y\). We write \(x \mathrel{\mathfrak{L}}y\) if \(x \leq_{\mathfrak{L}}y\) and \(y \leq_{\mathfrak{L}}x\).

  • We write \(x \mathrel{\mathfrak{H}}y\) if \(x \mathrel{\mathfrak{R}}y\) and \(x \mathrel{\mathfrak{L}}y\).

Observe that because \(\Delta(u) = \Delta(u')\), we have that \(u v' \in \Sigma^\triangle\) and \(u' v \in \Sigma^\triangle\), so that we can consider the elements \(\mathop{\mathrm{ext}}_{u u u, v v' v} = \mathop{\mathrm{ext}}_{u, v} \circ \mathop{\mathrm{ext}}_{u, v'} \circ \mathop{\mathrm{ext}}_{u, v}\) and \(\mathop{\mathrm{ext}}_{u u' u, v v v} = \mathop{\mathrm{ext}}_{u, v} \circ \mathop{\mathrm{ext}}_{u', v} \circ \mathop{\mathrm{ext}}_{u, v}\) in \(\mathcal{O}(\Sigma^\triangle)\). These elements satisfy \(\psi_L(\mathop{\mathrm{ext}}_{u u u, v v' v}) \leq_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\) and \(\psi_L(\mathop{\mathrm{ext}}_{u u' u, v v v}) \leq_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\). We claim that we actually have \(\psi_L(\mathop{\mathrm{ext}}_{u u u, v v' v}) <_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\) and \(\psi_L(\mathop{\mathrm{ext}}_{u u' u, v v v}) <_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\). Indeed, assume we had \(\psi_L(\mathop{\mathrm{ext}}_{u u' u, v v v}) \mathrel{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\). Set \(x = \psi_L(\mathop{\mathrm{ext}}_{u, v})\) and \(y = \psi_L(\mathop{\mathrm{ext}}_{u', v})\). By a classical property of Green’s relations (see [25]), since it would hold that \(x \circ y \circ x \leq_{\mathfrak{R}}x\) and \(x \circ y \circ x \mathrel{\mathfrak{J}}x\), we would have \(x \circ y \circ x \mathrel{\mathfrak{R}}x\) and dually, since it would hold that \(x \circ y \circ x \leq_{\mathfrak{L}}x\) and \(x \circ y \circ x \mathrel{\mathfrak{J}}x\), we would have \(x \circ y \circ x \mathrel{\mathfrak{L}}x\). Therefore, we would have \(x \circ y \circ x \mathrel{\mathfrak{H}}x\). By another classical result on Green’s relations [25], as \(x\) is an idempotent, its \(\mathrel{\mathfrak{H}}\)-class is a group, hence for \(\omega \in \mathbb{N}_{>0}\) the idempotent power of \(O_L\), we would have \((x \circ y \circ x)^\omega = x^\omega = x\) (as the only idempotent element in a group is the identity). This would finally entail that \(\psi_L(\mathop{\mathrm{ext}}_{(u u' u)^\omega, (v v v)^\omega}) = \psi_L(\mathop{\mathrm{ext}}_{(u u u)^\omega, (v v v)^\omega})\) is a \(\varphi_L(L)\)-reaching idempotent and \(\Delta((u u' u)^\omega) = \Delta((u u u)^\omega) > 0\) but \(\mathopen{}\left|(u u' u)^\omega\right|\mathclose{} \neq \mathopen{}\left|(u u u)^\omega\right|\mathclose{}\), a contradiction to the fact that \((\varphi_L, \psi_L)\) is \(\varphi_L(L)\)-weakly-length-synchronous. Symmetrically, we can prove that if we had \(\psi_L(\mathop{\mathrm{ext}}_{u u u, v v' v}) \mathrel{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\), this would contradict the fact that \((\varphi_L, \psi_L)\) is \(\varphi_L(L)\)-weakly-length-synchronous.

We distinguish three cases. In each of these we prove that there exist \(k, l \in \mathbb{N}_{>0}, k \neq l\) such that \(\mathcal{L}_{k, l} \leq_{\mathrm{cd}}L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\), so that since \(L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})} \leq_{\mathrm{cd}}L\) (by Lemma [lemma32reduction32element]) and by transitivity of \(\leq_{\mathrm{cd}}\) we have \(\mathcal{L}_{k, l} \leq_{\mathrm{cd}}L\).

Case \(\mathopen{}\left|v\right|\mathclose{} = \mathopen{}\left|v'\right|\mathclose{}\).

In that case, we necessarily have \(\mathopen{}\left|u\right|\mathclose{} \neq \mathopen{}\left|u'\right|\mathclose{}\). Then, we can exploit the fact that matching \(u^3\) with \(v v' v\) or \(u u' u\) with \(v^3\) makes us fall down to a smaller \(\mathrel{\mathfrak{J}}\)-class to reduce \(\mathcal{L}_{3 \mathopen{}\left|u\right|\mathclose{}, 2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{}}\) to \(L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\). The constant-depth reduction works as follows on input \(w \in \Sigma^*\):

  1. check if \(w = x y\) with \(x \in (ac^{3 \mathopen{}\left|u\right|\mathclose{} - 1} + ac^{2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{} - 1})^*\) and \(y \in (b_1 + b_2)^*\), reject if it’s not the case;

  2. build \(x'\) by sending \(ac^{3 \mathopen{}\left|u\right|\mathclose{} - 1}\) to \(u^3\), \(ac^{2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{} - 1}\) to \(u u' u\) and \(y'\) by sending \(b_1\) to \(v^3\) and \(b_2\) to \(v v' v\);

  3. accept whenever \(x' \# y' \in L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\).

This forms a valid reduction. Indeed, take a word \(w = x y\) with \(x \in (ac^{3 \mathopen{}\left|u\right|\mathclose{} - 1} + ac^{2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{} - 1})^n\) for \(n \in \mathbb{N}\) and \(y \in (b_1 + b_2)^m\) for \(m \in \mathbb{N}\) and consider \(x' \# y'\) produced by the reduction with \(x' \in (u^3 + u u' u)^n\) and \(y' \in (v^3 + v v' v)^m\). If \(w \in \mathcal{L}_{3 \mathopen{}\left|u\right|\mathclose{}, 2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{}}\), then it easily follows that \(x' \# y' \in L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\). Otherwise, if \(w \notin \mathcal{L}_{3 \mathopen{}\left|u\right|\mathclose{}, 2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{}}\), then either \(n \neq m\) and thus \(x' y'\) is not well-matched because \(\Delta(x') = n \cdot 3 \cdot \Delta(u)\) and \(\Delta(y') = m \cdot 3 \cdot \Delta(v)\), or \(n = m\) and thus \(x' y'\) is well-matched, so \(\mathop{\mathrm{ext}}_{x', y'} = \mathop{\mathrm{ext}}_{z_1', t_1'} \circ \cdots \circ \mathop{\mathrm{ext}}_{z_n', t_n'}\) with \(z_1', \ldots, z_n' \in \{u^3, u u' u\}\) and \(t_1', \ldots, t_n' \in \{v^3, v v' v\}\) such that there exists \(i \in [1, n]\) satisfying \(\mathop{\mathrm{ext}}_{z_i', t_i'} \in \{\mathop{\mathrm{ext}}_{u^3, v v' v}, \mathop{\mathrm{ext}}_{u u' u, v^3}\}\), thereby implying \[\psi_L(\mathop{\mathrm{ext}}_{x', y'}) \leq_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{z_i', t_i'}) <_{\mathfrak{J}} \psi_L(\mathop{\mathrm{ext}}_{u, v}) \,\,\text{.}\] Our algorithm therefore outputs the pair \((k,l)=(3k_0,2k_0+k_0')\).

Case \(\mathopen{}\left|u\right|\mathclose{} = \mathopen{}\left|u'\right|\mathclose{}\).

This case is symmetric to the previous case. Our algorithm outputs the pair \((k,l)=(2l_0+l_0',3l_0)\).

Case \(\mathopen{}\left|u\right|\mathclose{} \neq \mathopen{}\left|u'\right|\mathclose{}\) and \(\mathopen{}\left|v\right|\mathclose{} \neq \mathopen{}\left|v'\right|\mathclose{}\).

Then, we can again exploit the fact that matching \(u^3\) with \(v v' v\) or \(u u' u\) with \(v^3\) makes us fall down to a smaller \(\mathrel{\mathfrak{J}}\)-class to reduce \(\mathcal{L}_{A \cdot B', A' \cdot B}\) where \(A = 3 \mathopen{}\left|u\right|\mathclose{}=3k_0\), \(A' = 2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{}=2k_0+k_0'\), \(B = 3 \mathopen{}\left|v\right|\mathclose{}=3l_0\) and \(B' = 2 \mathopen{}\left|v\right|\mathclose{} + \mathopen{}\left|v'\right|\mathclose{}=2l_0+l_0'\) to \(L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\). Indeed, we have \(A \cdot B' \neq A' \cdot B\) because otherwise we would have \[\begin{align} 3 \mathopen{}\left|u\right|\mathclose{} \cdot (2 \mathopen{}\left|v\right|\mathclose{} + \mathopen{}\left|v'\right|\mathclose{}) & = (2 \mathopen{}\left|u\right|\mathclose{} + \mathopen{}\left|u'\right|\mathclose{}) \cdot 3 \mathopen{}\left|v\right|\mathclose{}\\ 6 \mathopen{}\left|u\right|\mathclose{} \mathopen{}\left|v\right|\mathclose{} + 3 \mathopen{}\left|u\right|\mathclose{} \mathopen{}\left|v'\right|\mathclose{} & = 6 \mathopen{}\left|u\right|\mathclose{} \mathopen{}\left|v\right|\mathclose{} + 3 \mathopen{}\left|u'\right|\mathclose{} \mathopen{}\left|v\right|\mathclose{}\\ \mathopen{}\left|u\right|\mathclose{} \mathopen{}\left|v'\right|\mathclose{} & = \mathopen{}\left|u'\right|\mathclose{} \mathopen{}\left|v\right|\mathclose{} \,\,\text{.} \end{align}\] The constant-depth reduction works as follows on input \(w \in \Sigma^*\):

  1. check if \(w = x y\) with \(x \in (ac^{A \cdot B' - 1} + ac^{A' \cdot B - 1})^*\) and \(y \in (b_1 + b_2)^*\), reject if it is not the case;

  2. build \(x'\) by sending \(ac^{A \cdot B' - 1}\) to \((u^3)^{B'}\), \(ac^{A' \cdot B - 1}\) to \((u u' u)^B\) and \(y'\) by sending \(b_1\) to \((v^3)^{B'}\) and \(b_2\) to \((v v' v)^B\);

  3. accept whenever \(x' \# y' \in L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\).

This forms a valid reduction. Indeed, take a word \(w = x y\) with \(x = z_1 \cdots z_n\) where \(n \in \mathbb{N}\) and \(z_1, \ldots, z_n \in \{ac^{A \cdot B' - 1}, ac^{A' \cdot B - 1}\}\) and \(y = t_1 \cdots t_m\) where \(m \in \mathbb{N}\) and \(t_1, \ldots, t_m \in \{b_1, b_2\}\). Consider \(x' \# y'\) produced by the reduction with \(x' = z_1' \cdots z_n'\) where \(z_1', \ldots, z_n' \in \{(u^3)^{B'}, (u u' u)^B\}\) and \(y' = t_1' \cdots t_m'\) where \(t_1', \ldots, t_m' \in \{(v^3)^{B'}, (v v' v)^B\}\). If \(w \in \mathcal{L}_{A \cdot B', A' \cdot B}\), then it easily follows that \(x' \# y' \in L_{\psi_L(\mathop{\mathrm{ext}}_{u, v})}\). Otherwise, if \(w \notin \mathcal{L}_{A \cdot B', A' \cdot B}\), three situations can occur.

  • There exists \(i \in [1, \min\{n, m\}]\) such that \(z_1 \cdots z_{i - 1} t_{i - 1} \cdots t_1 \in \mathcal{L}_{A \cdot B', A' \cdot B}\) but it holds that \((z_i, t_i) \in \{(ac^{A \cdot B' - 1}, b_2), (ac^{A' \cdot B - 1}, b_1)\}\). Assume first \((z_i, t_i) = (ac^{A' \cdot B - 1}, b_1)\). In this case, let \(\tilde{x}' = (u u' u)^{B - 1} z_{i + 1}' \cdots z_n'\) and \(\tilde{y}' = t_n' \cdots t_{i + 1}' (v^3)^{B' - 1}\). If \(\Delta(\tilde{x}' \tilde{y}') \neq 0\), then \[\Delta(x' y') = \Delta(z_1' \cdots z_{i - 1}' (u u' u) v^3 t_{i - 1}' \cdots t_1') + \Delta(\tilde{x}' \tilde{y}') = \Delta(\tilde{x}' \tilde{y}') \neq 0 \,\,\text{,}\] thus \(x' y'\) is not well-matched. Otherwise, if \(\Delta(\tilde{x}' \tilde{y}') = 0\), we can show that \(\tilde{x}' \tilde{y}'\) is well-matched. Indeed, since \(u v \in \Sigma^\triangle\), for all \(j \in [1, \mathopen{}\left|u\right|\mathclose{}]\), we have \(\Delta(u_1 \cdots u_j) \geq 0\) and for all \(j \in [1, \mathopen{}\left|v\right|\mathclose{}]\), we have \(\Delta(v_j \cdots v_{\mathopen{}\left|v\right|\mathclose{}}) = -\Delta(u v_1 \cdots v_{j - 1}) \leq 0\). Similarly, since \(u' v' \in \Sigma^\triangle\), for all \(j \in [1, \mathopen{}\left|u'\right|\mathclose{}]\), we have \(\Delta(u'_1 \cdots u'_j) \geq 0\) and for all \(j \in [1, \mathopen{}\left|v'\right|\mathclose{}]\), we have \(\Delta(v'_j \cdots v'_{\mathopen{}\left|v'\right|\mathclose{}}) = -\Delta(u' v'_1 \cdots v'_{j - 1}) \leq 0\). This implies that for all \(j \in [1, \mathopen{}\left|\tilde{x}'\right|\mathclose{}]\), we have \(\Delta(\tilde{x}'_1 \cdots \tilde{x}'_j) \geq 0\) and for all \(j \in [1, \mathopen{}\left|\tilde{y}'\right|\mathclose{}]\), we have \(\Delta(\tilde{x}' \tilde{y}'_1 \cdots \tilde{y}'_{j - 1}) = -\Delta(\tilde{y}'_j \cdots \tilde{y}'_{\mathopen{}\left|\tilde{y}'\right|\mathclose{}}) \geq 0\). Therefore, \(\tilde{x}' \tilde{y}' \in \Sigma^\triangle\). Hence \(x' y'\) is well-matched and \[\mathop{\mathrm{ext}}_{x', y'} = \mathop{\mathrm{ext}}_{z_1' \cdots z_{i - 1}', t_{i - 1}' \cdots t_1'} \circ \mathop{\mathrm{ext}}_{z_i', t_i'} \circ \mathop{\mathrm{ext}}_{\tilde{x}', \tilde{y}'} \,\,\text{,}\] so that \[\psi_L(\mathop{\mathrm{ext}}_{x', y'}) \leq_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{z_i', t_i'}) <_{\mathfrak{J}} \psi_L(\mathop{\mathrm{ext}}_{u, v}) \,\,\text{.}\]

    If we assume that \((z_i, t_i) = (ac^{A \cdot B' - 1}, b_2)\), then we prove in the same way that either \(x' y'\) is not well-matched or it is well-matched and \(\psi_L(\mathop{\mathrm{ext}}_{x', y'}) <_{\mathfrak{J}}\psi_L(\mathop{\mathrm{ext}}_{u, v})\).

  • It holds that \(n < m\) and \(z_1 \cdots z_n t_n \cdots t_1 \in \mathcal{L}_{A \cdot B', A' \cdot B}\). This entails that \(\Delta(x' t_n' \cdots t_1') = \Delta(z_1' \cdots z_n' t_n' \cdots t_1') = 0\), so that \[\Delta(x' y') = \Delta(x' t_n' \cdots t_1') + \Delta(t_m' \cdots t_{n + 1}') = \Delta(t_m' \cdots t_{n + 1}') < 0\] because \(m > n\) and \(\Delta(v) < 0\) as well as \(\Delta(v') < 0\). Therefore, \(x' y'\) is not well-matched.

  • It holds that \(n > m\) and \(z_1 \cdots z_m t_m \cdots t_1 \in \mathcal{L}_{A \cdot B', A' \cdot B}\). Symmetrically to the previous case, we can also show that then, \(x' y'\) is not well-matched.

Hence, our algorithm outputs the pair \((k,l)=(A\cdot B',A'\cdot B)=(3k_0(2l_0+l_0'),(2k_0+k_0')3l_0)\) in this last case. ◻

5.5 Proof of Corollary [corollary32OCA]↩︎

Let \(A=(Q,\Sigma,q_0,F,\delta_0,\dots,\delta_m)\) be a \(m\)-VCA and let \(L=L(A)\). One easily computes from \(A'\) a DVPA such that \(L(A')=L\). Details of this standard translation are omitted. It will be sufficient to prove that \(L\) is weakly length-synchronous if, and only if, \(L\) is length-synchronous: indeed, one can simply perform the case distinction of Section 5.1 and observe that, under the assumption that weak length-synchronicity and length synchronicity coincide, the algorithm for Theorem [thm32main] will either output that \(L\) is in \(\mathsf{AC}^0\) or some \(m\geq 2\) such that \(\mathrm{MOD}_m\leq_{\mathrm{cd}}L\).

It thus suffices to prove that if \(L\) is not length-synchronous, then \(L\) is not weakly length-synchronous. Let \((R_L,O_L)\) be the syntactic \(\mathop{\mathrm{Ext}}\)-algebra of \(L\) along with with its syntactic morphism \((\varphi_L,\psi_L)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle)) \rightarrow(R_L,O_L)\).

Let \(\mathcal{M}=[0,m]\times (Q^Q)^{[0,m]}\times (Q^Q)^{[0,m]}\). The behavior of the \(m\)-VCA can be described as follows. To each \(\mathop{\mathrm{ext}}_{u,v}\in\mathcal{O}(\Sigma^\triangle)\) we assign the triple \(\zeta(\mathop{\mathrm{ext}}_{u,v})=(j,(f_i)_{i\in[0,m]},(g_i)_{i\in[0,m]}) \in\mathcal{M}\), where

  • \(j=\min(\Delta(u),m)\in[0,m]\),

  • \(f_i(q)=q'\) where \(q'\in Q\) is the unique state such that \(q(i)\xrightarrow{u}_Aq'(i+j)\) for all \(q\in Q\) and all \(i\in[0,m]\), and

  • \(g_i(q)=q'\), where \(q'\in Q\) is the unique state such that \(q'(i+j)\xrightarrow{v}_A q'(i)\) for all \(q\in Q\) and all \(i\in[0,m]\).

Over \(\mathcal{M}\) we define the product \[(j,(f_i)_{i\in[0,m]},(g_i)_{i\in[0,m]})\odot_{\mathcal{M}} (j',(f_i')_{i\in[0,m]},(g_i')_{i\in[0,m]})\] as \[(\min(j+j',m),(f_{\min(i+j,m)}'\circ f_i)_{i\in[0,m]}, (g_{\min(i+j,m)}\circ g_{\min(i+j+j',m)}')_{i\in[0,m]}).\] We claim \(\odot_\mathcal{M}\) is associative. For this, let us fix

  • \(m=(j,(f_i)_{i\in[0,m]},(g_i)_{i\in[0,m]})\in\mathcal{M}\),

  • \(m'=(j',(f_i')_{i\in[0,m]},(g_i')_{i\in[0,m]})\in\mathcal{M}\), and

  • \(m''=(j'',(f_i'')_{i\in[0,m]},(g_i'')_{i\in[0,m]})\in\mathcal{M}\).

Let \(\widetilde{m}=m\odot_\mathcal{M}m'= (\widetilde{j},(\widetilde{f_i})_{i\in[0,m]}, (\widetilde{g_i})_{i\in[0,m]})\) and \(\overline{m}=m'\odot_\mathcal{M}m''= (\overline{j},(\overline{f_i})_{i\in[0,m]}, (\overline{g_i})_{i\in[0,m]})\). We need to prove \(\widetilde{m}\odot_\mathcal{M}m''=m\odot_\mathcal{M}\overline{m}\).

Since \(j,j',j'',m\geq 0\) we have \(\min(\widetilde{j}+j'',m)=\min(\min(j+j',m)+j'',m)=\min(j+j'+j'',m)= \min(j+\min(j'+j'',m),m))=\min(j+\overline{j},m)\) associativity holds on the first component. For each \(i\in[0,m]\) the \(i^{\text{th}}\) component of the second component of \(\widetilde{m}\odot_\mathcal{M}m''\) is \[\begin{align} f_{\min(i+\widetilde{j},m)}''\circ \widetilde{f}_i &=&f_{\min(i+\widetilde{j},m)}''\circ\left(f_{\min(i+j,m)}'\circ f_i\right)\\ &=&f_{\min(i+\min(j+j',m),m)}''\circ\left(f_{\min(i+j,m)}'\circ f_i\right)\\ &=&f_{\min(i+j+j',m)}''\circ\left(f_{\min(i+j,m)}'\circ f_i\right)\\ &=&\left(f_{\min(i+j'+j'',m)}''\circ f_{\min(i+j,m)}'\right)\circ f_i\\ &=&\left(f_{\min(\min(i+j,m)+j',m)}''\circ f_{\min(i+j,m)}'\right)\circ f_i\\ &=&\overline{f}_{\min(i+j,m)}\circ f_i \end{align}\] the latter of which is the \(i^{\text{th}}\) component of the second component of \(m\odot_\mathcal{M}\overline{m}\), as required. For each \(i\in[0,m]\) the \(i^{\text{th}}\) component of the third component of \(m\odot_\mathcal{M}\overline{m}\) is \[\begin{align} g_{\min(i+j,m)}\circ\overline{g}_{\min(i+j+\overline{j},m))} &=& g_{\min(i+j,m)}\circ\overline{g}_{\min(i+j+j'+j'',m)}\\ &=& g_{\min(i+j,m)}\circ\overline{g}_{\min(\min(i+j,m)+j'+j'',m)}\\ &=& g_{\min(i+j,m)}\circ\left( g_{\min(\min(i+j,m)+j')}'\circ g_{\min(\min(i+j,m),j'+j'',m)}'' \right)\\ &=& \left(g_{\min(i+j,m)}\circ g_{\min(\min(i+j,m)+j')}'\right)\circ g_{\min(\min(i+j,m),j'+j'',m)}''\\ &=& \left(g_{\min(i+j,m)}\circ g_{\min(i+j+j',m)}'\right)\circ g_{\min(i+\min(j+j',m)+j'',m)}''\\ &=& \widetilde{g}_i\circ g_{\min(i+\widetilde{j}+j'',m)}'' \end{align}\] the latter of which is the \(i^{\text{th}}\) component of the third component of \(\widetilde{m}\odot_\mathcal{M}m''\), as required. Clearly \((0,(\mathrm{id}_Q)^{[0,m]},(\mathrm{id}_Q)^{[0,m]})\) is the identity of \(\mathcal{M}\) with respect to \(\odot_\mathcal{M}\), hence \((\mathcal{M},\odot_\mathcal{M})\) is a monoid. The following points can easily be verified.

  1. The function \(\zeta\colon \mathcal{O}(\Sigma^\triangle)\rightarrow\mathcal{M}\) is a monoid morphism.

  2. For all \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v'}\in\mathcal{O}(\Sigma^\triangle)\) with \(\Delta(u)=\Delta(u')\) we have \[\zeta(\mathop{\mathrm{ext}}_{u,v})=\zeta(\mathop{\mathrm{ext}}_{u',v'}) \quad\Longrightarrow\quad \zeta(\mathop{\mathrm{ext}}_{u,v})=\zeta(\mathop{\mathrm{ext}}_{u',v})= \zeta(\mathop{\mathrm{ext}}_{u,v'})=\zeta(\mathop{\mathrm{ext}}_{u',v'}).\]

  3. For all \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v'}\in\mathcal{O}(\Sigma^\triangle)\) we have \[\zeta(\mathop{\mathrm{ext}}_{u,v})=\zeta(\mathop{\mathrm{ext}}_{u',v'}) \quad\Longrightarrow\quad \psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u',v'}).\]

Now assume that \(L\) is not length-synchronous. We will prove that \(L\) is not length-synchronous. By assumption there exist a \(\varphi_L(L)\)-reaching idempotent \(e\in O_L\) and \(\mathop{\mathrm{ext}}_{u,v},\mathop{\mathrm{ext}}_{u',v'}\in\mathcal{O}(\Sigma^\triangle)\) such that \(\Delta(u),\Delta(u')>0\), \(\frac{|u|}{|v|}\not=\frac{|u'|}{|v'|}\), and \(\psi_L(\mathop{\mathrm{ext}}_{u,v})=\psi_L(\mathop{\mathrm{ext}}_{u',v'})=e\). Without loss of generality we may assume \(\Delta(u)=\Delta(u')\). Let \(\omega\) denote the idempotent power of \(\mathcal{M}\). Consider the elements \[\mathop{\mathrm{ext}}_{x,y}=(\mathop{\mathrm{ext}}_{u,v}^{2\omega}\circ\mathop{\mathrm{ext}}_{u',v'}^\omega)^\omega \text{ and } \mathop{\mathrm{ext}}_{x',y'}=(\mathop{\mathrm{ext}}_{u,v}^{\omega}\circ\mathop{\mathrm{ext}}_{u',v'}^{2\omega})^\omega.\] By definition we have \(\zeta(\mathop{\mathrm{ext}}_{x,y})=\zeta(\mathop{\mathrm{ext}}_{x',y'})\), and since \(\Delta(x)=\Delta(x')\) we obtain \(\zeta(\mathop{\mathrm{ext}}_{x,y})=\zeta(\mathop{\mathrm{ext}}_{x',y})=\zeta(\mathop{\mathrm{ext}}_{x,y'})=\zeta(\mathop{\mathrm{ext}}_{x',y'})\) by Point 2. Hence, \[\begin{align} \psi_L(\mathop{\mathrm{ext}}_{x,y})=\psi_L(\mathop{\mathrm{ext}}_{x',y})=\psi_L(\mathop{\mathrm{ext}}_{x,y'})=\psi_L(\mathop{\mathrm{ext}}_{x',y'})=e \end{align}\] by Point 3.

We finally make a case distinction on whether \(|u|=|u'|\) or not.

First, assume \(|u|\not=|u'|\). Then \(|x|\not=|x'|\) by construction. Since \(\psi_L(\mathop{\mathrm{ext}}_{x,y})=\psi_L(\mathop{\mathrm{ext}}_{x',y})=e\), which is an idempotent of \(O_L\), we obtain that \(L\) is not weakly length-synchronous.

Now assume \(|u|=|u'|\). Since \(\frac{|u|}{|v|}\not=\frac{|u'|}{|v'|}\) by assumption, we conclude that \(|v|\not=|v'|\). By construction, the latter implies \(|y|\not=|y'|\). Since \(\psi_L(\mathop{\mathrm{ext}}_{x,y})=\psi_L(\mathop{\mathrm{ext}}_{x,y'})=e\), again we obtain that \(L\) is not weakly length-synchronous.

6 Proof of Proposition [prop32effectivity]↩︎

We will prove the different statements appearing in Proposition [prop32effectivity] in the following subsections.

6.0.0.0.1 Computability of the syntactic \(\mathop{\mathrm{Ext}}\)-algebra.

This paragraph will be devoted to proving Point 1 of Proposition [prop32effectivity], rephrased in the following proposition.

Given a DVPA \(A\) with \(L=L(A)\), one can compute the syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L,O_L)\) of \(L\), its syntactic morphism \((\varphi_L,\psi_L)\) and \(\varphi_L(L)\).

We require a bit of notation. For each visibly pushdown alphabet \(\Sigma\) and each finite \(\mathop{\mathrm{Ext}}\)-algebra \((R,O)\) it follows from Proposition [ptn:Freeness95Ext-algebras] that each morphism \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\rightarrow (R,O)\) has a unique finite presentation: it is given by the tuples \[(\varphi(c))_{c\in\Sigma_\text{int}}\quad \text{and}\quad (\psi(\mathop{\mathrm{ext}}_{a,b}))_{(a,b)\in\Sigma_\text{call}\times\Sigma_\text{ret}}\quad.\] The syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L, O_L)\) of a VPL \(L\) over a visibly pushdown alphabet \(\Sigma\) can be represented by any \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) such that \(R\) has \([1, \left|R_L\right|]\) as base set and such that there exists a bijective morphism \((\alpha, \beta)\colon (R, O) \to (R_L, O_L)\). Indeed, in that case we have

  1. \(x y = z \Leftrightarrow \alpha(x) \alpha(y) = \alpha(z)\) for all \(x, y, z \in R\);

  2. \(x' y' = z' \Leftrightarrow \alpha^{-1}(x') \alpha^{-1}(y') = \alpha^{-1}(z')\) for all \(x', y', z' \in R_L\);

  3. \(f(x) = y \Leftrightarrow \beta(f)(\alpha(x)) = \alpha(y)\) for all \(f \in O\) and all \(x, y \in R\); and

  4. \(f'(x') = y' \Leftrightarrow \beta^{-1}(f')(\alpha^{-1}(x')) = \alpha^{-1}(y')\) for all \(f' \in O_L\) and all \(x', y' \in R_L\).

For the following claim we avoid the tedious standard algebraic constructions on \(\mathop{\mathrm{Ext}}\)-algebras to show decidability of the equivalence problem, since the latter decidability has already been established in [7].

There is an algorithm that decides, given two morphisms into finite \(\mathop{\mathrm{Ext}}\)-algebras \((\varphi_1,\psi_1)\colon(\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\rightarrow (R_1,O_1)\) and \((\varphi_2,\psi_2)\colon(\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\rightarrow (R_1,O_1)\) for \(\Sigma\) a visibly pushdown alphabet and subsets \(F_1\subseteq R_1\) and \(F_2\subseteq R_2\), whether \(\varphi_1^{-1}(F_1)=\varphi_2^{-1}(F_2)\).

Proof of the Claim.. The proof of Theorem [thm:vpl:ext] shows that one can effectively compute DVPAs \(A_1\) and \(A_2\) such that \(L(A_1)=\varphi_1^{-1}(F_1)\) and \(L(A_2)=\varphi_2^{-1}(F_2)\). By [7] one can effectively decide if \(L(A_1)=L(A_2)\) by deciding \(L(A_1)\subseteq L(A_2)\) and \(L(A_2)\subseteq L(A_1)\). ◻

Proof of Proposition [prop32ext32alg]. By Theorem [thm:vpl:ext] we first compute from our DVPA \(A\) on the visibly pushdown alphabet \(\Sigma\) an \(\mathop{\mathrm{Ext}}\)-algebra \((R_A,O_A)\), a morphism \((\varphi_A,\psi_A)\colon(\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle))\to (R_A,O_A)\), and a subset \(F_A \subseteq R_A\) such that \(L(A) = \varphi_A^{-1}(F_A)\). For an \(\mathop{\mathrm{Ext}}\)-algebra \((R,O)\) define \(\#(R,O)=(\left|R\right|,\left|O\right|)\). Let \(\prec\subseteq(\mathbb{N}\times\mathbb{N})^2\) be the lexicographic order on \(\mathbb{N}\times\mathbb{N}\), i.e.\((i,j)\prec(k,l)\) if, and only if either \(i<k\), or \(i=k\) and \(j<l\).

Observe that since \((R_A, O_A)\) recognizes \(L\), we have that the syntactic \(\mathop{\mathrm{Ext}}\)-algebra \((R_L, O_L)\) of \(L\) divides \((R_A, O_A)\) by Proposition [prop:syntactic:recognizes], so that \(\#(R_L, O_L) \leq \#(R_A, O_A)\). In fact, we have that any \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) having \([1, i]\) for \(i \in [1, \left|R_L\right|]\) as base set, satisfying \(\#(R, O) \leq \#(R_L, O_L)\) and recognizing \(L\) via a morphism \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) is a presentation of \((R_L, O_L)\) with \((\varphi, \psi)\) and \(F\) presentations of, respectively, \((\varphi_L, \psi_L)\) and \(\varphi_L(L)\). Indeed, since such an \(\mathop{\mathrm{Ext}}\)-algebra recognizes \(L\), by Proposition [prop:syntactic:recognizes] it is divided by \((R_L, O_L)\): this implies that \(\#(R_L, O_L) \leq \#(R, O)\), but as also \(\#(R, O) \leq \#(R_L, O_L)\), we have \(\#(R, O) = \#(R_L, O_L)\). The morphism \((\varphi, \psi)\) must be surjective, otherwise, by Lemma [lem:Surjective95recognition], \(\bigl(\varphi(\Sigma^\triangle), {\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)} \bigr)\) would be a sub-\(\mathop{\mathrm{Ext}}\)-algebra of \((R, O)\) recognizing \(L\) such that \(\#\bigl(\varphi(\Sigma^\triangle), {\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)} \bigr) < \#(R, O) = \#(R_L, O_L)\) while \((R_L, O_L)\) divides \(\bigl(\varphi(\Sigma^\triangle), {\psi(\mathcal{O}(\Sigma^\triangle))|}_{\varphi(\Sigma^\triangle)} \bigr)\), which is contradictory. Therefore, by Lemma [lem:Factorization95surjective95recognition], there is a surjective morphism \((\alpha, \beta)\colon (R, O) \to (R_L, O_L)\), that must be bijective, such that \(\varphi_L = \alpha \circ \varphi\), so that \((R, O)\) is a presentation of \((R_L, O_L)\) with \((\varphi, \psi)\) and \(F\) presentations of, respectively, \((\varphi_L, \psi_L)\) and \(\varphi_L(L)\).

Under the assumption that such an \(\mathop{\mathrm{Ext}}\)-algebra exists, we compute \((R_L, O_L)\), \((\varphi_L, \psi_L)\) and \(\varphi_L(L)\) by enumerating all the finitely many triples made of a finite \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\), a morphism \((\varphi,\psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle))\to(R,O)\) and a subset \(F \subseteq R\) such that \(R\) has \([1, i]\) for \(i \in [1, \left|R_A\right|]\) as base set and \(\#(R, O) \leq \#(R_A, O_A)\). For each of these we test whether \(\varphi^{-1}(F)=\varphi_A^{-1}(F_A)\), which is possible by the above claim and take \((R, O)\), \((\varphi, \psi)\) and \(F\) from a triple validating this test with \(\#(R, O)\) minimal with respect to \(\prec\).

It remains to prove that an \(\mathop{\mathrm{Ext}}\)-algebra \((R, O)\) having \([1, i]\) for \(i \in [1, \left|R_L\right|]\) as base set, satisfying \(\#(R, O) \leq \#(R_L, O_L)\) and recognizing \(L\) exists. Take any bijection \(\alpha\colon R_L \to [1, \left|R_L\right|]\). We define \(R\) to be the monoid with base set \([1, \left|R_L\right|]\) and operation defined by \(x \cdot y = \alpha\bigl(\alpha^{-1}(x) \alpha^{-1}(y)\bigr)\) for all \(x, y \in [1, \left|R_L\right|]\). This is a monoid because

  • \(x \cdot \alpha(1_R) = \alpha\bigl(\alpha^{-1}(x) \alpha^{-1}(\alpha(1_R))\bigr) = \alpha(\alpha^{-1}(x)) = \alpha\bigl(\alpha^{-1}(\alpha(1_R)) \alpha^{-1}(x)\bigr) = \alpha(1_R) \cdot x\) for all \(x \in R\); and

  • for all \(x, y, z \in R\), we have \[\begin{align} x \cdot (y \cdot z) & = \alpha \biggl( \alpha^{-1}(x) \alpha^{-1}\Bigl(\alpha\bigl(\alpha^{-1}(y) \alpha^{-1}(z)\bigr)\Bigr) \biggr)\\ & = \alpha\bigl(\alpha^{-1}(x) \alpha^{-1}(y) \alpha^{-1}(z)\bigr)\\ & = \alpha \biggl( \alpha^{-1}\Bigl(\alpha\bigl(\alpha^{-1}(x) \alpha^{-1}(y)\bigr)\Bigr) \alpha^{-1}(z) \biggr)\\ & = (x \cdot y) \cdot z \,\,\text{.} \end{align}\]

Define the function \(\beta\colon O_L \to R^R\) by \(\beta(f')(x) = \alpha\bigl(f'(\alpha^{-1}(x))\bigr)\) for all \(f' \in O_L\) and \(x \in R\). Set \(O\) to be the monoid with base set \(\beta(O_L)\) and with composition as operation. This is a monoid because

  • \(\beta(1_O)(x) = \alpha\bigl(1_O(\alpha^{-1}(x))\bigr) = x = \mathrm{id}_R(x)\) for all \(x \in R\); and

  • for all \(f', g' \in O_L\), \[\beta(f') \circ \beta(g')(x) = \alpha \Biggl( f' \biggl( \alpha^{-1} \Bigl( \alpha\bigl(g'(\alpha^{-1}(x))\bigr) \Bigr) \biggr) \Biggr) = \alpha\bigl(f' \circ g'(\alpha^{-1}(x))\bigr) = \beta(f' \circ g')(x)\] for all \(x \in R\), so that \(\beta(f') \circ \beta(g') \in O\).

Then \((R, O)\) is an \(\mathop{\mathrm{Ext}}\)-algebra, because for all \(r' \in R_L\), we have \[\beta(\mathrm{left}_{r'})(x) = \alpha\bigl(\mathrm{left}_{r'}(\alpha^{-1}(x))\bigr) = \alpha\bigl(\alpha^{-1}(\alpha(r')) \alpha^{-1}(x)\bigr) = \alpha(r') \cdot x = \mathrm{left}_{\alpha(r')}(x)\] for all \(x \in R\) and \(\beta(\mathrm{right}_{r'})(x) = \mathrm{right}_{\alpha(r')}(x)\) for all \(x \in R\), so that \(\mathrm{left}_{r}, \mathrm{right}_{r} \in O\) for all \(r \in R\) by surjectivity of \(\alpha\).

We now define \((\varphi, \psi)\colon (\Sigma^\triangle, \mathcal{O}(\Sigma^\triangle)) \to (R, O)\) as the unique morphism satisfying \(\varphi(c) = \alpha(\varphi_L(c))\) for all \(c \in \Sigma_\text{int}\) and \(\psi(\mathop{\mathrm{ext}}_{a, b}) = \beta(\psi_L(\mathop{\mathrm{ext}}_{a, b}))\) for all \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\) given by Proposition [ptn:Freeness95Ext-algebras]. It is easy to show that then, \(\varphi(w) = \alpha(\varphi_L(w))\) for all \(w \in \Sigma^\triangle\) by structural induction on \(w\). Hence, by injectivity of \(\alpha\), we have \[\begin{align} \varphi^{-1}\bigl(\alpha(\varphi_L(L))\bigr) & = \{w \in \Sigma^\triangle \mid \alpha(\varphi_L(w)) \in \alpha(\varphi_L(L))\}\\ & = \{w \in \Sigma^\triangle \mid \varphi_L(w) \in \varphi_L(L)\} = \varphi_L^{-1}(\varphi_L(L)) = L \,\,\text{,} \end{align}\] thus \((R, O)\) recognizes \(L\). ◻

6.0.0.0.2 Decidability of quasi-aperiodicity.

This paragraph is devoted to proving Point 2 (a) of Proposition [prop32effectivity], rephrased in the following proposition.

Given a morphism \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to(R,O)\) for \(\Sigma\) a visibly pushdown alphabet and \((R, O)\) a finite \(\mathop{\mathrm{Ext}}\)-algebra, it is decidable if \((\varphi,\psi)\) is quasi-aperiodic. If \((\varphi,\psi)\) is not quasi-aperiodic, one can effectively compute \(k,l\in\mathbb{N}\) such that \(\psi(\mathcal{O}(\Sigma^\triangle)^{k,l})\) is not aperiodic.

For the rest of this paragraph, let us fix a morphism \((\varphi,\psi)\colon(\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to(R,O)\), where \(\Sigma\) is a visibly pushdown alphabet and \((R,O)\) is some finite \(\mathop{\mathrm{Ext}}\)-algebra that is the input to our problem. We first have the following lemma.

For all \(e\in O\) one can effectively compute a finite \(\mathop{\mathrm{Ext}}\)-algebra recognizing \(L_e= \{u\#v\mid uv \in \Sigma^\triangle : \psi(\mathop{\mathrm{ext}}_{u,v})=e\}\), where \(\#\) is a fresh internal letter that does not appear in \(\Sigma\), along with an associated morphism and subset.

Proof. Let \(\Sigma'\) be the alphabet that emerges from \(\Sigma\) by additionally declaring \(\#\) as an internal letter. We will construct an \(\mathop{\mathrm{Ext}}\)-algebra \((R',O')\) and a morphism \((\varphi',\psi')\colon(\Sigma'^\triangle,\mathcal{O}(\Sigma')^\triangle)\to(R',O')\) such that for some element \(r'\in R'\) we have \(L_e=\varphi'^{-1}(r')\).

We define \(R'=R\cup O\cup\{\bot\}\), for some fresh zero \(\bot\), where multiplication between two elements in \(R'\) is defined as follows:

  • multiplication between two elements in \(R\) is inherited from the monoid \(R\);

  • \(r\cdot f=\mathrm{left}_{r}\circ f\) and \(f\cdot r=\mathrm{right}_{r}\circ f\) for all \(r\in R\) and all \(f\in O\);

  • \(\bot\) acts as a zero, i.e.\(\bot\cdot r'=r'\cdot\bot=\bot\) for all \(r'\in R'\);

  • \(f\cdot g=\bot\) for all \(f,g\in O\).

Clearly the identity of \(R\) is the identity of \(R'\). Associativity is immediate except for products of the form \(r_1\cdot f\cdot r_2, r_1\cdot r_2\cdot f\), and \(f\cdot r_1\cdot r_2\), where \(f\in O\) and \(r_1,r_2\in R\). In the first case we have \[\begin{align} (r_1\cdot f)\cdot r_2 & = (\mathrm{left}_{r_1}\circ f)\cdot r_2 = \mathrm{right}_{r_2}\circ(\mathrm{left}_{r_1}\circ f) = (\mathrm{right}_{r_2}\circ\mathrm{left}_{r_1})\circ f\\ & = (\mathrm{left}_{r_1}\circ\mathrm{right}_{r_2})\circ f = r_1\cdot (\mathrm{right}_{r_2}\circ f) = r_1\cdot (f\cdot r_2) \,\,\text{.} \end{align}\] In the second case we have \[(r_1\cdot r_2)\cdot f = \mathrm{left}_{r_1 r_2}\circ f = (\mathrm{left}_{r_1}\circ\mathrm{left}_{r_2})\circ f = \mathrm{left}_{r_1}\circ(\mathrm{left}_{r_2}\circ f) = r_1\cdot(r_2\cdot f)\] and in the third case we have \[f\cdot (r_1\cdot r_2)=\mathrm{right}_{r_1r_2}\circ f= (\mathrm{right}_{r_2}\circ\mathrm{right}_{r_1})\circ f= \mathrm{right}_{r_2}\circ(\mathrm{right}_{r_1}\circ f)= (f\cdot r_1)\cdot r_2 \,\,\text{.}\] We define \(O'=(R')^{R'}\) which is clearly a monoid for composition and thus directly get that \((R', O')\) is an \(\mathop{\mathrm{Ext}}\)-algebra. Applying Proposition [ptn:Freeness95Ext-algebras], we define the morphism \[(\varphi',\psi')\colon (\Sigma'^\triangle,\mathcal{O}(\Sigma')^\triangle)\to(R',O')\] as the unique one satisfying \(\varphi'(c)=\varphi(c)\) for all \(c\in\Sigma_\text{int}\), \(\varphi'(\#)=\mathrm{id}_O\) and where for all \(a \in \Sigma_\text{call}\), \(b \in \Sigma_\text{ret}\), we have \[\psi'(\mathop{\mathrm{ext}}_{a,b})(x)= \begin{cases} \psi(\mathop{\mathrm{ext}}_{a,b})(x) & \text{if x\in R}\\ \psi(\mathop{\mathrm{ext}}_{a,b})\circ x & \text{if x\in O}\\ \bot & \text{otherwise (i.e.\;if x=\bot)} \end{cases}\] for all \(x\in R'\). It suffices to prove the following claim, which directly implies the desired equality \(\varphi'^{-1}(e)= \{u\#v\mid uv \in \Sigma^\triangle \text{ s.t.\;} \psi(\mathop{\mathrm{ext}}_{u,v})=e\}\). For all \(w\in\Sigma'^\triangle\) we have \[\varphi'(w)= \begin{cases} \varphi(w)& \text{ if w\in\Sigma^\triangle}\\ \psi(\mathop{\mathrm{ext}}_{u,v}) & \text{ if w=u\#v for some uv\in\Sigma^\triangle}\\ \bot & \text{ otherwise.} \end{cases}\] We prove it by structural induction on \(w\). The cases when \(w = \varepsilon\) or \(w=c\in\Sigma_\text{int}\) follow immediately from the definition of \(\varphi'\). In case \(w=\#=\varepsilon\#\varepsilon\), we have \(\varphi'(w)=\mathrm{id}_O=\psi(\mathop{\mathrm{ext}}_{\varepsilon,\varepsilon})\).

For the inductive step first assume \(w=aw'b\) for some \(w'\in\Sigma'^\triangle\). If \(w'\) is neither in \(\Sigma^\triangle\) nor of the form \(u\#v\) with \(uv \in \Sigma^\triangle\), then \(\varphi'(w') = \bot\) by induction hypothesis and thus \(\varphi'(w) = \psi'(\mathop{\mathrm{ext}}_{a,b})(\varphi'(w'))=\psi'(\mathop{\mathrm{ext}}_{a,b})(\bot) = \bot\) as required. If \(w'\in\Sigma^\triangle\), then \(\varphi'(w')=\varphi(w')\in R\) by induction hypothesis, and hence \(\varphi'(w)=\psi'(\mathop{\mathrm{ext}}_{a,b})(\varphi'(w'))=\psi'(\mathop{\mathrm{ext}}_{a,b})(\varphi(w'))= \psi(\mathop{\mathrm{ext}}_{a,b})(\varphi(w'))=\varphi(w)\) as required. If \(w'=u\#v\) with \(uv\in\Sigma^\triangle\), i.e.\(w = a u\#v b\), then \(\varphi'(w')=\psi(\mathop{\mathrm{ext}}_{u,v})\in O\) by induction hypothesis. Hence, we have \(\varphi'(w)=\psi'(\mathop{\mathrm{ext}}_{a,b})(\varphi'(w'))= \psi'(\mathop{\mathrm{ext}}_{a,b})(\psi(\mathop{\mathrm{ext}}_{u,v}))=\psi(\mathop{\mathrm{ext}}_{a,b})\circ\psi(\mathop{\mathrm{ext}}_{u,v})= \psi(\mathop{\mathrm{ext}}_{au,vb})\).

Finally assume \(w=xy\) for some \(x,y\in\Sigma'^\triangle\setminus\{\varepsilon\}\). The case when \(x\) or \(y\) is neither in \(\Sigma^\triangle\) nor of the form \(u\#v\) with \(uv \in \Sigma^\triangle\) is easily handled by applying the induction hypothesis and observing that \(\bot\) is a zero in \(R'\). Two other immediate cases are when both \(x\) and \(y\) are in \(\Sigma^\triangle\) and when both \(x\) and \(y\) are of the form \(u\#v\) with \(uv \in \Sigma^\triangle\). Consider the case when \(x\in\Sigma^\triangle\setminus\{\varepsilon\}\) and \(y=u\#v\) with \(uv \in \Sigma^\triangle\), hence \(w=xu\#v\). The induction hypothesis yields \(\varphi'(x)=\varphi(x)\in R\) and \(\varphi'(y)=\psi(\mathop{\mathrm{ext}}_{u,v})\in O\). We obtain \[\varphi'(xy)=\varphi'(x)\cdot\varphi'(y)= \varphi(x)\cdot \psi(\mathop{\mathrm{ext}}_{u,v})= \mathrm{left}_{\varphi(x)}\circ\psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{xu,v})\] as required. Finally, let us treat the case when \(x=u\#v\) with \(uv\in\Sigma^\triangle\) and \(y\in\Sigma^\triangle\setminus\{\varepsilon\}\), i.e.\(w=u\#vy\). The induction hypothesis yields \(\varphi'(x)=\psi(\mathop{\mathrm{ext}}_{u,v})\in O\) and \(\varphi'(y)=\varphi(y)\in R\). We obtain \[\varphi'(xy)=\varphi'(x)\cdot\varphi'(y)= \psi(\mathop{\mathrm{ext}}_{u,v})\cdot\varphi(y)= \mathrm{right}_{\varphi(y)}\circ\psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u,vy})\] as required. ◻

The next goal will be to prove that the set of pairs of word lengths \((\mathopen{}\left|u\right|\mathclose{},\mathopen{}\left|v\right|\mathclose{})\) of words \(u\#v\in L_e\) is effectively semilinear for each \(e\in O\).

A (realtime) pushdown automaton (PDA for short) is a tuple \(A=(Q,\Sigma,\Gamma,\Omega,q_0,F,\bot)\), where \(Q\) is a finite set of states, \(\Sigma\) is a finite input alphabet, \(\Gamma\) is a finite stack alphabet, \(q_0\in Q\) is an initial state, \(F\subseteq Q\) is the set of final states, \(\bot\in\Gamma\setminus\Sigma\) is the bottom-of-stack symbol, and \(\Omega\subseteq Q\times\Sigma\times\Gamma\times Q\times\Gamma^*\) is a finite transition relation such that for all \((p,a,X,q,\alpha)\in\Omega\) we have \(\alpha\in\Gamma^*\bot\) if \(X=\bot\) and \(\alpha\in(\Gamma\setminus\{\bot\})^*\) otherwise. The relation \(\Omega\) is naturally extended to the relation \(\Omega^*\subseteq Q\times\Sigma^*\times\Gamma^*\bot\times Q\times\Gamma^*\bot\), namely as the smallest relation containing the set \(\{(p,\varepsilon,\alpha,p,\alpha)\mid p\in Q,\alpha\in\Gamma^*\bot\}\) and such that moreover, if \((p,a,X,q,\alpha)\in\Omega\) and \((q,w,\alpha\beta,r,\gamma)\in\Omega^*\), then \((p,aw,X\beta,r,\gamma)\in\Omega^*\). The language of \(A\) is \(L(A)=\{w\in\Sigma^*\mid \exists \alpha\in\Gamma^*\bot, \exists q\in F : (q_0,w,\bot,q,\alpha)\in\Omega^*\}\). Hence it is clear that one can compute a PDA \(A'\) such that \(L(A')=L(A)\).

Let \(A\) be a DVPA that accepts a language over a visibly pushdown alphabet \(\Sigma'\) such that \(L(A) \subseteq \{u \# v \mid uv \in \Sigma'^\triangle \setminus \Sigma'^* \# \Sigma'^*\}\) and \(\# \in \Sigma'_\text{int}\). Then the set \[P(L(A))= \{(k,l)\in\mathbb{N}\times\mathbb{N}\mid \exists u\in(\Sigma' \setminus \{\#\})^k, v\in(\Sigma' \setminus \{\#\})^l : u \# v \in L(A)\}\] is effectively semilinear.

Proof. We first compute a PDA \(A'\) accepting the same language as \(A\), i.e. \(L(A')=L(A)\). Let us assume without loss of generality that \(0,1\not\in\Sigma'\). We claim that from \(A'=(Q,\Sigma',\Gamma,\Omega,q_0,F,\bot)\) one can compute a PDA \(A''\) such that \[L(A'')=\{0^{|u|}\#1^{|v|}\mid u\#v\in L(A')\} \,\,\text{.}\] Indeed, the PDA \(A''\) can simply be computed as follows: we set \[A''=(Q\times\{0,1\},\{0,1,\#\},\Gamma,\Omega',\langle q_0,0\rangle,F\times\{1\},\bot) \,\,\text{,}\] where \(\Omega'\) is the union of \(\bigl\{(\langle p,i\rangle,i,X,\langle q,i\rangle,\alpha) \mathrel{\big|} i\in\{0,1\}, \exists c\in\Sigma' \setminus \{\#\} : (p,c,X,q,\alpha)\in\Omega\bigr\}\) and \(\{(\langle p,0\rangle,\#,X,\langle q,1\rangle,\alpha)\mid (p,\#,X,q,\alpha)\in\Omega\}\). Finally, we apply Parikh’s Theorem, cf. [29], which implies that the set \(\{(m,n)\in\mathbb{N}\times\mathbb{N}\mid 0^m\#1^n\in L(A'')\}=P(L(A))\) is effectively semilinear. ◻

We are now ready to prove Proposition [prop32quasi].

Proof of Proposition [prop32quasi]. Let \(e\in O\). By Lemma [lemma32Le] we first compute a finite \(\mathop{\mathrm{Ext}}\)-algebra recoginizing \(L_e\), along with an associated morphism and subset. From the latter we can compute (by Theorem [thm:vpl:ext]) a DVPA \(A_e\) accepting \(L_e\). We then use Lemma [lemma32semilinear] to conclude that the set \[P(L_e) = \{(k,l)\in\mathbb{N}\times\mathbb{N}\mid \exists u\in\Sigma^k,v\in\Sigma^l : uv\in\Sigma^\triangle, \psi(\mathop{\mathrm{ext}}_{u,v})=e\}\] is effectively semilinear, and this holds for all \(e \in O\).

We make use of the folklore fact that semilinear sets are effectively closed under Boolean operations, cf. [30] for a recent study. To decide whether \((\varphi, \psi)\) is quasi-aperiodic, we go through all possible subsets \(U \subseteq O\): if it is a subsemigroup of \(O\) that is a non-trivial group, we compute the set \(\bigcap_{e\in U} P(L_e)\) and reject if it is non-empty (which is easy to check given a semilinear presentation of the set), otherwise we continue. If we were able to go through all those subsets without rejecting, we accept.

Thus, if \((\varphi,\psi)\) is not quasi-aperiodic we can find a subset \(U\subseteq O\) that contains a non-trivial group and output a pair \((k,l)\in \bigcap_{e\in U} P(L_e)\); it witnesses that \(\psi(\mathcal{O}(\Sigma^\triangle)^{k,l})\) is not aperiodic. ◻

6.0.0.0.3 Decidability of length-synchronicity.

This paragraph is devoted to proving Point 2 (b) of Proposition [prop32effectivity], rephrased in the following proposition.

Given a morphism \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to(R,O)\), for \(\Sigma\) a visibly pushdown alphabet and \((R, O)\) a finite \(\mathop{\mathrm{Ext}}\)-algebra, and some \(F\subseteq R\), it is decidable if \((\varphi,\psi)\) is \(F\)-length-synchronous. If \((\varphi,\psi)\) is not length-synchronous, one can effectively compute a tuple \((k,l,k',l')\in\mathbb{N}_{>0}^4\) such that that there exist \(uv,u'v'\in\Sigma^\triangle\) and some \(F\)-reaching idempotent \(e\in O\) such that \(\psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u',v'})=e\), \(k=|u|\), \(l=|v|\), \(k'=|u'|\), \(l'=|v'|\) and \(\frac{k}{l}\not=\frac{k'}{l'}\).

Before proving the proposition we need a technical lemma characterizing when a two-dimensional semilinear set contains only vectors with the same slope. We say two vectors \(\vec{x},\vec{y}\in\mathbb{N}^2\) are co-linear if \(\vec{y}=\alpha\cdot\vec{x}\) for some \(\alpha\in\mathbb{Q}_{>0}\)

Let \(S=\bigcup_{i\in I}\left(\vec{x}_{i,0}+\sum_{j=1}^{t_i}\mathbb{N}\vec{x}_{i,j}\right) \subseteq \mathbb{N}_{>0}^2\) be a non-empty semilinear set, where \(\vec{x}_{i,j}\not=(0,0)\) for all \(i\in I\) and all \(j\in[0,t_i]\). Then, \[\left|\left\{\frac{k}{l}\Big| (k,l)\in S\right\}\right|=1\quad\Longleftrightarrow\quad \forall i,i'\in I\;\forall j\in[0,t_i]\;\forall j'\in [0,t_{i'}]: \vec{x}_{i,j}\text{ and }\vec{x}_{i',j'}\text{ are co-linear}.\]

Proof. First assume that \(\vec{x}_{i,j}\) and \(\vec{x}_{i',j'}\) are co-linear for all \(i,i'\in I\), \(j\in[0,t_i]\), and \(j'\in [0,t_{i'}]\). Let \((k,l),(k',l')\in S\). That is, \((k,l)=\vec{x}_{i,0}+ n_1\vec{x}_{i,1}+\dots+n_{t_i}\vec{x}_{i,t_i}\) and \((k',l')=\vec{x}_{i',0}+n_1'\vec{x}_{i',1}+\dots+n_{t_{i'}}'\vec{x}_{i',t_{i'}}\) for some \(i,i'\in I\) and some \(n_1,\dots,n_{t_i},n_1',\dots,n_{t_{i'}}'\in \mathbb{N}\). But due to pairwise co-linearity there exist \(\alpha,\alpha'\in\mathbb{Q}_{>0}\) such that \((k,l)=\alpha\vec{x}_{i,0}\) and \((k',l')=\alpha'\vec{x}_{i,0}\), thus implying \(\frac{k}{l}=\frac{k'}{l'}\).

Conversely assume that there exist two vectors \((k,l)=\vec{x}_{i,j}\) and \((k',l')=\vec{x}_{i',j'}\) that are not co-linear. In case this is possible when \(i\not= i'\) and \(j=j'=0\) we are done, since then \((k,l),(k',l')\in S\) and thus \(\frac{k}{l}\not=\frac{k'}{l'}\). Otherwise \(\vec{x}_{i,0}\) and \(\vec{x}_{i',0}\) are co-linear for all \(i,i'\in I\), so there must exist \(i\in I\) and \(j\in[0,t_i]\) such that \(\vec{x}_{i,0}\) and \(\vec{x}_{i,j}\) are not co-linear. Then \(\vec{x}_{i,0}\) and \(\vec{x}_{i,0}+\vec{x}_{i,j}\) are in \(S\) but also not co-linear: indeed, if \(\alpha\vec{x}_{i,0}=\vec{x}_{i,0}+\vec{x}_{i,j}\) for some \(\alpha\in\mathbb{Q}_{>0}\), then \(\vec{x}_{i,j}=(\alpha-1)\vec{x}_{i,0}\) with \(\alpha-1>0\) due to \(\vec{x}_{i,0},\vec{x}_{i,j}\in\mathbb{N}^2\setminus\{(0,0)\}\), a contradiction. Hence there exist \((k,l),(k',l')\in S\) that are not co-linear, and therefore \(\frac{k}{l}\not=\frac{k'}{l'}\). ◻

Proof of Proposition [prop32length32effectivity]. Let us fix the \(\mathop{\mathrm{Ext}}\)-algebra morphism \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to(R,O)\), where \((R, O)\) is a finite \(\mathop{\mathrm{Ext}}\)-algebra and where \(F\subseteq R\).

Recall that over the alphabet \(\Sigma'\), obtained from \(\Sigma\) by declaring a fresh letter \(\#\) as internal, the language \[L_{e \uparrow} = \{u\#v\mid uv \in \Sigma^\triangle : \Delta(u) > 0, \psi(\mathop{\mathrm{ext}}_{u,v})=e\} = L_e \cap \{u\#v\mid uv \in \Sigma^\triangle : \Delta(u) > 0\}\] is given for all \(e \in O\). The language \(\{u\#v\mid uv \in \Sigma^\triangle : \Delta(u) > 0\}\) is a clearly a VPL. Thus, for all \(e \in O\), we have that the set \[P(L_{e \uparrow}) = \left\{(k,l)\in\mathbb{N}\times\mathbb{N}\mid \exists u\in\Sigma^k,v\in\Sigma^l : uv\in\Sigma^\triangle, \Delta(u) > 0, \psi(\mathop{\mathrm{ext}}_{u,v})=e\right\}\] is effectively semilinear: indeed, given \(e \in O\), using Lemma [lemma32Le] and Theorem [thm:vpl:ext], we can as in the proof of Point 2 (a) of Proposition [prop32effectivity] compute a DVPA \(A_e\) accepting \(L_e\); we then compute a DVPA \(A_{e \uparrow}\) accepting \(L_{e \uparrow} = L(A_e) \cap L(A)\) by using the effective construction given in [7] and finally use Lemma [lemma32semilinear] to conclude.

Observe that \((\varphi,\psi)\) is \(F\)-length-synchronous if, and only if, for each \(F\)-reaching idempotent \(e \in O\) for which \(P(L_{e\uparrow})\) is non-empty we have \(|\{\frac{k}{l}\mid (k,l)\in P(L_{e \uparrow})\}|=1.\) The latter condition is easily seen to be decidable by the characterization provided in Lemma [lemma32collinear]. Hence, for deciding if \((\varphi,\psi)\) is length-synchronous our algorithm verifies if for all \(F\)-reaching \(e\in O\) for which \(P(L_{e\uparrow})\) is non-empty we have \(|\{\frac{k}{l}\mid (k,l)\in P(L_{e \uparrow})\}|=1.\) On the other hand, if this verification fails, i.e. in case \((\varphi,\psi)\) is not \(F\)-length-synchronous, our algorithm outputs, again using the characterization of Lemma [lemma32collinear], a quadruple \((k,l,k',l')\in\mathbb{N}_{>0}^4\) such that for some \(F\)-reaching idempotent \(e\in O\) we have \((k,l),(k',l')\in P(L_{e\uparrow})\) and \(\frac{k}{l}\not=\frac{k'}{l'}\). ◻

6.0.0.0.4 Decidability of weak length-synchronicity.

This paragraph is devoted to proving Point 2 (c) of Proposition [prop32effectivity], rephrased in the following proposition.

Given a morphism \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to(R,O)\), for \(\Sigma\) a visibly pushdown alphabet and \((R, O)\) a finite \(\mathop{\mathrm{Ext}}\)-algebra, and some \(F\subseteq R\), it is decidable if \((\varphi,\psi)\) is \(F\)-weakly-length-synchronous.

Let us fix the morphism \((\varphi,\psi)\colon (\Sigma^\triangle,\mathcal{O}(\Sigma^\triangle))\to(R,O)\), for \(\Sigma\) a visibly pushdown alphabet and \((R, O)\) a finite \(\mathop{\mathrm{Ext}}\)-algebra, and some \(F\subseteq R\).

Define the new visibly pushdown alphabet \(\overline{\Sigma}\) by \(\overline{\Sigma}_\text{call}= \{\overline{b} \mid b \in \Sigma_\text{ret}\}\), \(\overline{\Sigma}_\text{int}= \{\overline{c} \mid c \in \Sigma_\text{int}\}\) and \(\overline{\Sigma}_\text{ret}= \{\overline{a} \mid a \in \Sigma_\text{call}\}\). For all \(w \in \Sigma^*\), we define \[\overline{w} = \begin{cases} \varepsilon& \text{if w = \varepsilon}\\ \overline{w_n} \cdots \overline{w_1} & \text{if w = w_1 \cdots w_n for n \in \mathbb{N}_{>0} and w_1, \ldots w_n \in \Sigma} \,\,\text{.} \end{cases}\] We have the following lemma, that we prove later on.

For all \(e\in O\) one can effectively compute a finite \(\mathop{\mathrm{Ext}}\)-algebra recognizing the language of well-matched words \(K_e= \{u\#\overline{u'}\mid u, u' \in \Sigma^*, \exists v \in \Sigma^* : uv \in \Sigma^\triangle, u'v \in \Sigma^\triangle, \psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u',v})=e\}\), where \(\#\) is a fresh internal letter that does not appear in \(\Sigma \cup \overline{\Sigma}\), along with an associated morphism and subset.

Over the alphabet \(\Sigma'\) obtained from \(\Sigma \cup \overline{\Sigma}\) by declaring the fresh letter \(\#\) as internal, we define \[\begin{align} K_{e \uparrow} & = \biggl\{u\#\overline{u'}\mathrel{\bigg|} \begin{aligned} & u, u' \in \Sigma^*, \exists v \in \Sigma^* :\\ & uv \in \Sigma^\triangle, u'v \in \Sigma^\triangle, \Delta(u) > 0, \psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u',v})=e \end{aligned}\biggr\}\\ & = K_e \cap \{u\#u'\mid uu' \in (\Sigma \cup \overline{\Sigma})^\triangle : \Delta(u) > 0\} \end{align}\] for all \(e \in O\). As in the proof of Point (2) of the second statement of Proposition [prop32effectivity], we can prove that the language \(\{u\#u'\mid uu' \in (\Sigma \cup \overline{\Sigma})^\triangle : \Delta(u) > 0\}\) is a VPL and thus conclude that for all \(e \in O\), the set \[P(K_{e \uparrow}) = \biggl\{(k,l)\in\mathbb{N}\times\mathbb{N}\mathrel{\bigg|} \begin{align} & \exists u\in\Sigma^k, u'\in\Sigma^l, v \in \Sigma^*:\\ & uv\in\Sigma^\triangle, u'v \in \Sigma^\triangle, \Delta(u) > 0, \psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u',v})=e \end{align}\biggr\}\] is effectively semilinear.

It is clear that \((\varphi, \psi)\) is \(F\)-weakly-length-synchronous if and only if for each idempotent \(e \in O\) that is \(F\)-reaching, there does not exist any \((x_1, x_2) \in P(K_{e \uparrow})\) such that \(x_1 \neq x_2\). Therefore, to decide whether \((\varphi, \psi)\) is \(F\)-weakly-length-synchronous, we go through all \(e \in O\): if \(e\) is an idempotent that is \(F\)-reaching, we compute the set \(P(K_{e \uparrow})\) and reject if it contains a vector \((x_1, x_2)\) such that \(x_1 \neq x_2\) (which is easy to check given a semilinear presentation of the set), otherwise we continue. Finally, if we were able to go through all those elements without rejecting, we accept.

Proof of Lemma [lemma32Ke]. Let \(\Sigma'\) be the alphabet that emerges from \(\Sigma \cup \overline{\Sigma}\) by additionally declaring \(\#\) as an internal letter. We will construct an \(\mathop{\mathrm{Ext}}\)-algebra \((R',O')\) and a morphism \((\varphi',\psi')\) from \((\Sigma'^\triangle,\mathcal{O}(\Sigma')^\triangle)\) to \((R',O')\) such that for some subset \(F \subseteq R'\) we have \(K_e=\varphi'^{-1}(F)\).

Let \(\overline{R} = \{\overline{r} \mid r \in R\}\). We define \(R' = R \cup \overline{R} \cup \mathfrak{P}(O^2) \setminus \emptyset \cup \{\bot, 1\}\), for some fresh zero \(\bot\) and identity \(1\), where multiplication between two elements in \(R'\) is defined as follows:

  • for all \(r_1, r_2 \in R\), \[\begin{align} r_1 \cdot r_2 & = r_1 r_2 & \overline{r_1} \cdot r_2 & = \bot\\ \overline{r_1} \cdot \overline{r_2} & = \overline{r_2 r_1} & r_1 \cdot \overline{r_2} & = \bot \,\,\text{;} \end{align}\]

  • for all \(r \in R\) and \(E \in \mathfrak{P}(O^2) \setminus \emptyset\), \[\begin{align} r \cdot E & = \{(\mathrm{left}_{r} \circ e_1, e_2) \mid (e_1, e_2) \in E\} & E \cdot r & = \bot\\ E \cdot \overline{r} & = \{(e_1, \mathrm{left}_{r} \circ e_2) \mid (e_1, e_2) \in E\} & \overline{r} \cdot E & = \bot \,\,\text{;} \end{align}\]

  • for all \(E_1, E_2 \in \mathfrak{P}(O^2) \setminus \emptyset\), we have \(E_1 \cdot E_2 = \bot\);

  • \(\bot\) acts as a zero, i.e.\(\bot\cdot r'=r'\cdot\bot=\bot\) for all \(r'\in R'\);

  • \(1\) acts as an identity, i.e.\(1 \cdot r' = r' \cdot 1 = r'\) for all \(r'\in R'\).

Associativity is immediate except for products of the form \(\overline{r_1} \cdot \overline{r_2} \cdot \overline{r_3}\), \(r_1 \cdot E \cdot \overline{r_2}\), \(r_1 \cdot r_2 \cdot E\) and \(E \cdot \overline{r_1} \cdot \overline{r_2}\), where \(E \in \mathfrak{P}(O^2) \setminus \emptyset\) and \(r_1, r_2, r_3 \in R\). In the first case we have \[(\overline{r_1} \cdot \overline{r_2}) \cdot \overline{r_3} = \overline{r_2 r_1} \cdot \overline{r_3} = \overline{r_3 r_2 r_1} = \overline{r_1} \cdot \overline{r_3 r_2} = \overline{r_1} \cdot (\overline{r_2} \cdot \overline{r_3}) \,\,\text{.}\] In the second case we have \[\begin{align} (r_1 \cdot E) \cdot \overline{r_2} & = \{(\mathrm{left}_{r_1} \circ e_1, e_2) \mid (e_1, e_2) \in E\} \cdot \overline{r_2}\\ & = \{(\mathrm{left}_{r_1} \circ e_1, \mathrm{left}_{r_2} \circ e_2) \mid (e_1, e_2) \in E\}\\ & = r_1 \cdot \{(e_1, \mathrm{left}_{r_2} \circ e_2) \mid (e_1, e_2) \in E\} = r_1 \cdot (E \cdot \overline{r_2}) \,\,\text{.} \end{align}\] In the third case we have \[\begin{align} (r_1 \cdot r_2) \cdot E & = \{(\mathrm{left}_{r_1 r_2} \circ e_1, e_2) \mid (e_1, e_2) \in E\}\\ & = \{(\mathrm{left}_{r_1} \circ \mathrm{left}_{r_2} \circ e_1, e_2) \mid (e_1, e_2) \in E\}\\ & = r_1 \cdot \{(\mathrm{left}_{r_2} \circ e_1, e_2) \mid (e_1, e_2) \in E\} = r_1 \cdot (r_2 \cdot E) \end{align}\] and in the fourth case we have \[\begin{align} E \cdot (\overline{r_1} \cdot \overline{r_2}) & = \{(e_1, \mathrm{left}_{r_2 r_1} \circ e_2) \mid (e_1, e_2) \in E\}\\ & = \{(e_1, \mathrm{left}_{r_2} \circ \mathrm{left}_{r_1} \circ e_2) \mid (e_1, e_2) \in E\}\\ & = \{(e_1, \mathrm{right}_{r_1} \circ e_2) \mid (e_1, e_2) \in E\} \cdot \overline{r_2} = (E \cdot \overline{r_1}) \cdot \overline{r_2} \,\,\text{.} \end{align}\] We define \(O'=(R')^{R'}\) which is clearly a monoid for composition and thus directly get that \((R', O')\) is a finite \(\mathop{\mathrm{Ext}}\)-algebra. Applying Proposition [ptn:Freeness95Ext-algebras], we define the morphism \((\varphi',\psi')\colon (\Sigma'^\triangle,\mathcal{O}(\Sigma')^\triangle)\to(R',O')\) as the unique one satisfying \(\varphi'(c)=\varphi(c)\) and \(\varphi'(\overline{c}) = \overline{\varphi(c)}\) for all \(c\in\Sigma_\text{int}\), \(\varphi'(\#)= \{(\psi(\mathop{\mathrm{ext}}_{\varepsilon, v}), \psi(\mathop{\mathrm{ext}}_{\varepsilon, v})) \mid v \in \Sigma^\triangle\}\) and where for all \(a, a' \in \Sigma_\text{call}\), \(b, b' \in \Sigma_\text{ret}\), we have \[\begin{align} \psi'(\mathop{\mathrm{ext}}_{a,b})(x) & = \begin{cases} \psi(\mathop{\mathrm{ext}}_{a,b})(1_R) & \text{if x=1}\\ \psi(\mathop{\mathrm{ext}}_{a,b})(x) & \text{if x\in R}\\ \bot & \text{otherwise} \end{cases}\\ \psi'(\mathop{\mathrm{ext}}_{\overline{b'},\overline{a'}})(x) & = \begin{cases} \overline{\psi(\mathop{\mathrm{ext}}_{a',b'})(1_R)} & \text{if x=1}\\ \overline{\psi(\mathop{\mathrm{ext}}_{a',b'})(x')} & \text{if x=\overline{x'} for x'\in R}\\ \bot & \text{otherwise} \end{cases}\\ \psi'(\mathop{\mathrm{ext}}_{a,\overline{a'}})(x) & = \begin{cases} \bigcup_{\substack{b \in \Sigma_\text{ret}\\z \in \Sigma^\triangle\\ (e_1, e_2) \in x}} \{(\psi(\mathop{\mathrm{ext}}_{a,bz}) \circ e_1, \psi(\mathop{\mathrm{ext}}_{a',bz}) \circ e_2)\} & \text{if x \in \mathfrak{P}(O^2) \setminus \emptyset}\\ \bot & \text{otherwise} \end{cases}\\ \psi'(\mathop{\mathrm{ext}}_{\overline{b'},b})(x) & = \bot \end{align}\] for all \(x\in R'\). Note that \((\varphi', \psi')\) is computable because \[\begin{align} \{(\psi(\mathop{\mathrm{ext}}_{\varepsilon, v}), \psi(\mathop{\mathrm{ext}}_{\varepsilon, v})) \mid v \in \Sigma^\triangle\} & = \{(\mathrm{right}_{\varphi(v)}, \mathrm{right}_{\varphi(v)}) \mid v \in \Sigma^\triangle\}\\ & = \{(\mathrm{right}_{r}, \mathrm{right}_{r}) \mid r \in R\} \end{align}\] and \[\begin{align} & \bigcup_{\substack{b \in \Sigma_\text{ret}\\z \in \Sigma^\triangle\\ (e_1, e_2) \in x}} \{(\psi(\mathop{\mathrm{ext}}_{a,bz}) \circ e_1, \psi(\mathop{\mathrm{ext}}_{a',bz}) \circ e_2)\}\\ = & \bigcup_{\substack{b \in \Sigma_\text{ret}\\z \in \Sigma^\triangle\\ (e_1, e_2) \in x}} \{(\mathrm{right}_{\varphi(z)} \circ \psi(\mathop{\mathrm{ext}}_{a,b}) \circ e_1, \mathrm{right}_{\varphi(z)} \circ \psi(\mathop{\mathrm{ext}}_{a',b}) \circ e_2)\}\\ = & \bigcup_{\substack{b \in \Sigma_\text{ret}\\r \in R\\ (e_1, e_2) \in x}} \{(\mathrm{right}_{r} \circ \psi(\mathop{\mathrm{ext}}_{a,b}) \circ e_1, \mathrm{right}_{r} \circ \psi(\mathop{\mathrm{ext}}_{a',b}) \circ e_2)\} \end{align}\] for all \(x \in \mathfrak{P}(O^2) \setminus \emptyset\) and \(a, a' \in \Sigma_\text{call}\).

Now define the set of pairs \(P = \{(u, u') \in \Sigma^* \times \Sigma^* \mid \exists v \in \Sigma^* : uv \in \Sigma^\triangle, u'v \in \Sigma^\triangle\}\); it is not difficult to check that for all \(w \in \Sigma'^*\), \(w \in \Sigma'^\triangle \cap \Sigma^* \# \overline{\Sigma}^*\) if and only if \(w = u\#\overline{u'}\) for \((u, u') \in P\). It suffices to prove the following claim, which directly implies the desired equality \[\begin{align} & \varphi'^{-1}(\{E \in \mathfrak{P}(O^2) \setminus \emptyset \mid (e, e) \in E\})\\ = & \{u\#\overline{u'} \mid (u, u') \in P, \exists v \in \Sigma^* : uv \in \Sigma^\triangle, u'v \in \Sigma^\triangle, \psi(\mathop{\mathrm{ext}}_{u, v}) = \psi(\mathop{\mathrm{ext}}_{u', v}) = e\}\\ = & \{u\#\overline{u'} \mid u, u' \in \Sigma^*, \exists v \in \Sigma^* : uv \in \Sigma^\triangle, u'v \in \Sigma^\triangle, \psi(\mathop{\mathrm{ext}}_{u,v})=\psi(\mathop{\mathrm{ext}}_{u',v})=e\} \,\,\text{.} \end{align}\] For all \(w\in\Sigma'^\triangle\) we have \[\varphi'(w)= \begin{cases} 1 & \text{if w = \varepsilon}\\ \varphi(w) & \text{if w\in\Sigma^\triangle\setminus\{\varepsilon\}}\\ \overline{\varphi(w')} & \text{if w = \overline{w'} for w' \in \Sigma^\triangle\setminus\{\varepsilon\}}\\ \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\} & \text{if w=u\#\overline{u'} for (u, u') \in P}\\ \bot & \text{otherwise.} \end{cases}\] We prove it by structural induction on \(w\). The cases when \(w = \varepsilon\) or \(w=c\in\Sigma_\text{int}\) or \(w=\overline{c}\in\overline{\Sigma}_\text{int}\) follow immediately from the definition of \(\varphi'\). In case \(w=\#=\varepsilon\#\varepsilon\), we have \[\varphi'(w)= \{(\psi(\mathop{\mathrm{ext}}_{\varepsilon, v}), \psi(\mathop{\mathrm{ext}}_{\varepsilon, v})) \mid v \in \Sigma^\triangle\} = \{(\psi(\mathop{\mathrm{ext}}_{\varepsilon, v}), \psi(\mathop{\mathrm{ext}}_{\varepsilon, v})) \mid v \in \Sigma^*, \varepsilon v \in \Sigma^\triangle\}\] as required.

For the inductive step first assume \(w=\alpha w' \beta\) for \(w'\in\Sigma'^\triangle\), \(\alpha \in \Sigma_\text{call}\cup \overline{\Sigma}_\text{call}\) and \(\beta \in \Sigma_\text{ret}\cup \overline{\Sigma}_\text{ret}\). If \(w'\) is neither in \(\Sigma^\triangle \cup \overline{\Sigma}^\triangle\) nor of the form \(u\#\overline{u'}\) with \((u, u') \in P\), then \(\varphi'(w') = \bot\) by induction hypothesis and thus \(\varphi'(w) = \psi'(\mathop{\mathrm{ext}}_{\alpha,\beta})(\varphi'(w')) = \psi'(\mathop{\mathrm{ext}}_{\alpha,\beta})(\bot) = \bot\) as required, since \(w\) is also neither in \(\Sigma^\triangle \cup \overline{\Sigma}^\triangle\) nor of the form \(u\#\overline{u'}\) with \((u, u') \in P\). If \(w' = \varepsilon\), then \(\varphi'(w') = 1\) and hence \[\begin{align} \varphi'(w) & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(\varphi'(w'))\\ & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(1)\\ & = \begin{cases} \psi(\mathop{\mathrm{ext}}_{\alpha, \beta})(1_R) = \varphi(w) & \text{if \alpha \in \Sigma_\text{call} and \beta \in \Sigma_\text{ret}}\\ \overline{\psi(\mathop{\mathrm{ext}}_{a, b})(1_R)} = \overline{\varphi(a b)} & \text{if \alpha = \overline{b} \in \overline{\Sigma}_\text{call} and \beta = \overline{a} \in \overline{\Sigma}_\text{ret}}\\ \bot & \text{otherwise} \end{cases} \end{align}\] as required, because \(w = \overline{b} \, \overline{a} = \overline{a b}\) in the second case. If \(w' \in \Sigma^\triangle \setminus \{\varepsilon\}\), then \(\varphi'(w') = \varphi(w') \in R\) by induction hypothesis, and hence \[\begin{align} \varphi'(w) = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(\varphi'(w')) & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(\varphi(w'))\\ & = \begin{cases} \psi(\mathop{\mathrm{ext}}_{\alpha, \beta})(\varphi(w')) = \varphi(w) & \text{if \alpha \in \Sigma_\text{call} and \beta \in \Sigma_\text{ret}}\\ \bot & \text{otherwise} \end{cases} \end{align}\] as required. If \(w' \in \overline{\Sigma}^\triangle \setminus \{\varepsilon\}\), then \(w' = \overline{w''}\) for \(w'' \in \Sigma^\triangle \setminus \{\varepsilon\}\), so \(\varphi'(w') = \overline{\varphi(w'')} \in \overline{R}\) by induction hypothesis, and hence \[\begin{align} \varphi'(w) & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(\varphi'(w'))\\ & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(\overline{\varphi(w'')})\\ & = \begin{cases} \overline{\psi(\mathop{\mathrm{ext}}_{a, b})(\varphi(w''))} = \overline{\varphi(a w'' b)} & \text{if \alpha = \overline{b} \in \overline{\Sigma}_\text{call} and \beta = \overline{a} \in \overline{\Sigma}_\text{ret}}\\ \bot & \text{otherwise} \end{cases} \end{align}\] as required, because \(w = \overline{b} \, \overline{w''} \, \overline{a} = \overline{a w'' b}\) in the first case. If \(w'=u\#u'\) with \((u, u') \in P\), i.e.\(w = \alpha u\#u' \beta\), then \[\varphi'(w') = \{(\psi(\mathop{\mathrm{ext}}_{u,v'}), \psi(\mathop{\mathrm{ext}}_{u', v'})) \mid v' \in \Sigma^*, uv', u'v' \in \Sigma^\triangle\} \in \mathfrak{P}(O^2) \setminus \emptyset\] by induction hypothesis. Hence, we have \[\begin{align} \varphi'(w) & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta})(\varphi'(w'))\\ & = \psi'(\mathop{\mathrm{ext}}_{\alpha, \beta}) (\{(\psi(\mathop{\mathrm{ext}}_{u,v'}), \psi(\mathop{\mathrm{ext}}_{u', v'})) \mid v' \in \Sigma^*, uv', u'v' \in \Sigma^\triangle\})\\ & = \bigcup_{\substack{b \in \Sigma_\text{ret}\\z \in \Sigma^\triangle}} \{(\psi(\mathop{\mathrm{ext}}_{au,v'bz}), \psi(\mathop{\mathrm{ext}}_{a'u',v'bz})) \mid v' \in \Sigma^*, uv', u'v' \in \Sigma^\triangle\}\\ & = \{(\psi(\mathop{\mathrm{ext}}_{au,v}), \psi(\mathop{\mathrm{ext}}_{a'u', v})) \mid v \in \Sigma^*, auv, a'u'v \in \Sigma^\triangle\} \end{align}\] if \(\alpha = a \in \Sigma_\text{call}\) and \(\beta = \overline{a'} \in \overline{\Sigma}_\text{ret}\) (where the last inclusion from right to left follows by considering the unique stair factorizations given by Lemma [lemma32ext] for the elements of each pair) and \(\varphi'(w) = \bot\) otherwise, as required.

Finally assume \(w=xy\) for some \(x, y \in \Sigma'^\triangle \setminus \{\varepsilon\}\). The case when \(x\) or \(y\) is neither in \(\Sigma^\triangle \cup \overline{\Sigma}^\triangle\) nor of the form \(u\#\overline{u'}\) with \((u, u') \in P\) is easily handled by applying the induction hypothesis and observing that \(\bot\) is a zero in \(R'\). Four other immediate cases are when both \(x\) and \(y\) are in \(\Sigma^\triangle\), when \(x\) is in \(\Sigma^\triangle\) and \(y\) in \(\overline{\Sigma}^\triangle\), when \(x\) is in \(\overline{\Sigma}^\triangle\) and \(y\) in \(\Sigma^\triangle\) and when both \(x\) and \(y\) are of the form \(u\#u'\) with \((u, u') \in P\). For the case when both \(x\) and \(y\) are in \(\overline{\Sigma}^\triangle\), we have that \(x = \overline{x'}\) and \(y = \overline{y'}\) for \(x', y' \in \Sigma^\triangle\), so that \(\varphi'(x) = \overline{\varphi(x')} \in \overline{R}\) and \(\varphi'(y) = \overline{\varphi(y')} \in \overline{R}\) by induction hypothesis, hence \[\varphi'(x y) = \varphi'(x) \cdot \varphi'(y) = \overline{\varphi(x')} \cdot \overline{\varphi(y')} = \overline{\varphi(y') \varphi(x')} = \overline{\varphi(y' x')}\] as required, because \(x y = \overline{x'} \, \overline{y'} = \overline{y' x'}\). Consider the case when \(x \in (\Sigma^\triangle \cup \overline{\Sigma}^\triangle) \setminus \{\varepsilon\}\) and \(y = u\#\overline{u'}\) with \((u, u') \in P\), hence \(w = x u\#\overline{u'}\). The induction hypothesis yields \[\varphi'(x) = \begin{cases} \varphi(x) \in R & \text{if x \in \Sigma^\triangle \setminus \{\varepsilon\}}\\ \overline{\varphi(x')} \in \overline{R} & \text{if x = \overline{x'} for x' \in \Sigma^\triangle \setminus \{\varepsilon\}} \end{cases}\] and \(\varphi'(y) = \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\} \in \mathfrak{P}(O^2) \setminus \emptyset\). We obtain \[\begin{align} \varphi'(w) & = \varphi'(x) \cdot \varphi'(y)\\ & = \varphi(x) \cdot \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\}\\ & = \{(\mathrm{left}_{\varphi(x)} \circ \psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\}\\ & = \{(\psi(\mathop{\mathrm{ext}}_{x u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, xuv, u'v \in \Sigma^\triangle\} \end{align}\] if \(x \in \Sigma^\triangle \setminus \{\varepsilon\}\) and \(\varphi'(w) = \overline{\varphi(x')} \cdot \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\} = \bot\) if \(x = \overline{x'}\) for \(x' \in \Sigma^\triangle \setminus \{\varepsilon\}\), as required. Eventually, let us treat the case when \(x = u\#u'\) with \((u, u') \in P\) and \(y \in (\Sigma^\triangle \cup \overline{\Sigma}^\triangle) \setminus \{\varepsilon\}\), hence \(w = u\#\overline{u'} y\). The induction hypothesis yields \(\varphi'(x) = \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\} \in \mathfrak{P}(O^2) \setminus \emptyset\) and \(\varphi'(y) = \begin{cases} \varphi(y) \in R & \text{if y \in \Sigma^\triangle \setminus \{\varepsilon\}}\\ \overline{\varphi(y')} \in \overline{R} & \text{if y = \overline{y'} for y' \in \Sigma^\triangle \setminus \{\varepsilon\}} \end{cases}\). We obtain \[\begin{align} \varphi'(w) & = \varphi'(x) \cdot \varphi'(y)\\ & = \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\} \cdot \overline{\varphi(y')}\\ & = \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \mathrm{left}_{\varphi(y')} \circ \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\}\\ & = \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{y' u', v})) \mid v \in \Sigma^*, uv, y'u'v \in \Sigma^\triangle\} \end{align}\] if \(y = \overline{y'}\) for \(y' \in \Sigma^\triangle \setminus \{\varepsilon\}\) and \(\varphi'(w) = \{(\psi(\mathop{\mathrm{ext}}_{u,v}), \psi(\mathop{\mathrm{ext}}_{u', v})) \mid v \in \Sigma^*, uv, u'v \in \Sigma^\triangle\} \cdot \varphi(y) = \bot\) if \(x \in \Sigma^\triangle \setminus \{\varepsilon\}\), as required, because \(\overline{y' u'} = \overline{u'} \, \overline{y'}\) in the first case. ◻

7 sec:Conclusion↩︎

In this paper we have studied the question of which visibly pushdown languages lie in the complexity class \(\mathsf{AC}^0\).

We have introduced the notions of length-synchronicity, weak length-synchronicity and quasi-counterfreeness. We have introduced intermediate VPLs: these are quasi-counterfree VPLs generated by context-free grammars \(G\) involving the production \(S\rightarrow_G\varepsilon\) for the start nonterminal \(S\) and whose further productions are all of the form \(T\rightarrow_G uT'v\), where \(uv\) is well-matched, \(u\in(\Sigma_\text{int}^*\Sigma_\text{call}\Sigma_\text{int}^*)^+\), \(v\in(\Sigma_\text{int}^*\Sigma_\text{ret}\Sigma_\text{int}^*)^+\), and the set of contexts \(\{(u,v)\in\mathsf{Con}(\Sigma)\mid S\Rightarrow_G^*uSv\}\) is weakly length-synchronous but not length-synchronous. To the best of our knowledge our community is unaware of whether at all there is an intermediate VPL that is provably in \(\mathsf{AC}^0\) (even in \(\mathsf{ACC}^0\)) or provably not in \(\mathsf{AC}^0\). In fact we conjecture that every intermediate VPL is neither in \(\mathsf{ACC}^0\) nor \(\mathsf{TC}^0\)-hard.

Our main result states that there is an algorithm that, given a visibly pushdown language \(L\), outputs if \(L\) surely lies in \(\mathsf{AC}^0\), surely does not lie in \(\mathsf{AC}^0\) (by providing some \(m\geq 2\) such that \(L(A)\) is \(\mathsf{ACC}^0(m)\)-hard), or outputs a disjoint finite union of intermediate VPLs that \(L\) is constant-depth equivalant to. In the latter case one can moreover compute distinct \(k,l\in\mathbb{N}_{>0}\) such that already \(\mathcal{L}_{k,l}=L(S\rightarrow \varepsilon\mid a c^{k-1} S b_1\mid ac^{l-1}Sb_2)\) is constant-depth reducible to \(L\).

We conjecture that due to the particular nature of intermediate VPLs, either all of them are in \(\mathsf{AC}^0\) or all are not: this conjecture together with our main result indeed implies that there is an algorithm that decides if a given visibly pushdown language is in \(\mathsf{AC}^0\).

As main tools we carefully revisited \(\mathop{\mathrm{Ext}}\)-algebras, introduced by Czarnetzki et al. [9], being closely related to forest algebras, introduced by Bojańczyk and Walukiewicz [10]. For the reductions from \(\mathcal{L}_{k,l}\) we made use of Green’s relations.

Natural questions arise. Is there any concrete intermediate VPL that is provably in \(\mathsf{ACC}^0\), provably not in \(\mathsf{AC}^0\), or hard for \(\mathsf{TC}^0\)? Another exciting question is whether one can effectively compute those visibly pushdown languages that lie in the complexity class \(\mathsf{TC}^0\). Is there is a \(\mathsf{TC}^0\)/\(\mathsf{NC}^1\) complexity dichotomy? For these questions new techniques seem to be necessary. In this context it is already interesting to mention there is an \(\mathsf{NC}^1\)-complete visibly pushdown language whose syntactic \(\mathop{\mathrm{Ext}}\)-algebra is aperiodic. Another exciting question is to give an algebraic characterization of the visibly counter languages.

References↩︎

[1]
M. P. Schützenberger, “On finite monoids having only trivial subgroups,” Inf. Control., vol. 8, no. 2, pp. 190–194, 1965, doi: 10.1016/S0019-9958(65)90108-7.
[2]
H. Straubing, Finite automata, formal logic, and circuit complexity. Birkhäuser Boston, 1994.
[3]
Y. Gurevich and H. R. Lewis, “A logic for constant-depth circuits,” Inf. Control., vol. 61, no. 1, pp. 65–74, 1984, doi: 10.1016/S0019-9958(84)80062-5.
[4]
N. Immerman, “Languages that capture complexity classes,” SIAM J. Comput., vol. 16, no. 4, pp. 760–778, 1987, doi: 10.1137/0216051.
[5]
D. A. M. Barrington, K. J. Compton, H. Straubing, and D. Thérien, “Regular languages in NC\({^1}\),” J. Comput. Syst. Sci., vol. 44, no. 3, pp. 478–499, 1992, doi: 10.1016/0022-0000(92)90014-A.
[6]
K. Mehlhorn, Pebbling Moutain Ranges and its Application of DCFL-Recognition,” in Automata, languages and programming, 7th colloquium, noordweijkerhout, the netherlands, july 14-18, 1980, proceedings, 1980, vol. 85, pp. 422–435, doi: 10.1007/3-540-10003-2\_89.
[7]
R. Alur and P. Madhusudan, “Visibly pushdown languages,” in Proceedings of the 36th annual ACM symposium on theory of computing, chicago, IL, USA, june 13-16, 2004, 2004, pp. 202–211, doi: 10.1145/1007352.1007390.
[8]
R. Alur, V. Kumar, P. Madhusudan, and M. Viswanathan, “Congruences for visibly pushdown languages,” in Automata, languages and programming, 32nd international colloquium, ICALP 2005, lisbon, portugal, july 11-15, 2005, proceedings, 2005, vol. 3580, pp. 1102–1114, doi: 10.1007/11523468\_89.
[9]
S. Czarnetzki, A. Krebs, and K.-J. Lange, “Visibly pushdown languages and free profinite algebras,” CoRR, vol. abs/1810.12731, 2018, [Online]. Available: http://arxiv.org/abs/1810.12731.
[10]
M. Bojanczyk and I. Walukiewicz, “Forest algebras,” in Logic and automata: History and perspectives [in honor of wolfgang thomas], 2008, vol. 2, pp. 107–132.
[11]
P. W. Dymond, “Input-driven languages are in log n depth,” Inf. Process. Lett., vol. 26, no. 5, pp. 247–250, 1988, doi: 10.1016/0020-0190(88)90148-2.
[12]
D. A. M. Barrington, Bounded-Width Polynomial-Size Branching Programs Recognize Exactly Those Languages in NC\({^1}\),” J. Comput. Syst. Sci., vol. 38, no. 1, pp. 150–164, 1989, doi: 10.1016/0022-0000(89)90037-8.
[13]
A. Krebs, K.-J. Lange, and M. Ludwig, “Visibly counter languages and constant depth circuits,” in 32nd international symposium on theoretical aspects of computer science, STACS 2015, march 4-7, 2015, garching, germany, 2015, vol. 30, pp. 594–607, doi: 10.4230/LIPIcs.STACS.2015.594.
[14]
M. Ludwig, Tree-structured problems and parallel computation,” PhD thesis, University of Tübingen, Germany, 2019.
[15]
M. A. Harrison, Introduction to formal language theory. Addison-Wesley, 1978.
[16]
[17]
S. Jukna, Boolean function complexity - advances and frontiers, vol. 27. Springer, 2012.
[18]
A. K. Chandra, L. J. Stockmeyer, and U. Vishkin, “Constant depth reducibility,” SIAM J. Comput., vol. 13, no. 2, pp. 423–439, 1984, doi: 10.1137/0213028.
[19]
N. Immerman, Descriptive complexity. Springer, 1999.
[20]
J. Håstad, “Almost optimal lower bounds for small depth circuits,” in Proceedings of the 18th annual ACM symposium on theory of computing, may 28-30, 1986, berkeley, california, USA, 1986, pp. 6–20, doi: 10.1145/12130.12132.
[21]
R. Beigel, “The polynomial method in circuit complexity,” in Proceedings of the eigth annual structure in complexity theory conference, san diego, CA, USA, may 18-21, 1993, 1993, pp. 82–95, doi: 10.1109/SCT.1993.336538.
[22]
V. Bárány, C. Löding, and O. Serre, “Regularity problems for visibly pushdown languages,” in STACS 2006, 23rd annual symposium on theoretical aspects of computer science, marseille, france, february 23-25, 2006, proceedings, 2006, vol. 3884, pp. 420–431, [Online]. Available: https://doi.org/10.1007/11672142\_34.
[23]
S. Eilenberg, Automata, languages, and machines. Volume A. New York: Academic Press, 1974.
[24]
S. Eilenberg, Automata, languages, and machines. Volume B. New York: Academic Press, 1976.
[25]
J.-É. Pin, (Traduction de Variétés de langages formels)Varieties of formal languages. North Oxford, London; Plenum, New-York, 1986.
[26]
J.-É. Pin, Ed., Handbook of automata theory. European Mathematical Society Publishing House, Zürich, Switzerland, 2021.
[27]
H. Straubing, “On logical descriptions of regular languages,” in LATIN 2002: Theoretical informatics, 5th latin american symposium, cancun, mexico, april 3-6, 2002, proceedings, 2002, vol. 2286, pp. 528–538, doi: 10.1007/3-540-45995-2\_46.
[28]
J. Esparza, M. Luttenberger, and M. Schlund, “A brief history of Strahler numbers,” in Language and automata theory and applications - 8th international conference, LATA 2014, madrid, spain, march 10-14, 2014. proceedings, 2014, vol. 8370, pp. 1–13, doi: 10.1007/978-3-319-04921-2\_1.
[29]
J. Esparza, P. Ganty, S. Kiefer, and M. Luttenberger, “Parikh’s theorem: A simple and direct automaton construction,” Inf. Process. Lett., vol. 111, no. 12, pp. 614–619, 2011, doi: 10.1016/j.ipl.2011.03.019.
[30]
D. Chistikov and C. Haase, “The taming of the semi-linear set,” in 43rd international colloquium on automata, languages, and programming, ICALP 2016, rome, italy, july 11-15, 2016, 2016, vol. 55, pp. 128:1–128:13, doi: 10.4230/LIPICS.ICALP.2016.128.

  1. The first author was supported by the Agence Nationale de la Recherche grant no. ANR-17-CE40-0010.↩︎

  2. In the terminology of Green’s relations, to be introduced in the proof of Proposition [prop32SM32lowerbound], this is equivalent to the fact that \(e \leq_{\mathfrak{J}}f\).↩︎