Deque automata, languages, and planar graph representations☆
Introduction
This research pertains to the classical investigations on languages recognized by automata equipped with various types of auxiliary memory, such as pushdown LIFO stacks, FIFO queues, and combinations thereof. Introduced by D. Knuth [2], the double-ended queue or deque data-type is common in computer science, where it is typically implemented by means of a bidirectional buffer.
A deque memory combines the standard operations of a queue and of two independent stacks. But, unlike the pushdown automaton (PDA) and the queue automaton (QA) which impose serialization, a deque automaton permits parallel or interleaved execution of some operations.
Previous work on multi-head/multi-tape Turing machines has also addressed the simulation of deques, stacks and queues, e.g., in [3], where a deque is simulated in realtime by a machine with four single head tapes; see also [4] for deque simulation using stacks.
A different point of view on deques (initiated with [2] and then pursued by many authors starting with [5]) studies the permutations of an input sequence, which can be computed by a deque memory unit: the unit writes to memory n elements and then sorts them out by reading operations.
On the other hand, the use of a deque as the memory of an automaton has been rarely considered within formal language studies. The first deque automaton model we know of is in [6], but it is rather restricted and contains errors later corrected in [7]. The same model is used in [8] but restricted to have only one state, in connection with so called breadth-depth grammars. Such paucity of studies is perhaps due to the fact that a deque automaton is too powerful since already a simple QA can simulate a Turing machine move by turning its queue without reading from input.
To reduce computational capacity, we restrict our model to work in quasi-real-time (QRT), in the sense that the number of spontaneous moves occurring in a row is bounded by a constant; we mention that a similar hypothesis was made in a study of multi-queue automata [9].
First, the present work makes a step to establish the basic properties of languages recognized by deque automata, and their relations to the classic families of pushdown and of queue automata (see [10], [11], [9] in temporal order and the recent survey [12]). Such relation is made manifest by the definition of a language that plays the role of the Dyck and AntiDyck languages for context-free and for queue languages respectively.
Another reason to investigate deque languages is that they seem to fit, better than traditional automata, with the linguistic models proposed by molecular biology and chemistry, to study spatial arrangements of macromolecule sequences. Such fitting is suggested by a similarity of representation, next outlined. In their investigation of plane drawings of graphs on cylinder surfaces, Auer et al. [13], [14] showed that “a plane drawing is possible if, and only if, the graph is a …deque graph, i.e., the vertices of the graph can be processed according to a linear order and the edges correspond to items in the deque inserted and removed at their end vertices”. The syntactic structure of a word recognized by a deque machine is then represented by such toroidal planar graph. Similar though more complex embeddings of planar graphs on a cylinder have been considered in natural sciences, e.g., in [15], [16] for chemistry and for RNA.
Paper content and contributions.
Sect. 2 defines a quasi-realtime deque automaton (DA) by generalizing existing definitions of pushdown and queue automata (PDA, QA). To illustrate expressiveness, we introduce, among other examples, a family of languages featuring any number and ordering of reversed and directed replications of a word. Containment of CF and QRT QA families follows.
Sect. 3 shows that our DA definition is rather robust: the corresponding language family, denoted as , is unaffected by typical variations, such as the number of states, the number of deque symbols processed per move, and the restriction to real-time computations. It defines a convenient normal form, to simplify later proofs, and establishes that the family forms an abstract family of languages (AFL) but not a full one.
Sect. 4 defines the characteristic deque language (CDL) which plays the role of the Dyck and the AntiDyck (also known as FIFO) language, respectively for CF and queue languages. Using CDL, a homomorphic characterization of deque languages à la Chomsky - Schützenberger is proved for .
Sect. 5 exploits the planar cylindrical graph layout recently defined in [14] to develop a technique for analyzing and visualizing deque automata and languages. We prove that CDL computations on a DA are faithfully represented by a deque graph where vertices are labeled. We characterize the CDL by means of cancellation rules that combine the classical rules for Dyck and AntiDyck languages. We show an alternative definition of the CDL by a closed formula, as the shuffle of two CF languages intersected with a queue language; its corollary for the whole family immediately follows.
The Conclusion mentions directions for future research.
Section snippets
Basic definitions and properties of deque automata
We use the standard concepts and terminology of formal language and automata theory, to be found, e.g., in [17]. We only need to recall the p-limited erasing operation as defined, e.g., in [18] to generalize nonerasing homomorphisms. Intuitively, if h is a p-limited erasing on a language L, its effect is that, when applied to any sentence w of L, none of the factors of w of length p is entirely erased.
Definition 1 Given a language , a homomorphism with the property that h always maps less than p
Normal forms and closure properties
Following the established practice for other types of automata, we present some simplifications of the elementary operations, that preserve the language family . The use of such normal forms often improves readability of automata descriptions and simplifies the proofs of closure properties, in the second part of this section. We also show that the ability to test if the deque is empty does not augment the recognition capacity.
Characteristic deque language and definition by homomorphism
This section introduces the language that, for deque automata, plays the role of the Dyck language for PDA and of the AntiDyck language for QA. The idea is that, as for the simpler LIFO and FIFO cases, the deque operations too can be cast into a terminal alphabet containing distinct copies of each operation. In the Dyck language, such terminals are “brackets”, and although such name is less appropriate for the AntiDyck and the characteristic deque language (CDL) we keep to it.
Definition 5 CDL alphabet For every , the
Definition of deque sentences by planar graphs
An insightful analysis of deque operations has been recently obtained within research on graph drawing by Auer et al. [14]. The authors investigated when (undirected) planar graphs admit a special kind of drawing, namely linear cylindric planar drawing.
A linear cylindric drawing (LCD) in 3D is shown in Fig. 2, top; the vertices are placed on a straight line–a total order– parallel to the cylinder axis; the LCD is planar when the edge curves do not cross the line. The direction of the edges
Conclusion
Although the deque data structure is well-known as a generalization of both pushdown stacks and queues, it has rarely been considered as the auxiliary memory of an automaton. This paper makes some steps towards a formal study of quasi-realtime deque automata DA and establishes the basic closure properties of the corresponding language family ; it especially focuses on the characteristic deque language CDL which is used as generator of family .
A second focus is on the definition and 3D
Declaration of Competing Interest
There is no conflict of interest.
Acknowledgement
We gratefully thank an anonymous reviewer for pointing to inaccuracies and for suggesting several improvements.
References (22)
Deque automata and a subfamily of context-sensitive languages which contains all semilinear bounded languages
Theor. Comput. Sci.
(1985)A note on: ‘Deque automata and a subfamily of context-sensitive languages which contains all semilinear bounded languages’
Theor. Comput. Sci.
(1987)- et al.
QRT FIFO automata, breath-first grammars and their relations
Theor. Comput. Sci.
(1991) - et al.
Automates à file
Theor. Comput. Sci.
(1980) - et al.
AFL with the semilinear property
J. Comput. Syst. Sci.
(1971) - et al.
Deque languages, automata and planar graphs
The Art of Computer Programming, vol. I: Fundamental Algorithms
(1968)- et al.
New real-time simulations of multihead tape units
J. ACM
(1981) Stacks versus deques
Computing permutations with double-ended queues, parallel stacks and parallel queues