Académique Documents
Professionnel Documents
Culture Documents
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/221568118
CITATIONS READS
3 7
2 authors, including:
Marcella Anselmo
Università degli Studi di Salerno
51 PUBLICATIONS 285 CITATIONS
SEE PROFILE
All content following this page was uploaded by Marcella Anselmo on 09 March 2016.
The user has requested enhancement of the downloaded file. All in-text references underlined in blue
are linked to publications on ResearchGate, letting you access and read them immediately.
Simulating Two-Dimensional Recognizability by
Pushdown and Queue Automata
1 Introduction
J. Farré, I. Litovsky, and S. Schmitz (Eds.): CIAA 2005, LNCS 3845, pp. 43–53, 2006.
c Springer-Verlag Berlin Heidelberg 2006
44 M. Anselmo and M. Madonia
REC(1). Our simulation follows some basic ideas for analogous simulations of
REC family (see [6]).
We then consider 4NFA equipped with a stack. If the size of the stack is
bounded by the minimal of the dimensions of the picture (as for 4NQA) it seems
that several recognizable languages would be not accepted. Indeed we could not
keep in memory a row or a column indifferently. Furthermore, using a stack
instead of a queue, when we pop the stack, some necessary information could
get lost. Hence we consider 4NFA equipped with a stack of size bounded by
the sum of the dimensions of the picture and call them 4-way pushdown au-
tomata (4NPDA). When restricted to one-row pictures, 4NPDA are equivalent
to two-way pushdown automata on strings. Since two-way pushdown automata
on strings recognize also context-free (string) languages, 4NPDA recognize lan-
guages not in REC. Nevertheless we show that 4NPDA are able to recognize a
quite large family inside REC, here called L(2DOTA). This is the class of lan-
guages that are either recognized by 2DOTA or the rotation of a language recog-
nized by 2DOTA. Furthermore, every example provided in the literature of a lan-
guage in REC but not in L(2DOTA) is a rotation of a language in L(2DOTA).
We use a characterization of L(2DOTA) by 2AFA in [10]. The class L(2DOTA)
is also characterized by a recursive definition: a language in L(2DOTA) can be
obtained from some languages accepted by 2NFA by iterating their union, inter-
section and diagonal overlapping. The diagonal overlapping is a new operation
on pictures and picture languages here defined; in the unary alphabet case it is
strictly linked to the diagonal concatenation as defined in [1, 2].
The paper is organized as follows. In Section 2 we briefly recall some prelimi-
nary definitions and results later used in the paper. Section 3 contains the main
results about 4NQA. Section 4 is devoted to 4NPDA and the class L(2DOTA).
Section 5 draws some conclusions.
2 Preliminaries
In this section we recall some terminology for two-dimensional languages. For all
definitions and classical results refer to [6]. Deterministic and non-deterministic
4-way automata (4DFA and 4NFA, resp.) are a generalization of 2-way (one-
dimensional) finite automata where the reading head can move in four directions:
Left, Right, Up and Down. When the head can move only in two directions,
right and down, we obtain deterministic and non-deterministic 2-way automata
(2DFA and 2NFA, resp.). The definition of two-dimensional on-line tessellation
acceptor, denoted by 2OTA is in [7]. If M is an automaton of a certain type,
then L(M) will denote the family of languages accepted by automata as M.
Let Σ be a finite alphabet. A two-dimensional string (or a picture) over Σ
is a two-dimensional rectangular array of elements of Σ. The set of all two-
dimensional strings over Σ is denoted by Σ ∗∗ and a two-dimensional language
over Σ is a subset of Σ ∗∗ . Given a picture p ∈ Σ ∗∗ , let pi,j denote the symbol
in p with coordinates (i, j), let 1 (p) denote the number of rows of p and 2 (p)
denote the number of columns of p. The pair (1 (p), 2 (p)) of dimensions of p is
called the size of the picture p. The set of all two-dimensional strings over Σ of
46 M. Anselmo and M. Madonia
size (n, m) is denoted by Σ n×m . For any picture p of size (n, m), we consider
picture p of size (n+ 2, m+ 2) obtained by surrounding p with a special boundary
symbol # ∈ Σ.
A tiling system for a language L over Σ with local alphabet Γ is a pair (Θ, π)
where Θ is a set of tiles, that is pictures of dimension (2, 2) over Γ ∪ {}, and
π : Γ ∪{} → Σ is an alphabetic mapping. Then, we say that a language L ⊆ Σ ∗∗
is recognizable by tiling system (Θ, π) if L = π(L ) and L is the set of all pictures
p such that the sub-pictures of p are all in Θ. The family of two-dimensional
languages recognizable by tiling systems is denoted by REC(Σ), briefly REC
when the alphabet can be omitted, and by REC(1) when a one-letter alphabet
is dealt with. Note that one-row languages in REC exactly correspond to regular
string languages.
Example 1. Let L be the language of pictures that are the column concatenation
of two identical squares. More formally L = {p | 1 (p) = n ≥ 1, 2 (p) = 2n and
p(i, j) = p(i, j + n) ∀1 ≤ i, j ≤ n}. The language L is accepted by a 4NQA that
compares the i-th column with the n + i-th one, for any i = 1, · · · , n, as follows.
It enqueues the content of the i-th column in the queue while moving down, then
moves to n + i-th column following the diagonal, and moving down it dequeues
if the symbol at the head of the queue matches the one in the cell. Note that
this 4NQA for L acts deterministically.
Simulating 2D Recognizability by Pushdown and Queue Automata 47
p pi−1,j
can guess the tile t2 = i−1,j−1 for p (if at least one such tile exists in
pi,j−1 pi,j
Remark 1. Bounding the queue of a 4NQA by the minimum of the dimensions
of a picture has an important byproduct. When 4NQA are restricted to one-row
languages, they are equivalent to 2-way automata on strings with unitary size
queue that recognize only regular languages (the queue symbol can be simulated
by the states).
In the case of an unary alphabet, Proposition 1 can be specified and gives the
following result.
Proposition 2. Let |Σ| = 1. The family REC(1) is contained in L(2NQA).
Proof. Let L ∈ REC(1), (Θ, π), Γ , L and n be as in Proposition 1. The 2NQA,
A, that recognizes L is similar to the 4NQA constructed in Proposition 1. The
only difference is that, since |Σ| = 1, it is no more necessary to scan all the
positions of the picture p. Therefore, A works in this way: first it fills up the
queue moving downwards in the first column. When it reaches the bottom, it
moves to the right, then remaining in the bottom position of the second column,
it updates the queue for n + 1 times in order to obtain in the queue the sequence
of guessed tiles for the first two columns of p. Then A moves again to the right
and repeats the cycle on the next column. If it reaches the bottom-right corner
of p then it accepts (see Example 2).
48 M. Anselmo and M. Madonia
The symbol q1,j = . . . = qn,j is needed to know if two columns can be adjacent:
if A leaves the j-th column in the state q, then it must enter in the (j + 1)-th
column in the same state (i.e. qn,j = qn,j+1 . . . = q1,j+1 ).
universal state qa are given by: δ(qa , σ) = {(qaR , R), (qaD , D), (qD , no move)}.
State qaR deterministically checks whether at the right end of the row there is
an a symbol and accepts in this case. In an anologous way, state qaD determin-
istically checks whether at the bottom of the column there is an a symbol and
accepts in this case. State qD moves one cell in diagonal and enters q0 .
Proposition 4. The family L(2AFA) is contained in L(4NPDA).
Proof. Let L ∈ L(2AFA) and let A be a 2AFA for L. For the sake of simplicity,
suppose that A at each step moves rigth or down. A 4NPDA P that simulates
A is the following. When A reaches an universal state q in position (i, j), then P
has to check if all the possible paths of the computation tree, starting from q in
position (i, j), are accepting. So P fills its stack with some triples (q, d, k), where
q is the state, d ∈ {Rigth, Down} is the direction and k is a number indicating
which path is actually checked. When P has completed an accepting path t of
A, it can return in position (i, j) by popping his stack, and thus check the next
path. Note that, since A can move only right and down, P’s stack contains at
most 1 (p) + 2 (p) symbols, where p is the input picture.
Consider now the family L(2DOTA) of all languages in L(2DOTA) and all their
rotations.
Corollary 1. The family L(2DOTA) is contained in L(4NPDA).
Proof. If L ∈ L(2DOTA) then it is the 180◦ rotation of a language L ∈ L(2AFA)
([10]) and L is accepted by a 4NPDA A (Proposition 4). Hence L is accepted
by a 4NPDA that starts by reaching the bottom-right corner and then continues
with a reversed copy of A. Moreover L(4NPDA) is closed under rotation since,
in a similar way as before, any rotation of a language accepted by a 4NPDA
is also accepted by a 4NPDA that first deterministically reaches some corner.
Observe that in any case the sum of the dimensions is the same and so the size
of the stack.
Let us now introduce the operation of diagonal overlapping. Given a picture p,
let us denote for any 1 ≤ i ≤ i ≤ 1 (p) and 1 ≤ j ≤ j ≤ 2 (p), by p[(i, j), (i , j )]
the sub-picture of p with top-left corner in position (i, j) and bottom-right corner
in position (i , j ) (as in [8]).
Definition 1. Let p, q ∈ Σ ∗∗ two pictures such that p1 (p),2 (p) = q1,1 . The
diagonal overlapping of p with q, denoted p(ov)q, is the language of words z ∈
Σ ∗∗ with 1 (z) = 1 (p) + 1 (q) − 1, 2 (z) = 2 (p) + 2 (q) − 1 and such that
z[(1, 1), (1 (p), 2 (p)] = p and z[(1 (p), 2 (p)), (1 (z), 2 (z))] = q.
Moreover for L1 , L2 ⊆ Σ ∗∗ , the diagonal overlapping of L1 with L2 , denoted
L1 (ov)L2 , is the language L1 (ov)L2 = {p(ov)q | p ∈ L1 , q ∈ L2 }.
Remark 4. Consider an unary alphabet. The diagonal concatenation of p =
(n, m) and q = (n , m ), as defined in [1, 2], is the picture of size (n + n , m + m ).
Hence, in the case of an unary alphabet, the descriptional power of the diago-
nal overlapping is the same as that of the diagonal concatenation. The diagonal
Simulating 2D Recognizability by Pushdown and Queue Automata 51
Now we set the recursive definition of 2-way recursive languages. Observe that
in the case of an unary alphabet, the class L(2NFA) has been characterized in
[1, 2] as both the family of rational relations and the family of languages obtained
from finite languages using union, diagonal concatenation and its closure.
Proof. Let A be a 2AFA accepting L, δ its transition function and q0 its starting
state. Set nΣ = σ∈Σ |δ(q0 , σ)|. First suppose q0 is an existential state. If nΣ > 1
then L is the union of nΣ languages in L(2AFA), following the nΣ possible
choices for the transitions. If nΣ = 1 and δ(qo , σ) = (q1 , R) (= (q1 , D), resp.)
then L = L1,2 (ov)L1 , (L = L2,1 (ov)L1 , resp.) where L1,2 = {p ∈ Σ 1×2 | p1,1 =
σ} ∈ L(2NFA), L2,1 = {p ∈ Σ 2×1 | p1,1 = σ} ∈ L(2NFA), and L1 ∈ L(2AFA) is
the language recognized by A with initial state q1 . When q0 is a universal state
an analogous proof holds with intersection instead of union. For the sake of
brevity, we omit some details about border conditions and no move transitions.
Vice versa, let L be a 2-way recursive language. The proof is by induction. If
L ∈ L(2NFA) then L ∈ L(2AFA) since a 2AFA is a generalization of a 2NFA.
If L = L1 ∪ L2 and L1 , L2 are 2-way recursive then by inductive hypothesis,
for i = 1, 2, Li is accepted by a 2AFA Ai with initial state qi . Then we can
define a 2AFA A joining A1 and A2 with a new initial existential state q0 and
δ(q0 , σ) = {(q1 , no move), (q2 , no move)}. The proof is analogous when L =
L1 ∩ L2 and L1 , L2 are 2-way recursive, with the only difference that q0 is now a
universal state. Finally, suppose L = L1 (ov)L2 where L1 ∈ L(2NFA) and L2 is
a 2-way recursive language. W.l.o.g. suppose that the 2NFA A1 recognizing L1
always accepts in the bottom-right corner of a picture. By inductive hypothesis,
L2 is accepted by a 2AFA A2 with initial state q2 . So we can obtain a 2AFA
accepting L by simulating first A1 (viewed as a 2AFA that can guess the bottom
border) and then starting A2 each time A1 on some position would enter an
accepting state if the position would be a bottom-right corner. Remark that the
construction is possible since it works basically connecting initial states of 2AFA
unless in the case of (ov) operations.
52 M. Anselmo and M. Madonia
Proof. The proof easily follows from Proposition 5 and a result in [10] stating
that L ∈ L(2AFA) iff it is the 180◦ rotation of a language in L(2DOTA).
5 Some Conclusions
References
1. Anselmo, M., Giammarresi, D., Madonia, M.: Regular Expressions for Two-
Dimensional Languages Over One-Letter Alphabet (Proc. DLT04), Calude C. S.,
Calude E., Dinneen M. J. (Eds), LNCS 3340 Springer Verlag (2004) 63-75
2. Anselmo, M., Giammarresi, D., Madonia, M.: New operations and regular expres-
sions for two-dimensional languages over one-letter alphabet. Theor. Comp. Sc.
(2005) (to appear)
3. Blum, M., Hewitt, C.: Automata on a two-dimensional tape. IEEE Symposium on
Switching and Automata Theory. (1967) 155-160
4. Crespi Reghizzi S., Pradella, M.: Tile Rewriting Grammars, (Proc. Developments
in Language Theory DLT 2003), LNCS 2710 Springer Verlag (2003) 206-217
5. Giammarresi, D., Restivo, A.: Two-dimensional finite state recognizability. Funda-
menta Informaticae 25:3, 4 (1996) 399-422
6. Giammarresi, D., Restivo, A.: Two-dimensional languages. In: G. Rozenberg et al
Eds: Handbook of Formal Languages Vol. III. Springer Verlag (1997) 215-268
Simulating 2D Recognizability by Pushdown and Queue Automata 53