1 Introduction

The restarting automaton was introduced in [9] to model the linguistic technique of analysis by reduction (see, e.g., [12]). Despite its linguistic motivation, also many classical families of formal languages have been characterized by various types of restarting automata (for a survey see, e.g., [16]). A particularly simple type of restarting automaton is the ordered restarting automaton (ORWW-automaton, for short) that has been introduced in [15] in relation with the processing of languages of rectangular pictures.

An ORWW-automaton consists of a finite-state control, a tape with endmarkers, a read-write window of size three, and a (partial) ordering on its tape alphabet. Based on the actual state and window contents, the automaton can move its window one position to the right and change its state, or it can replace the letter in the middle of the window by a smaller letter and restart, or it can accept. During a restart, the window is moved back to the left end of the tape, and the finite-state control is reset to the initial state. In [17], it is shown that deterministic ORWW-automata (det-ORWW-automata) don’t need states and that they characterize the class of regular languages. On the other hand, the nondeterministic ORWW-automata yield an abstract family of languages that is incomparable to the (deterministic) context-free languages, the Church-Rosser languages, and the growing context-sensitive languages with respect to inclusion [10, 11]. However, stateless nondeterministic ORWW-automata (stl-ORWW-automata) are only as expressive as det-ORWW-automata, that is, they yield just another characterization for the regular languages.

In [18] (see, also [19]), the det-ORWW-automaton was extended to the deterministic ordered restart-delete automaton (or det-ORD-automaton, for short). This was achieved by introducing an additional restart-delete operation that allows to delete the symbol from the middle of the window and to restart. The det-ORD-automata do not need states, either, and the class of languages they accept properly includes the class of deterministic context-free languages, while it is contained in the intersection of the (unambiguous) context-free languages and the Church-Rosser languages.

Here we turn to the nondeterministic variant of the ordered restart-delete automaton. As this model extends both, the det-ORD-automaton as well as the ORWW-automaton, it is immediate that the resulting language class is quite large. In particular, this class contains languages that are not even growing context-sensitive [10, 11]. Therefore, we restrict our attention to the stateless variant of these automata, the stateless ordered restart-delete automaton (or stl-ORD-automaton, for short). In fact, for technical reasons that will be discussed in Section 3, we concentrate on a restricted variant called swift stl-ORD-automaton. A swift stl-ORD-automaton can always perform move-right steps unless its window is already at the right end of the tape. While the stl-ORWW-automaton just accepts the regular languages, the swift stl-ORD-automaton yields a characterization for the context-free languages.

We also study the descriptional complexity of stl-ORD-automata, where we use the size of the underlying tape alphabet as a complexity measure for a stateless ORWW- or ORD-automaton. Based on our constructions we show that the increase in alphabet size that is required when turning a stl-ORD-automaton into a stl-ORWW-automaton for the same (regular) language cannot be bounded from above by any recursive function. That is, we obtain a non-recursive trade-off for this conversion.

Finally, we relate the swift stl-ORD-automata to a new class of limited context restarting automata. A limited context restarting automaton can be seen as a certain type of string rewriting system [2], where the accepted language is defined as the set of all input words that are reducible to the empty word (see, e.g., [1]). Various types of limited context restarting automata have been defined and used to characterize some of the classes of the Chomsky hierarchy [21]. Here we show that the new class of limited context restarting automata that is obtained from the swift stl-ORD-automata is a proper subclass of the limited context restarting automata of type \(\mathcal {R}_{1}^{\prime }\). In addition, this new class is incomparable under inclusion to the limited context restarting automata of type \(\mathcal {R}_{2}^{\prime }\), although it has exactly the same expressive capacity.

This paper is structured as follows. In Section 2, we define the stl-ORD-automaton, we illustrate it by a detailed example, and we establish a kind of normal form result for stl-ORD-automata. In the next section, we prove that each swift stl-ORD-automaton can be simulated by a pushdown automaton (PDA), which implies that all languages accepted by swift stl-ORD-automata are necessarily context-free. Then, in Section 4, we show conversely that each context-free language is accepted by a swift stl-ORD-automaton. This is done by providing a simulation of a PDA by a swift stl-ORD-automaton. In Section 5, we present the aformentioned non-recursive trade-off and in Section 6, we relate the swift stl-ORD-automata to limited context restarting automata. In the concluding section, we summarize our results and describe the hierarchy of language classes obtained through a detailed diagram.

2 The Stateless Ordered Restart-Delete Automaton

An alphabet Σ is a finite set of letters. For all n ≥ 1, Σn is the set of words over Σ of length n, Σ+ is the set of non-empty words, and Σ =Σ + ∪{λ}, where λ denotes the empty word. For wΣ, |w| denotes the length of w. A language over Σ is any subset of Σ. Of particular interest are the classes REG, DCFL, CFL, CRL, and GCSL of regular, deterministic context-free, context-free, Church-Rosser [13], and growing context-sensitive languages [3, 6]. Furthermore, for any type of automaton X, \({\mathscr{L}}(\textsf {X})\) is used to denote the class of (input) languages that are accepted by automata of that type.

Definition 1

A stateless ordered restart-delete automaton (stl-ORD-automaton) has a flexible tape with endmarkers and a read/write window of size 3. It is defined by a 6-tuple \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>),\) where Σ is a finite input alphabet, Γ is a finite tape alphabet such that \(\varSigma \subseteq \varGamma \), the symbols \(\rhd , \lhd \not \in \varGamma \), called sentinels, serve as markers for the left and right border of the work space, respectively, > is a partial ordering on Γ, and

$$\delta:(((\varGamma\cup\{\rhd\})\cdot\varGamma\cdot(\varGamma\cup\{\lhd\}))\cup\{\rhd\lhd\}) \to 2^{\varGamma \cup \{\lambda,{\mathsf{MVR}}\}} \cup \{{\mathsf{Accept}}\}$$

is the transition relation that describes four types of transition steps:

  1. (1)

    A move-right step has the form MVRδ(a1a2a3), where \(a_{1}\in \varGamma \cup \{\rhd \}\) and a2,a3Γ. It causes M to shift the window one position to the right.

  2. (2)

    A restart-rewrite step has the form bδ(a1a2a3), where \(a_{1}\in \varGamma \cup \{\rhd \}\), a2,bΓ, and \(a_{3}\in \varGamma \cup \{\lhd \}\) such that a2 > b holds. It causes M to replace the symbol a2 in the middle of its window by b and to restart, which means that the window is shifted to the left end of the tape so that the first symbol it contains is the left sentinel \(\rhd \). Observe that this operation requires that the newly written letter b is smaller than the letter a2 being replaced with respect to the partial ordering >.

  3. (3)

    A restart-delete step has the form λδ(a1a2a3), where \(a_{1}\in \varGamma \cup \{\rhd \}\), a2Γ, and \(a_{3}\in \varGamma \cup \{\lhd \}\). It causes M to delete the symbol a2 in the middle of its window and to restart. Through this step, the tape field that contains a2 is also removed, that is, the length of the tape is reduced.

  4. (4)

    An accept step has the form δ(a1a2a3) = Accept, where \(a_{1}\in \varGamma \cup \{\rhd \}\), a2Γ, and \(a_{3}\in \varGamma \cup \{\lhd \}\). It causes M to halt and accept. In addition, we allow an accept step of the form \(\delta (\rhd \lhd )={\mathsf {Accept}}\).

Observe that, for each word \(u\in (\varGamma \cup \{\rhd \})\cdot \varGamma \cdot (\varGamma \cup \{\lhd \})\), either δ(u) = Accept or δ(u) does not contain an accept step. The motivation for this restriction is the observation that the aim of a computation consists in accepting an input word, and hence, once an accept step becomes applicable, it makes no sense to choose a different transition step.

If δ(u) is undefined for some word u, then M necessarily halts, when its window contains the word u, and we say that M rejects in this situation. Furthermore, the letters in \(\varGamma \smallsetminus \varSigma \) are called auxiliary symbols.

A configuration of a stl-ORD-automaton M is a word \(\alpha \in \{\rhd \}\cdot \varGamma ^{*}\cdot \{\lhd \}\) in which a factor of length three (or all of α if |α|≤ 3) is underlined. Here it is understood that α is the current contents of the tape and that the window contains the underlined factor. A restarting configuration has the form \(\rhd w \lhd \), where the prefix of length three is underlined; if wΣ, then this restarting configuration is also called an initial configuration. A configuration that is reached by an accept step is an accepting configuration, denoted by Accept, and a configuration of the form \(\alpha _{1}\underline {a_{1}a_{2}a_{3}}\alpha _{2}\) such that δ(a1a2a3) is undefined is a rejecting configuration. A halting configuration is either an accepting or a rejecting configuration. By ⊩M we denote the single-step computation relation that M induces on its set of configurations. Then \(\vdash _{M}^{*}\), the reflexive and transitive closure of ⊩M, is the computation relation of M.

Any computation of a stl-ORD-automaton M consists of certain phases. A phase, called a cycle, starts in a restarting configuration, the window is moved along the tape by MVR steps until a restart-rewrite or a restart-delete step is performed and thus, a new restarting configuration is reached. By \({\vdash ^{c}_{M}}\) we denote the execution of a cycle, and \(\vdash ^{c^{*}}_{M}\) is the reflexive transitive closure of \({\vdash _{M}^{c}}\). It is the reduction relation that M induces on its set of restarting configurations.

The part of a computation that follows after the last execution of a restart-rewrite or restart-delete operation is called a tail. Hence, a tail starts in a restarting configuration, the window is moved along the tape by MVR steps until either an accept step is performed or the automaton gets stuck in a rejecting configuration. Accordingly, we speak of an accepting tail or a rejecting tail.

A word wΓ is accepted by M, if there exists a computation of M which starts with the restarting configuration \(\rhd w \lhd \) and ends with an accept step. The language consisting of all words that are accepted by M is denoted by LC(M). It is called the characteristic language of M. The (input) languageL(M) of M is the set of all words wΣ that are accepted by M. Obviously, L(M) = LC(M) ∩Σ.

As each cycle ends with a rewrite operation, which replaces a symbol a by a symbol b that is strictly smaller than a with respect to the given ordering >, or with a delete operation, we see that each computation of M on an input of length n consists of at most |Γ|⋅ n many cycles. Each cycle (and each tail) of M can be simulated in linear time by a nondeterministic two-tape Turing machine that stores the prefix α1 of a configuration \(\alpha _{1}\underline {a_{1}a_{2}a_{3}}\alpha _{2}\) of M on one of the tapes and the suffix a1a2a3α2 on the other tape. Hence, M can be simulated by a nondeterministic two-tape Turing machine in time O(n2).

As each det-ORD-automaton can be simulated by a stateless det-ORD-automaton [18], we obtain the following inclusion.

Proposition 1

\({\mathscr{L}}(\textsf {det-ORD})\subseteq {\mathscr{L}}(\textsf {stl-ORD})\).

The following example illustrates how stl-ORD-automata work.

Example 1

Let L = {anbnn ≥ 0}∪{anb2nn ≥ 0}. It is well-known that L is a context-free language that is not deterministic context-free. Furthermore, this language is not accepted by any ORWW-automaton [10, 11]. However, L is accepted by the stl-ORD-automaton \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) that is defined by taking Σ = {a,b} and Γ =Σ ∪{a1,e,e1,f,f1,f2}, by choosing the partial ordering > such that a > a1, b > e > e1, and b > f > f1 > f2, and by defining the transition relation δ as follows:

$$\begin{array}{rlclrlclrlcl} (0) & \delta(xyz) & \ni & {\mathsf{MVR}}{\kern8mm} &\multicolumn{8}{l}{\text{for all } x\in\varGamma\cup\{\rhd\}\text{ and }y,z\in\varGamma,}\\ (1) & \delta(\rhd \lhd) & = & {\mathsf{Accept}},& \\ (2) & \delta(ab\lhd) & = & \{e\}, & (10) & \delta(a_{1}ee) & \ni & e_{1},{\kern8mm} & (18) & \delta(a_{1}ff) & \ni & f_{1},\\ (3) & \delta(bb\lhd) & = & \{e,f\}, & (11) & \delta(a_{1}e\lhd) & \ni & e_{1},& (19) & \delta(f_{1}ff) & \ni & f_{2},\\ (4) & \delta(bbe) & \ni & e, & (12) & \delta(aa_{1}e_{1}) & \ni & \lambda,& (20) & \delta(f_{1}f\lhd) & \ni & f_{2},\\ (5) & \delta(abe) & \ni & e, & (13) & \delta(\rhd a_{1}e_{1}) & \ni & \lambda,& (21) & \delta(a_{1}f_{1}f_{2}) & \ni & \lambda,\\ (6) & \delta(bbf) &\ni & f, & (14) & \delta(ae_{1}e) & \ni & \lambda,& (22) & \delta(aa_{1}f_{2}) & \ni & \lambda,\\ (7) & \delta(abf) & \ni & f, & (15) & \delta(\rhd e_{1}\lhd) & \ni & \lambda,& (23) & \delta(\rhd a_{1}f_{2}) & \ni & \lambda,\\ (8) & \delta(aae) & \ni & a_{1}, & (16) & \delta(aaf) & \ni & a_{1},& (24) & \delta(af_{2}f) & \ni & \lambda,\\ (9) & \delta(\rhd ae) & \ni & a_{1}, & (17) & \delta(\rhd af) & \ni & a_{1}, & (25) & \delta(\rhd f_{2}\lhd) & \ni & \lambda. \end{array}$$

For an input of the form ambn, first the factor bn is rewritten, from right to left, into en or into fn using lines (2) to (7). In the former case, it is then checked whether m = n by alternatingly rewriting the last letter a into a1, the first letter e into e1 and then deleting a1 and e1 using lines (8) to (15). In the latter case, it is checked whether n = 2m by alternatingly rewriting the last letter a into a1 and the first factor ff into f1f2 and then deleting f1, a1, and f2 using lines (16) to (25). For example, given w = aabbbb as input, M can execute the following computation, where we attach the number of the line used as an index to the computation relation ⊩:

$$\begin{array}{lclclcl} \underline{\rhd aa}bbbb \lhd & \vdash_{(0)}^{5} & \rhd aabb\underline{bb\lhd} & \vdash_{(3)} & \underline{\rhd aa}bbbf\lhd & \vdash_{(0)}^{4} & \rhd aab\underline{bbf}\lhd\\ & \vdash_{(6)} & \underline{\rhd aa}bbff\lhd & \vdash^{*} & \underline{\rhd aa}ffff\lhd & \vdash_{(0)} & \rhd\underline{aaf}fff\lhd\\ & \vdash_{(16)} & \underline{\rhd aa_{1}}ffff\lhd & \vdash_{(0)}^{2} & \rhd a\underline{a_{1}ff}ff\lhd & \vdash_{(18)} & \underline{\rhd aa_{1}}f_{1}fff\lhd\\ & \vdash_{(0)}^{3} & \rhd aa_{1}\underline{f_{1}ff}\lhd & \vdash_{(19)} & \underline{\rhd aa_{1}}f_{1}f_{2}ff\lhd & \vdash_{(0)}^{2} & \rhd a\underline{a_{1}f_{1}f_{2}}ff\lhd\\ & \vdash_{(21)} & \underline{\rhd aa_{1}}f_{2}ff\lhd & \vdash_{(0)} & \rhd\underline{aa_{1}f_{2}}ff\lhd & \vdash_{(22)} & \underline{\rhd af_{2}}ff\lhd\\ & \vdash_{(0)} & \rhd \underline{af_{2}f}f\lhd & \vdash_{(24)} & \underline{\rhd af}f\lhd & \vdash^{*} & \underline{\rhd f_{2}\lhd}\\ & \vdash_{(25)} & \underline{\rhd\lhd} & \vdash_{(1)} & {\mathsf{Accept}}. \end{array}$$

