Elsevier

Theoretical Computer Science

Volume 834, 24 September 2020, Pages 43-59
Theoretical Computer Science

Deque automata, languages, and planar graph representations

https://doi.org/10.1016/j.tcs.2020.02.029Get rights and content

Abstract

A deque automaton is a finite-state machine equipped with a deque memory tape. Such memory being more general than a queue or two stacks, we restrict consideration to quasi-real-time deque machines, for which we present useful normal forms. The closure properties of deque languages qualify them as an abstract family of languages but not a full one. The newly defined characteristic deque language CDL combines Dyck and AntiDyck (or FIFO) languages, and homomorphically characterizes the deque languages. The notion of deque graph from the graph drawing theory, well represents deque computations by means of a planar graph developed on a cylinder surface, with edges visualizing how deque symbols are inserted and removed. The drawing of deque computations on a cylinder is remindful of 3D models used in theoretical (bio)chemistry. We prove that a CDL can be defined in different ways: by a simple deque automaton, by labeled deque graphs, by cancellation rules, and by means of the shuffle and intersection of simpler languages. The labeled deque graph represents the syntax structure of a word.

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 F(DA), 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 F(DA) 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 F(DA).

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 F(DA) 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 LΣ, a homomorphism h:LΣ 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 F(DA). 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 k2, 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 F(DA); it especially focuses on the characteristic deque language CDL which is used as generator of family F(DA).

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)

  • A. Cherubini et al.

    Breath and depth grammars and deque automata

    Int. J. Found. Comput. Sci.

    (1990)
  • Cited by (0)

    A preliminary partial version of this work has been published in [1].

    View full text