Jumping Computation Updating Automata and Grammars for Discontinuous
Jumping Computation Updating Automata and Grammars for Discontinuous
Jumping Computation: Updating Automata and Grammars for Discontinuous Information Pro-
cessing is primarily a theoretically oriented treatment of jumping automata and grammars, covering
all essential theoretical topics concerning them, including their power, properties, and transforma-
tions. From a practical viewpoint, it describes various concepts, methods, algorithms, techniques,
case studies and applications based upon these automata and grammars.
In today’s computerized world, the scientific development and study of computation, referred to as
the theory of computation, plays a crucial role. One important branch, language theory, investigates
how to define and study languages and their models, which formalize algorithms according to which
their computation is executed. These language-defining models are classified into two basic catego-
ries: automata, which define languages by recognizing their words, and grammars, which generate
them. Introduced many decades ago, these rules reflect classical sequential computation. However,
today’s computational methods frequently process information in a fundamentally different way,
frequently “jumping” over large portions of the information as a whole. This book adapts classical
models to formalize and study this kind of computation properly. Simply put, during their language-
defining process, these adapted versions, called jumping automata and grammars, jump across the
words they work on.
The book selects important models and summarizes key results about them in a compact and uniform
way. It relates each model to a particular form of modern computation, such as sequential, semi-
parallel and totally parallel computation. It explains how the model in question properly reflects and
formalizes the corresponding form of computation, thus allowing us to obtain a systematized body
of mathematically precise knowledge concerning the jumping computation. The book pays special
attention to power, closure properties, and transformations and also describes many algorithms that
modify jumping grammars and automata so they satisfy some prescribed properties without changing
the defined language. The book will be of great interest to anyone researching the theory of computa-
tion across the fields of computer science, mathematics, engineering, logic and linguistics.
Alexander Meduna is a theoretical computer scientist and expert on the theory of computation who
was born in the Czech Republic. He is a full professor of Computer Science at the Brno University of
Technology. Formerly, he taught theoretical computer science at various American, Asian and Euro-
pean universities, including the University of Missouri, where he spent a decade teaching advanced
topics of formal language theory and Kyoto Sangyo University, where he spent several months teach-
ing these topics, too. Concerning the subject of this book, he is the author of over 90 papers and
several books, listed at: http://www.fit.vutbr.cz/~meduna/work.
Zbyněk Křivka is both a theoretically and pragmatically oriented computer scientist. Being a former
PhD student of Alexander Meduna and, currently, his colleague at the Brno University of Technology,
he has published several journal papers with strong focus on jumping models. His PhD thesis, which
also deals with formal languages, has been published as a book.
Jumping Computation
Updating Automata and
Grammars for Discontinuous
Information Processing
Reasonable efforts have been made to publish reliable data and information, but the author and pub-
lisher cannot assume responsibility for the validity of all materials or the consequences of their use.
The authors and publishers have attempted to trace the copyright holders of all material reproduced
in this publication and apologize to copyright holders if permission to publish in this form has not
been obtained. If any copyright material has not been acknowledged please write and let us know so
we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information stor-
age or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com
or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. For works that are not available on CCC please contact [email protected]
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are
used only for identification and explanation without intent to infringe.
DOI: 10.1201/9781003107910
Typeset in TeXGyreTermesX-Regular
by KnowledgeWorks Global Ltd.
Publisher’s note: This book has been prepared from camera-ready copy provided by the authors.
To my students. AM
To Veronika. ZK
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Part I Introduction
1 Mathematical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Sets and Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Relations and Translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
vii
viii Contents
Part IV Conclusion
Indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Index to Key Language Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Subject Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Preface
Living and working in today’s enormously computerized world, most people use
computers on a daily basis. Many of them make use of various artificial languages,
such as high-level programming languages, in which they encode algorithms ac-
cording to which computers process their data. In addition, apart from computation
originated by humans in this way, many computer programs are created by ma-
chines, too. Indeed, the world is overflown with various clever machines, such as
smart phones, which use their own languages in which they encode algorithms and,
subsequently, perform computation based upon their users’ requests. It thus comes
as no surprise that the scientific study of computation, referred to as the theory of
computation, fulfills a more important role today than ever before.
Writing computer programs in various languages gives rise to a constant struggle
of proper formalization of languages in the theory of computation. Taking great ad-
vantage of mathematics as a systematized body of unshakable knowledge obtained
by precise and infallible reasoning, this theory has developed formal language the-
ory as one of its crucially important parts. Formal language theory investigates how
to define and study languages in a rigorous and general way. From a mathematical
viewpoint, this theory simply defines languages as sets of sequences of symbols. This
straightforward definition is so general that it encompasses almost all languages as
they are commonly understood. As a matter of fact, even natural languages are in-
cluded in this definition. Of course, all artificial languages introduced within various
scientific disciplines represent languages formalized in this way as well. Perhaps
most obviously, this simple definition takes in all computer-related languages, rang-
ing from machine codes through assembly languages up to high-level programming
languages, such as all C-based languages.
The formalization of languages, most of which are infinite, necessitates the intro-
duction of language-defining formal models. Traditionally, these language models
are based upon finitely many rules by which they sequentially rewrite sequences
of symbols, called words. They are classified into two basic categories—generating
and accepting models. Generating models or, briefly, grammars define strings of
their languages by generating them from special start symbols. On the other hand,
accepting models or, briefly, automata define strings of their language by a rewriting
ix
x Preface
process that starts from these strings and ends in a special set of strings, usually
called final configurations.
Introduced many decades ago, original versions of automata and grammars re-
flect the classical way of computation, continuously working with a single piece
of information from left to right according to algorithms designed for this pur-
pose. Accordingly, the classical automata and grammars worked on words, which
represented the information being processed, in a strictly left-to-right way as well.
Modern methods, however, frequently process information in a fundamentally differ-
ent way. For example, they process various parts of information frequently occurring
far away from each other. As a result, the computational process based upon these
methods constantly jumps over large portions of the information as a whole. As is
obvious, classical automata and grammars inadequately and insufficiently formalize
this modern way of computation, referred to as jumping computation throughout
this book. To formalize and study it properly, the present book adapts these classical
models so they work on words non-continuously just like the execution of jumping
computation, which they formalize (Brandon Mull’s well-known quote paraphrases
a necessity of this update accurately: when jumping is the sole option, you jump
and try to make it work). Simply put, during their language-defining process, these
adapted versions, referred to as jumping automata and grammars, jump across the
words they work on. During a single language-defining step, they modify a portion
of the current word at a position, then jump over a portion of the word in either
direction, and continue this process from there. Working in this way, they formalize
and reflect today’s jumping computation adequately and elegantly.
To give an insight into jumping automata, let us first recall the well-known notion
of a classical finite automaton, 𝑀, which consists of an input tape, a read head, and
a finite state control. The input tape is divided into squares. Each square contains
one symbol of an input word. The symbol under the read head, 𝑎, is the current
input symbol. The finite control is represented by a finite set of states together with
a control relation, which is usually specified as a set of computational rules. 𝑀
operates on words by making a sequence of moves. Each move is made according to
a computational rule that describes how the current state is changed and whether the
current input symbol is read. If the symbol is read, the read head is shifted precisely
one square to the right. 𝑀 has one state defined as the start state and some states
designated as final states. Let a word 𝑤 be written on the input tape. If 𝑀 can perform
a sequence of moves, made in the left-to-right way sketched above, so that starting
from the start state, it reads the entire 𝑤 on the tape and ends up in a final state, then
𝑀 accepts 𝑤. In essence, a jumping finite automaton 𝐽 works just like a classical
finite automaton, except it does not read the input string from left to right. Instead,
after reading a symbol, 𝐽 jumps over a portion of the tape in either direction and
continue making jumps from there. Once an occurrence of a symbol is read on the
tape, it cannot be re-read again later during the computation of 𝐽. If 𝐽 can perform
a sequence of jumps so it begins from the start state, reads all the symbols of 𝑤 on
the tape, and enters a final state, then 𝐽 accepts 𝑤.
To give an insight into jumping grammars, let us recall the notion of a classical
grammar 𝐺, which represents a language-generating model based upon an alphabet
Preface xi
of symbols and a finite set of rules. The alphabet of symbols is divided into two
disjoint subalphabets—the alphabet of terminal symbols and the alphabet of non-
terminal symbols. Each rule represents a pair of the form (𝑥, 𝑦), where 𝑥 and 𝑦 are
strings over the alphabet of 𝐺. Customarily, (𝑥, 𝑦) is written as 𝑥 → 𝑦, where 𝑥 and 𝑦
are referred to as the left-hand side and the right-hand side of 𝑥 → 𝑦. Starting from a
special start nonterminal symbol, 𝐺 repeatedly rewrites strings according to its rules
until it obtains a sentence—that is, a string that solely consists of terminal symbols;
the set of all sentences represents the language generated by the grammar. In greater
detail, 𝐺 rewrites a string 𝑧 according to 𝑥 → 𝑦 so it (1) selects an occurrence
of 𝑥 in 𝑧, (2) erases it, and (3) inserts 𝑦 precisely at the position of this erasure.
More formally, let 𝑧 = 𝑢𝑥𝑣, where 𝑢 and 𝑣 are strings. By using 𝑥 → 𝑦, 𝐺 rewrites
𝑢𝑥𝑣 to 𝑢𝑦𝑣. The notion of a jumping grammar is conceptualized just like that of a
classical grammar; however, it rewrites strings in a slightly different way. Consider
𝐺, described above, as a jumping grammar. Let 𝑧 and 𝑥 → 𝑦 have the same meaning
as above. When 𝐺 rewrites a string 𝑧 according to 𝑥 → 𝑦, it performs (1) and (2) as
described above, but during (3), 𝐺 can jump over a portion of the rewritten string in
either direction and insert 𝑦 there. More formally, by using 𝑥 → 𝑦, 𝐺 rewrites 𝑢𝑐𝑣
to 𝑢𝑑𝑣, where 𝑢, 𝑣, 𝑤, 𝑐, 𝑑 are strings such that either (i) 𝑐 = 𝑥𝑤 and 𝑑 = 𝑤𝑦 or (ii)
𝑐 = 𝑤𝑥 and 𝑑 = 𝑦𝑤. Otherwise, it coincides with the standard notion of a grammar.
To illustrate the essential difference between the classical and jumping versions
of automata and grammars described above in a simple and straightforward manner,
consider the infinite language 𝐿 consisting of all binary strings containing the same
number of 0s and 1s. Of course, 𝐿 may fulfill a useful role in any scientific inves-
tigation that formalizes the subject of its study in binary. For instance, imagine a
linguistic study that denotes any consonant and any vowel by 1 and 0, respectively, to
schematize the words containing the same number of consonants and vowels by using
𝐿. In English, subroutine would be schematized to 1011001010, which is in 𝐿 while
routine would correspond to 1001010, which is out of 𝐿. Clearly, these schemes may
be of some use when, for example, this study compares several languages in terms
of the number of consonants and vowels occurring in their words. To take another
scientific area, a social investigation might use 𝐿 in terms of gender binary in such a
way that 0 and 1 represent a male and a female, respectively. In this way, 𝐿 actually
represents all possible sequences of people with the same number of masculine and
feminine persons, which might turn out as a topic under discussion during this in-
vestigation. Nevertheless, any scientific use of 𝐿 necessitates its rigorous definition
by a suitable automaton or grammar in the first place. Unfortunately, no classical
finite automaton, which represents an utterly finitary model without any potentially
infinite memory, accepts 𝐿. Indeed, reading strings in a strictly left-to-right way, no
classical finite automaton can compare the number of 0s against the number of 1s,
thus failing to accept 𝐿. On the other hand, a jumping finite automaton can accept
𝐿 by repeatedly performing a two-jump computation during which it reads one oc-
currence of 0 and one occurrence of 1. If it eventually empties the input tape in this
way, it accepts; otherwise, it rejects. Similarly, a jumping grammar can generate 𝐿
by using only three rules—𝑆 → 0𝐴, 𝐴 → 1𝑆, and 𝑆 → 𝜀, where 𝑆 and 𝐴 are non-
terminals, and 𝜀 denotes the empty string. Compare to this trivial jumping grammar,
xii Preface
all the classical grammars for 𝐿 are more complicated and clumsy as the reader can
easily verify. Consequently, as just illustrated, under some circumstances, jumping
versions of automata and grammars have important advantages over their classical
counterparts, so their concepts and properties deserve a careful investigation.
Jumping automata and grammars, together referred to as jumping language mod-
els, represent the principal subject of the present book, whose main focus is on their
concepts, properties and application-related perspectives in practice. The book se-
lects crucially important models and summarizes key results about them in a compact
and uniform way. It always relates each of the selected models to a particular way of
modern computation, such as sequential and parallel computation. The text explains
how the model in question properly reflects and formalizes the corresponding way
of computation, thus allowing us to obtain a systematized body of mathematically
precise knowledge concerning the jumping computation.
Concerning the properties of jumping automata and grammars, the book pays
special attention to their power, closure properties, and transformations. Obviously,
the power of these modern versions of language models represents perhaps the most
important information about them, so the book always determines the family of
languages that these versions define. The text also describes many algorithms that
modify jumping grammars and automata so they satisfy some prescribed properties
without changing the defined language. Algorithms of this kind fulfill an important
role in practice because many language processors strictly require that the prescribed
properties be satisfied. These properties also frequently simplify proofs demonstrat-
ing results about the models. Of course, the same languages can be defined by dif-
ferent models, and every computation-related investigation or application naturally
selects the most appropriate models for them under given circumstances. Therefore,
whenever discussing different types of equally powerful jumping language models,
the book studies their mutual transformations, too. More specifically, given a lan-
guage model of one type, the text carefully explains how to turn it to another model
so both the original system and the model produced by this conversion define the
same language.
The text is divided into four parts, each of which consists of several chapters. Every
part starts with an abstract that summarizes its chapters. Altogether, the book contains
10 chapters, each of which opens its discussion with a brief explanation of jumping
computation in general while paying special attention to the subject of the chapter
in question.
Part I, consisting of Chapters 1 and 2, reviews important mathematical concepts
so that the entire text of the book is completely self-contained. Chapter 1 reviews
rudimentary concepts from discrete mathematics. Chapter 2 introduces the funda-
mental notions of formal language theory. Part I can be only skimmed with respect
to the notation and definitions used later in the book.
Preface xiii
Part II, consisting of Chapters 3 and 4, gives the fundamentals of jumping au-
tomata. First, it gives an extensive and thorough coverage of jumping one-head finite
automata (Chapter 3), after which it covers their multi-head versions (Chapter 4).
Part III consists of Chapters 5 through 7, and it covers jumping grammars as
crucially important grammatical counterparts to jumping automata. Chapter 5 studies
the jumping generation of language by classical grammars, which work in a strictly
sequential way. Then, Chapter 6 discusses the same topic in terms of semi-parallel
grammars. Finally, Chapter 7 explores the jumping generation of language by pure
sequential and parallel grammars, which have only terminals.
Part IV, consisting of Chapters 8, 9, and 10, closes this book. First, Chapter 8
sketches how to formalize discontinuous computation by some alternative models,
whose behavior differs from that based upon the jumping principle. Chapter 9
presents selected applications of jumping automata and grammars. Naturally, it
concentrates its attention on the use in practice, but it also covers their applications
in theoretical computer science. Finally, Chapter 10 sums up the entire text and
makes many bibliographical notes for the serious reader.
As a whole, the entire text is intentionally written so that it allows the flexibility
needed to study only some selected topics. Perhaps most importantly, each chapter of
Parts II and III, which represent the heart of the book, always begins with a succinct
explanation of jumping computation in general while paying particular attention
to the subject of the chapter; as a result, the reader is freed from the necessity of
studying other chapters of the book. To put it simply and plainly, the reader can read
every chapter completely independently of the rest of the book.
As far as the writing style is concerned, the book introduces all formalisms with
enough rigor to make all results quite clear and valid because this book primarily
represents a theoretically oriented treatment. Before every complicated mathematical
passage, the text explains its basic idea intuitively so that even the most complex
parts of the book are relatively easy to grasp. If a parenthesized reference follows a
statement heading, then the present book only sketches or even omits its proof, but
the reference specifies where a fully rigorous version of the proof is to be found; for
instance, a proof of Theorem 2.2 (Păun et al. [1998]) is omitted in this book, but
Păun et al. [1998] proves this theorem rigorously.
From a practical standpoint, it is worth pointing out that the book proves most of
the results in the chapters listed above effectively—that is, within proofs demonstrat-
ing them, it also gives algorithms that describe how to achieve these results. Perhaps
most importantly, the book often presents conversions between equally powerful
models as algorithms, whose correctness is then rigorously verified. In this way,
apart from their theoretical value, the text actually explains how to implement and
use them in practice. Several worked-out examples illustrate this use.
Figures
The text includes several figures, many of which diagram relationships between
language families. In these diagrams, the following conventions are used. Let X and
xiv Preface
A B
C D
E F
Use
Primarily, from an utterly general standpoint, this book is helpful to everybody who
takes advantage of modern computational technologies working in a jumping way to
some extent. Perhaps most significantly, all scientists who make these technologies,
ranging from pure mathematicians through computational linguists up to computer
engineers, might find jumping automata and grammars, covered in this book, useful
for their work.
The text allows the flexibility needed to study only some selected topics indepen-
dently of the rest of the entire text. More precisely, Part I should be always skimmed
with respect to the notation and definitions used later in the book; but apart from
this, every other chapter can be read utterly independently of the other chapters.
Secondarily, the entire book can be used as a text for a one-term course about
jumping grammars and automata at an upper-level graduate or introductory post-
graduate level. As already pointed out, the text allows the flexibility needed to make
a shorter course, which concentrates in depth on some selected topics. A sample
schedule of a course like this might be one of the following:
Preface xv
Support
For the sake of brevity, the text makes use of many mathematical symbols, including
the symbolic denotation of several language families. Therefore, the end matter of
this book contains some supporting material that should help the reader with a quick
orientation in the text. This material includes the index to key language families and
the subject index.
For the support on the Web, visit
http://www.fit.vutbr.cz/˜meduna/books/jc/
Here, one will find further backup materials related to this book, such as sug-
gestions for further reading as well as errata as we learn of them. We will also
frequently update this website with information about new publications related to
jumping computation and its models.
Acknowledgments
xvii
Part I
Introduction
In this two-chapter introductory part, we first review the mathematical notions,
concepts, and techniques used throughout this textbook in order to express all the
upcoming material clearly and precisely. Then, we introduce formal languages and
rewriting systems that define them. We distinguish two principal approaches to this
definition—the language generation and the language acceptation.
To make this book self-contained, Chapter 1 reviews the principal ideas and no-
tions underlying some mathematical areas needed to follow the rest of this book.
These areas include logic, set theory, discrete mathematics, and graph theory. Chap-
ter 2 outlines the theory of formal languages and their models. That is, it introduces
rewriting systems and demonstrates how to use them as language-defining models.
It categorizes these models into two essential classes—automata, which accept lan-
guages, and grammars, which generate them. Apart from the classical well-known
versions of these models, such as finite automata and context-free grammars, the
chapter also covers less-known language models, such as Watson–Crick finite au-
tomata and state grammars, which are used later in the text as well.
Chapter 1
Mathematical Background
This chapter reviews rudimentary concepts from logic (Section 1.1), set theory
(Section 1.2), discrete mathematics (Section 1.3), and graph theory (Section 1.4).
For readers familiar with these concepts, this chapter can be treated as a reference
for notation and definitions.
1.1 Logic
Next, we review the basics of elementary logic. We pay special attention to the
fundamental proof techniques used in this book.
In general, a formal mathematical system 𝑆 consists of basic symbols, formation
rules, axioms, and inference rules. Basic symbols, such as constants and operators,
form components of statements, which are composed according to formation rules.
Axioms are primitive statements, whose validity is accepted without justification. By
inference rules, some statements infer other statements. A proof of a statement 𝑠 in 𝑆
consists of a sequence of statements 𝑠1 , . . . , 𝑠𝑖 , . . . , 𝑠 𝑛 such that 𝑠 = 𝑠 𝑛 , and each 𝑠𝑖
is either an axiom of 𝑆 or a statement inferred by some of the statements 𝑠1 , . . . , 𝑠𝑖−1
according to the inference rules; 𝑠 proved in this way represents a theorem of 𝑆.
Logical connectives join statements to create more complicated statements. The
most common logical connectives are not, and, or, implies, and if and only if. In this
list, not is unary while the other connectives are binary. That is, if 𝑠 is a statement,
then not 𝑠 is a statement as well. Similarly, if 𝑠1 and 𝑠2 are statements, then 𝑠1 and
𝑠2 , 𝑠1 or 𝑠2 , 𝑠1 implies 𝑠2 , and 𝑠1 if and only if 𝑠2 are statements, too. We often write
¬, ∧, and ∨ instead of not, and, and or, respectively. In Figure 1.1, the truth table
presents the rules governing the truth or falsity concerning statements connected by
the binary connectives. Regarding the unary connective ¬, if 𝑠 is true, then ¬𝑠 is
false, and if 𝑠 is false, then ¬𝑠 is true.
Convention 1.1 Throughout this book, truth and falsity are denoted by 1 and 0,
respectively.
3
4 1 Mathematical Background
By this table, 𝑠1 and 𝑠2 is true if both statements are true; otherwise, 𝑠1 and
𝑠2 is false. Analogically, we can interpret the other rules governing the truth or
falsity of a statement containing the other connectives from this table. A statement
of equivalence, which has the form 𝑠1 if and only if 𝑠2 , sometimes abbreviated to 𝑠1
iff 𝑠2 , plays a crucial role in this book. A proof that such a statement is true usually
consists of two parts. The only-if part demonstrates that 𝑠1 implies 𝑠2 is true, while
the if part proves that 𝑠2 implies 𝑠1 is true.
Example 1.1 There exists a useful way of representing ordinary infix arithmetic
expressions without using parentheses. This notation is referred to as Polish notation,
which has two fundamental forms—postfix and prefix notation. The former is defined
recursively as follows.
Let Ω be a set of binary operators, and let Σ be a set of operands.
(1) Every 𝑎 ∈ Σ is a postfix representation of 𝑎.
(2) Let 𝐴𝑜𝐵 be an infix expression, where 𝑜 ∈ Ω, and 𝐴, 𝐵 are infix expressions.
Then, 𝐶𝐷𝑜 is the postfix representation of 𝐴𝑜𝐵, where 𝐶 and 𝐷 are the postfix
representations of 𝐴 and 𝐵, respectively.
(3) Let 𝐶 be the postfix representation of an infix expression 𝐴. Then, 𝐶 is the
postfix representation of ( 𝐴).
Consider the infix logical expression (1 ∨ 0) ∧ 0. The postfix expressions for 1
and 0 are 1 and 0, respectively. The postfix expression for 1 ∨ 0 is 10∨, so the postfix
expression for (1 ∨ 0) is 10∨, too. Thus the postfix expression for (1 ∨ 0) ∧ 0 is
10 ∨ 0∧.
Prefix notation is defined analogically except that in the second part of the defi-
nition, 𝑜 is placed in front of 𝐴𝐵; the details are left as an exercise.
There exist many logic laws useful to demonstrate that an implication is true.
Specifically, the contrapositive law says (𝑠1 implies 𝑠2 ) if and only if ((¬𝑠2 ) implies
(¬𝑠1 )), so we can prove 𝑠1 implies 𝑠2 by demonstrating that (¬𝑠2 ) implies (¬𝑠1 )
holds true. We also often use a proof by contradiction based upon the law saying
((¬𝑠2 ) ∧ 𝑠1 ) implies 0 is true. Less formally, if from the assumption that 𝑠2 is
false and 𝑠1 is true we obtain a false statement, 𝑠1 implies 𝑠2 is true. A proof by
induction demonstrates that a statement 𝑠𝑖 is true for all integers 𝑖 ≥ 𝑏, where 𝑏 is a
non-negative integer. In general, a proof of this kind is made in this way:
Basis. Prove that 𝑠 𝑏 is true.
1.2 Sets and Languages 5
Induction Hypothesis. Suppose that there exists an integer 𝑛 such that 𝑛 ≥ 𝑏 and 𝑠 𝑚
is true for all 𝑏 ≤ 𝑚 ≤ 𝑛.
Induction Step. Prove that 𝑠 𝑛+1 is true under the assumption that the inductive
hypothesis holds.
A proof by contradiction and a proof by induction are illustrated in the beginning
of the next section (see Example 1.2).
This section reviews basic concepts of set theory. Most importantly, it defines lan-
guages as sets whose elements are finite sequences of symbols. Many language
operations are covered, too.
In what follows, we suppose that there are certain elements taken from some
pre-specified universe. A set Σ is a collection of elements taken from this universe.
To express that an element 𝑎 is a member of Σ, we write 𝑎 ∈ Σ. On the other hand, if
𝑎 is not in Σ, we write 𝑎 ∉ Σ. We automatically assume that these utterly rudimental
notions exist, but they are left undefined, so they are considered as naive notions of
set theory.
If Σ has a finite number of members, then Σ is a finite set; otherwise, Σ is an
infinite set. The finite set that has no member is the empty set, denoted by ∅. The
cardinality of a finite set, Σ, denoted by card(Σ), is the number of Σ’s members;
note that card(∅) = 0.
Convention 1.2 Throughout this book, N denotes the set of natural numbers—that
is, N = {1, 2, . . .}, and 0 N = {0} ∪ N.
Example 1.2 The purpose of this example is two-fold. First, we give examples of
sets. Second, as pointed out in the conclusion of the previous section, we illustrate
how to make proofs by contradiction and by induction.
Let 𝑃 be the set of all primes (a natural number 𝑛, 𝑛 ≥ 2, is prime if its only
positive divisors are 1 and 𝑛).
A proof by contradiction. By contradiction, we next prove that 𝑃 is infinite. That
is, for the sake of contradiction, assume that 𝑃 is finite. Set 𝑘 = card(𝑃). Thus,
𝑃 contains 𝑘 numbers, 𝑝 1 , 𝑝 2 , . . . , 𝑝 𝑘 . Set 𝑛 = 𝑝 1 𝑝 2 · · · 𝑝 𝑘 + 1. Observe that 𝑛
is not divisible by any 𝑝 𝑖 , 1 ≤ 𝑖 ≤ 𝑘. As a result, either 𝑛 is a new prime or 𝑛
equals a product of new primes. In either case, there exists a prime out of 𝑃, which
contradicts the assumption that P contains all primes. Thus, 𝑃 is infinite. Another
proof by contradiction is given in Example 1.5.
A proof by induction. As already stated, by induction, we prove that a statement 𝑠𝑖
holds for all 𝑖 ≥ 𝑏, where 𝑏 ∈ N. To illustrate, consider 𝑖 2 | 𝑖 ∈ N, and let 𝑠𝑖 state
1 + 3 + 5 + · · · + 2𝑖 − 1 = 𝑖 2
6 1 Mathematical Background
for all 𝑖 ∈ N; in other words, 𝑠𝑖 says that the sum of the first 𝑖 odd integers is a
perfect square. An inductive proof of this statement follows next.
Basis. As 1 = 12 , 𝑠1 is true.
Induction Hypothesis. Assume that 𝑠 𝑚 is true for all 1 ≤ 𝑚 ≤ 𝑛, where 𝑛 is a natural
number.
Induction Step. Consider 𝑠 𝑛+1 = 1 + 3 + 5 + ... + (2𝑛 − 1) + (2(𝑛 + 1) − 1) =
(𝑛 + 1) 2 . By the inductive hypothesis, 𝑠 𝑛 = 1 + 3 + 5 + ... + (2𝑛 − 1) = 𝑛2 . Hence,
1 + 3 + 5 + ... + (2𝑛 − 1) + (2(𝑛 + 1) − 1) = 𝑛2 + 2𝑛 + 1 = (𝑛 + 1) 2 . Consequently,
𝑠 𝑛+1 holds, and the inductive proof is completed.
Languages
Just like set theory has its naive notions, so does formal language theory. Indeed,
it automatically assumes that there exists a pre-specified infinite set, referred to
as a universal alphabet, whose members are called symbols. An alphabet Σ is
any finite nonempty subset of this universal alphabet. Any nonempty subset of Σ
1.2 Sets and Languages 7
Example 1.3 The English alphabet, consisting of its 26 letters, illustrates the defini-
tion of an alphabet as stated above except that we refer to its members as symbols
in this book. Our definition of a language includes all common artificial and nat-
ural languages. For instance, programming languages represent formal languages
in terms of this definition, and so do English, Navaho, and Japanese. Any family
of natural languages—including Indo-European, Sino-Tibetan, Niger-Congo, Afro-
Asiatic, and Japonic families of languages—is a language family according to the
definition above.
Convention 1.3 In strings, for brevity, we simply juxtapose the symbols and omit
the parentheses and all separating commas. That is, we write 𝑎 1 𝑎 2 · · · 𝑎 𝑛 instead of
(𝑎 1 , 𝑎 2 , . . . , 𝑎 𝑛 ).
Let FIN and INFIN denote the families of finite and infinite languages, re-
spectively. Let ALL denote the family of all languages; in other words, ALL =
FIN ∪ INFIN.
𝑥1 𝑥 2 · · · 𝑥 𝑛 , 𝑣 = 𝑦 1 𝑦 2 · · · 𝑦 𝑛 , 𝑥𝑖 , 𝑦 𝑖 ∈ Σ∗ , 1 ≤ 𝑖 ≤ 𝑛, 𝑛 ≥ Ð
1}, where 𝑢, 𝑣 ∈ Σ∗ . Fur-
thermore, for languages 𝐿 1 and 𝐿 2 over Σ, set 𝐿 1 𝐿 2 = 𝑢∈ 𝐿1 , 𝑣 ∈ 𝐿2 (𝑢 𝑣 ).
E
Ð
𝑤 ∈ 𝐿 perm(𝑤). If 𝐿 = perm(𝐿), we say 𝐿 is permutation closed.
Let Δ be a subalphabet of Σ. The string projection of 𝑦 is the string resulting from
𝑦 by removing all symbols from Σ − Δ; formally defined as
𝜀 if 𝑦 = 𝜀;
𝜋Δ (𝑦) = 𝜋Δ (𝑥) if 𝑦 = 𝑥𝑎 and 𝑎 ∉ Δ;
𝜋Δ (𝑥)𝑎
if 𝑦 = 𝑥𝑎 and 𝑎 ∈ Δ.
The projection of a language 𝐿 is given by 𝜋 Δ (𝐿) = {𝜋 Δ (𝑦) | 𝑦 ∈ 𝐿}.
Assume 𝑜 is an 𝑛-ary operation over languages, 𝑛 ≥ 1. A language family L is
closed under operation 𝑜 if 𝑜(𝐿 1 , 𝐿 2 , . . . , 𝐿 𝑛 ) ∈ L, where 𝐿 1 , 𝐿 2 , . . . , 𝐿 𝑛 ∈ L.
Example 1.4 Consider the alphabet {0, 1}. For instance, 𝜀, 1, and 010 are strings over
{0, 1}. Notice that |𝜀| = 0, |1| = 1, |010| = 3. The concatenation of 1 and 010 is 1010.
1.3 Relations and Translations 9
The third power of 1010 equals 101010101010. Observe that reversal(1010) = 0101.
We have prefixes(1010) = {𝜀, 1, 10, 101, 1010}, where 1, 10, and 101 are proper
prefixes of 1010, while 𝜀 and 1010 are not. We have suffixes(1010) = {𝜀, 0, 10,
010, 1010}, substrings(1010) = {𝜀, 0, 1, 01, 10, 010, 101, 1010}, symbols(1010) =
{0, 1}, and 𝜋 {0} (1010) = 00.
Set 𝐾 = {0, 01} and 𝐿 = {1, 01}. Observe that 𝐿 ∪ 𝐾, 𝐿 ∩ 𝐾, and 𝐿 − 𝐾
are equal to {0, 1, 01}, {01}, and {1}, respectively. The concatenation of 𝐾 and 𝐿 is
𝐾 𝐿 = {01, 001, 011, 0101}. For 𝐿, ∼ 𝐿 = Σ∗ − 𝐿, so ∼ 𝐿 contains all strings in {0, 1}∗
but 1 and 01. Furthermore, reversal(𝐿) = {1, 10} and 𝐿 2 = {11, 101, 011, 0101}.
Next, 𝐿 ∗ contains all strings from Σ∗ such that every 0 is followed by at least one 1.
To illustrate, the strings in 𝐿 ∗ that consist of four or fewer symbols are 𝜀, 1, 01, 11,
011, 101, 111, 0101, 0111, 1011, 1101, and 1111.
Since 𝜀 ∉ 𝐿, 𝐿 + = 𝐿 ∗ − {𝜀}. Notice that prefixes(𝐿) = {𝜀, 1, 0, 01}, suffixes(𝐿) =
{𝜀, 1, 01}, substrings(𝐿) = {𝜀, 0, 1, 01}, and symbols(𝐿) = {0, 1}.
Next, 𝜓 Σ (001) = (2, 1), perm(001) = {001, 010, 100}, and perm(𝐿) = {1, 01,
10}.
For two objects, 𝑎 and 𝑏, (a, b) denotes the ordered pair consisting of 𝑎 and 𝑏 in this
order. Let 𝐴 and 𝐵 be two sets. The Cartesian product of 𝐴 and 𝐵, 𝐴 × 𝐵, is defined
as 𝐴 × 𝐵 = {(𝑎, 𝑏) | 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵}. For some 𝑛 ≥ 0, 𝐴𝑛 denotes the 𝑛-fold
Cartesian product of set 𝐴. A binary relation or, briefly, a relation, 𝜌, from 𝐴 to 𝐵 is
any subset of 𝐴 × 𝐵; that is, 𝜌 ⊆ 𝐴 × 𝐵. If 𝜌 represents a finite set, then it is a finite
relation; otherwise, it is an infinite relation. The domain of 𝜌, denoted by domain(𝜌),
and the range of 𝜌, denoted by range(𝜌), are defined as domain(𝜌) = {𝑎 | (𝑎, 𝑏) ∈
𝜌 for some 𝑏 ∈ 𝐵} and range(𝜌) = {𝑏 | (𝑎, 𝑏) ∈ 𝜌 for some 𝑎 ∈ 𝐴}. If 𝐴 = 𝐵, then
𝜌 is a relation on 𝐴. A relation 𝜎 is a subrelation of 𝜌 if 𝜎 ⊆ 𝜌. The inverse of 𝜌,
denoted by inverse(𝜌), is defined as inverse(𝜌) = {(𝑏, 𝑎) | (𝑎, 𝑏) ∈ 𝜌}. Let 𝜒 ⊆ 𝐵×𝐶
be a relation, where 𝐶 is a set; the composition of 𝜌 with 𝜒 is denoted by 𝜒 ◦ 𝜌 and
defined as 𝜒◦ 𝜌 = {(𝑎, 𝑐) | (𝑎, 𝑏) ∈ 𝜌, (𝑏, 𝑐) ∈ 𝜒}. A function from 𝐴 to 𝐵 is a relation
𝜙 from 𝐴 to 𝐵 such that for every 𝑎 ∈ 𝐴, card({𝑏 | 𝑏 ∈ 𝐵 and (𝑎, 𝑏) ∈ 𝜙}) ≤ 1.
If domain(𝜙) = 𝐴, 𝜙 is total. If we want to emphasize that 𝜙 may not satisfy
domain(𝜙) = 𝐴, we say that 𝜙 is partial.
Furthermore, we say that a function 𝜙 is
• an injection, if for every 𝑏 ∈ 𝐵, card({𝑎 | 𝑎 ∈ 𝐴 and (𝑎, 𝑏) ∈ 𝜙}) ≤ 1;
• a surjection, if for every 𝑏 ∈ 𝐵, card({𝑎 | 𝑎 ∈ 𝐴 and (𝑎, 𝑏) ∈ 𝜙}) ≥ 1;
• a bijection, if 𝜙 is a total function that is both a surjection and an injection.
As relations and functions are defined as sets, the set operations apply to them,
too. For instance, if 𝜙 ⊆ 𝐴 × 𝐵 is a function, its complement, ∼ 𝜙, is defined as
( 𝐴 × 𝐵) − 𝜙.
10 1 Mathematical Background
If there is a bijection from an infinite set Ψ to an infinite set Ξ, then Ψ and Ξ have
the same cardinality. An infinite set, Ω, is countable or, synonymously, enumerable,
if Ω and N have the same cardinality; otherwise, it is uncountable (according to
Convention 1.2, N is the set of natural numbers).
Example 1.5 Consider the set of all even natural numbers, E. Define the bijection
𝜙(𝑖) = 2𝑖, for all 𝑖 ∈ N. Observe that 𝜙 represents a bijection from N to E, so they
have the same cardinality. Thus, E is countable.
Consider the set 𝜍 of all functions mapping N to {1, 0}. By contradiction, we
prove that 𝜍 is uncountable. Suppose that 𝜍 is countable. Thus, there is a bijection
from 𝜍 to N. Let 𝑖 𝑓 be the function mapped to the 𝑖th positive integer, for all 𝑖 ≥ 1.
Consider the total function 𝑔 from N to {1, 0} defined as 𝑔( 𝑗) = 0 if and only if
𝑗 𝑓 ( 𝑗) = 1, for all 𝑖 ≥ 1, so 𝑔( 𝑗) = 1 if and only if 𝑗 𝑓 ( 𝑗) = 0. As 𝜍 contains 𝑔,
𝑔 = 𝑘 𝑓 for some 𝑘 ≥ 1. Specifically, 𝑔(𝑘) = 𝑘 𝑓 (𝑘). However, 𝑔(𝑘) = 0 if and
only if 𝑘 𝑓 (𝑘) = 1, so 𝑔(𝑘) ≠ 𝑘 𝑓 (𝑘), which contradicts 𝑔(𝑘) = 𝑘 𝑓 (𝑘). Thus, 𝜍 is
uncountable.
The proof technique by which we have demonstrated that 𝜍 is uncountable is cus-
tomarily called diagonalization. To see why, imagine an infinite table with 1 𝑓 , 2 𝑓 , . . .
listed down the rows and 1, 2, . . . listed across the columns (see Figure 1.2). Each
entry contains either 0 or 1. Specifically, the entry in row 𝑖 𝑓 and column 𝑗 contains
1 if and only if 𝑖 𝑓 ( 𝑗) = 1, so this entry contains 0 if and only if 𝑖 𝑓 ( 𝑗) = 0. A
contradiction occurs at the diagonal entry in row 𝑘 𝑓 and column 𝑘 because 𝑔(𝑘) = 0
if and only if 𝑘 𝑓 (𝑘) = 1, and 𝑔(𝑘) = 𝑘 𝑓 (𝑘); in other words, this diagonal entry
contains 0 if and only if it contains 1, which is impossible. We make use of this proof
technique several times in this book.
1 2 ··· 𝑘 ···
1𝑓 0 1 ··· 0 ···
1𝑓 1 1 ··· 1 ···
.. .. .. .. ..
. . . . .
𝑔=𝑘𝑓 0 0 ··· 0 iff 1 ···
.. .. .. .. ..
. . . . .
Example 1.6 Let Δ denote the English alphabet. The Morse code, denoted by 𝜇, can
be seen as a homomorphism from Δ∗ to {., –}∗ (see Figure 1.3). For instance,
𝜇(SOS) = . . . – – – . . .
Notice that 𝜇 is not an injection; for instance, 𝜇(SOS) = 𝜇(IJS).
We conclude this section by the next example, which demonstrates how to rep-
resent non-negative integers by strings in a very simple way. More specifically, it
12 1 Mathematical Background
introduces the function unary, which represents all non-negative integers by strings
consisting of 𝑎s. Later in this book, especially in Part III, we frequently make use of
unary.
Example 1.7 Let 𝑎 be a symbol. To represent non-negative integers by strings over
{𝑎}, define the total function unary from 0 N to {𝑎}∗ as unary(𝑖) = 𝑎 𝑖 , for all 𝑖 ≥ 0.
For instance, unary(0) = 𝜀, unary(2) = 𝑎𝑎, and unary(1000000) = 𝑎 1000000 .
1.4 Graphs
Let 𝐴 be a set. A directed graph or, briefly, a graph is a pair 𝐺 = ( 𝐴, 𝜌), where 𝜌 is a
relation on 𝐴. Members of 𝐴 are called nodes, and ordered pairs in 𝜌 are called edges.
If (𝑎, 𝑏) ∈ 𝜌, then edge (𝑎, 𝑏) leaves 𝑎 and enters 𝑏. Let 𝑎 ∈ 𝐴; then, the in-degree
of 𝑎 and the out-degree of 𝑎 are card({𝑏 | (𝑏, 𝑎) ∈ 𝜌}) and card({𝑐 | (𝑎, 𝑐) ∈ 𝜌}). A
sequence of nodes, (𝑎 0 , 𝑎 1 , . . . , 𝑎 𝑛 ), where 𝑛 ≥ 1, is a path of length 𝑛 from 𝑎 0 to
𝑎 𝑛 if (𝑎 𝑖−1 , 𝑎 𝑖 ) ∈ 𝜌 for all 1 ≤ 𝑖 ≤ 𝑛; if, in addition, 𝑎 0 = 𝑎 𝑛 , then (𝑎 0 , 𝑎 1 , . . . , 𝑎 𝑛 )
is a cycle of length 𝑛. In this book, we frequently label the edges of 𝐺 with some
attached information. Pictorially, we represent 𝐺 = ( 𝐴, 𝜌) by drawing each edge
(𝑎, 𝑏) ∈ 𝜌 as an arrow from 𝑎 to 𝑏, possibly along with its label, as illustrated in the
next example.
Example 1.8 Consider a program 𝑝 and its call graph 𝐺 = (𝑃, 𝜌), where 𝑃 represents
the set of subprograms in 𝑝, and (𝑥, 𝑦) ∈ 𝜌 iff subprogram 𝑥 calls subprogram 𝑦.
Specifically, let 𝑃 = {𝑎, 𝑏, 𝑐, 𝑑}, and 𝜌 = {(𝑎, 𝑏), (𝑎, 𝑐), (𝑏, 𝑑), (𝑐, 𝑑)}, which says
that 𝑎 calls 𝑏 and 𝑐, 𝑏 calls 𝑑, and 𝑐 calls 𝑑 as well (see Figure 1.4). The in-degree
of 𝑎 is 0, and its out-degree is 2. Notice that (𝑎, 𝑏, 𝑑) is a path of length 2 in 𝐺. 𝐺
contains no cycle because none of its paths starts and ends in the same node.
𝑏 𝑐
Suppose we use 𝐺 to study the value of a global variable during the four calls.
Specifically, we want to express that this value is zero when call (𝑎, 𝑏) occurs;
otherwise, it is one. We express this by labeling the edges of 𝐺 in the way given in
Figure 1.5.
1.4 Graphs 13
𝑎
1
0
𝑏 𝑐
1
1
𝑑
The next example illustrates both the one-dimensional odr-representation and the
two-dimensional pictorial representation of a tree. For brevity, we prefer the former
throughout the rest of this book.
Example 1.9 Graph 𝐺 discussed in Example 1.8 is acyclic. However, it is not a tree
because the in-degree of node 𝑑 is two. By removing the edge (𝑏, 𝑑), we obtain a
tree 𝑇 = (𝑃, 𝜈), where 𝑃 = {𝑎, 𝑏, 𝑐, 𝑑} and 𝜈 = {(𝑎, 𝑏), (𝑎, 𝑐), (𝑐, 𝑑)}. Nodes 𝑎 and
𝑐 are interior nodes while 𝑏 and 𝑑 are leaves. The root of 𝑇 is 𝑎. We define 𝑏 and 𝑐 as
the first child of 𝑎 and the second child of 𝑎, respectively. A parent-children portion of
𝑇 is, for instance, (𝑎, 𝑏) and (𝑎, 𝑐). Notice that frontier(𝑇) = 𝑏𝑑, and depth(𝑇) = 2.
Following (1) and (2) above, we obtain the one-dimensional representation of 𝑇 as
odr(𝑇) = 𝑎⟨𝑏𝑐⟨𝑑⟩⟩. Its subtrees are 𝑎⟨𝑏𝑐⟨𝑑⟩⟩, 𝑐⟨𝑑⟩, 𝑏, and 𝑑. In Figure 1.6, we
pictorially describe 𝑎⟨𝑏𝑐⟨𝑑⟩⟩ and 𝑐⟨𝑑⟩.
𝑏 𝑐 𝑐
𝑑 𝑑
15
16 2 Automata and Grammars
Despite a broad variety of these models introduced over the history of this science,
almost all of them are based on the same mathematical notion of a rewriting system.
In this section, we first introduce this notion quite generally. Then, we explain how
to use this model as a base of two fundamental types of language models—automata
and grammars.
Definition 2.1 A rewriting system is a pair, 𝑀 = (Σ, 𝑅), where Σ is an alphabet,
and 𝑅 is a finite relation on Σ∗ . Σ is called the total alphabet of 𝑀 or, simply, the
alphabet of 𝑀. A member of 𝑅 is called a rule of 𝑀, and accordingly, 𝑅 is referred
to as the set of rules of 𝑀.
Convention 2.1 For any rewriting system 𝑀 = (Σ, 𝑅), each rule (𝑥, 𝑦) ∈ 𝑅 is written
as 𝑥 → 𝑦 throughout this book. For 𝑥 → 𝑦 ∈ 𝑅, 𝑥 and 𝑦 represent the left-hand side
of 𝑥 → 𝑦 and the right-hand side of 𝑥 → 𝑦, respectively.
For brevity, we sometimes denote a rule 𝑥 → 𝑦 with a unique label ℎ as ℎ : 𝑥 → 𝑦,
and instead of ℎ : 𝑥 → 𝑦 ∈ 𝑅, we simply write ℎ ∈ 𝑅.
To give a straightforward insight into rewriting systems, we next illustrate them
by two linguistical examples.
Example 2.1 Let Δ denote the alphabet of English small letters (this alphabet is used
in all examples of this section). In the present example, we introduce a rewriting
system 𝑀 that translates every digital string to the string in which every digit is
converted to its corresponding English name followed by #; for instance, 010 is
translated to 𝑧𝑒𝑟𝑜#𝑜𝑛𝑒#𝑧𝑒𝑟𝑜#.
First, we define the homomorphism ℎ from {0, 1, . . . , 9} to Δ∗ as
(𝜀, 𝜀), (0, zero#), (1, one#), . . . , (9, nine#), (00, zero#zero#), (01, zero#one#), . . .
Example 2.2 This example strongly resembles a simple morphological study (in
linguistics, morphology studies the structure of words). Indeed, it discusses restruc-
turing strings consisting of English letters, including strings that do not represent
any English words, such as 𝑥𝑥𝑢𝑦. More precisely, we introduce a rewriting system
𝑀 that
(i) starts from nonempty strings consisting of small English letters delimited by
angle brackets,
(ii) orders the letters lexicographically, and
(iii) eliminates the angle brackets.
Considering the pairs from 𝑜 given above, we see that (⟨𝑜𝑟𝑑𝑒𝑟⟩, 𝑑𝑒𝑜𝑟𝑟) ∈ 𝑜∗ , so
(⟨𝑜𝑟𝑑𝑒𝑟⟩, 𝑑𝑒𝑜𝑟𝑟) ∈ 𝑇 (𝑀).
Language Models
In this section, we return to the key subject of this chapter, which consists in using
rewriting systems as language-defining models.
Given a rewriting system 𝑀 = (Σ, 𝑅) and a subalphabet Δ ⊆ Σ, we introduce a
rewriting relation ⇒ over Σ∗ . Then, based upon its transitive and reflexive closure
⇒∗ , we define the language of 𝑀 over Δ. In fact, 𝑀 can define its language in two
different ways: either 𝑀 generates its language or 𝑀 accepts it as stated next. Let
𝐿 S ⊆ Σ∗ and 𝐿 F ⊆ Σ∗ be a start language and a final language, respectively. Let
𝜋 Δ be a string projection as defined in Section 1.2.
1. The language generated by 𝑀 is defined as the set of all strings 𝜋 Δ (𝑦) satisfying
𝑥 ⇒∗ 𝑦 in 𝑀, where 𝑥 ∈ 𝐿 S and 𝑦 ∈ 𝐿 F . 𝑀 used in this way is generally
referred to as a language-generating rewriting system or, briefly and preferably,
a grammar.
2. The language accepted by 𝑀 is defined as the set of all strings 𝜋 Δ (𝑥) satisfying
𝑥 ⇒∗ 𝑦 in 𝑀, where 𝑥 ∈ 𝐿 S and 𝑦 ∈ 𝐿 F . 𝑀 used in this way is referred to as a
language-accepting rewriting system or, briefly, an automaton.
To give an intuitive insight into this definition, 𝜋 Δ (𝑦) simply eliminates all sym-
bols from Σ − Δ in any string 𝑦 ∈ Σ∗ .
2.1 Language Models of Computation 19
Example 2.3 Let Δ denote the alphabet of English lowercases. Let 𝐿 be the language
consisting of all even-length palindromes over Δ (a palindrome is a string that is the
same whether written forward or backward). For instance, 𝑎𝑎 and 𝑛𝑜𝑜𝑛 belong to 𝐿,
but 𝑏 and 𝑜𝑜 𝑝𝑠 do not.
We define the rewriting system. Let 𝑀 = (Σ, 𝑅) be the rewriting system with
Σ = Δ ∪ {#} and 𝑅 = {# → 𝑎#𝑎 | 𝑎 ∈ Δ} ∪ {# → 𝜀}.
First, we use 𝑀 to generate 𝐿. We introduce the rewriting relation ⇒𝑔𝑒𝑛 over
Σ∗ so that for every 𝑢, 𝑣 ∈ Σ∗ , 𝑢 ⇒𝑔𝑒𝑛 𝑣 if and only if 𝑢 = 𝑤𝑥𝑧, 𝑣 = 𝑤𝑦𝑧, and
𝑥 → 𝑦 ∈ 𝑅. As usual, ⇒∗𝑔𝑒𝑛 denotes the transitive and reflexive closure of ⇒𝑔𝑒𝑛 .
For language-generating rewriting system, consider 𝐿 S = {#} and 𝐿 F = Δ∗ . We
denote the language generated by 𝑀 as 𝐿 (𝑀)𝑔𝑒𝑛 and define it as
𝑛𝑜#𝑜𝑛 ⇒∗𝑎𝑐𝑐 # in 𝑀. Hence, 𝜋 Δ (𝑛𝑜#𝑜𝑛) = 𝑛𝑜𝑜𝑛 ∈ 𝐿 (𝑀) 𝑎𝑐𝑐 . On the other hand,
𝑚𝑜𝑜𝑛 ∉ 𝐿(𝑀) because (𝑚𝑜#𝑜𝑛, #) ∉ ⇒∗𝑎𝑐𝑐 . Thus, indeed, 𝐿 (𝑀) 𝑎𝑐𝑐 = 𝐿 as desired.
Strictly speaking, based upon rewriting systems, language models represent pairs.
Rarely, however, they are described in this way in language theory. Instead, we specify
them as 𝑛-tuples, for some 𝑛 ≥ 2, because this alternative specification makes them
easier to discuss. As a matter of fact, in the next two sections, all the types of language
models are introduced in this easier-to-follow way.
In general, concerning various types of language models, we say that two of them
are equivalent if both define the same language family. For instance, we introduce
pushdown automata and context-free grammars in Sections 2.2 and 2.3, respectively.
Both are equivalent because they define the same language family—the family of
context-free languages. Similarly and more specifically, two instances of language
models are considered as equivalent if both define the same language.
2.2 Automata
We start with the notion of a finite automaton, which represents a strictly finitary
model because its auxiliary memory is nil.
Definition 2.2 A general finite automaton (GFA, see [Meduna and Zemek, 2014,
Section 3.4], alternatively called lazy finite automaton as in [Wood, 1987, Section
2.2 Automata 21
𝑞 ∈ 𝛿( 𝑝, 𝑎) if and only if 𝑝𝑎 → 𝑞 ∈ 𝑅
where 𝑝, 𝑞 ∈ 𝑄 and 𝑎 ∈ Δ ∪ {𝜀}; using this 𝛿-specification, we define 𝑀 as
𝑀 = (𝑄, Δ, 𝛿, 𝑠, 𝐹)
As is obvious, all these kinds of specification are equivalent, and we interchange-
ably use them depending on what is the most appropriate and convenient notation
under the given circumstances in what follows. For instance, we work with jumping
finite automata (see Chapter 3), which are based on GFA that use the set of rules,
and we also work with jumping 5′ → 3′ Watson–Crick finite automata (see Section
4.4), which are based on FA that use the transition function.
When we want to visualize an FA 𝑀, we use its state diagram (for instance, see
Figure 2.1). The state diagram is a labeled directed graph such that nodes represent
22 2 Automata and Grammars
𝑝 1
𝑟
0 0
0
𝑠 𝜀 01
1 𝑠 𝑓
11
1
𝑞 1
𝑓
1
Note that if there is no rule starting in state 𝑝 and reading symbol 𝑎, we skip to write
𝛿( 𝑝, 𝑎) = ∅.
Let 0101 be an input string. Using 𝑀1 , the accepting computation is
Alternatively, 𝑀2 needs only three moves to accept 0101 as 𝑠0101 ⊢ 𝑠101 ⊢ 𝑠01 ⊢ 𝑓 .
Finally, we can illustrate DFA 𝑀3 with 𝐿 (𝑀3 ) = 𝐿 by the diagram in Figure 2.2.
As stated next, both FAs and GFAs have the same power.
2.2 Automata 23
0
0 0
𝑠 𝑝 𝑓 1
1 1
In the classical definition of PDA, we do not include a total alphabet, Σ, into the
list of its components, because Σ is divided into more than two subsets, such as 𝑄,
Δ, and Γ like in state grammars (see Definition 8.2).
Now, we introduce how PDA works according to its rules and what are the variants
of its final configurations to accept the input string.
the pushdown top from 𝑧 to 𝑦, and changes the current state from 𝑝 to 𝑞. Notice that
if 𝑎 = 𝜀 in the rule ( 𝑝, 𝑎, 𝑧) → (𝑞, 𝑦), then 𝑀 reads no input symbol.
In the standard way, ⊢ is extended to ⊢𝑛 , for 𝑛 ≥ 0. As usual, ⊢+ and ⊢∗ denote the
transitive closure of ⊢ and the reflexive-transitive closure of ⊢, respectively.
The language accepted by the pushdown automaton 𝑀, 𝐿 (𝑀), is defined as
𝐿(𝑀) = {𝑤 | 𝑤 ∈ Δ∗ , (𝑠, 𝑤, 𝑆) ⊢∗ ( 𝑓 , 𝜀, 𝜀), 𝑓 ∈ 𝐹}. That is, 𝑀 as a rewriting
system has 𝐿 S = {𝑠} × Δ∗ × {𝑆} and 𝐿 F = 𝐹 × {𝜀} × {𝜀} as the sets of initial and
final configurations, respectively.
In addition, we have two alternative accepting computations for a (extended)
PDA. Specifically, 𝐿 𝑒 (𝑀) = {𝑤 | 𝑤 ∈ Δ∗ , (𝑠, 𝑤, 𝑆) ⊢∗ (𝑞, 𝜀, 𝜀), 𝑞 ∈ 𝑄} and
𝐿 𝑓 (𝑀) = {𝑤 | 𝑤 ∈ Δ∗ , (𝑠, 𝑤, 𝑆) ⊢∗ ( 𝑓 , 𝜀, 𝑧), 𝑓 ∈ 𝐹}.
(𝑠, 1, $) → ( 𝑝, #$),
(𝑠, 0, $) → (𝑞, #$),
( 𝑝, 0, #) → ( 𝑝, 𝜀),
( 𝑝, 1, #) → ( 𝑝, ##),
( 𝑝, 1, $) → ( 𝑝, #$),
( 𝑝, 0, $) → (𝑞, #$),
( 𝑝, 𝜀, $) → ( 𝑓 , 𝜀),
(𝑞, 0, #) → (𝑞, ##),
(𝑞, 1, #) → (𝑞, 𝜀),
(𝑞, 1, $) → ( 𝑝, #$),
(𝑞, 0, $) → (𝑞, #$),
(𝑞, 𝜀, $) → ( 𝑓 , 𝜀).
Let 0110 be an input string. Using 𝑀 𝑃𝐷 𝐴, the accepting computation is
1, $/$#
1, #/##
0, #/𝜀
1, $/$# 𝑝 𝜀, $/𝜀
𝑠 1, $/$# 0, $/$# 𝑓
0, $/$# 𝑞 𝜀, $/𝜀
0, $/$#
0, #/##
1, #/𝜀
DNA
pairs between the upper and lower strand. The sequence built up by complementary
pairs of nucleotides are said to be double strands.
In formal languages, nucleotides are straightforwardly represented by symbols A,
T, C, and G, and strands are represented by strings of nucleotides. Finally, double
helix is represented by two strings of nucleotides written one above the other, called
double-stranded string. Bounded nucleotides, which are related in a complementarity
way, are referred to as pairs of symbols and written one above the other to represent
the correspondence and validity of such pairs. A substring of a double-stranded string
can represent a protein or gene. Chemically, every nucleotide has two ends, (1) the 5’
position corresponding to the free PO4 group and (2) the 3’ position corresponding
to the free OH group. As nucleotides are stringed together, the resulting strand has
one 3’ end and one 5’ end. In a biology environment, a strand is usually written and
read from 5’-end toward its 3’-end.
Definitions
𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹)
where 𝑄, Δ, 𝑠, and∗ 𝐹 are defined as in an FA; 𝑄 ∩ Δ = ∅, 𝜌 is a symmetric relation
on Δ, and 𝑅 ⊆ 𝑄× ΔΔ∗ ×𝑄 is a finite set of rules.
∗ ∗
A configuration of WKFA 𝑀 is a string from ΔΔ∗ 𝑄 ΔΔ∗ such that 𝑢𝑢12 𝑣𝑣12 𝑤
𝑤2 ∈
1
𝑣1 𝜀
if and only if ( 𝑝, 𝑣2 , 𝑞) ∈ 𝑅. For lucidity, substring 𝜀 can be omitted from a
configuration. Let ⊨+ and ⊨∗ denote the transitive and the reflexive-transitive closure
of ⊨, respectively.
Since 𝑀 is processing the whole DS string, let 𝐿 𝑀 (𝑀) denote the set of all DS
strings from WK𝜌 (𝑉) accepted by 𝑀. In the classical theory of languages, we are
interested in languages that are sets of strings, so in practice, we study the projection
of 𝐿 𝑀 (𝑀). Let ↑𝑉 (𝐿 𝑀 (𝑀)) = {𝑤 1 ∈ 𝑉 ∗ | 𝑤 1 ∗
𝑤2 ∈ 𝐿𝑀 (𝑀), 𝑤 2 ∈ 𝑉 }. Then, the
language accepted by WKFA 𝑀, denoted 𝐿 (𝑀), is defined as 𝐿(𝑀) = ↑𝑉 (𝐿 𝑀 (𝑀)).
Formally, the language accepted by WKFA is
n o
𝐿 (𝑀) = 𝑤 1 ∈ Δ∗ | 𝑠 𝑤
1 ∗ 𝑤1 𝑤1
𝑤2 ⊨ 𝑤2 𝑓 , 𝑓 ∈ 𝐹, 𝑤2 ∈ WK 𝜌 (Δ)
Variants of WK Models
By various restrictions placed on a set of states and the form of rules, there are four
subclasses of WKFA (see Chapter 5 in Păun et al. [1998]).
REG ⊂ WK
REG − NWK ≠ ∅
F1WK − NWK ≠ ∅
NSWK ⊂ F1WK
ALL
RE
CS
CF WK = SWK = 1WK
FWK
LIN
FSWK
NWK
F1WK
REG
NSWK
N1WK
FIN
Fig. 2.5 Chomsky hierarchy and the language families defined by WKFAs.
Subramanian et al. [2012], WKFAs are equivalent in the expressive power with WK
regular grammars, but it is still an open problem whether WK pushdown automata
Chatterjee and Ray [2017] define the language family generated by WK context-free
grammars.
2.3 Grammars
𝑥→𝑦∈𝑃
Accordingly, the set 𝑃 is according to its content called the set of rules in 𝐺. Let
𝑝 : 𝑥 → 𝑦 ∈ 𝑃 be a rule with label 𝑝, then we set lhs( 𝑝) = 𝑥 and rhs( 𝑝) = 𝑦. The
rewriting relation in 𝐺 is called direct derivation or derivation step. It is a binary
relation on Σ∗ denoted by ⇒𝐺 and defined in the following way. Let 𝑝 : 𝑥 → 𝑦 ∈ 𝑃,
𝑢, 𝑣, 𝑧 1 , 𝑧2 ∈ Σ∗ , and 𝑢 = 𝑧1 𝑥𝑧 2 , 𝑣 = 𝑧 1 𝑦𝑧2 ; then,
𝑢 𝐺⇒ 𝑣 [ 𝑝]
𝐿(𝐺) = {𝑤 ∈ Δ∗ | 𝑆 ⇒∗𝐺 𝑤}
The members of 𝐿(𝐺) are called sentences. In general, to explicitly express that
the sentences are generated by various rewritting steps, we alternatively denote the
generated language by 𝐿(𝐺, ⇒∗𝐺 ). In the literature, the unrestricted grammars are
also often defined by listing its rules of the form
𝑥 𝐴𝑦 → 𝑥𝑢𝑦
where 𝑢, 𝑥, 𝑦 ∈ Σ∗ , 𝐴 ∈ Σ−Δ (see Hopcroft and Ullman [1979]). Both definitions are
interchangeable, which means that the grammars defined in these two ways generate
the same language family—the family of recursively enumerable languages, denoted
by RE.
CF = {𝐿 (𝑀) | 𝑀 is a PDA}
𝐸 → 𝐸 𝐸,
𝐸 → 𝑎 1 𝐸𝑎 1′ ,
𝐸 → 𝑎 2 𝐸𝑎 2′ ,
..
.
𝐸 → 𝑎 𝑘 𝐸𝑎 ′𝑘 ,
𝐸→𝜀
35
36 3 Jumping One-Head Automata
Each move is made according to a computational rule that describes how the current
state is changed and whether the current input symbol is read. If the symbol is read,
the read head is shifted a square to the right. 𝐶 has one state defined as the start state
and some states designated as final states. If 𝐶 can read 𝑤 by making a sequence of
moves from the start state to a final state, 𝐶 accepts 𝑤; otherwise, 𝐶 rejects 𝑤. A
jumping finite automaton 𝐽 is conceptualized just like 𝐶. Apart from the concept, 𝐽
also works similarly to the way 𝐶 does except that 𝐽 does not read the input string
in a symbol-by-symbol and left-to-right way. Indeed, after reading a symbol, 𝐽 can
jump over a portion of the tape in either direction and goes on reading from there. It
is worth noting that once 𝐽 reads an input symbol 𝑎, 𝐽 cannot re-read it afterward;
indeed, reading 𝑎 actually means its replacement with 𝜀, so all the prefixes preceding
𝑎 and all the suffixes following 𝑎 join each other after this erasure.
This chapter concentrates on jumping finite automata with a single read head while
leaving a discussion of their multi-head versions to the next chapter. The present
chapter demonstrates several key results about jumping one-head finite automata in
terms of many commonly studied areas of formal language theory. Perhaps most
importantly, it studies differences between them and their classical counterparts. As
a whole, it gives a systematic body of knowledge concerning jumping one-head finite
automata. At the same time, however, it points out several open questions regarding
them, which may represent a new, attractive, and significant investigation area of
automata theory in the future.
Synopsis
The chapter is divided into two sections. Section 3.1 formalizes and illustrates jump-
ing finite automata and demonstrates their fundamental properties. Most importantly,
it compares their power with the power of other well-known language-defining for-
mal devices. In addition, this section establishes basic closure properties of the
language families defined by them. In addition, it establishes an infinite hierarchy of
language families resulting from these automata, one-directional jumps and various
start configurations. Section 3.2 describes right one-way jumping finite automata as
both natural and deterministic modification of jumping finite automata with right
jumps as studied in Section 3.1.
𝑥 𝑤 𝑧 𝑥 𝑧
𝑝 𝑞
𝑥 𝑧 𝑥 𝑧
𝑝 𝑞
Figures 3.1 and 3.2 schematize jumps in a GJFA and a JFA, respectively. More
specifically, these figures illustrate right jumps, where 𝑥, 𝑤, 𝑧 are strings, and 𝑎, 𝑏, 𝑐, 𝑑
are symbols.
𝑝𝑦 1 𝑦 2 · · · 𝑦 𝑛 ⇝ 𝑞
Starting from 𝑠, 𝑀 has to read some 𝑎, some 𝑏, and some 𝑐, entering again the start
(and also the final) state 𝑠 (see also Figure 3.3). All these occurrences of 𝑎, 𝑏, and 𝑐
can appear anywhere in the input string. Therefore, the accepted language is clearly
𝑎
𝑠 𝑟
𝑐 𝑏
𝑡
where
𝑅 = 𝑠𝑏𝑎 → 𝑓 , 𝑓 𝑎 → 𝑓 , 𝑓 𝑏 → 𝑓
Starting from 𝑠, 𝑀 has to read string 𝑏𝑎, which can appear anywhere in the input
string. Then, it can read an arbitrary number of symbols 𝑎 and 𝑏, including no
symbols. Therefore, the accepted language is 𝐿(𝑀, ↷) = {𝑎, 𝑏}∗ {𝑏𝑎}{𝑎, 𝑏}∗ .
3.1 Basic and Generalized Jumping Finite Automata 39
In fact, it is easy to see that several other languages over Δ belong to GJFA such
as
(i) Δ∗ 𝑢Δ∗ where 𝑢 ∈ Δ∗ (a generalization of Example 3.2);
(ii) any semi-Dyck language 𝐷 𝑘 , for 𝑘 ≥ 1 (for the definition, see Example 2.9, and
for the proof see Example 5.3 or Vorel [2018]).
Throughout the rest of this chapter, GJFA, GJFA− 𝜀 , JFA, JFA− 𝜀 , and DJFA denote
the families of languages accepted by GJFAs, 𝜀-free GJFAs, JFAs, 𝜀-free JFAs, and
DJFAs, respectively.
Properties
In this section, we discuss the generative power of GJFAs and JFAs and some other
basic properties of these automata.
Theorem 3.1 For every DJFA 𝑀, there is a CJFA 𝑀 ′ such that 𝐿(𝑀, ↷) =
𝐿(𝑀 ′ , ↷).
Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a DJFA. We next construct a CJFA 𝑀 ′ such
that 𝐿 (𝑀, ↷) = 𝐿(𝑀 ′ , ↷). Without any loss of generality, we assume that ⊥ ∉ 𝑄.
Initially, set
𝑀 ′ = 𝑄 ∪ {⊥}, Δ, 𝑅 ′ , 𝑠, 𝐹
where 𝑅 ′ = 𝑅. Next, for each 𝑎 ∈ Δ and each 𝑝 ∈ 𝑄 such that 𝑝𝑎 → 𝑞 ∉ 𝑅 for all
𝑞 ∈ 𝑄, add 𝑝𝑎 → ⊥ to 𝑅 ′ . For each 𝑎 ∈ Δ, add ⊥𝑎 → ⊥ to 𝑅 ′ . Clearly, 𝑀 ′ is a
CJFA and 𝐿(𝑀, ↷) = 𝐿(𝑀 ′ , ↷). □
Lemma 3.1 For every GJFA 𝑀 of degree 𝑛 ≥ 0, there is an 𝜀-free GJFA 𝑀 ′ of
degree 𝑛 such that 𝐿 (𝑀 ′ , ↷) = 𝐿(𝑀, ↷).
Proof This lemma can be demonstrated by using the standard conversion of finite
automata to 𝜀-free finite automata (see [Meduna, 2000, Algorithm 3.2.2.3]). □
Theorem 3.2 GJFA = GJFA− 𝜀
Proof GJFA− 𝜀 ⊆ GJFA follows from the definition of a GJFA (see Def. 3.1).
GJFA ⊆ GJFA− 𝜀 follows from Lemma 3.1. □
Theorem 3.3 JFA = JFA− 𝜀 = DJFA
Proof JFA = JFA− 𝜀 can be proved by analogy with the proof of Theorem 3.2, so
we only prove that JFA− 𝜀 = DJFA. DJFA ⊆ JFA− 𝜀 follows from the definition of
a DJFA (see Def. 3.3). The converse inclusion can be proved by using the standard
technique of converting 𝜀-free finite automata to deterministic finite automata (see
[Meduna, 2000, Algorithm 3.2.3.1]). □
40 3 Jumping One-Head Automata
The next theorem shows a property of languages accepted by GJFAs with unary
input alphabets.
Theorem 3.4 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA such that card(Δ) = 1. Then,
𝐿(𝑀, ↷) is regular.
Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA such that card(Δ) = 1. Since card(Δ) = 1,
without any loss of generality, we can assume that the acceptance process for 𝑤 ∈ Δ∗
starts from the configuration 𝑠𝑤 and 𝑀 does not jump over any symbols. Therefore,
we can treat 𝑀 as an equivalent general finite automaton defined just like an ordinary
finite automaton except that it can read a string, not just a symbol, during a single
move (see [Meduna and Zemek, 2014, Definition 3.4.1]). As general finite automata
accept only regular languages (see [Meduna and Zemek, 2014, Theorem 3.4.4]),
𝐿(𝑀, ↷) is regular. □
As a consequence of Theorem 3.4, we obtain the following corollary (recall that
𝐾 below is not regular).
Corollary 3.1 The language 𝐾 = {𝑎 𝑝 | 𝑝 is a prime number} cannot be accepted by
any GJFA.
The following theorem gives a necessary condition for a language to be in JFA.
Theorem 3.5 Let 𝐾 be an arbitrary language. Then, 𝐾 ∈ JFA only if 𝐾 = perm(𝐾).
Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a JFA. Without any loss of generality, we assume
that 𝑀 is a DJFA (recall that JFA = DJFA by Theorem 3.3). Let 𝑤 ∈ 𝐿(𝑀, ↷). We
next prove that perm(𝑤) ⊆ 𝐿(𝑀, ↷). If 𝑤 = 𝜀, then perm(𝜀) = 𝜀 ∈ 𝐿(𝑀, ↷), so
we assume that 𝑤 ≠ 𝜀. Then, 𝑤 = 𝑎 1 𝑎 2 · · · 𝑎 𝑛 , where 𝑎 𝑖 ∈ Δ for all 𝑖 = 1, . . . , 𝑛, for
some 𝑛 ≥ 1. Since 𝑤 ∈ 𝐿 (𝑀, ↷), 𝑅 contains
𝑠𝑎 𝑖1 → 𝑠𝑖1
𝑠𝑖1 𝑎 𝑖2 → 𝑠𝑖2
..
.
𝑠𝑖𝑛−1 𝑎 𝑖𝑛 → 𝑠𝑖𝑛
The next theorem gives both a necessary and sufficient condition for a language
to be accepted by a JFA.
Proof The proof is divided into the only-if part and the if part.
Only If. Let 𝑀 be a JFA. Consider 𝑀 as a finite automaton 𝑀 ′ . Set 𝐾 = 𝐿 (𝑀 ′ ). 𝐾
is regular, and 𝐿 (𝑀, ↷) = perm(𝐾). Hence, the only-if part holds.
If. Take perm(𝐾), where 𝐾 is any regular language. Let 𝐾 = 𝐿 (𝑀), where 𝑀 is
a finite automaton. Consider 𝑀 as a JFA 𝑀 ′ . Observe that 𝐿 (𝑀 ′ , ↷) = perm(𝐾),
which proves the if part of the proof. □
Inspired by the pumping lemma for regular languages, we can formulate corre-
sponding lemma for JFAs.
Lemma 3.2 (Chigahara et al. [2016]) For any language 𝐿 over an alphabet Δ
(card(Δ) = 𝑛) accepted by a JFA, there exists a constant 𝑘 such that for all strings
𝑤 ∈ 𝐿 with |𝑤| ≥ 𝑘 and Parikh image 𝜓 Δ (𝑤) = (𝑚 1 , 𝑚 2 , . . . , 𝑚 𝑛 ) there exists a
vector (𝑡1 , 𝑡2 , . . . , 𝑡 𝑛 ) which satisfies the following criteria:
(1) 𝑡 𝑖 ≤ 𝑚 𝑖 , for all 𝑖 with 1 ≤ 𝑖 ≤ 𝑛;
Í𝑛
(2) 𝑖=1 𝑡 𝑛 ≤ 𝑘;
(3) all strings with Parikh vector (𝑚 1 + 𝑖 · 𝑡 1 , 𝑚 2 + 𝑖 · 𝑡2 , . . . , 𝑚 𝑛 + 𝑖 · 𝑡 𝑛 ) are in 𝐿, for
all integers 𝑖 ≥ −1.
As opposed to the standard versions of FAs and GFAs, which are equally powerful
(see Theorem 2.1), we next show that GJFAs are stronger than JFAs.
Proof JFA ⊆ GJFA follows from the definition of a JFA (see Definition 3.2). From
Corollary 3.3, GJFA − JFA ≠ ∅, because {𝑎, 𝑏}∗ {𝑏𝑎}{𝑎, 𝑏}∗ is accepted by the
GJFA from Example 3.2. □
Theorem 3.6 gives a necessary and sufficient condition concerning the member-
ship of any language in JFA. Concerning GJFA, however, so far, only a necessary
condition has been achieved (see Vorel [2018]).
Open Problem Is there a necessary and sufficient condition for a language to be
in GJFA? □
42 3 Jumping One-Head Automata
In this section, we establish relationships between GJFA, JFA, and some well-known
language families, including FIN, REG, CF, and CS.
Proof Let 𝐾 ∈ FIN. Since 𝐾 is a finite, there exists 𝑛 ≥ 0 such that card(𝐾) = 𝑛.
Therefore, we can express 𝐾 as 𝐾 = {𝑤 1 , 𝑤 2 , . . . , 𝑤 𝑛 }. Define the GJFA
𝑀 = {𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }
Proof (by contradition) Let 𝐾 = {𝑎}∗ {𝑏}∗ . For the sake of contradiction, assume
that there is a GJFA, 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹), such that 𝐿 (𝑀, ↷) = 𝐾. Let 𝑤 = 𝑎 𝑛 𝑏,
where 𝑛 is the degree of 𝑀. Since 𝑤 ∈ 𝐾, during an acceptance of 𝑤, a rule,
𝑝𝑎 𝑖 𝑏 → 𝑞 ∈ 𝑅, where 𝑝, 𝑞 ∈ 𝑄 and 0 ≤ 𝑖 < 𝑛, has to be used. However, then 𝑀 also
accepts from the configuration 𝑎 𝑖 𝑏𝑠𝑎 𝑛−𝑖 . Indeed, as 𝑎 𝑖 𝑏 is read in a single step, and
all the other symbols in 𝑤 are just 𝑎s, 𝑎 𝑖 𝑏𝑎 𝑛−𝑖 may be accepted by using the same
rules as during an acceptance of 𝑤. This implies that 𝑎 𝑖 𝑏𝑎 𝑛−𝑖 ∈ 𝐾—a contradiction
with the assumption that 𝐿 (𝑀, ↷) = 𝐾. Therefore, there is no GJFA that accepts
{𝑎}∗ {𝑏}∗ . □
Proof GJFA ⊈ REG follows from Example 3.1. REG ⊈ GJFA follows from
Lemma 3.3. □
Proof GJFA ⊈ CF follows from Example 3.1, and CF ⊈ GJFA follows from
Lemma 3.3. □
Proof JFA ⊈ FIN follows from Example 3.1. Consider the finite language 𝐾 =
{𝑎𝑏}. By Theorem 3.5, 𝐾 ∉ JFA, so FIN ⊈ JFA. □
3.1 Basic and Generalized Jumping Finite Automata 43
Closure Properties
In this section, we show the closure properties of the families GJFA and JFA under
various operations. The basic study is to be found in Meduna and Zemek [2012] and
Vorel [2016, 2017, 2018] that continue the investigation of decidability and closure
properties.
Theorem 3.13 Both GJFA and JFA are not closed under endmarking.
Proof Consider the language 𝐾 = {𝑎}∗ . Clearly, 𝐾 ∈ JFA. A proof that no GJFA
accepts 𝐾 {#}, where # is a symbol such that # ≠ 𝑎, can be made by analogy with
the proof of Lemma 3.3. □
Theorem 3.13 implies that both families are not closed under concatenation.
Indeed, observe that the JFA
𝑀 = {𝑠, 𝑓 }, {#}, {𝑠# → 𝑓 }, 𝑠, { 𝑓 }
accepts {#}.
Corollary 3.5 Both GJFA and JFA are not closed under concatenation.
To see that 𝐿(𝐻) = (𝐿(𝑀1 , ↷), 𝐿(𝑀2 , ↷)), observe how 𝐻 works. On an input
E
string, 𝑤 ∈ (Δ1 ∪ Δ2 ) ∗ , 𝐻 first runs 𝑀1 on 𝑤, and if it ends in a final state, then it runs
𝑀2 on the rest of the input. If 𝑀2 ends in a final state, 𝐻 accepts 𝑤. Otherwise, it
rejects 𝑤. By Theorem 3.5, 𝐿(𝑀𝑖 , ↷) = perm(𝐿(𝑀𝑖 , ↷)) for all 𝑖 ∈ {1, 2}. Based
on these observations, since 𝐻 can jump anywhere after a symbol is read, we see that
𝐿(𝐻) = (𝐿(𝑀1 , ↷), 𝐿(𝑀2 , ↷)). In addition, as proved in Fernau et al. [2017],
E
the power of JFAs coincide to 𝛼-SHUF expressions so JFA is closed under iterated
shuffle as well. □
Notice that the construction used in the previous proof coincides with the standard
construction of a concatenation of two finite automata (see Meduna [2000]).
Theorem 3.15 (Fernau et al. [2017]) If 𝐿 ∈ JFA, then 𝐿 is closed under permuta-
tion, i.e., 𝐿 = perm(𝐿).
Theorem 3.16 Both GJFA and JFA are closed under union.
Clearly, 𝐿(𝐻) = 𝐿 (𝑀1 , ↷) ∪ 𝐿 (𝑀2 , ↷), and if both 𝑀1 and 𝑀2 are JFAs, then 𝐻
is also a JFA. □
Proof Consider the GJFA 𝑀 from Example 3.2. Observe that the complement
of 𝐿 (𝑀, ↷) (with respect to {𝑎, 𝑏}∗ ) is {𝑎}∗ {𝑏}∗ , which cannot be accepted by any
GJFA (see Lemma 3.3). □
𝑀 ′ = 𝑄, Δ, 𝑅, 𝑠, 𝑄 − 𝐹
Proof Consider any 𝑀 = ({𝑠, 𝑓 }, {𝑎, 𝑏}, {𝑠𝑏𝑎 → 𝑠, 𝑠𝑎𝑏 → 𝑓 }, 𝑠, { 𝑓 }) and any
semi-Dyck language 𝐷 1 ∈ GJFA (see Example 3.2). Observe that 𝐷 1 ∩ 𝐿(𝑀, ↷) =
{𝑎𝑏}∗ , which is out of GJFA by Lemma 3.4. □
Theorem 3.19 Both GJFA and JFA are not closed under intersection with regular
languages.
Proof Consider the language 𝐽 = {𝑎, 𝑏}∗ , which can be accepted by both GJFAs and
JFAs. Consider the regular language 𝐾 = {𝑎}∗ {𝑏}∗ . Since 𝐽 ∩ 𝐾 = 𝐾, this theorem
follows from Lemma 3.3. □
Proof Let 𝐾 ∈ JFA. Since perm(𝑤) ⊆ 𝐾 by Theorem 3.5 for all 𝑤 ∈ 𝐾, also
reversal(𝑤) ∈ 𝐾 for all 𝑤 ∈ 𝐾, so the theorem holds. □
Theorem 3.21 JFA is not closed under Kleene star or under Kleene plus.
3.1 Basic and Generalized Jumping Finite Automata 45
Proof Consider the language 𝐾 = {𝑎𝑏, 𝑏𝑎}, which is accepted by the JFA
𝑀 = {𝑠, 𝑟, 𝑓 }, {𝑎, 𝑏}, {𝑠𝑎 → 𝑟, 𝑟𝑏 → 𝑓 }, 𝑠, { 𝑓 }
However, by Theorem 3.5, there is no JFA that accepts 𝐾 ∗ or 𝐾 + (notice that, for
example, 𝑎𝑏𝑎𝑏 ∈ 𝐾 + , but 𝑎𝑎𝑏𝑏 ∉ 𝐾 + ). □
Lemma 3.5 There is no GJFA that accepts {𝑎}∗ {𝑏}∗ ∪ {𝑏}∗ {𝑎}∗ .
Proof This lemma can be proved by analogy with the proof of Lemma 3.3. □
Theorem 3.22 Both GJFA and JFA are not closed under substitution.
Proof Consider the language 𝐾 = {𝑎𝑏, 𝑏𝑎}, which is accepted by the JFA 𝑀 from
the proof of Theorem 3.21. Define the substitution 𝜎 from {𝑎, 𝑏}∗ to power({𝑎, 𝑏}∗ )
as 𝜎(𝑎) = {𝑎}∗ and 𝜎(𝑏) = {𝑏}∗ . Clearly, both 𝜎(𝑎) and 𝜎(𝑏) can be accepted by
JFAs. However, 𝜎(𝐾) cannot be accepted by any GJFA (see Lemma 3.5). □
Since the substitution 𝜎 in the proof of Theorem 3.22 is regular, we obtain the
following corollary.
Corollary 3.8 Both GJFA and JFA are not closed under regular substitution.
Proof Define the 𝜀-free homomorphism 𝜙 from {𝑎} to {𝑎, 𝑏}+ as 𝜙(𝑎) = 𝑎𝑏, and
consider the language {𝑎}∗ , which is accepted by the JFA
𝑀 = {𝑠}, {𝑎}, {𝑠𝑎 → 𝑠}, {𝑠}
Notice that 𝜙(𝐿(𝑀, ↷)) = {𝑎𝑏}∗ , which cannot be accepted by any JFA (see
Corollary 3.2).
The analogous result was proved for GJFAs in Vorel [2018].
Theorem 3.24 ([Vorel, 2018, Theorem 14]) GJFA is not closed under 𝜀-free ho-
momorphism.
Corollary 3.9 GJFA and JFA are not closed under homomorphism.
Corollary 3.10 GJFA and JFA are not closed under finite substitution.
where
𝑅 ′ = 𝑝𝑎 → 𝑞 | 𝑎 ∈ Δ′ , 𝑝𝜙(𝑎) ⇝ 𝑞 in Γ(𝑀)
Theorem 3.26 ([Vorel, 2018, Theorem 15]) GJFA is not closed under inverse
homomorphism.
Moreover, in Vorel [2018] it was shown that GJFA is not close under shuffle,
Kleene star, and Kleene plus, while it is closed under reversal.
Theorem 3.27 ([Vorel, 2018, Theorem 14 and Theorem 16]) GJFA is not closed
under shuffle, Kleene star, and Kleene plus.
Theorem 3.28 ([Vorel, 2018, Theorem 18]) GJFA is closed under reversal.
The summary of closure properties of the families GJFA and JFA is given in
Table 3.1, where + marks closure and − marks non-closure. It is worth noting that
REG, characterized by finite automata, is closed under all of these operations.
GJFA JFA
endmarking − −
concatenation − −
shuffle − +
union + +
complement − +
intersection − +
int. with regular languages − −
Kleene star − −
Kleene plus − −
mirror image + +
substitution − −
regular substitution − −
finite substitution − −
homomorphism − −
𝜀-free homomorphism − −
inverse homomorphism − +
Decidability
In this section, we prove the decidability of some decision problems with regard
to GJFA and JFA.
Proof If. Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA such that 𝑝𝑦 ⇝ 𝑝 in Γ(𝑀), for some
𝑦 ∈ Δ+ and 𝑝 ∈ 𝑄 such that 𝑝 is both reachable and terminating in Γ(𝑀). Then,
𝑤 1 𝑠𝑤 2 ↷∗ 𝑢 𝑝𝑣 ↷+ 𝑥 𝑝𝑧 ↷∗ 𝑓
𝑤 1 𝑠𝑤 2 ↷∗ 𝑢 𝑝𝑣𝑦 ′ ↷+ 𝑥 𝑝𝑧 ↷∗ 𝑓
𝑤 1 𝑠𝑤 2 ↷∗ 𝑢 𝑝𝑣 ↷+ 𝑥 𝑝𝑧 ↷∗ 𝑓
Theorem 3.29 Both finiteness and infiniteness are decidable for GJFA.
Corollary 3.11 Both finiteness and infiniteness are decidable for JFA.
Ψ = (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 ) | 𝑥𝑖 ∈ Δ+ , 1 ≤ 𝑖 ≤ 𝑛, 𝑥1 𝑥2 · · · 𝑥 𝑛 = 𝑥, 𝑛 ≥ 1
and
Ψ 𝑝 = (𝑦 1 , 𝑦 2 , . . . , 𝑦 𝑛 ) | (𝑥 1 , 𝑥2 , . . . , 𝑥 𝑛 ) ∈ Ψ, 𝑛 ≥ 1, (𝑦 1 , 𝑦 2 , . . . , 𝑦 𝑛 ) is
a permutation of (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 )
GJFA JFA
membership + +
emptiness + +
finiteness + +
infiniteness + +
The summary of decidability properties of the families GJFA and JFA is given
in Table 3.2, where + marks decidability. Further, Fernau et al. [2017] presents
several results concerning computational hardness and algorithms for parsing and
other basic tasks concerning JFAs and GJFAs.
In addition, Beier et al. [2017, 2019] study their operational state complexity and
decidability of JFAs; in addition, these studies relate JFAs to semilinear sets and
Parikh images of regular sets.
Lemma 3.7 Let Δ be an alphabet such that card(Δ) ≥ 2. Then, for any 𝑛 ≥ 1, there
is a GJFA of degree 𝑛, 𝑀𝑛 = (𝑄, Δ, 𝑅, 𝑠, 𝐹), such that 𝐿 (𝑀𝑛 , ↷) cannot be accepted
by any GJFA of degree 𝑛 − 1.
Proof Let Δ be an alphabet such that card(Δ) ≥ 2, and let 𝑎, 𝑏 ∈ Δ such that
𝑎 ≠ 𝑏. The case when 𝑛 = 1 follows immediately from the definition of a JFA (see
Definition 3.2), so we assume that 𝑛 ≥ 2. Define the GJFA of degree 𝑛
𝑀𝑛 = {𝑠, 𝑓 }, Δ, {𝑠𝑤 → 𝑓 }, 𝑠, { 𝑓 }
where 𝑤 = 𝑎𝑏(𝑎) 𝑛−2 . Clearly, 𝐿 (𝑀𝑛 , ↷) = {𝑤}. We next prove that 𝐿 (𝑀𝑛 , ↷)
cannot be accepted by any GJFA of degree 𝑛 − 1.
Suppose, for the sake of contradiction, that there is a GJFA of degree 𝑛 − 1,
𝐻 = (𝑄, Δ, 𝑅, 𝑠′ , 𝐹), such that 𝐿(𝐻) = 𝐿(𝑀𝑛 , ↷). Without any loss of generality,
we assume that 𝐻 is 𝜀-free (see Lemma 3.1). Since 𝐿 (𝐻) = 𝐿 (𝑀𝑛 , ↷) = {𝑤} and
|𝑤| > 𝑛 − 1, there has to be
𝑢𝑠′ 𝑥𝑣 ↷𝑚 𝑓
in 𝐻, where 𝑤 = 𝑢𝑥𝑣, 𝑢, 𝑣 ∈ Δ∗ , 𝑥 ∈ Δ+ , 𝑓 ∈ 𝐹, and 𝑚 ≥ 2. Thus,
𝑠′ 𝑥𝑢𝑣 ↷𝑚 𝑓
and
𝑢𝑣𝑠′ 𝑥 ↷𝑚 𝑓
in 𝐻, which contradicts the assumption that 𝐿(𝐻) = {𝑤}. Therefore, 𝐿 (𝑀𝑛 , ↷)
cannot be accepted by any GJFA of degree 𝑛 − 1. □
Proof GJFA𝑛 ⊆ GJFA𝑛+1 follows from the definition of a GJFA of degree 𝑛 (see
Def. 3.2), for all 𝑛 ≥ 0. From Lemma 3.7, GJFA𝑛+1 − GJFA𝑛 ≠ ∅, which proves
the theorem. □
Taking Lemma 3.1 into account, we obtain the following corollary of Theo-
rem 3.32.
𝑤𝑥 𝑝𝑦𝑧 𝑙 ↷ 𝑤𝑞𝑥𝑧
50 3 Jumping One-Head Automata
𝑤 𝑝𝑦𝑥𝑧 𝑟 ↷ 𝑤𝑥𝑞𝑧
and
= 𝑢𝑣 | 𝑢, 𝑣 ∈ Δ∗ , 𝑢𝑠𝑣 𝑟 ↷∗ 𝑓 with 𝑓 ∈ 𝐹
𝑟 𝐿(𝑀, ↷)
Let 𝑙 GJFA, 𝑙 JFA, 𝑟 GJFA, and 𝑟 JFA denote the families of languages accepted
by GJFAs using only left jumps, JFAs using only left jumps, GJFAs using only right
jumps, and JFAs using only right jumps, respectively.
Proof We first prove that 𝑟 JFA = REG. Consider any JFA, 𝑀 = (𝑄, Δ, 𝑅, 𝑠,
𝐹). Observe that if 𝑀 occurs in a configuration of the form 𝑥 𝑝𝑦, where 𝑥 ∈ Δ∗ ,
𝑝 ∈ 𝑄, and 𝑦 ∈ Δ∗ , then it cannot read the symbols in 𝑥 anymore because 𝑀 can
make only right jumps. Also, observe that this covers the situation when 𝑀 starts to
accept 𝑤 ∈ Δ∗ from a different configuration than 𝑠𝑤. Therefore, to read the whole
input, 𝑀 has to start in configuration 𝑠𝑤, and it cannot jump to skip some symbols.
Consequently, 𝑀 behaves like an ordinary finite automaton, reading the input from
the left to the right, so 𝐿(𝑀, ↷) is regular and, therefore, 𝑟 JFA ⊆ REG. Conversely,
any finite automaton can be viewed as a JFA that starts from configuration 𝑠𝑤 and
does not jump to skip some symbols. Therefore, REG ⊆ 𝑟 JFA, which proves that
𝑟 JFA = REG. 𝑟 GJFA = REG can be proved by the same reasoning using general
finite automata instead of finite automata. □
Next, we show that JFAs using only left jumps accept some non-regular languages.
where
𝑅 = 𝑠𝑎 → 𝑝, 𝑝𝑏 → 𝑠, 𝑠𝑏 → 𝑞, 𝑞𝑎 → 𝑠
We argue that
𝑙 𝐿(𝑀, ↷) = 𝑤 | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)
With 𝑤 ∈ {𝑎, 𝑏}∗ on its input, 𝑀 starts over the last symbol. 𝑀 reads this symbol
by using 𝑠𝑎 → 𝑝 or 𝑠𝑏 → 𝑞, and jumps to the left in front of the rightmost
3.1 Basic and Generalized Jumping Finite Automata 51
Open Problem Study the effect of left jumps to the acceptance power of JFAs and
GJFAs. □
Figure 3.4 summarizes the achieved results on jumping automata in this chapter.
CS
CF
GJFA = GJFA−ε
r GJFA = r JFA REG GJFAn
..
.
GJFA2
Fig. 3.4 Relationships between JFA, GJFA, and the Chomsky hierarchy.
52 3 Jumping One-Head Automata
In general, a GJFA can start its computation anywhere in the input string (see
Definition 3.1). In this section, we consider the impact of various start configurations
on the acceptance power of GJFAs and JFAs.
𝑀 ′ = 𝑄, Δ, 𝑅 ∪ {𝑠 → 𝑠}, 𝑠, 𝐹
satisfies 𝑏 𝐿(𝐻) = 𝐾. However, observe that 𝑎 𝐿(𝐻) = {𝑏}∗ {𝑎}{𝑏}∗ , which differs
from 𝐾. By Theorem 3.5, for every JFA 𝑁, it holds that 𝑎 𝐿(𝑁) ≠ 𝐾. Hence,
𝑎
JFA ⊂ 𝑏 JFA. □
Proof This theorem can be proved by analogy with the proof of Theorem 3.35. □
𝑀 ′ = 𝑄, Δ, 𝑅 ∪ {𝑠 → 𝑠}, 𝑠, 𝐹
𝑀 ′′ = {𝑠}, Δ, ∅, 𝑠, {𝑠}
𝑅ˆ = 𝑅 − 𝑠𝑢 → 𝑞 | 𝑢 ∈ Δ+ , 𝑞 ∈ 𝑄, and there is no 𝑥 ∈ Δ+
The reason for excluding such 𝑠𝑢 → 𝑞 from 𝑅ˆ is that 𝑀 first has to use a rule of the
form 𝑠 → 𝑝, where 𝑝 ∈ 𝑄 (see the argumentation above). However, since 𝑀ˆ starts
anywhere in the input string, we need to force it to use 𝑠 → 𝑝 as the first rule, thus
changing the state from 𝑠 to 𝑝, just like 𝑀 does.
𝑎
Clearly, 𝑀ˆ is of degree 𝑛 and satisfies 𝑒 𝐿(𝑀, ↷) = 𝐿( 𝑀),
ˆ so the lemma holds.□
Proof Theorem 3.33, in fact, states that 𝑟𝑎 GJFA = 𝑟𝑎 JFA = REG. Furthermore,
𝑏 𝑏
𝑟 GJFA = 𝑟 JFA = REG follows from the proof of Theorem 3.33 because 𝑀 has
to start the acceptance process of a string 𝑤 from the configuration 𝑠𝑤—that is, it
starts at the beginning of 𝑤. 𝑙𝑏 GJFA = 𝑙𝑏 JFA = REG can be proved analogously. □
54 3 Jumping One-Head Automata
Open Problems
Within the previous sections, we have already pointed out several specific open
problems concerning them. We close the present chapter by pointing out some
crucially important open problem areas as suggested topics of future investigations.
(I) Concerning closure properties, study the closure of GJFA under shuffle, Kleene
star, Kleene plus, and under reversal.
(II) Regarding decision problems, investigate other decision properties of GJFA
and JFA, like equivalence, universality, inclusion, or regularity. Furthermore,
study their computational complexity. Do there exist undecidable problems
for GJFA or JFA?
(III) Section 3.1 has demonstrated that GJFAs and JFAs using only right jumps
define the family of regular languages. How precisely do left jumps affect the
acceptance power of JFAs and GJFAs?
(IV) Broaden the results of Section 3.1 concerning various start configurations by
investigating the properties of 𝑙𝑒 GJFA and 𝑙𝑒 JFA.
(V) Determinism represents a crucially important investigation area in terms of all
types of automata. In essence, the nondeterministic versions of automata can
make several different moves from the same configuration while their deter-
ministic counterparts cannot—that is, they make no more than one move from
any configuration. More specifically, the deterministic version of classical finite
automata require that for any state 𝑞 and any input symbol 𝑎, there exists no
more than one rule with 𝑞𝑎 on its left-hand side; in this way, they make no more
than one move from any configuration. As a result, with any input string 𝑤, they
make a unique sequence of moves. As should be obvious, in terms of jumping
finite automata, this requirement does not guarantee their determinism in the
above sense. Modify the requirement so it guarantees the determinism.
As pointed out in Fernau et al. [2015, 2017], there exist several formalisms that
characterize GJFA and JFA including shuffle expressions, 𝛼-shuffle expressions,
3.2 One-Way Jumping Finite Automata 55
At a first and somewhat hasty glance, the definitions of the previous two models might
produce a wrong impression that jumping models always work in an inherently
nondeterministic way. However, this is not the case at all as demonstrated, for
instance, by one-way jumping finite automata introduced in Chigahara et al. [2015,
2016].
Although in many respects, one-way jumping finite automata make their jumps
similarly to the way JFAs do, these jumps are performed in a slightly different
manner, which subsequently implies their determinism. To explain this determinism,
consider any one-way jumping finite automaton, 𝑀. Concerning an individual jump
performance in 𝑀 on a tape containing some symbols, there are three situations to
be distinguished—(1) if a rule is defined for the current state and input symbol, it
is applied there; otherwise, (2) the reading head jumps to the right to the nearest
possible symbol where a rule is applicable; and (3) if no symbol like this occurs on
the tape, 𝑀 gets stuck. Starting from the input tape beginning, 𝑀 performs jumps
in the way sketched above only in one direction from left to right on its cyclic tape
(see Figure 3.5), possibly skipping over some of its parts. This reading process is
cyclically repeated over the tape until 𝑀 either reads all the symbols, thus accepting
the input string, or gets stuck, thus rejecting the input. As a result, 𝑀 works in an
utterly deterministic way.
Let us now formally define two types of one-way jumping finite automata.
𝑝𝑥𝑎𝑦 ⟳ 𝑞𝑦𝑥
if 𝑥 ∈ (Δ − Δ 𝑝 ) ∗ where Δ 𝑝 = {𝑏 ∈ Δ | 𝑝𝑏 → 𝑏 ∈ 𝑅}. A right one-way jump is
illustrated in Figure 3.5. In the standard manner, we extend ⟳ to ⟳𝑚 where 𝑚 ≥ 0,
⟳+ and ⟳∗ . The language accepted by 𝑀, denoted by 𝐿(𝑀, ⟳), is defined as
𝑝
𝑑 𝑑
𝑒
𝑒
⟳ 𝑝
𝑏
𝑏
𝑎 𝑐
𝑐
𝑦𝑎𝑥 𝑝 ⟲ 𝑥𝑦𝑞
)∗
if 𝑥 ∈ (Δ − Δ 𝑝 where Δ 𝑝 = {𝑏 ∈ Δ | 𝑝𝑏 → 𝑏 ∈ 𝑅}.
In a straightforward analogy with a ROWJFA, we can define ⟲𝑚 where 𝑚 ≥ 0,
⟲+ , ⟲∗ , and 𝐿 (𝑀).
Example 3.3 Let a ROWJFA 𝑀 = ({𝑠, 𝑓 }, {𝑎, 𝑏}, 𝑅, 𝑠, {𝑠, 𝑓 }), where 𝑅 consists of
3.2 One-Way Jumping Finite Automata 57
𝑠𝑎 → 𝑠, 𝑠𝑏 → 𝑓 , 𝑓 𝑏 → 𝑓
𝑀 works on 𝑎𝑎𝑏 as follows
𝑠𝑎𝑎𝑏 ⟳ 𝑠𝑎𝑏 ⟳ 𝑠𝑏 ⟳ 𝑓
But 𝑀 rejects 𝑎𝑎𝑏𝑎. See, for instance, the following sequence of steps
Now, we investigate results concerning the accepting power of ROWJFAs and LOWJ-
FAs and their closure properties as they are significantly different from DJFAs.
Theorem 3.40 ROWJFA and LOWJFA are incomparable.
Proof (sketch) We use slightly modified language from Example 3.4. Consider
𝐿 = {𝑎𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)}. There is an accepting ROWJFA
𝑀 = ({𝑠, 𝑡, 𝑞, 𝑓 }, {𝑎, 𝑏}, 𝑅, 𝑠, { 𝑓 }), where 𝑅 consists of
𝑠𝑏 → 𝑡, 𝑠𝑎 → 𝑞, 𝑞𝑏 → 𝑓 , 𝑓 𝑎 → 𝑞
Obviously, 𝑡 has a role of a trap state, so 𝑀 cannot accept the input string after entering
𝑡. The detailed proof that 𝐿 is accepted by no LOWJFA so 𝐿 ∈ ROWJFA−LOWJFA
is in Chigahara et al. [2016]. On the other hand, 𝐿 ′ = {𝑤𝑎 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) =
occur(𝑤, 𝑏)} ∈ LOWJFA − ROWJFA. □
58 3 Jumping One-Head Automata
Theorem 3.42 ROWJFA is not closed under Kleene star and Kleene plus.
ROWJFA DJFA
concatenation − −
union − +
complement − +
intersection − +
int. with regular languages − −
Kleene star − −
mirror image − +
substitution − −
homomorphism − −
inverse homomorphism − +
Conclusion
Naturally, the research on ROWJFAs and LOWJFAs continues. As seen from the
previous results, Chigahara et al. [2016] study the accepting power and closure
properties, and they also define pumping lemmas for the resulting language families.
In Fazekas and Yamamura [2016], the sufficient conditions for the resulting language
to be regular are studied.
Beier and Holzer [2018b] study inclusion relations and closure properties. Beier
and Holzer [2018a] is a continuation of Beier and Holzer [2018b] that focuses on
decision problems. It shows that most of the classical problems are decidable for
ROWJFAs, and it discusses some complexity results for the considered decision
problems. Beier and Holzer [2019] characterize the family of permutation closed
languages accepted by ROWJFAs in terms of Myhill-Nerode equivalence classes.
Using this, it investigates closure and non-closure properties as well as inclusion
relationships between all related language families. Furthermore, it gives more char-
acterizations of languages accepted by ROWJFAs in the case that the language is
given as the concatenation of two languages. Recently in Beier and Holzer [2022],
nondeterministic versions of right one-way jumping finite automata were introduced
and their computational power was investigated including the relationship to JFA.
Lastly, Fazekas et al. [2019] compare the deterministic and nondeterministic finite
automata and pushdown automata when they use standard, jumping, and one-way
jumping steps. Then, the same authors investigated two-way jumping automata as
strictly more powerful model in Fazekas et al. [2021]. Further, Fazekas et al. [2022]
discuss asymptotically bounded computation in terms of one-way jumping finite
automata with a principal focus on the study of its complexity.
60 3 Jumping One-Head Automata
Apart from the most influential models mentioned in this part, there are also other
papers that study the jumping mechanism further in more advanced automata-based
models:
• Two-dimensional jumping finite automata (see Immanuel and Thomas [2016b];
Madejski and Szepietowski [2017]; Immanuel and Thomas [2017]);
• Jumping restarting automata (see Wang and Li [2018]);
• Jumping multi-head automata (see Kuperberg et al. [2019]);
• Jumping automata over infinite words (see Shaull and Omer [2023]).
Note that it may seem, from the name of jumping multi-head automata, that this
model is similar to the models studied later in this book. However, it falls into the
category (PA.1) of parallelism in finite automata. On the other hand, most finite
automata studied in this book fall into the category (PA.2), which is a fundamentally
different behavior.
Chapter 4
Jumping Multi-Head Automata
To place the subject of this chapter into a general and historical context, recall
that early computer programs were always executed strictly sequentially. Indeed, to
perform a computational task, an algorithm was written and implemented as an in-
struction sequence executed on a central processing unit of a single computer. Only
one instruction was executed at a time, so after this instruction was completed, the
next instruction was executed until all the sequence of instructions was performed
in this unbearably slow way. In the mid-1980s or so, however, computer program-
mers started to write their first pioneer programs that performed several parts of
a single computational task simultaneously. As a result, around that time, parallel
computation emerged in computer science.
Generally speaking, seen from today’s perspective, parallel computation can be
categorized as any type of computation in which many computational processes are
carried out simultaneously while taking advantage of mutually cooperating multi-
processor computers. From a hardware standpoint, parallel computation is often
executed on various computers, such as a single computer with multiple processors or
several networked computers with specialized hardware, and it may simultaneously
process quite diverse data. It can be performed at various levels, ranging from bit-
level through instruction-level up to task-level parallelism. Over the past few years,
parallel computing has become the dominant paradigm in computer architecture,
mainly in the form of multi-core processors. From a software standpoint, parallel
computation is conceptually accomplished by breaking a single computational task
into many independent subtasks so that each subtask can be simultaneously executed
with the others. It thus comes as no surprise that today the investigation of parallel
computation fulfills a central role within computer science as a whole.
Of course, discontinuous computation, whose models represent the principal sub-
ject of this book, is often executed in parallel, too. Building up a systematized body
of knowledge about this kind of computation obviously necessitates an introduction
of its proper formalization in the first place. In terms of jumping automata, this
investigation trend leads to a generalization of one-head jumping automata, covered
in Chapter 3, to their multi-head versions, which can act as an automaton-based
formalization of discontinuous parallelism much more properly. To see the principal
61
62 4 Jumping Multi-Head Automata
reason why the multi-head jumping automata represent appropriate models of dis-
continuous computation in parallel, recall that their original one-head counterparts
always apply a single rule during every jump, so they obviously fail to formalize any
kind of computational parallelism. On the other hand, their multi-head versions can
perform a simultaneous application of several rules during any jump, thus reflecting
and formalizing discontinuous parallelism more adequately. That is also why the
present chapter carefully explores a large variety of these versions.
The introduction of parallel mechanisms such as multiple reading heads influence
the properties of jumping automata significantly in various ways such as increase of
their accepting power (see Section 4.2) or even fundamental change of the behavior
such that the jumping concept utilizes multiple heads, the heads can naturally jump
at specific positions on the tape, and thus they can easily work on different places
at once in parallel, although their heads cooperate on a single tape and, therefore,
process a single input string. From a practical point of view, the deterministic variants
and scalable splitting the work into more or less independent tasks are of interest as
well.
More specifically, this four-section chapter opens its discussion by investigating
two-head jumping automata in Section 4.1, which are generalized to multi-head
jumping automata in Section 4.2. Section 4.3 explores jumping Watson–Crick finite
automata, which represent biology-related model processing double-stranded inputs.
Finally, Section 4.4 deals with their special cases—jumping 5′ → 3′ Watson–Crick
finite automata that read the double-stranded string from opposite ends so it is closer
to the real processing of DNA.
Categories of Parallelism
On the other hand, there are also models with a fixed degree of parallelism such
as Watson–Crick finite automata (see Păun et al. [1998]). These automaton models
use two heads in parallel in such a way that each head processes one strand of a
double-stranded DNA input sequence. Consequently, the degree of parallelism of
Watson–Crick finite automata is always two.
Work-distributing Parallelism. Lastly, if we consider category (P.3) in the basic
research, it seems that there is not much interest to study possibilities how to split the
work for the given tasks. This may not be that surprising because in the basic research
we usually study characteristics like the expressive power, closure properties, and
the decidability and complexity of various operations; and, of course, these results
are not affected by parallelism that is primarily applied to speed up the computation
without changing the result. In basic research, we often even prefer approaches that
are completely sequential because it makes the subsequent proof techniques much
easier in many cases. When we do consider parallelism that splits the work of the
tasks (see Rozenberg and Salomaa [1997a,b]), we usually just simply conclude that
if the model behaves nondeterministically, then we can explore different cases in
parallel, and if the model uses only context-free rules, then we can trivially split the
generation process into multiple independent parts.
It is possible to find some theoretical papers that explore this role of parallelism
further in certain areas, e.g., in biomolecular computing (see Loos and Nagy [2011]);
but a thorough study is usually left for practical applications such as parsing (see
Grune and Jacobs [2008]), formal verification, and others.
The situation around the types of parallelism gets more complex if we look at finite
automata. Thus, we introduce some additional categorization.
There are some finite automaton models that have the same expressive power
as grammars from category (P.1). For example, self-regulating finite automata (see
Meduna and Masopust [2007]), pure multi-pushdown automata that perform com-
plete pushdown pops (see Masopust and Meduna [2009]), and finite-turn checking
automata (see Siromoney [1971]), which are connected to the various versions of
simple matrix, equal matrix, and 𝑛-parallel right-linear grammars. However, we do
not consider these models to be parallel. This is due to the fact that, up until quite re-
cently, automaton models always read the input tape almost exclusively in the strictly
continuous (left-to-right) symbol-by-symbol way. The mentioned models are no ex-
ceptions, and thus they use various kinds of stacks to match the expressive power of
the parallel grammars but otherwise work strictly continuously on the input tape in
a completely non-parallel way.
As we have already pointed out, we can imagine parallelism in finite automata
as a parallel cooperation of multiple heads. There is indeed the well-known concept
of Turing machines with multiple tapes and multiple heads; which was also adapted
and studied in terms of finite automaton models. Nonetheless, not all such models
4 Jumping Multi-Head Automata 65
Synopsis
While Chapter 3 has explored one-head jumping finite automata (JFA), the present
four-section chapter is devoted to JFAs having several heads.
66 4 Jumping Multi-Head Automata
Section 4.1 modifies the way the basic model of a JFA works so it simultaneously
performs two jumps according to the same rule. For either of the two jumps, it
always considers three directions—(1) to the left, (2) to the right, and (3) in either
direction. In correspondence to these three directions, this section investigates the
mutual relation between the language families resulting from JFAs working in these
ways and well-known language families, including the families of regular, linear,
context-free, and context-sensitive languages. In essence, it demonstrates that most of
these language families are pairwise incomparable—that is, they are not subfamilies
of each other, but they are not disjoint either. In addition, this section establishes
several closure as well as non-closure properties concerning the language families
under discussion.
Section 4.2 covers 𝑛-parallel jumping finite automata, whose input is divided into
several parts separately processed by distinct synchronized heads. Under this parallel
mechanism, each part can be read discontinuously, but the order between parts is
preserved; from this viewpoint, this model actually combines both discontinuous
and continuous ways of reading.
More precisely, the 𝑛-parallel jumping finite automata utilize jumping only during
the initialization when heads jump to their starting positions. After that, all heads read
their parts of the input continuously in a left-to-right way. Section 4.2 compares these
automata with 𝑛-parallel right linear grammars and shows that both models actually
define the same language families. Consequently, making use of well-known results
about 𝑛-parallel right linear grammars, Section 4.2 establishes several properties of
𝑛-parallel jumping finite automata.
Sections 4.3 and 4.4 demonstrate a close relation between two-head jumping
automata discussed in Section 4.2 and Watson–Crick automata (see Section 2.2.3),
which fulfill a crucially important role in many biologically oriented research areas,
particularly, in DNA computation. In essence, Watson–Crick automata work with
DNA information represented by two strings, referred to as strands, bounded with
symmetric Watson–Crick relation and read by their heads. As is obvious, this fun-
damental conceptualization strongly resembles that of two-head jumping automata,
and this resemblance gives rise to introducing combined versions of both types
of automata—the principal subject of these two sections. Both sections concentrate
their attention on the accepting power of the resulting combined versions of Watson–
Crick and jumping automata, including a large variety of their restricted versions.
From a more practical standpoint, it is worth making a prediction: as the biological
applications frequently make use of original versions of Watson–Crick automata as
their models, the future applications of this kind are highly likely to pay a significant
attention to their jumping versions as well as sketched in Section 9.1.
The present section investigates two-head JFAs that work over a single tape. To give
an insight into this, let us first recall the notion of a classical finite automaton (see
4.1 Double-Jumping Finite Automata 67
Section 2.2.1), 𝑀, which consists of an input tape, a read head, and a finite state
control. The input tape is divided into squares. Each square contains one symbol of
an input string. The symbol under the read head, 𝑎, is the current input symbol. The
finite control is represented by a finite set of states together with a control relation,
which is usually specified as a set of computational rules. 𝑀 computes by making
a sequence of moves. Each move is made according to a computational rule that
describes how the current state is changed and whether the current input symbol is
read. If the symbol is read, the read head is shifted precisely one square to the right.
𝑀 has one state defined as the start state and some states designated as final states.
If 𝑀 can read entire 𝑤 by making a sequence of moves from the start state to a final
state, 𝑀 accepts 𝑤; otherwise, 𝑀 rejects 𝑤.
As discussed in Chapter 3, a JFA works just like a classical finite automaton
except it does not read the input string in a symbol-by-symbol left-to-right way: after
reading a symbol, 𝑀 can jump over a portion of the tape in either direction and
continue making moves from there. Once an occurrence of a symbol is read on the
tape, it cannot be re-read again later during the computation of 𝑀. Otherwise, it
coincides with the standard notion of a finite automaton.
Consider the notion of a JFA 𝑀 sketched above. The present section based
on Kocman et al. [2016, 2018] modifies the way 𝑀 works so it simultaneously
performs two jumps according to the same rule. For either of the two jumps, it
always considers three natural directions—(1) to the left, (2) to the right, and (3) in
either direction. In correspondence to this jumping-direction three-part classification,
the section investigates the mutual relation between the language families resulting
from JFAs working in these ways and the families of regular, linear, context-free, and
context-sensitive languages. In essence, it demonstrates that most of these language
families are pairwise insmparable—that is, they are not subfamilies of each other
and, simultaneously, they are not disjoint either. In addition, the section establishes
several closure and non-closure properties concerning the language families defined
by JFAs working in the three ways sketched above.
Recall from Section 3.1 that a general jumping finite automaton (GJFA) is a quintuple
𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹), where 𝑄, Δ, 𝑅, 𝑠, and 𝐹 are defined as in a general finite
automaton (see Section 2.2.1). According to Convention 2.1, we sometimes denote
a rule 𝑝𝑦 → 𝑞 with a unique label ℎ as ℎ : 𝑝𝑦 → 𝑞, so we can write ℎ instead
of 𝑝𝑦 → 𝑞. A configuration of 𝑀 is any string in Δ∗ 𝑄Δ∗ . To make the notation of
jumping relation consistent with the rest of this section, instead of ↷, we denote
the binary jumping relation by ♦ ↷, over Δ∗ 𝑄Δ∗ , and ♦ ↷ is defined as follows. Let
𝑥, 𝑧, 𝑥 ′ , 𝑧 ′ ∈ Δ∗ such that 𝑥𝑧 = 𝑥 ′ 𝑧 ′ and ℎ : ( 𝑝, 𝑦, 𝑞) ∈ 𝑅; then, 𝑀 makes a jump from
𝑥 𝑝𝑦𝑧 to 𝑥 ′ 𝑞𝑧 ′ , symbolically written as 𝑥 𝑝𝑦𝑧 ♦ ↷ 𝑥 ′ 𝑞𝑧 ′ [ℎ]. When the specification
of the rule ℎ is immaterial, we can omit [ℎ].
68 4 Jumping Multi-Head Automata
We define a new mode for GJFAs that performs two single jumps simultaneously.
In this mode, both single jumps follow the same rule; however, they are performed
on two different positions on the tape and thus handle different parts of the input
string. Moreover, these two jumps cannot ever cross each other—their initial mutual
order is preserved during the whole process. As a result, when needed, we can
specifically denote them as the first jump and the second jump. Furthermore, this
section considers three possible types of single jumps that can be used in this new
double-jumping mode. Besides the unrestricted single jump ♦ ↷ from the original
definition, we also define and use two restricted single jumps with limited movement.
The definition of restricted jumps is modified from the original paper Meduna and
Zemek [2012] (see Definition 3.5) in order to get a more consistent behavior. The
restricted single jumps now read strings from the configuration on the specific side
of the state depending on the actual direction of their jumping.
Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. Let 𝑤, 𝑥, 𝑦, 𝑧 ∈ Δ∗ and ℎ : ( 𝑝, 𝑦, 𝑞) ∈ 𝑅; then,
𝑤 𝑝𝑦𝑥𝑧 ▶ ↷ 𝑤𝑥𝑞𝑧 [ℎ] and 𝑤𝑥𝑦 𝑝𝑧 ◀ ↷ 𝑤𝑞𝑥𝑧 [ℎ] in 𝑀.
Consider the jumping relation (see Definition 3.1) and right and left jumps (see
Definition 3.5). Based on the jumping relation, we next introduce the notion of an
unrestricted 2-jumping relation (see Figure 4.1). In addition, based on the combina-
tion of left jumps and right jumps, we define four new types of restricted 2-jumping
relations, such as left-right 2-jumping relation in Figure 4.2.
𝑟 : 𝑝𝑥 → 𝑞
𝑟 : 𝑝𝑥 → 𝑞
↶ ↷ ↶ ↷
𝑝 ... 𝑥 ... 𝑥 ...
𝑟 : 𝑝𝑥 → 𝑞
𝑟 : 𝑝𝑥 → 𝑞
↶ ↷
𝑝 ... 𝑥 ... 𝑥 ...
Observe that 𝑀◀▶ ↷ is stuck since we need to move the first head one position to the
right as we need to reach configuration 𝑎𝑏𝑠𝑠𝑎𝑏 to be able to apply rule 1 again.
The similar situation happens if we consider 𝑀 working by ▶◀ ↷:
Again, the first head is stuck since 𝑀▶◀↷ reads from 𝑠 to the right, but it cannot jump
to the left to move 𝑠 at the position of first 𝑎.
70 4 Jumping Multi-Head Automata
Definition 4.2 Let 𝐿 𝑚,𝑛 be a simply expandable language (SEL) over an alpha-
bet Δ if it can
be written as follows. Let 𝑚 and 𝑛 be positive integers; then,
𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 𝑣 𝑖ℎ 𝑣 𝑖ℎ 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 | 𝑖 ≥ 0, 𝑢 ℎ,𝑘 , 𝑣 ℎ ∈ Δ∗ , 1 ≤ 𝑘 ≤ 𝑛 .
Ð𝑚
𝐿 𝑚,𝑛 = ℎ=1
For the sake of clarity, let us note that, in the previous definition, 𝑣 ℎ and all 𝑢 ℎ,𝑘
are fixed strings that only vary for different values of ℎ.
Throughout the rest of this section, SEL denotes the family of SELs. Furthermore,
for any language family F , Feven = {𝐾 | 𝐾 is the maximal subset of 𝐿 in which every
string has an even length, 𝐿 ∈ F }. Specifically, we make use of FINeven , REGeven ,
LINeven , CFeven , and CSeven in what follows.
Example 4.2 Let Δ = {𝑎, 𝑏, 𝑐}. Consider the GJFA 𝑀♦♦ ↷ = ({𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }),
where 𝑅 consists of the rules 1 : 𝑠𝑎𝑏 → 𝑓 and 2 : 𝑓 𝑐 → 𝑓 . Starting from 𝑠, 𝑀
has to read two times some 𝑎𝑏, entering the final state 𝑓 ; then, 𝑀 can arbitrarily
many times read two times some 𝑐. Consequently, if we work with the unrestricted
2-jumps, the input must always contain two separate strings 𝑎𝑏, and the symbols 𝑐
can be anywhere around these two strings. For instance, 𝑀 works on 𝑐𝑎𝑏𝑐𝑎𝑏𝑐𝑐 as
follows.
General Results
This section studies the accepting power of GJFAs making their computational steps
by unrestricted, right-left, left-right, right-right, and left-left 2-jumps.
Lemma 4.1 For every language 𝐿 ∈ DJFA2 , there is no 𝑥 ∈ 𝐿 such that |𝑥| is an odd
number; furthermore, there is no symbol 𝑎 for which occur(𝑥, 𝑎) is an odd number.
Proof By the definition of 2-jumps, any GJFA that uses 2-jumps always performs
two single jumps simultaneously, and they both follow the same rule; therefore, there
is no way how to read an odd number of symbols from the input string. □
4.1 Double-Jumping Finite Automata 71
Proof Since GJFA 𝑀♦ ↷ works as a GJFA (see Definitions 3.1 and 4.1), we follow
Lemma 3.3 which effectively shows that a GJFA 𝑀♦ ↷ can maintain a specific order
of symbols only in the sole context of a rule. Let 𝐾 = {𝑐 𝑘 𝑎𝑏𝑐 𝑚 𝑎𝑏𝑐 𝑛 | 𝑘 + 𝑚 +
𝑛 be an even integer, 𝑘, 𝑚, 𝑛 ≥ 0}. For the sake of contradiction, assume that there
is a GJFA 𝑀♦ ↷ such that 𝐿 (𝑀♦ ↷ ) = 𝐾. If 𝑀 uses two times a rule reading 𝑎𝑏,
then it can also accept input 𝑎𝑎𝑏𝑏; and clearly 𝑎𝑎𝑏𝑏 ∉ 𝐾. Consequently, 𝑀 has to
always read the whole sequence 𝑎𝑏𝑐 𝑚 𝑎𝑏 with a single rule; however, number 𝑚 is
unbounded and thus there cannot be finitely many rules that cover all possibilities—a
contradiction with the assumption that 𝐿(𝑀♦ ↷ ) = 𝐾 exists. Therefore, there is no
GJFA 𝑀♦ ↷ that accepts {𝑐 𝑘 𝑎𝑏𝑐 𝑚 𝑎𝑏𝑐 𝑛 | 𝑘 + 𝑚 + 𝑛 is an even integer, 𝑘, 𝑚, 𝑛 ≥ 0}.□
Proof GJFA ⊈ DJFA♦♦ follows from FIN ⊂ GJFA (see Theorem 3.8) and Lemma
4.1. DJFA♦♦ ⊈ GJFA follows from Example 4.2 and Lemma 4.2. Moreover, both
DJFA♦ and DJFA♦♦ clearly contain the simple finite language {𝑎𝑎}. □
Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄, Δ, 𝑅, 𝑠, 𝐹). Since we work with the right-left
2-jumps, the first jump can move only to the right, the second jump can move only
to the left, and both jumps cannot cross each other. Observe that if the configuration
of 𝑀 is of the form 𝑢 𝑝𝑣 𝑝𝑤, where 𝑢, 𝑣, 𝑤 ∈ Δ∗ , and 𝑝 ∈ 𝑄, then 𝑀 cannot read
the symbols in 𝑢 and 𝑤 anymore. Also, observe that this covers the situation when
𝑀 starts to accept 𝑥 ∈ Δ∗ from any other configuration than 𝑠𝑥𝑠. Therefore, to read
the whole input string, 𝑀 has to start in the configuration 𝑠𝑥𝑠, and it cannot jump
over any symbols during the whole process. Consequently, since both jumps always
follow the same rule, they have to read the same corresponding strings and, at the
end, meet in the middle of the input string. Therefore, every 𝑥 ∈ 𝐿(𝑀▶◀ ↷ ) can be
surely written as 𝑥 = 𝑢 1 𝑢 2 . . . 𝑢 𝑛 𝑢 𝑛 . . . 𝑢 2 𝑢 1 , where 𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛.□
Lemma 4.4 For every GJFA 𝑀, there is a linear grammar 𝐺 such that 𝐿(𝑀▶◀ ↷ )
= 𝐿 (𝐺).
Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄, Δ, 𝑅, 𝑠, 𝐹). Define the linear grammar 𝐺 =
(𝑄, Δ, 𝑃, 𝑠), where 𝑃 is constructed in the following way:
1. For each ( 𝑝, 𝑦, 𝑞) ∈ 𝑅, add 𝑝 → 𝑦𝑞𝑦 to 𝑃.
2. For each 𝑝 ∈ 𝐹, add 𝑝 → 𝜀 to 𝑃.
72 4 Jumping Multi-Head Automata
Proof DJFA▶◀ ⊆ LINeven follows from Lemma 4.4 and the structure of its proof.
LINeven ⊈ DJFA▶◀ follows from Lemma 4.1. □
Lemma 4.6 For every SEL 𝐾𝑚,𝑛 , there is a GJFA 𝑀 such that 𝐾𝑚,𝑛=𝐿 (𝑀▶◀ ↷ ).
Proof Let 𝑚 and 𝑛 be positive integers. Consider any SEL over an alphabet Δ,
𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 𝑣 𝑖ℎ 𝑣 𝑖ℎ 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 | 𝑖 ≥ 0, 𝑢 ℎ,𝑘 , 𝑣 ℎ ∈ Δ∗ , 1 ≤ 𝑘 ≤ 𝑛 .
Ð𝑚
𝐾𝑚,𝑛 = ℎ=1
Define the GJFA 𝑀▶◀ ↷ = (𝑄, Δ, 𝑅, ⟨𝑠⟩, 𝐹), where 𝑄, 𝑅, and 𝐹 are constructed in
the following way:
1. Add ⟨𝑠⟩ to 𝑄.
2. Add ⟨ℎ, 𝑘⟩ to 𝑄, for all 1 ≤ ℎ ≤ 𝑚, 1 ≤ 𝑘 ≤ 𝑛 + 1.
3. Add ⟨ℎ, 𝑛 + 1⟩ to 𝐹, for all 1 ≤ ℎ ≤ 𝑚.
4. Add (⟨𝑠⟩, 𝜀, ⟨ℎ, 1⟩) to 𝑅, for all 1 ≤ ℎ ≤ 𝑚.
5. Add (⟨ℎ, 𝑘⟩, 𝑢 ℎ,𝑘 , ⟨ℎ, 𝑘 + 1⟩) to 𝑅, for all 1 ≤ ℎ ≤ 𝑚, 1 ≤ 𝑘 ≤ 𝑛.
6. Add (⟨ℎ, 𝑛 + 1⟩, 𝑣 ℎ , ⟨ℎ, 𝑛 + 1⟩) to 𝑅, for all 1 ≤ ℎ ≤ 𝑚.
We follow Lemma 4.3 and its proof. Observe that 𝑀 starts from ⟨𝑠⟩ by jumping
to an arbitrary state ⟨ℎ, 1⟩, where 1 ≤ ℎ ≤ 𝑚. Then, the first jump consecutively
reads 𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 , and the second jump consecutively reads 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 ,
until 𝑀 ends up in the final state ⟨ℎ, 𝑛 + 1⟩. Here, both jumps can arbitrarily many
times read 𝑣 ℎ . As a result, 𝑀 accepts 𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 𝑣 𝑖ℎ 𝑣 𝑖ℎ 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 , for all
1 ≤ ℎ ≤ 𝑚, where 𝑖 ≥ 0, 𝑢 ℎ,𝑘 , 𝑣 ℎ ∈ Δ∗ , 1 ≤ 𝑘 ≤ 𝑛; therefore, 𝐾𝑚,𝑛 = 𝐿 (𝑀▶◀ ↷ ). □
Lemma 4.7 For every SEL 𝐾𝑚,𝑛 , there is a right-linear grammar 𝐺 such that 𝐾𝑚,𝑛 =
𝐿 (𝐺).
4.1 Double-Jumping Finite Automata 73
Proof Let 𝑚 and 𝑛 be positive integers. Consider any SEL over an alphabet Δ,
𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 𝑣 𝑖ℎ 𝑣 𝑖ℎ 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 | 𝑖 ≥ 0, 𝑢 ℎ,𝑘 , 𝑣 ℎ ∈ Δ∗ , 1 ≤ 𝑘 ≤ 𝑛 .
Ð𝑚
𝐾𝑚,𝑛 = ℎ=1
Define the right-linear grammar 𝐺 = (𝑁, Δ, 𝑃, ⟨𝑠⟩), where 𝑁 and 𝑃 are constructed
in the following way:
1. Add ⟨𝑠⟩ to 𝑁.
2. Add ⟨ℎ, 1⟩ and ⟨ℎ, 2⟩ to 𝑁, for all 1 ≤ ℎ ≤ 𝑚.
3. Add ⟨𝑠⟩ → ⟨ℎ, 1⟩ to 𝑃, for all 1 ≤ ℎ ≤ 𝑚.
4. Add ⟨ℎ, 1⟩ → 𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 ⟨ℎ, 2⟩ to 𝑃, for all 1 ≤ ℎ ≤ 𝑚.
5. Add ⟨ℎ, 2⟩ → 𝑣 𝑛 𝑣 𝑛 ⟨ℎ, 2⟩ to 𝑃, for all 1 ≤ ℎ ≤ 𝑚.
6. Add ⟨ℎ, 2⟩ → 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 to 𝑃, for all 1 ≤ ℎ ≤ 𝑚.
Observe that at the beginning, 𝐺 has to change nonterminal ⟨𝑠⟩ to an arbi-
trary nonterminal ⟨ℎ, 1⟩, where 1 ≤ ℎ ≤ 𝑚. Then, it generates 𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛
and nonterminal ⟨ℎ, 2⟩. Here, it can arbitrarily many times generate 𝑣 𝑛 𝑣 𝑛 and
ultimately finish the generation with 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 . As a result, 𝐺 generates
𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 (𝑣 ℎ 𝑣 ℎ ) 𝑖 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 , for all 1 ≤ ℎ ≤ 𝑚, where 𝑖 ≥ 0, 𝑢 ℎ,𝑘 , 𝑣 ℎ ∈
Δ∗ , 1 ≤ 𝑘 ≤ 𝑛, which is indistinguishable from 𝑢 ℎ,1 𝑢 ℎ,2 . . . 𝑢 ℎ,𝑛 𝑣 𝑖ℎ 𝑣 𝑖ℎ 𝑢 ℎ,𝑛 . . . 𝑢 ℎ,2 𝑢 ℎ,1 ;
therefore, 𝐾𝑚,𝑛 = 𝐿(𝐺). □
Proof SEL ⊆ REGeven follows from Lemma 4.7 and the structure of its proof.
REGeven ⊈ SEL follows from Lemma 4.6 and Lemma 4.1. □
Proof SEL ⊆ DJFA▶◀ follows from Lemma 4.6. DJFA▶◀ ⊈ SEL follows from
Theorem 4.3 and Lemma 4.5 because a subfamily of the family of regular languages
surely cannot contain a non-trivial language of all even palindromes. □
Proof DJFA▶◀ ⊈ REG (REGeven ) and DJFA▶◀ ⊈ FIN (FINeven ) follow from
Lemma 4.5, Theorem 4.3, and Theorem 4.4 (and Lemma 4.1). REG (REGeven ) ⊈
DJFA▶◀ and FIN (FINeven ) ⊈ DJFA▶◀ follow from Lemma 4.1. Moreover, DJFA▶◀
clearly contains the regular language {𝑎 2𝑛 | 𝑛 ≥ 0} and finite language {𝑎𝑎}. □
Open Problem (DJFA▶◀ − SEL) ∩ REG = ∅? □
Proof Consider any GJFA 𝑀◀▶ ↷ = (𝑄, Δ, 𝑅, 𝑠, 𝐹). Since we work with the left-
right 2-jumps, the first jump can move only to the left, and the second jump can
move only to the right. Observe that if the configuration of 𝑀 is of the form 𝑢 𝑝𝑣 𝑝𝑤,
where 𝑢, 𝑣, 𝑤 ∈ Δ∗ , and 𝑝 ∈ 𝑄, then 𝑀 cannot read the symbols in 𝑣 anymore. Also,
observe that this covers the situation when 𝑀 starts to accept 𝑥 ∈ Δ∗ from any other
configuration than 𝑦𝑠𝑠𝑧, where 𝑦, 𝑧 ∈ Δ∗ such that 𝑥 = 𝑦𝑧. Therefore, to read the
whole input string, 𝑀 has to start in the configuration 𝑦𝑠𝑠𝑧, and it cannot jump over
any symbols during the whole process. Consequently, since both jumps follow the
same rule, they have to read the same corresponding strings and ultimately finish
at the ends of the input string. Therefore, every 𝑥 ∈ 𝐿(𝑀◀▶ ↷ ) can be written as
𝑥 = 𝑢 𝑛 . . . 𝑢 2 𝑢 1 𝑢 1 𝑢 2 . . . 𝑢 𝑛 , where 𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛. □
Lemma 4.9 For every GJFA 𝑀, there is a GJFA 𝑁 such that 𝐿(𝑀◀▶ ↷ ) = 𝐿 (𝑁 ▶◀ ↷ ).
Proof Consider any 𝐺𝐽𝐹 𝐴 𝑀◀▶ ↷ = (𝑄, Δ, 𝑅1 , 𝑠1 , 𝐹). Without a loss of generality,
assume that 𝑠2 ∉ 𝑄. Define the GJFA 𝑁 ▶◀ ↷ = (𝑄 ∪ {𝑠2 }, Δ, 𝑅2 , 𝑠2 , {𝑠1 }), where 𝑅2
is constructed in the following way:
1. For each ( 𝑝, 𝑦, 𝑞) ∈ 𝑅1 , add (𝑞, 𝑦, 𝑝) to 𝑅2 .
2. For each 𝑓 ∈ 𝐹, add (𝑠2 , 𝜀, 𝑓 ) to 𝑅2 .
Note that this construction resembles the well-known conversion technique for fi-
nite automata which creates a finite automaton that accepts the reversal of the original
language. However, in this case, the effect is quite different. We follow Lemmas 4.3
and 4.8. Consider any 𝑥 ∈ 𝐿 (𝑀◀▶ ↷ ). We can surely find 𝑥 = 𝑢 𝑛 . . . 𝑢 2 𝑢 1 𝑢 1 𝑢 2 . . . 𝑢 𝑛 ,
where 𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛, such that 𝑁 reads 𝑢 𝑛 . . . 𝑢 2 𝑢 1 and 𝑢 1 𝑢 2 . . . 𝑢 𝑛
in the reverse order. Moreover, in 𝑁, both jumps have their direction reversed, com-
pared to jumps in 𝑀, and thus they start on the opposite ends of their parts, which is
demonstrated in the mentioned claims. Consequently, if each jump in 𝑁 reads its part
reversely and from the opposite end, then 𝑁 reads the same 𝑢 𝑛 . . . 𝑢 2 𝑢 1 𝑢 1 𝑢 2 . . . 𝑢 𝑛
as 𝑀. Finally, 𝑁 surely cannot accept anything new that is not accepted by 𝑀. Thus,
𝐿 (𝑀◀▶ ↷ ) = 𝐿(𝑁 ▶◀ ↷ ). □
Lemma 4.10 For every GJFA 𝑀, there is a GJFA 𝑁 such that 𝐿 (𝑀▶◀ ↷ ) = 𝐿(𝑁 ◀▶ ↷ ).
Proof The construction and reasoning is exactly the same as in Lemma 4.9. □
Theorem 4.6 DJFA◀▶ = DJFA▶◀ .
Proof DJFA◀▶ ⊆ DJFA▶◀ follows from Lemma 4.9. DJFA▶◀ ⊆ DJFA◀▶ follows
from Lemma 4.10. □
Other properties of this language family thus coincide with Section 4.1.
has to read two times 𝑎𝑏 and two times 𝑐. Observe that if the first jump skips
(jumps over) some symbols, then they cannot be ever read afterward. However,
the second jump is not so harshly restricted and can potentially skip some sym-
bols which will be read later by the first jump. Therefore, the accepted language is
𝐿(𝑀▶▶ ↷ ) = {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}.
Example 4.4 Consider the GJFA 𝑀▶▶ ↷ = ({𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }), where Δ = {𝑎, 𝑏}
and 𝑅 consists of the rules (𝑠, 𝑏, 𝑓 ) and ( 𝑓 , 𝑎, 𝑓 ). Starting from 𝑠, 𝑀 has to read two
times 𝑏 and then it can arbitrarily many times read two times 𝑎. Both jumps behave
in the same way as in Example 4.3. Observe that when we consider no skipping of
symbols, then 𝑀 reads 𝑏𝑎 𝑛 𝑏𝑎 𝑛 , 𝑛 ≥ 0. Nevertheless, when we consider the skipping
with the second jump, then the second 𝑏 can also occur arbitrarily closer to the first
𝑏; until they are neighbors, and 𝑀 reads 𝑏𝑏𝑎 2𝑛 , 𝑛 ≥ 0. When combined together,
the accepted language is 𝐿(𝑀▶▶ ↷ ) = {𝑏𝑎 𝑛 𝑏𝑎 𝑛 𝑎 2𝑚 | 𝑛, 𝑚 ≥ 0}. Observe that this is
clearly a non-regular context-free language.
Example 4.5 Consider the GJFA 𝑀▶▶ ↷ = ({𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }), where Δ = {𝑎, 𝑏,
𝑐, 𝑑} and 𝑅 = {(𝑠, 𝑦, 𝑓 ) | 𝑦 ∈ Δ} ∪ {( 𝑓 , 𝑦, 𝑓 ) | 𝑦 ∈ Δ}. Starting from 𝑠, 𝑀
has to read two times some symbol from Δ, and then it can arbitrarily many times
read two times any symbols from Δ. Again, both jumps behave in the same way
as in Example 4.3. Consider the special case when the second jump consistently
jumps over one symbol each time (except the last step) during the whole process.
In such a case, the accepted strings can be written as 𝑢 1 𝑢 1′ 𝑢 2 𝑢 2′ . . . 𝑢 𝑛 𝑢 ′𝑛 , where
𝑛 ∈ N, 𝑢 𝑖 , 𝑢 𝑖′ ∈ Δ, 𝑢 𝑖 = 𝑢 𝑖′ , 1 ≤ 𝑖 ≤ 𝑛. Observe that the symbols without primes
are read by the first jump, and the symbols with primes are read by the second
jump. Moreover, such strings can be surely generated by a right-linear grammar.
Nevertheless, now consider no special case. Observe that, in the accepted strings,
the symbols with primes can be arbitrarily shifted to the right over symbols without
primes; this creates a more complex structure, due to 𝑢 𝑖 = 𝑢 𝑖′ , with multiple crossed
agreements. Lastly, consider the other border case with no skipping of any symbols
at all. Then, the accepted strings can be written as 𝑤𝑤, where 𝑤 ∈ Δ+ . Such strings
represent the reduplication phenomenon—the well-known example of non-context-
free languages (see Chapter 3.1 in Rozenberg and Salomaa [1997b]). As a result, due
to the unbound number of crossed agreements, we can safely state that 𝐿(𝑀▶▶ ↷ ) is
a non-context-free language.
This statement can be formally proven by contradiction. Assume that 𝐿(𝑀▶▶ ↷ )
is a context-free language. The family of context-free languages is closed under
intersection with regular sets. Let 𝐾 = 𝐿 (𝑀▶▶ ↷ ) ∩ 𝑎𝑏 + 𝑐+ 𝑑𝑎𝑏 + 𝑐+ 𝑑. Consider the
previous description. Observe that this selects strings where 𝑢 1 = 𝑎 and 𝑢 ′𝑛 = 𝑑.
Since there are only exactly two symbols 𝑎 and two symbols 𝑑 in each selected string,
we know where precisely both jumps start and end. And since the second jump starts
after the position where the first jump ends, we also know that this, in fact, follows the
special border case of behavior with no skipping of any symbols at all. Consequently,
𝐾 = {𝑎𝑏 𝑛 𝑐 𝑚 𝑑𝑎𝑏 𝑛 𝑐 𝑚 𝑑 | 𝑛, 𝑚 ≥ 1}. However, 𝐾 is clearly a non-context-free
language (see Chapter 3.1 in Rozenberg and Salomaa [1997b])—a contradiction
76 4 Jumping Multi-Head Automata
Proof Clearly, any GJFA 𝑀▶▶ ↷ can be simulated by linear bounded automata, so
DJFA▶▶ ⊆ CS. Due to Lemma 4.1, we can safely exclude all languages containing
odd-length strings. CSeven ⊈ DJFA◀◀ also follows from Lemma 4.1. □
Lemma 4.11 Let 𝑛 ∈ N, and let 𝑀 be any GJFA. Furthermore, let every 𝑥 ∈
𝐿(𝑀▶▶ ↷ ) satisfy either |𝑥| ≤ 𝑛 or symbols(𝑥) = 1. Then, there exists a right-linear
grammar 𝐺 such that 𝐿(𝑀▶▶ ↷ ) = 𝐿 (𝐺).
Proof Let 𝑛 ∈ N. Consider any GJFA 𝑀▶▶ ↷ where every 𝑥 ∈ 𝐿(𝑀▶▶ ↷ ) satisfy
either |𝑥| ≤ 𝑛 or symbols(𝑥) = 1. Define the right-linear grammar 𝐺 in the following
way: Observe that the number of 𝑥 for which holds |𝑥| ≤ 𝑛 must be finite; therefore,
for each such 𝑥, we can create a separate rule that generates 𝑥 in 𝐺. On the other
hand, the number of 𝑥 for which holds symbols(𝑥) = 1 can be infinite; however,
every such 𝑥 is defined by the finite number of rules in 𝑀. And we can surely convert
these rules ( 𝑝, 𝑦, 𝑞) from 𝑀 into rules in 𝐺 in such a way that they generate 𝑦 2
and simulate the state transitions of 𝑀. Consequently, since the position of symbols
here is ultimately irrelevant, these rules properly simulate results of 2-jumps in 𝑀.
Therefore, 𝐿(𝑀▶▶ ↷ ) = 𝐿 (𝐺). □
Example 4.7 Consider the GJFA 𝑀◀◀ ↷ = ({𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }), where Δ = {𝑎, 𝑏}
and 𝑅 consists of the rules (𝑠, 𝑎, 𝑠) and (𝑠, 𝑏, 𝑓 ). Starting from 𝑠, 𝑀 can arbitrarily
many times read two times 𝑎 and, at the end, it has to read two times 𝑏. Both jumps
behave in the same way as in Example 4.6. Observe that when we consider no
skipping of symbols, then 𝑀 reads 𝑏𝑎 𝑛 𝑏𝑎 𝑛 , 𝑛 ≥ 0. Nevertheless, when we consider
the skipping with the first jump, then the second 𝑏 can also occur arbitrarily closer
to the first 𝑏, since the first jump can now read symbols 𝑎 also behind this second 𝑏.
Consequently, the accepted language is 𝐿(𝑀◀◀ ↷ ) = {𝑏𝑎 𝑛 𝑏𝑎 𝑛 𝑎 2𝑚 | 𝑛, 𝑚 ≥ 0}. Note
that this is the same language as in Example 4.4.
Example 4.8 Consider the GJFA 𝑀◀◀ ↷ = ({𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }), where Δ = {𝑎, 𝑏, 𝑐,
𝑑} and 𝑅 = {(𝑠, 𝑦, 𝑓 ) | 𝑦 ∈ Δ} ∪ {( 𝑓 , 𝑦, 𝑓 ) | 𝑦 ∈ Δ}. Starting from 𝑠, 𝑀 has to read
two times some symbol from Δ, and then it can arbitrarily many times read two times
any symbols from Δ. Both jumps behave in the same way as in Example 4.6, and the
overall behavior tightly follows Example 4.5. In the special case where the first jump
consistently jumps over one symbol each time (except the last step) during the whole
process, the accepted strings can be written as 𝑢 ′𝑛 𝑢 𝑛 . . . 𝑢 2′ 𝑢 2 𝑢 1′ 𝑢 1 , where 𝑛 ∈ N,
𝑢 𝑖′ , 𝑢 𝑖 ∈ Δ, 𝑢 𝑖′ = 𝑢 𝑖 , 1 ≤ 𝑖 ≤ 𝑛. The symbols with primes are read by the first jump,
and the symbols without primes are read by the second jump. With no special case,
the symbols with primes can be arbitrarily shifted to the left over the symbols without
primes, which creates a more complex structure with multiple crossed agreements
and ultimately also the structure of the reduplication phenomenon. As a result, we
can safely state that 𝐿 (𝑀◀◀ ↷ ) is a non-context-free language, and this statement can
be formally proven in the same way as in Example 4.5.
Lemma 4.12 Let 𝑛 ∈ N, and let 𝑀 be any GJFA. Furthermore, let every 𝑥 ∈
𝐿 (𝑀◀◀ ↷ ) satisfy either |𝑥| ≤ 𝑛 or symbols(𝑥) = 1. Then, there exists a right-linear
grammar 𝐺 such that 𝐿(𝑀◀◀ ↷ ) = 𝐿 (𝐺).
Lemma 4.13 There is no GJFA 𝑀▶▶ ↷ that accepts {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}.
78 4 Jumping Multi-Head Automata
Proof (by contradition) Let 𝐾 = {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}. For the sake of con-
tradiction, assume that there is a GJFA 𝑀 such that 𝐿 (𝑀▶▶ ↷ ) = 𝐾. Observe that
each string in 𝐾 contains three pairs of symbols; therefore, to effectively read such a
string, we need a maximum of three chained rules in 𝑀 or less. (Note that additional
rules reading 𝜀 do not affect results.) Moreover, due to the nature of strings in 𝐾, we
need to consider only such chains of rules where, in the result, 𝑎 precedes 𝑏, and 𝑏
precedes 𝑐. Therefore, we can easily try all possibilities and calculate their resulting
sets. Surely, 𝐿 (𝑀▶▶ ↷ ) must be a union of some of these sets:
(i) if 𝑀 reads 𝑎𝑏𝑐, the set is {𝑎𝑏𝑐𝑎𝑏𝑐};
(ii) if 𝑀 reads 𝑎𝑏, and 𝑐, the set is {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐};
(iii) if 𝑀 reads 𝑎, and 𝑏𝑐, the set is {𝑎𝑎𝑏𝑐𝑏𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐};
(iv) if 𝑀 reads 𝑎, 𝑏, and 𝑐, the set is {𝑎𝑎𝑏𝑏𝑐𝑐, 𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑎𝑏𝑐𝑏𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}.
Clearly, no union of these sets can result in 𝐾—a contradiction with the assump-
tion that 𝐿(𝑀▶▶ ↷ ) = 𝐾 exists. Therefore, there is no GJFA 𝑀▶▶ ↷ that accepts
{𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}. □
Proof (by contradition) Let 𝐾 = {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}. For the sake of contradiction,
assume that there is a GJFA 𝑀 such that 𝐿 (𝑀◀◀ ↷ ) = 𝐾. By the same reasoning as
in the proof of Lemma 4.13, 𝐿 (𝑀◀◀ ↷ ) must be a union of some of these sets:
(i) if 𝑀 reads 𝑎𝑏𝑐, the set is {𝑎𝑏𝑐𝑎𝑏𝑐};
(ii) if 𝑀 reads 𝑐, and 𝑎𝑏, the set is {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐};
(iii) if 𝑀 reads 𝑏𝑐, and 𝑎, the set is {𝑎𝑎𝑏𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐};
(iv) if 𝑀 reads 𝑐, 𝑏, and 𝑎, the set is {𝑎𝑎𝑏𝑏𝑐𝑐, 𝑎𝑎𝑏𝑐𝑏𝑐, 𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}.
Clearly, no union of these sets can result in 𝐾. Therefore, there is no GJFA 𝑀◀◀ ↷
that accepts {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}. □
Proof DJFA▶▶ ⊈ DJFA◀◀ follows from Example 4.3 and Lemma 4.14. DJFA◀◀ ⊈
DJFA▶▶ follows from Example 4.6 and Lemma 4.13. Moreover, both DJFA▶▶ and
DJFA◀◀ clearly contain the same language from Examples 4.4 and 4.7. □
The results concerning the accepting power of GJFAs that perform right-left,
left-right, right-right, and left-left 2-jumps are summarized in Figure 4.3.
Closure Properties
CSeven
LINeven CF
FIN
Fig. 4.3 Relationships between DJFA▶▶ , DJFA◀◀ , and other language families.
Theorem 4.12 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
endmarking.
Proof This result directly follows from Lemma 4.1—the inability to read an odd
number of symbols from the input string. □
Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄, Δ, 𝑅, 𝑠, 𝐹). Without a loss of generality,
assume that 𝑠′ ∉ 𝑄 and # ∉ Δ. Define GJFA 𝑁 ▶◀ ↷ = (𝑄 ∪ {𝑠′ }, Δ ∪ {#}, 𝑅 ∪
{(𝑠′ , #, 𝑠)}, 𝑠′ , 𝐹). Then, by Lemma 4.3, every 𝑥 ∈ 𝐿(𝑁 ▶◀ ↷ ) can be surely written
as 𝑥 = #𝑢 2 𝑢 3 . . . 𝑢 𝑛 𝑢 𝑛 . . . 𝑢 3 𝑢 2 #, where 𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 2 ≤ 𝑖 ≤ 𝑛 □
Theorem 4.14 Both DJFA▶▶ and DJFA◀◀ are not closed under endmarking on
both sides.
Proof Since both jumps always read the same strings in the same direction, they
clearly cannot reliably define the endmarking on the opposite sides of the input string
in the general case. □
Theorem 4.15 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
concatenation.
Proof This can be easily proven by contradiction. Consider two simple languages
{𝑎𝑎} and {𝑏𝑏}, which clearly belong into DJFA▶◀ , DJFA▶▶ , and DJFA◀◀ . Assume
that DJFA▶◀ , DJFA▶▶ , and DJFA◀◀ are closed under concatenation. Therefore,
the resulting language {𝑎𝑎𝑏𝑏} also has to belong into DJFA▶◀ , DJFA▶▶ , and
DJFA◀◀ . However, such a language does not satisfy the string form for DJFA▶◀
from Lemma 4.3, and there is no GJFA 𝑀▶▶ ↷ or GJFA 𝑁 ◀◀ ↷ that can define such a
language. Observe that 𝑀 and 𝑁 cannot accept 𝑎𝑎𝑏𝑏 with a single 2-jump, and that
the rules for multiple 2-jumps define broader languages, e.g., {𝑎𝑏𝑎𝑏, 𝑎𝑎𝑏𝑏}. □
80 4 Jumping Multi-Head Automata
Theorem 4.16 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
square.
Proof Consider language 𝐿 = {𝑎𝑎, 𝑏𝑏}, which clearly belongs into DJFA▶◀ ,
DJFA▶▶ , and DJFA◀◀ . Therefore, 𝐿 2 = {𝑎𝑎𝑎𝑎, 𝑎𝑎𝑏𝑏, 𝑏𝑏𝑎𝑎, 𝑏𝑏𝑏𝑏} should also
belong into these language families. However, observe string 𝑎𝑎𝑏𝑏; it causes the
same problems as in the proof of Theorem 4.15. This string does not satisfy the
string form for DJFA▶◀ from Lemma 4.3. Moreover, there is no GJFA 𝑀▶▶ ↷ or
GJFA 𝑁 ◀◀ ↷ that can simultaneously accept required string 𝑎𝑎𝑏𝑏 and reject unwanted
string 𝑎𝑏𝑎𝑏. □
Theorem 4.17 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
shuffle.
Proof Consider two simple languages {𝑎𝑎} and {𝑏𝑏}, which clearly belong into
DJFA▶◀ , DJFA▶▶ , and DJFA◀◀ . Therefore, the resulting language of their shuffle
{𝑎𝑎𝑏𝑏, 𝑎𝑏𝑎𝑏, 𝑏𝑎𝑎𝑏, 𝑎𝑏𝑏𝑎, 𝑏𝑎𝑏𝑎, 𝑏𝑏𝑎𝑎} should also belong into these language
families. However, several strings from this language do not satisfy the string form
for DJFA▶◀ from Lemma 4.3. Moreover, there is surely no GJFA 𝑀▶▶ ↷ or GJFA
𝑁 ◀◀ ↷ that can accept string 𝑏𝑎𝑎𝑏 or 𝑎𝑏𝑏𝑎, since these strings do not contain two
identical sequences of symbols that could be properly synchronously read. □
Theorem 4.18 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are closed under
union.
Theorem 4.19 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
complement.
Proof Consider Lemma 4.1—that all 2-jumping modes can only accept even-length
input strings. As a result, every complement has to contain at least all odd-length
strings, and thus it cannot be defined by any 2-jumping mode. □
Theorem 4.20 DJFA▶◀ (DJFA◀▶ ) is closed under intersection with regular lan-
guages.
with the construction of 𝐻. First, Fw(𝑁, 𝑝, 𝑠𝑡𝑟) accepts three parameters: 𝑁 which
is some FA, 𝑝 which is some state of 𝑁, and 𝑠𝑡𝑟 which is some string. This function
returns the set of states in which 𝑁 can end up if 𝑁 is in state 𝑝 and reads 𝑠𝑡𝑟. Second,
Bw(𝑁, 𝑝, 𝑠𝑡𝑟) that also accepts the same parameters: 𝑁 which is some FA, 𝑝 which
is some state of 𝑁, and 𝑠𝑡𝑟 which is some string. This function returns the set of
states from which 𝑁 reads 𝑠𝑡𝑟 and ends in state 𝑝. We are not giving full details of
these functions here since they only incorporate the well-known standard techniques
for finite automata. With this, we construct 𝑄 3 , 𝑅3 , and 𝐹3 in the following way:
1. Add 𝑠3 to 𝑄 3 .
2. Add ⟨𝑝, 𝑞, 𝑟⟩ to 𝑄 3 , for all ( 𝑝, 𝑞, 𝑟) ∈ 𝑄 1 × 𝑄 2 × 𝑄 2 .
3. Add ⟨𝑝, 𝑞, 𝑞⟩ to 𝐹3 , for all ( 𝑝, 𝑞) ∈ 𝐹1 × 𝑄 2 .
4. Add (𝑠3 , 𝜀, ⟨𝑠1 , 𝑠2 , 𝑓 ⟩) to 𝑅3 , for all 𝑓 ∈ 𝐹2 .
5. For each ( 𝑝, 𝑎, 𝑞) ∈ 𝑅1 and 𝑟 1 , 𝑡1 ∈ 𝑄 2 , add (⟨𝑝, 𝑟 1 , 𝑡1 ⟩, 𝑎, ⟨𝑞, 𝑟 2 , 𝑡2 ⟩) to 𝑅3 , for
all (𝑟 2 , 𝑡2 ) ∈ Fw(𝑁, 𝑟 1 , 𝑎) × Bw(𝑁, 𝑡1 , 𝑎).
Observe that 𝐻 handles three distinct things in its states ⟨𝑝, 𝑞, 𝑟⟩: 𝑝 represents the
original state of 𝑀, 𝑞 simulates the first part of 𝑁 in the classical forward way,
and 𝑟 simulates the second part of 𝑁 in the backward way. At the beginning, 𝐻
makes a 2-jump from the initial state 𝑠3 into one of the states ⟨𝑠1 , 𝑠2 , 𝑓 ⟩, where
𝑓 ∈ 𝐹2 , and the main part of the simulation starts. In each following step, 𝐻 can
only make a 2-jump if the similar 2-jump is also in 𝑀 and if 𝑁 can read the same
string as 𝑀 from both opposite sides with the current states. This part ends when
there are no valid 2-jumps or when 𝐻 reads the whole input string. If 𝐻 processes
the whole input string, we can recognize valid final state ⟨𝑝, 𝑞, 𝑟⟩ in the following
way: 𝑝 has to be the original final state of 𝑀, and 𝑞 must be the same as 𝑟 so that
the simulation of 𝑁 from the two opposite sides can be connected in the middle. As
a result, 𝐿 (𝐻▶◀ ↷ ) = 𝐿 (𝑀▶◀ ↷ ) ∩ 𝐿 (𝑁). □
Observe that 𝐻 stores six pieces of information in its compound states: (1) the
state of 𝑀, (2) the buffered string (so-called buffer) with up to 2𝑘 − 1 symbols
read from the beginning of the input string to simulate the work of 𝑀 on it, (3) the
buffered string with up to 2𝑘 − 1 symbols read from the end of the input string to
simulate the work of 𝑀 on it, and pieces (4), (5), and (6) are analogous to (1), (2),
and (3) but for 𝑁, respectively.
Next, by the same reasoning as in the proof of Lemma 4.3, we can assume that
𝑀 and 𝑁 start from configurations 𝑠1 𝑤𝑠1 and 𝑠2 𝑤𝑠2 , respectively, and neither of
them can jump over any symbol during the reading. Using these assumptions, 𝐻
simulates the work of 𝑀 and 𝑁 as follows. First, it reads by the rules from (I) a part
of the input string and stores it in the buffers. Then, by the rules from (II) and (III),
𝐻 processes the symbols from the buffers by the simulation of the rules from 𝑀 and
𝑁. Whenever needed, 𝐻 reads from the input string some additional symbols using
the rules from (I). The input string is accepted by 𝐻 if and only if the whole input
string is read, all buffers are processed and emptied, and both (1) and (4) are final
states of 𝑀 and 𝑁, respectively.
To justify the maximum size of the buffers in (2), (3), (5), and (6), consider the
situation when the simulation of 𝑀 needs to read the input string by the strings of
length 𝑘, but the 𝑁’s right-hand sides of the simulated rules alternate between 1 and
𝑘 symbols. Then, we can observe a situation when a buffer contains 𝑘 − 1 symbols
and we have to read 𝑘 additional symbols from the input string before we can process
the first (or the last) 𝑘 symbols of the buffer. The question remains, however, whether
we can reliably exclude some of these situations and possibly further decrease the
size of the buffers in the states of 𝐻.
The rigorous proof of 𝐿 (𝐻▶◀ ↷ ) = 𝐿 (𝑀▶◀ ↷ ) ∩ 𝐿 (𝑁 ▶◀ ↷ ) is left to the reader. □
Theorem 4.22 Both DJFA▶▶ and DJFA◀◀ are not closed under intersection and
intersection with regular languages.
Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄, Δ, 𝑅1 , 𝑠, 𝐹). Define the GJFA 𝑁 ▶◀ ↷ =
(𝑄, Δ, 𝑅2 , 𝑠, 𝐹), where 𝑅2 is constructed in the following way. For each ( 𝑝, 𝑎, 𝑞) ∈
𝑅1 , add ( 𝑝, reversal(𝑎), 𝑞) to 𝑅2 . Note that by Lemma 4.3 and its proof, every
𝑥 ∈ 𝐿(𝑀▶◀ ↷ ) can be written as 𝑥 = 𝑢 1 𝑢 2 . . . 𝑢 𝑛 𝑢 𝑛 . . . 𝑢 2 𝑢 1 , where 𝑛 ∈ N, and
𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛; and where each 𝑢 𝑖 represents string 𝑎 from a certain rule.
Observe that each 𝑥 almost resembles an even palindrome. We just need to resolve
the individual parts |𝑢 𝑖 | > 1 for which the palindrome statement does not hold.
Nevertheless, observe that if we simply reverse each 𝑢 𝑖 individually, it will create
the reversal of the whole 𝑥. As a result, 𝐿 (𝑁 ▶◀ ↷ ) is a reversal of 𝐿 (𝑀▶◀ ↷ ). □
Theorem 4.24 Both DJFA▶▶ and DJFA◀◀ are not closed under reversal.
Theorem 4.25 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
finite substitution.
Theorem 4.26 DJFA▶◀ (DJFA◀▶ ) is closed under homomorphism and 𝜀-free ho-
momorphism.
Theorem 4.27 Both DJFA▶▶ and DJFA◀◀ are not closed under homomorphism
and 𝜀-free homomorphism.
that can accept string 𝑎𝑎𝑏𝑐𝑏𝑐; it surely has to start with reading two times only
symbol 𝑎, then it can read two times 𝑏𝑐 together. However, even in such a case
𝐿(𝑁 ▶▶ ↷ ) = {𝑎𝑏𝑐𝑎𝑏𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑎𝑏𝑐𝑏𝑐}; which is a proper superset of 𝜑(𝐾). There-
fore, there cannot be any GJFA 𝐻▶▶ ↷ that defines 𝜑(𝐾). Trivially, 𝜑 is also a general
homomorphism. The similar proof for DJFA◀◀ is left to the reader. □
Theorem 4.28 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
inverse homomorphism.
Proof Consider language 𝐿 = {𝑎𝑎}, which clearly belongs into DJFA▶◀ , DJFA▶▶ ,
and DJFA◀◀ . Define the homomorphism 𝜑 : {𝑎}∗ → {𝑎}∗ as 𝜑(𝑎) = 𝑎𝑎. By
applying 𝜑 −1 to 𝐿, we get 𝜑 −1 (𝐿) = {𝑎}. However, in consequence of Lemma 4.1,
we know that no 2-jumping mode can define such a language. □
We would like to remark that the resulting behavior of right-left 2-jumps has proven to
be very similar to the behaviors of 2-head finite automata accepting linear languages
(see Nagy [2012]) and 5′ → 3′ sensing Watson–Crick finite automata (see Nagy
[2008, 2010, 2013]). Although these models differ in details, the general concept
of their reading remains the same—all three mentioned models read simultaneously
from the two different positions on the opposite sides of the input string. The main
difference comes in the form of their rules. The other two models use more complex
rules that allow them to read two different strings on their reading positions. Con-
sequently, the resulting language families of these models differ from the language
family defined by right-left 2-jumps. Nonetheless, the connection to Watson–Crick
4.2 Multi-Parallel Jumping Finite Automata 85
models shows that the concept of synchronized jumping could potentially find its
use in the fields that study the correlations of several patterns such as biology or
computer graphics. A further study of the combined model of jumping and 5′ → 3′
Watson–Crick finite automata can be found in Section 4.4.
At the end, we propose some future investigation areas concerning JFAs that link
several jumps together. Within the previous sections, we have already pointed out
one open problem concerning right-left (and left-right) 2-jumps (Open Problem).
This section continues with other more general suggestions.
(I) Study decidability properties of the newly defined jumping modes.
(II) Investigate remaining possible variants of 2-jumps where the unrestricted single
jumps and the restricted single jumps are combined together.
(III) Extend the definition of 2-jumps to the general definition of 𝑛-jumps, where
𝑛 ∈ N. Can we find some interesting general results about these multi-jumps?
(IV) Study relaxed versions of 2-jumps where the single jumps do not have to follow
the same rule and where each single jump has its own state.
(V) Use the newly defined jumping modes in JFAs in which rules read single symbols
rather than whole strings (JFA—see Definition 3.2).
(VI) In the same fashion as in finite automata, consider deterministic versions of
GJFAs with the newly defined jumping modes.
is combined with the previously described concept, we get a model which is very
similar to 𝑛-parallel grammars. These automata utilize the jumping only during the
initialization, when the heads jump to their start positions. After that, all heads read
their parts of the input continuously in a left-to-right way. We compare these au-
tomata with 𝑛-parallel right-linear grammars and show that these models actually
represent the same language families.
Prerequisites
𝑛-parallel right-linear grammars were introduced and deeply studied in Wood [1973,
1975, 1977]; Rosebrugh and Wood [1973, 1974, 1975]. In order to state some results
about 𝑛-parallel jumping finite automata, we need to formally define so-called 𝑛-
parallel right-linear grammars (see Rosebrugh and Wood [1973, 1975]; Wood [1973,
1975]).
𝐿(𝐺) = 𝑤 ∈ Δ∗ | 𝑆 ⇒+𝐺 𝑤
4.2 Multi-Parallel Jumping Finite Automata 87
Definitions
𝑥 𝑝𝑦𝑧 ↷ 𝑥 ′ 𝑞𝑧 ′
𝜁1 $ · · · 𝜁 𝑛 $ 𝑛↷ 𝜗1 $ · · · 𝜗𝑛 $
Let 𝑤 ∈ Δ∗ . We say that 𝑀 accepts 𝑤 if and only if 𝑤 ∈ 𝐿 (𝑀, 𝑛). 𝑀 rejects 𝑤 if and
only if 𝑤 ∈ Δ∗ − 𝐿(𝑀, 𝑛).
88 4 Jumping Multi-Head Automata
𝜁1 𝜁2 𝜁𝑛
𝑝1 𝑝2 𝑝𝑛
𝜁1 𝜁2 𝜁𝑛
𝑝1 𝑝2 𝑝𝑛
𝑤 𝑝𝑦𝑥𝑧 𝑟 ↷ 𝑤𝑥𝑞𝑧
Let 𝑛 𝑋 denote the set of all 𝑛-configurations over 𝑀. The binary right 𝑛-
jumping relation, symbolically denoted by 𝑛−𝑟 ↷, over 𝑛 𝑋, is defined as follows.
Let 𝜁1 $ · · · 𝜁 𝑛 $, 𝜗1 $ · · · 𝜗𝑛 $ ∈ 𝑛 𝑋, so 𝜁𝑖 , 𝜗𝑖 ∈ 𝑋, 1 ≤ 𝑖 ≤ 𝑛; then, 𝑀 makes a right
n-jump from 𝜁1 $ · · · 𝜁 𝑛 $ to 𝜗1 $ · · · 𝜗𝑛 $, symbolically written as
𝜁1 $ · · · 𝜁 𝑛 $ 𝑛−𝑟 ↷ 𝜗1 $ · · · 𝜗𝑛 $
Let PGJFA♦𝑛 and PGJFA▶𝑛 denote the language families accepted by 𝑛-PGJFAs
and 𝑛-PGJFAs using only right 𝑛-jumps, respectively. These two kinds of models
are illustrated in Figures 4.5 and 4.6.
4.2 Multi-Parallel Jumping Finite Automata 89
Examples
𝑠𝑎 → 𝑝, 𝑝𝑏 → 𝑠, 𝑟𝑐 → 𝑞, 𝑞𝑑 → 𝑟
Starting from 𝑠𝑟, 𝑀 has to read some 𝑎 and 𝑏 with the first head and some 𝑐 and
𝑑 with the second head, entering again the start (and also the final) states 𝑠𝑟. If we
work with the unrestricted jumps, both heads can read the symbols in an arbitrary
order. However, if we work with the right jumps, both heads must read all symbols
in their original order; otherwise, the automaton will eventually get stuck. Therefore,
the accepted languages are
𝑠𝑎 → 𝑟, 𝑟𝑏 → 𝑡, 𝑡𝑐 → 𝑠
Starting from 𝑠𝑠, 𝑀 has to read some 𝑎, 𝑏, and 𝑐 with both heads, entering again the
start (and also the final) states 𝑠𝑠. Therefore, the accepted languages are
It can be easily shown that the languages accepted with unrestricted 𝑛-jumps in
Examples 4.9 and 4.10 cannot be defined by any original jumping finite automata.
In the case of languages accepted with right 𝑛-jumps, Example 4.9 defines a linear
language, but Example 4.10 defines only a regular language.
90 4 Jumping Multi-Head Automata
Proof The definition of the binary jumping relation is identical between GJFAs (see
Section 3.1) and 𝑛-PGJFAs (see Definition 4.4). Consequently, if 𝑛 = 1, both models
transit between configurations in the same way, and they also require the same
conditions for accepting configurations. Therefore, the only difference is in their
initial configurations since GJFAs have a single start state, but 1-PGJFAs have a set
of start states. Nonetheless, we can convert any 1-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹) into
the equivalent 1-PGJFA 𝑁 = (𝑄 ′ , Δ, 𝑅 ′ , {𝑠}, 𝐹) such that 𝑠 ∉ (𝑄 ∪ Δ), 𝑄 ′ = 𝑄 ∪ {𝑠},
and 𝑅 ′ = 𝑅 ∪ {𝑠 → 𝑠′ | 𝑠′ ∈ 𝑆}. Then, the conversions between GJFAs and 1-PGJFAs
are trivial. □
Proof (by contradition) We extend the reasoning from Lemma 3.3 that shows that
there is no GJFA that accepts {𝑎}∗ {𝑏}∗ . For the sake of contradiction, assume that,
for some 𝑛 ≥ 1 and 𝑚 > 𝑛, there is a 𝑛-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹) such that
Δ = {𝑎 1 , . . . , 𝑎 𝑚 } and 𝐿(𝑀, 𝑛) = {𝑎 1 }∗ · · · {𝑎 𝑚 }∗ . Then, some of the heads of 𝑀
must handle at least two types of symbols. Assume any 𝑤 1 𝑢𝑣𝑤 2 ∈ 𝐿(𝑀, 𝑛) such
that 𝑢𝑣 is a whole part read with one head, 𝑢𝑣 contains at least two types of symbols,
𝑣 is read in a single step, |𝑢| ≥ 1, and |𝑣| ≥ 1. Clearly, for any 𝑛 ≥ 1 and 𝑚 > 𝑛,
there has to exist some 𝑤 1 𝑢𝑣𝑤 2 ∈ 𝐿 (𝑀, 𝑛) that satisfy these conditions. Due to the
behavior of the unrestricted 𝑛-jumps, it must then also hold that 𝑤 1 𝑣𝑢𝑤 2 ∈ 𝐿(𝑀, 𝑛);
however, 𝑤 1 𝑣𝑢𝑤 2 ∉ {𝑎 1 }∗ · · · {𝑎 𝑚 }∗ . That is a contradiction with the assumption
that 𝐿 (𝑀, 𝑛) = {𝑎 1 }∗ · · · {𝑎 𝑚 }∗ . Therefore, there is no 𝑛-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹)
such that 𝑛 ≥ 1, 𝑚 > 𝑛, Δ = {𝑎 1 , . . . , 𝑎 𝑚 }, and 𝐿 (𝑀, 𝑛) = {𝑎 1 }∗ · · · {𝑎 𝑚 }∗ . □
Proof First, we show that, for all 𝑛 ≥ 1, PGJFA♦𝑛 ⊆ PGJFA♦(𝑛+1) . For any 𝑛-PGJFA
𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹) we can construct the (𝑛+1)-PGJFA 𝑁 = (𝑄 ′ , Δ, 𝑅 ′ , 𝑆 ′ , 𝐹 ′ ) such
4.2 Multi-Parallel Jumping Finite Automata 91
With Theorems 4.29 and 4.30, we can easily derive the following additional
characterization of the language families accepted by 𝑛-PGJFAs with unrestricted
𝑛-jumps.
Proof This theorem directly follows from FIN ⊂ GJFA (see Theorem 3.8). □
Proof This theorem directly follows from the fact that there is a GJFA 𝑀 =
(𝑄, Δ, 𝑅, 𝑠, 𝐹) such that Δ = {𝑎, 𝑏, 𝑐} and 𝐿 (𝑀) = {𝑤 ∈ Δ∗ | occur(𝑤, 𝑎) =
occur(𝑤, 𝑏) = occur(𝑤, 𝑐)} which is a well-known non-context-free language (see
Example 3.1). □
Proof The jumps of GJFAs can be simulated by linear bounded automata (see
Theorem 3.11), and the same also holds for the 𝑛-jumps of 𝑛-PGJFAs. Thus, for all
𝑛 ≥ 1, PGJFA♦𝑛 ⊆ CS. From Lemma 4.16, for all 𝑛 ≥ 1, CS − PGJFA♦𝑛 ≠ ∅. □
𝑀 = ({ 𝑓 } ∪ 𝑁1 ∪ · · · ∪ 𝑁 𝑛 , Δ, 𝑅, 𝑆2 , { 𝑓 }),
Observe that the constructed 𝑛-PGJFA 𝑀 with right 𝑛-jumps simulates the 𝑛-
PRLG 𝐺 in such a way that its heads read symbols in the same fashion as the
nonterminals of 𝐺 generate them.
Any sentence 𝑤 ∈ 𝐿 (𝐺) can be divided into 𝑤 = 𝑢 1 · · · 𝑢 𝑛 , where 𝑢 𝑖 represents
the part of the sentence which can be generated from the nonterminal 𝑋𝑖 of a rule
𝑆1 → 𝑋1 · · · 𝑋𝑛 , 𝑋𝑖 ∈ 𝑁𝑖 , 1 ≤ 𝑖 ≤ 𝑛. In the same way, 𝑀 can start from an 𝑛-
configuration 𝑋1 𝑢 1 $ · · · 𝑋𝑛 𝑢 𝑛 $, where the heads with the states 𝑋𝑖 have to read 𝑢 𝑖 .
Therefore the part (1), where we convert the rules 𝑆1 → 𝑋1 · · · 𝑋𝑛 into the start state
strings, and the selection of a start state string thus covers the first derivation step of
the grammar.
Any consecutive non-final derivation step of the grammar then rewrites all 𝑛
nonterminals in the sentential form with the rules of the form 𝑋 → 𝑎𝑌 , 𝑋, 𝑌 ∈ 𝑁𝑖 ,
for some 𝑖, 1 ≤ 𝑖 ≤ 𝑛, 𝑎 ∈ Δ∗ . Therefore the part (2), where we convert the grammar
rules 𝑋 → 𝑎𝑌 into the automaton rules 𝑋𝑎 → 𝑌 . The automaton 𝑀 always works
with all its heads simultaneously, and thus the equivalent effect of these steps should
be obvious.
In the last derivation step of the grammar, every nonterminal is rewritten with a
rule of the form 𝑋 → 𝑎, 𝑋 ∈ 𝑁𝑖 , for some 𝑖, 1 ≤ 𝑖 ≤ 𝑛, 𝑎 ∈ Δ∗ . We can simulate the
same behavior in the automaton if we end up in a final state from which there are no
ongoing rules. Therefore the part (3), where we convert the grammar rules 𝑋 → 𝑎
into the automaton rules 𝑋𝑎 → 𝑓 , where 𝑓 is the sole final state. All heads of the
automaton must also end up in this final state simultaneously, or the automaton will
get stuck; there are no ongoing rules from 𝑓 , and all heads must make a move during
every step.
The automaton 𝑀 can also start from an 𝑛-configuration where the input is divided
into such parts that they cannot be generated from the nonterminals 𝑋𝑖 of the rules
𝑆1 → 𝑋1 · · · 𝑋𝑛 , 𝑋𝑖 ∈ 𝑁𝑖 , 1 ≤ 𝑖 ≤ 𝑛. However, such an attempt will eventually get
the automaton stuck because 𝑀 simulates only the derivation steps of the grammar.□
Lemma 4.18 For every 𝑛-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆2 , 𝐹) using only right 𝑛-jumps,
there is an 𝑛-PRLG 𝐺 = (𝑁1 , . . . , 𝑁 𝑛 , Δ, 𝑆1 , 𝑃) such that 𝐿 (𝐺) = 𝐿 (𝑀, 𝑛−𝑟).
Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑆2 , 𝐹) be an 𝑛-PGJFA with right 𝑛-jumps. Keep the same
𝑛 and define the 𝑛-PRLG
𝐺 = (𝑁1 , . . . , 𝑁 𝑛 , Δ, 𝑆1 , 𝑃),
Observe that the constructed 𝑛-PRLG 𝐺 simulates the 𝑛-PGJFA 𝑀 with right
𝑛-jumps in such a way that its nonterminals generate terminals in the same fashion
as the heads of 𝑀 read them.
The definition of 𝑛-PRLGs requires that 𝑁1 , . . . , 𝑁 𝑛 are mutually disjoint non-
terminal alphabets. However, the states of 𝑛-PGJFAs do not have such a restriction.
Therefore, we use a new index in all converted occurrences of states; this creates
a separate item for each nonterminal position. The index is represented by 𝑖 and is
used in all conversion steps.
Any sentence 𝑤 ∈ 𝐿(𝑀, 𝑛−𝑟) can be divided into 𝑤 = 𝑢 1 · · · 𝑢 𝑛 , where 𝑢 𝑖
represents the part of the sentence which can be accepted by the head of 𝑀 with
a start state 𝑝 𝑖 from a start 𝑛-configuration 𝑝 1 𝑢 1 $ · · · 𝑝 𝑛 𝑢 𝑛 $, where 𝑝 1 · · · 𝑝 𝑛 ∈ 𝑆2 ,
1 ≤ 𝑖 ≤ 𝑛. In the grammar, we can simulate the start 𝑛-configurations with the rules
𝑆1 → 𝑝 11 · · · 𝑝 𝑛𝑛 , where the nonterminals 𝑝 𝑖𝑖 must be able to generate 𝑢 𝑖 . Therefore
the part (2), where we convert the start state strings into the rules.
During every step of the automaton all heads simultaneously make a move.
Likewise, during every non-initial step of the grammar all non-terminals are simul-
taneously rewritten. Therefore the part (3), where we convert the automaton rules
𝑝𝑦 → 𝑞 into the grammar rules 𝑝 𝑖 → 𝑦𝑞 𝑖 . The equivalent effect of these steps
should be obvious.
The automaton can successfully end if all its heads are in the final states. We can
simulate this situation in the grammar if we rewrite every nonterminal to 𝜀. Therefore
the part (4), where we create new erasing rules for all final states. These rules can
be used only once during the last derivation step of the grammar; otherwise, the
generation process of the grammar will get stuck. □
Theorem 4.34 PGJFA▶𝑛 = 𝑛-PRL.
Proof 𝑛-PRL ⊆ PGJFA▶𝑛 follows from Lemma 4.17. PGJFA▶𝑛 ⊆ 𝑛-PRL follows
from Lemma 4.18. □
With Theorem 4.34 we can easily derive the following additional characterization
of the language families accepted by 𝑛-PGJFAs using only right 𝑛-jumps.
Theorem 4.35 For all 𝑛 ≥ 1, PGJFA▶𝑛 ⊂ PGJFA▶ (𝑛+1) .
Proof This theorem directly follows from 𝑛-PRL ⊂ (𝑛+1)-PRL (see Rosebrugh
and Wood [1975]). □
Theorem 4.36 For all 𝑛 ≥ 1, PGJFA▶𝑛 is closed under union, finite substitution,
homomorphism, reflection, and intersection with a regular set.
Proof This theorem directly follows from the same results for 𝑛-PRL (see Rosebrugh
and Wood [1975]). □
Theorem 4.37 For all 𝑛 ≥ 2, PGJFA▶𝑛 is not closed under intersection or comple-
ment.
Proof This theorem directly follows from the same results for 𝑛-PRL (see Rosebrugh
and Wood [1975]). □
94 4 Jumping Multi-Head Automata
CS
PGJFA▶n = n-PRL
..
PGJFA♦n CF .
..
.
PGJFA▶2 = 2-PRL
PGJFA♦2
FIN
Concluding Remarks
The presented results show that the concept of the parallel jumping has a positive
effect on the model of jumping finite automata. The most significant part of these
4.3 Jumping Watson–Crick Finite Automata 95
results is the fact that every additional head always increases the power of these
automata, and this is true for both the unrestricted and right 𝑛-jumping relation.
Therefore, this creates two infinite hierarchies of language families. Next, due to
the very simple conversions and similar concepts, we can see 𝑛-parallel general
jumping finite automata using only right 𝑛-jumps as a direct counterpart to 𝑛-parallel
right-linear grammars. There are already other automata with the same power as 𝑛-
parallel right-linear grammars (e.g., self-regulating finite automata, see Meduna and
Masopust [2007]); however, they use considerably different mechanisms, and the
conversions between models are not straightforward. Therefore, they would hardly
qualify as a direct counterpart. Furthermore, with a little bit of tweaking, we could
easily adjust our model so that it coincides with other well-known grammars that
synchronously rewrite several nonterminals at once, e.g., right-linear simple matrix
grammars (see Ibarra [1970]). On the other hand, considering 𝑛-parallel general
jumping finite automata with unrestricted 𝑛-jumps, due to their unconventional
behavior we were not able to find a fitting counterpart for them in grammars. It is
possible that no such counterpart exists, and it would need to be introduced; as it was
with general jumping finite automata and their counterpart in the form of jumping
grammars (see Křivka and Meduna [2015]).
Finally, we propose some suggestions for further investigation.
(I) In this section, we have considered only the situation where all heads keep their
own state and always work synchronously together. Investigate other options,
where, e.g., all heads follow a single state, not all heads have to make a move
during the 𝑛-jump, or only one head can make a move during the 𝑛-jump.
(II) Consider other grammars that rewrite several nonterminals at once for which
there is no direct counterpart in the form of an automaton model. Can we use
the concept of the parallel jumping to introduce such a model?
(III) Study closure and decidability properties for 𝑛-parallel general jumping finite
automata with unrestricted 𝑛-jumps.
↶ ↷
... 𝑎 ... upper strand
𝑝
is a finite sef of rules. For better readability, a rule is written in the form
𝑦1
𝑝 𝑦2 →𝑞
𝑦1 𝑉∗
where 𝑝, 𝑞 ∈ 𝑄 and 𝑦2 ∈ 𝑉∗ .
Δ∗ Δ∗ 𝑥1 𝑦1 𝑧1 𝑥1′ 𝑧1′
A configuration of JWKFA 𝑀 is a string from Δ∗ 𝑄 Δ∗ . For 𝑥2 𝑦2 𝑧2 , 𝑥2′ 𝑧2′
∈
WK𝜌 (Δ) and 𝑝, 𝑞 ∈ 𝑄, we write
𝑥1 𝑦1 𝑧1 𝑥1′ 𝑧′
𝑥2 𝑝 𝑦2 𝑧2 𝑊𝐾
↷ 𝑥2′
𝑞 𝑧1′
2
𝑦1 𝑥1 𝑧1 𝑥1′ 𝑧1′
if and only if 𝑝 𝑦2 → 𝑞 ∈ 𝑅 and 𝑥2 𝑧2 = 𝑥2′ 𝑧2′
.
In the standard manner, let us extend 𝑊𝐾 ↷ to 𝑊𝐾 ↷𝑛 , where 𝑛 ≥ 0; then, based on
𝑊𝐾
↷𝑛 , let us define 𝑊𝐾 ↷+ and 𝑊𝐾 ↷∗ . The accepted language, denoted by 𝐿 (𝑀),
is defined as
n o
𝐿(𝑀) = 𝑢𝑣 | 𝑢𝑢′ 𝑠 𝑣𝑣′ 𝑊𝐾 ↷ 𝑓 , where 𝑓 ∈ 𝐹, 𝑢, 𝑣, 𝑢 ′ , 𝑣 ′ ∈ Δ∗ , 𝑢𝑢𝑣
′ 𝑣′ ∈ WK 𝜌 (Δ)
𝑎 𝑎𝑏𝑏𝑐𝑐 𝜀 𝑎𝑏𝑐𝑐 𝑐𝑐 𝜀
𝑎𝑎𝑏𝑏𝑐𝑐 𝑠 𝜀 𝑊𝐾
↷ 𝑎𝑎𝑏𝑏𝑐𝑐 𝑠 𝜀 𝑊𝐾
↷ 𝑎𝑎𝑏𝑏 𝑠 𝑏𝑐𝑐 𝑊𝐾
↷
𝑐𝑐 𝜀 𝑎𝑎𝑏𝑐 𝑐𝑐 𝑎𝑎𝑏𝑐𝑐 𝑐
𝑎𝑎 𝑞 𝑏𝑐 𝑊𝐾
↷ 𝑎 𝑞 𝑎𝑏𝑐𝑐𝑐 𝑊𝐾
↷ 𝑎𝑎 𝑓 𝑎𝑏𝑐𝑐𝑐 𝑊𝐾
↷ 𝑓
From 𝑅, the upper strand in state 𝑠 checks that the same amount of 𝑎s precedes all
𝑏s. Then, the rules applied in the lower strand handle the check of the same amount
of 𝑏s and 𝑐s. In addition, these same rules check that 𝑏s occurs before 𝑐s. Altogether,
the language accepted by 𝑀 is 𝐿 (𝑀) = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 1}+ which is non-context-free
language.
As an exercise, observe that modeling just {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 1} without the positive
iteration as in Example 4.11 is problematic or even impossible (see Lemma 4.21).
98 4 Jumping Multi-Head Automata
Example 4.12 Let a JWKFA 𝑀 = ({𝑠, 𝑝, 𝑞, 𝑟, 𝑡}, {𝑎, 𝑏, 𝑐}, 𝜌, 𝑅, 𝑠, {𝑠, 𝑝, 𝑞, 𝑟, 𝑡}),
where 𝜌 is the identity relation and 𝑅 consists of
𝑎
𝑠 𝜀 → 𝑝, 𝑝 𝑏𝜀 → 𝑞, 𝑞 𝑐𝜀 → 𝑠,
𝑠 𝑎𝜀 → 𝑟, 𝑟 𝑏𝜀 → 𝑡, 𝑡 𝑐𝜀 → 𝑠 .
By analogy with the variants of WKFAs (see Definition 2.7), based on the form of
rules, we define the corresponding variants of JWKFAs.
Definition 4.7 A JWKFA 𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹) is
(i) stateless, if 𝑄 = 𝐹 = {𝑠};
(ii) all-final, if 𝑄 = 𝐹;
(iii) simple, if ( 𝑝, 𝑣𝑣12 , 𝑞) ∈ 𝑅 implies 𝑣 1 = 𝜀 or 𝑣 2 = 𝜀;
(iv) 1-limited, if ( 𝑝, 𝑣𝑣12 , 𝑞) ∈ 𝑅 implies |𝑣 1 𝑣 2 | = 1.
The families of languages accepted by stateless, all-final, simple, and 1-limited
JWKFAs are denoted by NJWK, FJWK, SJWK, and 1JWK, respectively.
Some of these restrictions, if it makes sense, can be pairwise combined to get
four language families F1JWK, N1JWK, FSJWK, and NSJWK.
The language accepted by 𝑀, 𝐿(𝑀) = {𝑎𝑏}∗ . Note that the second rule helps to
maintain that in any strand 𝑎𝑏 cannot be inserted in the middle of another substring
𝑎𝑏.
Reconsider the automaton from Example 4.12. Observe that it represents, in fact,
a 1-limited variant of JWKFAs, thus illustrating (iv) in Definition 4.7.
Another example shows that even without states (the set of state is a singleton),
it is possible to model a language with the strings containing the same numbers of
three different symbols.
Example 4.14 Consider a stateless JWKFA 𝑀 = ({𝑝}, {𝑎, 𝑏, 𝑐}, 𝜌, 𝑅, 𝑝, {𝑝}). Note
that 𝑄 = {𝑝}, the start state 𝑝, and 𝐹 = 𝑄 are constants, so these are omitted from
the definition sometimes.
𝑅 = 𝑝 𝑏𝑎 → 𝑝, 𝑝 𝑏𝑐 → 𝑝, 𝑝 𝑎𝜀 → 𝑝, 𝑝 𝑐𝜀 → 𝑝
4.3 Jumping Watson–Crick Finite Automata 99
In this subsection, we recall main results and properties of JWKFAs and their
variants.
Lemma 4.19 (Mahalingam et al. [2019]) GJFA ⊂ SJWK and JFA ⊆ 1JWK
Using anologous technique to the proof of Lemma 3.3, we get the following result.
Proof (sketch) Let 𝐾 ∈ FIN contain 𝑛 ≥ 0 strings. When described using a simple
JWKFA 𝑀, for each 𝑤 𝑖 ∈ 𝐾, 1 ≤ 𝑖 ≤ 𝑛, two rules are constructed of the form
𝑤𝑖 𝜀
𝑠 𝜀 → 𝑞𝑖 and 𝑞𝑖 𝑤𝑖 → 𝑓
such that 𝑠 is a start state and 𝑓 the only final state of 𝑀. Obviously, 𝐿(𝑀) = 𝐾.
Therefore, FIN ⊆ SJWK. An infinite non-context-free language accepted by a
simple JWKFA in Example 4.12 proves the strictness of the inclusion, so FIN ⊂
SJWK. □
Similarly to the construction in the proof of Lemma 4.22, we can demonstrate that
FIN ⊂ FJWK. In details, we make 𝑄 = 𝐹 and ignore 𝜀 in the inspiring construction.
In what follows, we explore some relations between variants of JWKFAs.
Conclusion
CS
CF JWK = SJWK
1JWK
FJWK
REG
NJWK
FIN
Fig. 4.9 JWK and its language family relationships given in Mahalingam et al. [2019, 2020].
More recently, new variants of the WKFA model were introduced that process the
input in non-conventional ways. In a 5′ → 3′ Watson–Crick finite automaton (5′ →
3′ WKFA; see Nagy [2008, 2010, 2013, 2020]), both heads read their specific strand
in the biochemical 5′ to 3′ direction. From a computing point of view, this means
that they read the DS string in opposite directions. Furthermore, a 5′ → 3′ WKFA
is sensing if the heads sense that they are meeting each other, and the processing of
the input ends if for each pair of the sequence one of the letters is read. The sensing
5′ → 3′ WKFAs generally accept the family of linear languages. This concept is
also studied further in several follow-up papers that explore alternative definitions
and combinations with different mechanics (see Nagy and Kovács [2019]; Nagy and
Otto [2019, 2020]; Nagy and Parchami [2020]; Nagy et al. [2017]; Parchami and
Nagy [2018]).
Even though these two groups significantly differ in their original definitions,
their newer models sometimes work in a very similar way. Both concepts are also
not mutually exclusive in a single formal model. This section defines jumping 5′ → 3′
Watson–Crick finite automaton—a combined model of GJFAs and sensing 5′ → 3′
WKFAs—and studies their characteristics. We primarily investigate the accepting
power of the model and also the effects of common restrictions on the model.
To recall the notion of WKFA discussed in Section 2.2.3, a WKFA is 𝑀 =
(𝑄, Δ, 𝜌, 𝛿, 𝑞 0 , 𝐹), where 𝑄, Δ, 𝑞 0 , and 𝐹 are the same as in FAs, 𝜌 ⊆ ∗Δ × Δ is a
symmetric relation (of complementarity), and the mapping 𝛿 : (𝑄 × ΔΔ∗ ) → 2𝑄
𝑤1
is a transition function such that 𝛿(𝑞, 𝑤2 ) ≠ ∅ only for finitely many triples
(𝑞, 𝑤 1 , 𝑤 2 ) ∈ 𝑄 × Δ∗ × Δ∗ .
The elementary difference between FAs and WKFAs, besides the doubled tape,
is the number of heads. WKFAs scan each of the two strands of the tape separately
with a unique head. In classical WKFAs, the heads scan both strands from left
to right, and the processing of the input sequence ends when all complementary
pairs of the DS string are read
with
both heads. The language accepted by 𝑀 is
𝐿(𝑀) = {𝑤 1 ∈ Δ∗ | 𝑠 𝑤 1
𝑤2 ⊨ ∗ 𝑤1 𝑓 , 𝑓 ∈ 𝐹, 𝑤1 ∈ WK (Δ)}.
𝑤2 𝑤2 𝜌
Let us recall the most important restricted variants of WKFAs usually studied in
the literature (see Definition 2.7):
• stateless (N): if 𝑄 = 𝐹 = {𝑞 0 };
• all-final (F): if 𝑄 = 𝐹;
• simple (S): at most one head moves in a rewriting step;
• 1-limited (1): exactly one symbol is being read in a rewriting step.
By combining these constraints, we identify additional variants such as NS, FS,
N1, and F1 WKFAs.
In 5′ → 3′ WKFAs (see Nagy [2008, 2010, 2013]; Nagy et al. [2017]),
both heads start from the biochemical 5′ end of the appropriate strand. Physi-
cally/mathematically and from a computing point of view, they read the DS string in
opposite directions, while biochemically they go in the same direction. A 5′ → 3′
WKFA is sensing if the heads sense that they are meeting (i.e., they are close enough
to meet in the next step or there is a possibility to read strings at overlapping posi-
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 103
tions). In sensing 5′ → 3′ WKFAs, the processing of the input sequence ends when
for each pair of the sequence precisely one of the letters is read. Since the original WK
complementarity (in biology) is not only symmetric but also a one-to-one relation,
we consider the input sequence to be fully processed, and thus the automaton makes
a decision on the acceptance. Actually, it is a very natural assumption/restriction for
most of the 5′ → 3′ WK automata models that 𝜌 defines a bijection on Δ.
Definition ∗
4.8 In WKFAs, the state transition 𝛿 is usually a mapping of the form
(𝑄 × ΔΔ∗ ) → 2𝑄 . To help define an extended state transition 𝛿 ′ for sensing 5′ → 3′
′ 𝑤1
WKFAs, in the transition 𝑞 ∈ 𝛿(𝑞, 𝑤2 ), we call 𝑟 𝑙 = |𝑤 1 | and 𝑟 𝑟 = |𝑤 2 | the left and
right radius of the transition (they are the lengths of the strings that the heads will read
respectively). The value 𝑟 = 𝑟 𝑙 +𝑟 𝑟
from left to right and from right to left in this step,
is the radius of the transition. Since 𝛿(𝑞, 𝑤 1
𝑤2 ) is nonempty only for finitely many
triples (𝑞, 𝑤 1 , 𝑤 2 ), there is a transition (maybe more) with the maximal radius for a
given automaton. We extend 𝛿 to 𝛿 ′ with a sensing condition in the following ∗
way:
Let 𝑟 max be the maximal radius among all rules. Then, let 𝛿 ′ : (𝑄 × 𝑉 𝑉∗ × 𝐷) → 2𝑄 ,
where 𝐷 is the sensing distance set {−∞, 0, 1, . . . , 𝑟 max , +∞}. This set gives the
distance of the two heads between 0 and 𝑟 max , +∞ when the heads are further than
𝑟 max , or −∞ when the heads are after their meeting point. Trivially, this automaton is
finite, and 𝐷 can be used only to control the sensing (i.e., the appropriate meeting of
the heads). To describe the work of the automata, we use the concept of configuration.
𝑤1′
A configuration 𝑤 1
𝑤2 (𝑞, 𝑠) 𝑤2′ consists of the state 𝑞, the current sensing distance
𝑤 𝑤′
𝑠, and the input 𝑤1 𝑤1′ ∈ WK𝜌 (𝑉) in such a way that the first head (on the upper
2 2
strand) has already processed the part 𝑤 1 , while the second head (on the lower strand)
has already processed 𝑤 2′ . A step of the sensing 5′ → 3′ WKFA, according to the
state transition function 𝛿 ′ , can be of the following two types:
𝑥𝑤 ′ 𝑤′
(1) Normal steps: 𝑤𝑤21𝑦 (𝑞, +∞) 𝑤 ′1 ⇒ 𝑤𝑤12𝑥 (𝑞 ′ , 𝑠) 𝑦𝑤1′ ,
2 2
for 𝑤 1 , 𝑤 2 , 𝑤 1′ , 𝑤 2′ , 𝑥, 𝑦 ∈ 𝑉 ∗ with |𝑤 2 𝑦| − |𝑤 1 | > 𝑟 max , 𝑞, 𝑞 ′ ∈ 𝑄,
𝑤 𝑥𝑤 ′
if 𝑤1 𝑦𝑤1′ ∈ WK𝜌 (𝑉) and 𝑞 ′ ∈ 𝛿 ′ (𝑞, 𝑦𝑥 , +∞),
2 2(
|𝑤 2 | − |𝑤 1 𝑥| if |𝑤 2 | − |𝑤 1 𝑥| ≤ 𝑟 max ;
and 𝑠 =
+∞ in other cases.
𝑥𝑤 ′ 𝑤′
(2) Sensing steps: 𝑤2 𝑦 (𝑞, 𝑠) 𝑤 ′1 ⇒ 𝑤𝑤12𝑥 (𝑞 ′ , 𝑠′ ) 𝑦𝑤1′ ,
𝑤1
2 2
for 𝑤 1 , 𝑤 2 , 𝑤 1′ , 𝑤 2′ , 𝑥, 𝑦 ∈ 𝑉 ∗ and 𝑠 ∈ {0, 1, . . . , 𝑟 max } with 𝑠 = |𝑤 2 𝑦| − |𝑤 1 |,
𝑤 𝑥𝑤 ′
if 𝑤1 𝑦𝑤1′ ∈ WK𝜌 (𝑉) and 𝑞 ′ ∈ 𝛿 ′ (𝑞, 𝑦𝑥 , 𝑠),
2 2(
Definitions
↶
3′ 5′
... 𝑎 ...
𝑝
5′ 3′
... 𝑏 ...
↷
interest to study variants of jumping finite automata with more streamlined behavior.
Indeed, there are already one-way jumping finite automata with fully deterministic
behavior introduced in Chigahara et al. [2016] (see Section 3.2). Nonetheless, another
option is to only limit the amount of possibilities of how the heads of the automaton
can jump.
With a simple direct approach, it is possible to fit the jumping mechanism straight-
forwardly into the original definition of sensing 5′ → 3′ WKFAs, investigated in
Kocman et al. [2022]. Note that we are now tracking only the meeting event of the
heads as it was introduced in Nagy et al. [2017] and not the original precise sensing
distance from Nagy [2008, 2010, 2013].
Now, we show that 𝑀 and 𝑁 accept the same language. We say that a current
configuration of 𝑀 ′
is potentially
valid if 𝑀 can still potentially reach some accepting
configuration 𝑤𝜀1 (𝑞 𝑓 , ⊖) 𝑤𝜀′ , 𝑞 𝑓 ∈ 𝐹, where 𝑤 1′ = 𝑎 1 𝑎 2 · · · 𝑎 𝑛 , 𝑤 2′ = 𝑏 1 𝑏 2 · · · 𝑏 𝑛 ,
2
𝑎 𝑖 , 𝑏 𝑖 ∈ (Δ ∪ {#}), and either 𝑎 𝑖 = # and 𝑏 𝑖 ∈ Δ, or 𝑎 𝑖 ∈ Δ and 𝑏 𝑖 = #, for all
𝑖 = 1, . . . , 𝑛, 𝑛 = |𝑤 1′ |. Observe that the condition regarding #’s can be checked
continuously and individually for each pair 𝑏𝑎𝑖𝑖 that was already passed by both
heads. The following description thus considers only the configurations of 𝑀 that
are still potentially valid.
Let us explore how 𝑀 can be simulated with 𝑁. The accepting process of 𝑀 can
be divided into three distinct stages:
(1) Before the heads meet (the mutual position of heads remains ⊕): The reading
steps of 𝑀 clearly correspond with the ⊕-reading steps of 𝑁—the processed
positions are marked with # in both models. Likewise, the jumping steps of 𝑀
clearly correspond with the ⊕-jumping steps of 𝑁—the passed positions are left
unchanged for the other head in both models.
(2) The meeting point of heads (when the mutual position changes from ⊕ to ⊖): The
same steps as in (1) are still applicable. The difference is that in 𝑀 the heads can
cross each other, but in 𝑁 the heads must meet each other precisely. However,
the crossing situations in 𝑀 that lead to potentially valid configurations are quite
limited. Assume that the heads of 𝑀 cross each other, the ▶-head reads/skips 𝑢
and the ◀-head reads/skips 𝑣, then:
(a) If |𝑢| > 1 and |𝑣| > 1, the resulting configuration cannot be potentially
valid since some pair 𝑏𝑎𝑖𝑖 was either read or skipped by both heads.
(b) If |𝑢| > 1 and |𝑣| = 0: Considering a reading step, all symbols from 𝑢 that are
read after the meeting point must be skipped by the ◀-head. However, since
jumping steps can occur arbitrarily, there is also an alternative sequence of
steps in 𝑀 where the heads precisely meet, the ◀-head jumps afterward,
and the same configuration is reached. Moreover, any jumping step can be
replaced with several shorter jumping steps.
(c) If |𝑢| = 0 and |𝑣| > 1, the situation is analogous to (b).
Thus, 𝑁 does not need to cover these crossing situations.
(3) After the heads meet (the mutual position of heads is ⊖): To keep the current con-
figuration potentially valid, 𝑀 can use reading steps only on positions that were
not yet read. Correspondingly, 𝑁 can use ⊖-reading steps on positions that do
not contain #. Also, 𝑀 can effectively use jumping steps only on positions that
were already read. Correspondingly, 𝑁 can use ⊖-jumping steps on positions
that contain #.
108 4 Jumping Multi-Head Automata
From the previous description, it is also clear that 𝑁 cannot accept additional
inputs that are not accepted by 𝑀 since it follows identical state transitions, and the
steps behave correspondingly between models. Thus, 𝐿(𝑁) = 𝐿(𝑀).
A rigorous version of this proof is rather lengthy but straightforward, so we left
it to the reader. □
Lemma 4.25 For every jumping 5′ → 3′ WKFA 𝑀, there is a sensing 5′ → 3′
WKFA with jumping feature 𝑁 such that 𝐿(𝑀) = 𝐿 (𝑁).
Proof Consider any jumping 5′ → 3′ WKFA 𝑀 = (Δ, 𝑄, 𝑞 0 , 𝐹, 𝛿). Define the
sensing 5′ → 3′ WKFA with jumping feature 𝑁 = (Δ, 𝜌, 𝑄, 𝑞 0 , 𝐹, 𝛿 ′ ), where 𝜌 =
{(𝑎, 𝑎) | 𝑎 ∈ Δ} and 𝛿 ′ (𝑞, 𝑤1 ∗
𝑤2 , 𝑠) = 𝛿(𝑞, 𝑤 1 , 𝑤 2 , 𝑠) for all 𝑞 ∈ 𝑄, 𝑤 1 , 𝑤 2 ∈ Δ , and
𝑠 ∈ {⊕, ⊖}.
To show that 𝑀 and 𝑁 accept the same language, we can follow the reasoning
described in the proof of Lemma 4.24. The simulation of 𝑀 with 𝑁 is trivial since
any ⊕/⊖-reading/jumping step of 𝑀 can be easily simulated with a reading/jumping
step of 𝑁. Moreover, for the simulated steps, it is guaranteed that the condition
regarding #’s holds. Finally, 𝑁 is clearly not able to accept additional inputs that are
not accepted by 𝑀. Thus, 𝐿(𝑁) = 𝐿 (𝑀). □
Proposition 4.1 The models of Definitions 4.9 and 4.10 accept the same family of
languages.
Proof This proposition follows directly from Lemmas 4.24 and 4.25. □
Hereafter, we primarily use Definition 4.10.
Examples
with the state transition function 𝛿: 𝛿(𝑠, 𝑎, 𝑏, ⊕) = {𝑠} and 𝛿(𝑠, 𝑎, 𝑏, ⊖) = {𝑠}.
Starting from 𝑠, 𝑀 can either utilize the jumping or read simultaneously with both
heads (the ▶-head reads 𝑎 and the ◀-head reads 𝑏), and it always stays in the sole
state 𝑠. Now, consider the inputs 𝑎𝑎𝑎𝑏𝑏𝑏 and 𝑏𝑎𝑎𝑏𝑏𝑎. The former can be accepted
by using three ⊕-readings and one ⊖-jumping:
The latter input is more complex and can be accepted by using one ⊕-jumping, two
⊕-readings, one ⊖-jumping, and one ⊖-reading:
It is not hard to see that, by combining different types of steps, we can accept any
input containing the same number of 𝑎’s and 𝑏’s, and thus 𝐿 (𝑀) = 𝐿.
with the state transition function 𝛿: 𝛿(𝑠, 𝑎, 𝑏, ⊕) = {𝑠}. Observe that this is almost
identical to Example 4.15; however, we cannot use the ⊖-reading anymore. Conse-
quently, we also cannot effectively use the ⊕-jumping because there is no way to
process remaining symbols afterward. As a result, the accepted language changes to
𝐿 (𝑀) = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}.
Lastly, we give a more complex example that uses all parts of the model.
General Results
These results cover the general behavior of jumping 5′ → 3′ WKFAs without any
additional restrictions on the model. Let Sen5′→ 3′ WK, J5′→ 3′ WK, GJFA, and
JFA denote the language families accepted by sensing 5′ → 3′ WKFAs, jumping
5′ → 3′ WKFA, GJFAs, and JFAs, respectively.
Considering previous results on other models that use the jumping mechanism
(see Meduna and Zemek [2012, 2014]; Křivka and Meduna [2015]; Kocman et al.
[2016, 2018]), it is a common characteristic that they define language families that
are incomparable with the classical families of regular, linear, and context-free
languages. On the other hand, sensing 5′ → 3′ WKFAs (see Nagy [2008, 2010,
110 4 Jumping Multi-Head Automata
2013]; Nagy et al. [2017]) are closely related to the family of linear languages.
First, we show that the new model is able to accept all linear languages and that its
accepting power goes even beyond the family of linear languages.
Lemma 4.26 For every sensing 5′ → 3′ WKFA 𝑀1 , there is a jumping 5′ → 3′
WKFA 𝑀2 such that 𝐿 (𝑀1 ) = 𝐿(𝑀2 ).
Proof This can be proven by construction. Consider any sensing 5′ → 3′ WKFA
𝑀1 . A direct conversion would be complicated; however, let us recall that LIN =
Sen5′→ 3′ WK (see [Nagy, 2013, Theorem 2]). Consider a linear grammar 𝐺 =
(Σ, Δ, 𝑃, 𝑆) with 𝑁 = Σ − Δ such that 𝐿 (𝐺) = 𝐿(𝑀1 ). We can construct the
jumping 5′ → 3′ WKFA 𝑀2 such that 𝐿 (𝑀2 ) = 𝐿 (𝐺). Assume that 𝑞 𝑓 ∉ Σ. Define
𝑀2 = (𝑁 ∪ {𝑞 𝑓 }, Δ, 𝛿, 𝑆, {𝑞 𝑓 }), where 𝐵 ∈ 𝛿( 𝐴, 𝑢, 𝑣, ⊕) if 𝐴 → 𝑢𝐵𝑣 ∈ 𝑃 and
𝑞 𝑓 ∈ 𝛿( 𝐴, 𝑢, 𝜀, ⊕) if 𝐴 → 𝑢 ∈ 𝑃 (𝐴, 𝐵 ∈ 𝑁, 𝑢, 𝑣 ∈ Δ∗ ).
From the definition of jumping 5′ → 3′ WKFA, the ⊕-reading steps will always
look like this: (𝑞, ⊕, 𝑤 1 , 𝑢𝑤 2 𝑣, 𝑤 3 ) ↷ (𝑞 ′ , 𝑠, 𝑤 1 {#} |𝑢| , 𝑤 2 , {#} |𝑣 | 𝑤 3 ), where 𝑞 ′ ∈
𝛿(𝑞, 𝑢, 𝑣, ⊕), 𝑤 2 ∈ Δ∗ , 𝑤 1 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ , and 𝑠 is either ⊕ if |𝑤 2 | > 0 or
⊖ in other cases. In 𝑀2 , there are no possible ⊖-reading steps. The ⊕-jumping
can be potentially used to skip some symbols before the heads meet; nonetheless,
this leads to the configuration (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) where symbols(𝑤 1 𝑤 3 ) ∩ Δ ≠ ∅.
Since without ⊖-reading steps there is no way to read symbols of Δ in 𝑤 1 and 𝑤 3 ,
such a configuration cannot yield an accepting result. Consequently, starting from
(𝑆, ⊕, 𝜀, 𝑤, 𝜀) where 𝑤 ∈ Δ∗ , it can be easily seen that if 𝑀2 accepts 𝑤, it reads
all symbols of 𝑤 in the same fashion as 𝐺 generates them; the remaining #’s can
be erased with the ⊖-jumping afterward. Moreover, the heads of 𝑀2 can meet each
other with the accepting state 𝑞 𝑓 if and only if 𝐺 can finish the generation process
with a rule 𝐴 → 𝑢. Thus, 𝐿(𝑀2 ) = 𝐿 (𝐺) = 𝐿 (𝑀1 ). □
Theorem 4.41 LIN = Sen5′→ 3′ WK ⊂ J5′→ 3′ WK.
Proof Sen5′→ 3′ WK ⊆ J5′→ 3′ WK follows from Lemma 4.26. LIN = Sen5′ →
3′ WK was proven in Nagy [2013]. J5′→ 3′ WK ⊈ LIN follows from Example 4.15.□
The next two characteristics follow from the previous results.
Theorem 4.42 Jumping 5′ → 3′ WKFAs that do not use ⊖-reading steps accept
linear languages.
Proof Consider any jumping 5′ → 3′ WKFA 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) that has no
possible ⊖-reading steps. Following the reasoning from the proof of Lemma 4.26, if
there are no possible ⊖-reading steps, the ⊕-jumping cannot be effectively used, and
we can construct a linear grammar that generates strings in the same fashion as 𝑀
reads them. Define the linear grammar 𝐺 = (𝑄 ∪Δ, Δ, 𝑅, 𝑞 0 ), where 𝑅 is constructed
in the following way: (1) For each 𝑝 ∈ 𝛿(𝑞, 𝑢, 𝑣, ⊕), add 𝑞 → 𝑢 𝑝𝑣 to 𝑅. (2) For each
𝑓 ∈ 𝐹, add 𝑓 → 𝜀 to 𝑅. Clearly, 𝐿 (𝐺) = 𝐿 (𝑀). □
Proposition 4.2 The language family accepted by double-jumping finite automata
that perform right-left and left-right jumps (see Section 4.1, SEL language, see
Definition 4.2) is strictly included in J5′→ 3′ WK.
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 111
Proof First, Theorem 4.6 shows that jumping finite automata that perform right-left
and left-right jumps accept the same family of languages. Second, Theorem 4.2
shows that this family is strictly included in LIN. Finally, Theorem 4.41 shows that
LIN is strictly included in J5′→ 3′ WK. □
Even though jumping 5′ → 3′ WKFAs are able to accept some nonlinear lan-
guages, the jumping directions of their heads are quite restricted compared to GJFAs.
Consequently, there are some languages accepted by jumping 5′ → 3′ WKFAs and
GJFAs that cannot be accepted with the other model. To formally prove these results,
we need to introduce the concept of the debt of a configuration in jumping 5′ → 3′
WKFAs. First, we start with the formal definition of a reachable state.
Next, we show that for any computation C that takes a jumping 5′ → 3′ WKFA 𝑀
from a starting configuration to a configuration from which a final state is reachable,
there exists 𝑤 ′ ∈ 𝐿 (𝑀) such that 𝑤 ′ can be fully processed with the same sequence
of reading steps as in C and a limited number of additional steps. Note that jumping
steps in C are unimportant for the result since jumping steps can occur arbitrarily
and they do not process any symbols of the input.
Proof First, if 𝑓 is reachable from 𝑞 and 𝑠, then there exists a sequence of pairs
P = ( 𝑝 0 , 𝑠0 ) · · · ( 𝑝 𝑛 , 𝑠 𝑛 ), for some 𝑛 ≥ 0, where
• 𝑝 𝑖 ∈ 𝑄, 𝑠𝑖 ∈ {⊕, ⊖}, for all 𝑖 = 0, . . . , 𝑛,
• 𝑝 0 = 𝑞, 𝑠0 = 𝑠 or 𝑠0 = ⊖, 𝑝 𝑛 = 𝑓 , 𝑠 𝑛 = ⊖,
• for all 𝑖 = 0, . . . , 𝑛 − 1 it holds: 𝑝 𝑖+1 ∈ 𝛿( 𝑝 𝑖 , 𝑥𝑖 , 𝑦 𝑖 , 𝑠𝑖 ), 𝑥 𝑖 , 𝑦 𝑖 ∈ Δ∗ ,
• for all 𝑖 = 0, . . . , 𝑛 − 1 it holds: 𝑠𝑖+1 = 𝑠𝑖 or 𝑠𝑖+1 = ⊖, and
• ( 𝑝 𝑖 , 𝑠𝑖 ) = ( 𝑝 𝑗 , 𝑠 𝑗 ) implies 𝑖 = 𝑗, 𝑖, 𝑗 = 0, . . . , 𝑛 (all pairs are unique).
This sequence is finite, and its maximum length is bounded by 𝑘 ′ = 2 · card(𝑄).
Second, let us represent a ⊕/⊖-reading step as a quintuple (𝑞 ′ , 𝑥, 𝑦, 𝑠′′ , 𝑞 ′′ )
according to 𝑞 ′′ ∈ 𝛿(𝑞 ′ , 𝑥, 𝑦, 𝑠′′ ), 𝑞 ′ , 𝑞 ′′ ∈ 𝑄, 𝑥, 𝑦 ∈ Δ∗ , 𝑠′′ ∈ {⊕, ⊖}. From
the computation C we extract a sequence of ⊕/⊖-reading steps S. From the se-
quence of pairs P we can easily derive a sequence of ⊕/⊖-reading steps S ′
that follows the state transitions of P. Let S ′′ = SS ′ . We split S ′′ into two
parts S ′′ = S⊕′′ S⊖′′ such that S⊕′′ = ( 𝑝 0′ , 𝑎 0 , 𝑏 0 , ⊕, 𝑞 0′ ) · · · ( 𝑝 ′𝑛 , 𝑎 𝑛 , 𝑏 𝑛 , ⊕, 𝑞 ′𝑛 ) and
112 4 Jumping Multi-Head Automata
And finally, we can combine Lemma 4.27 and Definition 4.12 to show that each
jumping 5′ → 3′ WKFA 𝑀 has to accept all 𝑤 ∈ 𝐿(𝑀) over configurations with
some bounded debt.
Proof (by contradition) Assume, for the sake of contradiction, that there is no
constant 𝑘 for 𝑀 such that 𝑀 accepts all 𝑤 ∈ 𝐿 using only configurations that have
their debt bounded by 𝑘. Then, 𝑀 can accept some 𝑤 ∈ 𝐿 over a configuration for
which the debt cannot be bounded by any 𝑘. Let Δ = {𝑎 1 , . . . , 𝑎 𝑛 }. Consider any
configuration 𝛾 of 𝑀 reached from an initial configuration (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) of 𝑀.
Let 𝑜 = (𝑜1 , . . . , 𝑜 𝑛 ) be the Parikh vector of processed symbols from 𝑤 in 𝛾. First,
assume that 𝛾 contains a state 𝑞 ∈ 𝑄 with a mutual position of heads 𝑠 ∈ {⊕, ⊖} from
which a final state 𝑓 ∈ 𝐹 is reachable. Then, due to Lemma 4.27, there is 𝑤 ′ ∈ 𝐿 (𝑀)
such that 𝜓 Δ (𝑤 ′ ) = (𝑚 1 , . . . , 𝑚 𝑛 ), 𝑚 𝑖 ≥ 𝑜 𝑖 , 1 ≤ 𝑖 ≤ 𝑛, and |𝑤 ′ | ≤ 𝑖=1 (𝑜𝑖 ) + 𝑘 ′ ,
Í𝑛
′ ′
where 𝑘 is some constant for 𝑀. According to Definition 4.12, 𝑤 ∈ 𝐿 (𝑀) implies
min Δ(𝑜) ≤ 𝑘 ′ . Second, assume that 𝛾 contains a state 𝑞 with a mutual position of
heads 𝑠 from which no final state 𝑓 is reachable. Then, by Definitions 4.10 and 4.11,
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 113
Proof The language {𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)} from Example 4.15
and the language {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)} from
Lemma 4.30 are accepted with (general) jumping finite automata (see Example 3.1).
The language {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0} from Example 4.16 is not accepted with (general)
jumping finite automata because by Lemma 3.3 even simpler language {𝑎}∗ {𝑏}∗ ∉
GJFA. □
The last group of results compares the accepting power of jumping 5′ → 3′
WKFAs with the families of context-sensitive and context-free languages.
Proof Clearly, the use of two heads and the jumping behavior can be simulated
by linear bounded automata, so J5′→ 3′ WK ⊆ CS. From Lemma 4.29, CS −
J5′→ 3′ WK ≠ ∅. □
with the state transition function 𝛿: 𝛿(𝑠, 𝑎, 𝑐, ⊕) = {𝑠} and 𝛿(𝑠, 𝑑, 𝑏, ⊖) = {𝑠}.
The accepting process has two stages. First, before the heads meet, the automaton
reads the same number of 𝑎’s and 𝑐’s. Second, after the heads meet, the automaton
reads the same number of 𝑑’s and 𝑏’s. Thus, 𝐿(𝑀) = {𝑤 1 𝑤 2 | 𝑤 1 ∈ {𝑎, 𝑏}∗ , 𝑤 2 ∈
{𝑐, 𝑑}∗ , occur(𝑤 1 , 𝑎) = occur(𝑤 2 , 𝑐), occur(𝑤 1 , 𝑏) = occur(𝑤 2 , 𝑑)}.
For the sake of contradiction, assume that 𝐿(𝑀) is a context-free language.
The family of context-free languages is closed under intersection with regular sets.
Let 𝐾 = 𝐿(𝑀) ∩ {𝑎}∗ {𝑏}∗ {𝑐}∗ {𝑑}∗ . Clearly, there are some strings in 𝐿 (𝑀) that
satisfy this forced order of symbols. Furthermore, they all have the proper correlated
numbers of these symbols. Consequently, 𝐾 = {𝑎 𝑛 𝑏 𝑚 𝑐 𝑛 𝑑 𝑚 | 𝑛, 𝑚 ≥ 0}. However,
𝐾 is a well-known non-context-free language (see [Rozenberg and Salomaa, 1997b,
Chapter 3.1]). That is a contradiction with the assumption that 𝐿 (𝑀) is a context-free
language. Therefore, 𝐿 (𝑀) is a non-context-free language. □
Proof Basic idea. We follow the proof structure of Lemma 4.29. Considering any
sufficiently large constant 𝑘, we show that 𝑀 cannot process all symbols of 𝑎 10𝑘 𝑏 10𝑘
𝑐10𝑘 𝑑 10𝑘 using only configurations that have their debt bounded by 𝑘.
Formal proof (by contradition). Let 𝐿 = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑚 𝑑 𝑚 | 𝑛, 𝑚 ≥ 0}, and let
𝑀 = (Δ, 𝑄, 𝑞 0 , 𝐹, 𝛿) be a jumping 5′ → 3′ WKFA such that 𝐿(𝑀) = 𝐿.
Due to Lemma 4.28, there must exist a constant 𝑘 for 𝑀 such that 𝑀 accepts
116 4 Jumping Multi-Head Automata
all 𝑤 ∈ 𝐿 using only configurations that have their debt bounded by 𝑘. Let
𝑘 min = max{|𝑢𝑣| | 𝛿(𝑞, 𝑢, 𝑣, 𝑠) ≠ ∅, 𝑞 ∈ 𝑄, 𝑢, 𝑣 ∈ Δ∗ , 𝑠 ∈ {⊕, ⊖}}. Consider
any 𝑘 for 𝑀 such that 𝑘 > 𝑘 min . Let 𝑤 = 𝑎 10𝑘 𝑏 10𝑘 𝑐10𝑘 𝑑 10𝑘 .
We follow a computation of 𝑀 from an initial configuration 𝜎 = (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀).
First, we explore the limits of how many symbols 𝑀 can read with ⊖-reading steps.
Let 𝛾 be the first configuration of the computation of 𝑀 with the mutual position of
heads ⊖ reached from 𝜎. Consider the maximum number of 𝑏’s that the ◀-head can
read with ⊖-reading steps starting from 𝛾. Since 𝑎’s are in front of 𝑏’s and since 𝑎’s
are linked with 𝑏’s, this number must be limited. The configuration 𝛾 can have the
debt of at most 𝑘 𝑏’s, the debt can reach at most 𝑘 𝑎’s, and only one step can read
both types of symbols together. Thus, the maximum number of 𝑏’s that the ◀-head
can read with ⊖-reading steps starting from 𝛾 is less than 3𝑘. In the same manner,
the maximum number of 𝑐’s that the ▶-head can read with ⊖-reading steps starting
from 𝛾 is less than 3𝑘.
Second, we explore the limits of how many symbols 𝑀 can read with ⊕-reading
steps. Consider the maximum number of 𝑎’s and 𝑏’s that the ▶-head can read on its
own with ⊕-reading steps starting from 𝛾. The configuration 𝜎 has no debt, the debt
can reach at most 𝑘 𝑏’s, only one step can read both types of symbols together, and
then the debt can reach at most 𝑘 𝑎’s. Thus, the maximum number of 𝑎’s and 𝑏’s that
the ◀-head can read on its own with ⊕-reading steps starting from 𝛾 is less than 4𝑘.
In the same manner, the maximum number of 𝑐’s and 𝑑’s that the ◀-head can read
on its own with ⊕-reading steps starting from 𝛾 is less than 4𝑘. Due to the previous
limits with ⊖-reading steps, in a successful computation, the ▶-head cannot jump
over all remaining 𝑏’s and the ◀-head cannot jump over all remaining 𝑐’s. Thus, the
heads cannot meet in a configuration that can yield a successful computation.
Finally, we can see that 𝑀 is not able to accept 𝑤 = 𝑎 10𝑘 𝑏 10𝑘 𝑐10𝑘 𝑑 10𝑘 when the
debt of configurations of 𝑀 is bounded by 𝑘. Since, for any 𝑘, 𝑤 ∈ 𝐿, there is no
constant 𝑘 for 𝑀 such that 𝑀 accepts all 𝑤 ∈ 𝐿 using only configurations that have
their debt bounded by 𝑘. But that is a contradiction with the assumption that there is
a jumping 5′ → 3′ WKFA 𝑀 such that 𝐿(𝑀) = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑚 𝑑 𝑚 | 𝑛, 𝑚 ≥ 0}. □
In this section, we compare the accepting power of unrestricted and restricted variants
of jumping 5′ → 3′ WKFAs. This section considers the same standard restrictions
as they are defined for WKFAs (see Definition 2.7). Since these restrictions regulate
only the state control and reading steps of the automaton, the jumping is not affected
in any way. Let J5′→ 3′ WK denote the language family accepted by jumping 5′ → 3′
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 117
WKFAs. We are using prefixes N, F, S, 1, NS, FS, N1, and F1 to specify the restricted
variants of jumping 5′ → 3′ WKFAs and appropriate language families.
In Section 3.1, it was shown that the use of the jumping mechanism can have
an unusual impact on the expressive power of the model when we restrict the state
control of the model. In the case of classical finite automata, it makes no difference
if the steps of the automaton read single symbols or longer strings. Nonetheless, in
the case of jumping finite automata, this change has a large impact on the expressive
power of the model. Moreover, most of the standard restrictions studied in WKFAs
were not yet considered together with the jumping mechanism. Therefore, it is our
intention to thoroughly explore the impact of these restrictions on the accepting
power of jumping 5′ → 3′ WKFAs and compare it with the similar results on
sensing 5′ → 3′ WKFAs.
In the field of DNA computing, the empty string/sequence usually does not belong
to any language because it does not refer to a molecule. This section is not so strict
and thus considers the empty string as a possible valid input. Let FIN 𝜀-inc denote
finite languages which contain the empty string. Nonetheless, the following proofs
are deliberately based on more complex inputs to mitigate the impact of the empty
string on the results. Moreover, we distinguish between FIN and FIN 𝜀-inc , when the
difference is unavoidable.
Note that there are some inherent inclusions between language families based
on the application of restrictions on the model. Additionally, several other basic
relationships can be established directly from the definitions of the restrictions:
Lemma 4.33 The following relationships hold: (i) N J5′→ 3′ WK ⊆ F J5′→ 3′ WK;
(ii) 1 J5′→ 3′ WK ⊆ S J5′→ 3′ WK; (iii) F1 J5′→ 3′ WK ⊆ FS J5′→ 3′ WK; (iv) N1
J5′→ 3′ WK ⊆ NS J5′→ 3′ WK; (v) NS J5′→ 3′ WK ⊆ FS J5′→ 3′ WK; (vi) N1
J5′→ 3′ WK ⊆ F1 J5′→ 3′ WK.
Proof These results follow directly from the definitions since the stateless restriction
(N) is a special case of the all-final restriction (F) and the 1-limited restriction (1) is
a special case of the simple restriction (S). □
Proof Basic idea. Any general reading step can be replaced with at most two simple
reading steps and a new auxiliary state that together accomplish the same action.
Formal proof. Consider any jumping 5′ → 3′ WKFA 𝑀 = (𝑄 1 , Δ, 𝛿1 , 𝑞 0 , 𝐹). We
can construct the S jumping 5′ → 3′ WKFA 𝑁 such that 𝐿 (𝑁) = 𝐿 (𝑀). Define
𝑁 = (𝑄 2 , Δ, 𝛿2 , 𝑞 0 , 𝐹), where 𝑄 2 and 𝛿2 are created in the following way: Let
𝑞 ∈ 𝑄 1 , 𝑥, 𝑦 ∈ Δ∗ , and 𝑠 ∈ {⊕, ⊖}.
(1) Set 𝑄 2 = 𝑄 1 .
(2) For each 𝛿1 (𝑞, 𝑥, 𝑦, 𝑠) ≠ ∅ where |𝑥| = 0 or |𝑦| = 0,
let 𝛿2 (𝑞, 𝑥, 𝑦, 𝑠) = 𝛿1 (𝑞, 𝑥, 𝑦, 𝑠).
118 4 Jumping Multi-Head Automata
(3) For each 𝛿1 (𝑞, 𝑥, 𝑦, 𝑠) ≠ ∅ where |𝑥| > 0 and |𝑦| > 0, add a new unique state 𝑝
to 𝑄 2 and let 𝑝 ∈ 𝛿2 (𝑞, 𝑥, 𝜀, 𝑠) and 𝛿2 ( 𝑝, 𝜀, 𝑦, 𝑠) = 𝛿1 (𝑞, 𝑥, 𝑦, 𝑠).
It is clear that all original transitions that did not satisfy the simple restriction were
transformed into the new suitable transitions.
Now we show that this change has no effect on the accepted language. Let
𝑤 ∈ 𝐿(𝑀) be accepted by an accepting computation 𝛾 of 𝑀. There is a computation
𝛾 ′ of 𝑁 corresponding to 𝛾 of 𝑀. We can construct 𝛾 ′ from 𝛾 in the following way:
(A) If there is (𝑞, ⊕, 𝑤 1 , 𝑥𝑤 2 𝑦, 𝑤 3 ) ↷ (𝑞 ′ , 𝑠, 𝑤 1 {#} | 𝑥 | , 𝑤 2 , {#} | 𝑦 | , 𝑤 3 ) in 𝛾, where
𝑥, 𝑦 ∈ Δ+ , 𝑤 1 , 𝑤 2 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ , 𝑞, 𝑞 ′ ∈ 𝑄 1 , 𝑠 ∈ {⊕, ⊖}, we re-
place it in 𝛾 ′ with (𝑞, ⊕, 𝑤 1 , 𝑥𝑤 2 𝑦, 𝑤 3 ) ↷ ( 𝑝, ⊕, 𝑤 1 {#} | 𝑥 | , 𝑤 2 𝑦, 𝑤 3 ) ↷
(𝑞 ′ , 𝑠, 𝑤 1 {#} | 𝑥 | , 𝑤 2 , {#} | 𝑦 | 𝑤 3 ), where 𝑝 is the new state introduced for
𝛿1 (𝑞, 𝑥, 𝑦, ⊕) in step (3).
(B) If there is (𝑞, ⊖, 𝑤 1 𝑦, 𝜀, 𝑥𝑤 3 ) ↷ (𝑞 ′ , ⊖, 𝑤 1 , 𝜀, 𝑤 3 ) in 𝛾, where 𝑥, 𝑦 ∈ Δ+ ,
𝑤 1 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ , 𝑞, 𝑞 ′ ∈ 𝑄 1 , we replace it in 𝛾 ′ with (𝑞, ⊖, 𝑤 1 𝑦, 𝜀, 𝑥𝑤 3 ) ↷
( 𝑝, ⊖, 𝑤 1 𝑦, 𝜀, 𝑤 3 ) ↷ (𝑞 ′ , ⊖, 𝑤 1 , 𝜀, 𝑤 3 ), where 𝑝 is the new state introduced
for 𝛿1 (𝑞, 𝑥, 𝑦, ⊖) in step (3).
(C) We keep other steps of the computation without changes.
Clearly, 𝛾 ′ is an accepting computation of 𝑁 and 𝑤 ∈ 𝐿 (𝑁). Thus, 𝐿 (𝑀) ⊆ 𝐿 (𝑁).
Let 𝑤 ∈ 𝐿 (𝑁) be accepted by an accepting computation 𝛾 of 𝑁. Clearly, any
sequence of consecutive ⊕/⊖-jumping steps can be replaced with a single ⊕/⊖-
jumping step, and it is also possible to utilize empty jumping steps that do not move
the heads. Thus, without loss of generality, assume that 𝛾 does not contain sequences
of consecutive ⊕/⊖-jumping steps and that every reading step in 𝛾 is followed by
a jumping step. There is a computation 𝛾 ′ of 𝑀 corresponding to 𝛾 of 𝑁. We can
construct 𝛾 ′ from 𝛾 in the following way:
(A) If there is (𝑞, ⊕, 𝑤 1 , 𝑥𝑢𝑤 2 𝑦𝑣, 𝑤 3 ) ↷ ( 𝑝, ⊕, 𝑤 1 {#} | 𝑥 | , 𝑢𝑤 2 𝑦𝑣, 𝑤 3 ) ↷ ( 𝑝, ⊕,
𝑤 1 {#} | 𝑥 | 𝑢, 𝑤 2 𝑦, 𝑣𝑤 3 ) ↷ (𝑞 ′ , 𝑠, 𝑤 1 {#} | 𝑥 | 𝑢, 𝑤 2 , {#} | 𝑦 | 𝑣𝑤 3 ) in 𝛾, where 𝑥, 𝑦 ∈
Δ+ , 𝑢, 𝑣 ∈ Δ∗ , 𝑤 1 , 𝑤 2 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ , 𝑞, 𝑞 ′ ∈ 𝑄 1 , 𝑠 ∈ {⊕, ⊖}, and 𝑝 is the
new state introduced for 𝛿1 (𝑞, 𝑥, 𝑦, ⊕) in step (3), we replace these steps in 𝛾 ′
with (𝑞, ⊕, 𝑤 1 , 𝑥𝑢𝑤 2 𝑦𝑣, 𝑤 3 ) ↷ (𝑞, ⊕, 𝑤 1 , 𝑥𝑢𝑤 2 𝑦, 𝑣𝑤 3 ) ↷ (𝑞 ′ , 𝑠′ , 𝑤 1 {#} | 𝑥 | ,
𝑢𝑤 2 , {#} | 𝑦 | 𝑣𝑤 3 ) ↷ (𝑞 ′ , 𝑠, 𝑤 1 {#} | 𝑥 | 𝑢, 𝑤 2 , {#} | 𝑦 | 𝑣𝑤 3 ), where 𝑠′ ∈ {⊕, ⊖} ac-
cording to the definition of ⊕-reading steps. Observe that, due to the unique 𝑝,
it is clear that 𝑞 ′ ∈ 𝛿1 (𝑞, 𝑥, 𝑦, ⊕) in 𝑀.
(B) If there is (𝑞, ⊖, 𝑤 1 𝑦{#} 𝑣 , 𝜀, 𝑥{#}𝑢 𝑤 3 ) ↷ ( 𝑝, ⊖, 𝑤 1 𝑦{#} 𝑣 , 𝜀, {#}𝑢 𝑤 3 ) ↷ ( 𝑝,
⊖, 𝑤 1 𝑦, 𝜀, 𝑤 3 ) ↷ (𝑞 ′ , ⊖, 𝑤 1 , 𝜀, 𝑤 3 ) in 𝛾, where 𝑥, 𝑦 ∈ Δ+ , 𝑢, 𝑣 ≥ 0, 𝑤 1 , 𝑤 3 ∈
(Δ ∪ {#}) ∗ , 𝑞, 𝑞 ′ ∈ 𝑄 1 , and 𝑝 is the new state introduced for 𝛿1 (𝑞, 𝑥, 𝑦, ⊖)
in step (3), we replace these steps in 𝛾 ′ with (𝑞, ⊖, 𝑤 1 𝑦{#} 𝑣 , 𝜀, 𝑥{#}𝑢 𝑤 3 ) ↷
(𝑞, ⊖, 𝑤 1 𝑦, 𝜀, 𝑥{#}𝑢 𝑤 3 ) ↷ (𝑞 ′ , ⊖, 𝑤 1 , 𝜀, {#}𝑢 𝑤 3 ) ↷ (𝑞 ′ , ⊖, 𝑤 1 , 𝜀, 𝑤 3 ).
(C) We keep other steps of the computation without changes.
Clearly, 𝛾 ′ is an accepting computation of 𝑀 and 𝑤 ∈ 𝐿 (𝑀). Thus, 𝐿(𝑁) ⊆ 𝐿(𝑀).
Consequently, 𝐿(𝑁) = 𝐿(𝑀). □
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 119
𝛿(𝑠, 𝑎, 𝑏, ⊕) = {𝑠}, 𝛿( 𝑓 , 𝑎, 𝑏, ⊕) = { 𝑓 }, 𝛿( 𝑓 , 𝑎, 𝑏, ⊖) = { 𝑓 },
𝛿(𝑠, 𝑐𝑐, 𝜀, ⊕) = { 𝑓 }, 𝛿(𝑠, 𝜀, 𝑐𝑐, ⊕) = { 𝑓 }.
The first three transitions mimic the behavior of Example 4.15. The other two
transitions ensure that the input is accepted only if it also contains precisely one
substring 𝑐𝑐. Therefore, 𝐿(𝑀) = {𝑤 1 𝑐𝑐𝑤 2 | 𝑤 1 , 𝑤 2 ∈ {𝑎, 𝑏}∗ , occur(𝑤 1 𝑤 2 , 𝑎) =
occur(𝑤 1 𝑤 2 , 𝑏)}.
Lemma 4.34 Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a 1 jumping 5′ → 3′ WKFA 𝑀, and
let 𝑤 ∈ 𝐿(𝑀) be accepted by an accepting computation 𝛾 of 𝑀. Let us represent
the ⊕-reading step of 𝑀 that follows 𝛿(𝑞, 𝑢, 𝑣, ⊕), 𝑞 ∈ 𝑄, 𝑢, 𝑣 ∈ (Δ ∪ {𝜀}), as a
quadruple (𝑢, 𝑣, 𝜀, 𝜀) and the ⊖-reading step of 𝑀 that follows 𝛿(𝑞, 𝑢 ′ , 𝑣 ′ , ⊖), 𝑞 ∈ 𝑄,
𝑢 ′ , 𝑣 ′ ∈ (Δ ∪ {𝜀}), as a quadruple (𝜀, 𝜀, 𝑢 ′ , 𝑣 ′ ). Then, we can represent the reading
steps of 𝛾 as a sequence (𝑢 1 , 𝑣 1 , 𝑢 1′ , 𝑣 1′ ) · · · (𝑢 𝑛 , 𝑣 𝑛 , 𝑢 ′𝑛 , 𝑣 ′𝑛 ), 𝑖 = 1, . . . , 𝑛, 𝑛 ≥ 1. Let
𝑤 ▶⊕ = 𝑢 1 · · · 𝑢 𝑛 , 𝑤 ▶⊖ = 𝑢 1′ · · · 𝑢 ′𝑛 , 𝑤 ◀⊕ = 𝑣 𝑛 · · · 𝑣 1 , 𝑤 ◀⊖ = 𝑣 ′𝑛 · · · 𝑣 1′ . It holds that
𝑥𝑦 ∈ 𝐿 (𝑀) for all 𝑥 ∈ (𝑤 ▶⊕ , 𝑤 ◀⊖ ) and 𝑦 ∈ (𝑤 ◀⊕ , 𝑤 ▶⊖ ).
E
Proof Since 𝑀 satisfies the 1-limited restriction, exactly one symbol is always being
read with a reading step. Therefore, for all 𝑖, only one of 𝑢 𝑖 , 𝑣 𝑖 , 𝑢 𝑖′ , 𝑣 𝑖′ is nonempty,
and it contains one symbol. When 𝑀 follows an accepting computation and a head
of 𝑀 jumps over a symbol with a ⊕-jumping step, such a symbol is read later with
the other head of 𝑀 with a ⊖-reading step. Since jumping steps can occur arbitrarily
between reading steps and since they do not depend on the current state of 𝑀, it
follows that every 𝑥𝑦, where 𝑥 is a shuffle of 𝑤 ▶⊕ and 𝑤 ◀⊖ and 𝑦 is a shuffle of 𝑤 ◀⊕
and 𝑤 ▶⊖ , has to belong to 𝐿 (𝑀). □
Lemma 4.35 There is no 1 jumping 5′ → 3′ WKFA 𝑀 such that 𝐿(𝑀) =
{𝑤 1 𝑐𝑐𝑤 2 | 𝑤 1 , 𝑤 2 ∈ {𝑎, 𝑏}∗ , occur(𝑤 1 𝑤 2 , 𝑎) = occur(𝑤 1 𝑤 2 , 𝑏)}.
Proof Basic idea. We follow the proof structure of Lemma 4.29. Considering any
sufficiently large constant 𝑘, we show that 𝑀 cannot process all symbols of 𝑎 3𝑘 𝑏 3𝑘 𝑐𝑐
𝑏 3𝑘 𝑎 3𝑘 using only configurations that have their debt bounded by 𝑘.
Formal proof (by contradition). Let 𝐿 = {𝑤 1 𝑐𝑐𝑤 2 | 𝑤 1 , 𝑤 2 ∈ {𝑎, 𝑏}∗ , occur(𝑤 1 𝑤 2 ,
𝑎) = occur(𝑤 1 𝑤 2 , 𝑏)}, and let 𝑀 = (Δ, 𝑄, 𝑞 0 , 𝐹, 𝛿) be a 1 jumping 5′ → 3′ WKFA
such that 𝐿(𝑀) = 𝐿. Due to Lemma 4.28, there must exist a constant 𝑘 for 𝑀 such
that 𝑀 accepts all 𝑤 ∈ 𝐿 using only configurations that have their debt bounded by
𝑘. Consider any 𝑘 for 𝑀 such that 𝑘 ≥ 2. Let 𝑤 = 𝑎 3𝑘 𝑏 3𝑘 𝑐𝑐𝑏 3𝑘 𝑎 3𝑘 .
Consider restrictions on how 𝑀 can accept 𝑤 so that it does not also accept any
𝑤 ′ ∉ 𝐿. Due to Lemma 4.34, to ensure that both 𝑐’s are always next to each other,
some parts of 𝑤 ▶⊕ , 𝑤 ▶⊖ , 𝑤 ◀⊕ , 𝑤 ◀⊖ must remain empty.
Consider cases where two or three parts remain empty. To ensure the proper
position of 𝑐’s, only one head can read or only ⊕-reading or only ⊖-reading steps
120 4 Jumping Multi-Head Automata
can be used. Note that the debt of an initial configuration of 𝑀 is always 2 since at
least 𝑐𝑐 has to be processed before an input can be successfully accepted. First, 𝑀
cannot accept 𝑤 with only one head because in this case jumping steps cannot be
effectively used, the debt of the configuration of 𝑀 reaches 𝑘 after 𝑘 − 2 reading
steps, and no further reading is possible. Second, the situation is similar for 𝑀 using
only ⊕-reading steps. Third, for 𝑀 using only ⊖-reading steps, the heads can meet
between 𝑎’s and 𝑏’s and process up to 7𝑘 + 2 symbols from 𝑤, but 𝑀 is clearly still
not able to process the whole 𝑤.
If only one part remains empty, the appropriate opposite part for the shuffle
must contain both 𝑐’s. Let us assume that 𝑤 ◀⊖ remains empty. Consequently, 𝑤 ▶⊕
must contain at least 𝑎 3𝑘 𝑏 3𝑘 𝑐𝑐. Consider possibilities how the ▶-head can process
𝑎 3𝑘 𝑏 3𝑘 𝑐𝑐 from 𝑤 with ⊕-reading-steps. To process more than 𝑘 − 2 symbols 𝑎 with
the ▶-head, both heads has to cooperate. Let us assume that 𝑀 first reads 𝑘 − 2
times 𝑎 with the ◀-head. Then, the ◀-head jumps to 𝑏’s on the right-hand side of 𝑤,
and the heads can start cooperate. The ◀-head reads 𝑏, the ▶-head reads 𝑎, and this
can be repeated 3𝑘 times. Now, the ▶-head still has to process 𝑏 3𝑘 𝑐𝑐. Since there
is the debt of 𝑘 − 2 symbols 𝑏 created with the initial readings of the ◀-head, the
▶-head can read 2𝑘 − 4 times 𝑏 before the debt of the configuration of 𝑀 reaches
𝑘. The ▶-head still has to process 𝑏 𝑘+4 𝑐𝑐, but the debt cannot be compensated with
the ◀-head any further. Consequently, the ▶-head cannot process 𝑎 3𝑘 𝑏 3𝑘 𝑐𝑐 from
𝑤 with ⊕-reading-steps. The proof strategy and results are analogous for the other
cases where 𝑤 ▶⊖ , 𝑤 ◀⊕ , or 𝑤 ◀⊖ remains empty.
Finally, we can see that 𝑀 is not able to accept 𝑤 = 𝑎 3𝑘 𝑏 3𝑘 𝑐𝑐𝑏 3𝑘 𝑎 3𝑘 when the
debt of configurations of 𝑀 is bounded by 𝑘. Since, for any 𝑘, 𝑤 ∈ 𝐿, there is
no constant 𝑘 for 𝑀 such that 𝑀 accepts all 𝑤 ∈ 𝐿 using only configurations that
have their debt bounded by 𝑘. But that is a contradiction with the assumption that
there is a 1 jumping 5′ → 3′ WKFA 𝑀 such that 𝐿(𝑀) = {𝑤 1 𝑐𝑐𝑤 2 | 𝑤 1 , 𝑤 2 ∈
{𝑎, 𝑏}∗ , occur(𝑤 1 𝑤 2 , 𝑎) = occur(𝑤 1 𝑤 2 , 𝑏)}. □
Proof This theorem follows directly from Example 4.18 and Lemma 4.35. □
It is not hard to see that the resulting behavior is similar to Example 4.15. The
automaton now reads 𝑎’s and 𝑏’s with separate steps and uses one auxiliary state
that is not final. Consequently, 𝐿(𝑀) = {𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)}.
Proof This theorem follows directly from Example 4.19 and Lemma 4.36. □
Proof (by contradition) Assume, for the sake of contradiction, that there is an F
jumping 5′ → 3′ WKFA 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) such that 𝐿 (𝑀) = {𝑐𝑎 𝑛 𝑐𝑏 𝑛 𝑐 | 𝑛 ≥
0} ∪ {𝜀}. Since 𝑀 satisfies the all-final restriction, all states are final. Therefore, if in
the first nonempty reading step the ▶-head reads 𝑢 and the ◀-head reads 𝑣, then 𝑢𝑣 or
𝑣𝑢 belongs to 𝐿 (𝑀). Let 𝑘 min = max{|𝑢𝑣| | 𝛿(𝑞, 𝑢, 𝑣, 𝑠) ≠ ∅, 𝑞 ∈ 𝑄, 𝑢, 𝑣 ∈ Δ∗ , 𝑠 ∈
{⊕, ⊖}}. Consider any 𝑘 such that 𝑘 > 𝑘 min . Let 𝑤 = 𝑐𝑎 𝑘 𝑐𝑏 𝑘 𝑐. It is not hard to see
that for any first nonempty reading step on 𝑤 (which reads 𝑢 and 𝑣) it must hold that
occur(𝑢𝑣, 𝑐) ≤ 2. However, for all 𝑤 ′ ∈ (𝐿 (𝑀) − {𝜀}) it holds that occur(𝑤 ′ , 𝑐) = 3.
Therefore, if 𝑀 accepts 𝑤, it also accepts 𝑢𝑣 ∉ 𝐿(𝑀) or 𝑣𝑢 ∉ 𝐿(𝑀). But that is a
contradiction with the assumption that 𝑀 exists. □
Proof This theorem follows directly from Theorem 4.41 and Lemma 4.37. □
Proof Consider any alphabet Δ and 𝐿 = {𝑥1 , . . . , 𝑥 𝑛 } ∈ FIN 𝜀-inc such that
𝑥𝑖 ∈ Δ∗ , 𝑖 = 1, . . . , 𝑛, 𝑛 ≥ 1. Define the F jumping 5′ → 3′ WKFA 𝑀 =
({𝑞 0 , 𝑞 𝑓 }, Δ, 𝛿, 𝑞 0 , {𝑞 0 , 𝑞 𝑓 }), where 𝛿 is constructed in the following way: For each
𝑥 ∈ 𝐿, set 𝛿(𝑞 0 , 𝑥, 𝜀, ⊕) = {𝑞 𝑓 }. It is clear that 𝐿(𝑀) = 𝐿. Thus, FIN 𝜀-inc ⊆ F
J5′→ 3′ WK. F J5′→ 3′ WK ⊈ FIN 𝜀-inc follows from Example 4.15. □
Example 4.20 Consider the following F (in fact, even N) jumping 5′ → 3′ WKFA
𝑀 = ({𝑠}, {𝑎, 𝑏, 𝑐}, 𝛿, 𝑠, {𝑠}) with the state transition function 𝛿:
This is a modification of Examples 4.15 and 4.18. The first two transitions ensure
that 𝑀 can accept any input containing the same number of 𝑎’s and 𝑏’s. The other
two transitions ensure that the accepted inputs can also contain an arbitrary number
of substrings 𝑐𝑐. Therefore, 𝐿 (𝑀) = {𝑤 ∈ {𝑎, 𝑏, 𝑐𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)}.
Proof First, due to Lemma 4.38, 𝐿 (𝑀) must always contain 𝜀. Second, by contra-
diction, assume that there is a N jumping 5′ → 3′ WKFA 𝑀2 such that 𝐿(𝑀2 ) ∈ FIN
and 𝐿 (𝑀2 ) contains a nonempty string. Since there is only one state, any ⊕/⊖-reading
step can be repeated arbitrarily many times. Therefore, if in the first nonempty read-
ing step the ▶-head reads 𝑢 and the ◀-head reads 𝑣, then 𝑢 𝑖 𝑣 𝑖 or 𝑣 𝑖 𝑢 𝑖 belongs to
𝐿 (𝑀2 ) for all 𝑖 ≥ 1. Thus, if 𝑀2 accepts a nonempty string, 𝐿 (𝑀2 ) ∉ FIN. But that
is a contradiction with the assumption that 𝑀2 exists. Consequently, if 𝐿(𝑀) ∈ FIN,
𝐿 (𝑀) = {𝜀}. □
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 123
Proposition 4.7 N J5′→ 3′ WK is incomparable with LIN, FIN, and FIN 𝜀-inc .
Proof LIN, FIN, FIN 𝜀-inc ⊈ N J5′→ 3′ WK follows from Lemma 4.39. N
J5′→ 3′ WK ⊈ LIN, FIN, FIN 𝜀-inc follows from Example 4.15. Next, N J5′→ 3′ WK
and LIN contain the language {𝑎}∗ . Finally, there is the sole language {𝜀} that N
J5′→ 3′ WK shares with FIN and FIN 𝜀-inc . □
Proof FS J5′→ 3′ WK ⊈ FIN 𝜀-inc follows from {𝑎}∗ ∈ FS J5′→ 3′ WK. The rest of
the proof is analogous to Theorem 4.49. □
Proof (Claim A) Due to the restrictions, parts (i), (ii), (iii), and (iv) cover all possible
types of state transitions. The accepted input can be always divided into two parts,
depending on the position where the heads of 𝑀 meet each other during the process-
ing of this input. The first part 𝑥1 𝑦 1′ · · · 𝑥 𝑛 𝑦 ′𝑛 is a combination of ⊕-readings with the
▶-head and ⊖-readings with the ◀-head. Likewise, the second part 𝑥 1′ 𝑦 1 · · · 𝑥 𝑚 ′ 𝑦 is
𝑚
a combination of ⊖-readings with the ▶-head and ⊕-readings with the ◀-head. To
get the uncertain reading order forced by the jumping steps, we also allow each part
𝑥𝑖 , 𝑦 𝑖′ , 𝑥 ′𝑗 , 𝑦 𝑗 to be empty. Therefore, all 𝑤 ∈ 𝐿(𝑀) have to be able to satisfy this
special form. □
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 125
Claim B Any 𝑤 ∈ Δ∗ that can be expressed in the previous special form belongs to
𝐿(𝑀). □
Proof (Claim B) Considering the restrictions, 𝑀 has only one state, and only one
head can read in a step. Therefore, if there is a possible reading step, it can be used
arbitrarily many times. Furthermore, the possible reading steps can change only
when the heads meet each other. Also, since each head reads separately, there cannot
be any dependence between the first and second part of the input in the special form.
Consequently, any 𝑤 ∈ Δ∗ that can be expressed in the form from Claim 1 has to
belong to 𝐿(𝑀). □
Considering both claims, it is easy to construct a finite automaton that accepts all
inputs of this special form. REG ⊈ NS J5′→ 3′ WK follows from Lemma 4.39. □
Proposition 4.13 N1 J5′→ 3′ WK ⊂ NS J5′→ 3′ WK.
Proof This proof is analogous to that of Proposition 4.11. □
Proposition 4.14 The following relationships hold:
(i) NS J5′→ 3′ WK ⊂ N J5′→ 3′ WK
(ii) NS J5′→ 3′ WK ⊂ FS J5′→ 3′ WK
(iii) N1 J5′→ 3′ WK ⊂ F1 J5′→ 3′ WK
Proof Examples 4.15 and 4.21 and Proposition 4.12 show that N J5′→ 3′ WK, FS
J5′→ 3′ WK, and F1 J5′→ 3′ WK contain some non-regular languages. Considering
Lemma 4.33 and Theorem 4.52, all three proposed relationships directly follow. □
Proposition 4.15 FS J5′→ 3′ WK and N J5′→ 3′ WK are incomparable.
Proof (by contradition) First, FS J5′→ 3′ WK ⊈ N J5′→ 3′ WK follows from
Lemma 4.39 and Theorem 4.51. Second, let 𝐿 = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}. It is trivial to con-
struct an N jumping 5′ → 3′ WKFA that accepts 𝐿. However, there is no FS jumping
5′ → 3′ WKFA that accepts 𝐿. For the sake of contradiction, assume that there is an
FS jumping 5′ → 3′ WKFA 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) such that 𝐿 (𝑀) = 𝐿. Due to the re-
strictions, if a head of 𝑀 reads 𝑢 in a step, it must hold that occur(𝑢, 𝑎) = occur(𝑢, 𝑏).
Otherwise, there would be 𝑤 ′ ∈ 𝐿(𝑀) such that occur(𝑤 ′ , 𝑎) ≠ occur(𝑤 ′ , 𝑏). Let
𝑘 min = max{|𝑣 1 𝑣 2 | | 𝛿(𝑞, 𝑣 1 , 𝑣 2 , 𝑠) ≠ ∅, 𝑞 ∈ 𝑄, 𝑣 1 , 𝑣 2 ∈ Δ∗ , 𝑠 ∈ {⊕, ⊖}}. Consider
any 𝑘 such that 𝑘 > 𝑘 min . Let 𝑤 = 𝑎 2𝑘 𝑏 2𝑘 . Clearly, when 𝑀 processes 𝑤, each
head can read 𝑢 such that occur(𝑢, 𝑎) = occur(𝑢, 𝑏) no more than once. However,
these balanced steps can thus process only less than 2𝑘 symbols. Consequently, if
𝑀 accepts 𝑤, it also accepts some 𝑤 ′ ∉ 𝐿—a contradiction with the assumption that
𝑀 exists. Therefore, N J5′→ 3′ WK ⊈ FS J5′→ 3′ WK. Lastly, FS J5′→ 3′ WK and
N J5′→ 3′ WK contain the language {𝑎}∗ . □
Proposition 4.16 F1 J5′→ 3′ WK and NS J5′→ 3′ WK are incomparable.
Proof First, F1 J5′→ 3′ WK ⊈ NS J5′→ 3′ WK follows from Lemma 4.39 and
{𝜀, 𝑎} ∈ F1 J5′→ 3′ WK. Second, NS J5′→ 3′ WK ⊈ F1 J5′→ 3′ WK follows from
{𝑎𝑎}∗ ∈ NS J5′→ 3′ WK. Lastly, both families contain the language {𝑎}∗ . □
126 4 Jumping Multi-Head Automata
Proof First, Examples 4.15 and 4.21 and Proposition 4.12 show that F J5′→ 3′ WK,
N J5′→ 3′ WK, FS J5′→ 3′ WK, and F1 J5′→ 3′ WK contain some non-regular
languages. Second, let 𝐿 = {𝑐𝑎 𝑛 𝑐𝑏 𝑚 𝑐 | 𝑛, 𝑚 ≥ 0} ∪ {𝜀}. 𝐿 is clearly a regular
language. Considering the proof of Lemma 4.37 and the previous results, we can
easily see that F J5′→ 3′ WK, N J5′→ 3′ WK, FS J5′→ 3′ WK, and F1 J5′→ 3′ WK
cannot contain 𝐿. Lastly, all families contain the language {𝑎}∗ . □
Proposition 4.19 FIN 𝜀-inc is incomparable with F1 J5′→ 3′ WK, NS J5′→ 3′ WK,
and N1 J5′→ 3′ WK.
Proof Considering previous results. First, F1 J5′→ 3′ WK, NS J5′→ 3′ WK, and
N1 J5′→ 3′ WK cannot contain {𝜀, 𝑎𝑎}. Second, F1 J5′→ 3′ WK, NS J5′→ 3′ WK,
and N1 J5′→ 3′ WK contain {𝑎}∗ . Lastly, all families contain {𝜀}. □
All the obtained results comparing the accepting power of different variants of
jumping 5′ → 3′ WKFAs are summarized in Figure 4.11.
Conclusion
The results clearly show that, with the addition of the jumping mechanism into the
model, the accepting power has been increased above sensing 5′ → 3′ WKFA. The
model is now able to accept some nonlinear and even some non-context-free lan-
guages. On the other hand, the jumping movement of the heads is restricted compared
to jumping finite automata, and this limits its capabilities to accept languages that
require a more sophisticated discontinuous information processing. Considering the
comparison with full-reading sensing 5′ → 3′ WKFAs, the results are not yet clear
and further research is required. However, we know that there are some languages,
like {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 0}, that cannot be accepted by jumping 5′ → 3′ WKFAs and
that are accepted by full-reading sensing 5′ → 3′ WKFAs (see Nagy [2008, 2010,
2013]).
If we compare the hierarchies of language families related to the restricted variants
of jumping 5′ → 3′ WKFAs and sensing 5′ → 3′ WKFAs (see Nagy [2010, 2013];
Nagy et al. [2017]), there are several noticeable remarks. Most importantly, the
1-limited restriction (1) has a negative impact on the accepting power, which is
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 127
J5′→ 3′ WK
S J5′→ 3′ WK F J5′→ 3′ WK
REG
F1 J5′→ 3′ WK NS J5′→ 3′ WK
FIN
FINε-inc
N1 J5′→ 3′ WK
Fig. 4.11 J5′→ 3′ WK and its language family relationships (in this figure, any two families are
incomparable unless explicitly diagrammed otherwise).
usually not the case in sensing 5′ → 3′ WKFAs. Secondly, when several restrictions
are combined together, the hierarchy structure resembles the alternative structure
of sensing 5′ → 3′ WKFAs without the sensing distance from Nagy et al. [2017].
Lastly, almost all restricted variants, with the exception of NS and N1, are still able
to accept some nonlinear languages, which cannot be accepted by any variants of
sensing 5′ → 3′ WKFAs.
The reader may notice that the ⊖-jumping can be used only in situations where it
is forced by the current configuration. Jumping finite automata usually immediately
erase symbols from the configuration and do not use the auxiliary symbol #. It is
thus a question for future research whether we can safely remove this part from the
model and keep the accepting power intact.
Finally, let us note that Section 4.3 has introduced a less restrictive combination
of jumping finite automata and classical WKFAs. Compared to jumping 5′ → 3′
WKFAs, both JWKFA heads jump freely over the input tape while all symbols
on both input tape strands have to be processed. This approach generates a very
different behavior compared to sensing 5′ → 3′ WKFAs, which resembles the
original behavior of GJFAs in many respects.
Part III
Jumping Grammars
As a whole, the theory of computation makes use of incredibly many different
language-defining models. Nevertheless, despite their huge diversity and quantity, in
terms of the way they work, all these models can be classified into two fundamental
categories—automata, which accept languages, and grammars, which generate them.
The theory of jumping computation is no exception. While the previous part of
this book has been devoted to jumping automata, the present part covers jumping
grammars as the fundamental grammatical models that work in a discontinuous or,
to put it in the terminology of the present monograph, jumping way.
This part consists of Chapters 5 through 7. Chapter 5 studies the jumping gen-
eration of language by classical grammars, which work in a strictly sequential way.
Then, Chapter 6 discusses the same topic in terms of grammars that work in semi-
parallel. Finally, Chapter 7 explores the jumping generation of language by pure
sequential and parallel grammars, which have only terminals.
Chapter 5
Sequential Jumping Grammars
5.1 Introduction
To start with, recall the notion of a classical grammar (see Section 2.3), 𝐺, which
represents a language-generating rewriting system based upon an alphabet of symbols
and a finite set of production rules or, simply, rules. The alphabet of symbols is
divided into two disjoint subalphabets—the alphabet of terminal symbols and the
alphabet of nonterminal symbols. Each production rule represents a pair of the form
(𝑥, 𝑦), where 𝑥 and 𝑦 are strings over the alphabet of 𝐺. Customarily, (𝑥, 𝑦) is written
as 𝑥 → 𝑦, where 𝑥 and 𝑦 are referred to as the left-hand side and the right-hand
side of 𝑥 → 𝑦. Starting from a special start nonterminal symbol, 𝐺 repeatedly
rewrites strings according to its rules until it obtains a sentence—that is, a string that
solely consists of terminal symbols; the set of all sentences represents the language
generated by the grammar. During every rewriting step of this generating process, 𝐺
always applies a single rule, so it represents a grammatical model that works strictly
sequentially.
To see the similarity as well as the difference between the classical grammatical
concept and its jumping version, take a closer look at a single rewriting step in 𝐺.
Classically, 𝐺 rewrites a string 𝑧 according to 𝑥 → 𝑦 in the following three-phase
way:
(1) selects an occurrence of 𝑥 in 𝑧;
(2) erases it;
(3) inserts 𝑦 precisely at the position of this erasure.
131
132 5 Sequential Jumping Grammars
More briefly and formally, let 𝑧 = 𝑢𝑥𝑣, where 𝑢 and 𝑣 are strings; by using 𝑥 → 𝑦,
𝐺 rewrites 𝑢𝑥𝑣 as 𝑢𝑦𝑣.
Introduced in Křivka and Meduna [2015], the notion of a jumping grammar—
the central subject of this chapter—is conceptualized just like that of a classical
grammar, and it works sequentially, too; however, it rewrites strings in a different
way. More precisely, consider 𝐺 as a jumping grammar. Let 𝑧 and 𝑥 → 𝑦 have the
same meaning as above. 𝐺 rewrites a string 𝑧 according to 𝑥 → 𝑦 in the following
way:
(j1) it performs (1) and (2), then
(j2) it inserts 𝑦 anywhere in 𝑢𝑣.
Therefore, during (j2), 𝐺 can jump over a portion of the rewritten string in either
direction and inserts 𝑦 there. Formally, by using 𝑥 → 𝑦, 𝐺 rewrites 𝑢𝑐𝑣 as 𝑢𝑑𝑣,
where 𝑢, 𝑣, 𝑤, 𝑐, 𝑑 are strings such that either (i) 𝑐 = 𝑥𝑤 and 𝑑 = 𝑤𝑦 or (ii) 𝑐 = 𝑤𝑥
and 𝑑 = 𝑦𝑤. Otherwise, it coincides with the standard notion of a grammar.
To illustrate the difference between classical and jumping versions of grammars,
consider any sentential form occurring in any derivation made by a context-free
grammar 𝐺. Let 𝐴 be the leftmost nonterminal in this sentential form. If 𝐺 represents
a classical non-jumping context-free grammar, it can never modify the terminal
prefix preceding 𝐴 throughout the rest of this derivation. However, if 𝐺 is a jumping
context-free grammar, it can perform this modification by inserting the right-hand
side of a rule into this prefix.
The fundamental purpose of this chapter is to give an essential body of rigorous
knowledge concerning jumping grammars. Since the determination of the power of
language-defining devices has always fulfilled perhaps the most important role in
formal language theory, it focuses its coverage on this topic. Regarding the gen-
eral versions of jumping grammars, it demonstrates that they are as powerful as
the classical unrestricted grammars. As there exist many important special versions
of the unrestricted grammars, defined in Section 2.3, the present chapter discusses
their jumping counterparts as well. It studies the jumping versions of context-free
grammars and their special cases, including regular grammars, right-linear gram-
mars, linear grammars, and context-free grammars of finite index. Surprisingly, all
of them have a different power than their classical counterparts. The chapter also
compares the generative power of jumping grammars with the accepting power of
jumping finite automata, covered in Part II. More specifically, it demonstrates that
regular jumping grammars are as powerful as these automata.
Although applications are systematically covered later in this book (Chapter 9),
we can make some preliminary remarks and suggestions concerning the expected
future to jumping grammars. It should be clear by now that jumping grammars pri-
marily serve as grammatical models that allow us to explore information processing
performed in a discontinuous way adequately and rigorously. Consequently, appli-
cations of these grammars are expected in any scientific area involving this kind of
information processing, ranging from applied mathematics through computational
linguistics and compiler writing up to data mining and biology-related informatics.
Taking into account the way these grammars are conceptualized, we see that they
5.2 Definitions and Examples 133
are particularly useful and applicable under the circumstances that primarily con-
cern the number of occurrences of various symbols or substrings rather than their
mutual context. To give a more specific insight into possible applications of this
kind in terms of bioinformatics, consider DNA computing, whose significance is
indisputable in computer science at present. Recall that DNA is a molecule encoding
genetic information by a repetition of four basic units called nucleotides—namely,
guanine, adenine, thymine, and cytosine, denoted by letters 𝐺, 𝐴, 𝑇, and 𝐶, respec-
tively. In terms of formal language theory, a DNA sequence is described as a string
over {𝐺, 𝐴, 𝑇, 𝐶}; for instance,
Let ℎ ⇒ be one of the four derivation relations (i) through (iv) over Σ∗ ; in other
words, ℎ equals 𝑠, 𝑙 𝑗, 𝑟 𝑗, or 𝑗. As usual, for every 𝑛 ≥ 0, the 𝑛th power of ℎ ⇒ is
denoted by ℎ ⇒𝑛 . The transitive-reflexive closure and the transitive closure of ℎ ⇒
are denoted by ℎ ⇒∗ and ℎ ⇒+ , respectively.
Example 5.2 Consider the following CSG 𝐺 = ({𝑆, 𝐴, 𝐵, 𝑎, 𝑏}, {𝑎, 𝑏}, 𝑃, 𝑆)
containing the following rules:
𝑆 → 𝑎 𝐴𝐵𝑏
𝑆 → 𝑎𝑏
𝐴𝐵 → 𝐴𝐴𝐵𝐵
𝑎𝐴 → 𝑎𝑎
𝐵𝑏 → 𝑏𝑏
Example 5.3 Consider the language of all well-written arithmetic expressions with
parentheses (, ) and [, ] (see semi-Dyck language 𝐷 2 in Example 2.9). Eliminate
everything but the parentheses in this language to obtain the language 𝐿(𝐺, 𝑠 ⇒)
defined by the CFG 𝐺 = (Σ = {𝐸, (, ), [, ]}, Δ = {(, ), [, ]}, {𝐸 → (𝐸)𝐸, 𝐸 →
[𝐸]𝐸, 𝐸 → 𝜀}, 𝐸). 𝐺 is not of a finite index (see [Salomaa, 1973, Example 10.1 on
page 210]). Consider the jumping RLG 𝐻 = (Σ, Δ, 𝑃 𝐻 , 𝐸), where 𝑃 𝐻 contains
𝐸 → ()𝐸
𝐸 → []𝐸
𝐸→𝜀
5.3 Results 135
5.3 Results
This section primarily investigates the generative power of jumping grammars. First,
it compares the generative power of jumping grammars with the accepting power
of jumping finite automata. More specifically, it demonstrates that regular jumping
grammars are as powerful as jumping finite automata. Regarding grammars, the
general versions of jumping grammars are as powerful as classical phrase-structure
grammars. As there exist many important special versions of these classical gram-
mars, we discuss their jumping counterparts in the present section as well. It studies
the jumping versions of context-free grammars and their special cases, including
regular grammars, right-linear grammars, and linear grammars. Surprisingly, all of
them have a different power than their classical counterparts. In its conclusion, this
section formulates several open problems and suggests future investigation areas.
Proof Assume that there exists a MONG 𝐺 = (Σ, Δ, 𝑃, 𝑆) such that 𝐿 (𝐺, 𝑗 ⇒) =
{𝑎}∗ {𝑏}∗ . Let 𝑝 : 𝑥 → 𝑦 ∈ 𝑃 be the last applied rule during a derivation 𝑆 𝑗 ⇒+ 𝑤,
where 𝑤 ∈ 𝐿 (𝐺, 𝑗 ⇒); that is, 𝑆 𝑗 ⇒∗ 𝑢𝑥𝑣 𝑗 ⇒ 𝑤 [ 𝑝], where 𝑢, 𝑣, 𝑤 ∈ Δ∗ and
𝑦 ∈ {𝑎}+ ∪ {𝑏}+ ∪ {𝑎}+ {𝑏}+ . In addition, assume that the sentential form 𝑢𝑥𝑣 is
longer than 𝑥 such that 𝑢𝑣 ∈ {𝑎}+ {𝑏}+ .
(i) If 𝑦 contains at least one symbol 𝑏, the last jumping derivation step can place 𝑦
at the beginning of the sentence and create a string from
136 5 Sequential Jumping Grammars
Corollary 5.1 The following pairs of language families are incomparable but not
disjoint:
(i) REG and JMON;
(ii) CF and JMON;
(iii) REG and JREG;
(iv) CF and JREG.
Proof Since REG ⊂ CF, it is sufficient to prove that REG − JMON, JREG − CF,
and REG ∩ JREG are nonempty. By Lemma 5.1,
As even some very simple regular language such as {𝑎}+ {𝑏}+ cannot be gen-
erated by jumping derivation in CSGs or even MONGs, we pinpoint the following
open problem and state a theorem comparing these families with context-sensitive
languages.
Open Problem Is JCS ⊆ JMON proper? □
Proof To see that JMON ⊆ CS, we demonstrate how to transform any jump-
ing MONG, 𝐺 = (Σ𝐺 , Δ, 𝑃𝐺 , 𝑆), to a MONG, 𝐻 = (Σ 𝐻 , Δ, 𝑃 𝐻 , 𝑆), such that
𝐿 (𝐺, 𝑗 ⇒) = 𝐿(𝐻, 𝑠 ⇒). Set Σ 𝐻 = 𝑁 𝐻 ∪ Δ and 𝑁 𝐻 = 𝑁𝐺 ∪ { 𝑋¯ | 𝑋 ∈ Σ𝐺 }. Let 𝜋
be the homomorphism from Σ𝐺 ∗ to Σ∗𝐻 defined by 𝜋(𝑋) = 𝑋¯ for all 𝑋 ∈ Σ𝐺 . Set
𝑃 𝐻 = 𝑃1 ∪ 𝑃2 , where
Ø
𝑃1 = {𝛼 → 𝜋(𝛽), 𝜋(𝛽) → 𝛽}
𝛼→𝛽 ∈ 𝑃𝐺
and
5.3 Results 137
Ø
𝑃2 = {𝑋 𝜋(𝛽) → 𝜋(𝛽) 𝑋, 𝜋(𝛽) 𝑋 → 𝑋 𝜋(𝛽) | 𝑋 ∈ Σ𝐺 }
𝛼→𝛽 ∈ 𝑃𝐺
𝑘
Ø
Σ 𝐻 = {⟨𝑥⟩ | 𝑥 ∈ (Σ𝐺 − Δ) 𝑖 } ∪ Δ
𝑖=1
and set
∪ {⟨𝐴⟩ → 𝑥 | 𝐴 → 𝑥 ∈ 𝑃𝐺 , 𝑥 ∈ Δ∗ }
Basic Idea. CFG 𝐺 working with index 𝑘 means that every sentential form contains
at most 𝑘 nonterminal symbols. In jumping derivation mode, the position of a
nonterminal symbol does not matter for context-free rewriting. Together with the
finiteness of 𝑁, we can store the list of nonterminals using just one nonterminal from
constructed Σ 𝐻 − Δ in the simulating RLG.
For every jumping derivation step 𝛾 𝐴𝛿 𝑗 ⇒ 𝑘 𝛾 ′ 𝑥𝛿 ′ by 𝐴 → 𝑥 in 𝐺, there is a
simulating jumping derivation step 𝜏( 𝛾)⟨𝜂(𝛾
¯ ¯ ⇒ 𝜏( 𝛾¯′ )𝜏(𝑥)⟨𝜂(𝛾𝛿𝑥)⟩𝜏( 𝛿¯′ )
𝐴𝛿)⟩𝜏( 𝛿) 𝑗
′ ′ ¯ ¯
in 𝐻, where 𝛾𝛿 = 𝛾 𝛿 = 𝛾¯ 𝛿 = 𝛾¯ 𝛿 . The last simulating step of jumping application
′ ′
of 𝐴 → 𝑤 with 𝑤 ∈ Δ∗ replaces the only nonterminal of the form ⟨𝐴⟩ by 𝑤 that can
be placed anywhere in the string. □
138 5 Sequential Jumping Grammars
Consider the finite index restriction in the family JCFfin in Theorem 5.2. Drop-
ping this restriction gives rise to the question, whether the inclusion JCFfin ⊆ JCF
is proper that was proved in Madejski [2016].
JCFfin ⊂ JCF.
𝑃 𝐻 = {𝑆 𝐻 → #𝑆𝐺 , # → ⌊$, ⌊ ⌋ → #, # → 𝜀}
∪{$𝛼 →⌋ 𝛽 | 𝛼 → 𝛽 ∈ 𝑃𝐺 }
Basic Idea. Nonterminal # has at most one occurrence in the sentential form. # is
generated by the initial rule 𝑆 𝐻 → #𝑆𝐺 . This symbol participates in the beginning
and end of every simulation of the application of a rule from 𝑃𝐺 . Each simulation
consists of several jumping derivation steps:
(i) # is expanded to a string of two nonterminals—marker of a position (⌊), where
the rule is applied in the sentential form, and auxiliary symbol ($) presented as
a left context symbol in the left-hand side of every simulated rule from 𝑃𝐺 .
(ii) For each 𝑥 → 𝑦 from 𝑃𝐺 , $𝑥 →⌋𝑦 is applied in 𝐻. To be able to finish the
simulation properly, the right-hand side (⌋𝑦) of applied rule has to be placed
right next to the marker symbol ⌊; otherwise, we cannot generate a sentence.
(iii) The end of the simulation (rule ⌊ ⌋ → #) checks that the jumping derivation was
applied like in terms of 𝑠 ⇒.
(iv) In the end, # is removed to finish the generation of a string of terminal symbols.
Proof (Claim A) The claim follows from the rules in 𝑃 𝐻 (see the construction in
the proof of Lemma 5.2). Note that occur(𝑦, {#, $, ⌊, ⌋, 𝑆 𝐻 }) ≤ 2 and in addition, if
symbol # occurs in 𝑦 then occur(𝑦, {$, ⌊, ⌋, 𝑆 𝐻 }) = 0. □
𝑦 ′ = 𝑢 ′ #𝑣 ′ 𝑗 ⇒ 𝑢 ′′ ⌊$𝛼𝑣 ′′ [# → ⌊$]
′′ ′′
𝑗 ⇒ 𝑢 ⌊ ⌋ 𝛽𝑣 [⌊ ⌋ → #]
′′′ ′′′ [# → 𝜀] = 𝑥 ′
𝑗 ⇒ 𝑢 #𝑣
Proof By the Turing-Church thesis, JRE ⊆ RE. The opposite inclusion holds by
Lemma 5.2 that is proved in details by Claim B and Claim C. □
Lemma 5.3 Let 𝜂 and 𝜏 be the homomorphisms from the proof of Theorem 5.2 and
𝑋 ∈ {RG, RLG, LG, CFG}. For every 𝑋 𝐺 = (Σ, Δ, 𝑃, 𝑆) with 𝑁 = Σ − Δ, if
𝑆 𝑗 ⇒∗ 𝛾 𝑗 ⇒𝑚 𝑤 in 𝐺, 𝑚 ≥ 0, 𝛾 ∈ Σ∗ , 𝑤 ∈ Δ∗ , then for every 𝛿 ∈ Σ∗ such that
𝜏(𝛾) = 𝜏(𝛿) and 𝜂(𝛿) ∈ perm(𝜂(𝛾)), there is 𝛿 𝑗 ⇒∗ 𝑤 in 𝐺.
𝑆 𝑗 ⇒∗ 𝛼𝛽 𝑗 ⇒∗ 𝑤 in 𝐺
Proof By Parikh’s Theorem (see [Harrison, 1978, Theorem 6.9.2 on page 228]),
for each context-free language 𝐿 ⊆ Σ∗ , 𝜓 Σ (𝐿) is semilinear. Let 𝐺 be a CFG
such that 𝐿 (𝐺, 𝑠 ⇒) = 𝐿. From the definition of 𝑗 ⇒ and CFG it follows that
𝜓 Σ (𝐿 (𝐺, 𝑠 ⇒)) = 𝜓 Σ (𝐿(𝐺, 𝑗 ⇒)), so 𝜓 Σ (𝐿(𝐺, 𝑗 ⇒)) is semilinear as well. □
Recall that the family of context-sensitive languages is not semilinear (for in-
stance, from [Dassow and Păun, 1989, Example 2.3.1 and Theorem 2.3.1], it follows
𝑛
that {𝑎 2 | 𝑛 ≥ 0} ∈ CS, but it is not a semilinear language). By no means, this
result rules out that JCS or JMON are semilinear. There is, however, another kind
of results concerning multiset grammars (see Kudlek et al. [2000]) saying that a
context-sensitive multiset grammar generates a non-semilinear language. The multi-
set grammars work with Parikh vector of a sentential form so the order of symbols in
the sentential form is irrelevant. Then, all permutations of terminal strings generated
by the grammar belong to the generated language.
Instead of the full definition of multiset grammars (see Kudlek et al. [2000]),
based on notions from the theory of macrosets, we introduce multiset derivation
mode concerning the classical string formal language theory.
142 5 Sequential Jumping Grammars
(II) In the multiset derivation mode, the mutual neighborhood of the rewritten sym-
bols is completely irrelevant—that is, 𝐺 applies any rule without any restriction
placed upon the mutual adjacency of the rewritten symbols in the multiset
derivation mode (see Definition 5.2). To put this in a different way, 𝐺 rewrites
any permutation of the required context in this way.
In the construction of the jumping CSG 𝐻, which simulates the multiset MONG
𝐺, we arrange (II) as follows.
(II.a) In 𝐻, the only rules generating terminals belong to 𝑃𝑡 . By using homomor-
phism ℎ, in every other rule, each terminal 𝑎 is changed to the corresponding
nonterminal ⟨𝑎⟩.
(II.b) In 𝑃𝑐 , there are rules that can rearrange the order of all nonterminals arbitrarily
in any sentential form of 𝐻. Thus, considering (II.a), just like in 𝐺, no context
restriction placed upon the mutual adjacency of rewritten symbols occurs in 𝐻.
Indeed, 𝐻 only requires the occurrence of the symbols from ℎ(lhs( 𝑝)) during
the simulation of an application of 𝑝 ∈ 𝑃𝐺 .
In order to arrange (I), an application of a monotonous context-sensitive rule
𝑝 : 𝑋1 𝑋2 · · · 𝑋𝑛 → 𝑌1𝑌2 · · · 𝑌𝑚 ∈ 𝑃𝐺 , 2 ≤ 𝑛 ≤ 𝑚 in 𝑢 𝑚 ⇒ 𝑣 [ 𝑝] in 𝐺 is simulated
in 𝐻 by the following two phases.
(i) First, 𝐻 verifies that a sentential form 𝑢 contains all symbols from ℎ(lhs( 𝑝))
and marks them by subscript 𝑝 for the consecutive rewriting. Therefore, to finish
the simulation of the application of 𝑝, 𝐻 has to use rules created based on 𝑝
during the construction of 𝑃𝑐𝑠 since no other rules from 𝑃 𝐻 rewrite symbols
𝑝 𝑋, 𝑋 ∈ 𝑁 𝐺 ∪ 𝑁 𝑡 .
where 𝜌𝑖 ∈ 𝑃𝑐∗ for 𝑛 ≤ 𝑖 ≤ 2𝑛, 𝑋ℓ′ = ℎ(𝑋ℓ ) for 1 ≤ ℓ ≤ 𝑛, and 𝑌𝑘′ = ℎ(𝑌𝑘 ) for
1 ≤ 𝑘 ≤ 𝑚.
144 5 Sequential Jumping Grammars
Proof (Claim A) In the construction given in the proof of Theorem 5.6, we introduce
𝑃𝑐 𝑓 and 𝑃𝑐𝑠 such that for every 𝑝 ∈ 𝑃 𝐻 − 𝑃𝑡 , rhs( 𝑝) ∈ (Σ 𝐻 − Δ) ∗ . In 𝑆 𝑗 ⇒∗ 𝑤 ′ ,
we apply rules only from 𝑃 𝐻 − 𝑃𝑡 so 𝑤 ′ ∈ 𝑁𝑡∗ , and no terminal symbol occurs in
any sentential form in 𝑆 𝑗 ⇒∗ 𝑤 ′ . Then, by rules from 𝑃𝑡 , we generate 𝑤 such that
𝑤 = ℎ(𝑤 ′ ). □
Claim B If 𝑤 ∈ 𝐿 (𝐻, 𝑗 ⇒), then perm(𝑤) ⊆ 𝐿 (𝐻, 𝑗 ⇒). □
Proof (Claim B) Let 𝑤 ∈ Δ∗ . Assume that 𝑤 is generated in 𝐻 as described in
Claim A—that is, 𝑆 𝑗 ⇒∗ 𝑤 ′ 𝑗 ⇒∗ 𝑤 such that 𝑤 ′ = ℎ(𝑤). Since rules from 𝑃𝑡
rewrite nonterminals in 𝑤 ′ in a one-by-one way in the jumping derivation mode, we
have 𝑤 ′ 𝑗 ⇒∗ 𝑤 ′′ in 𝐻 for every 𝑤 ′′ ∈ perm(𝑤). □
∗ 𝑣 ′ in 𝐻 such that 𝑣 ′ ∈
Claim C If 𝑆 𝑚⇒ 𝑣 in 𝐺 for some ℓ ≥ 0, then 𝑆 𝑗⇒
ℓ
perm(ℎ(𝑣)). □
Proof (Claim C) We prove this claim by induction on ℓ ≥ 0.
0 0
Basis. Let ℓ = 0. That is, 𝑆 𝑚⇒ 𝑆 in 𝐺, so 𝑆 𝑗⇒ 𝑆 in 𝐺. By ℎ(𝑆) = 𝑆,
𝑆 ∈ perm(ℎ(𝑆)).
Induction Hypothesis. Assume that the claim holds for all 0 ≤ ℓ ≤ 𝑘, for some 𝑘 ≥ 0.
Induction Step. Take any 𝑆 𝑚⇒ 𝑣. Express 𝑆 𝑚⇒ 𝑣 as
𝑘+1 𝑘+1
𝑘
𝑆 𝑚⇒ 𝑢 𝑚⇒ 𝑣 [ 𝑝 : 𝑥 → 𝑦]
𝑆 𝑗 ⇒ 𝑘 𝑢 𝑗 ⇒ 𝑣 [𝑞 : 𝑥 → 𝑦] 𝑗 ⇒∗ 𝑣¯
Proof Obviously, by Definition 5.1, JCF ⊆ JCS. By Corollary 5.3, JCS contains a
non-semilinear language that does not belong to JCF. □
5.3 Results 147
Next, we demonstrate that the generative power of regular and right-linear jumping
grammars is the same as accepting power of jumping finite automata and general
jumping finite automata, respectively. Consequently, the following equivalence and
the previous results in this chapter imply several additional properties of languages
that are generated by regular and right-linear jumping grammars such as closure
properties and decidability.
Proof Prove this statement by analogy with the proof of Theorem 5.7. □
Figure 5.1 summarizes the achieved results on the generative and accepting power
of jumping grammars and automata.
RE JRE
CS
JMON
JCS
CF
JCF JCF−ε
LIN
JRL JCFfin GJFA
REG
JREG
JFA
FIN
Fig. 5.1 Language families defined by jumping grammars and automata in relationships to the
Chomsky hierarchy.
5.3 Results 149
Future Investigation
𝛼𝐴𝛽 → 𝛼𝛾 𝛽, where 𝐴 ∈ 𝑁, 𝛼, 𝛽, 𝛾 ∈ Σ∗ , 𝛾 ≠ 𝜀.
IV.b Do not move the context of the rewritten nonterminal; that is, find 𝐴 with
left context 𝛼 and right context 𝛽, remove this 𝐴 from the current sentential
form, and place 𝛾 in the new sentential form, such that string 𝛾 will be again
in the context of both 𝛼 and 𝛽 (but it can be different occurrence of 𝛼 and
𝛽). For instance,
IV.c Similarly to (b), in the third variant we do not move the context of the
rewritten nonterminal either and, in addition, 𝛾 has to be placed between
150 5 Sequential Jumping Grammars
Notice that this derivation mode influences only the application of context-
free rules (i.e., 𝛼 = 𝛽 = 𝜀).
Example 5.4 Example 5.2 shows a CSG that generates {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 1} when
the alternative jumping derivation mode 𝑗 ′ ⇒ for CSGs is used. In context
of Lemma 5.1, the alternative jumping derivation mode (b) can increase the
generative power of jumping CSGs (a). In fact, it is an open question whether
the language family generated by CSGs with 𝑗 ′ ⇒ mode is strictly included in
the language family generated by MONGs with 𝑗 ′ ⇒ mode.
This chapter consists of three sections. Section 6.1 gives an introduction into paral-
lel versions of jumping grammars. Section 6.2 presents all the definitions needed.
Finally, Section 6.3 presents all the fundamental results about parallel jumping
grammars.
6.1 Introduction
All the grammars discussed in the previous chapter work strictly sequentially in the
sense that they apply a single rule during every derivation step. Considering the
current universal trend of performing computation in parallel, it is more than natural
and desirable to modify the grammatical computational models so that they also
work in parallel, and this is precisely what the present chapter is devoted to. Out
of all the sequential grammars, this chapter selects context-free grammars for this
modification because these grammars and their variants represent perhaps the most
significant grammatical model from a theoretical as well as practical standpoint;
for instance, these grammars are by far the most widely accepted specification tool
for the syntactic structure of programming language as clearly demonstrated by an
examination of any programming high-level language manual. In other words, the
present chapter, based on Meduna and Soukup [2017a], studies jumping versions of
parallelly modified context-free grammars, referred to as scattered context grammars,
which can simultaneously apply several rules during a single derivation step.
To give a more detailed insight into the key motivation and reason for introducing
and investigating jumping versions of scattered context grammars, let us take a
closer look at a more specific kind of information processing in a discontinuous
way. Consider a process 𝑝 that deals with information 𝑖. Typically, during a single
computational step, 𝑝 (1) reads 𝑛 pieces of information, 𝑥1 through 𝑥 𝑛 , in 𝑖, (2) erases
them, (3) generates 𝑛 new pieces of information, 𝑦 1 through 𝑦 𝑛 , and (4) inserts them
into 𝑖 possibly at different positions than the original occurrence of 𝑥1 through 𝑥 𝑛 ,
which was erased. To explore computation like this systematically and rigorously,
151
152 6 Parallel Jumping Grammars
the present chapter introduces and discusses jumping versions of scattered context
grammars, which represent suitable grammatical models of computation like this.
To see this suitability, recall that the notion of a scattered context grammar 𝐺
represents a language-generating rewriting system based upon an alphabet of symbols
and a finite set of rules (see Greibach and Hopcroft [1969]). The alphabet of symbols
is divided into two disjoint subalphabets—the alphabet of terminal symbols and the
alphabet of nonterminal symbols. In 𝐺, a rule 𝑟 is of the form
( 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 ) → (𝑥 1 , 𝑥2 , . . . , 𝑥 𝑛 )
for some positive integer 𝑛. On the left-hand side of 𝑟, the 𝐴s are nonterminals. On
the right-hand side, the 𝑥s are strings. 𝐺 can apply 𝑟 to any string 𝑢 of the form
𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛
where 𝑢s are any strings. Notice that 𝐴1 through 𝐴𝑛 are scattered throughout 𝑢, but
they occur in the order prescribed by the left-hand side of 𝑟. In essence, 𝐺 applies 𝑟
to 𝑢 so
(1) it deletes 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 in 𝑢, after which
(2) it inserts 𝑥 1 , 𝑥 2 , . . . , 𝑥 𝑛 into the string resulting from the deletion (1).
By this application, 𝐺 makes a derivation step from 𝑢 to a string 𝑣 of the form
𝑣 = 𝑣 0 𝑥1 𝑣 1 . . . 𝑣 𝑛−1 𝑥 𝑛 𝑣 𝑛
Notice that 𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 are inserted in the order prescribed by the right-hand side
of 𝑟. However, they are inserted in a scattered way—that is, between the inserted 𝑥s,
some substrings 𝑣s occur.
To formalize the above-described computation, consisting of phases (1) through
(4), the present section introduces and studies the following nine jumping derivation
modes of the standard application:
(1) Mode 1 requires that 𝑢 𝑖 = 𝑣 𝑖 for all 𝑖 = 0, . . . , 𝑛 in the above-described derivation
step.
(2) Mode 2 obtains 𝑣 from 𝑢 as follows:
(2.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(2.b) 𝑥1 through 𝑥 𝑛 are inserted between 𝑢 0 and 𝑢 𝑛 .
(3) Mode 3 obtains 𝑣 from 𝑢 so it changes 𝑢 by performing (3.a) through (3.c),
described next:
(3.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(3.b) 𝑥1 and 𝑥 𝑛 are inserted into 𝑢 0 and 𝑢 𝑛 , respectively;
(3.c) 𝑥2 through 𝑥 𝑛−1 are inserted between the newly inserted 𝑥1 and 𝑥 𝑛 .
(4) In Mode 4, the derivation from 𝑢 to 𝑣 is performed by the following steps:
(4.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
6.1 Introduction 153
6.2 Definitions
where
• Σ is a total alphabet;
• Δ ⊂ Σ an alphabet of terminals;
∞
•𝑃⊆ 𝑁 𝑚 × (Σ∗ ) 𝑚 is a finite set of rules of the form
Ð
𝑚=1
( 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 ) → (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 )
𝑢 ⇒𝐺 𝑣 [ 𝑝]
𝐿 (𝐺) = 𝑤 ∈ Δ∗ | 𝑆 ⇒∗𝐺 𝑤
where
𝑃 = (𝑆) → (𝑎 𝐴𝑏 𝐴𝑐 𝐴),
( 𝐴, 𝐴, 𝐴) → (𝑎 𝐴, 𝑏 𝐴, 𝑐 𝐴),
( 𝐴, 𝐴, 𝐴) → (𝜀, 𝜀, 𝜀)
For example, the sentence 𝑎𝑎𝑏𝑏𝑐𝑐 is generated by 𝐺 as follows:
where
𝑃′ = (𝑆) → ( 𝐴𝐴𝐴),
( 𝐴, 𝐴, 𝐴) → (𝑎 𝐴, 𝑏 𝐴, 𝑐 𝐴),
( 𝐴, 𝐴, 𝐴) → (𝑎, 𝑏, 𝑐)
To find a detailed overview of many results about SCGs, see Meduna and Techet
[2010]. The investigation of SCGs is still a vivid topic in the theory of formal
languages as indicated in Csuhaj-Varjú and Vaszil [2010]; Křoustek et al. [2011];
and Křivka and Meduna [2021] with some very interesting results.
In the rest of this section, we formally define nine derivation modes (1) through
(9), sketched in the previous introductory section.
Definition 6.3 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG, and let 𝜚 be a relation over Σ∗ . Set
𝐿(𝐺, 𝜚) = {𝑥 | 𝑥 ∈ Δ∗ , 𝑆 𝜚∗ 𝑥}
𝑤 1 𝐴𝑤 2 𝑖⇒ 𝑤 1 𝑥𝑤 2 , for 𝑖 = 1, . . . , 9
6.3 Results
This section demonstrates that SCGs working under any of the derivation modes
defined in the previous section are computationally complete—that is, they charac-
terize the family of recursively enumerable languages. In addition, in its conclusion,
it formulates several open problems.
Let us recall Theorem 2.9 that fulfills an important role in the proofs throughout
this section. Theorem 2.9 states that every 𝐿 ∈ RE can be expressed as a homomor-
phism of the intersection of two context-free languages.
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 1⇒ 𝑢 0 𝑥1 𝑢 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑢 𝑛
Proof (Claim A) Basic idea. First, the starting rule (1) is applied. The starting
nonterminals 𝑆1 and 𝑆2 are inserted into the current sentential form. Then, by using
the rules from (2), 𝐺 simulates derivations of both 𝐺 1 and 𝐺 2 and generates the
sentential form 𝑤 = $𝑤 1 1111𝑤 2 $.
Suppose 𝑆 1⇒∗ 𝑤, where symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅. Recall, 𝑁1 and 𝑁2 denote
the nonterminal alphabets of 𝐺 1 and 𝐺 2 , respectively. If 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), then
𝑡 (𝑤 1 ) = ℎ(𝑣), where 𝑣 ∈ 𝐿 1 ∩ 𝐿 2 and ℎ(𝑣) ∈ 𝐿. In other words, 𝑤 represents a
successful derivation of both 𝐺 1 and 𝐺 2 , where both grammars have generated the
same sentence 𝑣; therefore, 𝐺 must generate the sentence ℎ(𝑣).
The rules from (3) serve to check, whether the simulated grammars have gener-
ated the identical strings. Binary codings of the generated strings are erased while
checking the equality. Always the leftmost and the rightmost symbols are erased;
otherwise, some symbol is skipped. If the codings do not match, some 0 or 1 cannot
be erased and no terminal string can be generated.
Finally, the symbols $ are erased with rule (4). If 𝐺 1 and 𝐺 2 generated the same
sentence and both codings were successfully erased, 𝐺 has generated the terminal
sentence ℎ(𝑣) ∈ 𝐿. □
Claim A implies RE ⊆ JSC1 ⇒ . Thus, Theorem 6.1 holds. □
For brevity, we make use of some terminology introduced in the proof of Theorem
6.1 throughout the rest of this section. That is, each of the upcoming proofs given in
Section 6.3 introduces its own new notions; apart from them, however, it also uses the
notions introduced in the proof of Theorem 6.1 without repeating their definitions
therefrom.
6.3 Results 159
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 2⇒ 𝑣 0 𝑥1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛
where 𝑢 0 𝑢 1 . . . 𝑢 𝑛 = 𝑣 0 𝑣 1 . . . 𝑣 𝑛 , 𝑢 0 𝑧1 = 𝑣 0 and 𝑧2 𝑢 𝑛 = 𝑣 𝑛 , 𝑧1 , 𝑧2 ∈ Σ∗ .
Informally, by using ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, 𝐺 obtains 𝑣 =
𝑣 0 𝑥1 𝑣 1 𝑥 2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 from 𝑢 = 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 in 2⇒ as follows:
(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(2) 𝑥 1 through 𝑥 𝑛 are inserted between 𝑢 0 and 𝑢 𝑛 .
Notice, the mutual order of inserted right-hand-side strings must be always pre-
served.
Example 6.3 Consider SCG defined in Example 6.2 and 2⇒. Context-free rules act in
the same way as in 1⇒ unlike context-sensitive rules. Let us focus on the differences.
First, 𝐺 generates the sentential form 𝑤𝑆 ′ 𝑆 ′′ 𝑤, where 𝑤 ∈ Δ∗ and 𝑤 is the
reversal of 𝑤 in capital letters, with context-free derivations. Then, the nonterminals
to the right of 𝑆 ′ are rewritten to their prime versions and possibly randomly shifted
closer to 𝑆 ′ , which may arbitrarily change their order. Additionally, the sequence of
terminals in the same order is generated to the left of 𝑆 ′ , which we denote 𝑤 ′ . 𝑆 ′
may be also shifted; however, in such case it appears to the right of 𝑆 ′′ , and future
application of rule (viii) is excluded and no terminal string can be generated. Since
all the symbols to the right of 𝑆 ′ must be rewritten, the sequence generated to the
left of 𝑆 ′ must have the same composition of symbols. Next, 𝑆 ′ is erased and 𝑆 ′′ is
rewritten to 𝑆 ′′′ at once, which ensures their mutual order is preserved. If any prime
symbol occurs to the left of 𝑆 ′′′ , it cannot be erased and the derivation is blocked.
Finally, the prime versions of symbols to the right of 𝑆 ′′′ are rewritten to the terminal
string denoted 𝑤 ′′ , which also enables random disordering. Consequently,
Construction. Set
𝑁 = {⌈, ⌉, ⌊, ⌋, |, 𝑋, 𝑋, 𝑋, 𝑋, 𝑌 , 𝑌 , 𝑌 , 𝑌 }
Proof (Claim A) The context-free rules from (1) and (2) of 𝐺 ′ correspond one-to-
one to the rules constructed in (1) and (2) of 𝐺, only the codings of terminals contain
additional symbols. Thus, for every derivation in 𝐺
𝑆 1⇒∗ $𝑣 1 1111𝑣 2 $ = 𝑣
6.3 Results 161
where 𝑣 is generated by using rules from (1) and (2) constructed in 𝐺 and
symbols(𝑣) ∩ (𝑁1 ∪ 𝑁2 ) = ∅, there is
in 𝐺 ′ generated by rules from (1) and (2), where 𝑏(𝑤 1 ) = 𝑡 ′ (𝑣 1 ), 𝑏(𝑤 2 ) = 𝑣 2 . This
also holds vice versa. Since such a sentential form represents a successful derivation
of both 𝐺 1 and 𝐺 2 , without any loss of generality, we can consider it in every
successful derivation of either 𝐺, or 𝐺 ′ . Additionally, in 𝐺
𝑣 1⇒∗ 𝑣 ′ , 𝑣 ′ ∈ Δ∗
𝑤 1⇒∗ 𝑤 ′ , 𝑤 ′ ∈ Δ∗
𝑤 1⇒∗ 𝑤 ′
Next, we prove
′ ′
𝑤 ′ = 𝑋$10𝑖 1⌉ | ( ⌈10𝑖𝑚 1⌉ |) 𝑘 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑘 | ⌈10 𝑗 1$𝑌 1⇒∗ 𝜀
by induction on 𝑘 ≥ 0.
Basis. Let 𝑘 = 0. Then,
′ ′
𝑤 ′ = 𝑋$10𝑖 1⌉ | ⌈11 || 11⌉ | ⌈10 𝑗 1$𝑌
By using the rule produced in (8) and twice rules from (3) 𝐺 ′ performs
′ ′ ′ ′
𝑋$10𝑖 1⌉ | ⌈11 || 11⌉ | ⌈10 𝑗 1$𝑌 1⇒ $0𝑖 ⌉ 𝑋 ⌈11 || 11⌉𝑌 ⌈0 𝑗 $
𝑖′ 𝑗′ 𝑖′ 𝑗′
1⇒ $0 ⌋ 𝑋⌋11 || 11⌉𝑌 ⌈0 $ 1⇒ $0 ⌋ 𝑋⌋11 || 11⌊𝑌 ⌊0 $
Finally, by applying rules from (4), (6), (7), (8), and (9), we finish the derivation
as
$⌋ 𝑋⌋11 || 11⌊𝑌 ⌊$ 1⇒⌋ 𝑋$⌋11 || 11⌊$𝑌 ⌊ 1⇒
𝑋$11 || 11$𝑌 1⇒ $𝑋𝑌 $ 1⇒∗ 𝜀
and the basis holds.
Induction Hypothesis. Suppose there exists 𝑘 ≥ 0 such that
′ ′
𝑤 ′ = 𝑋$10𝑖 1⌉ | ( ⌈10𝑖𝑚 1⌉ |) 𝑙 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑙 | ⌈10 𝑗 1$𝑌 1⇒∗ 𝜀
Proof (Claim C) In 2⇒, applications of context-free rules progress in the same way
as in 1 ⇒. While using context-sensitive rules inserted right-hand-side strings can
be nondeterministically scattered between the previous positions of the leftmost and
rightmost affected nonterminals, only their order is preserved. We show that we can
control this by the construction of 𝐺 ′ .
Recall the observations made at the beginning of the proof of Claim A. Since the
behavior of context-free rules remains unchanged in terms of 2 ⇒, these still hold
true. It remains to prove that Claim B also holds in 2⇒.
In a special case, 2 ⇒ behave exactly as 1 ⇒, hence definitely 𝐿 (𝐺 ′ , 1 ⇒) ⊆
𝐿 (𝐺 ′ , 2⇒). We prove
Claim D In 𝐺 ′ , for
where 𝑤 is generated only by using rules from (1) and (2), and 𝑡 ′ (𝑤 1 ) ≠ reversal(𝑤 2 ),
there is no 𝑤 ′ , where
𝑤 1⇒∗ 𝑤 ′ , 𝑤 ′ ∈ Δ∗
For the sake of readability, in the next proof we omit all symbols from Δ in
𝑤 1 —we consider only nonterminal symbols, which are to be erased.
Proof (Claim D) Suppose any 𝑤, where
in 𝐺 ′ and 𝑤 is generated by using rules from (1) and (2), symbols(𝑤) ∩ (𝑁1 ∪𝑁2 ) = ∅,
and 𝑤 1 ≠ reversal(𝑤 2 ).
6.3 Results 165
From the construction of 𝐺 ′ , there is no rule shifting the left $ to the left and no
rule shifting the right $ to the right. Neither 2⇒ can do this. Since the rule (5) is the
only one erasing 0s, and these 0s must be between two $s, if there is any 0, which is
not between the two $s, it cannot be erased. A similar situation is regarding 1s, 𝑋,
and 𝑌 . Thus, for the sentential form 𝑤, if 0 or 1 is the outermost symbol of 𝑤, no
terminal string can be generated.
Consider two cases (I) 𝑤 1 = 𝜀 or 𝑤 2 = 𝜀 and (II) 𝑤 1 ≠ 𝜀 and 𝑤 2 ≠ 𝜀.
(I) Suppose the condition does not apply. Without any loss of generality, suppose
𝑤 1 = 𝜀. Since 𝑤 1 ≠ reversal(𝑤 2 ), 𝑤 2 ≠ 𝜀. Then,
′
𝑤 =⌉ 𝑋$⌈11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1⌉$𝑌 ⌈
where 𝑘 ≥ 0, 𝑚 ∈ {1, . . . , 𝑘 }, 𝑖 𝑚 , 𝑖 ′ ∈ {1, . . . , card(Δ)}.
First, the rules from (3) and (9) are the only applicable rules; however,
application of a rule from (9) would block the derivation, so we do not consider
it. While rewriting 𝑋, the leftmost ⌉ is rewritten. Unless the leftmost ⌈ is chosen,
it becomes unpaired and, thus, cannot be erased. It is symmetric with 𝑌 . After the
application of rules from (3), rules from (4) become applicable. The positions
of the symbols $ must be preserved for future use of rule (7). Then, the only way
of continuing a successful derivation is
′
⌉ 𝑋$⌈11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1⌉$𝑌 ⌈ 2⇒
′
⌋ 𝑋$⌋11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1⌉$𝑌 ⌈ 2⇒
′
⌋ 𝑋$⌋11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1⌊$𝑌 ⌊ 2⇒
′
⌋ 𝑋$⌋11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10 1⌊$𝑌 ⌊ 2⇒
𝑖
′
⌋ 𝑋$⌋11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1⌊$𝑌 ⌊
′
𝑤 ′ = 𝑋$11 || 11⌉ | ⌈10𝑖 1$𝑌
of ⌉,⌈, but there is only one remaining. Therefore, there are 𝑖 ′ symbols 0,
which cannot be erased, and no terminal string can be generated.
′
𝑋$11 || 11⌉ | ⌈𝑢⌉ | ⌈10𝑖 1$𝑌
Rule (8) is the only one applicable. It rewrites 𝑋 to 𝑋, 𝑌 to 𝑌 and puts them
potentially anywhere into the current sentential form. However, the rules
from (3), which are the only rules containing 𝑋 and 𝑌 on the left-hand side,
require 𝑋 and 𝑌 to be situated between ⌉ and ⌈.
′ ′
𝑋$11 || 11⌉ | ⌈𝑢⌉ | ⌈10𝑖 1$𝑌 2⇒ $11 || 11⌉ 𝑋 ⌈𝑢⌉𝑌 ⌈0𝑖 $
′ ′
⌉ 𝑋$⌈10𝑖 1⌉ | ⌈𝑢⌉ | ⌈10𝑖 1⌉$𝑌 ⌈ 2⇒ ⌋ 𝑋$⌋10𝑖 1⌉ | ⌈𝑢⌉ | ⌈10𝑖 1⌉$𝑌 ⌈ 2⇒
′ ′
⌋ 𝑋$⌋10𝑖 1⌉ | ⌈𝑢⌉ | ⌈10𝑖 1⌊$𝑌 ⌊ 2⇒ ⌋ 𝑋$⌋10𝑖 1⌉ | ⌈𝑢⌉ | ⌈10𝑖 1⌊$𝑌 ⌊ 2⇒
′ ′
⌋ 𝑋$⌋10 1⌉ | ⌈𝑢⌉ | ⌈10 1⌊$𝑌 ⌊ 2⇒ 𝑋$10 1⌉ | ⌈𝑢⌉ | ⌈10 1$𝑌
𝑖 𝑖 𝑖 𝑖
Next, rule (8) is the only applicable rule, which erases four symbols 1, two |,
rewrites 𝑋 to 𝑋 and 𝑌 to 𝑌 , and inserts them possibly anywhere into the current
sentential form. However, 𝑋 must be inserted between ⌉ and ⌈; otherwise, no rule
from (3) is applicable, and 𝑋 remains permanently in the sentential form. Unless
the leftmost pair of ⌉ and ⌈ is chosen, there are skipped symbols 1 remaining to
the left of 𝑋. Rules (6) and (7) ensure the derivation is blocked, if 𝑋 is shifted
6.3 Results 167
to the right. Additionally, the only way to erase 1s is rule (8), but these 1s must
be to the right of 𝑋. Thus, the skipped symbols 1 cannot be erased. Therefore,
the pair of ⌉ and ⌈ is the leftmost or the derivation is blocked. Moreover, the two
erased 1s are also the leftmost or they cannot be erased in the future, and the
same holds for the left erased symbol |. A similar situation is regarding 𝑌 . Then,
′ ′
𝑋$10𝑖 1⌉ | ⌈𝑢⌉ | ⌈10𝑖 1$𝑌 2⇒ $0𝑖 ⌉ 𝑋 ⌈𝑢⌉𝑌 ⌈0𝑖 $
and by using the rules from(3) and repeatedly rules from (4) and (5) both
outermost sequences of 0s can be erased, if 𝑖 = 𝑖 ′ . Additionally, rules from (4)
ensure that 𝑋 and 𝑌 are never shifted. If there is any 0 skipped, it cannot be
erased and the derivation is blocked.
′ ′
$0𝑖 ⌉ 𝑋 ⌈𝑢⌉𝑌 ⌈0𝑖 $ 2⇒∗ $0𝑖 ⌋ 𝑋⌋𝑢⌊𝑌 ⌊0𝑖 $ 2⇒∗ $⌋ 𝑋⌋𝑢⌊𝑌 ⌊$
Finally, by rules (6) and (7) both terminal codings can be completely erased and
𝑋, 𝑌 , and two $ are the outermost symbols, if no symbol is skipped.
$⌋ 𝑋⌋𝑢⌊𝑌 ⌊$ 2⇒ ⌋ 𝑋$⌋𝑢⌊$𝑌 ⌊ 2⇒ 𝑋$𝑢$𝑌
Since 𝑤 1 ≠ 𝑤 2 , 𝑤 1 = 𝑣𝑎𝑢 and 𝑤 2 = 𝑢 ′ 𝑎 ′ 𝑣, where 𝑎 ≠ 𝑎 ′ are the outermost non-
identical terminal codings. Derivation can always erase 𝑣s, as it was described, or
be blocked before. Without any loss of generality, we have to consider two cases:
′
$0𝑖 ⌉ 𝑋 ⌈𝑢⌉𝑌 ⌈0𝑖 $
′
where 10𝑖 1 = 𝑎, 10𝑖 1 = 𝑎 ′ . Then, 𝑖 ≠ 𝑖 ′ and while simultaneously erasing
the sequences of 0s of both codings, one is erased before the second one.
Rule (5) becomes inapplicable, and there is no way not to skip the remaining
part of the second sequence of 0s. The derivation is blocked.
We covered all possibilities and showed that there is no way to generate terminal
string 𝑤 ′ ∉ 𝐿 (𝐺 ′ , 1⇒), and the claim holds. □
Since 𝑆 1⇒∗ 𝑤, 𝑤 ∈ Δ∗ if and only if 𝑆 2⇒∗ 𝑤, Claim C holds. □
We proved that 𝐿(𝐺 ′ , 2⇒) = 𝐿 (𝐺 ′ , 1⇒), 𝐿(𝐺 ′ , 1⇒) = 𝐿(𝐺, 1⇒), and 𝐿 (𝐺, 1⇒
) = 𝐿, then 𝐿 (𝐺 ′ , 2⇒) = 𝐿, so the proof of Theorem 6.2 is completed. □
168 6 Parallel Jumping Grammars
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 3⇒ 𝑣 0 𝑥1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛
where 𝑢 0 𝑢 1 . . . 𝑢 𝑛 = 𝑣 0 𝑣 1 . . . 𝑣 𝑛 , 𝑢 0 = 𝑣 0 𝑧 1 and 𝑢 𝑛 = 𝑧 2 𝑣 𝑛 , 𝑧1 , 𝑧2 ∈ Σ∗ .
Example 6.4 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, $, 𝑎, 𝑏}, Δ = {𝑎, 𝑏}, be an
SCG with 𝑃 containing the following rules:
Consider 𝐺 uses 3⇒. Notice that context-free rules are not influenced by 3⇒.
After applying starting rule (i), 𝐺 generates {𝑎} 𝑛 {𝑏} 𝑛 , where 𝑛 ≥ 0, by using
rule (ii) or finishes the derivation with rules (iv) and (v). However, at any time during
the derivation rule (iii) can be applied. It inserts or erases nothing, but it potentially
shifts 𝐴 to the left. Notice, the symbol $ is always the rightmost and, thus, cannot be
shifted. Then,
𝐿(𝐺, 3⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝜀 or 𝑥 = 𝑢𝑣𝑤𝑏 𝑛 , 𝑢𝑤 = 𝑎 𝑛 , 𝑛 ≥ 0,
Proof (Claim A) 𝐺 ′ is closely related to 𝐺, only rule (1) and the rules from (3) are
slightly modified. As a result the correspondence of the sentences generated by the
simulated 𝐺 1 , 𝐺 2 , respectively, is not checked in the direction from the outermost
to the central symbols but from the central to the outermost symbols. Again, if the
current two symbols do not match, these symbols cannot be erased and the derivation
is blocked. □
Proof (Claim B) Without any loss of generality, we can suppose rule (1) and rules
from (2) are used only before the first usage of a rule from (3). The context-free rules
work unchanged with 3⇒. Then, for every derivation
𝑆 1⇒∗ 𝑤 = 𝑤 1 11$$11𝑤 2
generated only by rule (1) and rules from (2), where symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅,
there is the identical derivation
𝑆 3⇒∗ 𝑤
and vice versa. Since
𝑤 1⇒∗ 𝑤 ′ , 𝑤 ′ ∈ Δ∗
if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), we can complete the proof of the previous claim
by the following one.
Claim C Let the sentential form 𝑤 be generated only by rule (1) and rules from (2).
Without any loss of generality, suppose symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅. Consider
𝑆 3⇒∗ 𝑤 = 𝑤 1 11$$11𝑤 2
For better readability, in the next proof we omit all symbols of 𝑤 1 from Δ—we
consider only nonterminal symbols, which are to be erased.
Basic idea. The rules from (3) are the only ones with 0s and 1s on their left-hand
sides. These symbols are simultaneously erasing to the left and to the right of $s
checking the equality. While proceeding from the center to the edges, when there is
any symbol skipped, which is remaining between $s, there is no way, how to erase
it, and no terminal string can be generated.
170 6 Parallel Jumping Grammars
Consider 3 ⇒. Even when the symbols are erasing one after another from the
center to the left and right, 3 ⇒ can potentially shift the left $ to the left and the
right $ to the right skipping some symbols. Also in this case the symbols between
$s cannot be erased anymore.
Proof (Claim C) If. Recall
Suppose the check works properly not skipping any symbol. Then,
𝑤 3⇒∗ 𝑤 ′ = $$
𝑤 1⇒∗ 𝑤 ′ = 𝑤 1′ 𝑥$$𝑥 ′ 𝑤 2′
and 𝑥, 𝑥 ′ ∈ {0, 1}, 𝑥 ≠ 𝑥 ′ . Continuing the check with application of the rules from
(3) will definitely skip 𝑥 or 𝑥 ′ . Consequently, no terminal string can be generated.
We showed that 𝐺 ′ can generate the terminal string from the sentential form 𝑤 if
and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), and the claim holds. □
Since 𝑆 1⇒∗ 𝑤, 𝑤 ∈ Δ∗ if and only if 𝑆 3⇒∗ 𝑤, Claim B holds. □
We proved that 𝐿(𝐺, 1 ⇒) = 𝐿, 𝐿(𝐺 ′ , 1 ⇒) = 𝐿(𝐺, 1 ⇒), 𝐿(𝐺 ′ , 3 ⇒) =
𝐿(𝐺 ′ , 1 ⇒); therefore, 𝐿 (𝐺 ′ , 3 ⇒) = 𝐿 holds. Thus, the proof of Theorem 6.3
is completed. □
Consider 𝐺 uses 4⇒. Then, every context-sensitive rule is applied in the following
way. First, all affected nonterminals are erased. Next, some position of the current
sentential form called center is nondeterministically chosen. Finaly, the correspond-
ing right-hand sides of the selected rule are inserted each at the original place of
the neighboring erased nonterminal closer to the center. The central right-hand-side
strings are randomly put closer to the chosen central position. In this example, we
show how to control the choice.
First, rule (i) rewrites 𝑆 to 𝐴𝐵$$𝐵𝐴. Then, 𝐺 uses rules (ii) and (iii) generating
a sentential form
𝑎 𝑛1 𝐴𝑏 𝑛1 𝑐 𝑛2 𝐵𝑑 𝑛2 $$𝑐 𝑛3 𝐵𝑑 𝑛3 𝑎 𝑛4 𝐴𝑏 𝑛4
where 𝑛𝑖 ≥ 0, for 𝑖 ∈ {1, 2, 3, 4}. If rule (vi) is used, derivation is blocked. Next, 𝐺
uses the context-sensitive rule (iv), which may act in several different ways. In any
case, it inserts two 𝐶s into the current sentential form and the only possibility to
erase them is rule (v). However, thereby we force rule (iv) to choose the center for
interchanging nonterminals between 𝐵s and moreover to insert 𝐶s between the two
symbols $. Finally, 𝐺 continues by using rule (ii) and eventually finishes twice rule
(vi). Consequently,
𝐿 (𝐺, 4⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑎 𝑛1 𝑏 𝑛1 𝑐 𝑛2 𝑎 𝑛3 𝑏 𝑛3 𝑑 𝑛2 𝑐 𝑛4 𝑎 𝑛5 𝑏 𝑛5 𝑑 𝑛4 𝑎 𝑛6 𝑏 𝑛6 ,
𝑛𝑖 ≥ 0, 𝑖 ∈ {1, 2, 3, 4, 5, 6}
Then, the string 𝑎𝑎𝑏𝑏𝑐𝑎𝑏𝑑𝑐𝑐𝑑𝑑𝑎𝑏 is generated by 𝐺 in the following way:
𝑆 4⇒ 𝐴𝐵$$𝐵𝐴 4⇒ 𝑎 𝐴𝑏𝐵$$𝐵𝐴 4⇒ 𝑎𝑎 𝐴𝑏𝑏𝐵$$𝐵𝐴 4⇒ 𝑎𝑎 𝐴𝑏𝑏𝑐𝐵𝑑$$𝐵𝐴
4⇒ 𝑎𝑎 𝐴𝑏𝑏𝑐𝐵𝑑$$𝑐𝐵𝑑𝐴 4⇒ 𝑎𝑎 𝐴𝑏𝑏𝑐𝐵𝑑$$𝑐𝑐𝐵𝑑𝑑𝐴 4⇒ 𝑎𝑎 𝐴𝑏𝑏𝑐𝐵𝑑$$𝑐𝑐𝐵𝑑𝑑𝑎 𝐴𝑏
4⇒ 𝑎𝑎𝑏𝑏𝑐 𝐴𝑑$𝐶𝐶$𝑐𝑐 𝐴𝑑𝑑𝑎𝑏 4⇒ 𝑎𝑎𝑏𝑏𝑐 𝐴𝑑𝑐𝑐 𝐴𝑑𝑑𝑎𝑏 4⇒ 𝑎𝑎𝑏𝑏𝑐𝑎 𝐴𝑏𝑑𝑐𝑐 𝐴𝑑𝑑𝑎𝑏
4⇒ 𝑎𝑎𝑏𝑏𝑐𝑎𝑏𝑑𝑐𝑐 𝐴𝑑𝑑𝑎𝑏 4⇒ 𝑎𝑎𝑏𝑏𝑐𝑎𝑏𝑑𝑐𝑐𝑑𝑑𝑎𝑏
Proof (Claim A) The behavior of context-free rules remains unchanged under 4⇒.
Since the rules of 𝐺 ′ simulating the derivations of 𝐺 1 and 𝐺 2 are identical to the
ones of 𝐺 simulating both grammars, for every derivation of 𝐺
𝑆 1⇒∗ $𝑤 1 1111𝑤 2 $ = 𝑤
where 𝑤 is generated only by using rule (1) and rules from (2) constructed in 𝐺 and
symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅, there is
in 𝐺 ′ , generated by the corresponding rule (1) and rules from (2) produced in 𝐺 ′ ,
and vice versa. Without any loss of generality, we can consider such a sentential
form in every successful derivation. Additionally, in 𝐺
𝑤 1⇒∗ 𝑣, 𝑣 ∈ Δ∗
𝑤 ′ 4⇒∗ 𝑣 ′ , 𝑣 ′ ∈ Δ∗
Claim B In 𝐺 ′ , for
where 𝑤 is generated only by using the rule (1) and rules from (2),
𝑤 4⇒∗ 𝑤 ′
The new rule (3) potentially arbitrarily multiplies the number of 𝐹s to the left
and right. Then, 𝐹s from both sequences are simultaneously erasing by using rule
(5). Thus, without any loss of generality, suppose 𝑖 1 = 𝑖 2 equal the number of future
usages of rule (5).
6.3 Results 173
For the sake of readability, in the next proof, in 𝑤 1 , we omit all symbols from
Δ—we consider only nonterminal symbols, which are to be erased.
Proof (Claim B) If. Suppose 𝑤 1 = reversal(𝑤 2 ), then 𝑤 4⇒∗ 𝜀. We prove this by
the induction on the length of 𝑤 1 ,𝑤 2 , where |𝑤 1 | = |𝑤 2 | = 𝑘.
Basis. Let 𝑘 = 0. Then, 𝑤 = 𝐹𝐹$11|𝐸 |11$𝐹𝐹. Except for the rules from (7), a
rule from (4) is the only applicable. The center for interchanging the right-hand-side
strings must be chosen between the two rewritten 1s and additionally inserted 𝐷s
must remain on the different sides of the central string |𝐸 |. Moreover, if any 1 stays
outside the two 𝐷s, it cannot be erased, so
Next, rule (5) rewrites 𝐷s back to $s, erases 𝐹s, and changes |s to ⊤s. The center
must be chosen between the two |s and inserted ⊤s may not be shifted; otherwise,
they appear on the same side of 𝐸 and rule (6) is inapplicable. It secures the former
usage of rules from (4) was as expected, so
By rule (6) the symbols ⊤ may be rewritten back to |s. No left-hand-side string may
be shifted during the application of the rule and the choice of the central position has
no influence, because the neighboring symbols are rewritten. It secures the former
usage of rule (5) was as expected; therefore,
Then, the same sequence of rules with the same restrictions can be used again to
erase remaining 1s and the check is finished by rules from (7) as
𝑤 = 𝐹 𝑖1 $𝑤 1 11|𝐸 |11𝑤 2 $𝐹 𝑖2 , |𝑤 1 | = |𝑤 2 | = 𝑚
Next, rule (5) rewrites 𝐷s back to $s, erases 𝐹s, and changes |s to ⊤s. The center
must be chosen between the two |s and inserted ⊤s may not be shifted; otherwise,
they appear on the same side of 𝐸 and rule (6) is inapplicable. It secures the former
usage of a rule from (4) was as expected.
′ ′
𝐹 𝑖1 𝐷𝑤 1′ 11|𝐸 |11𝑤 2′ 𝐷𝐹 𝑖2 4⇒ 𝐹 𝑖1 $𝑤 1′ 11⊤𝐸⊤11𝑤 2′ $𝐹 𝑖2
By rule (6) the symbols ⊤ may be rewritten back to |s. No left-hand-side string may
be shifted during the application of the rule, and the position of the chosen center has
no influence, because the neighboring symbols are rewritten. It secures the former
usage of rule (5) was as expected.
′ ′ ′ ′
𝐹 𝑖1 $𝑤 1′ 11⊤𝐸⊤11𝑤 2′ $𝐹 𝑖2 4⇒ 𝐹 𝑖1 $𝑤 1′ 11|𝐸 |11𝑤 2′ $𝐹 𝑖2 = 𝑤 ′
𝐹 𝑖1 $𝑎𝑢11|𝐸 |11𝑢 ′ 𝑎 ′ $𝐹 𝑖2
Next, rules from (4) can be applied to erase outermost 0s or 1s. However, then, there
is 0 or 1 outside inserted 𝐷s and, thus, unable to be erased, which completes the
proof.
We showed that 𝐺 ′ can generate the terminal string from the sentential form 𝑤 if
and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), and the claim holds. □
We proved that for some 𝑤 ∈ Δ∗ , 𝑆 1⇒∗ 𝑤 in 𝐺 if and only if 𝑆 4⇒∗ 𝑤 in 𝐺 ′ , and
the claim holds. □
Since 𝐿(𝐺, 1⇒) = 𝐿 (𝐺 ′ , 4⇒) = 𝐿, the proof of Theorem 6.4 is completed. □
where 𝑢 0 = 𝑢 01 𝑢 02 , 𝑢 𝑛 = 𝑢 𝑛1 𝑢 𝑛2 .
Example 6.6 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, 𝐵, $, 𝑎, 𝑏}, Δ = {𝑎, 𝑏}, be an
SCG with 𝑃 containing the following rules:
$𝑎 𝑚 𝐴𝑏 𝑚 𝑎 𝑛 𝐴𝑏 𝑛 $
Proof (Claim A) Context-free rules are not influenced by 5⇒. Rule (3) must generate
precisely as many 𝐹s as the number of applications of rules from (4). Context-
sensitive rules of 𝐺 ′ correspond to context-sensitive rules of 𝐺, except for the
special rule (5). We show that the construction of 𝐺 ′ forces context-sensitive rules
to work exactly in the same way as the rules of 𝐺 do.
Every application of a rule from (4) must be followed by the application of
rule (5) to rewrite 𝐷 back to 𝐸, which requires the symbol 𝐷 between two ◦s. It
ensures the previous usage of context-sensitive rule selected the center to the right
of the rightmost affected nonterminal, and all right-hand-side strings changed their
positions with the more left ones. The leftmost right-hand-side string is then shifted
randomly to the left, but it is always 𝜀. 5⇒ has no influence on rule (5).
From the construction of 𝐺 ′ , it works exactly in the same way as 𝐺 does. □
𝐿 (𝐺, 1⇒) = 𝐿(𝐺 ′ , 5⇒) and 𝐿(𝐺, 1⇒) = 𝐿; therefore, 𝐿 (𝐺 ′ , 5⇒) = 𝐿. Thus,
the proof of Theorem 6.5 is completed. □
Example 6.7 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, 𝐵, 𝑎, 𝑏}, Δ = {𝑎, 𝑏}, be an
SCG with 𝑃 containing the following rules:
𝑎 𝑚 𝐴𝑏 𝑚 𝐵𝐵𝑎 𝑛 𝐴𝑏 𝑛
where 𝑚, 𝑛 ≥ 0. Next, 𝐺 uses the context-sensitive rule (iii) or (iv). Notice, there is
no rule erasing 𝐵s; thus, in both cases the center of interchanging of nonterminals
must be chosen between the two 𝐵s. Otherwise, in both cases there is exactly one
𝐴 remaining, thus the only applicable rule is rule (ii), which is context-free and not
erasing. Therefore, 𝐺 uses rule (iii) generating the sentential form
𝑎 𝑚 𝑏 𝑚 𝐴𝐵𝐵𝐴𝑎 𝑛 𝑏 𝑛
and continues by using rule (ii) or it uses rule (iv) and finishes the derivation.
Subsequently, the language 𝐺 generates is
𝐿 (𝐺, 6⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑎 𝑛1 𝑏 𝑛1 𝑎 𝑛2 𝑏 𝑛2 . . . 𝑎 𝑛2𝑘 𝑏 𝑛2𝑘 , 𝑘, 𝑛𝑖 ≥ 0, 1 ≤ 𝑖 ≤ 2𝑘
𝑎 𝑚 𝐴𝑎 𝑚 𝑏 𝑛 𝐵𝑏 𝑛 𝑐𝑙 𝐶𝑐𝑙 $
where 𝑚, 𝑛, 𝑙 ≥ 0. Next, 𝐺 uses the context-sensitive rule (v) choosing the center
to the left of 𝐴 erasing 𝐶. If a different central position is chosen, the symbol 𝐴 is
erased, while 𝐵 or 𝐶 cannot be erased in the future and the derivation is blocked.
There is the same situation, if one of rules (vi) or (vii) is used instead. Notice, no
rule erases 𝐵 or 𝐶. Then, the derivation continues by using rules (ii) and (iii) and
eventually rule (vi) rewriting 𝐵 to 𝐴 and erasing 𝐵. Otherwise, 𝐴 is erased and
the symbol $ cannot be erased any more. 𝐺 continues by using rule (ii) and finally
finishes the derivation with rule (vii). Subsequently,
𝐿 (𝐺, 7⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑎 2𝑚1 𝑏 𝑛1 𝑎 2𝑚2 𝑏 𝑛1 𝑐𝑙 𝑏 𝑛2 𝑎 2𝑚3 𝑏 𝑛2 𝑐𝑙 ,
𝑚 1 , 𝑚 2 , 𝑚 3 , 𝑛1 , 𝑛2 , 𝑙 ≥ 0
Then, the string 𝑎𝑎𝑏𝑎𝑎𝑏𝑐𝑐𝑏𝑎𝑎𝑏𝑐𝑐 is generated by 𝐺 in the following way:
𝑆 7⇒ 𝐴𝐵𝐶$ 7⇒ 𝑎 𝐴𝑎𝐵𝐶$ 7⇒ 𝑎 𝐴𝑎𝑏𝐵𝑏𝐶$ 7⇒ 𝑎 𝐴𝑎𝑏𝐵𝑏𝑐𝐶𝑐$
7⇒ 𝑎 𝐴𝑎𝑏𝐵𝑏𝑐𝑐𝐶𝑐𝑐$ 7⇒ 𝑎𝑎𝑏 𝐴𝑏𝑐𝑐𝐵𝑐𝑐$ 7⇒ 𝑎𝑎𝑏𝑎 𝐴𝑎𝑏𝑐𝑐𝐵𝑐𝑐$ 7⇒
𝑎𝑎𝑏𝑎 𝐴𝑎𝑏𝑐𝑐𝑏𝐵𝑏𝑐𝑐$
7⇒ 𝑎𝑎𝑏𝑎𝑎𝑏𝑐𝑐𝑏 𝐴𝑏𝑐𝑐$ 7⇒ 𝑎𝑎𝑏𝑎𝑎𝑏𝑐𝑐𝑏𝑎 𝐴𝑎𝑏𝑐𝑐$ 7⇒ 𝑎𝑎𝑏𝑎𝑎𝑏𝑐𝑐𝑏𝑎𝑎𝑏𝑐𝑐
Theorem 6.7 JSC7 ⇒ = RE.
Proof Clearly, JSC7 ⇒ ⊆ RE. We prove RE ⊆ JSC7 ⇒ .
Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be the SCG constructed in the proof of Theorem 6.1. Next,
we modify 𝐺 to a new SCG 𝐺 ′ so 𝐿(𝐺, 1⇒) = 𝐿(𝐺 ′ , 7⇒).
𝑆 1⇒∗ $𝑤 1 1111𝑤 2 $ = 𝑤
where 𝑤 is generated only by using rule (1) and rules from (2) constructed in 𝐺 and
symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅, there is
in 𝐺 ′ , generated by the corresponding rule (1) and rules from (2) produced in 𝐺 ′ ,
and vice versa. Without any loss of generality, we can consider such a sentential
form in every successful derivation. Additionally, in 𝐺
𝑤 1⇒∗ 𝑣, 𝑣 ∈ Δ∗
𝑤 ′ 4⇒∗ 𝑣 ′ , 𝑣 ′ ∈ Δ∗
𝑆 7⇒∗ 𝑤 = 𝐹 𝑖 𝐻𝑤 1 $|$𝑤 2 𝐸
where 𝑤 is generated only by using rules from (1) through (3) and symbols(𝑤) ∩
(𝑁1 ∪ 𝑁2 ) = ∅. Then,
𝑤 7⇒∗ 𝑤 ′
where 𝑤 ′ ∈ Δ∗ if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ). □
The new rule (3) may potentially arbitrarily multiply the number of 𝐹s to the left.
Then, 𝐹s are erasing by using rule (5). Thus, without any loss of generality, suppose
𝑖 equals the number of the future usages of rule (5).
For the sake of readability, in the next proof we omit all symbols in 𝑤 1 from
Δ—we consider only nonterminal symbols, which are to be erased.
Proof (Claim B) If. Suppose 𝑤 1 = reversal(𝑤 2 ), then 𝑤 7⇒∗ 𝜀. We prove this by
the induction on the length of 𝑤 1 , 𝑤 2 , where |𝑤 1 | = |𝑤 2 | = 𝑘. Then, obviously 𝑖 = 𝑘.
By the construction of 𝐺 ′ , the least 𝑘 equals 2, but we prove the claim for all 𝑘 ≥ 0.
Basis. Let 𝑘 = 0. Then,
𝑤 = 𝐻$|$
By the rules from (6)
𝐻$|$ 7⇒∗ 𝜀
and the basis holds.
Induction Hypothesis. Suppose there exists 𝑘 ≥ 0 such that the claim holds for all
𝑚, where
6.3 Results 181
𝑤 = 𝐹 𝑚 𝐻𝑤 1 $|$𝑤 2 , |𝑤 1 | = |𝑤 2 | = 𝑚, 0 ≤ 𝑚 ≤ 𝑘
𝑤 = 𝐹 𝑘+1 𝐻𝑤 1 $|$𝑤 2 , |𝑤 1 | = |𝑤 2 | = 𝑘 + 1
𝐹 𝑖 𝐻𝑢𝑎$|$𝑎 ′ 𝑢 ′
Next, the rules from (4) can be applied to erase innermost 0s or 1s. However, since
𝑎 ≠ 𝑎 ′ , even if the center is chosen properly between the two $s, there is 0 or 1
between inserted 𝐸s and, thus, unable to be erased, which completes the proof.
We showed that 𝐺 ′ can generate the terminal string from the sentential form 𝑤 if
and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), and the claim holds. □
We proved 𝑆 1 ⇒∗ 𝑤, 𝑤 ∈ Δ∗ , in 𝐺 if and only if 𝑆 7 ⇒∗ 𝑤 in 𝐺 ′ , hence
𝐿 (𝐺, 1⇒) = 𝐿(𝐺 ′ , 7⇒) and the claim holds. □
Since 𝐿(𝐺, 1⇒) = 𝐿 (𝐺 ′ , 7⇒) and 𝐿 (𝐺, 1⇒) = 𝐿, the proof of Theorem 6.7 is
completed. □
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 8⇒ 𝑣 0 𝑥 1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛
182 6 Parallel Jumping Grammars
where 𝑢 0 𝑧1 = 𝑣 0 , 𝑧2 𝑢 𝑛 = 𝑣 𝑛 , |𝑢 0 𝑢 1 . . . 𝑢 𝑗 −1 | ≤ |𝑣 0 𝑣 1 . . . 𝑣 𝑗 |, |𝑢 𝑗+1 . . . 𝑢 𝑛 | ≤
|𝑣 𝑗 𝑣 𝑗+1 . . . 𝑣 𝑛 |, 0 < 𝑗 < 𝑛, and 𝑧1 , 𝑧2 ∈ Σ∗ .
𝐴𝑚 𝑏 𝑛 𝐵𝑙 (𝑐𝐶) 𝑛
The derivation finishes with the sequence of applications of rule (vi). For 𝐴s, 𝐵s, and
𝐶s are being rewritten together, 𝑚 = 𝑛 = 𝑙. Moreover, inserted 𝑎 is always between
the rewritten 𝐴 and 𝐵. Subsequently,
𝐿(𝐺, 8⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑤𝑐 𝑛 , 𝑤 ∈ {𝑎, 𝑏}∗ ,
occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = 𝑛, 𝑛 ≥ 1
For example, the string 𝑏𝑎𝑎𝑏𝑏𝑎𝑐𝑐𝑐 is generated by 𝐺 in the following way:
𝑆 8⇒ 𝐴𝑆 8⇒ 𝐴𝐴𝑆 8⇒ 𝐴𝐴𝐴𝑆 8⇒ 𝐴𝐴𝐴𝑆 8⇒ 𝐴𝐴𝐴𝑏𝑆𝑐𝐶 8⇒ 𝐴𝐴𝐴𝑏𝑏𝑆𝑐𝐶𝑐𝐶
8⇒ 𝐴𝐴𝐴𝑏𝑏𝑏𝑆𝑐𝐶𝑐𝐶𝑐𝐶 8⇒ 𝐴𝐴𝐴𝑏𝑏𝑏𝐵𝑐𝐶𝑐𝐶𝑐𝐶 8⇒ 𝐴𝐴𝐴𝑏𝑏𝑏𝐵𝐵𝑐𝐶𝑐𝐶𝑐𝐶
8⇒ 𝐴𝐴𝐴𝑏𝑏𝑏𝐵𝐵𝐵𝑐𝐶𝑐𝐶𝑐𝐶 8⇒ 𝐴𝐴𝑏𝑏𝑏𝑎𝐵𝐵𝑐𝑐𝐶𝑐𝐶 8⇒ 𝐴𝑏𝑎𝑏𝑏𝑎𝐵𝑐𝑐𝑐𝐶 8⇒
𝑏𝑎𝑎𝑏𝑏𝑎𝑐𝑐𝑐
Proof Prove this theorem by analogy with the proof of Theorem 6.2. □
6.3 Results 183
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 9⇒ 𝑣 0 𝑥1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛
where 𝑢 0 = 𝑣 0 𝑧 1 , 𝑢 𝑛 = 𝑧 2 𝑣 𝑛 , |𝑢 0 𝑢 1 . . . 𝑢 𝑗 −1 | ≤ |𝑣 0 𝑣 1 . . . 𝑣 𝑗 |, |𝑢 𝑗+1 . . . 𝑢 𝑛 | ≤
|𝑣 𝑗 𝑣 𝑗+1 . . . 𝑣 𝑛 |, 0 < 𝑗 < 𝑛, and 𝑧1 , 𝑧2 ∈ Σ∗ .
Informally, 𝐺 obtains 𝑣 0 𝑥1 𝑣 1 𝑥 2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 from 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 by using
( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃 in 9⇒ as follows:
(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(2) 𝑥 1 and 𝑥 𝑛 are inserted into 𝑢 0 and 𝑢 𝑛 , respectively;
(3) 𝑥𝑖 is inserted into 𝑢 𝑖−1 𝑢 𝑖 , for all 1 < 𝑖 < 𝑛, to the right of 𝑥 𝑖−1 and to the left of
𝑥𝑖+1 .
Example 6.10 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝑆, 𝐴, 𝐵, 𝐶, $, 𝑎, 𝑏, 𝑐}, Δ = {𝑎,
𝑏, 𝑐}, be an SCG with 𝑃 containing the following rules:
Consider 𝐺 uses 9⇒. 9⇒ acts similarly to 3⇒ with respect to the direction of shift
of the rule right-hand sides, but with limitation as in 8⇒. When a rule is to be applied,
there is a nondeterministically chosen center between the affected nonterminals and
rule right-hand-side strings can be shifted in the direction from this center, but not
farther than the neighboring affected nonterminal was.
Rules (i) through (vi) are context-free. Without any loss of generality, we can
suppose these rules are used only before the first application of rule (vii), which
produce the sentential form
𝑎 𝑚 $𝑛 (𝑐𝐵) 𝑙 $𝑙 𝑎 𝑚
The derivation finishes with the sequence of applications of rule (vii). The symbols $
and 𝐵s are being rewritten together, thus 𝑛 = 𝑙 must hold. Additionally, 9⇒ ensures,
𝑏 is always inserted between the rewritten $s. Subsequently,
𝐿 (𝐺, 9⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑎 𝑚 𝑤𝑎 𝑚 , 𝑤 ∈ {𝑏, 𝑐}∗ , occur(𝑤, 𝑏) = occur(𝑤, 𝑐),
𝑚≥0
For example, the string 𝑎𝑎𝑏𝑐𝑏𝑐𝑎𝑎 is generated by 𝐺 in the following way:
𝑆 9⇒ 𝑎𝑆𝑎 9⇒ 𝑎𝑎𝑆𝑎𝑎 9⇒ 𝑎𝑎 𝐴𝑎𝑎 9⇒ 𝑎𝑎$𝐴𝑎𝑎 9⇒ 𝑎𝑎$$𝐴𝑎𝑎
9⇒ 𝑎𝑎$$𝐶𝑎𝑎 9⇒ 𝑎𝑎$$𝑐𝐵𝐶$𝑎𝑎 9⇒ 𝑎𝑎$$𝑐𝐵𝑐𝐵𝐶$$𝑎𝑎
9⇒ 𝑎𝑎$$𝑐𝐵𝑐𝐵$$𝑎𝑎 9⇒ 𝑎𝑎$𝑏𝑐𝑐𝐵$𝑎𝑎 9⇒ 𝑎𝑎𝑏𝑐𝑏𝑐𝑎𝑎
184 6 Parallel Jumping Grammars
Proof Prove this theorem by analogy with the proof of Theorem 6.3. □
Finally, let us suggest some open problem areas concerning the subject of this section.
Open Problem Return to derivation modes (1) through (9) in Section 6.3. Introduce
and study further modes. For instance, in a more general way, discuss a jumping
derivation mode, in which the only restriction is to preserve a mutual order of the
inserted right-hand-side strings, which can be nondeterministicaly spread across the
whole sentential form regardless of the positions of the rewritten nonterminals. In a
more restrictive way, study a jumping derivation mode over strings satisfying some
prescribed requirements, such as a membership in a regular language. □
Open Problem Consider propagating versions of jumping scattered context gram-
mars. In other words, rule out erasing rules in them. Reconsider the investigation of
the present section in its terms. □
Open Problem The present section has often demonstrated that some jumping
derivation modes work just like ordinary derivation modes in scattered context
grammars. State general combinatorial properties that guarantee this behavior. □
Open Problem Establish normal forms of scattered context grammars working in
jumping ways. □
Admittedly, apart from scattered context grammars, the language theory is lit-
erally overflown with a broad variety of parallel grammars, many of which are
underlain by context-free grammars, such as E0L systems (see Rozenberg and Sa-
lomaa [1980, 1986]), Indian grammars (see Siromoney and Krithivasan [1974]),
𝑘-parallel context-free grammars (see Skyum [1974]), Russian grammars (see Lev-
itina [1972]), and parallel versions of selective substitution grammars (see Kleijn
[1987]). To a large extent, an exploration of their jumping versions remains an open
investigation area of the language theory in the future. Nevertheless, later on, this
book discusses some more jumping versions of parallel grammars, including pure
grammars working under jumping parallel mode covered in the next chapter.
Chapter 7
Pure Jumping Grammars
This chapter studies jumping computation based upon the notion of a pure gram-
mar 𝐺. Section 7.1 gives an introduction into its subject. Section 7.2 recalls all the
terminology needed in this chapter and introduces a variety of jumping pure gram-
mars, illustrated by an example. Finally, Section 7.3 presents fundamental results
and concludes by summing up ten open problems.
7.1 Introduction
185
186 7 Pure Jumping Grammars
7.2 Definitions
Let 𝐼 ⊂ 0 N be a finite nonempty set. Then, max 𝐼 denotes the maximum of 𝐼. Now,
we recall the most important notions for this chapter. For a (binary) relation 𝜚 over
𝑋, 𝜚𝑖 , 𝜚+ , and 𝜚∗ denote the 𝑖th power of 𝜚, for all 𝑖 ≥ 0, the transitive closure of
𝜚, and the reflexive and transitive closure of 𝜚, respectively. For 𝑥, 𝑦 ∈ 𝑋, instead of
(𝑥, 𝑦) ∈ 𝜚, we write 𝑥 𝜚𝑦 throughout. Set domain( 𝜚) = {𝑥 | 𝑥 𝜚𝑦}.
Let 𝑛 ≥ 0. A set 𝐽 ⊆ 0 N𝑛 is said to be linear if there exist 𝛼, 𝛽1 , 𝛽2 , . . . , 𝛽𝑚 ∈
0 N , 𝑚 ≥ 0 such that
𝑛
𝐽 = {𝑥 | 𝑥 = 𝛼 + 𝑘 1 𝛽1 + 𝑘 2 𝛽2 + · · · + 𝑘 𝑚 𝛽𝑚 ,
𝑘 𝑖 ∈ 0 N, 1 ≤ 𝑖 ≤ 𝑚}.
7.2 Definitions 187
Let ℎ ⇒ be one of the six derivation relations (i) through (vi) over Σ∗ . To express
that 𝐺 applies production rule 𝑟 during 𝑢 ℎ ⇒ 𝑣, we write 𝑢 ℎ ⇒ 𝑣 [𝑟], where 𝑟 ∈ 𝑃.
By 𝑢 ℎ ⇒∗ 𝑣 [𝜋], where 𝜋 is a sequence of rules from 𝑃, we express that 𝐺 makes
𝑢 ℎ ⇒∗ 𝑣 by using 𝜋.
The language that 𝐺 generates by using ℎ ⇒, 𝐿 (𝐺, ℎ ⇒), is defined as
𝐿 (𝐺, ℎ ⇒) = {𝑥 | 𝜎 ℎ ⇒∗ 𝑥, 𝑥 ∈ Σ∗ }.
The set of all PGs and the set of all PGs without erasing rules are denoted ΓPG
and ΓPG− 𝜀 , respectively.
Remark 7.1 The inclusions ΓPCFG ⊆ ΓPG , ΓPCFG− 𝜀 ⊆ ΓPCFG , and ΓPG− 𝜀 ⊆ ΓPG are
obvious.
𝐺 = (Σ = {𝑎, 𝑏, 𝑐, 𝑑}, 𝑃, 𝑎)
7.3 Results
A
SPCF = ⊃ ∥ ∥ ⊂ ∥ ∥ ∥ ⊂ ∥
SPCF− 𝜀 ⊂ = ∥ ∥ ⊂ ⊂ ∥ ∥ ⊂ ⊂
JSPCF ∥ ∥ = ⊃ ∥ ∥ ∥ ∥ ∥ ∥
JSPCF− 𝜀 ∥ ∥ ⊂ = ∥ ∥ ? ? ∥ ∥
PPCF ⊃ ⊃ ∥ ∥ = ⊃ ∥ ∥ ⊃ ⊃
PPCF− 𝜀 ∥ ⊃ ∥ ∥ ⊂ = ∥ ∥ ∥ ⊃
JPPCF ∥ ∥ ∥ ? ∥ ∥ = ⊃ ∥ ∥
JPPCF− 𝜀 ∥ ∥ ∥ ? ∥ ∥ ⊂ = ∥ ∥
0L ⊃ ⊃ ∥ ∥ ⊂ ∥ ∥ ∥ = ⊃
0L− 𝜀 ∥ ⊃ ∥ ∥ ⊂ ⊂ ∥ ∥ ⊂ =
Table 7.1 Mutual relationships between investigated language families. 𝐴 denotes the language
family from the first column, 𝐵 the language family from the table header. If the relation in the cell
given by 𝐴 and 𝐵 is ★, then 𝐴 ★ 𝐵. 𝐴∥ 𝐵 means that 𝐴 and 𝐵 are incomparable, ? stands for an
open problem, and the meaning of ⊂, =, and ⊃ is as usual.
190 7 Pure Jumping Grammars
PPCF
CF
A
SPCF
I M
E JSPCF
B F J N Q
? ? ? ?
JPPCF
C G K O R
? ?
T
D H L P S
?
CS
𝑛 𝑛
{𝑎2 𝑏2 | 𝑛 ≥ 0} ∈ A {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 1} ∈ M
{𝑎 2𝑛 | 𝑛 ≥ 0} ∈ D {𝑎𝑎𝑏𝑏, 𝑎𝑏𝑎𝑏, 𝑎𝑏𝑏𝑎, 𝑏𝑎𝑎𝑏, 𝑏𝑎𝑏𝑎, 𝑏𝑏𝑎𝑎} ∈ O
{𝑎 𝑛 𝑐𝑏 𝑛 | 𝑛 ≥ 0} ∈ E {𝑎𝑎𝑏𝑏, 𝑐𝑐𝑑𝑑, 𝑐𝑑𝑐𝑑, 𝑐𝑑𝑑𝑐, 𝑑𝑐𝑐𝑑, 𝑑𝑐𝑑𝑐, 𝑑𝑑𝑐𝑐} ∈ P
occur(𝑤, 𝑎) − 1 = occur(𝑤, 𝑏) = occur(𝑤, 𝑐),
{𝑎𝑎, 𝑎𝑎𝑏, 𝑎𝑎𝑐, 𝑎𝑎𝑏𝑐} ∈ F 𝑤 + ∈R
𝑤 ∈ {𝑎, 𝑏, 𝑐}
occur(𝑤, 𝑎) − 1 = occur(𝑤, 𝑏) = occur(𝑤, 𝑐) ,
{𝑎} + ∈ G { 𝑎ˆ 𝑏ˆ 𝑐}
ˆ ∪ 𝑤 ∈S
𝑤 ∈ {𝑎, 𝑏, 𝑐} +
{𝑎𝑎𝑏𝑏, 𝑐𝑐𝑑𝑑 } ∈ I {𝑎 𝑝 | 𝑝 is a prime} ∈ T
{𝑎𝑏, 𝑐𝑑, 𝑑𝑐} ∈ L The question whether B, C, H, J, K, N, or Q is empty remains open.
Fig. 7.1 Relationships between CF, CS, and language families defined by pure grammars.
Elementary Properties
Many properties about pure grammars can be found in Rozenberg and Salomaa
[1997a]; Maurer et al. [1980]. Recall that1 SPCF ⊂ CF (see Rozenberg and Salomaa
[1997a]; Maurer et al. [1980]). As follows from (13) and (15) in Definition 7.2,
0L ⊆ PPCF. Furthermore, there exist languages that can be generated by parallel
PCFG but cannot be generated by any 0L system (such a language is, for example,
{𝑎, 𝑎𝑎𝑏}). Thus, 0L ⊂ PPCF.
1 According to its definition, SPCF in this paper coincides with PCF in Maurer et al. [1980].
7.3 Results 191
Lemma 7.1 Let 𝑋 ∈ {SP, JSP, PP, JPP, SPCF, JSPCF, PPCF, JPPCF, 0L}.
Then, 𝑋 − 𝜀 ⊆ 𝑋.
Proof Obvious. □
Proof Since SPCF ⊂ CF and CF is semilinear (see Parikh [1966]), SPCF must be
also semilinear. Consider any PCFG 𝐺 = (Σ, 𝑃, 𝜎). From the definitions of 𝑠 ⇒ and
𝑗 ⇒ it follows that 𝜓 Σ (𝐿 (𝐺, 𝑠 ⇒)) = 𝜓 Σ (𝐿 (𝐺, 𝑗 ⇒)). Thus, JSPCF is semilinear as
well. □
Proof First, we prove the inclusion SPCF ⊆ PPCF. The proof is based on the proof
from [Rozenberg and Doucet, 1971, Theorem 4.2]. Let Σ be an alphabet. We claim
that for every PCFG 𝐺 = (Σ, 𝑃, 𝜎), there is a PCFG 𝐺 ′ = (Σ, 𝑃′ , 𝜎 ′ ) such that
𝐿(𝐺 ′ , 𝑝 ⇒) = 𝐿 (𝐺, 𝑠 ⇒). Set
𝑃′ = 𝑃 ∪ {𝑎 → 𝑎 | 𝑎 ∈ Σ} and 𝜎′ = 𝜎
Now, we prove the following two claims by induction on 𝑚 ≥ 0. Since both proofs
are straightforward, we show only their induction steps. As the common hypothesis,
assume that the claims hold for all 0 ≤ 𝑚 ≤ 𝑘, where 𝑘 ≥ 0.
Claim A Let 𝜎 𝑠 ⇒𝑚 𝑤 in 𝐺, where 𝑤 ∈ Σ∗ . Then 𝜎 ′ 𝑝 ⇒∗ 𝑤 in 𝐺 ′ . □
Proof Observe that 𝐺 ′ from the proof of Theorem 7.2 is a correctly defined 0L
system according to page 304 in Rozenberg and Doucet [1971]. □
Theorem 7.3 SPCF ⊂ CF ∩ PPCF.
Proof SPCF ⊆ CF ∩ PPCF is a consequence of recalled inclusion SPCF ⊂ CF and
Theorem 7.2. Let Σ = {𝑎, 𝑏, 𝑐, 𝑑} be an alphabet and 𝐿 = {𝑎𝑏, 𝑐𝑐𝑑𝑑} be a language
over Σ. Clearly, 𝐿 ∈ CF and also 𝐿 ∈ PPCF since there is a PCFG
Now, we investigate all the mutual relationships between SPCF, JSPCF, PPCF,
JPPCF, CF, and CS. We refer to them as language subfamilies A through T in
Figure 7.1, which presents them by using an Euler diagram. More precisely, in
this diagram, JSPCF, PPCF, JPPCF, CF form Venn diagram with 16 subfamilies
contained in CS; in addition, four more subfamilies are pictured by placing SPCF
as a subset of CF ∩ PPCF (see Theorem 7.3). Hereafter, we study 20 subfamilies in
the following 13 theorems and seven open problems (Theorems and Open Problems
7.8 through 7.20).
Proof For unary alphabet, 0L = PPCF = JPPCF (Theorem 7.4). Since CF and
JSPCF are both semilinear, it is sufficient to find any non-semilinear language over
unary alphabet which is also contained in PPCF. Such a language is indisputably
𝑛
{𝑎 2 | 𝑛 ≥ 0}. □
𝐿(𝐺 ′ , 𝑗 ⇒) = 𝑋.
Proof Let Σ = {𝑎, 𝑏, 𝑐} be an alphabet and let 𝑋 = {𝑎𝑎, 𝑎𝑎𝑏, 𝑎𝑎𝑐, 𝑎𝑎𝑏𝑐} be a
language over Σ. Consider a PCFG
Proof Consider a language 𝑋 = {𝑎𝑏, 𝑐𝑑, 𝑑𝑐} over an alphabet Σ = {𝑎, 𝑏, 𝑐, 𝑑}.
Clearly, 𝑋 is neither classical sequential pure context-free nor jumping sequential
pure context-free language, since at some point during a derivation, we must rewrite
two symbols simultaneously.
As 𝑋 is a finite language, 𝑋 ∈ CF. As there exists a PCFG
Proof Consider a language 𝑌 = {𝑎𝑎𝑏𝑏, 𝑐𝑐𝑑𝑑, 𝑐𝑑𝑐𝑑, 𝑐𝑑𝑑𝑐, 𝑑𝑐𝑐𝑑, 𝑑𝑐𝑑𝑐, 𝑑𝑑𝑐𝑐} over
an alphabet Σ = {𝑎, 𝑏, 𝑐, 𝑑}. Clearly, 𝑌 ∈ CF and also 𝑌 ∈ JPPCF because there is
a PCFG
𝐺 = (Σ, {𝑎 → 𝑐, 𝑏 → 𝑑, 𝑐 → 𝑐, 𝑑 → 𝑑}, 𝑎𝑎𝑏𝑏)
such that 𝐿(𝐺, 𝑗 𝑝 ⇒) = 𝑌 . The proof that 𝑌 ∉ PPCF is almost identical to the proof
that 𝑋 ∉ PPCF from Theorem 7.16, so it is omitted. Because it is not possible to
rewrite two or more symbols simultaneously during the direct derivation step by
using 𝑗 ⇒, we have 𝑌 ∉ JSPCF. □
Open Problem (Subfamily Q) Is it true that
𝑋 = { 𝑎ˆ 𝑏ˆ 𝑐}
ˆ ∪ {𝑥 | occur(𝑥, 𝑎) − 1 = occur(𝑥, 𝑏) = occur(𝑥, 𝑐),
𝑥 ∈ {𝑎, 𝑏, 𝑐}+ }
𝛽 ∈ {𝑎, 𝑏, 𝑐}∗ (this can be assumed since 𝑎ˆ 𝑏ˆ 𝑐ˆ is the only string over { 𝑎,ˆ 𝑏,ˆ 𝑐} ˆ in 𝑋).
′
As 𝑎 ∈ 𝑋, 𝑎 → 𝜀, 𝑎 → 𝑏, and 𝑎 → 𝑐 are not contained in 𝑃 . The observations
(1) to (3) from the proof of Theorem 7.18 hold also for 𝐻 ′ . The rest of the proof is
similar to the proof of Theorem 7.18. □
As stated in Lemma 7.1, it is natural that the family of languages generated by pure
grammars without erasing rules is included in the family of languages generated
by pure grammars in which the presence of erasing rules is allowed. As we show
7.3 Results 201
further, for PCFG, the inclusions stated in Lemma 7.1 are proper. The PG case is left
as an open problem.
Theorem 7.21 Let
Then, 𝑋 − 𝜀 ⊂ 𝑋.
Proof Let 𝐾 = {𝑎, 𝑎𝑏} and 𝑌 = {𝑎𝑎, 𝑎𝑎𝑏} be two languages over Σ = {𝑎, 𝑏}.
Furthermore, let 𝐺 = (Σ, {𝑎 → 𝑎, 𝑏 → 𝜀}, 𝑎𝑏) and 𝐺 ′ = (Σ, {𝑎 → 𝑎, 𝑏 →
𝜀}, 𝑎𝑎𝑏) be two PCFGs.
(a) SPCF− 𝜀 ⊂ SPCF. Since 𝐾 = 𝐿 (𝐺, 𝑠 ⇒), 𝐾 ∈ SPCF. Assume that 𝐾 ∈
SPCF− 𝜀 ; then, there is a PCFG 𝐻 = (Σ, 𝑃, 𝜎) with no erasing rules in 𝑃 such
that 𝐿(𝐻, 𝑠 ⇒) = 𝐾. Obviously, 𝜎 = 𝑎, so 𝑎 → 𝑎𝑏 ∈ 𝑃. We have 𝑎 𝑠 ⇒∗ 𝑎𝑏𝑏
and since 𝑎𝑏𝑏 ∉ 𝐾, 𝐾 ∉ SPCF− 𝜀 .
(b) JSPCF− 𝜀 ⊂ JSPCF. 𝐾 ∈ JSPCF and 𝐾 ∉ JSPCF− 𝜀 are proved analogously
as in (a).
(c) PPCF− 𝜀 ⊂ PPCF. Since 𝑌 = 𝐿(𝐺 ′ , 𝑝 ⇒), 𝑌 ∈ PPCF. Assume that 𝑌 ∈
PPCF− 𝜀 , so there is a PCFG 𝐻 = (Σ, 𝑃, 𝜎) with no erasing rules in 𝑃 such
that 𝐿(𝐻, 𝑝 ⇒) = 𝑌 . Obviously, 𝜎 = 𝑎𝑎 and then 𝑎 → 𝑎𝑏 ∈ 𝑃. We have
𝑎𝑎 𝑝 ⇒∗ 𝑎𝑏𝑎𝑏 and since 𝑎𝑏𝑎𝑏 ∉ 𝑌 , 𝑌 ∉ PPCF− 𝜀 .
(d) JPPCF− 𝜀 ⊂ JPPCF. 𝑌 ∈ JPPCF and 𝑌 ∉ JPPCF− 𝜀 are proved analogously
as in (c).
(e) 0L− 𝜀 ⊂ 0L (see [Herman and Rozenberg, 1975, Theorem 2.8]). □
Open Problem Let 𝑋 ∈ {SP, JSP, PP, JPP}. Is the inclusion 𝑋 − 𝜀 ⊆ 𝑋, in fact,
proper? □
From Figure 7.1 and from mentioned theorems, we are able to find out the most
of relationships between investigated language families (even for those which are
generated by PCFGs without erasing rules—the most of languages used in Figure
7.1 have this property), but not all. Following theorems fill this gap.
Theorem 7.22 SPCF and PPCF− 𝜀 are incomparable.
Proof Let 𝑋 = {𝑎𝑎, 𝑎𝑎𝑏} be a language over alphabet Σ = {𝑎, 𝑏}. Obviously, there
is a PCFG 𝐺 = (Σ, {𝑎 → 𝑎, 𝑏 → 𝜀}, 𝑎𝑎𝑏) such that 𝐿 (𝐺, 𝑠 ⇒) = 𝑋, so 𝑋 ∈ SPCF.
By Theorem 7.21, 𝑋 ∉ PPCF− 𝜀 . Conversely, there is a language 𝑌 = {𝑎 2 | 𝑛 ≥ 0}
𝑛
−𝜀
over {𝑎} such that 𝑌 ∉ SPCF and 𝑌 ∈ PPCF (see D in Figure 7.1 and observe
that to get 𝑌 we need no erasing rules). Finally, {𝑎}+ ∈ SPCF ∩ PPCF− 𝜀 . □
Theorem 7.23 SPCF and 0L− 𝜀 are incomparable.
Proof Analogous to the proof of Theorem 7.22. □
The mutual relation between JSPCF− 𝜀 and JPPCF− 𝜀 is either incomparability
or JSPCF− 𝜀 ⊂ JPPCF− 𝜀 , but we do not know the answer now. We also do not
know either if JSPCF− 𝜀 and JPPCF are incomparable or JSPCF− 𝜀 ⊂ JPPCF.
202 7 Pure Jumping Grammars
We close this section by showing how the mutual relations between investigated
language families change if we consider only alphabets containing only one symbol.
From Theorem 7.2, Theorem 7.4, and Theorem 7.5, we can conclude that for every
unary alphabet
SPCF = JSPCF ⊂ PPCF = JPPCF = 0L.
Trivially,
As the following theorem demonstrates that PPCF− 𝜀 and SPCF are incomparable,
we can summarize the results for the unary alphabet by Figure 7.2.
Theorem 7.25 In the case of unary alphabets, SPCF and PPCF− 𝜀 are incompara-
ble.
Proof Clearly, the language {𝑎}+ is contained in both SPCF and PPCF− 𝜀 . Since
the language {𝜀, 𝑎, 𝑎𝑎} from SPCF is not contained in PPCF− 𝜀 , SPCF ⊈ PPCF− 𝜀 .
Conversely, PPCF− 𝜀 ⊈ SPCF since PPCF− 𝜀 is not semilinear. □
Open Problems
PPCF JPPCF 0L
SPCF JSPCF
SPCF− 𝜀 JSPCF− 𝜀
We have been careful not to say that the jumping formal models given in this book
are the only formalizations of discontinuous computation. In fact, formal language
theory has introduced numerous other alternatives for this purpose. Out of these, the
present chapter highlights a few that appear to be of a great interest.
Section 8.1 discusses deep pushdown automata, which represent modified ver-
sions of ordinary pushdown automata. Specifically, these modified versions can
rewrite non-input symbols deeper than on the very top of their pushdown lists. Sec-
tion 8.2 formalizes discontinuous computation by grammars and automata working
with unordered strings. Section 8.3 continues with the discussion of models that
define unodered strings. It covers permutation grammars, which are based upon
classical grammars that generate unordered strings.
Finite automata are strictly finitary and memoryless models, so their jumping versions
can only jump over their input tapes (see Chapter 3). Pushdown automata, however,
represent finite automata extended by potentially infinite stacks. As is obvious, this
extention allows them to perform jumps over their stacks as explored in the present
section.
Pushdown automata discussed in this section represent language-accepting mod-
els based upon slightly generalized stack structures, which can be modified deeper
than on their tops. As opposed to the ordinary versions of pushdown automata, which
can only expand the stack tops, these generalized versions can jump deeper into their
stacks or, speaking in terms of automata theory, pushdown lists and make expansions
therein, hence their name—deep pushdown automata.
To give a more precise insight into the concept of deep pushdown automata,
consider the well-known conversion of any context-free grammar to an equivalent
pushdown automaton 𝑀, frequently referred to as the general top-down parser for
the converted grammar (see, for instance, [Meduna, 2000, page 444]). Recall that
207
208 8 Other Models of Discontinuous Computation
during every move, 𝑀 either pops or expands its pushdown depending on the symbol
occurring on the pushdown top. If an input symbol 𝑎 occurs on the pushdown top,
𝑀 compares the pushdown top symbol with the current input symbol, and if they
coincide, 𝑀 pops the topmost symbol from the pushdown and proceeds to the next
input symbol on the input tape. If a nonterminal occurs on the pushdown top, the
parser expands its pushdown by replacing the top nonterminal with a string. 𝑀
accepts an input string 𝑥 if it makes a sequence of moves during which it completely
reads 𝑥, empties its pushdown, and enters a final state; the latter requirement of
entering a final state is dropped in some books (see, for instance, [Meduna, 2000,
Algorithm 5.3.1.1.1]). In essence, a deep pushdown automaton 𝐷 represents a slight
generalization of 𝑀. Indeed, 𝐷 works exactly as 𝑀 except that it can make expansions
of depth 𝑚, meaning that 𝐷 replaces the 𝑚th topmost pushdown symbol with a string,
for some positive integer 𝑚.
This chapter proves that deep pushdown automata are stronger than ordinary
pushdown automata but less powerful than linear-bounded automata. More precisely,
we demonstrate that the deep pushdown automata that make expansions of depth 𝑚
or less, where 𝑚 ≥ 1, accept a proper language subfamily of the language family
accepted by deep pushdown automata that make expansions of depth 𝑚 + 1 or less.
They give rise to an infinite hierarchy of language families occurring between the
family of context-free languages and that of context-sensitive languages.
Basic Model
every positive integer 𝑛, however, there exist some context-sensitive languages that
cannot be accepted by any deep pushdown automata that make expansions of depth
𝑛 or less.
Next, we define the notion of a deep pushdown automaton, after which we illustrate
it by an example. Recall that by Convention 1.2, N denotes the set of all positive
integers without 0.
where
• 𝑄 is a finite set of states;
• Δ is an input alphabet;
• Γ is a pushdown alphabet, N, 𝑄, and Γ are pairwise disjoint, Δ ⊆ Γ, and Γ − Δ
contains a special bottom symbol, denoted by #;
• 𝑅 ⊆ (N × 𝑄 × (Γ − (Δ ∪ {#})) × 𝑄 × (Γ − {#}) + )
∪ (N × 𝑄 × {#} × 𝑄 × (Γ − {#}) ∗ {#}) is a finite relation;
• 𝑠 ∈ 𝑄 is the start state;
• 𝑆 ∈ Γ is the start pushdown symbol;
• 𝐹 ⊆ 𝑄 is the set of final states.
Instead of (𝑚, 𝑞, 𝐴, 𝑝, 𝑣) ∈ 𝑅, we write 𝑚𝑞 𝐴 → 𝑝𝑣 ∈ 𝑅 and call 𝑚𝑞 𝐴 → 𝑝𝑣 a
rule; accordingly, 𝑅 is referred to as the set of rules of 𝑀. A configuration of 𝑀 is
a triple in 𝑄 × Δ∗ × (Γ − {#}) ∗ {#}. Let 𝜒 denote the set of all configurations of 𝑀.
Let 𝑥, 𝑦 ∈ 𝜒 be two configurations. 𝑀 pops its pushdown from 𝑥 to 𝑦, symbolically
written as
𝑥 𝑝⊢ 𝑦
if 𝑥 = (𝑞, 𝑎𝑢, 𝑎𝑧), 𝑦 = (𝑞, 𝑢, 𝑧), where 𝑎 ∈ Δ, 𝑢 ∈ Δ∗ , 𝑧 ∈ Γ∗ . 𝑀 expands its
pushdown from 𝑥 to 𝑦, symbolically written as
𝑥 𝑒⊢ 𝑦
𝑥 𝑒 ⊢ 𝑦 [𝑚𝑞 𝐴 → 𝑝𝑣]
𝑥⊢𝑦
1𝑠𝑆 → 𝑞 𝐴𝐴 1𝑞 𝐴 → 𝑓 𝑎𝑏 1𝑓 𝐴 → 𝑓𝑐
1𝑞 𝐴 → 𝑝𝑎 𝐴𝑏 2𝑝 𝐴 → 𝑞 𝐴𝑐
On 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑀 makes
State Grammars
To establish key results about DPDAs concerning their power and an infinite language
family hierarchy underlain by these automata (Corollaries 8.1 through 8.3), we first
recall the definition of state grammars as well as some results about these grammars,
needed to prove these key results.
A state grammar 𝐺 is a context-free grammar extended by an additional state
mechanism that strongly resembles a finite-state control of finite automata. During
every derivation step, 𝐺 rewrites the leftmost occurrence of a nonterminal that can
be rewritten under the current state; in addition, it moves from a state to another
state, which influences the choice of the rule to be applied in the next step. If the
application of a rule always takes place within the first 𝑛 occurrences of nonterminals,
𝐺 is referred to as 𝑛-limited.
First, the state grammars are defined, and then we illustrate them by examples
and describe their generative power.
where
• Σ is a total alphabet;
• 𝑊 is a finite set of states;
• Δ ⊂ Σ is an alphabet of terminals;
• 𝑆 ∈ Σ − Δ is the start symbol;
• 𝑅 ⊆ (𝑊 × (Σ − Δ)) × (𝑊 × Σ+ ) is a finite relation.
Instead of (𝑞, 𝐴, 𝑝, 𝑣) ∈ 𝑅, we write (𝑞, 𝐴) → ( 𝑝, 𝑣) ∈ 𝑅. If (𝑞, 𝐴) → ( 𝑝, 𝑣) ∈
𝑅, 𝑥, 𝑦 ∈ Σ∗ , and for each 𝐵 ∈ symbols(𝑥), 𝑅 contains no rule with (𝑞, 𝐵) on its left-
hand side, then 𝐺 makes a derivation step from (𝑞, 𝑥 𝐴𝑦) to ( 𝑝, 𝑥𝑣𝑦), symbolically
written as
(𝑞, 𝑥 𝐴𝑦) ⇒ ( 𝑝, 𝑥𝑣𝑦) [(𝑞, 𝐴) → ( 𝑝, 𝑣)]
In addition, if 𝑛 is a positive integer satisfying that occur(𝑥 𝐴, Σ − Δ) ≤ 𝑛, we say
that (𝑞, 𝑥 𝐴𝑦) ⇒ ( 𝑝, 𝑥𝑣𝑦) [(𝑞, 𝐴) → ( 𝑝, 𝑣)] is 𝑛-limited, symbolically written as
and
(𝑞, 𝑥 𝐴𝑦) ⇒𝑛 ( 𝑝, 𝑥𝑣𝑦),
respectively. In the standard manner, we extend ⇒ to ⇒𝑚 , where 𝑚 ≥ 0; then, based
on ⇒𝑚 , we define ⇒+ and ⇒∗ .
Let 𝑛 be a positive integer, and let 𝜈, 𝜔 ∈ 𝑊 × Σ+ . To express that every derivation
step in 𝜈 ⇒𝑚 𝜔, 𝜈 ⇒+ 𝜔, and 𝜈 ⇒∗ 𝜔 is 𝑛-limited, we write 𝜈 𝑛 ⇒𝑚 𝜔, 𝜈 𝑛 ⇒+ 𝜔,
and 𝜈 𝑛 ⇒∗ 𝜔 instead of 𝜈 ⇒𝑚 𝜔, 𝜈 ⇒+ 𝜔, and 𝜈 ⇒∗ 𝜔, respectively.
By strings(𝜈 𝑛 ⇒∗ 𝜔), we denote the set of all strings occurring in the derivation
𝜈 𝑛 ⇒∗ 𝜔. The language of 𝐺, denoted by 𝐿(𝐺), is defined as
( 𝑝 0 , 𝑆) → ( 𝑝 0 , 𝑋𝑌 ) ( 𝑝 0 , 𝑋) → ( 𝑝 3 , 𝑎)
( 𝑝 0 , 𝑋) → ( 𝑝 1 , 𝑎𝑋) ( 𝑝 3 , 𝑌 ) → ( 𝑝 0 , 𝑎)
( 𝑝 1 , 𝑌 ) → ( 𝑝 0 , 𝑎𝑌 ) ( 𝑝 0 , 𝑋) → ( 𝑝 4 , 𝑏)
( 𝑝 0 , 𝑋) → ( 𝑝 2 , 𝑏𝑋) ( 𝑝 4 , 𝑌 ) → ( 𝑝 0 , 𝑏)
( 𝑝 2 , 𝑌 ) → ( 𝑝 0 , 𝑏𝑌 )
Indeed, first, 𝑆 is rewritten to 𝑋𝑌 . Then, by using its states, 𝐺 ensures that whenever
𝑋 is rewritten to 𝑎𝑋, the current state is changed to force the rewrite of 𝑌 to 𝑎𝑌 .
Similarly, whenever 𝑋 is rewritten to 𝑏𝑋, the current state is changed to force the
rewrite of 𝑌 to 𝑏𝑌 . Every successful derivation is finished by rewriting 𝑋 to 𝑎 or 𝑏
and then 𝑌 to 𝑎 or 𝑏, respectively.
For example, 𝑎𝑏𝑎𝑏 is produced by the following derivation
8.1 Deep Pushdown Automata 213
( 𝑝 0 , 𝑆) ⇒ ( 𝑝 0 , 𝑋𝑌 ) [( 𝑝 0 , 𝑆) → ( 𝑝 0 , 𝑋𝑌 )]
⇒ ( 𝑝 1 , 𝑎𝑋𝑌 ) [( 𝑝 0 , 𝑋) → ( 𝑝 1 , 𝑎𝑋)]
⇒ ( 𝑝 0 , 𝑎𝑋𝑎𝑌 ) [( 𝑝 1 , 𝑌 ) → ( 𝑝 0 , 𝑎𝑌 )]
⇒ ( 𝑝 4 , 𝑎𝑏𝑎𝑌 ) [( 𝑝 0 , 𝑋) → ( 𝑝 4 , 𝑏)]
⇒ ( 𝑝 0 , 𝑎𝑏𝑎𝑏) [( 𝑝 4 , 𝑌 ) → ( 𝑝 0 , 𝑏)]
By ST, we denote the family of languages generated by state grammars. For every
𝑛 ≥ 1, ST𝑛 denotes the family of languages generated by 𝑛-limited state grammars.
Set Ø
ST∞ = ST𝑛
𝑛≥1
In the conclusion of this section, we give the key result concerning state grammars,
originally established in Kasai [1970].
Accepting Power
In the present section, we establish the main results of this chapter. That is, we
demonstrate that DPDAs that make expansions of depth 𝑚 or less, where 𝑚 ≥ 1, are
equivalent to 𝑚-limited state grammars, so these automata accept a proper subfamily
of the language family accepted by DPDAs that make expansions of depth 𝑚 + 1
or less. Then, we point out that the resulting infinite hierarchy of language families
obtained in this way occurs between the families of context-free and context-sensitive
languages. However, we also show that there always exist some context-sensitive
languages that cannot be accepted by any DPDAs that make expansions of depth 𝑛
or less, for every positive integer 𝑛.
To rephrase these results briefly and formally, in Meduna [2006], it is demon-
strated that
DPDA1 = DEPDA1 = CF
and for every 𝑛 ≥ 1,
After giving basic ideas and constructive parts of the proofs of all these results,
we recall several open problem areas, including some suggestions concerning new
deterministic and generalized versions of DPDAs.
Lemma 8.1 (see Lemma 1 in Meduna [2006]) For every state grammar 𝐺 and for
every 𝑛 ≥ 1, there exists a DPDA of depth 𝑛, 𝑛 𝑀, such that 𝐿 (𝐺, 𝑛) = 𝐿 (𝑛 𝑀).
where
𝑄 = 𝑆, $ ∪ ⟨𝑝, 𝑢⟩ | 𝑝 ∈ 𝑊, 𝑢 ∈ 𝑁 ∗ {#} 𝑛 , |𝑢| ≤ 𝑛
Examine the construction of 𝑛 𝑀 to see that (𝑠, 𝑐, 𝑆) ⊢∗ ($, 𝜀, #) starts by using a rule
introduced in (1), so (𝑠, 𝑐, 𝑆) ⊢∗ (⟨𝑝, 𝑆#𝑛−1 ⟩, 𝑐, 𝑆#). Furthermore, notice that this
sequence of moves ends (𝑠, 𝑐, 𝑆) ⊢∗ ($, 𝜀, 𝜀) by using a rule introduced in step (4).
Thus, we can express
(𝑠, 𝑐, #) ⊢∗ ($, 𝜀, #)
as
(𝑠, 𝑐, #) ⊢∗ (⟨𝑝, 𝑆#𝑛−1 ⟩, 𝑐, 𝑆#)
⊢∗ (⟨𝑞, prefix( 𝑓 (#𝑛 ), 𝑛, ⟩), 𝜀, #)
⊢ ($, 𝜀, #) in 𝑛 𝑀
8.1 Deep Pushdown Automata 215
Lemma 8.2 ([Meduna, 2006, Lemma 2]) For every 𝑛 ≥ 1 and every DPDA 𝑛 𝑀,
there exists a state grammar 𝐺 such that 𝐿 (𝐺, 𝑛) = 𝐿 (𝑛 𝑀).
and
𝐷 = ⟨𝑞, 𝑖, ⊳⟩ | 𝑞 ∈ 𝑄, 0 ≤ 𝑖 ≤ 𝑛 − 1
Moreover, introduce an alphabet 𝑊 such that card(Σ) = card(𝑊), and for all 𝑖, 1 ≤
𝑖 ≤ 𝑛, an alphabet 𝑈𝑖 such that card(𝑈𝑖 ) = card(𝑁). Without any loss of generality,
assume that Σ, 𝑄,Ðand all these newly introduced sets and alphabets are pairwise
𝑛
disjoint. Set 𝑈 = 𝑖=1 𝑈𝑖 . For each 𝑖, 1 ≤ 𝑖 ≤ 𝑛 − 1, set 𝐶𝑖 = {⟨𝑞, 𝑖, ⊲⟩ | 𝑞 ∈ 𝑄} and
for each 𝑖, 0 ≤ 𝑖 ≤ 𝑛 − 1, set 𝐷 𝑖 = {⟨𝑞, 𝑖, ⊳⟩ | 𝑞 ∈ 𝑄}. Introduce a bijection ℎ from Σ
to 𝑊. For each 𝑖, 1 ≤ 𝑖 ≤ 𝑛, introduce a bijection 𝑖 𝑔 from 𝑁 to 𝑈𝑖 . Define the state
grammar
𝐺 = Σ ∪ 𝑊 ∪ 𝑈 ∪ {𝑍 }, 𝑄 ∪ 𝐶 ∪ 𝐷 ∪ {$}, Δ, 𝑅, 𝑍
where 𝑅 is constructed by performing the following steps:
Theorem 8.2 For every 𝑛 ≥ 1 and for every language 𝐿, 𝐿 = 𝐿 (𝐺, 𝑛) for a state
grammar 𝐺 if and only if 𝐿 = 𝐿 (𝑛 𝑀) for a DPDA 𝑛 𝑀.
By analogy with the demonstration of Theorem 8.2, we can establish the next
theorem.
Theorem 8.3 For every 𝑛 ≥ 1 and for every language 𝐿, 𝐿 = 𝐿 (𝐺, 𝑛) for a state
grammar 𝐺 if and only if 𝐿 = 𝐸 (𝑛 𝑀) for a DPDA 𝑛 𝑀.
Proof This corollary follows from Theorems 8.2 and 8.3 above and from Theo-
rem 8.1, which says that the 𝑚-limited state grammars generate a proper subfamily
of the family generated by (𝑚 + 1)-limited state grammars, for every 𝑚 ≥ 1. □
Finally, we state two results concerning CF and CS.
Proof This corollary follows from Lemmas 8.1 and 8.2 for 𝑛 = 1, and from Theo-
rem 8.1, which says that one-limited state grammars characterize CF. □
Proof This corollary follows from Lemmas 8.1 and 8.2, Theorems 8.2 and 8.3, and
from Theorem 8.1, which says that ST𝑚 , for every 𝑚 ≥ 1, is properly included
in CS. □
Open Problems
Determinism
This chapter has discussed a general version of DPDAs, which work nondeterminis-
tically. Undoubtedly, the future investigation of these automata should pay a special
attention to their deterministic versions, which fulfill a crucial role in practice. In
fact, we can introduce a variety of deterministic versions, including the following
two types. First, we consider the fundamental strict form of determinism.
Definition 8.3 Let 𝑀 = (𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹) be a DPDA. We say that 𝑀 is
deterministic if for every 𝑚𝑞 𝐴 → 𝑝𝑣 ∈ 𝑅,
Generalization
Let us note that throughout this chapter, we have considered only true pushdown
expansions in the sense that the pushdown symbol is replaced with a nonempty string
rather than with the empty string; at this point, no pushdown expansion can result
in shortening the pushdown length. Nevertheless, the discussion of moves that allow
DPDAs to replace a pushdown symbol with 𝜀 and, thereby, shorten its pushdown
represent a natural generalization of DPDAs discussed in this chapter.
Open Problem What is the language family defined by DPDAs generalized in this
way? □
218 8 Other Models of Discontinuous Computation
Restricted Versions
As usual, let N denote the set of all positive integers. For an alphabet Γ, Γ∗ represents
the free monoid generated by Γ under the operation of concatenation. The identity
of Γ∗ is denoted by 𝜖. For 𝑤 ∈ Γ∗ , |𝑤| denotes the length of 𝑤.
Definition 8.5 Let 𝑀 be a deep pushdown automaton (see Definition 8.1) and 𝑛 ∈ N.
If during any 𝛼 ⊢∗ 𝛽 in 𝑀, 𝛼, 𝛽 ∈ Ξ, 𝑀 has no more than 𝑛 occurrences of symbols
form Γ − Δ in its pushdown, then 𝑀 is an 𝑛-expandable deep pushdown automaton.
Results
Next, we establish Lemma 8.3, which implies the main result of this section.
Lemma 8.3 Let 𝑛 ∈ N. For every 𝑛-expandable deep pushdown automaton 𝑀, there
exists an 𝑛-expendable deep pushdown automaton 𝑀𝑅 such that 𝐿(𝑀) = 𝐿(𝑀𝑅 )
and 𝑀𝑅 contains only two non-input pushdown symbols—$ and #.
𝑀 = (𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹)
be an 𝑛-expandable deep pushdown automaton. Recall that rules in 𝑅 are of the form
𝑚𝑞 𝐴 → 𝑝𝑣, where 𝑚 ∈ N, 𝑞, 𝑝 ∈ 𝑄, either 𝐴 ∈ 𝑁 and 𝑣 ∈ (Γ − {#}) + or 𝐴 = # and
𝑣 ∈ (Γ − {#}) ∗ {#}, where # denotes the pushdown bottom.
Let $ be a new symbol, $ ∉ 𝑄 ∪ Γ, and let homomorphisms 𝑓 and 𝑔 over Γ∗ be
defined as 𝑓 ( 𝐴) = 𝐴 and 𝑔( 𝐴) = $, for every 𝐴 ∈ 𝑁, and 𝑓 (𝑎) = 𝜖 and 𝑔(𝑎) = 𝑎, for
every 𝑎 ∈ (Δ ∪ {#}). Next, we construct an 𝑛-expandable deep pushdown automaton
𝑀𝑅 = (𝑄 𝑅 , Δ, Δ ∪ {$, #}, 𝑅 𝑅 , 𝑠 𝑅 , $, 𝐹𝑅 )
The next example illustrates the construction described in the previous proof.
Example. Take this three-expandable DPDA
𝑅 = {1𝑠𝑆 → 𝑞 𝐴𝐴,
1𝑞 𝐴 → 𝑓 𝑎𝑏,
1 𝑓 𝐴 → 𝑓 𝑐,
1𝑞 𝐴 → 𝑝𝑎 𝐴𝑏,
2𝑝 𝐴 → 𝑞 𝐴𝑐}
(⟨𝑠; 𝑆⟩, 𝑎𝑎𝑏𝑏𝑐𝑐, $#) 𝑒 ⊢ (⟨𝑞; 𝐴𝐴⟩, 𝑎𝑎𝑏𝑏𝑐𝑐, $$#) [1⟨𝑠; 𝑆⟩$ → ⟨𝑞; 𝐴𝐴⟩$$]
𝑒⊢ (⟨𝑝; 𝐴𝐴⟩, 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑎$𝑏$#) [1⟨𝑞; 𝐴𝐴⟩$ → ⟨𝑝; 𝐴𝐴⟩𝑎$𝑏]
𝑝⊢ (⟨𝑝; 𝐴𝐴⟩, 𝑎𝑏𝑏𝑐𝑐, $𝑏$#)
𝑒⊢ (⟨𝑞; 𝐴𝐴⟩, 𝑎𝑏𝑏𝑐𝑐, $𝑏$𝑐#) [2⟨𝑝; 𝐴𝐴⟩$ → ⟨𝑞; 𝐴𝐴⟩$𝑐]
𝑒 ⊢ (⟨ 𝑓 ; 𝐴⟩, 𝑎𝑏𝑏𝑐𝑐, 𝑎𝑏𝑏$𝑐#) [1⟨𝑞; 𝐴𝐴⟩$ → ⟨ 𝑓 ; 𝐴⟩𝑎𝑏]
𝑝⊢ (⟨ 𝑓 ; 𝐴⟩, 𝑐𝑐, $𝑐#)
𝑒⊢ (⟨ 𝑓 ; 𝜖⟩, 𝑐𝑐, 𝑐𝑐#) [1⟨ 𝑓 ; 𝐴⟩$ → ⟨ 𝑓 ; 𝜖⟩𝑐]
𝑝⊢ (⟨ 𝑓 ; 𝜖⟩, 𝜖, #)
Proof This corollary follows from Theorem 8.4 in this section and from [Leupold
and Meduna, 2010, Corollary 3.1]. □
Can we reformulate Theorem 8.4 and Corollary 8.5 in terms of 𝑛 DPDA1 ? The answer
is no as we show next.
{𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 1} ∈ 𝑛 DPDA2 − 𝑛 DPDA1
Open Problems
In the present section, we have reduced finitely expandable deep pushdown automata
with respect to the number of non-input pushdown symbols. Before closing this
section, we suggest some open problem areas related to this subject for the future
investigation.
1. Can we reduce these automata with respect to the number of states?
2. Can we simultaneously reduce them with respect to the number of both states
and non-input pushdown symbols?
3. Can we achieve the reductions described above in terms of general deep push-
down automata, which are not finitely expandable? In fact, Lemma 8.4 holds for
these automata, so it can be considered as a preliminary result related to this
investigation area.
Bags
To start our search for a formalization of unordered strings, let us consider what
remains of strings when we abstract away their order. Under this formalization, any
two strings, 𝑥 and 𝑦, are considered as equivalent if 𝑥 represents a symbol permutation
of 𝑦. For example, the strings 𝑎𝑏𝑏, 𝑏𝑎𝑏 and 𝑏𝑏𝑎 are all permutations of one another
and could all denote the same unordered string, consisting of one 𝑎 and two 𝑏’s
in no particular order. As this example suggests, we can fully identify strings up to
symbol reordering by specifying exactly how many instances of which symbols they
contain. This means that unordered strings can be thought of as finite multisets of
symbols.
Informally, multisets (also called bags) are a modification of sets which can con-
tain multiple instances of the same element. One way to put this is that each element
of a multiset is paired with a positive integer1, called its multiplicity. A multiset
is finite if it only contains a finite number of distinct elements, each with a finite
multiplicity. Assuming an universal alphabet as introduced in Section 1.2, denoted
by Δ, we can formalize multisets as total functions from Δ to 0 N. Alternatively, be-
cause most symbols in Δ will usually be assigned 0, we can think of them as partial
functions which only assign values to symbols with nonzero multiplicities. In either
case, we are successfully avoiding representing the same bag over different alphabets
as a different object. Note, however, that either of these two representations is easily
convertible to the other. Let us now define this notion of unordered strings formally
under the name bag.
Let Δ denote the universal alphabet, that is, a possibly infinite alphabet containing
all possible symbols, and let Σ ⊆ Δ be a finite subalphabet. A bag over Σ is a function
𝜎 : Δ → 0 N such that the set {𝑎 ∈ Δ | 𝜎(𝑎) > 0}, called the underlying set of 𝜎 and
denoted by underlying(𝜎), is a subset of Σ. For convenience, we may also think of
them as functions from underlying(𝜎) to N—the infinitely many pairs (𝑎, 0) for all
𝑎 ∈ Δ not appearing in 𝜎 are the only difference between the two definitions and we
sometimes want to avoid them, such as when explicitly enumerating the members
of the bag. This can be thought of as the bag assigning the number of occurences to
each symbol of Σ it contains, and assigning nothing to the remaining symbols. For
example, 𝜏 = {(𝑎, 2), (𝑏, 1)} is a bag over the alphabet {𝑎, 𝑏, 𝑐} which contains 𝑎
twice, 𝑏 once, and other than that contains no other symbols.
We can represent 𝜏 as a string by enumerating its symbols in any order—so 𝑎𝑎𝑏,
𝑎𝑏𝑎 and 𝑏𝑎𝑎 all describe the same bag, 𝜏. For clarity and standardization, we choose
to use alphabetically ordered strings—given some linear order on the alphabet, no
symbol in the string may be followed by a symbol that precedes it in said order.
Furthermore, repeated occurences of the same symbol may be replaced using the
power notation. Thus, 𝜏 would be represented as 𝑎 2 𝑏. Evidently, the concept of a
bag corresponds to the concept of an unordered string we set out to find.
We denote the empty bag by 𝜀, just like the empty string. This is the unique bag
with the property that 𝜀(𝑎) = 0 for all symbols 𝑎. Given an alphabet Σ, we denote
by ∗ Σ and + Σ the set of all bags over Σ and the set of all nonempty bags over Σ,
respectively. Let 𝜎 ∈ ∗ Σ be a bag. The cardinality of 𝜎 (also called its weight or
norm) is denoted by |𝜎| and is defined as the sum of 𝜎(𝑎) over all symbols 𝑎 in its
alphabet:
∑︁
|𝜎| = 𝜎(𝑎).
𝑎∈Σ
Because we are mainly talking about bags in relation to and in contrast with
strings, it is useful to introduce some precise notions to connect these two worlds.
Let Σ be an alphabet. We can define a function ΨΣ : Σ∗ → ∗ Σ such that for each
𝑤 ∈ Σ∗ , ΨΣ (𝑤) is the bag containing each symbol of Σ exactly the same number of
times as 𝑤; in other words, ΨΣ (𝑤) (𝑎) = occur(𝑤, 𝑎). The function ΨΣ is called the
Parikh mapping, and ΨΣ (𝑤) is the Parikh vector of 𝑤. Due to how we defined bags
to be independent of their alphabet, we can drop the subscript and think of Ψ as a
more general function such that Ψ(𝑤) = ΨΣ (𝑤) for any alphabet Σ and any 𝑤 ∈ Σ∗ .
Parikh vectors were not originally defined as bags, but rather as 𝑘-tuples of
integers corresponding to the numbers of occurences of each symbol in the original
string. The choice to define them as bags might seem like a big departure from
the original spirit of Parikh vectors, but this is in fact not the case—bags over a
particular alphabet Σ of cardinality 𝑘 ∈ N can also be represented as 𝑘-tuples of
natural numbers, also called vectors, each number representing the multiplicity of
its corresponding symbol. Note that this representation is dependent not only on
Σ, but also on how we pair up symbols of Σ with components of the vector. This
pairing up corresponds to specifying a linear ordering of the alphabet. Thus, given
Σ = {𝑎 1 , . . . , 𝑎 𝑘 }, we can define a function ℎΣ : ∗ Σ → 0 N 𝑘 as follows for each
𝜎 ∈ ∗ Σ:
Macrosets
Just how languages are sets of strings, we define a corresponding notion of sets of
bags. Let Σ be an alphabet. A macroset is any subset of ∗ Σ. In particular, ∗ Σ is the
universal macroset over Σ, whereas ∅ is the empty macroset (over any alphabet).
For example, let Σ = {𝑎, 𝑏, 𝑐}. An example of a macroset over Σ is the macroset
𝑀1 = {𝜎 ∈ ∗ Σ | 𝜎(𝑎) = 𝜎(𝑏) = 𝜎(𝑐)}, containing all the bags of the form 𝑎 𝑖 𝑏 𝑖 𝑐𝑖
for some 𝑖 ∈ 0 N.
Even though, as discussed previously, strings and bags are fundamentally different
objects, we are still interested in comparing languages with macrosets, and once we
define some models of computation based on bags, we will be interested in comparing
their power with the power of string-based models of computation. Perhaps the most
obvious and natural connection between the worlds of strings and bags comes in
the form of the Parikh mapping (see Section 1.2), generalized to sets of strings.
That is, for a language 𝐿 ⊆ Σ∗ , reformulate the notion of Parikh image so that
Ψ(𝐿) = {Ψ(𝑤) | 𝑤 ∈ 𝐿} denotes the macroset of Parikh vectors of all strings in 𝐿
(this reformulation is straightforward and left to the reader). We call Ψ(𝐿) the Parikh
image of 𝐿. Given any macroset 𝑀 ⊆ ∗ Σ, if Ψ(𝐿) = 𝑀, we say that 𝐿 and 𝑀 are
Ψ-equivalent.
To better illustrate these notions, consider the languages 𝐿 1 = {𝑎 𝑖 𝑏 𝑖 𝑐𝑖 | 𝑖 ≥ 0}
and 𝐿 2 = {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}. Any string
226 8 Other Models of Discontinuous Computation
𝑤 ∈ 𝐿 1 ∪ 𝐿 2 from either one of these languages contains each symbol from {𝑎, 𝑏, 𝑐}
exactly the same number of times, and for any given number 𝑛 ∈ 0 N, there is exactly
one 𝑤 ∈ 𝐿 1 and at least one 𝑤 ′ ∈ 𝐿 2 with exactly 𝑛 occurences of each symbol.
From these observations we can establish that Ψ(𝐿 1 ) = Ψ(𝐿 2 ) = 𝑀1 , where 𝑀1 is
the macroset defined earlier in this section.
These examples also demonstrate that Ψ, when understood as a mapping from
power(Σ∗ ) to power( ∗ Σ), is not injective—two different languages can map to the
same macroset, as a direct consequence of the original Parikh mapping from Σ∗ to
∗ Σ being non-injective. Note, however, that this does not hold for unary languages.
Indeed, two unary languages 𝐿 1 and 𝐿 2 will have the same Parikh image if and only
if they are the same. Formally, Ψ(𝐿 1 ) = Ψ(𝐿 2 ) if and only if 𝐿 1 = 𝐿 2 for all unary
languages 𝐿 1 , 𝐿 2 .
Similarly to families of languages, we can define families of macrosets simply as
sets whose members are macrosets. Even though we have not yet established any
models for multiset computation, we can derive macroset families from language
families using Parikh mapping. Let L denote a family of languages. Then 𝑝L
denotes the family of Parikh images of languages in the original family of languages.
Formally, 𝑝L = {Ψ(𝐿) | 𝐿 ∈ L}. For example, 𝑝REG, 𝑝LIN, 𝑝CF, 𝑝CS, and 𝑝RE
denote the families of Parikh images for all regular, linear, context-free, context-
sensitive and recursively enumerable languages, respectively. It follows immediately
from the Chomsky hierarchy that
however, it turns out that only the last two of these inclusions are proper, meaning
that the first three families of macrosets are identical. Before formalizing this in a
theorem, let us introduce another useful term for this purpose—another family of
macrosets that also turns out to be equivalent to these families. A macroset of the form
𝑖𝑚
{𝜎0 + 𝜎1𝑖1 + · · · + 𝜎𝑚 | 𝑖1 , . . . , 𝑖 𝑚 ∈ 0 N} for some 𝑚 ∈ 0 N and bags 𝜎0 , . . . , 𝜎𝑚 ∈ ∗ Σ
is a linear macroset. The family of linear macrosets is denoted by Lin. A union of
finitely many linear macrosets is a semilinear macroset. The family of semilinear
macrosets is denoted by SLin.
Proof For a proof of 𝑝CF = SLin, see [Rozenberg and Salomaa, 1997a, Chapter 9].
The inclusion 𝑝REG ⊆ 𝑝CF follows immediately from the definitions of these two
families of macrosets. It is a simple exercise to prove the converse inclusion, SLin ⊆
𝑝REG. We will first briefly describe how to transform an arbitrary linear macroset
𝑀 ′ into a right-linear grammar 𝐺 ′ such that Ψ(𝐿 (𝐺 ′ )) = 𝑀 ′ , demonstrating the
inclusion Lin ⊆ 𝑝REG. The inclusion SLin ⊆ 𝑝REG then follows easily as a
consequence of the class of regular languages being closed under union.
Let Δ be an alphabet and 𝜎0 , . . . , 𝜎𝑚 ∈ ∗ Δ for some 𝑚 ∈ 0 N be the basis bags
which describe the macroset 𝑀 ′ = {𝜎0 + 𝜎1𝑖1 + · · · + 𝜎𝑚 𝑖𝑚
| 𝑖 1 , . . . , 𝑖 𝑚 ∈ 0 N}. Let
8.2 Computation over Unordered Strings 227
𝑃′ = {𝑆 ′ → 𝑠0 } ∪ {𝑆 ′ → 𝑠𝑖 𝑆 ′ | 1 ≤ 𝑖 ≤ 𝑚}.
Let 𝐺 ′ = (Δ ∪ {𝑆 ′ }, Δ, 𝑃′ , 𝑆 ′ ). Obviously, Ψ(𝐿(𝐺 ′ )) = 𝑀 ′ , proving that Lin ⊆
𝑝REG. Ð𝑛
Now, let 𝑀 = 𝑖=1 𝑀𝑖 be an arbitrary semilinear macroset formed as the union
of 𝑛 linear macrosets 𝑀1 , . . . , 𝑀𝑛 for some 𝑛 ≥ 1, and 𝐺 1 , . . . , 𝐺 𝑛 be right-linear
grammars such that Ψ(𝐿 (𝐺 𝑖 )) = 𝑀𝑖 for each 1 ≤ 𝑖 ≤ 𝑛. A grammar 𝐺 = (Σ =
𝑁 ∪ Δ, Δ, 𝑃, 𝑆) such that Ψ(𝐿(𝐺)) = 𝑀 can be constructed from these grammars as
follows.
Let 𝐺 𝑖 = (Σ𝑖 = 𝑁𝑖 ∪ Δ𝑖 , Δ𝑖 , 𝑃𝑖 , 𝑆𝑖 ) for all 1 ≤ 𝑖 ≤ 𝑛. Assume (without loss of
generality) that the sets 𝑁1 , . . . , 𝑁 𝑛 are pairwise disjoint,Ðand let 𝑆 be a Ð
new symbol
𝑛 𝑛
such that 𝑆 ∉ 𝑁𝑖 for any 1 ≤Ð𝑖 ≤ 𝑛. Let 𝑁 = {𝑆} ∪ 𝑖=1 𝑁𝑖 , Δ = 𝑖=1 Δ𝑖 and
𝑛
𝑃 = {𝑆 → 𝑆𝑖 | 1 ≤ 𝑖 ≤ 𝑛} ∪ 𝑖=1 𝑃𝑖 . The grammar 𝐺 generates the union of the
languages 𝐿 (𝐺 1 ), . . . , 𝐿 (𝐺 𝑛 ), and, therefore, Ψ(𝐿 (𝐺)) = 𝑀. This construction can
be repeated for an arbitrary semilinear macroset, proving that SLin ⊆ 𝑝REG.
Putting all this information together, we get SLin ⊆ 𝑝REG ⊆ 𝑝CF = SLin,
meaning that all three of these families are equivalent. □
Theorem 8.6 shows that a part of the Chomsky hierarchy for macrosets collapses
into a single family. However, we have yet to show that the rest of the hierarchy
does not collapse. We demonstrate this using unary languages in the proof of the
following theorem.
Theorem 8.7 𝑝CF ⊂ 𝑝CS ⊂ 𝑝RE.
Proof The improper version of the above statement, 𝑝CF ⊆ 𝑝CS ⊆ 𝑝RE, follows
directly from the definitions of these macroset families and the original models. It
remains to show that each of these two inclusions is proper.
𝑘
To show that 𝑝CS− 𝑝CF is not empty, consider the unary language 𝐿 = {𝑎 2 | 𝑘 ≥
0} and its Parikh image, the macroset 𝑀 = Ψ(𝐿) (which can also be described using
set builder notation in exactly the same way as 𝐿). It is a well-known fact that
𝐿 ∈ CS − CF, and, seeing as 𝐿 is unary, no other language has the same Parikh
image, thus proving that 𝑀 ∉ 𝑝CF, and, consequently, 𝑝CF ⊂ 𝑝CS.
The statement 𝑝CS ⊂ 𝑝RE follows analogously from the existence of unary
recursively enumerable languages that are not context-sensitive, such as a unary
encoding of the halting problem. □
Multiset Grammars
We have now laid a sufficient foundation to explore macroset theory, but as far as
computational models go, we only know how to describe macrosets indirectly as
Parikh images of languages generated by traditional string-based models. Let us
228 8 Other Models of Discontinuous Computation
now finally dive into the world of multiset computation by introducing some bag-
based computational models. The first such model will be multiset grammars (also
called commutative grammars), which are essentially traditional phrase-structure
grammars modified to work with bags instead of strings.
𝜎 ⇒𝐺 𝜏 [𝜇1 → 𝜇2 ]
By applying additional constraints on the shape of the rewriting rules, we can es-
tablish a hierarchy of multiset grammars and their corresponding macroset families.
A multiset grammar 𝐺 = (Σ, Δ, 𝑅, 𝐴) is said to be
• phrase-structure regardless of the shapes of its rewriting rules;
• monotone if |𝜇1 | ≤ |𝜇2 | for all 𝜇1 → 𝜇2 ∈ 𝑅;
• context-free if |𝜇1 | = 1 for all 𝜇1 → 𝜇2 ∈ 𝑅;
• linear if |𝜇1 | = 1 and 𝜇2 (𝑁) ≤ 1 for all 𝜇1 → 𝜇2 ∈ 𝑅;
• regular if |𝜇1 | = 1, |𝜇2 | ≤ 2 and 𝜇2 (𝑁) ≤ 1 for all 𝜇1 → 𝜇2 ∈ 𝑅.
We will denote the families of macrosets generated by regular, linear, context-
free, monotone, and phrase-structure multiset grammars by 𝑚REG, 𝑚LIN, 𝑚CF,
𝑚MON, and 𝑚PS, respectively.
As an example, consider the grammar 𝐺 1 = ({𝑆, 𝑎, 𝑏, 𝑐}, {𝑎, 𝑏, 𝑐}, {𝑆 →
𝑆𝑎𝑏𝑐, 𝑆 → 𝜀}, {𝑆}). Clearly, any derivation of a terminal bag in this grammar
will consist of zero or more applications of the rule 𝑆 → 𝑆𝑎𝑏𝑐, followed by a single
application of the rule 𝑆 → 𝜀. It is therefore easy to see that 𝐺 1 generates exactly
those bags over {𝑎, 𝑏, 𝑐} in which all three symbols have the same multiplicity, com-
prising the macroset 𝑀1 from the previous section. Written explicitly, the macroset
generated by 𝐺 1 is 𝑀 (𝐺 1 ) = {𝑎 𝑖 + 𝑏 𝑖 + 𝑐𝑖 | 𝑖 ∈ 0 N} = 𝑀1 . Notice that 𝐺 1 is a linear
multiset grammar, meaning that 𝑀1 ∈ 𝑚LIN. To demonstrate how 𝐺 1 works, let us
demonstrate the derivation of 𝑎 3 𝑏 3 𝑐3 :
8.2 Computation over Unordered Strings 229
𝑆 ⇒ 𝑆𝑎𝑏𝑐 ⇒ 𝑆𝑎 2 𝑏 2 𝑐2 ⇒ 𝑆𝑎 3 𝑏 3 𝑐3 ⇒ 𝑎 3 𝑏 3 𝑐3
One striking difference between Definition 8.6 and Definition 2.8 is that phrase-
structure grammars have a single start symbol 𝑆, whereas multiset grammars have
an entire set 𝐴 = {𝛼1 , . . . , 𝛼 𝑘 } of axioms (where 𝑘 = card( 𝐴)). However, it turns
out that a grammar of any of the types of multiset grammars described above can be
transformed to an equivalent multiset grammar of the same type such that its start
macroset consists only of a single bag of cardinality 1 (that is, 𝐴 = {𝑆}). This is easily
shown for phrase-structure, monotone and context-free multiset grammars, simply
by introducing a new start symbol 𝑆 and rules 𝑆 → 𝛼1 , . . . , 𝑆 → 𝛼 𝑘 . Demonstrating
this for linear and regular grammars requires a more intricate construction, such as
replacing the set of nonterminals 𝑁 in the original grammar with the set of strings
over 𝑁 of length up to max{occur(𝛼, 𝑁) | 𝛼 ∈ 𝐴} (see Kudlek et al. [2000] for details
of this construction).
In the previous sections, we used the Greek letter Ψ for connections between the
world of strings and the world of macrosets—to denote the Parikh mapping, as well as
its generalization to sets. To avoid confusion, we will now select a different symbol,
Φ, to map traditional grammars to their multiset counterparts. Given any phrase-
structure grammar, 𝐺, we define Φ(𝐺) to be the multiset grammar constructed
from 𝐺 by simply replacing all the strings in its production rules and its axioms by
corresponding multisets. Thanks to the convention of writing multisets as strings, this
means that we can describe a phrase-structure grammar and a multiset grammar in
exactly the same way with the only difference coming from context—we understand
a particular model to be either string-based or multiset-based.
One might expect that when we construct a multiset grammar in this way, the
macroset it generates is simply the macroset of Parikh vectors of strings generated
by the original grammar, that is, given an arbitrary phrase-structure grammar 𝐺,
𝑀 (Φ(𝐺)) = Ψ(𝐿(𝐺)) holds, and that, consequently, the class of Parikh images of
languages generated by a particular class of grammars corresponds to the class of
macroset generated by their multiset counterparts. For context-free grammars, this
is indeed the case—the left-hand side of every rule is a single non-terminal, so the
application of a rule only requires that this nonterminal be contained in the current
sentential form, and this is easily simulated by a context-free multiset grammar,
meaning that 𝑀 (Φ(𝐺)) = Ψ(𝐿 (𝐺)) always holds for context-free grammars 𝐺,
which combined with Theorem 8.6 gives the consequence that 𝑚CF = 𝑚LIN =
𝑚REG = SLin.
However, as we will show in the remainder of this section, neither 𝑀 (Φ(𝐺)) =
Ψ(𝐿 (𝐺)) nor 𝑚L = 𝑝L holds in the general case. For example, consider the
grammar 𝐺 = ({𝑆, 𝐵, 𝐶}, {𝑎}, {𝑆 → 𝐵𝑎𝐶, 𝐵𝐶 → 𝑎}, 𝑆). It is easy to see that
𝐿 (𝐺) = ∅. However, in Φ(𝐺), the derivation 𝑆 ⇒ 𝑎𝐵𝐶 ⇒ 𝑎𝑎 becomes possible,
meaning that 𝑀 (Φ(𝐺)) = {𝑎𝑎} ≠ Ψ(𝐿(𝐺)) = ∅. This alone, however, is not enough
to prove that 𝑚MON ≠ 𝑝MON = 𝑝CS or 𝑚PS ≠ 𝑝PS, or indeed to show where
these macroset classes fit within the hierarchy shown in the previous section. For
230 8 Other Models of Discontinuous Computation
Proof We will show that any monotone multiset grammar can be transformed into an
equivalent propagating matrix multiset grammar and vice versa. Both constructions
sketched here are taken from Kudlek et al. [2000].
Let 𝐺 = (Σ, Δ, 𝑅, 𝐴) be a monotone multiset grammar. Note that every rule in 𝑅
is of the form
𝑋1 · · · 𝑋 𝑘 → 𝑌1 · · · 𝑌𝑙
for some 𝑘, 𝑙 such that 𝑘 ≤ 𝑙. For each 𝑋 ∈ Σ, we introduce new nonterminals
𝑋 ′ , 𝑋 ′′ . We can then simulate each production rule 𝑋1 · · · 𝑋 𝑘 → 𝑌1 · · · 𝑌𝑙 with a
matrix consisting of the following rules in order:
• Rules 𝑋𝑖′ → 𝑌𝑖′′ for each 1 ≤ 𝑖 < 𝑘,
• A single rule 𝑋 𝑘′ → 𝑌𝑘′′ · · · 𝑌𝑙′′ ,
• Rules 𝑌𝑖′′ → 𝑌𝑖′ for each 1 ≤ 𝑖 < 𝑘.
Both single-primed and double-primed symbols are used to prevent the rewriting
of symbols that should not be rewritten—if 𝑋 𝑗 = 𝑌𝑖 for some 1 ≤ 𝑖 < 𝑗 ≤ 𝑘, a matrix
constructed as above but without primed symbols would allow the 𝑌𝑖 generated by
the 𝑖-th rule of the matrix to be rewritten as 𝑋 𝑗 by the 𝑗-th rule, which would not
be possible by the original rule in 𝐺. Having constructed these matrices, only a few
technical details remain (such as creating a new set of axioms containing primed
variants of the multisets in 𝐴, or adding rules to convert primed terminals to their
non-primed variants) to construct a propagating matrix multiset grammar (without
appearance checking) equivalent to 𝐺. Consequently, 𝑚MON ⊆ 𝑚M− 𝜀 .
Conversely, let 𝐻 ′ = (𝐺 ′ , 𝑀 ′ , ∅) be a propagating matrix multiset grammar
corresponding to a string matrix grammar in binary normal form. To simulate a
matrix of the form ( 𝐴 → 𝑥, 𝑋 → 𝑌 ) (where 𝐴, 𝑋, 𝑌 are nonterminals and 𝑥 is
an arbitrary string over the total alphabet of 𝐺 ′ ), simply create a monotone rule
𝐴𝑋 → 𝑥 𝑋. Thanks to 𝐻 ′ being in binary normal form, 𝑋 ∉ symbols(𝑥), so the
resulting monotone rule will be applicable to exactly the same sentential forms as
the original matrix. This can be utilized to construct a monotone multiset grammar
equivalent to 𝐻 ′ , proving that also 𝑚M− 𝜀 ⊆ 𝑚MON. □
Proof To demonstrate this theorem, modify the proof of Theorem 8.8 so it works
with non-propagating rules. □
Figure 8.1 shows how the macroset families generated by different types of
multiset matrix grammars compare to the macroset variant of Chomsky hierarchy
established in the previous section. The improper inclusions in the diagram eas-
ily follow from what we have already discussed and the well-known hierarchy of
language families generated by matrix grammars (see Dassow and Păun [1989]).
However, we are yet to justify the properness of these inclusions, which we will do
in the remainder of this section.
To show that SLin ⊂ 𝑚MON, simply consider the monotone multiset grammar
𝐺 2 = ({𝑋, 𝑌 , 𝐴, 𝑎, 𝑏}, {𝑎, 𝑏}, 𝑃2 , {𝑋𝑎}) where 𝑃2 = {𝑋𝑎 → 𝑋 𝐴𝐴, 𝑋 → 𝑌 , 𝑋 →
232 8 Other Models of Discontinuous Computation
𝑝CS
𝑚PS = 𝑝M = 𝑚M
− 𝜀 = 𝑚M − 𝜀
𝑝M𝑎𝑐 𝑎𝑐
𝑎 𝑝 𝑏 𝑞
𝑠
Fig. 8.2 𝐴1 .
Multiset Automata
( 𝑝, 𝜏) ⊢ 𝐴 (𝑞, 𝜌)
Looking over the definition, it is clear that this model is very closely related to finite
automata. Indeed, essentially the only difference is that while finite automata work
with strings, multiset finite automata work with multisets. In light of Theorem 3.6,
a very close relation to jumping finite automata can also be seen—the way a JFA
ignores the order of symbols in its input string corresponds closely to the non-
existence of order in the input of a MFA. So while a MFA may accept or reject a
particular multiset 𝜇, a JFA may accept or reject all permutation of a string 𝑤 such
that Ψ(𝑤) = 𝜇.
As a simple example, consider MFA 𝐴1 = ({𝑠, 𝑝, 𝑞}, {𝑎, 𝑏, 𝑐}, 𝑓 , 𝑠, {𝑠}) where
𝑓 (𝑠, 𝑎) = {𝑝}, 𝑓 ( 𝑝, 𝑏) = {𝑞}, 𝑓 (𝑞, 𝑐) = {𝑠}, and 𝑓 (𝑥, 𝑦) = ∅ for all other pairs
(𝑥, 𝑦) ∈ {𝑠, 𝑝, 𝑞}×{𝑎, 𝑏, 𝑐}. The diagram of this automaton can be seen in Figure 8.2.
It is not hard to see that this MFA accepts the macroset 𝑀1 from the section about
macrosets, that is, 𝑀 ( 𝐴1 ) = 𝑀1 = {𝑎 𝑖 + 𝑏 𝑖 + 𝑐𝑖 | 𝑖 ≥ 0}.
234 8 Other Models of Discontinuous Computation
While a traditional finite automaton, working with ordered strings, decides upon
its next step based on the first symbol of the unprocessed input, an MFA, working with
bags, has no such limitations—it has more of a global view of its input, performing
a transition if a particular symbol is present in its input, regardless of its position; in
fact, it does not even make sense to talk about the position of a symbol within a bag.
In this light, it makes sense to consider a modification to this model which would
allow it to decide on a particular computational step based on whether a particular
symbol is not present in its input bag. This modification is presented formally in the
following definition.
( 𝑝, 𝜏) ⊢ 𝐴 (𝑞, 𝜌)
For MFAs, this modification does not actually provide an increase in accepting
power; however, they do increase the accepting power of their deterministic variants,
as well as some stronger models which we will discuss later in this section. An
MFA 𝐴 = (𝑄, Δ, 𝑓 , 𝑠, 𝐹) is deterministic (DMFA) if and only if the following two
conditions hold:
1. For all 𝑞 ∈ 𝑄 and for all 𝑎 ∈ Δ, card( 𝑓 (𝑞, 𝑎)) ≤ 1;
2. For all 𝑞 ∈ 𝑄 and for all 𝑎 ∈ Δ, card( 𝑓 (𝑞, 𝑎)) > 0 implies 𝑓 (𝑞, 𝑏) = ∅ for all
𝑏 ∈ Δ − {𝑎}.
Notice that MFA 𝐴1 in Figure 8.2 is deterministic. Similarly, but rather more com-
plexly, a MFAD 𝐴 = (𝑄, Δ, 𝑓 , 𝑠, 𝐹) is deterministic (DMFAD) if and only if the
following two conditions hold:
1. For all 𝑞 ∈ 𝑄 and for all 𝑎 ∈ Δ ∪ Δ̄, card( 𝑓 (𝑞, 𝑎)) ≤ 1;
2. For all 𝑞 ∈ 𝑄 and for all 𝑎 ∈ Δ ∪ Δ̄, card( 𝑓 (𝑞, 𝑎)) > 0 implies 𝑓 (𝑞, 𝑏) = ∅ for
all 𝑏 ∈ Δ ∪ Δ̄ − {𝑎, 𝑎}.
¯
MFA, MFAD, DMFA, and DMFAD denote the classes of macrosets generated
by MFAs, MFADs, DMFAs, and DMFADs, respectively. By definition, it must be the
case that DMFA ⊆ MFA ⊆ MFAD and DMFA ⊆ DMFAD ⊆ MFAD. From the
close relation of MFA to finite automata, it is easy to see that MFA = 𝑝REG = SLin.
8.2 Computation over Unordered Strings 235
In Csuhaj-Varjú et al. [2001], it is also proven that MFAD = MFA. However, the
deterministic variants are both strictly weaker. DMFA cannot even deal with some
finite macrosets, such as {𝑎, 𝑏}—if there is any transition from the start state reading
𝑎, there can be no such transition reading 𝑏, and vice versa. DMFAD on the other
hand can accept all finite macrosets, but are unable to accept certain linear macrosets,
such as {𝑎 𝑘+2𝑙 + 𝑏 2𝑘+𝑙 | 𝑘, 𝑙 ∈ 0 N}, which is proven in Csuhaj-Varjú et al. [2001] as
well. The relative accepting powers of these automata can thus be summarized as
follows:
DMFA ⊂ DMFAD ⊂ MFAD = MFA = SLin,
with the extra note that DMFAD and DMFA are both incomparable with Lin and
DMFA is incomparable with the class of finite macrosets, while DMFAD contains
the class of finite macrosets.
A reader familiar with traditional automata theory might now expect a multiset
analog of pushdown automata; however, no such model will be introduced in this
section, for at least two reasons. First, the last in, first out nature of the pushdown
cannot be meaningfully simulated only using bags, as there is no notion of order
or position. Second, as we have seen in the section on multiset grammars, the
distinctions between regular, context-free and semilinear are blurred in the world of
multiset computation, evidenced by the fact that REG = 𝑝CF = SLin. Therefore,
we will skip directly to a multiset analog of linear bounded automata.
( 𝑝, 𝜏) ⊢ 𝑁 (𝑞, 𝜌)
Whereas a MFA can only read its input bag symbol by symbol, a MLBA can also
output symbols to its bag. This, combined with the unordered nature of bags, would
give rise to an analog of the Turing Machine in the general case; however, the linear
236 8 Other Models of Discontinuous Computation
boundedness is enforced by not allowing the automaton to write more than it reads
in a single step.
Analogously to MFA, we can extend this definition to allow the automaton to
detect the non-presence of a particular symbol, with the caveat that this time we
introduce barred symbols for the entire bag alphabet, 𝑈. More precisely, in a multiset
linear bounded automaton with detection (MLBAD), 𝑁 = (𝑄, Δ, 𝑈, 𝑓 , 𝑠, 𝐹), all of
𝑄, Δ, 𝑈, 𝑠, 𝐹 retain the same meaning as in a MLBA, but we introduce a barred
alphabet 𝑈¯ = { 𝑎¯ | 𝑎 ∈ 𝑈} of new symbols, and modify the definition of the transition
mapping as a function 𝑓 : 𝑄 × (𝑈 ∪ 𝑈) ¯ → power(𝑄 × (𝑈 ∪ {𝜀})), and for any
𝑝, 𝑞 ∈ 𝑄, 𝜏, 𝜌 ∈ ∗𝑈,
( 𝑝, 𝜏) ⊢ 𝑁 (𝑞, 𝜌)
if and only if one of the following holds for some 𝑎 ∈ 𝑈, 𝑏 ∈ 𝑈 ∪ {𝜀}:
(a) (𝑞, 𝑏) ∈ 𝑓 ( 𝑝, 𝑎) and 𝜌 = 𝜏 − 𝑎 + 𝑏,
(b) (𝑞, 𝑏) ∈ 𝑓 ( 𝑝, 𝑎),
¯ 𝜏(𝑎) = 0 and 𝜌 = 𝜏 + 𝑏.
Both of these models also have deterministic variants, defined the same way as
for MFA—no more than one transition should be possible from any state while
reading any particular symbol, and for deterministic MLBAD, no particular state
can combine transitions with barred and unbarred symbols, unless it has exactly one
transition for an unbarred symbol, exactly one transition for its barred variant, and no
other transitions other than these two. These variants can be referred to, predictably,
by the acronyms DMLBA and DMLBAD.
As an example, consider the MLBAD
𝑎/𝜀 ¯
𝑎/𝜀
𝑞0 𝑞1 𝑞𝑟
𝑎/𝑏 ¯
𝑏/𝜀
𝑏/𝜀
¯
𝑏/𝜀 ¯
𝑎/𝜀 𝑞𝑒 𝑞𝑓
¯
𝑎/𝜀
𝑏/𝜀 𝑎/𝜀
𝑝0 𝑝1 ¯ 𝑝𝑟
𝑏/𝜀
𝑏/𝑎
Fig. 8.3 𝑁1 .
𝑛
earlier in this section accepts the non-semilinear macroset {𝑎 2 | 𝑛 ≥ 0}, thus proving
that MLBA ⊂ MLBAD. DMLBA are unable to accept even simple macrosets like
{𝑎, 𝑏} due to limitations similar to DMFA. As such, DMLBA ⊂ MLBA, which
contrasts with the original, string-based variants, where the relationship between
the language classes accepted by deterministic and nondeterministic LBA is still an
open problem. This also serves to show that DLMBA ⊂ DMLBAD. Based on this
information, we can refine the hierarchies above to
and
DMLBA ⊂ DMLBAD ⊆ MLBAD.
The relationship between MLBAD and other established superclasses of MLBA,
such as 𝑝MON and 𝑚PS, is unclear; however, it is shown in Csuhaj-Varjú et al.
[2001] to contain all macroset generated by multiset random context grammars
limited to non-erasing rules.
Our final stop on this tour of multiset automata will be, unsurprisingly, the multiset
counterpart of Turing machines—a variant of Turing machines the tape of which
behaves like a bag rather than a string. The version defined in Csuhaj-Varjú et al.
[2001] differs from MLBA in that it is always allowed to read a special symbol
which is in unlimited supply in the bag. We will introduce a slightly modified but
equivalent version, which is instead allowed to not read anything in a computational
move.
( 𝑝, 𝜏) ⊢ 𝑁 (𝑞, 𝜌)
Petri Nets
At the core of Petri nets is the concept of a net, which consists of places, transitions,
and arcs between them. Essentially, a net is a bipartite directed graph, meaning its
vertices are divided into two disjoint subsets (places and transitions) such that every
edge (arc) of the graph connects a vertex in one subset with one in the other. In
a diagram, places are usually represented by circles, transitions are represented by
rectangles or squares, and arcs are represented as directed arrows between them.
While the exact semantics of a particular class of Petri nets depends on its exact
definition, generally, the places of a Petri net are intended to contain tokens, which can
be removed or added by firing transitions. Arcs represent the connections between
8.2 Computation over Unordered Strings 239
𝑝6
𝑏 𝑑
𝑝1 𝑝3
𝑎
𝜀 𝑝2 𝜀 𝜀 𝑝4
𝑝5
We are now ready to start drawing parallels between Petri nets and multiset
computation. The marking of a Petri net can be thought of as a multiset of its
places, with the caveat that a place can be assigned the marking 𝜔, representing
infinite multiplicity. Transitions then behave exactly as production rules in a multiset
grammar—the incoming arcs and their weights represent the left-hand side of the
rule, while the right-hand side is represented by the outgoing arcs and their weights.
Following these observations, we can simulate derivations of multiset grammars
using Petri nets, but it is worth noting that there are some aspects of the semantics
of Petri nets that we do not need for this simulation, such as the capacities of places,
or the possibility of a place being marked with infinitely many tokens.
Observe that languages accepted by variants of jumping automata are semilinear,
so it is worth to consider their relation to Petri nets, because their reachability sets
are semilinear as well (see Yen [2016]).
2 An exception can be made for a single rule of the form 𝑆 → 𝜀, in which case 𝑆 may not appear
on the right-hand side of any rule in 𝐺.
8.3 Permutation Grammars 241
Example 8.3 Let 𝐺 1 = ({𝑆, 𝑋, 𝐴, 𝐵, 𝐶}, {𝑎, 𝑏, 𝑐}, 𝑃1 , 𝑆), where 𝑃1 contains the fol-
lowing rules:
• 𝑆 → 𝜀, 𝑆 → 𝑋,
• 𝑋 → 𝐴𝐵𝐶 𝑋, 𝑋 → 𝐴𝐵𝐶,
• 𝐴 → 𝑎,
• 𝐵 → 𝑏,
• 𝐶 → 𝑐,
• 𝐴𝐵 ↔ 𝐵𝐴,
• 𝐴𝐶 ↔ 𝐶 𝐴,
• 𝐵𝐶 ↔ 𝐶 𝐵.
This grammar generates the language 𝐿 1 = 𝐿(𝐺 1 ) = {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤,
𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}.
𝐿 1 is a well-known example of a non-context-free language, but as it is generated
by a permutation grammar, it is a permutation language. An example of a basis
language for this language is 𝐿 1𝐵 = {𝑎𝑏𝑐}∗ .
Proof Follows directly from Lemma 8.5 and the languages from Examples 8.3
and 8.4 satisfying 𝐿 1 ∈ Perm − CF and 𝐿 2 ∈ CS − Perm, respectively. □
Theorem 8.11 shows the position of permutation languages in the Chomsky
hierarchy, between context-free languages and context-sensitive languages.
The case for 𝑛 = 1 in the above definition is not very interesting, as permutation
rules of length 1 are context-free and offer no increase in generative power, meaning
that Perm1 = CF. However, Example 8.3 alone is enough to show that CF ⊂ Perm𝑛
for all 𝑛 ≥ 2. Furthermore, it follows immediately from Definition 8.15 that for
any 𝑛 ≥ 1, Perm𝑛 ⊆ Perm and Perm𝑛 ⊆ Perm𝑛+1 . The following theorem shows
that infinitely many of these inclusions are proper, leading to an infinite hierarchy
of language classes contained strictly between context-free and context-sensitive
languages.
Principally and primarily, the objective of this book consists in building up a strictly
mathematical body of knowledge concerning jumping automata and grammars. That
is also why Parts II and III, which represent the heart of this book, have concentrated
their attention solely on theoretical aspects of jumping formal models while re-
fraining from their applications. The present three-section chapter somewhat relaxes
this purely mathematical approach by briefly sketching some of these applications
in order to demonstrate the use of these models in practice of the current and,
perhaps even more significantly, future computer science. Specifically, Section 9.1
considers jumping automata as language-defining devices. Once again, it compares
their behavior against classical sequential automata, and based upon this compar-
ison, it demonstrates circumstances under which the use of the jumping versions
has their obvious advantages over that of their sequential counterparts. Then, in a
more specific and realistic way, Section 9.2 describes the use of jumping grammars
as DNA-computational models in bioinformatics. Section 9.3 returns to theoretical
computer scince, but it concetrates its attention on the applications of some of pre-
viously achieved results in this field. More specifically, it demonstrates how Lemma
4.28 gives rise to a brand new proof technique applicable to a variety of automata,
which is shortly shown for classical finite automata.
First, let us start with the discussion on the reading behavior of jumping finite au-
tomata and the types of languages that these models accept. As we have stated in the
introduction of this book (see Preface and Chapter 3), the main initial motivation be-
hind the jumping concept was the fact that in modern computation methods we often
process information in a discontinuous way, but classical formal models usually work
in a strictly continuous way. Consequently, the description of modern computation
methods with classical formal models can be in many cases inadequately compli-
cated. Nonetheless, this does not mean that the proposed jumping finite automata
243
244 9 Remarks on Applications and Their Perspectives
Considering models from Section 4.2, we can see that they precisely fit the de-
scription of parallelism (P.1) that increases the power of the model (see page 62).
Moreover, the parallel mechanism integrated into the jumping finite automaton model
can also partially control the reading order of the input sting. Indeed, we can use the
9.1 Jumping Automata Used as Language-Defining Devices 245
initial splitting of the input string to establish some required fixed order between the
separated parts.
Due to Theorems 4.29 and 4.30, we know that, with any number of reading heads,
we can accept all languages accepted by the original jumping finite automata. Now,
consider the following languages that cannot be accepted with the original jumping
finite automata:
(1) {𝑎}∗ {𝑏}∗ , {𝑎}∗ {𝑏}∗ {𝑐}∗ , {𝑎}∗ {𝑏}∗ {𝑐}∗ {𝑑}∗ ,
(2) {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}, {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 0}, and {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 𝑑 𝑛 | 𝑛 ≥ 0}.
In group (1), the languages are clearly all regular. By contrast, in group (2), the
languages get again quickly out of the capabilities of even push automata. It is
possible to easily accept all these languages with 𝑛-PGJFAs; even if we restrict
these automata so that the rules can contain only a single symbol. Nonetheless, each
distinct section in the input string that occupies a specific position between other
sections of the input string requires an additional reading head (see Lemma 4.16).
Therefore, we can see that this technique of controlling the order of symbols has its
limitations. For example, with a finite number of reading heads, we are not able to
cover all regular languages.
As we have shown, there is a possibility to use the right 𝑛-jumping relation and
thus extend the basic behavior of classical finite automata rather than jumping finite
automata. In this case, we decrease the capabilities of the discontinuous reading
but increase the capabilities of the continuous reading. In this mode, 𝑛-PGJFAs are
still able to accept all languages introduced in the previous paragraph and also all
regular languages, but they are no longer able to accept the previous languages like
{𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}.
It should be a relatively simple task to simulate the parallel behavior of these
automata. The model conveniently splits the input into several almost independent
parts at the start, and then we need to synchronize only the number of performed
steps by the reading heads. The synchronization behavior in this model is also easily
reconfigurable, and thus it can be further fine-tuned for the specific needs of the given
task. After such a reconfiguration, the changes in the power of the model should be
also relatively easy to predict because many different versions of these types of
synchronizations were already thoroughly studied in formal grammars (see Martı́n-
Vide and Mitrana [2000]; Csuhaj-Varjú et al. [2000]; Martı́n-Vide et al. [2002];
Vollweiler and Otto [2014]).
Even though the previous 𝑛-PGJFAs are already able to partially control the discon-
tinuous reading, we can see that they can ensure only a relatively simple reading
order and that it can potentially require many additional reading heads. Therefore, let
us take a look at the advanced reading modes with two reading heads from Section
4.1. We can see that the behavior of the jumping finite automaton model in these
246 9 Remarks on Applications and Their Perspectives
modes differs from 𝑛-PGJFAs: (1) the input string is not split into separate parts
at the start; however, the heads cannot cross each other; (2) each head has its own
reading direction; and (3) both heads always follow the same rule in a single step.
These changes have a large impact on the jumping behavior and the families of
accepted languages, but they help us to better control the discontinuous reading and
combine it with the continuous reading. Indeed, we could make these modes more
general if we removed (3), but the main focus of our research was to study the core
behavior of these modes.
From our initial study, the unrestricted 2-jumping relation does not seem to be
particularly interesting for further research. It offers a somewhat similar effect as 𝑛-
PGJFAs, but the impact of rules on the accepted language is less clear because there
is no clear point on the input tape which the heads cannot cross. Consequently, we
were not able to link this mode to some specific behavior used in modern computation
methods.
Considering the right-left and left-right 2-jumping relations, we see that the model
loses almost all its jumping capabilities. Indeed, the reading heads can reposition
themselves only during the initialization phase. However, this gives us a great control
over the reading behavior since the model can still read from two distinct places
at once and the position of the heads is always well predictable. Of course, the
reduction of jumping capabilities has its drawbacks, and the model can now accept
only a subfamily of linear languages. Nonetheless, these 2-jumping relations draw a
nice connection to 5′ → 3′ Watson–Crick finite automata, where this concept can
be expanded and studied further.
Lastly, let us take a look at the right-right and left-left 2-jumping relations. On
the first glance, their behavior may seem hard to grasp, but under a closer inspection
we see here some similarities with methods that ensure data consistency or with
other similar types of tasks. In computer science, there are many tasks where several
processes may need to work with the same resources together in parallel and where
we need to guarantee data consistency. To demonstrate our idea, let us consider
database transactions. Typically, in a transaction, we load data from a database,
we modify some values, and we save the data back to the database. These three
operations together are not atomic, and the database may need to handle other
requests at the same time. Thus, when we consider a stream of operations performed
by the database, the load and store operations may not follow precisely after each
other, but there cannot be a different operation between them that modifies the same
data. If we consider the right-right 2-jumping relation, we see that it can accept
input strings where the data (symbols) are not in some precise order but where two
sequences read by the heads are interlined according to the rule that the first head
cannot ever cross the second head. Of course, the model would need to be further
appropriately tweaked to precisely match the needs of a real-world task.
9.2 Jumping Grammars Used as Models of DNA Computation 247
This section presents two biologically oriented case studies. First, Section 9.2.1
describes a simple case study that suggests how to make use of jumping scattered
context derivation in DNA processing. Then, within the framework of genetic algo-
rithms, Section 9.2.2 sketches an application of pure jumping grammars.
248 9 Remarks on Applications and Their Perspectives
Assume that the grammar works under 2 ⇒. It first generates an arbitrary string
of 𝐺s and 𝑇s, in which there are no restrictions, by classical regular rules, since
2 ⇒ does not change the behavior of context-free rules. However, then it comes
the essential phase generating 𝐴s and 𝐶s. Indeed, the only context-sensitive rule
under 2 ⇒ generates the equal number of 𝐴s and 𝐶s randomly scattered through
the resulting sentence, but always with 𝐴s preceding 𝐶s. For instance, previously
mentioned string 𝐴𝐺𝐺 𝐴𝐴𝑇𝐶𝐺𝐶𝐺𝑇𝐶 can be generated by the following derivation.
9.2 Jumping Grammars Used as Models of DNA Computation 249
1 2⇒ 23 2⇒ 2𝐺3
2⇒ 2𝐺𝐺3 2⇒ 2𝐺𝐺𝑇3
2⇒ 2𝐺𝐺𝑇𝐺3 2⇒ 2𝐺𝐺𝑇𝐺𝐺3
2⇒ 2𝐺𝐺𝑇𝐺𝐺𝑇3 2⇒ 2𝐺𝐺𝑇𝐺𝐺𝑇4
2⇒ 𝐴2𝐺𝐺𝑇𝐺𝐺𝑇4𝐶 2⇒ 𝐴𝐺𝐺 𝐴2𝑇𝐺4𝐶𝐺𝑇𝐶
2
2⇒ 𝐴𝐺𝐺 𝐴𝐴2𝑇4𝐶𝐺𝐶𝐺𝑇𝐶 2⇒ 𝐴𝐺𝐺 𝐴𝐴𝑇𝐶𝐺𝐶𝐺𝑇𝐶
As is obvious, under 2⇒, the grammar generates the language consisting of all the
strings satisfying the above-stated requirements. Therefore, as we can see, jumping
grammars may fulfill a useful role in studies related to DNA computing.
𝑆 → 𝑆𝑆, 𝑆 → 𝐴𝐵, 𝑆 → 𝑐,
𝑆𝐴 → 𝐴𝑆, 𝑆𝐵 → 𝐵𝑆, 𝐴𝑆 → 𝑆 𝐴,
𝐴𝐵 → 𝐵𝐴, 𝐵𝑆 → 𝑆𝐵, 𝐵𝐴 → 𝐴𝐵,
𝐴 → 𝑎, 𝐵 → 𝑏
However, 𝐺 𝑎𝑏 contains only four rules and, therefore, describes 𝐿 𝑎𝑏 in a more
economical way than 𝐻 𝑎𝑏 does.
Next, we explore how to use one of the presented proof techniques in a broader
context. From the content of Sections 4.1, 4.2, and 4.4, it is clear that the parallel
jumping finite automaton models require different approaches in proofs than classical
finite automata that process the input in a continuous way. In Sections 4.1 and 4.2,
it was still possible to cleverly adapt the more or less classical proof techniques for
the new conditions. However, we can see that the proofs in Section 4.4 sometimes
require a significantly different approach. More specifically, let us recall one of the
crucial lemmas:
Lemma 4.28 (see page 112) Let 𝐿 be a language, and let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a
jumping 5′ → 3′ WKFA. If 𝐿 (𝑀) = 𝐿, there exists a constant 𝑘 for 𝑀 such that 𝑀
accepts all 𝑤 ∈ 𝐿 using only configurations that have their debt bounded by 𝑘.
is not used in formal proofs. We are not aware of any proof technique that would
try to capture such an approach in a formal way. Therefore, we have developed the
debt lemma that allows us to take into consideration both the language and also the
model.
Even though the debt lemma was designed for the parallel jumping finite automa-
ton model, it is not limited only for these types of models. We believe that it can be
easily adapted for any finite automaton model that does not use an infinite storage
and that reads the input at least semi-continuously. To demonstrate this in detail, we
show how to adapt the debt lemma for classical finite automata.
First, we adapt the supporting definitions and lemmas for the new model:
Lemma 4.27 (see page 111) For each jumping 5′ → 3′ WKFA 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹)
there exists a constant 𝑘 such that the following holds. Let 𝑞 ∈ 𝑄 and 𝑠 ∈ {⊕, ⊖}
such that 𝑓 ∈ 𝐹 is reachable from 𝑞 and 𝑠. For every computation C that takes 𝑀
from (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) to (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ), 𝑤 ∈ Δ∗ , 𝑤 1 , 𝑤 2 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ , there
exists 𝑤 ′ ∈ 𝐿 (𝑀) such that 𝑀 starting with 𝑤 ′ can reach 𝑞 and 𝑠′ ∈ {⊕, ⊖} by using
the same sequence of ⊕/⊖-reading steps as in C and the rest of 𝑤 ′ can be processed
with a limited number of additional steps bounded by 𝑘.
Lemma 9.1 For each finite automaton 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) there exists a constant
𝑘 such that the following holds. Let 𝑞 ∈ 𝑄 such that 𝑓 ∈ 𝐹 is reachable from 𝑞. For
every computation C that takes 𝑀 from 𝑞 0 𝑤 1 𝑤 2 to 𝑞𝑤 2 , 𝑤 1 , 𝑤 2 ∈ Δ∗ , there exists
𝑤 ′ ∈ 𝐿(𝑀) such that 𝑀 starting with 𝑤 ′ can reach 𝑞 by using the same sequence of
steps as in C and the rest of 𝑤 ′ can be processed with a limited number of additional
steps bounded by 𝑘.
Proof The proof is trivial. If 𝑓 is reachable from 𝑞, there has to exist some sequence
of state transitions from 𝑞 to 𝑓 that does not repeat states; this sequence is finite, and
its maximum length is bounded by 𝑘 ′ = card(𝑄). Assume that the sequence reads
𝑤 3 ∈ Δ∗ . Set 𝑤 ′ = 𝑤 1 𝑤 3 . Clearly, 𝑞 0 𝑤 1 𝑤 3 ⇒∗ 𝑞𝑤 3 ⇒∗ 𝑓 in 𝑀. Thus, 𝑤 ′ ∈ 𝐿 (𝑀)
and there exists 𝑘 ≤ 𝑘 ′ for 𝑀 that bounds the number of additional steps. □
Of course, since pumping lemmas for regular languages are well known, it is not
necessary to adapt the debt lemma for classical finite automata. However, we can
see that the adaptation process is straightforward, and the resulting proof technique
is simple to use.
Chapter 10
Summary and Bibliographical Remarks
The present book has been written for one reason and one reason only: a necessary
update of the fundamental formal models used in the theory of computation for
discontinuous information processing, which belongs to the most common ways of
computation on today’s mutually heavily cooperating multi-processor computers.
In the previous century, most classical computer science methods were developed
for continuous information processing; accordingly, their models work on the input
string-represented information in a strictly continuous way from the left side to the
right side of the string. Today’s methods, however, often process information in an
utterly discontinuous way so that they jump over large portions of the input infor-
mation between individual computational steps. An adequate formalization of this
modern computation, referred to as jumping computation in this book, necessitates
an update of the original models so that the resulting updated models reflect jumping
computation properly.
By no means, however, does this update intend, metaphorically speaking, to
throw the baby out with the bathwater. That is, as almost always in the theory of
computation, the models under update are categorizable into the two well-known
categories—automata and grammars, whose updated versions are hence referred
to as jumping automata and grammars, respectively. In fact, the theory of jumping
computation usually selects and turns the most common types of the original models,
such as finite automata and context-free grammars, to their jumping versions. Also,
just like the classical theory of computation often simultaneously uses automata
and grammars to formalize the same kind of computation, so does this new theory.
In other words, the theory of jumping computation often formalizes the same kind
of discontinuous computation by both jumping automata and jumping grammars,
which represent, in essence, nothing but two different, but literary inseparable math-
ematical approaches to the same computational phenomenon. In the present book,
any formalization like this is preceded by an explanation why its introduction is
needed in order to cope with a particular type of real computational discontinuity
occurring in computer science at present.
Primarily, from a theoretical standpoint, this book gives an account of crucially
important concepts and results concerning jumping automata and grammars, whose
255
256 10 Summary and Bibliographical Remarks
Bibliographical History
We close this chapter and, in fact, the entire book by placing jumping automata
and grammars into a historical and bibliographical context. Despite its short, about-
ten-year-old development, a great number of papers about these models have been
published. Rather than attempt to be encyclopedic, we next mention only the papers,
which seem to fulfill the most important role during this brief development.
Historically, Meduna and Zemek [2012] opened the subject of this book by
introducing the basic versions of jumping finite automata, and to a large extent,
Chapter 3 is based upon this pioneer paper. This paper carefully explains how their
introduction results from a real need of coping with discontinuous computation today,
and it established their fundamental properties. Indeed, it covers all the major topics
in the theory of automata and computation in terms of jumping finite automata.
Following the principal idea of models working in a jumping way described
in Meduna and Zemek (2012), many more related studies have been published
on this subject since. More specifically, up until now, the authors are aware of
over 30 studies concerning jumping automata and grammars. Most of these models
define the language families that intersect some of the well-known families of the
Chomsky hierarchy, which is probably the fundamental reason for investigating them
so intensively: an incomparability like this represents, in general, a rather unusual
phenomenon in the language theory as a whole. Out of all these studies, we next bring
the reader’s attention to several papers, which arguably fulfill the most important
role in this new vivid trend.
Immanuel and Thomas [2016b] modify jumping finite automata for accept-
ing two-dimensional languages. It compares the family of languages accepted by
these automata with other two-dimensional language families, such as the family of
Siromoney matrix languages and that of picture languages. It also proves some of
closure and decidability properties. Many additional variants and properties of two-
dimensional JFAs are investigated by Immanuel and Thomas [2016a], Immanuel and
Thomas [2017], and Madejski and Szepietowski [2017].
Wang and Li [2018] introduce new variants of restarting automata, where the
move-right operation is replaced by a jump operation. The paper proves that the
jumping restarting automata with auxiliary symbols can accept all growing context-
sensitive languages, and for some special cases they are even more expressive. Next,
the deterministic and monotone versions of the jumping restarting automata with
auxiliary symbols have the same expressive power as the corresponding types of
general restarting automata. Finally, it is demonstrated that for the types without
auxiliary symbols, the general restarting automata are strictly more powerful than
jumping restarting automata.
Kuperberg et al. [2019] introduce alternative versions of multi-head finite au-
tomata, which differs from the multi-head finite automata discussed in Chapter 4 of
this book. In the alternative versions, tape heads can jump according to a prescribed
set of rules, and they actually combine both categories of parallelisms (PA.1) and
(PA.2) described in Chapter 4. Perhaps most importantly, from a general viewpoint,
this paper demonstrates a close relation between the theory of jumping automata,
258 10 Summary and Bibliographical Remarks
logic, and algebra. More specifically, the paper expresses a fragment of a cyclic
sequent proof system for Kleene algebra, which is viewed as a computational device
for recognizing languages. The starting proof system is linear, and it defines precisely
the regular languages. When adding the standard contraction rule, the expressivity
raises and characterizes precisely the family of languages accepted by the alternative
multi-head finite automata.
Fazekas et al. [2021] define and investigate two-way finite automata as modified
versions of ordinary deterministic finite automata that can jump to the nearest letter
they can read in either direction. The paper shows that these automata are more
powerful than one-way jumping finite automata. It also proves several non-closure
properties of the language family defined by these automata.
Mishra et al. [2021b] (non-reviewed on-line publication) introduce generalized
linear one-way jumping finite automata, which make a jump after deleting an input
substring, and after this deletion, they change the current state. Furthermore, they
make a sequence of jumps only in one direction—either from left to right or from
right to left. The paper shows that these automata are more powerful than one-way
jumping finite automata defined in Chigahara et al. [2016]. The paper studies several
special cases, such as generalized right linear one-way jumping finite automata and
generalized left linear one-way jumping finite automata. Several closure properties
of the language families defined by all these variants are established.
Mishra et al. [2021a] (non-reviewed on-line publication) study generalized linear
one-way jumping finite automata, which strongly resemble the automata studied in
Mishra et al. [2021b], except that they work on the input in a circular way. The paper
shows that these automata are more powerful than one-way jumping finite automata.
It considers several special versions of these automata and studies their power. Many
closure properties of the language relationships resulting from these versions are
demonstrated.
Fazekas et al. [2022] continue the discussion of one-way jumping finite automata
that skip over letters for which they do not have any rules to apply instead of halting
and rejecting the input. These automata are strictly more powerful than classical
finite automata. The paper restricts these automata asymptotically similarly to the
way computational complexity classes are bounded. It points out a gap between
the resulting constant and linear jumping complexity classes. The paper demonstrates
the existence of automata with logarithmic jumping complexity. It introduces a
measure called sweep complexity in order to characterize the regular language
family by one-way jumping machines with limited resources.
Beier and Holzer [2022] continue the discussion opened in Chigahara et al.
[2016] by investigating nondeterministic one-way jumping finite automata. The paper
considers a great number of versions of these machines with multiple initial states
and various transition functions, such as spontaneous functions or 𝜆-based functions.
It achieves many results concerning the relationships of the associated language
families defined by all these versions. These relationships are also established with
respect to the Chomsky hierarchy.
Fazekas et al. [2022] study a variety of modified versions of jumping automata. In
many respects, these modifications resemble common computational mechanisms
10 Summary and Bibliographical Remarks 259
This bibliographical list contains all the publications referenced in the text. In addi-
tion, it includes some more useful references concerning the theory of languages and
computation, many of which were published prior to the introduction of jumping
automata and grammars. These publications discuss formal models, such as finite
automata or context-free grammars, which underlie their jumping versions. There-
fore, the reader without a solid background in these areas can treat them as useful
references for a comfortable explanation of the necessary terminology, outlined in
Chapter 1 extremely succinctly.
Beier, S. and M. Holzer (2018a). Decidability of right one-way jumping finite automata. In
Developments in Language Theory, DLT 2018, Volume 11088 of LNCS, pp. 109–120. Springer
International Publishing.
Beier, S. and M. Holzer (2018b). Properties of right one-way jumping finite automata. In De-
scriptional Complexity of Formal Systems, DCFS 2018, Volume 10952 of LNCS, pp. 11–23.
Springer International Publishing.
Beier, S. and M. Holzer (2019). Properties of right one-way jumping finite automata. Theoretical
Computer Science 798, 78–94.
Beier, S. and M. Holzer (2022). Nondeterministic right one-way jumping finite automata. Informa-
tion and Computation 284, 104687. Selected Papers from DCFS 2019, the 21st International
Conference on Descriptional Complexity of Formal Systems.
Beier, S., M. Holzer, and M. Kutrib (2017). Operational state complexity and decidability of
jumping finite automata. In Developments in Language Theory, DLT 2017, Volume 10396 of
LNCS, pp. 96–108.
Beier, S., M. Holzer, and M. Kutrib (2019). Operational state complexity and decidability of
jumping finite automata. International Journal of Foundations of Computer Science 30(1),
5–27.
Bordihn, H., H. Fernau, and M. Holzer (2002). Accepting pure grammars. Publ. Math. 60, 483–510.
Chatterjee, K. and K. S. Ray (2017). Watson–Crick pushdown automata. Kybernetika 53(5),
868–876.
Chigahara, H., S. Z. Fazekas, and A. Yamamura (2015). One-way jumping finite automata. In The
77th Nat. Convention of IPSJ.
Chigahara, H., S. Z. Fazekas, and A. Yamamura (2016). One-way jumping finite automata. Inter-
national Journal of Foundations of Computer Science 27(03), 391–405.
Chomsky, N. (1959). On certain formal properties of grammars. Information and Control 2,
137–167.
Csuhaj-Varju, E., J. Dassow, J. Kelemen, and G. Păun (1994). Grammar Systems: A Grammatical
Approach to Distribution and Cooperation. Gordon and Breach, Yverdon.
Csuhaj-Varjú, E., C. Martı́n-Vide, and V. Mitrana (2001). Multiset automata. In C. S. C. S. Calude,
G. Păun, G. Rozenberg, and A. Salomaa (Eds.), Multiset Processing, Volume 2235 of LNCS,
pp. 69–83. Springer Berlin Heidelberg.
Csuhaj-Varjú, E., C. Martı́n-Vide, V. Mitrana, and G. Vaszil (2000). Parallel communicating
pushdown automata systems. International Journal of Foundations of Computer Science 11(4),
631–650.
Csuhaj-Varjú, E. and G. Vaszil (2010). Scattered context grammars generate any recursively
enumerable language with two nonterminals. Information Processing Letters 110, 902–907.
Czeizler, E. and E. Czeizler (2006). A short survey on Watson–Crick automata. Bull. EATCS 88,
104–119.
Dassow, J. and G. Păun (1989). Regulated Rewriting in Formal Language Theory. Springer, Berlin.
Eğecioğlu, O., L. Hegedüs, and B. Nagy (2010). Stateless multicounter 5′ → 3′ Watson–Crick
automata. In Fifth IEEE International Conference on Bio-Inspired Computing: Theories and
Applications, BIC-TA 2010, pp. 1599–1606.
262 Bibliography
Fazekas, S. Z., K. Hoshi, and A. Yamamura (2019). Enhancement of automata with jumping modes.
In AUTOMATA 2019, Volume 11525 of LNCS, pp. 62–76.
Fazekas, S. Z., K. Hoshi, and A. Yamamura (2021). Two-way deterministic automata with jumping
mode. Theoretical Computer Science 864, 92–102.
Fazekas, S. Z., K. Hoshi, and A. Yamamura (2022). The effect of jumping modes on various
automata models. Nat. Comput. 21(1), 17–30.
Fazekas, S. Z., R. Mercaş, and O. Wu (2022). Complexities for jumps and sweeps. Journal of
Automata, Languages and Combinatorics 27(1–3), 131–149.
Fazekas, S. Z. and A. Yamamura (2016). On regular languages accepted by one-way jumping finite
automata. In Eighth Workshop on Non-Classical Models of Automata and Applications (NCMA
2016) Short papers, pp. 7–14.
Fernau, H. and A. Meduna (2003). A simultaneous reduction of several measures of descriptional
complexity in scattered context grammars. Information Processing Letters 86(5), 235–240.
Fernau, H., M. Paramasivan, and M. L. Schmid (2015). Jumping finite automata: Characterizations
and complexity. In F. Drewes (Ed.), CIAA 2015, Volume 9223 of LNCS, pp. 89–101. Springer.
Fernau, H., M. Paramasivan, M. L. Schmid, and V. Vorel (2017). Characterization and complexity
results on jumping finite automata. Theoretical Computer Science 679, 31–52.
Freund, R., G. Paun, G. Rozenberg, and A. Salomaa (1997). Watson–Crick finite automata. In
H. Rubin and D. H. Wood (Eds.), DNA Based Computers, Proceedings of a DIMACS Workshop,
Philadelphia, Pennsylvania, USA, June 23-25, 1997, Volume 48 of DIMACS Series in Discrete
Mathematics and Theoretical Computer Science, pp. 297–328. DIMACS/AMS.
Gabrielian, A. (1970). Pure grammars and pure languages. Technical Report Rep. C.S.R.R. 2027,
Department of Computer Research, University of Waterloo, Waterloo, Ontario, Canada.
Ginsburg, S., S. A. Greibach, and M. Harrison (1967). One-way stack automata. Journal of the
ACM 14(2), 389–418.
Greibach, S. A. and J. E. Hopcroft (1969). Scattered context grammars. Journal of Computer and
System Sciences 3(3), 233–247.
Grune, D. and C. J. Jacobs (2008). Parsing Techniques: A Practical Guide (2nd ed.). Springer.
Hammer, J. and Z. Křivka (2022). Practical aspects of membership problem of Watson–Crick
context-free grammars. In Proceedings 12th International Workshop on Non-Classical Models
of Automata and Applications, Number 367, pp. 88–111. School of Computer Science and
Engineering, University of New South Wales.
Harrison, M. A. (1978). Introduction to Formal Language Theory. Addison-Wesley, Boston.
Hauschildt, D. and M. Jantzen (1994). Petri net algorithms in the theory of matrix grammars. Acta
Informatica 31, 719–728.
Hegedüs, L., B. Nagy, and O. Eğecioğlu (2012). Stateless multicounter 5′ → 3′ Watson–Crick
automata: The deterministic case. Natural Computing 11(3), 361–368.
Herman, G. T. and G. Rozenberg (1975). Developmental Systems and Languages. Amsterdam:
North-Holland Publishing Company.
Holzer, M., M. Kutrib, and A. Malcher (2009). Multi-head finite automata: Characterizations,
concepts and open problems. In The Complexity of Simple Programs 2008, EPTCS, pp. 93–
107.
Hopcroft, J. E., R. Motwani, and J. D. Ullman (2006). Introduction to Automata Theory, Languages,
and Computation (3rd ed.). Addison-Wesley, Boston.
Hopcroft, J. E. and J. D. Ullman (1979). Introduction to Automata Theory, Languages, and
Computation. Addison-Wesley, Boston.
Ibarra, O. H. (1970). Simple matrix languages. Information and Control 17, 359–394.
Immanuel, S. J. and D. G. Thomas (2016a). New results on two-dimensional jumping finite
automata. International Journal of Pure and Applied Mathematics 109(5), 101–108.
Immanuel, S. J. and D. G. Thomas (2016b). Two-dimensional jumping finite automata. Mathematics
for Applications 5(2), 105–122.
Immanuel, S. J. and D. G. Thomas (2017). Two-dimensional double jumping finite automata.
International Journal of Artificial Intelligence and Soft Computing 6(3), 250–264.
Bibliography 263
Inoue, K., I. Takanami, A. Nakamura, and T. Ae (1979). One-way simple multihead finite automata.
Theoretical Computer Science 9(3), 311–328.
Kasai, T. (1970). A hierarchy between context-free and context-sensitive languages. Journal of
Computer and System Sciences 4, 492–508.
Kleijn, H. C. M. (1983). Selective Substitution Grammars Based on Context-Free Productions. Ph.
D. thesis, Leiden University, Netherlands.
Kleijn, H. C. M. (1987). Basic ideas of selective substitution grammars. In A. Kelemenová and
J. Kelemen (Eds.), Trends, Techniques, and Problems in Theoretical Computer Science, Volume
281 of Lecture Notes in Computer Science, pp. 75–95. Springer.
Kocman, R., Z. Křivka, and A. Meduna (2018). On double-jumping finite automata and their
closure properties. RAIRO-Theor. Inf. Appl. 52(2-3-4), 185–199.
Kocman, R., Z. Křivka, A. Meduna, and B. Nagy (2022). A jumping 5′ → 3′ Watson–Crick finite
automata model. Acta Informatica 59(5), 557–584.
Kocman, R., Z. Křivka, and A. Meduna (2016). On double-jumping finite automata. In Eighth
Workshop on Non-Classical Models of Automata and Applications (NCMA 2016), Volume 321
of OCG, pp. 195–210.
Kocman, R. and A. Meduna (2016). On parallel versions of jumping finite automata. In Proc. of
the 2015 Federated Conf. on Softw. Dev. and Object Technol. (SDOT 2015), Volume 511 of
Adv. Intell. Syst. Comput., pp. 142–149. Springer.
Koza, J. R. (1992). Genetic Programming: On the Programming of Computers by Means of Natural
Selection. The MIT Press, Cambridge, Massachusetts.
Kudlek, M., C. Martı́n-Vide, and G. Păun (2000). Toward FMT (formal macroset theory). In
Pre-proceedings of the Workshop on Multiset Processing, pp. 149–158. Curtea de Arges.
Kuperberg, D., L. Pinault, and D. Pous (2019). Cyclic proofs and jumping automata. In Foundations
of Software Technology and Theoretical Computer Science 2019.
Kuske, D. and P. Weigel (2004). The role of the complementarity relation in Watson–Crick automata
and sticker systems. In Developments in Language Theory, Volume 3340 of Lecture Notes in
Computer Science, pp. 272–283. Springer Berlin Heidelberg.
Křivka, Z., J. Kučera, and A. Meduna (2018). Jumping pure grammars. The Computer Jour-
nal 62(1), 30–41.
Křivka, Z., C. Martı́n-Vide, A. Meduna, and K. G. Subramanian (2014, May 28-30). A variant
of pure two-dimensional context-free grammars generating picture languages. In Proceedings
of 16th International Workshop on Combinatorial Image Analysis (IWCIA 2014), Brno, Czech
Republic, pp. 123–133. Springer.
Křivka, Z. and A. Meduna (2015). Jumping grammars. International Journal of Foundations of
Computer Science 26(6), 709–731.
Křivka, Z. and A. Meduna (2021). Scattered context grammars with one non-context-free production
are computationally complete. Fundamenta Informaticae 179(4), 361–384.
Křoustek, J., S. Židek, D. Kolář, and A. Meduna (2011). Scattered context grammars with priority.
International Journal of Advanced Research in Computer Science 2(4), 1–6.
Langer, M. and A. Kelemenová (2012). Positioned agents in eco-grammar systems with border
markers and pure regulated grammars. Kybernetika 48(3), 502–517.
Leupold, P. and A. Meduna (2010). Finitely expandable deep PDAs. In Automata, Formal Lan-
guages and Algebraic Systems: Proceedings of AFLAS 2008, pp. 113–123. Hong Kong Univer-
sity of Scinece and Technology.
Levitina, M. (1972). On some grammars with global productions. Akad. Nauk SSSR Nauchno-Tekhn.
Inform. Ser. 2(3), 32–36.
Loos, R. and B. Nagy (2011). On the concepts of parallelism in biomolecular computing. Triangle
6 (Languages: Bioinspired Approaches), 109–118.
Madejski, G. (2014). Infinite hierarchy of permutation languages. Fundamenta Informaticae 130,
263–274.
Madejski, G. (2016). Jumping and pumping lemmas and their applications. In Proceedings of
NCMA 2016 - 8th Workshop on Non-Classical Models of Automata and Applications, pp.
25–34.
264 Bibliography
Rozenberg, G. and A. Salomaa (Eds.) (1997b). Handbook of Formal Languages, Vol. 2: Linear
Modeling: Background and Application. Springer, New York.
Russell, S. and P. Norvig (2002). Artificial Intelligence: A Modern Approach (2nd ed.). Prentice-
Hall, New Jersey.
Salomaa, A. (1973). Formal Languages. Academic Press, London.
Shaull, A. and Y. Omer (2023). Jumping automata over infinite words. In F. Drewes and M. Volkov
(Eds.), Developments in Language Theory - 27th International Conference, DLT 2023, Umeå,
Sweden, June 12-16, 2023, Proceedings, Volume 13911 of Lecture Notes in Computer Science,
pp. 9–22. Springer.
Sipser, M. (2006). Introduction to the Theory of Computation (2nd ed.). PWS Publishing Company,
Boston.
Siromoney, R. (1971). Finite-turn checking automata. Journal of Computer and System Sciences 5,
549–559.
Siromoney, R. and K. Krithivasan (1974). Parallel context-free languages. Information and Con-
trol 24(2), 155–162.
Skyum, S. (1974). Parallel context-free languages. Information and Control 26(3), 280–285.
Subramanian, K., S. Hemalatha, and I. Venkat (2012). On Watson–Crick automata. In Proceedings
of the Second International Conference on Computational Science, Engineering and Information
Technology, CCSEIT ’12, New York, NY, USA, pp. 151–156. Association for Computing
Machinery.
Ďuriš, P. and J. Hromkovič (1983). One-way simple multihead finite automata are not closed under
concatenation. Theoretical Computer Science 27(1), 121–125.
Vollweiler, M. and F. Otto (2014). Systems of parallel communicating restarting automata. RAIRO -
Theoretical Informatics and Applications - Informatique Théorique et Applications 48(1), 3–22.
Vorel, V. (2016). Two results on discontinuous input processing. In Descriptional Complex. of
Form. Syst. (DCFS 2016), Volume 9777 of LNCS, pp. 205–216. Springer.
Vorel, V. (2017). Two results on discontinuous input processing. Journal of Automata, Languages
and Combinatorics 22(1–3), 189–203.
Vorel, V. (2018). On basic properties of jumping finite automata. International Journal of Foun-
dations of Computer Science 29(1), 1–15.
Wang, Q. and Y. Li (2018). Jumping restarting automata. In Tenth Workshop on Non-Classical
Models of Automata and Applications, NCMA 2018, Volume 332 of [email protected], pp. 181–196.
Osterreichische Computer Gesellschaft.
Wood, D. (1973). Properties of 𝑛-parallel finite state languages. Utilitas Mathematica 4, 103–113.
Wood, D. (1975). 𝑚-parallel 𝑛-right linear simple matrix languages. Utilitas Mathematica 8, 3–28.
Wood, D. (1977). 𝑛-linear simple matrix languages and 𝑛-parallel linear languages. Rev. Roum. de
Math. Pures et Appl., 408–412.
Wood, D. (1987). Theory of Computation: A Primer. Addison-Wesley, Boston.
Yen, H.-C. (2016). Petri nets and semilinear sets (extended abstract). In A. Sampaio and F. Wang
(Eds.), Theoretical Aspects of Computing – ICTAC 2016, Cham, pp. 25–29. Springer Interna-
tional Publishing.
Indices
The rest of this book contains two indices to help the reader with a quick orientation
in the text. First, it gives the index to major language families together with their
symbolic denotation. This index is followed by the subject index, which closes the
entire text.
267
268 Indices
This index includes the basic versions of all key language families used in the book
while excluding their special versions, which are to be found (nearly or exactly)
on the same page as the basic versions and which are usually distinguished by
subscripts appended to the basic version denotation. For instance, the index includes
JFA, which denotes the family accepted by JFAs defined on page 39, but it excludes
JFA− 𝜀 , which denotes the family accepted by JFAs without 𝜀-rules defined on
page 39.
271
272 Subject Index
unrestricted, 29 regular, 32
graph, 12 right-linear, 32
acyclic, 13 simply expandable, 70
directed, 12 unary, 40, 192, 194, 200, 203, 226,
transition, 38 232
universal, 7
homomorphism, 11 language family, 7
𝜀-free, 11 leaf, 13
left jump, 49
incomparable, xiv left one-way jumping finite
initial automaton, 56
symbol, 86 length, 6
injection, 9 lhs(), 30, 154
input LOWJFA, see left one-way jumping
alphabet, 209 finite automaton
intersection, 6
iteration, see closure macroset, 225
semilinear, 226
JFA, see jumping finite automaton matrix multiset grammars, 230
jump, 37 propagating, 230
jumping 5′ → 3′ Watson–Crick with appearance checking, 230
finite automaton, 106 member, 5
jumping finite automaton, 37 MFA, see finite automaton, multiset
general, 36 mirror image, see reversal
left one-way, 56 move, 23, 209
right one-way, 55 multiset, 222
jumping grammar, 133 multiset linear bounded automaton,
jumping pure grammar, 187 235
jumping relation, 37 with detection, 236
jumping scattered context grammar, multiset Turing machine, 237
155
jumping Watson–Crick finite N, 5, 209
automaton, 97 𝑛-configuration, 87
JWKFA, see jumping Watson–Crick 𝑛-jump, 87
finite automaton right, 88
𝑛-limited direct derivation, 211
Kleene, 44, 46, 58, 258 𝑛-parallel general jumping finite
automaton, 87
label, 30 𝑛-parallel right-linear grammar, 86
language, 7 𝑛-PGJFA, see 𝑛-parallel general
accepted, 24, 210 jumping finite automaton
context-free, 31 𝑛-PRLG, see 𝑛-parallel right-linear
context-sensitive, 31 grammar
generated, 154, 212 0 N, 5
linear, 32 natural number, see N
recursively enumerable, 30 net, 239
274 Subject Index
occur, 7 range, 9
ordered pair, 9 reachable state, 38
relation, 9
P/T Petri net, 239 binary, 9
parallel finite, 9
right-linear grammar, 86 infinite, 9
parallelism symmetric, 10
reversal, 7
behavior-changing (P.3), 63
rewriting system, 16
cooperating (PA.2), 65
rhs(), 30, 154
independent (PA.1), 65
right jump, 50, 88
power-increasing (P.1), 63
right one-way jumping finite
work-distributing (P.2), 64
automaton, 55
parent, 13
ROWJFA, see right one-way
Parikh image, 8
jumping finite automaton
Parikh mapping, 229
rule, 3, 30, 86, 154, 209
Parikh vector, 8, 112, 224
inference, 3
path, 12
of depth 𝑚, 209
PCFG, see pure context-free
permutation, 240
grammar
PDA, see pushdown automaton scattered context
perm, 8 language, 154
PG, see pure grammar scattered context grammar, 154
pop of pushdown, 209 SCG, see scattered context grammar
power set, 6 SEL, see language, simply
prefix, 8 expandable
proper, 8 semi-Dyck language, 31, 100, 134
product, 10 semilinear language, 146
production rule, 30 semilinear macroset, 226
projection, 8 semilinear set, 8
proof, 3 sensing 5′ → 3′ Watson–Crick finite
propagating automaton with jumping
scattered context feature, 105
grammar, 154 sentence, 30
language, 155 sentential form, 30
pumping lemma, 41, 58, 198, 250 sequence, 6
pure context-free grammar, 188 empty, 6
pure grammar, 187 set, 5
pushdown finite, 5
Subject Index 275