It follows that L(M) = L.

Let \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) be a stl-ORD-automaton. A word wL(M) is first rewritten into a word zΓ through a sequence of cycles, and then M executes an accepting tail computation on the tape contents \(\rhd z\lhd \). Actually, we can require that all accepting configurations of a stl-ORD-automaton are of a very restricted form.

Proposition 2

From a given stl-ORD-automaton \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\), one can construct a stl-ORD-automaton \(M^{\prime }=(\varSigma ,{\varDelta },\rhd ,\lhd ,\delta ^{\prime },>')\) such that Δ =Γ ∪{#}, where # is a new auxiliary symbol, \(\delta ^{\prime }(\rhd \#\lhd )={\mathsf {Accept}}\) is the only accept step of \(M^{\prime }\), and \(L(M^{\prime })=L(M)\smallsetminus \{\lambda \}\).

Proof

Let \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) be a stl-ORD-automaton and let # be a new auxiliary symbol. The stl-ORD-automaton \(M^{\prime }\) is constructed by replacing each accept step of M by a rewrite-restart step that produces an occurrence of the symbol #. This symbol is then used as context in delete-restart steps that delete all other letters until the configuration \(\underline {\rhd \#\lhd }\) is reached.

Accordingly, we define the stl-ORD-automaton \(M^{\prime }=(\varSigma ,{\varDelta },\rhd ,\lhd ,\delta ^{\prime },>')\) by taking Δ =Γ ∪{#}, by defining > => ∪(Γ×{#}), and by defining the transition relation \(\delta ^{\prime }\) as follows, where a,b,cΓ:

$$\begin{array}{rlcll} (1) & \delta^{\prime}(abc) & = & \delta(abc),&\text{if }\delta(abc)\not={\mathsf{Accept}},\\ (2) & \delta^{\prime}(abc) & = & \{\#\},&\text{if }\delta(abc) = {\mathsf{Accept}},\\ (3) & \delta^{\prime}(ab\lhd) & = & \delta(ab\lhd), &\text{if }\delta(ab\lhd)\not={\mathsf{Accept}},\\ (4) & \delta^{\prime}(ab\lhd) & = & \{\#\},&\text{if }\delta(ab\lhd) = {\mathsf{Accept}},\\ (5) & \delta^{\prime}(\rhd bc) & = & \delta(\rhd bc), &\text{if }\delta(\rhd bc)\not=\mathsf{Accept},\\ (6) & \delta^{\prime}(\rhd bc) & = & \{\#\},&\text{if }\delta(\rhd bc) = {\mathsf{Accept}},\\ (7) & \delta^{\prime}(\rhd b\lhd) & = & \delta(\rhd b\lhd)\smallsetminus\{\lambda\},&\text{if } \delta(\rhd b\lhd)\cap\varGamma\not=\emptyset\text{ and }\\ & & & &(\lambda\not\in\delta(\rhd b\lhd) \text{ or }\delta(\rhd \lhd)\not={\mathsf{Accept}}),\\ (8) & \delta^{\prime}(\rhd b\lhd) & = & \{\#\},& \text{if }\delta(\rhd b\lhd) = {\mathsf{Accept}},\\ (9) & \delta^{\prime}(\rhd b\lhd) & = & (\delta(\rhd b\lhd)\smallsetminus\{\lambda\})\cup\{\#\}, &\text{if }\lambda\in\delta(\rhd b\lhd)\text{ and } \delta(\rhd \lhd)={\mathsf{Accept}}, \end{array}$$
$${}\begin{array}{rlclrlcl} (10) & \delta^{\prime}(\rhd \#b) & = & \{{\mathsf{MVR}}\}, & (13) & \delta^{\prime}(\#bc) & = & \{\lambda\},\\ (11) & \delta^{\prime}(ab\#) & = & \{\lambda\}, & (14) & \delta^{\prime}(\#b\lhd) & = & \{\lambda\},\\ (12) & \delta^{\prime}(\rhd b\#) & = & \{\lambda\}, & (15) & \delta^{\prime}(\rhd\#\lhd) & = & {\mathsf{Accept}}. \end{array}$$

From the definition of \(\delta ^{\prime }\), we see immediately that \(\lambda \not \in L(M^{\prime })\). Let w = a1a2anL(M), where a1,a2,…,anΣ and n ≥ 1. Then M has an accepting computation on input w, that is, w is rewritten into a word zΓ, which is then accepted in a tail computation. If zλ, then by using lines (1), (3), (5), (7) and (9), \(M^{\prime }\) can execute the same cycles as M, in this way rewriting w into z. The accept step of M yields a rewrite step of \(M^{\prime }\) that produces an occurrence of the new auxiliary symbol # (by (2), (4), (6), or (8)), and then \(M^{\prime }\) can rewrite its complete tape contents into the configuration \(\underline {\rhd \#\lhd }\) by lines (10) to (14). If z = λ, then \(M^{\prime }\) produces the tape contents \(\rhd b\lhd \), from which \(\rhd z\lhd = \rhd \lhd \) is obtained through a delete step of M. In this situation \(M^{\prime }\) accepts by lines (9) and (15). Thus, we see that \(L(M)\smallsetminus \{\lambda \}\subseteq L(M^{\prime })\) holds.

On the other hand, let \(w\in L(M^{\prime })\). Then w is non-empty, and we see from the definition of \(M^{\prime }\) that \(\rhd w\lhd \vdash _{M^{\prime }}^{c^{*}} \underline {\rhd \#\lhd }\) holds. As w does not contain any occurrence of the special symbol #, \(M^{\prime }\) must introduce an occurrence of this symbol in the course of its accepting computation. Hence, this computation has the form

$$\rhd w\lhd \vdash_{M^{\prime}}^{c^{*}}\rhd z\lhd = \rhd z_{1}bz_{2}\lhd \vdash_{M^{\prime}}^{c} \rhd z_{1}\#z_{2}\lhd \vdash_{M^{\prime}}^{c^{*}} \underline{\rhd \# \lhd}$$

for some word z = z1bz2 (z1,z2Γ and bΓ), where the first occurrence of the symbol # is created by an application of line (2), (4), (6), (8), or (9). This in turn implies that M can execute the accepting computation \(\rhd w\lhd \vdash _{M}^{c^{*}}\rhd z\lhd \vdash _{M}^{*}{\mathsf {Accept}}\), which shows that wL(M). Hence, \(L(M^{\prime })=L(M)\smallsetminus \{\lambda \}\) follows. □

3 Swift Stl-ORD-Automata Only Accept Context-Free Languages

We would like to show that each language accepted by a stl-ORD-automaton is necessarily context-free. To prove this result, we would simulate the accepting computations of a stl-ORD-automaton by a (nondeterministic) PDA. For this simulation, we would use an extension of the simulation that is given in [18] (see also [19]) for simulating a stl-det-ORD-automaton by a PDA. Unfortunately, that approach leads to a serious technical problem (see the paragraph following Example 2 below). As currently we do not see a way to overcome this problem, we restrict our attention to just a subclass of stl-ORD-automata, the swift-ORD-automata.

We first describe the data structure that will be used for the simulation.

Definition 2

Let \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) be a stl-ORD-automaton, and let w = w1w2wn, where n ≥ 1 and w1,w2,…,wnΓ. To encode the computations of M for the word w in a compact way, we introduce a 3-tuple of vectors Ti = [Li,Wi,Ri] for each letter wi of w, 1 ≤ i ≤|w|, where

  • Wi is a sequence \((x_{i,1},x_{i,2},\ldots ,x_{i,j_{i}},x_{i,j_{i}+1})\) over Γ ∪{λ} such that ji ≥ 0, \(w_{i}=x_{i,1}>x_{i,2}>{\cdots } > x_{i,j_{i}}\) and ((\(x_{i,j_{i}+1}\in \varGamma \) and \(x_{i,j_{i}}>x_{i,j_{i}+1}\)) or \(x_{i,j_{i}+1}=\lambda \)),

  • Li is a sequence of letters \((y_{i,1},y_{i,2},\ldots ,y_{i,j_{i}})\) over \(\varGamma \cup \{\rhd \}\), and

  • Ri is a sequence of letters \((z_{i,1},z_{i,2},\ldots ,z_{i,j_{i}})\) over \(\varGamma \cup \{\lhd \}\) such that δ(yi,rxi,rzi,r) ∋ xi,r+ 1 holds for all r = 1,2,…,ji.

In addition, \(y_{1,r} = \rhd \) for all r = 1,2,…,j1 and \(z_{n,r} = \lhd \) for all r = 1,2,…,jn.

The idea is that Wi encodes the sequence of letters that are produced by M in an accepting computation for a particular field, and Li and Ri encode the information on the neighboring letters to the left and to the right that are used to perform the corresponding rewrite steps. For example, the triple (yi,1,xi,1,zi,1) ∈ (Li,Wi,Ri) means that xi,1 is rewritten into xi,2 by the transition xi,2δ(yi,1xi,1zi,1). We say that xi,1 is rewritten into xi,2 with left context yi,1 and right context zi,1. In particular, if \(x_{i,j_{i}+1}=\lambda \), then the transition \(\lambda \in \delta (y_{i,j_{i}}x_{i,j_{i}}z_{i,j_{i}})\) is used to delete the letter \(x_{i,j_{i}}\). The restrictions on the elements of L1 and Rn just express the fact that w1 is the first letter, and so its left neighboring field contains the left sentinel \(\rhd \), while wn is the last letter, and so its right neigboring field contains the right sentinel \(\lhd \).

We illustrate this definition by a simple example. As the purpose of this example is simply to explain the dynamics of the simulation, the language accepted by the given automaton is not of importance.

Example 2

Let M be the stl-ORD-automaton on the input alphabet Σ = {a1,a2,a3,a4,a5}, the tape alphabet Γ =Σ ∪{b1,b2,b3,b4,#}, and the ordering ai > bi > # (1 ≤ i ≤ 4), where the transition relation is given by the following table:

$$\begin{array}{lcllcllcl} \delta(\rhd a_{1}a_{2}) & = & \{{\mathsf{MVR}},b_{1}\}, {\kern0.7cm}& \delta(a_{1}a_{2}a_{3}) & = & \{{\mathsf{MVR}}\}, {\kern0.3cm}& \delta(a_{2}a_{3}a_{4}) & = & \{b_{3}\},\\ \delta(a_{1}a_{2}b_{3}) & = & \{b_{2}\}, & \delta(\rhd a_{1}b_{2}) & = & \{{\mathsf{MVR}}\}, & \delta(a_{1}b_{2}b_{3}) & = & \{\lambda\},\\ \delta(\rhd a_{1}b_{3}) & = & \{{\mathsf{MVR}},b_{1}\}, & \delta(b_{1}b_{3}a_{4}) & = & \{{\mathsf{MVR}}\}, & \delta(b_{3}a_{4}a_{5}) & = & \{{\mathsf{MVR}},b_{4}\}, \\ \delta(a_{4}a_{5}\lhd) & = & \{\lambda\}, & \delta(b_{3}a_{4}\lhd) & = & \{b_{4}\}, & \delta(b_{3}b_{4}\lhd) & = & \{\lambda\}, \\ \delta(\rhd b_{1}b_{3}) & = & \{{\mathsf{MVR}}\}, & \delta(b_{1}b_{3}b_{4}) & = & \{{\mathsf{MVR}}\}, & \delta(b_{1}b_{3}\lhd) & = & \{\#\}, \\ \delta(\rhd b_{1}\#) & = & \{\lambda\}, & \delta(\rhd \# \lhd) & = & {\mathsf{Accept}}. \end{array}$$

Given the word w = a1a2a3a4a5 as input, M can execute the following accepting computation:

$$\begin{array}{lclclcl} \underline{\rhd a_{1}a_{2}}a_{3}a_{4}a_{5}\lhd & \vdash_{M} & \rhd\underline{a_{1}a_{2}a_{3}}a_{4}a_{5}\lhd & \vdash_{M} & \rhd a_{1}\underline{a_{2}a_{3}a_{4}}a_{5}\lhd & \vdash_{M} & \underline{\rhd a_{1}a_{2}}b_{3}a_{4}a_{5}\lhd\\ & \vdash_{M} & \rhd\underline{a_{1}a_{2}b_{3}}a_{4}a_{5}\lhd & \vdash_{M} & \underline{\rhd a_{1}b_{2}}b_{3}a_{4}a_{5}\lhd & \vdash_{M} & \rhd\underline{a_{1}b_{2}b_{3}}a_{4}a_{5}\lhd\\ & \vdash_{M} & \underline{\rhd a_{1}b_{3}}a_{4}a_{5}\lhd & \vdash_{M} & \underline{\rhd b_{1}b_{3}}a_{4}a_{5}\lhd & \vdash_{M} & \rhd \underline{b_{1}b_{3}a_{4}}a_{5}\lhd \\ & \vdash_{M} & \rhd b_{1}\underline{b_{3}a_{4}a_{5}}\lhd & \vdash_{M} & \rhd b_{1}b_{3}\underline{a_{4}a_{5}\lhd} & \vdash_{M} & \underline{\rhd b_{1}b_{3}}a_{4}\lhd \\ & \vdash_{M} & \rhd \underline{b_{1}b_{3}a_{4}}\lhd & \vdash_{M} & \rhd b_{1}\underline{b_{3}a_{4}\lhd} & \vdash_{M} & \underline{\rhd b_{1}b_{3}}b_{4}\lhd \\ & \vdash_{M} & \rhd \underline{b_{1}b_{3}b_{4}}\lhd & \vdash_{M} & \rhd b_{1}\underline{b_{3}b_{4}\lhd} & \vdash_{M} & \underline{\rhd b_{1}b_{3}}\lhd \\ & \vdash_{M} & \rhd \underline{b_{1}b_{3}\lhd} & \vdash_{M} & \underline{\rhd b_{1}\#}\lhd & \vdash_{M} & \underline{\rhd \#\lhd}\\ & \vdash_{M} & {\mathsf{Accept}}. \end{array}$$

For this computation, we obtain the following sequence of triples:

$$\left[\begin{array}{c|c|c|c|c} \begin{array}[t]{ccc} L_{1} & W_{1} & R_{1}\\ \rhd & a_{1} & b_{3} \\ \rhd & b_{1} & \# \\ & \lambda & \end{array} & \begin{array}[t]{ccc} L_{2} & W_{2} & R_{2}\\ a_{1} & a_{2} & b_{3} \\ a_{1} & b_{2} & b_{3} \\ & \lambda & \end{array} & \begin{array}[t]{ccc} L_{3} & W_{3} & R_{3}\\ a_{2} & a_{3} & a_{4} \\ b_{1} & b_{3} & \lhd \\ & \# & \end{array} & \begin{array}[t]{ccc} L_{4} & W_{4} & R_{4}\\ b_{3} & a_{4} & \lhd \\ b_{3} & b_{4} & \lhd \\ & \lambda & \end{array} & \begin{array}[t]{ccc} L_{5} & W_{5} & R_{5}\\ a_{4} & a_{5} & \lhd\\ & \lambda & \end{array} \end{array}\right]$$

These triples do not only record the history of rewrite and delete steps that have been applied to the various input letters, but the sequence of these triples also provides information on the ordering in which these rewrite and delete steps have been executed at neighboring positions. In fact, if [Li,Wi,Ri]i= 1,2,…,n is a sequence of triples that describe an accepting computation of M on input w = w1w2wn, then we can extract the complete sequence of rewrite and delete operations of M from this sequence. To see this, we inspect the above sequence.

First, we see that w = a1a2a3a4a5. Furthermore, from the first triple [L1,W1,R1] = \(\left [\begin {array}{ccc} \rhd & a_{1} & b_{3} \\ \rhd & b_{1} & \#\\ & \lambda & \end {array}\right ]\), we conclude that M executes the rewrite step \(b_{1}\in \delta (\rhd a_{1}b_{3})\) and the delete step \(\lambda \in \delta (\rhd b_{1}\#)\) at position 1. As this is the first position, we know that the left neighboring field contains the left sentinel \(\rhd \), that is, the left contexts of these steps coincide with (the contents of) the left neighboring field. We express this fact by saying that these steps match left.

Next, we consider the second triple [L2,W2,R2] = \(\left [\begin {array}{ccc} a_{1} & a_{2} & b_{3} \\ a_{1} & b_{2} & b_{3} \\ & \lambda & \end {array}\right ]\). Thus, at position 2, M executes the sequence of rewrite and delete steps b2δ(a1a2b3) and λδ(a1b2b3). As initially field 1 contains the letter a1, we see that the left contexts of these steps coincide with their left neigboring field, that is, they match left.

At position 3, M executes the sequence of rewrite steps b3δ(a2a3a4) and \(\#\in \delta (b_{1}b_{3}\lhd )\). As the initial letter at position 2 is a2, we see that the first of these rewrite steps matches left. After a3 has been rewritten into b3, the right contexts of the rewrite and delete steps at position 2 coincide with (the contents) of their right neighboring field, that is, they match right. Thus, all rewrite and delete steps at position 2 match left and right, which means that all their left and right contexts have been verified. In particular, this implies that these steps can be executed aftera3 has been rewritten into b3. As W2 ends with λ, we can now remove the triple [L2,W2,R2] from the sequence. But then the triple [L3,W3,R3] becomes the right neighbor of [L1,W1,R1], which shows that now the first rewrite at position 1 also matches right. Hence, a1 can now be rewritten into b1, and after that, the second rewrite step at position 3 matches left, too. So the second rewrite step at position 3 is executed after the first rewrite step at position 1. After b3 has been rewritten into #, also the final delete step at position 1 matches right, that is, all rewrite and delete steps at position 1 match left and right. As W1 ends with λ, we can now remove the triple [L1,W1,R1] from the sequence.

At position 4, M executes the rewrite step \(b_{4}\in \delta (b_{3}a_{4}\lhd )\) and the delete step \(\lambda \in \delta (b_{3}b_{4}\lhd )\). As this position initially contains the letter a4, we conclude that the first rewrite step at position 3 matches right. Hence, this rewrite step is executed before the rewrite step at position 4. After a3 has been rewritten into b3, the steps at position 4 match left.

Finally, at position 5, M only executes the delete step \(\lambda \in \delta (a_{4}a_{5}\lhd )\), which matches left and right. In particular, we see that this step is executed before the first rewrite step at position 4. As W5 ends with λ, the triple [L5,W5,R5] can be removed, which means that the right sentinel \(\lhd \) is now the new right neighbor of position 4. This in turn implies that the rewrite and delete steps at position 4 match right. Thus, these steps can now be executed and the triple [L4,W4,R4] can be removed as well. But then \(\lhd \) is the new right neighbor of position 3, and hence, the second rewrite step at position 3 matches right.

Thus, only the triple [L3,W3,R3] remains, and all its rewrite steps have been matched left and right. In fact, from the above considerations we can conclude that the rewrite and delete transitions encoded in the given sequence of triples are executed in the following order:

$$\begin{array}{llclllclllcl} 1. & a_{3} & \to & b_{3}, &\qquad 4. & a_{1} & \to & b_{1},&\qquad 7. & b_{4} & \to & \lambda,\\ 2. & a_{2} & \to & b_{2}, &\qquad 5. & a_{5} & \to & \lambda,& \qquad8. & b_{3} & \to & \#,\\ 3. & b_{2} & \to & \lambda, & \qquad6. & a_{4} & \to & b_{4}, &\qquad 9. & b_{1} & \to & \lambda. \end{array}$$

This is actually the same order as the one in the above computation of M. Finally, as \({\mathsf {Accept}}\in \delta (\rhd \#\lhd )\), we see that the above sequence of triples does indeed describe the accepting computation of M on input a1a2a3a4a5 under the assumption that M can always move to the required position by a sequence of move-right steps.

In the case of stl-ORWW-automata, that is, when no letter can be deleted, the required MVR-steps can easily be inferred from the corresponding sequence of triples considered, and so, by checking the transition relation of M, it can be verified whether they are actually possible. However, for stl-ORD-automata, that is, when delete operations can be used, this is not at all clear, as particular move-right steps may or may not use letters at positions that are at some point deleted. Therefore, in order to turn our idea into a correct simulation of a stl-ORD-automaton by a PDA, we only consider a restricted class of stl-ORD-automata.

Definition 3

A stl-ORD-automaton \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) is called swift (or simply a swift-ORD-automaton) if MVRδ(a1a2a3) for all \(a_{1}\in \varGamma \cup \{\rhd \}\) and all a2,a3Γ. By swift-ORD we denote the class of all swift-ORD-automata.

From a restarting configuration \(\rhd w\lhd \), a swift-ORD-automaton M can move its window to any position on the tape. Thus, a computation of M cannot be blocked by a factor across which M cannot move its window. The stl-ORD-automaton M of Example 1 is actually a swift-ORD-automaton. Furthermore, Proposition 2 carries over to swift-ORD-automata. The aim of this section is the following result.

Theorem 1

\({\mathscr{L}}({\mathsf {swift}\text {-}\mathsf {ORD}}) \subseteq \mathsf {CFL}\).

For establishing this result, we proceed as follows. First, motivated by the discussion in Example 2, we define the notion of compatibility for sequences of triples [L,W,R]. After illustrating this definition by an example, we prove that, for a given input w = w1w2wn, there exists a compatible sequence of triples if and only if w is accepted by the swift-ORD-automaton M considered. Then we describe a PDA P that, on input w = w1w2wn, guesses a corresponding sequence of triples, checks whether this sequence is compatible, and accepts in the affirmative. Together these results imply that L(M) is accepted by the PDA P, which completes the proof of Theorem 1.

Definition 4

Let \(M=(\varSigma ,\varGamma \cup \{\#\},\rhd ,\lhd ,\delta ,>)\) be a swift-ORD-automaton for which \(\delta (\rhd \#\lhd )={\mathsf {Accept}}\) is the only accept step, and let w = w1w2wn, where n ≥ 1 and w1,w2,…,wnΓ. Furthermore, let π = (π0,π1,π2,…,πn,πn+ 1) be a sequence of triples as in Definition 2. Here \(\varPi _{0}=\left [L_{0},W_{0},R_{0}\right ]=[\emptyset ,(\rhd ),\emptyset ]\), \(\varPi _{n+1} = \left [L_{n+1},W_{n+1},R_{n+1}\right ] = [\emptyset ,(\lhd ),\emptyset ]\), and, for all i = 1,2,…,n,

\(\varPi _{i} = [L_{i},W_{i},R_{i}] = \left [\begin {array}{ccc} a_{i,1} & b_{i,1} & c_{i,1} \\ a_{i,2} & b_{i,2} & c_{i,2} \\ \cdots & \cdots & \cdots \\ a_{i,j_{i}}&b_{i,j_{i}}&c_{i,j_{i}}\\ & x_{i} & \end {array} \right ], \)

where ji ≥ 0, ai,r,bi,r,ci,rΓ for all r = 1,2,…,ji, bi,1 = wi, and xiΓ∪{λ}.

  1. (a)

    A pair (πi,πi+ 1) of neighboring triples from the sequence π is said to be compatible if one of the following five conditions is satisfied:

    1. (i)

      If i = 0, then \(a_{1,r} = \rhd \) for all r = 1,2,…,j1. This means that all rewrite (and delete) transitions at position 1 have left context \(\rhd \). In the affirmative, all left contexts of π1 are marked.

    2. (ii)

      If i = n, then \(c_{n,r} = \lhd \) for all r = 1,2,…,jn. This means that all rewrite (and delete) transitions at position n have right context \(\lhd \). In the affirmative, all right contexts of πn are marked.

    3. (iii)

      If xiλxi+ 1, then all rewrite transitions of πi and all rewrite transitions of πi+ 1 can be put into a linear order in such a way that the respective right contexts of the rewrite transitions of πi coincide with the actual letters at position i + 1 and the respective left contexts of the rewrite transitions of πi+ 1 coincide with the actual letters at position i. As in Example 2 we say that the rewrite transitions of πi match right and the rewrite transitions of πi+ 1 match left. Observe that each rewrite transition at position i (i + 1) changes the letter at that position, which means that the possible left (right) context for the rewrite transitions at position i + 1 (i) is changed. The matching right contexts of πi and the matching left contexts of πi+ 1 are marked.

    4. (iv)

      If xiλ and xi+ 1 = λ, then there exists a maximal integer r ∈{0,1,…,ji} such that the first r rewrite transitions of πi and all ji+ 1 rewrite (and delete) transitions of πi+ 1 can be put into a linear order in such a way that the respective right contexts of the first r rewrite transitions of πi coincide with the actual letters at position i + 1 and the respective left contexts of the rewrite (and delete) transitions of πi+ 1 coincide with the actual letters at position i. We say that the first r rewrite transitions of πi match right and the rewrite (and delete) transitions of πi+ 1 match left. The matching right contexts of πi and the matching left contexts of πi+ 1 are marked.

    5. (v)

      If xi = λ and xi+ 1λ, then there exists a maximal integer r ∈{0,1,…,ji+ 1} such that the first r rewrite transitions of πi+ 1 and all ji rewrite (and delete) transitions of πi can be put into a linear order in such a way that the respective right contexts of the ji rewrite (and delete) transitions of πi coincide with the actual letters at position i + 1 and the respective left contexts of the first r rewrite transitions of πi+ 1 coincide with the actual letters at position i. We say that the rewrite (and delete) transitions of πi match right and the first r rewrite transitions of πi+ 1 match left. The matching right contexts of πi and the matching left contexts of πi+ 1 are marked.

    6. (vi)

      If xi = λ and xi+ 1 = λ, then there are two possibilities.

      1. (1)

        There exists a maximal integer r ∈{0,1,…,ji} such that the first r rewrite transitions of πi match right and all ji+ 1 rewrite (and delete) transitions of πi+ 1 match left. Again, the matching right contexts of πi and the matching left contexts of πi+ 1 are marked.

      2. (2)

        There exists a maximal integer r ∈{0,1,…,ji+ 1} such that the first r rewrite transitions of πi+ 1 match left and all ji rewrite (and delete) transitions of πi match right. The matching right contexts of πi and the matching left contexts of πi+ 1 are marked.

  2. (b)

    The sequence of triples π = (π0,π1,π2,…,πn,πn+ 1) is called compatible if it satisfies all of the following conditions:

    1. (1)

      There exists an index s ∈{1,2,…,n} such that xs = #, while xi = λ for all \(i\in \{1,2,\ldots ,n\}\smallsetminus \{s\}\).

    2. (2)

      Each pair of neighboring triples (πi,πi+ 1), i = 0,1,2,…,n, is compatible.

    3. (3)

      From π a sequence of remainder triples \(\varPi ^{\prime }\) is constructed as follows. Each triple πi, \(i\in \{1,2,\ldots ,n\}\smallsetminus \{s\}\), for which all left and all right contexts have been marked, is deleted. For each other triple, all rewrite transitions are deleted for which the corresponding left and right contexts have both been marked. The resulting sequence of triples is the sequence \(\varPi ^{\prime }\). If \(\varPi ^{\prime }\) does not contain any rewrite or delete transitions anymore, then it is compatible; otherwise, it is now checked recursively that the sequence \(\varPi ^{\prime }\) is compatible. For checking the conditions in (a) for \(\varPi ^{\prime }\), the marked contexts are ignored.

We illustrate this definition by taking another look at our example.

Example 2

(cont.) For the automaton M considered above, we have the following sequence of triples π = (π0,π1,π2,π3,π4,π5,π6) =

$$\begin{array}{ccccccc} \left[\begin{array}{ccc} \emptyset & (\rhd) & \emptyset \end{array}\right] & \left[\begin{array}{ccc} \rhd & a_{1} & b_{3} \\ \rhd & b_{1} & \# \\ & \lambda & \end{array}\right] & \left[\begin{array}{ccc} a_{1} & a_{2} & b_{3} \\ a_{1} & b_{2} & b_{3} \\ & \lambda & \end{array} \right] & \left[\begin{array}{ccc} a_{2} & a_{3} & a_{4} \\ b_{1} & b_{3} & \lhd \\ & \# & \end{array} \right]& \left[\begin{array}{ccc} b_{3} & a_{4} & \lhd \\ b_{3} & b_{4} & \lhd \\ & \lambda & \end{array}\right] & \left[\begin{array}{ccc} a_{4} & a_{5} & \lhd\\ & \lambda & \end{array}\right] & \left[\begin{array}{ccc} \emptyset & (\lhd) & \emptyset \end{array}\right] \end{array}.$$

The pairs (π0,π1) and (π5,π6) are obviously compatible by (i) and (ii). Accordingly, the left contexts in π1 and the right contexts in π5 are marked.

The pair \((\varPi _{1},\varPi _{2}) = {\left [\begin {array}{ccc} \rhd & a_{1} & b_{3} \\ \rhd & b_{1} & \# \\ & \lambda & \end {array}\right ] \left [\begin {array}{ccc} a_{1} & a_{2} & b_{3} \\ a_{1} & b_{2} & b_{3} \\ & \lambda & \end {array} \right ]}\) is compatible by case (vi) (1) for r = 0. Here the rewrite and the delete steps at position 2 have left context a1, which is the current letter at position 1.

The pair \((\varPi _{2},\varPi _{3}) = { \left [\begin {array}{ccc} a_{1} & a_{2} & b_{3} \\ a_{1} & b_{2} & b_{3} \\ & \lambda & \end {array} \right ] \left [\begin {array}{ccc} a_{2} & a_{3} & a_{4} \\ b_{1} & b_{3} & \lhd \\ & \# & \end {array} \right ]}\) is compatible by case (v) for r = 1. Here the first rewrite transition at position 3 comes before the rewrite and delete transitions at position 2.

The pair \((\varPi _{3},\varPi _{4}) = { \left [\begin {array}{ccc} a_{2} & a_{3} & a_{4} \\ b_{1} & b_{3} & \lhd \\ & \# & \end {array} \right ] \left [\begin {array}{ccc} b_{3} & a_{4} & \lhd \\ b_{3} & b_{4} & \lhd \\ & \lambda & \end {array}\right ] }\) is compatible by case (iv) with r = 1. Here the first rewrite transition at position 3 comes before the rewrite and delete transitions at position 4.

Finally, the pair \((\varPi _{4},\varPi _{5}) = { \left [\begin {array}{ccc} b_{3} & a_{4} & \lhd \\ b_{3} & b_{4} & \lhd \\ & \lambda & \end {array}\right ] \left [\begin {array}{ccc} a_{4} & a_{5} & \lhd \\ & \lambda & \end {array}\right ]}\) is compatible by case (vi) (1) with r = 0. Here only the delete transition at position 5 is possible.

By marking all the left and right contexts that correspond to the enabled rewrite and delete transitions, we obtain the following variant of the original sequence, where the marked letters are written in boldface:

$$\begin{array}{ccccccc} \left[\begin{array}{ccc} \emptyset & (\rhd) & \emptyset \end{array}\right] & \left[\begin{array}{ccc} \blacktriangleright & a_{1} & b_{3} \\ \blacktriangleright & b_{1} & \# \\ & \lambda & \end{array}\right] & \left[\begin{array}{ccc} {\mathbf{a}_{\mathbf{1}}} & a_{2} & {\mathbf{b}_{\mathbf{3}}} \\ {\mathbf{a}_{\mathbf{1}}} & b_{2} & {\mathbf{b}_{\mathbf{3}}} \\ & \lambda & \end{array} \right] & \left[\begin{array}{ccc} {\mathbf{a}_{\mathbf{2}}} & a_{3} & {\mathbf{a}_{\mathbf{4}}} \\ b_{1} & b_{3} & \lhd \\ & \# & \end{array} \right]& \left[\begin{array}{ccc} {\mathbf{b}_{\mathbf{3}}} & a_{4} & \lhd \\ {\mathbf{b}_{\mathbf{3}}} & b_{4} & \lhd \\ & \lambda & \end{array}\right] & \left[\begin{array}{ccc} {\mathbf{a}_{\mathbf{4}}} & a_{5} & \blacktriangleleft\\ & \lambda & \end{array}\right]& \left[\begin{array}{ccc} \emptyset & (\lhd) &\emptyset \end{array}\right]. \end{array} $$

From this sequence we obtain the sequence of remainder triples \(\varPi ^{\prime } = (\varPi _{0}^{\prime },\varPi _{1}^{\prime },\varPi _{2}^{\prime },\varPi _{3}^{\prime },\varPi _{4}^{\prime }) = { \left [\begin {array}{ccc} \emptyset &(\rhd ) &\emptyset \end {array}\right ]\! \left [\begin {array}{ccc} \blacktriangleright & a_{1} & b_{3} \\ \blacktriangleright & b_{1} & \# \\ & \lambda & \end {array}\right ]\! \left [\begin {array}{ccc} b_{1} & b_{3} & \lhd \\ & \# & \end {array} \right ]\! \left [\begin {array}{ccc} {\mathbf {b}_{\mathbf {3}}} & a_{4} & \lhd \\ {\mathbf {b}_{\mathbf {3}}} & b_{4} & \lhd \\ & \lambda & \end {array}\right ]\! \left [\begin {array}{ccc} \emptyset &(\lhd ) & \emptyset \end {array}\right ] . } \)Continuing recursively, we see that the pairs \((\varPi _{0}^{\prime },\varPi _{1}^{\prime })\) and \((\varPi _{3}^{\prime },\varPi _{4}^{\prime })\) are compatible. Furthermore, the pair \((\varPi _{1}^{\prime },\varPi _{2}^{\prime }) = { \left [\begin {array}{ccc} \blacktriangleright & a_{1} & b_{3} \\ \blacktriangleright & b_{1} & \# \\ & \lambda & \end {array}\right ] \left [\begin {array}{ccc} b_{1} & b_{3} & \lhd \\ & \# & \end {array} \right ]}\) is compatible by case (v) with r = 1. Here the first rewrite step of \(\varPi _{1}^{\prime }\) comes first, the rewrite step of \(\varPi _{2}^{\prime }\) comes second, and then comes the delete step of \(\varPi _{1}^{\prime }\).

Finally, the pair \((\varPi _{2}^{\prime },\varPi _{3}^{\prime }) = { \left [\begin {array}{ccc} b_{1} & b_{3} & \lhd \\ & \# & \end {array} \right ] \left [\begin {array}{ccc} {\mathbf {b}_{\mathbf {3}}} & a_{4} & \lhd \\ {\mathbf {b}_{\mathbf {3}}} & b_{4} & \lhd \\ & \lambda & \end {array}\right ] }\) is compatible by case (iv) with r = 0. By marking the left and right contexts of the corresponding rewrite and delete transitions, we obtain the following sequence:

$$ \left[\begin{array}{ccc} \emptyset & (\rhd) & \emptyset \end{array}\right] \left[\begin{array}{ccc} \blacktriangleright & a_{1} & {\mathbf{b}_{\mathbf{3}}} \\ \blacktriangleright & b_{1} & \boldsymbol{\#}\\ & \lambda & \end{array}\right] \left[\begin{array}{ccc} {\mathbf{b}_{\mathbf{1}}} & b_{3} & \lhd \\ & \# & \end{array} \right] \left[\begin{array}{ccc} {\mathbf{b}_{\mathbf{3}}} & a_{4} & \blacktriangleleft \\ {\mathbf{b}_{\mathbf{3}}} & b_{4} & \blacktriangleleft \\ & \lambda & \end{array}\right] \left[\begin{array}{ccc} \emptyset & (\lhd) & \emptyset \end{array}\right]. $$

From this sequence we finally get the remainder sequence

\(\varPi ^{\prime \prime } = (\varPi _{0}^{\prime \prime },\varPi _{1}^{\prime \prime },\varPi _{2}^{\prime \prime }) = { \left [\begin {array}{ccc} \emptyset &(\rhd ) & \emptyset \end {array}\right ] \left [\begin {array}{ccc} {\mathbf {b}_{\mathbf {1}}} & b_{3} & \lhd \\ & \# & \end {array} \right ] \left [\begin {array}{ccc} \emptyset &(\lhd ) & \emptyset \end {array}\right ] .} \)

In this sequence the right context \(\lhd \) of \(\varPi _{1}^{\prime \prime }\) is marked and the first line of \(\varPi _{1}^{\prime \prime }\) is deleted. This yields the final sequence \(\left [\begin {array}{ccc} \emptyset & (\rhd ) & \emptyset \end {array}\right ] \left [\begin {array}{ccc} \emptyset & (\#) & \emptyset \end {array}\right ] \left [\begin {array}{ccc} \emptyset & (\lhd ) & \emptyset \end {array}\right ]\), which shows that the original sequence is indeed compatible.

On the other hand, the following sequence is not compatible:

$$\varPi = (\varPi_{0},\varPi_{1},\varPi_{2},\varPi_{3},\varPi_{4}) = { \left[\begin{array}{ccc}\emptyset & (\rhd) & \emptyset \end{array} \right]\! \left[\begin{array}{ccc}\rhd & a_{1} & a_{2}\\ \rhd & b_{1} & \# \\ & \lambda & \end{array} \right]\! \left[\begin{array}{ccc}a_{1} & a_{2} & b_{3} \\ & b_{2} & \end{array} \right]\! \left[\begin{array}{ccc} \emptyset & (b_{3}) & \emptyset \end{array}\right] \left[\begin{array}{ccc} \emptyset & (\lhd) & \emptyset \end{array} \right] }.$$

In fact, the pair (π1,π2) is not compatible. Indeed, π1 tells us that the first rewrite transition at position 1 is \(b_{1}\in \delta (\rhd a_{1}a_{2})\), which requires the right context a2, while π2 tells us that the first rewrite transition at position 2 is b2δ(a1a2b3), which requires the left context a1. No matter which of these rewrite transitions is applied first, it destroys the required context for the other rewrite transition.

Lemma 1

Let \(M=(\varSigma ,\varGamma \cup \{\#\},\rhd ,\lhd ,\delta ,>)\) be a swift-ORD-automaton as constructed in Proposition 2, and let w = w1w2wn, where n ≥ 1 and w1,w2,…,wnΓ∪{#}. Then the following statements are equivalent:

  1. (a)

    wLC(M).

  2. (b)

    There exists a compatible sequence of triples

    $$\varPi = (\varPi_{0},\varPi_{1},\varPi_{2},\ldots,\varPi_{n},\varPi_{n+1}),$$

    where \(\varPi _{0} = [\emptyset ,(\rhd ),\emptyset ]\), \(\varPi _{n+1} = [\emptyset ,(\lhd ),\emptyset ]\), and, for all i = 1,2,…,n,

    \(\varPi _{i} = [L_{i},W_{i},R_{i}] = { \left [\begin {array}{ccc} a_{i,1} & b_{i,1} & c_{i,1} \\ a_{i,2} & b_{i,2} & c_{i,2} \\ {\cdots } & {\cdots } & {\cdots } \\ a_{i,j_{i}}&b_{i,j_{i}}&c_{i,j_{i}}\\ & x_{i} & \end {array} \right ]} \text { such that }b_{i,1} = w_{i}. \)

Proof

Let \(M=(\varSigma ,\varGamma \cup \{\#\},\rhd ,\lhd ,\delta ,>)\) be a swift-ORD-automaton as constructed in Proposition 2. Then \(\delta (\rhd \#\lhd )={\mathsf {Accept}}\) is the only accept step of M, and the letter # can neither be rewritten nor deleted. Let w = w1w2wn, where n ≥ 1 and w1,w2,…,wnΓ∪{#}.

Claim 1. If wLC(M), then there exists a sequence of triples π = (π0,π1,π2,…,πn,πn+ 1) that satisfies all the properties in (b).

Proof

If wLC(M), then M has an accepting computation

$$\rhd w \lhd {\vdash_{M}^{c}} \rhd z_{1} \lhd {\vdash_{M}^{c}} {\cdots} {\vdash_{M}^{c}} \rhd z_{m}\lhd {\vdash_{M}^{c}} \rhd \#\lhd\vdash_{M} {\mathsf{Accept}}.$$

By Definition 2, we can associate a triple πi = [Li,Wi,Ri] to each letter wi, i = 1,2,…,n, such that πi describes the rewrite and delete steps that are executed at position i during the above computation. For i = 1,2,…,n, let

\(\varPi _{i}=[L_{i},W_{i},R_{i}] = { \left [\begin {array}{ccc} a_{i,1} & b_{i,1} & c_{i,1} \\ a_{i,2} & b_{i,2} & c_{i,2} \\ {\cdots } & {\cdots } & {\cdots } \\ a_{i,j_{i}} & b_{i,j_{i}} & c_{i,j_{i}}\\ & x_{i} & \end {array}\right ]}, \)

let \(\varPi _{0}=[\emptyset ,(\rhd ),\emptyset ]\), and let \(\varPi _{n+1}=[\emptyset ,(\lhd ),\emptyset ]\). Then \(a_{1,j} = \rhd \) for all 1 ≤ jj1, \(c_{n,j} = \lhd \) for all 1 ≤ jjn, bi,1 = wi, xi ∈{#,λ}, and \(b_{i,1} > b_{i,2} > {\cdots } > b_{i,j_{i}} > x_{i}\) for all 1 ≤ in. Here we extend the partial ordering > by taking b > λ for all letters bΓ. Furthermore, as \(\delta (\rhd \#\lhd )= {\mathsf {Accept}}\) is the only accept step of M, there is a unique index s ∈{1,2,…,n} such that xs = # and xi = λ for all \(i\in \{1,2,\ldots ,n\}\smallsetminus \{s\}\).

We consider the sequence of triples π = (π0,π1,π2,…,πn,πn+ 1). It remains to prove that this sequence is compatible. From the definition of π, we see immediately that conditions (i) and (ii) of part (a) and condition (1) of part (b) of Definition 4 are satisfied.

For proving compatibility of π, we proceed by induction on m, the number of cycles in the above computation. For m = 1, there are three cases:

  1. (1)

    n = 1, w = w1, and \(\#\in \delta (\rhd w_{1}\lhd )\) is the rewrite transition that is used in this cycle. Then \(\varPi _{1} = { \left [\begin {array}{ccc} \rhd & w_{1} & \lhd \\ & \# & \end {array}\right ] }\).

  2. (2)

    n = 2, w1Γ, w2 = #, and \(\lambda \in \delta (\rhd w_{1}\#)\) is the delete transition that is used in this cycle. Then \(\varPi _{1}={ \left [\begin {array}{ccc}\rhd & w_{1} & \# \\ & \lambda & \end {array} \right ]}\) and \(\varPi _{2} ={ \left [\begin {array}{ccc}\emptyset & (\#) & \emptyset \end {array}\right ]}\).

  3. (3)

    n = 2, w1 = #, w2Γ, and \(\lambda \in \delta (\#w_{2}\lhd )\) is the delete transition that is used in this cycle. Then \(\varPi _{1} = { \left [\begin {array}{ccc}\emptyset & (\#) & \emptyset \end {array}\right ]}\) and \(\varPi _{2} = { \left [\begin {array}{ccc} \# & w_{2} & \lhd \\ & \lambda & \end {array} \right ]}\).

In each of these cases it is easily seen that the corresponding sequence π is compatible.

For the inductive step we scrutinize the first cycle

$$\rhd w \lhd = \underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{n}\lhd {\vdash_{M}^{c}} \rhd z_{1}\lhd$$

of the above computation. In this cycle a rewrite or delete transition bδ(wi− 1wiwi+ 1) is executed, where bΓ∪{#,λ} and i ∈{1,2,…,n}. Thus, the triples πi− 1, πi, and πi+ 1 look as follows, where \(w_{0}=\rhd \) and \(w_{n+1}=\lhd \): \( \varPi _{i-1} = { \left [\begin {array}{ccc} a_{i-1,1} & w_{i-1} & c_{i-1,1} \\ L_{i-1}^{\prime } & W_{i-1}^{\prime } & R_{i-1}^{\prime } \end {array} \right ]}, \varPi _{i} = { \left [\begin {array}{ccc} w_{i-1} & w_{i} & w_{i+1} \\ a_{i,2} & b & c_{i,2} \\ L_{i}^{\prime } & W_{i}^{\prime } & R_{i}^{\prime } \end {array} \right ]},\)

and \(\varPi _{i+1} = { \left [\begin {array}{ccc} a_{i+1,1} & w_{i+1} & c_{i+1,1} \\ L_{i+1}^{\prime } & W_{i+1}^{\prime } & R_{i+1}^{\prime } \end {array} \right ]}. \)

Here \(L_{i-1}^{\prime },W_{i-1}^{\prime },R_{i-1}^{\prime },L_{i}^{\prime },W_{i}^{\prime },R_{i}^{\prime },L_{i+1}^{\prime },W_{i+1}^{\prime },R_{i+1}^{\prime }\) denote the remaining parts of the corresponding sequences.

We now contruct a new sequence \(\varPi ^{\prime }\). For all \(j\in \{0,1,2,\ldots ,n+1\}\smallsetminus \{i\}\), we take \(\varPi _{j}^{\prime } = \varPi _{j}\). Furthermore, we take \(\varPi _{i}^{\prime } = { \left [\begin {array}{ccc} a_{i,2} & b & c_{i,2} \\ L_{i}^{\prime } & W_{i}^{\prime } & R_{i}^{\prime } \end {array} \right ]}\), if bλ. In this way, we obtain the sequence \(\varPi ^{\prime } = (\varPi _{0}^{\prime },\varPi _{1}^{\prime },\ldots ,\varPi _{i-1}^{\prime },\varPi _{i}^{\prime },\varPi _{i+1}^{\prime },\ldots ,\varPi _{n}^{\prime },\varPi _{n+1}^{\prime })\), if bλ, or \(\varPi ^{\prime } = (\varPi _{0}^{\prime },\varPi _{1}^{\prime }.\ldots ,\varPi _{i-1}^{\prime },\varPi _{i+1}^{\prime }\ldots ,\varPi _{n}^{\prime },\varPi _{n+1}^{\prime })\), if b = λ. In either case, the sequence \(\varPi ^{\prime }\) corresponds to the computation

$$\rhd z_{1} \lhd = \rhd w_{1}{\cdots} w_{i-1}bw_{i+1}{\cdots} w_{n}\lhd {\vdash_{M}^{c}} {\cdots} {\vdash_{M}^{c}} \rhd z_{m}\lhd {\vdash_{M}^{c}} \rhd \#\lhd\vdash_{M}{\mathsf{Accept}}$$

of M. As this computation consists of only m − 1 cycles. the induction hypothesis yields that the sequence \(\varPi ^{\prime }\) is compatible. Compatibility of π now follows easily, which completes the proof of Claim 1. □

Claim 2. If there exists a sequence of triples π = (π0,π1,…,πn,πn+ 1) that satisfies all the properties in (b), then wLC(M).

Proof

Let π = (π0,π1,π2,…,πn,πn+ 1) be a sequence of triples that satisfies all the properties in (b). We proceed by induction on the overall number \(R={\sum }_{i=1}^{n} j_{i}\) of rewrite and delete steps encoded in this sequence of triples. If R = 1, then either a single rewrite step or a single delete step is described by the given sequence. In the former case, we have n = 1 and compatibility of π implies that \(\varPi _{1} = { \left [\begin {array}{ccc} \rhd & w_{1} & \lhd \\ & \# & \end {array}\right ]}\). Hence, \(\underline {\rhd w_{1}\lhd } {\vdash _{M}^{c}} \underline {\rhd \#\lhd }\vdash _{M} {\mathsf {Accept}}\) is an accepting computation of M. In the latter case, we have n = 2, and compatibility of π implies that \(\varPi _{1} = { \left [\begin {array}{ccc} \rhd & w_{1} & \#\\ & \lambda & \end {array}\right ]}\) and \(\varPi _{2}=\left [\begin {array}{ccc}\emptyset & (\#) &\emptyset \end {array}\right ]\) or \(\varPi _{1} = \left [\begin {array}{ccc}\emptyset &(\#)&\emptyset \end {array}\right ]\) and \(\varPi _{2} = { \left [\begin {array}{ccc} \# & w_{2} & \lhd \\ & \lambda & \end {array}\right ]}\). Hence, we have the accepting computation \(\underline {\rhd w_{1}\#}\lhd {\vdash _{M}^{c}} \underline {\rhd \#\lhd }\vdash {\mathsf {Accept}}\) or \(\underline {\rhd \# w_{2}}{\lhd \vdash _{M}^{c}} \underline {\rhd \#\lhd }\vdash {\mathsf {Accept}}\).

Let us assume that R ≥ 2. We claim that there exists an index s ∈{1,2,…,n} such that as,1 = ws− 1 and cs,1 = ws+ 1. This means that the transition bs,2δ(as,1wscs,1), which is the first rewrite (or delete) transition described by πs, matches left and right. From the fact that π is compatible, we see that \(a_{1,1} = \rhd = w_{0}\). Thus, if c1,1 = w2, we can take s = 1. If c1,1w2, then compatibility of the pair (π1,π2) implies that a2,1 = w1. Thus, if c2,1 = w3, we can take s = 2; otherwise, we can repeat this argument for i = 3,4,…,n. As by compatibility, the rewrite and delete transitions of πn match right, we see that \(c_{n,1} = \lhd = w_{n+1}\). Hence, there exists an index s ∈{1,2,…,n} that meets the stated properties.

Now we consider the initial configuration

$$\begin{array}{ll} \multicolumn{2}{l}{\underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{s-2}w_{s-1}w_{s}w_{s+1}w_{s+2}{\cdots} w_{n}}\\ = & \underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{s-2}a_{s,1}w_{s}c_{s,1}w_{s+2}{\cdots} w_{n}\lhd \end{array}$$

of the swift-ORD-automaton M. As M is swift, it can make MVR-steps until its window contains the factor as,1wscs,1, and it can then execute the rewrite (or delete) step bs,2δ(as,1wscs,1). Thus, M can execute the cycle

$$\begin{array}{ll} \multicolumn{2}{l}{\underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{s-2}a_{s,1}w_{s}c_{s,1}w_{s+2}{\cdots} w_{n}\lhd}\\ {\vdash_{M}^{c}} & \underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{s-2}a_{s,1}b_{s,2}c_{s,1}w_{s+2}{\cdots} w_{n}\lhd\\ = &\underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{s-2}w_{s-1}b_{s,2}w_{s+1}w_{s+2}{\cdots} w_{n}\lhd. \end{array}$$

If js = 1 and bs,2 = λ, then we define a new sequence of triples \(\varPi ^{\prime }=(\varPi _{0},\varPi _{1},\varPi _{2},\ldots ,\varPi _{s-1},\varPi _{s+1},\ldots ,\varPi _{n+1})\) by deleting the triple πs. Otherwise, we define a triple \(\varPi _{s}^{\prime }\) by removing the first entries from each of the columns of the triple πs, that is, \(\varPi _{s}^{\prime } = [L_{s}^{\prime },W_{s}^{\prime },R_{s}^{\prime }] = { \left [\begin {array}{ccc} a_{s,2} & b_{s,2} & c_{s,2}\\ {\cdots } & {\cdots } & \cdots \\ a_{s,j_{s}} & b_{s,j_{s}} & c_{s,j_{s}}\\ & x_{s} & \end {array}\right ]}.\) In this case we take \(\varPi ^{\prime }=(\varPi _{0},\varPi _{1},\varPi _{2},\ldots ,\varPi _{s-1},\varPi _{s}^{\prime },\varPi _{s+1},\ldots ,\varPi _{n},\varPi _{n+1})\). In either case, \(\varPi ^{\prime }\) is now a sequence of triples that has all the properties required in (b). As this sequence only contains R − 1 rewrite and delete steps, we can conclude by induction that M has an accepting computation that begins with the restarting configuration \(\underline {\rhd w_{1}w_{2}}w_{3}\cdots w_{s-1}b_{s,2}w_{s+1}{\cdots } w_{n}\lhd \), that is,

$$\underline{\rhd w_{1}w_{2}}w_{3}{\cdots} w_{s-1}b_{s,2}w_{s+1}{\cdots} w_{n}\lhd \vdash_{M}^{*} {\mathsf{Accept}}.$$

Thus, by combining the above cycle with this accepting computation, we obtain an accepting computation of M that begins with the restarting configuration \(\underline {\rhd w_{1}w_{2}}w_{3}{\cdots } w_{s-1}w_{s}w_{s+1}\cdots w_{n}\lhd \). Hence, wLC(M). □

This completes the proof of Lemma 1. □

Let \(M=(\varSigma ,\varGamma \cup \{\#\},\rhd ,\lhd ,\delta ,>)\) be a swift-ORD-automaton as constructed in Proposition 2. To prove that the language L(M) is context-free, we now describe a PDA P that, given a word w = w1w2wnΓn (n ≥ 1) as input, guesses a corresponding sequence of triples (π0,π1,π2,…,πn,πn+ 1), checks whether this sequence is compatible, and accepts in the affirmative. Actually, the language L(P) accepted by P will be \(L(P) = L_{\mathrm {C}}(M)\cdot \{\lhd \}\), but as the class of context-free languages is closed under right quotients by a single letter, this suffices to prove that LC(M) is a context-free language. Since L(M) = LC(M) ∩Σ, it then follows that L(M) is context-free, too.

Accordingly, the input alphabet of P will be \(\varSigma _{1} = \varSigma \cup \{\lhd \}\). The pushdown alphabet Δ will contain the bottom marker \(\rhd \) and all triples [L,W,R] describing sequences of rewrite and delete steps of M. In addition, Δ will contain variants of [L,W,R] in which some of the symbols in L and R have been marked to indicate that the corresponding rewrite and delete steps have already been verified to match left, respectively, to match right. The behavior of P is described by the following algorithm, in which the left sentinel \(\rhd \) will be represented by the triple \([\emptyset (\rhd ) \emptyset ]\), and the right sentinel \(\lhd \) will be represented by the triple \([\emptyset (\lhd ) \emptyset ]\).

To illustrate the way in which the PDA in Algorithm 1 works, we return to Example 2.

figure a
figure b

Example 2

(cont.) The computation of the PDA P for simulating the swift-ORD-automaton M is described in the table in Fig. 1. Here the input processed is \(w=a_{1}a_{2}a_{3}a_{4}a_{5}\lhd \), and the table contains the various steps of the computation of the PDA simulating M for this input. In the table those tape symbols in the left or right column of a triple that have been marked are written in boldface. Each time an input symbol is read, a corresponding triple π = [L,W,R] is guessed, the rewrite steps of which are neither left nor right marked. Then the triple \(\varPi ^{\prime }=[L^{\prime },W^{\prime },R^{\prime }]\) on the top of the pushdown is compared to π, some entries in \(R^{\prime }\) and in L are marked, and depending on the situation (see (14) to (22)), \(\varPi ^{\prime }\) is possibly popped from the pushdown, some more triples may be popped, and then π is pushed onto the pushdown. As the simulation ends with the pushdown containing the sequence

$$ \left[\begin{array}{ccc}\emptyset & (\rhd) & \emptyset \end{array}\right] {\left[\begin{array}{ccc} {\blacktriangleright} & a_{1} & {\mathbf{b}_{\mathbf{3}}} \\ {\blacktriangleright} & b_{1} & {\blacktriangleleft} \\ & \# & \end{array}\right] } \left[\begin{array}{ccc}\emptyset & (\lhd) &\emptyset \end{array}\right],$$

the PDA accepts in line (24).

Fig. 1
figure 1

Simulating the stl-ORD-automaton of Example 2 by a PDA

It remains to prove that \(L(P) = L(M)\cdot \{\lhd \}\). For doing so, we establish the following technical lemma.

Lemma 2

The PDA P of Algorithm 1 accepts on input \(w=w_{1}w_{2}{\cdots } w_{n}\lhd \)(n ≥ 1, w1,w2,…,wnΓ) if and only if there exists a sequence of triples for w1w2wn that satisfies all the properties of Lemma 1 (b).

Proof

Let w = w1w2wn, where n ≥ 1 and w1,w2,…,wnΓ. Furthermore, let π = (π0,π1,…,πn,πn+ 1) be a sequence of triples, where \(\varPi _{i}=[L_{i},W_{i},R_{i}]= { \left [\begin {array}{ccc} a_{i,1} & b_{i,1} & c_{i,1}\\ a_{i,2} & b_{i,2} & c_{i,2} \\ {\cdots } & {\cdots } & {\cdots } \\ a_{i,j_{i}} & b_{i,j_{i}} & c_{i,j_{i}}\\ & x_{i} & \end {array}\right ]}\)

such that bi,1 = wi for all i = 1,2,…,n, let \(\varPi _{0} = \left [\emptyset ,(\rhd ),\emptyset \right ]\), and \(\varPi _{n+1} = \left [\emptyset ,(\lhd ),\emptyset \right ]\). Comparing the various conditions in Definition 4 to the tests in Algorithm 1, we see that

  • condition (a) (i) is guaranteed by line (5),

  • condition (a) (ii) is guaranteed by the choice of πn+ 1 and the tests in lines (19) and (21) on triples that are popped from the pushdown and by the test in line (24),

  • condition (a) (iii) corresponds to lines (14) and (15),

  • condition (a) (iv) corresponds to lines (16) and (17),

  • condition (a) (v) corresponds to lines (18) and (19),

  • condition (a) (vi) corresponds to lines (20) to (22), and

  • condition (b) (1) is checked by the test in line (24).

Finally, the recursion in the definition of compatibility (see condition (b) (3)) is resolved inductively by the PDA P. In fact, for each triple πi, all rewrite (and delete) steps are verified to match left before this triple is pushed onto the pushdown (see lines (15), (17), and (22)), and all rewrite and delete steps are verified to match right before this triple is popped from the pushdown (see lines (19) and (21)). It follows that the PDA P accepts on input \(w=w_{1}w_{2}{\cdots } w_{n}\lhd \) if and only if the sequence of triples guessed for w1w2wn satisfies all the properties of Lemma 1 (b). This completes the proof of Lemma 2. □

Now we can present the proof of the main result of this section.

Proof

(of Theorem 1.) Let \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) be a swift stl-ORD-automaton. By Proposition 2, we can construct a swift stl-ORD-automaton \(M^{\prime }=(\varSigma ,\varGamma \cup \{\#\},\rhd ,\lhd ,\delta ^{\prime },>')\) from M such that \(\delta ^{\prime }(\rhd \#\lhd )={\mathsf {Accept}}\) is the only accept step of \(M^{\prime }\) and \(L(M^{\prime }) = L(M)\smallsetminus \{\lambda \}\). Lemma 1 now implies that, for each n ≥ 1 and each word w = w1w2wnΓn, \(w\in L_{\mathrm {C}}(M^{\prime })\) if and only if there exists a compatible sequence of triples

$$\varPi = (\varPi_{0},\varPi_{1},\varPi_{2},\ldots,\varPi_{n},\varPi_{n+1}),$$

where \(\varPi _{0} = [\emptyset ,(\rhd ),\emptyset ]\), \(\varPi _{n+1} = [\emptyset ,(\lhd ),\emptyset ]\), and, for all i = 1,2,…,n, \(\varPi _{i} = [L_{i},W_{i},R_{i}] = { \left [\begin {array}{ccc} a_{i,1} & b_{i,1} & c_{i,1} \\ a_{i,2} & b_{i,2} & c_{i,2} \\ {\cdots } & {\cdots } & {\cdots } \\ a_{i,j_{i}}&b_{i,j_{i}}&c_{i,j_{i}}\\ & x_{i} & \end {array} \right ]} \text { such that }b_{i,1} = w_{i}.\)

Let P be the PDA that is defined by Algorithm 1 for the swift stl-ORD-automaton \(M^{\prime }\). Then by Lemma 2, P accepts on input \(w=w_{1}w_{2}{\cdots } w_{n}\lhd \) if and only if there exists a sequence of triples for w1w2wn that satisfies all the properties above. It follows that \(L(P) = L_{\mathrm {C}}(M^{\prime })\cdot \{\lhd \}\), which shows that \(L_{\mathrm {C}}(M^{\prime })\cdot \{\lhd \}\) is a context-free language. Hence, \(L_{\mathrm {C}}(M^{\prime })\) is a context-free language, and therewith, L(M) is a context-free language, too, as \(L(M^{\prime }) = L_{\mathrm {C}}(M^{\prime }) \cap \varSigma ^{*}\). Finally, this implies that \(L(M^{\prime })\) is a context-free language, as \(L(M^{\prime }) = L(M)\smallsetminus \{\lambda \}\). This completes the proof of Theorem 1. □

4 All Context-Free Languages are Accepted by Swift Stl-ORD-Automata

Here we establish the converse of Theorem 1, showing that each context-free language is accepted by a swift stl-ORD-automaton.

Theorem 2

\(\textsf {CFL} \subseteq {\mathscr{L}}({\mathsf {swift}\text {-}\mathsf {ORD}})\).

Let \(L\subseteq \varSigma ^{*}\) be a context-free language. Then there exists a context-free grammar G = (V,Σ,S,P) in quadratic Greibach normal form for the language \(L\smallsetminus \{\lambda \}\) [23], that is, each production (Br) ∈ P satisfies the restriction that BV and rΣ⋅(V2V ∪{λ}). From this grammar, a PDA A = (Q,Σ,ΔA,q,S,δA) can be obtained such that L is the language N(A) that is accepted by A with empty pushdown. The PDA A is defined by taking Q = {q}, ΔA = V, and (q,αR) ∈ δA(q,a,B) iff (Baα) ∈ P, where aΣ, BV, and α ∈ (V2V ∪{λ}) (see, e.g., [8]). Here αR denotes the reversal (or mirror image) of the word α. Thus, A has a single state only, it does not execute any λ-transitions, and in each step, it replaces the topmost symbol on its pushdown by a word of length at most two. In our encoding below, the bottom (top) of the pushdown will always be on the left (right).

For proving that the language L is accepted by a swift stl-ORD-automaton we now proceed as follows. First, we present a construction of a swift stl-ORD-automaton M that simulates the PDA A. Essentially, M works as the automaton in Example 1, that is, it chooses the transition of A that is to be applied next, it marks the letters that are to be rewritten, and then it replaces (or deletes) the corresponding letters. Here the simulation of A is performed in a non-length-increasing fashion using an appropriate encoding of the pushdown. After giving the construction we illustrate it through a simple example, and then we prove that L(M) = L through a sequence of four lemmas.

Definition 5

Let (q,x,α) be a configuration of the PDA A, where xΣ is the still unread suffix of the given input and αV+ is the contents of the pushdown. This configuration will be encoded as [b1][b2]⋯[bm][q,α2]x, where α = b1b2bmα2 for some α2V2V and either m ≥ 1 and b1,b2,…,bmV or m = 0.

The swift-ORD-automaton \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) is now defined as follows:

  • The tape alphabet Γ contains the input alphabet Σ, two disjoint copies of Σ, encodings [x] of the nonterminals xV, encodings \([q,\alpha ],[q,\alpha ]^{\prime \prime },[q,\alpha ]_{a}\) (aΣ) for all αVV2, and the symbol [q,λ], that is,

    $$ \begin{array}{@{}rcl@{}} \varGamma & = & \varSigma \cup \{ a^{\prime},a^{\prime\prime}\mid a\in\varSigma \} \cup \{ [x] \mid x \in V \} \cup \{[q,\lambda]\} \cup\\ & & \{ [q,\alpha],[q,\alpha]^{\prime\prime}\mid \alpha \in V\cup V^{2} \} \cup \{ [q,\alpha]_{a}\mid \alpha \in V\cup V^{2}, a\in\varSigma \}. \end{array} $$
  • The partial ordering > on Γ is defined through

    $$\begin{array}{ccccccccccccccc} a & > & a^{\prime} & > & a^{\prime\prime} & > & [q,xy]^{\prime\prime} & > & [q,xy] & > & [q,xy]_{b}\\ &&& > & [x] & > & [q,x]^{\prime\prime}& > & [q,x] & > & [q,x]_{c} & > & [q,\lambda], \end{array}$$

    for all a,b,cΣ and x,yV.

  • The transition relation δ is defined through the following table, where a,bΣ, \(c\in \varSigma \cup \{\lhd \}\), x,yV, γVV2, and \(X\in \{\rhd \} \cup \{ [x]\mid x\in V \}\):

    $$\begin{array}{rlcll} (0) & \delta(UYZ) & \ni & {\mathsf{MVR}} &\text{for all }U\in \varGamma\cup\{\rhd\} \text{ and }Y,Z\in\varGamma,\\ (1) & \delta(\rhd a\lhd) & = & {\mathsf{Accept}} & \text{for all }a\in L\cap (\varSigma\cup\{\lambda\}),\\ (2) & \delta(\rhd ab) & \ni & [q,\gamma], & \text{if }\delta_{A}(q,a,S) \ni (q,\gamma)\text{ and }\gamma\not=\lambda,\\ (3) & \delta([q,x] ac) & \ni & a^{\prime},& \text{if }\delta_{A}(q,a,x)\not=\emptyset,\\ (4) & \delta([q,yx] ac) & \ni & a^{\prime},& \text{if }\delta_{A}(q,a,x) \not=\emptyset,\\ (5) & \delta(X [q,x] a^{\prime}) & \ni & [q,x]_{a},& \text{if }\delta_{A}(q,a,x) \not=\emptyset,\\ (6) & \delta(X [q,yx] a^{\prime}) & \ni & [q,yx]_{a},& \text{if }\delta_{A}(q,a,x) \not=\emptyset,\\ (7) & \delta([q,x]_{a} a^{\prime}c) & \ni & [q,\gamma]^{\prime\prime},& \text{if }\delta_{A}(q,a,x) \ni (q,\gamma), \gamma\not=\lambda,\\ (8) & \delta([q,yx]_{a} a^{\prime}c) & \ni & [q,\gamma]^{\prime\prime},& \text{if }\delta_{A}(q,a,x) \ni (q,\gamma), \gamma\not=\lambda,\\ (9) & \delta(X [q,yx]_{a}[q,\gamma]^{\prime\prime}) & \ni & [y], & \text{if }\delta_{A}(q,a,x) \ni (q,\gamma),\gamma\not=\lambda,\\ (10) & \delta(X [q,x]_{a}[q,\gamma]^{\prime\prime}) & \ni & \lambda, & \text{if }\delta_{A}(q,a,x)\ni (q,\gamma),\gamma\not=\lambda,\\ (11) & \delta(X [q,\gamma]^{\prime\prime}c) & \ni & [q,\gamma],\\ (12) & \delta([q,x]_{a} a^{\prime}c) & \ni & a^{\prime\prime}, & \text{if }\delta_{A}(q,a,x) \ni (q,\lambda),\\ (13) & \delta([q,yx]_{a} a^{\prime}c) & \ni & a^{\prime\prime}, & \text{if }\delta_{A}(q,a,x) \ni (q,\lambda),\\ (14) & \delta(X[q,yx]_{a} a^{\prime\prime}) & \ni & [q,y], & \text{if }\delta_{A}(q,a,x) \ni (q,\lambda),\\ (15) & \delta([q,y]a^{\prime\prime}c) & \ni & \lambda,\phantom{\text{for all }U\in \varGamma\cup\{\rhd\}}\\ (16) & \delta([y][q,x]_{a}a^{\prime\prime}) & \ni & \lambda, &\text{if }\delta_{A}(q,a,x)\ni(q,\lambda),\\ (17) & \delta(X[y]a^{\prime\prime}) & \ni & [q,y], \\ (18) & \delta(\rhd [q,x]_{a}a^{\prime\prime}) & \ni & [q,\lambda], &\text{if }\delta_{A}(q,a,x)\ni(q,\lambda),\\ (19) & \delta([q,\lambda]a^{\prime\prime}c) & \ni & \lambda,\\ (20) & \delta(\rhd [q,\lambda]\lhd) & = & {\mathsf{Accept}}. \end{array}$$

In order to illustrate this construction, we consider a simple example.

Example 3

Let A = ({q},{a,b},{S,B,C},q,S,δA), where δA only contains the following transitions:

$$ \begin{array}{@{}rcl@{}} \delta_{A}(q,a,S) & = & {\{(q,BC),(q,B)\},}\\ \delta_{A}(q,b,B) & = & \{(q,\lambda)\}, \\ \delta_{A}(q,a,C) & = & \{(q,BC),(q,B)\}. \end{array} $$

Then N(A) is the language {anbnn ≥ 1}, and, for example, A can execute the following accepting computation:

$$\begin{array}{ccccccc} (q,aaabbb,S) &\vdash_{A} & (q,aabbb,BC)& \vdash_{A}& (q,abbb,BBC)& \vdash_{A}& (q,bbb,BBB)\\ & \vdash_{A}& (q,bb,BB)& \vdash_{A}& (q,b,B)& \vdash_{A} & (q,\lambda,\lambda). \end{array}$$

This computation is now simulated by the corresponding swift-ORD-automaton M as follows, where the indices refer to the lines in the definition of the transition relation δ of M:

$$\begin{array}{ccccc} \underline{\rhd aa}abbb\lhd & \vdash_{(2)} & \underline{\rhd [q,BC]a}abbb\lhd & \vdash_{(0)} & \rhd\underline{[q,BC]aa}bbb\lhd\\ & \vdash_{(4)} & \underline{\rhd [q,BC]a^{\prime}}abbb\lhd & \vdash_{(6)} & \underline{\rhd [q,BC]_{a}a^{\prime}}abbb\lhd\\ & \vdash_{(0)} & \rhd\underline{[q,BC]_{a}a^{\prime}a}bbb\lhd & \vdash_{(8)} & \underline{\rhd [q,BC]_{a}[q,BC]^{\prime\prime}}abbb\lhd\\ & \vdash_{(9)} & \underline{\rhd [B][q,BC]^{\prime\prime}}abbb\lhd & \vdash_{(0)} & \rhd\underline{[B][q,BC]^{\prime\prime}a}bbb\lhd\\ & \vdash_{(11)} & \underline{\rhd [B][q,BC]}abbb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[q,BC]ab}bb\lhd\\ & \vdash_{(4)} & \underline{\rhd[B][q,BC]}a^{\prime}bbb\lhd & \vdash_{(0)} & \rhd\underline{[B][q,BC]a^{\prime}}bbb\lhd\\ & \vdash_{(6)} & \underline{\rhd [B][q,BC]_{a}}a^{\prime}bbb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[q,BC]_{a}a^{\prime}b}bb\lhd\\ & \vdash_{(8)} & \underline{\rhd[B][q,BC]_{a}}[q,B]^{\prime\prime}bbb\lhd & \vdash_{(0)} & \rhd\underline{[B][q,BC]_{a}[q,B]^{\prime\prime}}bbb\lhd\\ & \vdash_{(9)} & \underline{\rhd [B][B]}[q,B]^{\prime\prime}bbb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[B][q,B]^{\prime\prime}b}bb\lhd\\ & \vdash_{(11)} & \underline{\rhd[B][B]}[q,B]bbb\lhd & \vdash_{(0)}^{3} & \rhd[B][B]\underline{[q,B]bb}b\lhd\\ & \vdash_{(3)} & \underline{\rhd[B][B]}[q,B]b^{\prime}bb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[B][q,B]b^{\prime}}bb\lhd \\ & \vdash_{(5)} & \underline{\rhd[B][B]}[q,B]_{b}b^{\prime}bb\lhd & \vdash_{(0)}^{3} & \rhd[B][B]\underline{[q,B]_{b}b^{\prime}b}b\lhd \\ & \vdash_{(12)} & \underline{\rhd[B][B]}[q,B]_{b}b^{\prime\prime}bb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[B][q,B]_{b}b^{\prime\prime}}bb\lhd \\ & \vdash_{(16)} & \underline{\rhd[B][B]}b^{\prime\prime}bb\lhd & \vdash_{(0)} & \rhd\underline{[B][B]b^{\prime\prime}}bb\lhd \\ & \vdash_{(17)} & \underline{\rhd[B][q,B]}b^{\prime\prime}bb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[q,B]b^{\prime\prime}b}b\lhd \\ & \vdash_{(15)} & \underline{\rhd[B][q,B]}bb\lhd & \vdash_{(0)}^{2} & \rhd[B]\underline{[q,B]bb}\lhd \\ & \vdash_{(3)} & \underline{\rhd[B][q,B]}b^{\prime}b\lhd & \vdash_{(0)} & \rhd\underline{[B][q,B]b^{\prime}}b\lhd \\ & \vdash_{(5)} & \underline{\rhd[B][q,B]_{b}}b^{\prime}b\lhd & \vdash_{(0)}^{2} & \rhd [B]\underline{[q,B]_{b}b^{\prime}b}\lhd \\ & \vdash_{(12)} & \underline{\rhd[B][q,B]_{b}}b^{\prime\prime}b\lhd & \vdash_{(0)} & \rhd\underline{[B][q,B]_{b}b^{\prime\prime}}b\lhd \\ \phantom{\underline{\rhd aa}abbb\lhd} & \vdash_{(16)} & \underline{\rhd[B]b^{\prime\prime}}b\lhd & \vdash_{(17)} & \underline{\rhd[q,B]b^{\prime\prime}}b\lhd \\ & \vdash_{(0)} & \rhd\underline{[q,B]b^{\prime\prime}b}\lhd & \vdash_{(15)} & \underline{\rhd[q,B]b\lhd} \\ & \vdash_{(0)} & \rhd\underline{[q,B]b\lhd} & \vdash_{(3)} & \underline{\rhd[q,B]b^{\prime}}\lhd\\ & \vdash_{(5)} & \underline{\rhd[q,B]_{b}b^{\prime}}\lhd & \vdash_{(0)} & \rhd\underline{[q,B]_{b}b^{\prime}\lhd} \\ & \vdash_{(12)} & \underline{\rhd[q,B]_{b}b^{\prime\prime}}\lhd & \vdash_{(18)} & \underline{\rhd[q,\lambda]b^{\prime\prime}}\lhd \\ & \vdash_{(0)} & \rhd\underline{[q,\lambda]b^{\prime\prime}\lhd} & \vdash_{(19)} & \underline{\rhd[q,\lambda]\lhd} \\ & \vdash_{(20)} & {\mathsf{Accept}}. \end{array}$$

We must prove that L(M) = N(A). Let

$$C=(q,w,x_{1}x_{2}{\ldots} x_{m-2}x_{m-1}x_{m})$$

be a configuration of the PDA A, where wΣ+ and x1,x2,…,xmV for some m ≥ 2. Then the restarting configurations

$$C_{1}=\underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][x_{m-1}][q,x_{m}]w\lhd$$

and

$$C_{2}=\underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][q,x_{m-1}x_{m}]w\lhd$$

of M are representations of the configuration C of A. Conversely, if

$$C_{3} = \underline{\rhd[x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m}][q,\alpha]w\lhd$$

is a restarting configuration of M for some x1,x2,…,xmV, αVV2, and wΣ+, then \(C^{\prime }=(q,w,x_{1}x_{2}\cdots x_{m}\alpha )\) is the corresponding configuration of A. Thus, for each configuration of the PDA A, in which the height of the pushdown is at least two, we have two restarting configurations of M that represent it.

In order to prove that N(A) is contained in the language L(M), we first establish the following technical result.

Lemma 3

Let \(C=(q,w_{1},\alpha _{1})\vdash _{A} (q,w_{2},\alpha _{2})=C^{\prime }\), where w1,w2Σ+ and α1,α2V+, and let C1 be a restarting configuration of M that represents the configuration C. Then \(C_{1}\vdash _{M}^{c^{*}} C_{2}\) for some restarting configuration C2 that represents the configuration \(C^{\prime }\).

Proof

As \(C=(q,w_{1},\alpha _{1}) \vdash _{A} (q,w_{2},\alpha _{2})=C^{\prime }\), we have w1 = aw2 for some aΣ, α1 = x1x2xmx, and α2 = x1x2xmγ for some m ≥ 0, x1,x2…,xm,xV, and γVV2 ∪{λ} such that (q,γ) ∈ δA(q,a,x) and x1x2xmγλ. The restarting configuration C1 represents the configuration C, and so \(C_{1}=\underline {\rhd [x_{1}][x_{2}]}{\cdots } [x_{m-1}][q,x_{m}x]aw_{2}\lhd \) or \(C_{1}=\underline {\rhd [x_{1}][x_{2}]}{\cdots } [x_{m-1}][x_{m}][q,x]aw_{2}\lhd \).

We first assume that γλ. Then M can proceed as follows starting from the configuration C1:

$$\begin{array}{lcll} C_{1} & = & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}x]aw_{2}\lhd\\ & \vdash_{M}^{c^{*}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}x]_{a}a^{\prime}w_{2}\lhd &\text{(by lines (4) and (6))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}x]_{a}[q,\gamma]^{\prime\prime}w_{2}\lhd &\text{(by line (8))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][x_{m}][q,\gamma]^{\prime\prime}w_{2}\lhd &\text{(by line (9))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][x_{m}][q,\gamma]w_{2}\lhd &\text{(by line (11))} \end{array}$$

or

$$\begin{array}{lcll} C_{1} & = & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,x]aw_{2}\lhd\\ & \vdash_{M}^{c^{*}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,x]_{a}a^{\prime}w_{2}\lhd &\text{(by lines (3) and (5))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,x]_{a}[q,\gamma]^{\prime\prime}w_{2}\lhd &\text{(by line (7))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,\gamma]^{\prime\prime}w_{2}\lhd &\text{(by line (10))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,\gamma]w_{2}\lhd &\text{(by line (11))}, \end{array}$$

where, in either case, the restarting configuration \(\underline {\rhd [x_{1}][x_{2}]}{\cdots } [x_{m}][q,\gamma ]w_{2}\lhd \) represents the configuration \(C^{\prime }=(q,w_{2},\alpha _{2})\) of A.

If γ = λ, then M can proceed as follows starting from the configuration C1:

$$\begin{array}{lcll} C_{1} & = & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}x]aw_{2}\lhd\\ & \vdash_{M}^{c^{*}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}x]_{a}a^{\prime}w_{2}\lhd &\text{(by lines (4) and (6))}\\ &{\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}x]_{a}a^{\prime\prime}w_{2}\lhd &\text{(by line (13))}\\ &{\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}]a^{\prime\prime}w_{2}\lhd &\text{(by line (14))}\\ &{\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m-1}][q,x_{m}]w_{2}\lhd &\text{(by line (15))}, \end{array}$$

or

$$\begin{array}{lcll} C_{1} & = & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,x]aw_{2}\lhd\\ & \vdash_{M}^{c^{*}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,x]_{a}a^{\prime}w_{2}\lhd &\text{(by lines (3) and (5))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}][q,x]_{a}a^{\prime\prime}w_{2}\lhd &\text{(by line (12))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [x_{m}]a^{\prime\prime}w_{2}\lhd &\text{(by line (16))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [q,x_{m}]a^{\prime\prime}w_{2}\lhd &\text{(by line (17))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [x_{1}][x_{2}]}{\cdots} [q,x_{m}]w_{2}\lhd &\text{(by line (15))}, \end{array}$$

where the restarting configuration \(\underline {\rhd [x_{1}][x_{2}]}{\cdots } [x_{m-1}][q,x_{m}]w_{2}\lhd \) represents the configuration \(C^{\prime }=(q,w_{2},\alpha _{2})\) of A. This proves Lemma 3. □

Now we are prepared to prove the following inclusion.

Lemma 4

\(N(A)\subseteq L(M)\).

Proof

Let wN(A). If |w|≤ 1, then wL ∩ (Σ∪{λ}), and hence, M can accept on input w by line (1). So let us assume that w = a1a2an for some n ≥ 2 and a1,a2…,anΣ. As wN(A), A has an accepting computation for input w:

$$\begin{array}{lcll} (q,w,S) & = & (q,a_{1}a_{2}a_{3}{\cdots} a_{n},S)\\ & \vdash_{A} & (q,a_{2}a_{3}{\cdots} a_{n},\gamma_{1}) &\text{(using }(q,\gamma_{1})\in\delta_{A}(q,a_{1},S) \text{ for some }\gamma_{1}\not=\lambda)\\ & \vdash_{A}^{*} & (q,a_{n},\gamma_{n}) &\text{(for some }\gamma_{n}\in V)\\ & \vdash_{A} & (q,\lambda,\lambda) & \text{(as }A\text{ accepts with empty pushdown)}. \end{array}$$

Now M has a computation of the following form:

$$\begin{array}{lcll} \multicolumn{3}{l}{\underline{\rhd a_{1}a_{2}}a_{3}{\cdots} a_{n}\lhd}\\ & {\vdash_{M}^{c}} & \underline{\rhd [q,\gamma_{1}]a_{2}}a_{3}{\cdots} a_{n}\lhd &\text{(by line (2))}\\ & \vdash_{M}^{c^{*}} & \underline{\rhd [q,\gamma_{n}]a_{n}}\lhd &\text{(by using Lemma~3 repeatedly)}\\ & \vdash_{M}^{c^{*}} & \underline{\rhd [q,\gamma_{n}]_{a_{n}}a_{n}^{\prime\prime}}\lhd &\text{(by lines (3), (5), and (12))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [q,\lambda]a_{n}^{\prime\prime}}\lhd &\text{(by line (18))}\\ & {\vdash_{M}^{c}} & \underline{\rhd [q,\lambda]}\lhd &\text{(by line (19))}\\ & \vdash_{M} & {\mathsf{Accept}} &\text{(by line (20))}, \end{array}$$

as the restarting configuration \(\underline {\rhd [q,\gamma _{1}]a_{2}}a_{3}{\cdots } a_{n}\lhd \) represents the configuration (q,a2a3an,γ1) of A and the restarting configuration \(\underline {\rhd [q,\gamma _{n}]a_{n}}\lhd \) represents the configuration (q,an,γn) of A. Thus, \(N(A)\subseteq L(M)\) follows. □

It remains to prove the converse inclusion. We first derive the following technical result.

Lemma 5

Let C1 be a restarting configuration of M such that \(C_{1}\vdash _{M}^{*} {\mathsf {Accept}}\). If C1 represents a configuration (q,w,α) of the PDA A for some wΣ of length |w|≥ 2 and αV+, then there exists a restarting configuration C2 of M such that \(C_{1}\vdash _{M}^{c^{+}} C_{2} \vdash _{M}^{*}{\mathsf {Accept}}\) and C2 represents an immediate successor configuration of (q,w,α).

Proof

Let w = a1a2an and α = x1x2xm. Then

$$C_{1} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][q,x_{m-1}x_{m}]a_{1}a_{2}{\cdots} a_{n}\lhd$$

or

$$C_{1} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-1}][q,x_{m}]a_{1}a_{2}{\cdots} a_{n}\lhd.$$

From the form of the transition relation δ, we can conclude that the accepting computation of M that starts with the configuration C1 begins with a sequence of cycles that finally reaches the restarting configuration \(C_{f}={\rhd [q,\lambda ]\lhd }\), in which M simply accepts. Thus, during this sequence of cycles, one of the symbols on the tape is rewritten into the symbol [q,λ], while all other symbols are eventually deleted. We now analyze the possible rewrite and delete steps that M can apply starting from C1.

The only rewrite transition that is applicable to the tape contents of the configuration C1 is from line (3) or (4), and after that a rewrite by line (5) or (6) must follow. Hence, \(C_{1}\vdash _{M}^{c^{2}} D_{1}\), where

$$D_{1} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][q,x_{m-1}x_{m}]_{a_{1}}a_{1}^{\prime}a_{2}{\cdots} a_{n}\lhd$$

or

$$D_{1} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-1}][q,x_{m}]_{a_{1}}a_{1}^{\prime}a_{2}{\cdots} a_{n}\lhd.$$

As this sequence of two cycles is an initial part of an accepting computation of M, it follows that δA(q,a1,xm)≠, and that the next rewrite step is executed based on a transition (q,γ) ∈ δA(q,a1,xm) (see lines (7), (8), (12), and (13)).

There are two cases:

  • If line (7) or (8) is used next, then γλ, and the subsequent rewrite is executed based on line (9) or (10), that is, \(D_{1}\vdash _{M}^{c^{2}} D_{2}\), where

    $$D_{2} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][x_{m-1}][q,\gamma]^{\prime\prime}a_{2}{\cdots} a_{n}\lhd,$$

    and then

    $$D_{2}{\vdash_{M}^{c}} C_{2}=\underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][x_{m-1}][q,\gamma]a_{2}{\cdots} a_{n}\lhd$$

    by using line (11). Now the restarting configuration C2 represents the configuration (q,a2a3an,x1x2xm− 1γ) of A, and

    $$(q,w,\alpha) = (q,a_{1}a_{2}{\cdots} a_{n},x_{1}{\cdots} x_{m-1}x_{m}) \vdash_{A} (q,a_{2}a_{3}{\cdots} a_{n},x_{1}{\cdots} x_{m-1}\gamma).$$
  • If line (12) or (13) is used next, then γ = λ, and the subsequent rewrite is executed by applying line (14) or (16), that is, \(D_{1} \vdash _{M}^{c^{2}} D_{2}\), where

    $$D_{2} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][q,x_{m-1}]a_{1}^{\prime\prime}a_{2}{\cdots} a_{n}\lhd$$

    or

    $$D_{2} = \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-1}]a_{1}^{\prime\prime}a_{2}{\cdots} a_{n}\lhd.$$

    In the latter case, another cycle follows in which a rewrite step is executed by line (17) that yields the configuration

    $$\underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [q,x_{m-1}]a_{1}^{\prime\prime}a_{2}{\cdots} a_{n}\lhd.$$

    Finally, line (15) is used to delete the symbol \(a_{1}^{\prime \prime }\), which yields the configuration

    $$C_{2}= \underline{\rhd [x_{1}][x_{2}]}[x_{3}]{\cdots} [x_{m-2}][q,x_{m-1}]a_{2}{\cdots} a_{n}\lhd.$$

    In this case, the restarting configuration C2 represents the configuration (q,a2a3an,x1x2xm− 1) of A, and

    $$(q,w,\alpha) = (q,a_{1}a_{2}{\cdots} a_{n},x_{1}{\cdots} x_{m-1}x_{m}) \vdash_{A} (q,a_{2}a_{3}{\cdots} a_{n},x_{1}{\cdots} x_{m-1}).$$

This completes the proof of Lemma 5. □

Based on Lemma 5, we can now prove the following inclusion.

Lemma 6

\(L(M) \subseteq N(A)\).

Proof

Let wL(M), that is, \(\rhd w \lhd \vdash _{M}^{*} {\mathsf {Accept}}\). If |w|≤ 1, then w is accepted by line (1). This, however, means that wL = N(A).

We now consider the case that |w|≥ 2. The only rewrite transitions that can be applied to the tape contents \(\rhd a_{1}a_{2}{\cdots } a_{n}\lhd \) are those of line (2). Hence, the accepting computation of M for w has the following structure:

$$\underline{\rhd a_{1}a_{2}}a_{3}{\cdots} a_{n}\lhd {\vdash_{M}^{c}} C_{1}= \underline{\rhd [q,\gamma_{1}]a_{2}}a_{3}{\cdots} a_{n}\lhd \vdash_{M}^{c^{+}} \underline{\rhd [q,\lambda]\lhd}\vdash_{M}{\mathsf{Accept}}$$

for a pair (q,γ1) ∈ δA(q,a1,S) such that γ1λ. Thus, on input w, the PDA A can execute the transition

$$(q,w,S) = (q,a_{1}a_{2}a_{3}{\cdots} a_{n},S) \vdash_{A} (q,a_{2}a_{3}{\cdots} a_{n},\gamma_{1}),$$

and C1 represents the configuration (q,a2a3an,γ1) of A. If |a2a3an| = n − 1 ≥ 2, then we can apply Lemma 5, which implies that there exists a restarting configuration C2 of M such that \(C_{1}\vdash _{M}^{c^{+}} C_{2}\vdash _{M}^{*} \textsf {Accept}\) and C2 represents an immediate successor configuration (q,a3a4an,γ2) of the configuration (q,a2a3an,γ1) of A. Proceeding inductively, we obtain a sequence of restarting configurations C3,C4,…,Cn− 1 such that

$$C_{2}\vdash_{M}^{c^{+}} C_{3} \vdash_{M}^{c^{+}} {\cdots} \vdash_{M}^{c^{+}} C_{n-1}\vdash_{M}^{*}\textsf{Accept},$$

the PDA A can execute the sequence of transitions

$$(q,a_{3}a_{4}{\cdots} a_{n},\gamma_{2}) \vdash_{A} (q,a_{4}a_{5}{\cdots} a_{n},\gamma_{3}) \vdash_{A} {\cdots} \vdash_{A} (q,a_{n},\gamma_{n-1}),$$

and the restarting configuration Ci of M represents the configuration (q,ai+ 1ai+ 2an,γi) of A for all i = 2,3,…,n − 1.

As Cn− 1 represents the configuration (q,an,γn− 1) of A, we have \(C_{n-1}= \rhd W[q,\alpha ]a_{n}\lhd \) for some W ∈{[x]∣xV } and αVV2 such that γn− 1 = φ(W[q,α]), where φ : ({[x]∣xV }∪{[q,α]∣αVV2})V denotes the morphism that is defined by [x]↦x and [q,α]↦α. From δ we see that the accepting computation of M starting from Cn− 1 has the form

$$C_{n-1} = \underline{\rhd W [q,\alpha]}a_{n}\lhd \vdash_{M}^{c^{+}} \underline{\rhd [q,\lambda]\lhd} \vdash_{M} {\mathsf{Accept}}.$$

Furthermore, as there is only a single input letter left in Cn− 1, we can conclude that |γn− 1| = 1, that is, W = λ and α = γn− 1V. From line (18), which is the only one that produces an occurrence of the symbol [q,λ], we see that (q,λ) ∈ δA(q,an,γn− 1). Thus, A can execute the accepting computation

$$\begin{array}{lcccccccc} (q,w,S) & = & (q,a_{1}a_{2}{\cdots} a_{n},S) & \vdash_{A} & (q,a_{2}a_{3}\cdots a_{n},\gamma_{1})& \vdash_{A} & (q,a_{3}a_{4}{\cdots} a_{n},\gamma_{2})\\ & \vdash_{A}^{*} & (q,a_{n},\gamma_{n-1}) & \vdash_{A} & (q,\lambda,\lambda), \end{array}$$

which proves that wN(A) = L. This completes the proof of Lemma 6. □

Together Lemmas 4 and 6 show that L(M) = N(A) = L, which proves Theorem 2. From Theorems 1 and 2 we obtain the following characterization.

Corollary 1

\({\mathscr{L}}({\mathsf {swift}\text {-}\mathsf {ORD}}) = \mathsf {CFL}\).

5 Descriptional Complexity

Here we take a look at the descriptional complexity of stl-ORD-automata, relating it to the descriptional complexity of stl-ORWW-automata. As both these types of automata are stateless, we cannot possibly take the number of states as a measure for their descriptional complexity, as is done for finite-state acceptors (see, e.g., [7]). Instead, for both these types of automata, we take the size of the tape alphabet as complexity measure. This is reasonable, as the number of transitions and the size of the description of an automaton of one of these types are polynomially related to this measure. Here we have the following result, showing that for some regular languages, swift-ORD-automata yield a much more concise description than corresponding stl-ORWW-automata.

Theorem 3

The trade-off between swift-ORD-automata and stl-ORWW-automata is non-recursive.

Thus, the size increase that occurs when turning a swift-ORD-automaton that accepts a regular language into a stl-ORWW-automaton for the same language cannot be bounded from above by any recursive function.

Proof

According to an old result by Meyer and Fischer [14], the trade-off for turning a context-free grammar into an equivalent NFA is non-recursive. Now let G be a given context-free grammar that generates a regular language. From G we can construct an equivalent grammar G1 that is in quadratic Greibach normal form. The grammar G1 is in general much larger than the grammar G, but the size increase is bounded from above by an exponential function (see [23]). Thus, size(G1) ≤ csize(G), where we use size(G) (or size(A)) to denote the size of a grammar G or an automaton A. From the latter grammar, we immediately obtain a PDA A that accepts the language L(G) = L(G1) by empty pushdown. Then size(A) = size(G1) ≤ csize(G). Following the construction given in the proof of Theorem 2, we obtain a swift-ORD-automaton M for the language L(G). As is easily seen from this construction, the number of letters n in the tape alphabet of M is bounded from above by an exponential function in the size of the PDA A. Thus, \(\text {size}(M) \le c^{\text {size}(A)} \le c^{c^{\text {size}(G)}}\). Now assume that f is a recursive function such that, for each swift-ORD-automaton P, there exists an equivalent stl-ORWW-automaton \(P^{\prime }\) such that the number of letters in the tape alphabet of \(P^{\prime }\) is bounded from above by the value f(size(P)). Then there exists a stl-ORWW-automaton \(M^{\prime }\) for the language L(M) = L(G) such that \(\text {size}(M^{\prime }) \le f(\text {size}(M)) \le f(c^{c^{\text {size}(G)}})\). Finally, it is known from [10] that from \(M^{\prime }\) we can construct an NFA B for the language L(G) that is of size \(2^{O(\text {size}(M^{\prime }))}\). Thus, we see that \(\text {size}(B) \le 2^{O(f(c^{c^{\text {size}(G)}}))}\), which is a recursive bound for the conversion of the context-free grammar G into the equivalent NFA B. As this contradicts the aforementioned result of Meyer and Fischer, there is no recursive bound for the conversion of a swift-ORD-automaton into an equivalent stl-ORWW-automaton, which completes the proof. □

As the swift-ORD-automaton is just a restricted variant of the stl-ORD-automaton, Theorem 3 also holds for stl-ORD-automata in general.

6 Limited Context Restarting Automata

After a restart a swift-ORD-automaton can move its window to any position before executing a restart-rewrite, a restart-delete, or an accept step. Accordingly, this automaton can be seen as a type of rewriting system on its tape alphabet. And indeed, restarting automata of this form have been studied before.

In [4], the so-called clearing restarting automaton was introduced, which deletes symbols depending only on the context of a fixed size around the factor to be deleted. Not surprisingly, clearing restarting automata are quite limited in their expressive power. They accept all regular languages and some languages that are not context-free, but they do not even accept all context-free languages. Accordingly, they were extended to the so-called Δ-clearing restarting automata that can use a marker symbol Δ in their rewrite transitions. These automata only accept languages that are growing context-sensitive [21], but they accept all context-free languages [5]. However, it is still open whether or not there is a growing context-sensitive language that is not accepted by any Δ-clearing restarting automaton.

In [1], limited context restarting automata were defined as an extension of the clearing restarting automaton. Also these automata apply rewrite steps only based on context information, but their rewrite instructions are more general. Following [21], these automata can be defined as follows.

Definition 6

A limited context restarting automaton (an lc-R-automaton, for short) M is defined through a triple M = (Σ,Γ,I), where Σ is an input alphabet, Γ is a working alphabet containing Σ, and I is a finite set of instructions of the form \((u | x\rightarrow y | v)\). Here x,yΓ such that g(x) > g(y) for some weight function \(g:\varGamma ^{*}\to \mathbb {N}\), \(u \in \{\lambda ,\rhd \}\cdot \varGamma ^{*}\), and \(v\in \varGamma ^{*} \cdot \{\lambda ,\lhd \}\). Again the symbols \(\rhd \) and \(\lhd \) are used as left and right sentinels, which are not elements of Γ.

The lc-R-automaton M = (Σ,Γ,I) induces a reduction relation \({\vdash _{M}^{c}}\) on Γ as follows: for each w,zΓ, \(w {\vdash _{M}^{c}} z\), if there exist words w1,w2Γ and an instruction \((u | x\rightarrow y | v)\in I\) such that w = w1xw2, z = w1yw2, u is a suffix of \(\rhd w_{1}\), and v is a prefix of \(w_{2}\lhd \). Thus, the factor x is rewritten into y, if it appears within the context uxv. By \(\vdash _{M}^{c^{*}}\) we denote the reflexive and transitive closure of \({\vdash _{M}^{c}}\). The language accepted by the lc-R-automaton M is \(L(M)=\{ w \in \varSigma ^{*} \mid w \vdash _{M}^{c^{*}}\lambda \}\).

An lc-R-automaton M accepts exactly the set of input words which can be reduced to λ. Thus, λ is in L(M) for each lc-R-automaton M. Accordingly, if L is a language that does not contain λ as an element, then L is not accepted by any lc-R-automaton. In order to overcome this problem, we consider equality of languages only up to the empty word, that is, we say that two languages L and \(L^{\prime }\) on Σ are equal, denoted as \(L \dot {=} L^{\prime }\), if \(L\cap \varSigma ^{+} = L^{\prime }\cap \varSigma ^{+}\).

In [21], many different types of limited context restarting automata have been introduced and their expressive power has been studied. Here we are only interested in the following two types. We say that an lc-R-automaton M = (Σ,Γ,I) is of type

  • \(\mathcal {R}_{1}^{\prime }\), if I only contains instructions of the form \((u | x\rightarrow y | v)\), where |y|≤ 1;

  • \(\mathcal {R}_{2}^{\prime }\), if I only contains instructions of the form \((u | x\rightarrow y | v)\), where |y|≤ 1, \(u \in \{\lambda ,\rhd \}\), and \(v \in \{\lambda ,\lhd \} \).

For any \(\mathcal {R} \in \{\mathcal {R}_{1}^{\prime },\mathcal {R}_{2}^{\prime }\}\), we will refer to lc-R-automata of type \(\mathcal {R}\) as lc-R[\(\mathcal {R}\)]-automata. In [21], the following characterizations were obtained.

Theorem 4

(a) \({\mathscr{L}}(\mathsf {lc}\text {-}\mathsf {R}[\mathcal {R}_{1}^{\prime }]) = \mathsf {GCSL}\). (b) \({\mathscr{L}}(\mathsf {lc}\text {-}\mathsf {R}[\mathcal {R}_{2}^{\prime }]) = \mathsf {CFL}. \)

A clearing restarting automaton can be described as a limited context restarting automaton M = (Σ,Σ,I) of type \(\mathcal {R}_{1}^{\prime }\) such that each instruction \((u | x\rightarrow y | v)\in I\) satisfies the restrictions |u| = |v|≥ 1 and y = λ. Furthermore, a Δ-clearing restarting automaton can be described as a limited context restarting automaton M = (Σ,Σ∪{Δ},I) of type \(\mathcal {R}_{1}^{\prime }\) such that each instruction \((u | x\rightarrow y | v)\in I\) satisfies the restrictions |u| = |v|≥ 1 and y ∈{λ,Δ} [4].

Here we introduce still another type of limited context restarting automata in order to describe swift-ORD-automata. A limited context restarting automaton M = (Σ,Γ,I) is of type \(\mathcal {R}_{\text {ORD}}\) if each instruction \((u | x\rightarrow y | v)\in I\) satisfies the restrictions |u| = |x| = |v| = 1 and |y|≤ 1. Observe that the weight function associated with M induces a partial ordering > on Γ such that x > y holds for each instruction \((u | x\rightarrow y | v)\in I\) for which |y| = 1. Thus, \(\mathcal {R}_{\text {ORD}}\) is obtained from the type \(\mathcal {R}_{1}^{\prime }\) by restricting the left context, the right context, and the lefthand side of the rewrite instruction to be of length one. Limited context restarting automata of type \(\mathcal {R}_{\text {ORD}}\) will be denoted as lc-R\([\mathcal {R}_{\text {ORD}}]\)-automata.

Lemma 7

\({\mathscr{L}}(\mathsf {lc}\text {-}\mathsf {R}[\mathcal {R}_{\text {ORD}}])\subseteq {\mathscr{L}}({\mathsf {swift}\text {-}\mathsf {ORD}})\).

Proof

Let M = (Σ,Γ,I) be an lc-R\([\mathcal {R}_{\text {ORD}}]\)-automaton. We define an ordering on Γ by taking A > B if g(A) > g(B), where \(g:\varGamma ^{*}\to \mathbb {N}\) is the weight function for M. Now we construct a swift-ORD-automaton \(M^{\prime } = (\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) by defining the transition relation δ as follows:

$$\begin{array}{cccll} (1) & \delta(abc) & \ni & {\mathsf{MVR}} &\text{for all }a\in\varGamma\cup\{\rhd\}\text{ and }b,c\in\varGamma,\\ (2) & \delta(abc) & \ni & y &\text{if }(a | b\rightarrow y | c)\in I,\\ (3) & \delta(\rhd\lhd) & = & {\mathsf{Accept}}. \end{array}$$

Then \(L(M^{\prime }) = \{ w\in \varSigma ^{*}\mid w \vdash _{M}^{c^{*}}\lambda \} = L(M)\), which proves the above inclusion. □

Actually, we even have the following result.

Theorem 5

\({\mathscr{L}}(\mathsf {lc}\text {-}\mathsf {R}[\mathcal {R}_{\text {ORD}}]) = {\mathscr{L}}(\mathsf {swift}\text {-}\mathsf {ORD})\).

Proof

Let \(M=(\varSigma ,\varGamma ,\rhd ,\lhd ,\delta ,>)\) be a swift-ORD. By Proposition 2, we may assume that there is a special non-input symbol #Γ such that \(\delta (\rhd \#\lhd )={\mathsf {Accept}}\) is the only accept step of M. Now we define an \(\mathsf {lc}\text {-}\mathsf {R}[\mathcal {R}_{\text {ORD}}]\)-automaton S = (Σ,Γ,I) by taking

$$I = \{ (a | b\rightarrow d | c) \mid d\in\delta(abc) \} \cup \{{\rhd} | {\#}\rightarrow{\lambda} | {\lhd}\}.$$

Then \(L(S) = \{ w\in \varSigma ^{*}\mid w\vdash _{S}^{c^{*}} \lambda \} \dot {=} L(M)\). Thus, we also have \({\mathscr{L}}(\textsf {swift-ORD}) \subseteq {\mathscr{L}}({\mathsf {lc}\text {-}\mathsf {R}}[\mathcal {R}_{\text {ORD}}])\), which, together with Lemma 7, yields the intended equality. □

Hence, we conclude the following from Corollary 1.

Corollary 2

\({\mathscr{L}}({\mathsf {lc}\text {-}\mathsf {R}}[\mathcal {R}_{\text {ORD}}]) = {\mathsf {CFL}}\).

Thus, the limited context restarting automata of type \(\mathcal {R}_{\text {ORD}}\) are just as expressive as those of type \(\mathcal {R}_{2}^{\prime }\). However, type \(\mathcal {R}_{\text {ORD}}\) is a restricted variant of type \(\mathcal {R}_{1}^{\prime }\) that is incomparable to type \(\mathcal {R}_{2}^{\prime }\). Indeed, an automaton of type \(\mathcal {R}_{\text {ORD}}\) admits arbitrary left and right contexts of length one, while the only non-empty contexts that an automaton of type \(\mathcal {R}_{2}^{\prime }\) admits are the sentinels \(\rhd \) and \(\lhd \). On the other hand, an automaton of type \(\mathcal {R}_{2}^{\prime }\) may rewrite factors of arbitrary positive length, while an automaton of type \(\mathcal {R}_{\text {ORD}}\) can rewrite factors of length one only. Hence, Corollary 2 nicely complements the known results on limited context restarting automata presented in [21].

7 Conclusion

By introducing an additional restart-delete operation, which can just delete a single letter at a time, we have extended the stl-ORWW-automaton to the stl-ORD-automaton. As we have shown, this extension has surprizingly strong consequences. While the stl-ORWW-automaton just accepts the regular languages, we have seen that the stl-ORD-automaton accepts all context-free languages. In fact, by restricting the stl-ORD-automaton to its swift variant, we obtained a new characterization for the class of context-free languages. From the given constructions, we additionally derived the fact that stl-ORD-automata describe some regular languages in a much more succinct way than even stl-ORWW-automata. In fact, the size increase (measured in the cardinality of the underlying tape alphabets) that is required for turning a stl-ORD-automaton into an equivalent stl-ORWW-automaton can in general not be bounded from above by any recursive function.

Furthermore, we noticed that swift-ORD-automata can be interpreted as a new class of limited context restarting automata that is a proper subclass of the limited context restarting automata of type \(\mathcal {R}_{1}^{\prime }\). This new class is incomparable under inclusion to the limited context restarting automata of type \(\mathcal {R}_{2}^{\prime }\), although it has exactly the same expressive capacity.

Unfortunately, it still remains open whether stl-ORD-automata that are not swift can accept any languages that are not context-free. The diagram in Fig. 2 presents the inclusion and non-inclusion results between the classes of languages that are accepted by the various types of ordered restarting automata, the classes of the Chomsky hierarchy, and some related classes of limited context restarting automata. Here DCFLR = {LRLDCFL} is the class of languages that are reversals of deterministic context-free languages, UCFL is the class of unambiguous context-free languages, and Co-UCFL is the class of languages the complements of which are unambiguous context-free. Finally, \({\mathscr{L}}(\mathsf {con}\text {-}\mathsf {lc}\text {-}\mathsf {R}[\mathcal {R}_{1}^{\prime }])\) is the class of languages which are accepted by limited context restarting automata that are of the confluent version of type \(\mathcal {R}_{1}^{\prime }\) (see [21]). The results on det-ORWW-automata can be found in [22], those on stl-ORWW- and ORWW-automata are taken from [10, 11], the results on det-ORD-automata are from [18, 19], and those on limited context-restarting automata are from [21].

Fig. 2
figure 2

Hierarchy of language classes that are accepted by the various types of ordered restarting automata. An arrow indicates a proper inclusion, while an arrow with a question mark indicates an inclusion that is not known to be proper. If two classes that are not connected by a sequence of arrows, then they are incomparable under inclusion