0% found this document useful (0 votes)
30 views293 pages

Jumping Computation Updating Automata and Grammars for Discontinuous

The document discusses 'Jumping Computation: Updating Automata and Grammars for Discontinuous Information Processing,' which explores the theoretical aspects of jumping automata and grammars, their properties, and practical applications in modern computation. It adapts classical models to address contemporary information processing methods that involve 'jumping' over data, providing a systematic understanding of this computation style. The authors, Alexander Meduna and Zbyněk Křivka, are established experts in the field, contributing to the theoretical foundations and practical implications of these models.

Uploaded by

Jayme Santos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views293 pages

Jumping Computation Updating Automata and Grammars for Discontinuous

The document discusses 'Jumping Computation: Updating Automata and Grammars for Discontinuous Information Processing,' which explores the theoretical aspects of jumping automata and grammars, their properties, and practical applications in modern computation. It adapts classical models to address contemporary information processing methods that involve 'jumping' over data, providing a systematic understanding of this computation style. The authors, Alexander Meduna and Zbyněk Křivka, are established experts in the field, contributing to the theoretical foundations and practical implications of these models.

Uploaded by

Jayme Santos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 293

Jumping Computation

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

Alexander Meduna and Zbyněk Křivka


Designed cover image: Shutterstock
First edition published 2024
by CRC Press
2385 NW Executive Center Drive, Suite 320, Boca Raton FL 33431

and by CRC Press


4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN

CRC Press is an imprint of Taylor & Francis Group, LLC

© 2024 Alexander Meduna and Zbyněk Křivka

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.

ISBN: 978-0-367-62093-6 (hbk)


ISBN: 978-0-367-63479-7 (pbk)
ISBN: 978-1-003-10791-0 (ebk)

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

2 Automata and Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15


2.1 Language Models of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3 Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Part II Jumping Automata

3 Jumping One-Head Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35


3.1 Basic and Generalized Jumping Finite Automata . . . . . . . . . . . . . . . . 36
3.2 One-Way Jumping Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

4 Jumping Multi-Head Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61


4.1 Double-Jumping Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.2 Multi-Parallel Jumping Finite Automata . . . . . . . . . . . . . . . . . . . . . . . . 85
4.3 Jumping Watson–Crick Finite Automata . . . . . . . . . . . . . . . . . . . . . . . 95
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata . . . . . . . . . . . . . . . . 101

vii
viii Contents

Part III Jumping Grammars

5 Sequential Jumping Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131


5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.2 Definitions and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

6 Parallel Jumping Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151


6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

7 Pure Jumping Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185


7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
7.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
7.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

Part IV Conclusion

8 Other Models of Discontinuous Computation . . . . . . . . . . . . . . . . . . . . . . 207


8.1 Deep Pushdown Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
8.2 Computation over Unordered Strings . . . . . . . . . . . . . . . . . . . . . . . . . . 221
8.3 Permutation Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

9 Remarks on Applications and Their Perspectives . . . . . . . . . . . . . . . . . . 243


9.1 Jumping Automata Used as Language-Defining Devices . . . . . . . . . . 243
9.2 Jumping Grammars Used as Models of DNA Computation . . . . . . . . 247
9.3 Theoretically Oriented Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

10 Summary and Bibliographical Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . 255


Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

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.

Organization and Coverage

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

Y be two language families. A double line between them means X = Y. A dash-


dotted line between X and Y says that X and Y are incomparable—that is, X ⊈ Y,
Y ⊈ X, and Y ∩ X ≠ ∅. If there is a solid arrow leading from Y to X, then Y ⊂ X,
and if this arrow is dashed, then Y ⊆ X with Y ⊂ X representing an open problem.
To illustrate these conventions, consider this figure

A B

C D

E F

where A, B, C, D, E, and F are language families. The diagrammatic conventions


given above imply that E and F are incomparable, A = B, C ⊆ A, D ⊂ B, F ⊂ C,
F ⊆ D, E ⊂ C, which imply D ⊂ A, E ⊂ A, E ⊂ B, and C ⊆ B. By no means,
however, these diagramatic family relationships are covered exhausively in any way.
For instance, in the figure above, the relationship between D and E is simply left out
without claiming their comparability or incomparability.

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

• The essentials of jumping computational models: Chapters 1, 2, 3, 5, 8, and 9.


• Jumping automata: Chapters 1, 2, 3, 4, 8, and automaton-related applications in
Chapter 9.
• Jumping grammars: Chapters 1, 2, 5, 6, 7, 8, and grammar-related applications
in Chapter 9.
Nevertheless, in the authors’ opinion, a full one-term graduate-level course cov-
ering the book in its entirety is the most appropriate way of using it as a textbook.
Finally, at any educational level, the serious student may find this book helpful
as an accompanying text for any discussion related to formal languages and their
models.

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

We wish to acknowledge our indebtedness to several people for their assistance in


various aspects of this book. The text is partially based upon the dissertations by
Radim Kocman and Jiřı́ Kučera, Alexander Meduna’s former PhD students, who
provided them to us. Martin Tomko made a significant portion of Chapter 8 for us,
and he brought our attention to a number of studies related to that chapter. The painful
task of creating the figures, tables, and indices was largely performed in an excellent
fashion by Dominik Nejedlý. Many more students, friends, and colleagues—too
many to name them all—have contributed a good deal to the production of this book,
both by setting us thinking about questions concerning its subject and by helping
us to see the answers. We are also grateful to Acquiring Editor, Elliott Morsia and
Editorial Assistant, Talitha Duncan-Todd at CRC Press for their encouragement and
patience when we failed to meet deadline after deadline. To all of the above, we
render our thanks.
In addition, this work was supported by two grants—namely, Brno University of
Technology grants FIT-S-20-6293 and FIT-S-23-8209.

Brno, Czech Republic Alexander Meduna


June 2023 Zbyněk Křivka

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

𝑠1 𝑠2 𝑠1 ∧ 𝑠2 𝑠1 ∨ 𝑠2 𝑠1 implies 𝑠2 𝑠1 if and only if 𝑠2


0 0 0 0 1 1
0 1 0 1 1 0
1 0 0 1 0 0
1 1 1 1 1 1

Fig. 1.1 Truth table.

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).

1.2 Sets and Languages

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.

A finite set, Σ, is customarily specified by listing its members; that is, Σ =


{𝑎 1 , 𝑎 2 , . . . , 𝑎 𝑛 } where 𝑎 1 through 𝑎 𝑛 are all members of Σ; as a special case, we
have {} = ∅. An infinite set, Ω, is usually specified by a property, 𝑝, so that Ω
contains all elements satisfying 𝑝; in symbols, this specification has the general
format Ω = {𝑎 | 𝑝(𝑎)}. Sets whose members are other sets are usually called families
of sets rather than sets of sets.
Let Σ and Ω be two sets. Σ is a subset of Ω, symbolically written as Σ ⊆ Ω, if
each member of Σ also belongs to Ω. Σ is a proper subset of Ω, written as Σ ⊂ Ω, if
Σ ⊆ Ω and Ω contains an element that is not in Σ. To express that 𝐴 is not included
in 𝐵, write 𝐴 ⊈ 𝐵. If Σ ⊆ Ω and Ω ⊆ Σ, Σ equals Ω, denoted by Σ = Ω. The power
set of Σ, denoted by power(Σ), is the set of all subsets of Σ.
For two sets, Σ and Ω, their union, intersection, and difference are denoted by
Σ ∪ Ω, Σ ∩ Ω, and Σ − Ω, respectively, and defined as Σ ∪ Ω = {𝑎 | 𝑎 ∈ Σ or 𝑎 ∈ Ω},
Σ ∩ Ω = {𝑎 | 𝑎 ∈ Σ and 𝑎 ∈ Ω}, and Σ − Ω = {𝑎 | 𝑎 ∈ Σ and 𝑎 ∉ Ω}. If Σ is a set over
a universe 𝑈, the complement of Σ is denoted by ∼ Σ and defined as ∼ Σ = 𝑈 − Σ.
The operations of union, intersection, and complement are related by De Morgan’s
laws stating that ∼ (∼ Σ∪ ∼ Ω) = Σ ∩ Ω and ∼ (∼ Σ∩ ∼ Ω) = Σ ∪ Ω, for any two sets
Σ and Ω. If Σ ∩ Ω = ∅, Σ and Ω are disjoint. More generally, 𝑛 sets Σ1 , Σ2 , . . . , Σ𝑛 ,
where 𝑛 ≥ 2, are pairwise disjoint if Σ𝑖 ∩ Σ 𝑗 = ∅ for all 1 ≤ 𝑖, 𝑗 ≤ 𝑛 such that 𝑖 ≠ 𝑗.
A sequence is a list of elements from some universe. A sequence is finite if it
consists of finitely many elements; otherwise, it is infinite. The length of a finite
sequence 𝑥, denoted by |𝑥|, is the number of elements in 𝑥. The empty sequence,
denoted by 𝜀, is the sequence consisting of no element; that is, |𝜀| = 0. For brevity,
finite sequences are specified by listing their elements throughout. For instance,
(0, 1, 0, 0) is shortened to 0100; notice that |0100| = 4.

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

is a subalphabet of Σ. A finite sequence of symbols from Σ is a string over Σ;


specifically, 𝜀 is referred to as the empty string—that is, the string consisting of
zero symbols. By Σ∗ , we denote the set of all strings over Σ; Σ+ = Σ∗ − {𝜀}. Let
𝑥 ∈ Σ∗ . Like for any sequence, |𝑥| denotes the length of 𝑥—that is, the number
of symbols in 𝑥. For any 𝑎 ∈ Σ, occur(𝑥, 𝑎) denotes the number of occurrences
of 𝑎s in 𝑥, so Íoccur(𝑥, 𝑎) always satisfies 0 ≤ occur(𝑥, 𝑎) ≤ |𝑥|. Let 𝐴 ⊆ Σ, set
occur(𝑥, 𝐴) = 𝑎∈ 𝐴 occur(𝑥, 𝑎). Furthermore, if 𝑥 ≠ 𝜀, symbol(𝑥, 𝑖) denotes the 𝑖th
symbol in 𝑥, where 1 ≤ 𝑖 ≤ |𝑥|. Any subset 𝐿 ⊆ Σ∗ is a formal language or, briefly, a
language over Σ. Set symbol(𝐿, 𝑖) = {𝑎|𝑎 = symbol(𝑥, 𝑖), 𝑥 ∈ 𝐿−{𝜀}, 1 ≤ 𝑖 ≤ |𝑥|}.
Any subset of 𝐿 is a sublanguage of 𝐿. If 𝐿 represents a finite set of strings, 𝐿 is
a finite language; otherwise, 𝐿 is an infinite language. For instance, Σ∗ , which is
called the universal language over Σ, is an infinite language while ∅ and {𝜀} are
finite; noteworthy, ∅ ≠ {𝜀} as card(∅) = 0 ≠ card({𝜀}) = 1. Sets whose members
are languages are called families of languages.

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.

Let 𝑥, 𝑦 ∈ Σ∗ be two strings over an alphabet Σ, and let 𝐿, 𝐾 ⊆ Σ∗ be two


languages over Σ. As languages are defined as sets, all set operations apply to them.
Specifically, 𝐿 ∪ 𝐾, 𝐿 ∩ 𝐾, and 𝐿 − 𝐾 denote the union, intersection, and difference
of languages 𝐿 and 𝐾, respectively. Perhaps most importantly, the concatenation of
𝑥 with 𝑦, denoted by 𝑥𝑦, is the string obtained by appending 𝑦 to 𝑥. Notice that for
every 𝑤 ∈ Σ∗ , 𝑤𝜀 = 𝜀𝑤 = 𝑤. The concatenation of 𝐿 and 𝐾, denoted by 𝐿𝐾, is
defined as 𝐿𝐾 = {𝑥𝑦 | 𝑥 ∈ 𝐿, 𝑦 ∈ 𝐾 }.
Apart from binary operations, we also make some unary operations with strings
and languages. Let 𝑥 ∈ Σ∗ and 𝐿 ⊆ Σ∗ . The complement of 𝐿 is denoted by
∼ 𝐿 and defined as ∼ 𝐿 = Σ∗ − 𝐿. The reversal of 𝑥, denoted by reversal(𝑥),
is 𝑥 written in the reverse order, and the reversal of 𝐿, reversal(𝐿), is defined as
reversal(𝐿) = {reversal(𝑥) | 𝑥 ∈ 𝐿}. For all 𝑖 ≥ 0, the 𝑖th power of 𝑥, denoted by 𝑥 𝑖 ,
is recursively defined as (1) 𝑥 0 = 𝜀, and (2) 𝑥 𝑖 = 𝑥𝑥 𝑖−1 , for 𝑖 ≥ 1. Observe that this
definition is based on the recursive definitional method. To demonstrate the recursive
aspect, consider, for instance, the 𝑖th power of 𝑥 with 𝑖 = 3. By the second part of the
8 1 Mathematical Background

definition, 𝑥 3 = 𝑥𝑥 2 . By applying the second part to 𝑥 2 again, 𝑥 2 = 𝑥𝑥 1 . By another


application of this part to 𝑥 1 , 𝑥 1 = 𝑥𝑥 0 . By the first part of this definition, 𝑥 0 = 𝜀.
Thus, 𝑥 1 = 𝑥𝑥 0 = 𝑥𝜀 = 𝑥. Hence, 𝑥 2 = 𝑥𝑥 1 = 𝑥𝑥. Finally, 𝑥 3 = 𝑥𝑥 2 = 𝑥𝑥𝑥. By using
this recursive method, we frequently introduce new notions, including the 𝑖th power
of 𝐿, 𝐿 𝑖 , which is defined as (1) 𝐿 0 = 𝜀 and (2) 𝐿 𝑖 = 𝐿𝐿 𝑖1 , for 𝑖 ≥ 1. The closure
of 𝐿, 𝐿 ∗ , is defined as 𝐿 ∗ = 𝐿 0 ∪ 𝐿 1 ∪ 𝐿 2 ∪ · · · , and the positive closure of 𝐿, 𝐿 + , is
defined as 𝐿 + = 𝐿 1 ∪ 𝐿 2 ∪ · · · . Notice that 𝐿 + = 𝐿𝐿 ∗ = 𝐿 ∗ 𝐿, and 𝐿 ∗ = 𝐿 + ∪ {𝜀}. Let
𝑤, 𝑥, 𝑦, 𝑧 ∈ Σ∗ . If 𝑥𝑧 = 𝑦, then 𝑥 is a prefix of 𝑦; if in addition, 𝑥 ∉ {𝜀, 𝑦}, 𝑥 is a proper
prefix of 𝑦. By prefixes(𝑦), we denote the set of all prefixes of y. Set prefixes(𝐿) =
{𝑥 | 𝑥 ∈ prefixes(𝑦) for some 𝑦 ∈ 𝐿}. For 𝑖 = 0, . . . , |𝑦|, prefix(𝑦, 𝑖) denotes 𝑦’s
prefix of length 𝑖; notice that prefix(𝑦, 0) = 𝜀 and prefix(𝑦, |𝑦|) = 𝑦. If 𝑧𝑥 = 𝑦, 𝑥 is a
suffix of 𝑦; if in addition, 𝑥 ∉ {𝜀, 𝑦}, 𝑥 is a proper suffix of 𝑦. By suffixes(𝑦), we denote
the set of all suffixes of 𝑦. Set suffixes(𝐿) = {𝑥 | 𝑥 ∈ suffixes(𝑦) for some 𝑦 ∈ 𝐿}. For
𝑖 = 0, . . . , |𝑦|, suffix(𝑦, 𝑖) denotes 𝑦’s suffix of length 𝑖. If 𝑤𝑥𝑧 = 𝑦, 𝑥 is a substring
of 𝑦; if in addition, 𝑥 ∉ {𝜀, 𝑦}, 𝑥 is a proper substring of 𝑦. By substrings(𝑦), we
denote the set of all substrings of 𝑦. Observe that for all 𝑣 ∈ Σ∗ , prefixes(𝑣) ⊆
substrings(𝑣), suffixes(𝑣) ⊆ substrings(𝑣), and {𝜀, 𝑣} ⊆ prefixes(𝑣) ∩ suffixes(𝑣) ∩
substrings(𝑣). Set symbols(𝑦) = {𝑎 | 𝑎 ∈ substrings(𝑦), |𝑎| = 1}. Furthermore, set
substrings(𝐿) = {𝑥 | 𝑥 ∈ substrings(𝑦) for some 𝑦 ∈ 𝐿} and symbols(𝐿) = {𝑎 | 𝑎 ∈
symbols(𝑦) for some 𝑦 ∈ 𝐿}.
Let 𝑤 ∈ Σ∗ with Σ = {𝑎 1 , . . . , 𝑎 𝑛 }. We define Parikh vector or Parikh image of
𝑤 by 𝜓 Σ (𝑤) = (occur(𝑤, 𝑎 1 ), occur(𝑤, 𝑎 2 ), . . . , occur(𝑤, 𝑎 𝑛 )). A set of vectors is
called semilinear
Í𝑚 if it can be represented as a union of a finite number of sets of the
form {𝑣 0 + 𝑖=1 𝛼𝑖 𝑣 𝑖 |𝛼𝑖 ∈ N, 1 ≤ 𝑖 ≤ 𝑚}, where 𝑣 𝑖 for 0 ≤ 𝑖 ≤ 𝑚 is an 𝑛-dimensional
vector. A language 𝐿 ⊆ Σ∗ is called semilinear if the set 𝜓 Σ (𝐿) = {𝜓 Σ (𝑤) | 𝑤 ∈ 𝐿}
is a semilinear set. A language family is semilinear if all its languages are semilinear.
The shuffle operation, denoted by , is defined by 𝑢 𝑣 = {𝑥1 𝑦 1 𝑥 2 𝑦 2 · · · 𝑥 𝑛 𝑦 𝑛 | 𝑢 =
E

𝑥1 𝑥 2 · · · 𝑥 𝑛 , 𝑣 = 𝑦 1 𝑦 2 · · · 𝑦 𝑛 , 𝑥𝑖 , 𝑦 𝑖 ∈ Σ∗ , 1 ≤ 𝑖 ≤ 𝑛, 𝑛 ≥ Ð
1}, where 𝑢, 𝑣 ∈ Σ∗ . Fur-
thermore, for languages 𝐿 1 and 𝐿 2 over Σ, set 𝐿 1 𝐿 2 = 𝑢∈ 𝐿1 , 𝑣 ∈ 𝐿2 (𝑢 𝑣 ).
E

For a string 𝑤 over an alphabet Σ, the set perm(𝑤) of all permutations of 𝑤


is inductively defined as follows: (1) perm(𝜀) = {𝜀} and, for every 𝑎 ∈ Σ and
𝑢 ∈ Σ∗ , perm(𝑎𝑢) = {𝑎} perm(𝑢). For a language 𝐿 over alphabet Σ, perm(𝐿) =
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}.

1.3 Relations and Translations

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

Convention 1.4 Let 𝜌 ⊆ 𝐴 × 𝐵 be a relation. To express that (𝑎, 𝑏) ∈ 𝜌, we usually


write 𝑎𝜌𝑏. If 𝜌 represents a function, we often write 𝜌(𝑎) = 𝑏 instead of 𝑎𝜌𝑏. If
𝜌(𝑎) = 𝑏, 𝑏 is the value of 𝜌 for argument 𝑎.

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 ···
.. .. .. .. ..
. . . . .

Fig. 1.2 Diagonalization.

Let 𝐴 be a set, 𝜌 be a relation on 𝐴, and 𝑎, 𝑏 ∈ 𝐴. For 𝑘 ≥ 0, the 𝑘-fold product


of 𝜌, 𝜌 𝑘 , is recursively defined as (1) 𝑎𝜌 0 𝑏 iff 𝑎 = 𝑏, and (2) 𝑎𝜌 𝑘 𝑏 iff there exists
𝑐 ∈ 𝐴 such that 𝑎𝜌𝑐 and 𝑐𝜌 𝑘−1 𝑏, for 𝑘 ≥ 1. If for all 𝑎, 𝑏 ∈ 𝐴, 𝑎𝜌𝑏 implies 𝑏𝜌𝑎,
then 𝜌 is symmetric. The transitive closure of 𝜌, 𝜌 + , is defined as 𝑎𝜌 + 𝑏 if and only
1.3 Relations and Translations 11

if 𝑎𝜌 𝑘 𝑏 for some 𝑘 ≥ 1, and the reflexive and transitive closure of 𝜌, 𝜌 ∗ , is defined


as 𝑎𝜌 ∗ 𝑏 if and only if 𝑎𝜌 𝑘 𝑏 for some 𝑘 ≥ 0.
Let 𝑇 and 𝑈 be two alphabets, 𝐾 ⊆ 𝑇 ∗ , and 𝐿 ⊆ 𝑈 ∗ . A relation 𝜏 from 𝑇 ∗ to

𝑈 with domain(𝜏) = 𝐾 and range(𝜏) = 𝐿 is a translation from 𝐾 to 𝐿. Let 𝜎 be
a translation from 𝑇 ∗ to 𝑈 ∗ such that 𝜎 is a total function from 𝑇 ∗ to power(𝑈 ∗ )
satisfying 𝜎(𝑢𝑣) = 𝜎(𝑢)𝜎(𝑣) for every 𝑢, 𝑣 ∈ 𝑇 ∗ ; then, 𝜎 is a substitution from
𝑇 ∗ to 𝑈 ∗ . A total function 𝜑 from 𝑇 ∗ to 𝑈 ∗ such that 𝜑(𝑢𝑣) = 𝜑(𝑢)𝜑(𝑣) for every
𝑢, 𝑣 ∈ 𝑇 ∗ is a homomorphism from 𝑇 ∗ to 𝑈 ∗ ; if 𝜑(𝑎) ≠ 𝜀 for all 𝑎 ∈ 𝑇, 𝜑 is said
to be an 𝜀-free homomorphism. It is worth noting that a homomorphism from 𝑇 ∗
to 𝑈 ∗ does not necessarily represent an injection from 𝑇 ∗ to 𝑈 ∗ as illustrated in
Example 1.6.
Let 𝑇, 𝑈, 𝜎 and 𝜑 have the same meaning as above. Observe that 𝜎 from 𝑇 ∗
to power(𝑈 ∗ ) can be completely and properly specified by defining 𝜎(𝑎) for ev-
ery individual symbol 𝑎 ∈ 𝑇. Indeed, since 𝜎(𝜀) = {𝜀} and 𝜎(𝑎 1 𝑎 2 · · · 𝑎 𝑛 ) =
𝜎(𝑎 1 )𝜎(𝑎 2 ) · · · 𝜎(𝑎 𝑛 ), where 𝑎 𝑖 ∈ 𝑇, 1 ≤ 𝑖 ≤ 𝑛, for some 𝑛 ≥ 1, we can straight-
forwardly obtain 𝜎(𝑤) for all 𝑤 ∈ 𝑇 ∗ . As any homomorphism is obviously a special
case of a substitution, we can specify 𝜑 analogously. In this elegant way, using this
natural extension, we always introduce every new notion of a substitution and a ho-
momorphism throughout this book. In the next example, which illustrates this kind
of introduction, we make it in a tabular way (see Figure 1.3).

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).

Letter 𝜇 Letter 𝜇 Letter 𝜇


𝐴 .– 𝐽 .––– 𝑆 ...
𝐵 –... 𝐾 –.– 𝑇 –
𝐶 –.–. 𝐿 .–.. 𝑈 ..–
𝐷 –.. 𝑀 –– 𝑉 ...–
𝐸 . 𝑁 –. 𝑊 .––
𝐹 ..–. 𝑂 ––– 𝑋 –..–
𝐺 ––. 𝑃 .––. 𝑌 –.––
𝐻 .... 𝑄 ––.– 𝑍 ––..
𝐼 .. 𝑅 .–.

Fig. 1.3 Morse code.

We now slightly modify 𝜇 to 𝜇′ defined as 𝜇′ (𝑎) = 𝜇(𝑎)# for every 𝑎 ∈ Δ, where


# is an extra delimiting symbol out of Δ. Observe that 𝜇′ from Δ∗ to {., –, #}∗ is an
injection. For instance, 𝜇( 𝐴) = 𝜇(𝐸𝑇) but 𝜇′ ( 𝐴) ≠ 𝜇′ (𝐸𝑇).

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.

𝑏 𝑐

Fig. 1.4 Graph of 𝐺.

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
𝑑

Fig. 1.5 Labeled graph of 𝐺.

Let 𝐺 = ( 𝐴, 𝜌) be a graph. 𝐺 is an acyclic graph if it contains no cycle. If


(𝑎 0 , 𝑎 1 , . . . , 𝑎 𝑛 ) is a path in 𝐺, then 𝑎 0 is an ancestor of 𝑎 𝑛 and 𝑎 𝑛 is a descendant of
𝑎 0 ; if in addition, 𝑛 = 1, then 𝑎 0 is a direct ancestor of 𝑎 𝑛 and 𝑎 𝑛 a direct descendant
of 𝑎 0 . A tree is an acyclic graph 𝑇 = ( 𝐴, 𝜌) such that (1) 𝐴 contains a specified node
called the root of 𝑇 and denoted by root(𝑇), and (2) for every 𝑎 ∈ 𝐴 − {root(𝑇)}, 𝑎
is a descendant of root(𝑇) and the in-degree of 𝑎 is one. If 𝑎 ∈ 𝐴 is a node whose
out-degree is 0, 𝑎 is a leaf ; otherwise, it is an interior node. In this book, a tree 𝑇 is
always considered as an ordered tree in which each interior node 𝑎 ∈ 𝐴 has all its
direct descendants, 𝑏 1 through 𝑏 𝑛 , where 𝑛 ≥ 1, ordered from left to right so that 𝑏 1
is the leftmost direct descendant of 𝑎 and 𝑏 𝑛 is the rightmost direct descendant of 𝑎.
At this point, 𝑎 is the parent of its children 𝑏 1 through 𝑏 𝑛 , and all these nodes together
with the edges connecting them, (𝑎, 𝑏 1 ) through (𝑎, 𝑏 𝑛 ), are called a parent-children
portion of 𝑇. The frontier of 𝑇, denoted by frontier(𝑇), is the sequence of 𝑇’s leaves
ordered from left to right. The depth of 𝑇, depth(𝑇), is the length of the longest path
in 𝑇. A tree 𝑆 = (𝐵, 𝜈) is a subtree of 𝑇 if ∅ ⊂ 𝐵 ⊆ 𝐴, 𝜈 ⊆ 𝜌 ∩ (𝐵 × 𝐵), and in 𝑇,
no node in 𝐴 − 𝐵 is a descendant of a node in 𝐵; 𝑆 is an elementary subtree of 𝑇 if
depth(𝑆) = 1.
Like any graph, a tree 𝑇 can be described as a two-dimensional structure. To
simplify this description, however, we draw a tree 𝑇 with its root on the top and with
all edges directed down. Each parent has its children drawn from the left to the right
according to its ordering. Drawing 𝑇 in this way, we always omit all arrowheads.
Apart from this two-dimensional representation, however, it is frequently conve-
nient to specify 𝑇 by a one-dimensional representation, denoted by odr(𝑇), in which
each subtree of 𝑇 is represented by the expression appearing inside a balanced pair
of ⟨ and ⟩ with the node which is the root of that subtree appearing immediately to
the left of ⟨. More precisely, odr(𝑇) is defined by the following recursive rules:
(1) If 𝑇 consists of a single node 𝑎, then odr(𝑇) = 𝑎.
(2) Let (𝑎, 𝑏 1 ) through (𝑎, 𝑏 𝑛 ), where 𝑛 ≥ 1, be the parent-children portion of 𝑇,
root(𝑇) = 𝑎, and 𝑇𝑘 be the subtree rooted at 𝑏 𝑘 , 1 ≤ 𝑘 ≤ 𝑛, then odr(𝑇) =
𝑎⟨odr(𝑇1 ) odr(𝑇2 ) · · · odr(𝑇𝑛 )⟩.
14 1 Mathematical Background

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 𝑐⟨𝑑⟩.

𝑏 𝑐 𝑐

𝑑 𝑑

Fig. 1.6 A tree and a subtree.


Chapter 2
Automata and Grammars

Indisputably, the notion of a procedure is central to computation and, consequently,


computer science as a whole. We surely agree that it consists of finitely many
instructions, each of which can be executed mechanically in a fixed amount of
time. When running, it reads input data, executes its instructions, and produces
output data. Nevertheless, apart from understanding this notion intuitively, we need
its formalization in order to obtain a systematized body of mathematically precise
knowledge concerning it. Therefore, the theory of computation has developed an
important field, called formal language theory, which formalizes the notion of a
procedure by a large variety of language models. Despite their diversity, all the
models are uniformly underlain by rewriting systems, which are based upon finitely
many rules according to which they rewrite strings. They all can be classified into
two basic categories—automata and grammars.
Automata define strings of their language by rewriting processes that start from
these strings and end in prescribed special sets of strings, usually called start and
final configurations. They formalize procedures that have only two outputs—“yes”
and “no.” The output “yes” represents a resulting affirmative response to the input,
expressed by stating that the input is accepted. The output “no” means a negative
response to the input, which is said to be rejected. Grammars are language-generating
counterparts to the automata. Instead of accepting strings, they define strings of their
languages by generating them from a special start string. Consequently, as opposed
to automata, they formalize procedures that produce out data without any input.
Section 2.1 introduces rewriting systems in general and explains how to use
them as language models. Section 2.2 define classical types of automata—finite and
pushdown automata—while Section 2.3 covers a broad variety of grammars.

2.1 Language Models of Computation

As already pointed out, computer science customarily formalizes computation by


languages defined by their models in order to explore it in a strictly mathematical way.

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, ℎ(5) = five,


ℎ(1) = one, ℎ(6) = six,
ℎ(2) = two, ℎ(7) = seven,
ℎ(3) = three, ℎ(8) = eight,
ℎ(4) = four, ℎ(9) = nine.

Intuitively speaking, ℎ translates every member of {0, 1, . . . , 9} to its correspond-


ing English name; for instance, ℎ(9) = 𝑛𝑖𝑛𝑒. Based upon ℎ, we define 𝑀 = (Σ, 𝑅)
with Σ = {0, 1, . . . , 9} ∪ Δ ∪ {#} and 𝑅 = {𝑖 → ℎ(𝑖)# | 𝑖 ∈ {0, 1, . . . , 9}}. Consider
ℎ and 𝑅. Define the translation 𝑇 (𝑀) from {0, 1, . . . , 9}∗ to (Δ ∪ {#}) ∗ as

𝑇 (𝑀) = {(𝑠1 · · · 𝑠 𝑛 , 𝑡1 · · · 𝑡 𝑛 ) | for all 1 ≤ 𝑗 ≤ 𝑛, (𝑠 𝑗 , 𝑡 𝑗 ) ∈ 𝑅, 𝑛 ≥ 0}

Notice that 𝑇 (𝑀) contains

(𝜀, 𝜀), (0, zero#), (1, one#), . . . , (9, nine#), (00, zero#zero#), (01, zero#one#), . . .

For instance, since (911, 𝑛𝑖𝑛𝑒#𝑜𝑛𝑒#𝑜𝑛𝑒#) ∈ 𝑇 (𝑀), 911 is translated to string


𝑛𝑖𝑛𝑒#𝑜𝑛𝑒#𝑜𝑛𝑒#. Thus, 𝑀 performs the desired translation.
2.1 Language Models of Computation 17

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.

For instance, 𝑀 changes ⟨𝑥𝑥𝑢𝑦⟩ to 𝑢𝑥𝑥𝑦.


Let Δ have the same meaning as in Example 2.1—that is, Δ denotes the alphabet
of English lowercases. Let < denote the standardly defined lexical order over Δ—that
is,
𝑎<𝑏<𝑐<...<𝑦<𝑧
We define 𝑀 = (Σ, 𝑅) with Σ = Δ ∪ {⟨, ⟩, 1, 2, 3} and 𝑅 containing the following
rules:
1. ⟨ → 12, 12 → 3;
2. 2𝛼 → 𝛼2 and 𝛼2 → 2𝛼 for all 𝛼 ∈ Δ;
3. 𝛽2𝛼 → 𝛼2𝛽 for all 𝛼, 𝛽 ∈ Δ such that 𝛼 < 𝛽;
4. 3𝛼𝛽 → 𝛼3𝛽 for all 𝛼, 𝛽 ∈ Δ such that 𝛼 < 𝛽 or 𝛼 = 𝛽;
5. 3𝛼⟩ → 𝛼 for all 𝛼 ∈ Δ.
Define the translation 𝑜 over Δ∗ by this equivalence

(𝑢, 𝑣) ∈ 𝑜 if and only if 𝑢 = 𝑤𝑥𝑧, 𝑣 = 𝑤𝑦𝑧, and 𝑥 → 𝑦 ∈ 𝑅, where 𝑢, 𝑣, 𝑤, 𝑥, 𝑦, 𝑧 ∈ Δ∗

Based on 𝑜, define the translation 𝑇 (𝑀) from {⟨}Δ+ {⟩} to Δ+ as

(⟨𝑥⟩, 𝑦) ∈ 𝑇 (𝑀) if and only if (⟨𝑥⟩, 𝑦) ∈ 𝑜∗


where 𝑥, 𝑦 ∈ Δ+ and as usual, 𝑜 ∗ is the transitive and reflexive closure of 𝑜 (see
Section 1.3).
Considering 𝑀 defined in this way, observe that (⟨𝑠⟩, 𝑡) ∈ 𝑇 (𝑀) if and only if 𝑡
is a permutation of 𝑠 such that 𝑡 has its letters lexicographically ordered according
to <. For instance, 𝑇 (𝑀) contains (⟨𝑜𝑟𝑑𝑒𝑟⟩, 𝑑𝑒𝑜𝑟𝑟) because
18 2 Automata and Grammars

(⟨𝑜𝑟𝑑𝑒𝑟⟩ , 12𝑜𝑟 𝑑𝑒𝑟⟩) ∈ 𝑜 because ⟨ → 12 ∈ 𝑅;


(12𝑜𝑟𝑑𝑒𝑟⟩ , 1𝑜2𝑟 𝑑𝑒𝑟⟩) ∈ 𝑜 because 2𝑜 → 𝑜2 ∈ 𝑅;
(1𝑜2𝑟𝑑𝑒𝑟⟩ , 1𝑜𝑟2𝑑𝑒𝑟⟩) ∈ 𝑜 because 2𝑟 → 𝑟2 ∈ 𝑅;
(1𝑜𝑟2𝑑𝑒𝑟⟩ , 1𝑜𝑑2𝑟𝑒𝑟⟩) ∈ 𝑜 because 𝑟2𝑑 → 𝑑2𝑟 ∈ 𝑅;
(1𝑜𝑑2𝑟𝑒𝑟⟩ , 1𝑜𝑑𝑟2𝑒𝑟⟩) ∈ 𝑜 because 2𝑟 → 𝑟2 ∈ 𝑅;
(1𝑜𝑑𝑟2𝑒𝑟⟩ , 1𝑜𝑑𝑒2𝑟𝑟⟩) ∈ 𝑜 because 𝑟2𝑒 → 𝑒2𝑟 ∈ 𝑅;
(1𝑜𝑑𝑒2𝑟𝑟⟩ , 1𝑜𝑑2𝑒𝑟𝑟⟩) ∈ 𝑜 because 𝑒2 → 2𝑒 ∈ 𝑅;
(1𝑜𝑑2𝑒𝑟𝑟⟩ , 1𝑜2𝑑𝑒𝑟𝑟⟩) ∈ 𝑜 because 𝑑2 → 2𝑑 ∈ 𝑅;
(1𝑜2𝑑𝑒𝑟𝑟⟩ , 1𝑑2𝑜𝑒𝑟𝑟⟩) ∈ 𝑜 because 𝑜2𝑑 → 𝑑2𝑜 ∈ 𝑅;
(1𝑑2𝑜𝑒𝑟𝑟⟩ , 1𝑑𝑜2𝑒𝑟𝑟⟩) ∈ 𝑜 because 2𝑜 → 𝑜2 ∈ 𝑅;
(1𝑑𝑜2𝑒𝑟𝑟⟩ , 1𝑑𝑒2𝑜𝑟𝑟⟩) ∈ 𝑜 because 𝑜2𝑒 → 𝑒2𝑜 ∈ 𝑅;
(1𝑑𝑒2𝑜𝑟𝑟⟩ , 1𝑑2𝑒𝑜𝑟𝑟⟩) ∈ 𝑜 because 𝑒2 → 2𝑒 ∈ 𝑅;
(1𝑑2𝑒𝑜𝑟𝑟⟩ , 12𝑑𝑒𝑜𝑟𝑟⟩) ∈ 𝑜 because 𝑑2 → 2𝑑 ∈ 𝑅;
(12𝑑𝑒𝑜𝑟𝑟⟩ , 3𝑑𝑒𝑜𝑟𝑟⟩) ∈ 𝑜 because 12 → 3 ∈ 𝑅;
(3𝑑𝑒𝑜𝑟𝑟⟩ , 𝑑3𝑒𝑜𝑟𝑟⟩) ∈ 𝑜 because 3𝑑𝑒 → 𝑑3𝑒 ∈ 𝑅;
(𝑑3𝑒𝑜𝑟𝑟⟩ , 𝑑𝑒3𝑜𝑟𝑟⟩) ∈ 𝑜 because 3𝑒𝑜 → 𝑒3𝑜 ∈ 𝑅;
(𝑑𝑒3𝑜𝑟𝑟⟩ , 𝑑𝑒𝑜3𝑟𝑟⟩) ∈ 𝑜 because 3𝑜𝑟 → 𝑜3𝑟 ∈ 𝑅;
(𝑑𝑒𝑜3𝑟𝑟⟩ , 𝑑𝑒𝑜𝑟3𝑟⟩) ∈ 𝑜 because 3𝑟𝑟 → 𝑟3𝑟 ∈ 𝑅;
(𝑑𝑒𝑜𝑟3𝑟⟩ , 𝑑𝑒𝑜𝑟𝑟) ∈ 𝑜 because 3𝑟⟩ → 𝑟 ∈ 𝑅.

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

Furthermore, observe that 𝑥 ⇒∗ 𝑦, in effect, represents a step-by-step process


that 𝑀 makes according to its rules. If this process starts with 𝑥 ∈ 𝐿 S and ends with
𝑦 ∈ 𝐿 F , 𝑀 defines a string from its language. If this is the case, used as a grammar,
𝑀 generates 𝜋 Δ (𝑦), and used as an automaton, 𝑀 accepts 𝜋 Δ (𝑥).
The language defined by 𝑀 is denoted by 𝐿(𝑀), but of course, we always have
to explicitly state whether 𝑀 is considered as a grammar or as an automaton.
Based upon this basic definition, we introduce most notions of grammars and
automata later in the text. Whenever some of their parts, such as start and final
languages, are automatically understood and, therefore, any confusion is ruled out,
we omit them in order to keep this text as readable as possible.
Since the rewriting relation usually depends on a specific rule from 𝑅, we some-
times express which exact rule is used in a rewriting step.
Convention 2.2 To explicitly express that 𝑟 ∈ 𝑅 is used in a rewriting step 𝑥 ⇒ 𝑦 in
𝑀, we write 𝑥 ⇒ 𝑦 [𝑟].

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

𝐿(𝑀)𝑔𝑒𝑛 = {𝑠𝑡 | # ⇒∗𝑔𝑒𝑛 𝑠𝑡, 𝑠, 𝑡 ∈ Δ∗ }


For instance, # ⇒𝑔𝑒𝑛 𝑛#𝑛 ⇒𝑔𝑒𝑛 𝑛𝑜#𝑜𝑛 ⇒𝑔𝑒𝑛 𝑛𝑜𝑜𝑛 in 𝑀, so 𝜋 Δ (𝑛𝑜𝑜𝑛) =
𝑛𝑜𝑜𝑛 ∈ 𝐿(𝑀)𝑔𝑒𝑛 .
Second, we accept 𝐿 by 𝑀. We introduce 𝑅 = {𝑎#𝑎 → # | 𝑎 ∈ Δ} ∪ {𝜀 → #}
and the rewriting relation ⇒𝑎𝑐𝑐 over Σ∗ so that for every 𝑢, 𝑣 ∈ Σ∗ , 𝑢 ⇒𝑎𝑐𝑐 𝑣 if and
only if 𝑢 = 𝑤𝑥𝑧, 𝑣 = 𝑤𝑦𝑧, and 𝑥 → 𝑦 ∈ 𝑅. In case of language-accepting rewriting
system, consider 𝐿 S = Δ∗ {#}Δ∗ and 𝐿 F = {#}. Then, we denote the language
accepted by 𝑀 as 𝐿(𝑀) 𝑎𝑐𝑐 and define it as

𝐿(𝑀) 𝑎𝑐𝑐 = {𝑠𝑡 | 𝑠#𝑡 ⇒∗𝑎𝑐𝑐 #, 𝑠, 𝑡 ∈ Δ∗ }


To verify 𝐿 (𝑀) 𝑎𝑐𝑐 = 𝐿, take any 𝛼 ∈ ({#} ∪ Δ) ∗ . Assume that 𝛼 contains two or
more #s; observe that under this assumption, 𝛼 ⇒∗𝑎𝑐𝑐 # is ruled out. Suppose that
# occurs once in 𝛼, but its position is not in the middle of 𝛼; again, at this point,
𝛼 ⇒∗𝑎𝑐𝑐 # is impossible. Consequently, considering these simple observations as
well as the form of rules in 𝑅, the 𝛼 ⇒∗𝑎𝑐𝑐 # is necessarily of the form 𝛼 ⇒𝑎𝑐𝑐
𝑣# reversal(𝑣) ⇒∗𝑎𝑐𝑐 # with 𝛼 = 𝑣 reversal(𝑣). To illustrate, 𝑛𝑜#𝑜𝑛 ⇒ 𝑛#𝑛 ⇒ #, so
20 2 Automata and Grammars

𝑛𝑜#𝑜𝑛 ⇒∗𝑎𝑐𝑐 # 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

Conceptually speaking, a rewriting system 𝑀 used as an automaton usually consists


of three parts—an input tape, an auxiliary memory, and a finite state control. The
input tape is divided into squares, each of which is initially occupied with an input
symbol. There is an input read head, and the symbol under it is the current input
symbol. The auxiliary memory can be any type of data store, such as a pushdown
list. As its name suggests, the finite state control is based upon a finite set of states.
It represents the heart of 𝑀 because it can be thought of as a program that dictates
the behavior of 𝑀 as a whole. Standardly, 𝑀 works by making moves generalized
as rewriting in a rewriting-system view. Each move is made according to a rule that
describes how the current state as well as the auxiliary memory are changed. In
addition, it determines whether the current input symbol is read, and if so, the read
head is shifted precisely one square to the right on the tape. 𝑀 has one state defined
as the start state and some states designated as final states. Let a string 𝑤 be initially
written on the input tape. If 𝑀 can perform a sequence of moves so that starting
from the start state, it reads the entire 𝑤 on the tape and ends up in a final state, then
𝑀 accepts 𝑤. The set of strings accepted in this way is the language accepted by 𝑀,
𝐿 (𝑀).

2.2.1 Finite 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

2.6.2]) is a quintuple 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹), where 𝑄 is a finite set of states, Δ is an


input alphabet, 𝑄 ∩ Δ = ∅, 𝑅 ⊆ 𝑄 × Δ∗ × 𝑄 is finite, 𝑠 ∈ 𝑄 is the start state, and
𝐹 ⊆ 𝑄 is a set of final states. A member of 𝑅 is called a rule of 𝑀 usually written
in the form 𝑝𝑦 → 𝑞 for ( 𝑝, 𝑦, 𝑞) ∈ 𝑅. If 𝑝𝑦 → 𝑞 ∈ 𝑅 implies that |𝑦| ≤ 1, then 𝑀
is a finite automaton (FA). If 𝑅 ⊆ 𝑄 × Δ × 𝑄 and for every pair ( 𝑝, 𝑎) from 𝑄 × Δ
there is at most one rule in 𝑅, then 𝑀 is a deterministic FA (DFA).
A configuration of 𝑀 is any string in 𝑄Δ∗ . If ( 𝑝, 𝑦, 𝑞) ∈ 𝑅 and 𝑥, 𝑦 ∈ Δ∗ , then
𝑝𝑦𝑥 ⊢ 𝑞𝑥 and we say 𝑀 makes a move or a computational step from 𝑝𝑦𝑥 to 𝑞𝑥.
In the standard manner, let us extend ⊢ to ⊢𝑛 , where 𝑛 ≥ 0; then, based on ⊢𝑛 , let
us define ⊢+ and ⊢∗ (called a sequence of moves or a computation). The language
accepted by 𝑀, denoted by 𝐿 (𝑀), is defined as 𝐿(𝑀) = {𝑤 ∈ Δ∗ | 𝑠𝑤 ⊢∗ 𝑓 , 𝑓 ∈ 𝐹}
and a computation 𝑠𝑤 ⊢∗ 𝑓 , where 𝑤 ∈ Δ∗ and 𝑓 ∈ 𝐹, is called an accepting
computation. We say that 𝑀 accepts 𝑤 if and only if 𝑤 ∈ 𝐿(𝑀). 𝑀 rejects 𝑤 if and
only if 𝑤 ∈ Δ∗ − 𝐿 (𝑀). Two GFAs 𝑀 and 𝑀 ′ are said to be equivalent if and only
if 𝐿(𝑀) = 𝐿(𝑀 ′ ).
In rewriting system point of view, 𝐿 S = {𝑠}Δ∗ and 𝐿 F = 𝐹{𝜀} = 𝐹 are called
the set of initial and final configurations, respectively.
Note that if we restrict the label of each transition in GFA (see Definition 2.2) to
at most one symbol, we get an FA that is capable to accept a string 𝑤 if and only if
there is some GFA that accepts 𝑤 as well.
Before going any further, we introduce a convention concerning the notion of a
finite automaton.
Convention 2.3 To express that 𝑄, Δ, 𝑅, 𝑠, and 𝐹 belong to 𝑀, we specify these com-
ponents as 𝑀 𝑄, 𝑀 Δ, 𝑀 𝑅, 𝑀 𝑠, and 𝑀 𝐹, respectively (this 𝑀-subscript specification
is primarily used when several automata are simultaneously discussed, so a confu-
sion may arise). The analogous convention can be applied to any other rewriting
system.
Sometimes (see Rozenberg and Salomaa [1997a] or Sipser [2006]), considering
FA, 𝑅 is replaced with the function 𝛿 from 𝑄(Δ ∪ {𝜀}) to 2𝑄 (for DFA, 𝛿 : 𝑄Δ → 𝑄)
called transition function and defined by this equivalence

𝑞 ∈ 𝛿( 𝑝, 𝑎) 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

Fig. 2.1 FA 𝑀1 (on the left), GFA 𝑀2 (on the right).

states and each rule of the form 𝑝𝑎 → 𝑞 is represented by an edge from 𝑝 to 𝑞


labeled by 𝑎. We mark the start state with a short arrow and final states are doubly
circled.
Example 2.4 Now, according to the previous convention, we give several equivalent
formal definitions of an FA, GFA, and DFA all accepting a language 𝐿 over alphabet
Δ = {0, 1} such that 𝐿 consists of all terminal strings from Δ∗ that end with substring
01 or 11.
First, let 𝑀1 = (𝑄 𝑀1 , Δ, 𝑅 𝑀1 , 𝑠, 𝐹) be an FA written as a quintuple with a set of
rules 𝑅 𝑀1 such that 𝑄 𝑀1 = {𝑠, 𝑝, 𝑞, 𝑟, 𝑓 }, Δ = {0, 1}, 𝐹 = { 𝑓 }, and 𝑅 𝑀1 = {𝑠0 → 𝑠,
𝑠1 → 𝑠, 𝑠0 → 𝑝, 𝑠1 → 𝑞, 𝑝1 → 𝑟, 𝑞1 → 𝑓 , 𝑟𝜀 → 𝑓 }. That is, 𝑠 is the initial state
of 𝑀1 and 𝑓 is the only final state of 𝑀1 . In Figure 2.1, there is a diagram for 𝑀1 on
the left, and it is obvious that 𝐿(𝑀1 ) = 𝐿.
Second, using GFA, we simplify 𝑀1 to 𝑀2 significantly such that 𝑀2 =
(𝑄 𝑀2 , Δ, 𝑅 𝑀2 , 𝑠, 𝐹), 𝑄 𝑀2 = {𝑠, 𝑓 }, and 𝑅 𝑀1 = {𝑠0 → 𝑠, 𝑠1 → 𝑠, 𝑠01 → 𝑓 ,
𝑠11 → 𝑓 } (as shown on the right in Figure 2.1).
To illustrate a formal definition using a transition function 𝛿 instead of the finite
set of rules, 𝑀1 = (𝑄 𝑀1 , Δ, 𝛿, 𝑠, 𝐹) can be written with

𝛿(𝑠, 0) = {𝑠, 𝑝},


𝛿(𝑠, 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

𝑠0101 ⊢ 𝑠101 ⊢ 𝑠01 ⊢ 𝑝1 ⊢ 𝑟 ⊢ 𝑓

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

Fig. 2.2 DFA 𝑀3 .

Theorem 2.1 (see Wood [1987]) A language is accepted by an FA if and only if it is


accepted by a GFA.

2.2.2 Pushdown Automata

A pushdown automaton is a finite automaton together with a potentially infinite


pushdown list as an auxiliary memory. During its move, according to one of its
rules, it reads a symbol, changes the current state, and rewrites a string of symbols
occurring on the pushdown top. If it reads the entire input string, empties the
pushdown list and enters a final state, the automaton accepts the input string; the set
of all accepted strings in this way is the language that the automaton accepts.
As with finite automata, we define their general version—extended pushdown
automata. Then, we define their special case—classical pushdown automata.

Definition 2.3 An extended pushdown automaton is a septuple 𝑀 = (𝑄, Δ, Γ, 𝑅,


𝑠, 𝑆, 𝐹), where 𝑄 is the finite set of states, Δ ⊆ Γ is the input alphabet, Γ is the
pushdown alphabet, 𝑅 ⊆ 𝑄 × (Δ ∪ {𝜀}) × Γ∗ × 𝑄 × Γ∗ is the finite set of rules,
𝑠 ∈ 𝑄 is the starting state, 𝑆 ∈ Γ is the starting pushdown symbol, and 𝐹 ⊆ 𝑄 is
the set of final states. 𝑄 and Γ are pairwise disjoint. The rules are written in the
form ( 𝑝, 𝑎, 𝑧) → (𝑞, 𝑦) that corresponds to ( 𝑝, 𝑎, 𝑧, 𝑞, 𝑦) ∈ 𝑅, where 𝑝, 𝑞 ∈ 𝑄,
𝑎 ∈ Δ ∪ {𝜀}, and 𝑧, 𝑦 ∈ Γ∗ . If every rule ( 𝑝, 𝑎, 𝑧) → (𝑞, 𝑦) ∈ 𝑅 satisfies that |𝑧| = 1,
we call 𝑀 a pushdown automaton (PDA).

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.

Definition 2.4 A configuration of the PDA is a triple ( 𝑝, 𝑥, 𝛼) ∈ 𝑄 × Δ∗ × Γ∗ , where


𝑝 denotes the current state, and 𝑥 is a non-processed part of the input string, and 𝛼 is
the content of the pushdown. The transition, move or computational step is a binary
relation ⊢ on 𝑄 × Δ∗ × Γ∗ such that ( 𝑝, 𝑎𝑤, 𝑧𝛾) ⊢ (𝑞, 𝑤, 𝑦𝛾) if and only if exists
( 𝑝, 𝑎, 𝑧) → (𝑞, 𝑦) in 𝑅, where 𝑝, 𝑞 ∈ 𝑄, 𝑎 ∈ Δ ∪ {𝜀}, 𝑤 ∈ Δ∗ , and 𝑧, 𝑦, 𝛾 ∈ Γ∗ .
A rule of 𝑀 is applied to the current configuration, ( 𝑝, 𝑎𝑤, 𝑧𝛾), in the following
way. If 𝑝 is the current state, 𝑎 is the input symbol, 𝑧 is a substring from the
pushdown top, and ( 𝑝, 𝑎, 𝑧) → (𝑞, 𝑦) ∈ 𝑅; then, 𝑀 reads 𝑎 from the input, changes
24 2 Automata and Grammars

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
𝐿 𝑓 (𝑀) = {𝑤 | 𝑤 ∈ Δ∗ , (𝑠, 𝑤, 𝑆) ⊢∗ ( 𝑓 , 𝜀, 𝑧), 𝑓 ∈ 𝐹}.

Alternatively, we can define PDA by a diagram similar to a diagram for FA where


each edge is labeled by the relevant components from the corresponding rule. For
instance, a rule ( 𝑝, 𝑎, 𝑧) → (𝑞, 𝑦) is diagrammed by an edge from state 𝑝 into state
𝑞 labeled as 𝑎, 𝑧/𝑦.

Example 2.5 Let 𝑀 𝑃𝐷 𝐴 = (𝑄, Δ, Γ, 𝑅, 𝑠, $, { 𝑓 }) be a PDA, where 𝑄 = {𝑠, 𝑝, 𝑞, 𝑓 },


Δ = {0, 1}, Γ = {0, 1, $, #}, such that 𝐿(𝑀 𝑃𝐷 𝐴) contains all strings from Δ∗ such
that the number of occurences of 0s in the string is the same as of 1s. 𝑅 consists of

(𝑠, 1, $) → ( 𝑝, #$),
(𝑠, 0, $) → (𝑞, #$),
( 𝑝, 0, #) → ( 𝑝, 𝜀),
( 𝑝, 1, #) → ( 𝑝, ##),
( 𝑝, 1, $) → ( 𝑝, #$),
( 𝑝, 0, $) → (𝑞, #$),
( 𝑝, 𝜀, $) → ( 𝑓 , 𝜀),
(𝑞, 0, #) → (𝑞, ##),
(𝑞, 1, #) → (𝑞, 𝜀),
(𝑞, 1, $) → ( 𝑝, #$),
(𝑞, 0, $) → (𝑞, #$),
(𝑞, 𝜀, $) → ( 𝑓 , 𝜀).
Let 0110 be an input string. Using 𝑀 𝑃𝐷 𝐴, the accepting computation is

(𝑠, 0110, $) ⊢ (𝑞, 110, #$) ⊢ (𝑞, 10, $) ⊢ ( 𝑝, 0, #$) ⊢ ( 𝑝, 𝜀, $) ⊢ ( 𝑓 , 𝜀, 𝜀)

Next, let 𝐿 = {𝑎 𝑛 𝑏 𝑚 | 𝑛, 𝑚 ≥ 1, 𝑛 < 𝑚}. We illustrate 𝑀 𝑓 with 𝐿 𝑓 (𝑀 𝑓 ) = 𝐿


and 𝑀𝑒 with 𝐿 𝑒 (𝑀𝑒 ) = 𝐿 in Figure 2.4. To maintain greater number of 𝑏s than 𝑎s,
we push all 𝑎s on the pushdown and pop them while reading 𝑏s and in addition,
we introduce rules ( 𝑝, 𝑏, 𝑆) → ( 𝑓 , 𝑆) into 𝑅 𝑀 𝑓 and ( 𝑝, 𝑏, 𝑆) → ( 𝑝, 𝜀) into 𝑅 𝑀𝑒 ,
respectively. Recall that both 𝑀𝑒 and 𝑀 𝑓 have to read the entire input string to accept
it.
2.2 Automata 25

1, $/$#
1, #/##
0, #/𝜀

1, $/$# 𝑝 𝜀, $/𝜀

𝑠 1, $/$# 0, $/$# 𝑓

0, $/$# 𝑞 𝜀, $/𝜀

0, $/$#
0, #/##
1, #/𝜀

Fig. 2.3 PDA 𝑀𝑃𝐷 𝐴.

𝑎, 𝑆/𝑎𝑆 𝑎, 𝑆/𝑎𝑆 𝑏, 𝑎/𝜀


𝑎, 𝑎/𝑎𝑎 𝑏, 𝑎/𝜀 𝑏, 𝑆/𝑆 𝑎, 𝑎/𝑎𝑎 𝑏, 𝑆/𝜀

𝑏, 𝑎/𝜀 𝑏, 𝑆/𝑆 𝑏, 𝑎/𝜀


𝑠 𝑝 𝑓 𝑠 𝑝 𝑏, 𝜀/𝜀

Fig. 2.4 PDA 𝑀 𝑓 and 𝑀𝑒 .

2.2.3 Watson–Crick Finite Automaton

Reacting to the recent vivid development in molecular biology and biotechnology,


theoretical computer science has introduced and studied a variety of computational
models inspired by this development in order to formalize and study the new bio-
logical concepts and results in a rigorous way. The notion of a Watson–Crick (WK)
automaton, introduced in Freund et al. [1997] and further discussed in Păun et al.
[1998], belongs to the most important model of this kind. In essence, WK automaton
represents a modified version of the notion of an FA with two reading heads working
on two input tapes containing a string representing a DNA molecule.

DNA

Deoxyribonucleic acid (DNA) is a huge macromolecule consisting of millions of


nucleotides—Adenine (A), Thymine (T), Cytosine (C), and Guanine (G)—arranged
into a double helix with the upper and lower strand. The nucleotides are bounded in
26 2 Automata and Grammars

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

As inspired by the most prominent WK complementarity relation, the definition of


complementarity relation is mathematical and more general.

Definition 2.5 Let Δ be an alphabet, 𝜌 ⊆ Δ × Δ a symmetric complementarity


Δ∗ 
relation, and 𝑤 1 , 𝑤 2 ∈ Δ∗ . Then, a pair
 (𝑤 1 , 𝑤 2 ) from Δ∗ is a double-stranded
𝑤1 
string (DS string) and denoted as 𝑤 1
𝑤2 . DS string 𝑤2 is valid if |𝑤 1 | = |𝑤 2 | and
 1
(symbol(𝑤 1 , 𝑖), symbol(𝑤 2 , 𝑖)) ∈ 𝜌 for all 1 ≤ 𝑖 ≤ |𝑤 1 |, and we denote it as 𝑤 𝑤2 .
A Watson–Crick domain is a set 𝑊 𝐾𝜌 (Δ) which denotes all valid DS strings
associated with a given alphabet Δ and 𝜌. Formally:
 ∗ n  o
𝑊 𝐾𝜌 (Δ) = ΔΔ 𝜌 where ΔΔ 𝜌 = 𝑏𝑎 | 𝑎, 𝑏 ∈ Δ, (𝑎, 𝑏) ∈ 𝜌
 

For instance, based on the alphabet of nucleotides { 𝐴, 𝑇, 𝐶, 𝐺}, the WK com-


𝐴𝑇𝐶
plementarity relation 𝜌 = {(𝑇, 𝐴), ( 𝐴, 𝑇), (𝐶, 𝐺), (𝐺, 𝐶)}. Based on 𝜌, 𝑇𝐶𝐺 and
 𝐴𝑇𝐶 
𝑇 𝐴𝐺 are examples of non-valid and valid DS string, respectively.
Now, we formalize an FA-based rewriting system processing valid DS strings.

Definition 2.6 A Watson–Crick finite automaton (WKFA) is a sextuple

𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹)
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

WK𝜌 (Δ) and 𝑝, 𝑞 ∈ 𝑄, we write


𝑢1  𝑣1  𝑤1  𝑢1  𝑣1  𝑤1 
𝑢2 𝑝 𝑣2 𝑤2 ⊨ 𝑢2 𝑣2 𝑞 𝑤2
2.2 Automata 27

𝑣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 𝜌 (Δ)

The family of languages accepted by WKFAs is denoted by WK.


It has been shown in Kuske and Weigel [2004] that the type of complementary
relation does not increase the expressive power of WK automata and grammars.
Moreover, Czeizler and Czeizler [2006] provide an algorithm to transform any
WK automaton into an equivalent WK automaton with the relation being identity.
Therefore, many models and algorithms limit themselves to work only with identity
complementarity relation.
As illustrated in the following example, we can view the tape of WKFA as two
tapes that are not totally independent since both such tapes are bounded by the WK
relation.
Example 2.6 Let a WKFA

𝑀 = ({𝑠, 𝑞, 𝑓 }, {𝑎, 𝑏, 𝑐}, 𝜌, 𝑅, 𝑠, { 𝑓 })

where 𝜌 is the identity relation and 𝑅 is a set of rules


 𝑎   
𝑠 𝜀 → 𝑠, 𝑠 𝑎𝜀 → 𝑞, 𝑞 𝑏𝜀 → 𝑞, 𝑞 𝑏𝜀 → 𝑓 ,
  
𝑓 𝑎𝑐 → 𝑓 , 𝑓 𝑏𝑐 → 𝑓 , 𝑓 𝑐𝜀 → 𝑓
 
Using rules of 𝑀, we illustrate how to process 𝑎𝑎𝑏𝑐𝑐𝑐𝑎𝑎𝑏𝑐𝑐𝑐 .

𝑎𝑎𝑏𝑐𝑐𝑐  𝑎 𝑎𝑏𝑐𝑐𝑐  𝑎𝑎  𝑏𝑐𝑐𝑐  𝑎𝑎𝑏  𝑐𝑐𝑐 


𝑠 𝑎𝑎𝑏𝑐𝑐𝑐 ⊨ 𝜀 𝑠 𝑎𝑎𝑏𝑐𝑐𝑐 ⊨ 𝜀 𝑞 𝑎𝑎𝑏𝑐𝑐𝑐 ⊨ 𝜀 𝑓 𝑎𝑎𝑏𝑐𝑐𝑐 ⊨
𝑎𝑎𝑏𝑐  𝑐𝑐  𝑎𝑎𝑏𝑐𝑐  𝑐  𝑎𝑎𝑏𝑐𝑐𝑐  𝜀 
𝑎 𝑓 𝑎𝑏𝑐𝑐𝑐 ⊨ 𝑎𝑎 𝑓 𝑎𝑏𝑐𝑐𝑐⊨ 𝑎𝑎𝑏 𝑓 𝑐𝑐𝑐 ⊨
𝑎𝑎𝑏𝑐𝑐𝑐  𝜀   𝜀 𝑎𝑎𝑏𝑐𝑐𝑐 
𝑎𝑎𝑏𝑐 𝑓 𝑐𝑐 ⊨ 𝑎𝑎𝑏𝑐𝑐𝑐
𝑎𝑎𝑏𝑐𝑐 𝑓 𝑐 ⊨ 𝑎𝑎𝑏𝑐𝑐𝑐 𝑓
The language accepted by 𝑀 is 𝐿(𝑀) = {𝑎 𝑚 𝑏 𝑛 𝑐 𝑚+𝑛 | 𝑚, 𝑛 ≥ 1} which is context-
free language.
The following short example illustrates that WKFA can accept even some non-
context-free languages.
Example 2.7 Let a WKFA 𝑀 = ({𝑠, 𝑝, 𝑞, 𝑓 }, {𝑎, 𝑏, 𝑐}, 𝜌, 𝑅, 𝑠, { 𝑓 }), where 𝜌 is the
identity relation and 𝑅 is a set of rules
28 2 Automata and Grammars
 𝑎 𝑏 𝑏 𝑐
𝑠 𝜀 → 𝑠, 𝑠 𝑎 → 𝑝, 𝑝 𝑎 → 𝑝, 𝑝 𝑏 → 𝑞,
𝑐 𝜀 𝜀
𝑞 𝑏 → 𝑞, 𝑞 𝑐 → 𝑓, 𝑓 𝑐 → 𝑓

Observe that 𝐿 (𝑀) = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 1} which is non-context-free.

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]).

Definition 2.7 A WKFA 𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹) is


(i) stateless if it has only one state, so 𝑄 = 𝐹 = {𝑠};
(ii) all-final if all states are final, so 𝑄 = 𝐹;
(iii) simple if at each accepting step 𝑀 reads either the upper or the lower strand, so
( 𝑝, 𝑣𝑣12 , 𝑞) ∈ 𝑅 implies 𝑣 1 = 𝜀 or 𝑣 2 = 𝜀;
(iv) 1-limited  if it is simple and at every step 𝑀 reads only one symbol, so
( 𝑝, 𝑣𝑣12 , 𝑞) ∈ 𝑅 implies |𝑣 1 𝑣 2 | = 1.
The families of languages accepted by stateless, all-final, simple, and 1-limited
WKFAs are denoted by NWK, FWK, SWK, and 1WK, respectively. Further variants
such as NS, FS, N1, and F1 WK automata can be defined in a straightforward way
by combining multiple constraints.

The relationships between the language families accepted by variants of WKFAs


are carefully investigated in Păun et al. [1998] and visualized together with the
Chomsky hierarchy in Figure 2.5.

Theorem 2.2 (Păun et al. [1998])

N1WK ⊂ NSWK ⊆ NWK ⊂ FWK ⊂ WK = SWK = 1WK

REG ⊂ WK
REG − NWK ≠ ∅
F1WK − NWK ≠ ∅
NSWK ⊂ F1WK

Several additional variants and restrictions of Watson–Crick automata were in-


troduced such as initial stateless WK finite automata, reverse WK automata, WK
two-way automata, WK automata with a WK memory, and WK transducers (see
Păun et al. [1998]). In addition, simple and 1-limited WK automata with bounded
number of leaps between the two strands were investigated in Martı́n-Vide and Păun
[2000].
Recently, the field of WK models was extended to grammar models as well
(see Mohamad Zulkufli et al. [2016, 2017, 2018]; Hammer and Křivka [2022]). By
2.3 Grammars 29

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

As already stated in Section 2.1, grammars represent the fundamental language-


generating rewriting systems. The present section defines three basic types of
grammars: context-free, context-sensitive, and unrestricted grammars, which are
constantly used throughout the rest of this book. In addition, it describes the rela-
tionships, customarily called the Chomsky hierarchy, between the language families
they generate.

Definition 2.8 An unrestricted grammar or phrase-structure grammar (PSG) is a


quadruple
𝐺 = (Σ, Δ, 𝑃, 𝑆)
where
Σ is the total alphabet,
30 2 Automata and Grammars

Δ is the set of terminals (Δ ⊂ Σ),


𝑃 ⊆ Σ∗ (Σ − Δ)Σ∗ × Σ∗ is a finite relation,
𝑆 ∈ Σ − Δ is the axiom or starting nonterminal or starting symbol of 𝐺.
The symbols in Σ − Δ are referred to as nonterminals. Furthermore, every (𝑥, 𝑦) ∈
𝑃 is called a rule or a production rule and written as

𝑥→𝑦∈𝑃

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,

𝑢 𝐺⇒ 𝑣 [ 𝑝]

When there is no danger of confusion, we simplify 𝑢 ⇒𝐺 𝑣 [ 𝑝] to 𝑢 ⇒𝐺 𝑣. We


denote the 𝑘-fold product of ⇒𝐺 by ⇒𝐺 𝑘 . By ⇒+ and ⇒∗ , we denote the transitive
𝐺 𝐺
closure of ⇒𝐺 and the reflexive-transitive closure of ⇒𝐺 , respectively. If 𝑆 ⇒∗𝐺 𝑥
for some 𝑥 ∈ Σ∗ , 𝑥 is called a sentential form.
If there exists a derivation 𝑆 ⇒∗𝐺 𝑤, where 𝑤 ∈ Δ∗ , 𝑆 ⇒∗𝐺 𝑤 is said to be a
successful derivation in 𝐺. The language of 𝐺 or language generated by 𝐺, denoted
by 𝐿 (𝐺), is defined as

𝐿(𝐺) = {𝑤 ∈ Δ∗ | 𝑆 ⇒∗𝐺 𝑤}

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.

In rewriting system viewpoint, the grammars work with 𝐿 S = {𝑆}, 𝐿 F = Δ∗ , and


identity as the projection from 𝐿 F into the generated language. Notice that in gram-
mars, we prefer the notion of sentential form instead of the notion of configuration.

Definition 2.9 An unrestricted grammar 𝐺 = (Σ, Δ, 𝑃, 𝑆) is context-sensitive (CSG)


if each rule in 𝑃 is of the form
𝑥 𝐴𝑦 → 𝑥𝑢𝑦
2.3 Grammars 31

where 𝐴 ∈ Σ − Δ, 𝑢 ∈ Σ+ , 𝑥, 𝑦 ∈ Σ∗ . A context-sensitive language is the language


generated by a context-sensitive grammar. The family of context-sensitive languages
is denoted by CS.
Definition 2.10 An unrestricted grammar 𝐺 = (Σ, Δ, 𝑃, 𝑆) is context-free (CFG) if
each rule 𝑥 → 𝑦 ∈ 𝑃 satisfies 𝑥 ∈ Σ − Δ. A rule 𝑥 → 𝑦 is erasing if 𝑦 = 𝜀. A CFG
without erasing rules is called 𝜀-free. Analogically, a context-free language is the
language generated by a context-free grammar. The family of context-free languages
is denoted by CF.
Importantly, CF is characterized by PDAs (see Section 2.2.2) and 𝜀-free CFGs
as well.
Theorem 2.3 ([Meduna, 2014, Theorem 6.55])

CF = {𝐿 (𝑀) | 𝑀 is a PDA}

Theorem 2.4 ([Meduna, 2000, Theorem 5.1.3.2.4])

CF = {𝐿 (𝐺) | 𝐺 is an 𝜀-free CFG}

Two examples of a context-free language that cannot be generated by simpler type


of grammar follow.
Example 2.8 Assume a language 𝐿 over alphabet {0, 1} such that

𝐿 = {𝑤 | 𝑤 ∈ {0, 1} and occur(𝑤, 0) = occur(𝑤, 1)}

which is the same language as in Example 2.5.


Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) where Δ = {0, 1}, 𝑁 = {𝑆, 𝐴, 𝐵}, Σ = 𝑁 ∪ Δ and 𝑃 consists
of
𝑆 → 𝑎𝐵, 𝐴 → 𝑏 𝐴𝐴,
𝑆 → 𝑏 𝐴, 𝐵 → 𝑏,
𝐴 → 𝑎, 𝐵 → 𝑏𝑆,
𝐴 → 𝑎𝑆, 𝐵 → 𝑎𝐵𝐵.
The proof that really 𝐿 = 𝐿(𝐺) can be found, for instance, in [Meduna, 2014, page
88].
Example 2.9 Consider a CFG 𝐺 = (Σ = {𝐸, 𝑖, +, ∗, (, ), [, ]}, Σ − {𝐸 }, 𝑃, 𝐸) with 𝑃
consisting of
𝐸 → 𝐸 + 𝐸, 𝐸 → 𝐸 ∗ 𝐸,
𝐸 → (𝐸), 𝐸 → [𝐸],
𝐸 →𝑖
Observe that 𝐺 generates the language of all well-written arithmetic expressions
with parentheses (, ) and [, ].
When we eliminate everything but the parentheses in this language and we al-
low 𝑘 kinds of parentheses, 𝑘 ≥ 1, we obtain a set of languages, called semi-
Dyck languages where strings represent tree structures with different kinds of
32 2 Automata and Grammars

subtrees. For some 𝑘 ≥ 1, semi-Dyck language 𝐷 𝑘 is generated by a CFG with


Δ = {𝑎 1 , 𝑎 1′ , 𝑎 2 , 𝑎 2′ , . . . , 𝑎 𝑘 , 𝑎 ′𝑘 } (𝑎 𝑖 and 𝑎 𝑖′ is a pair of the corresponding parenthe-
ses), start nonterminal 𝐸, and the set of rules consists of

𝐸 → 𝐸 𝐸,
𝐸 → 𝑎 1 𝐸𝑎 1′ ,
𝐸 → 𝑎 2 𝐸𝑎 2′ ,
..
.
𝐸 → 𝑎 𝑘 𝐸𝑎 ′𝑘 ,
𝐸→𝜀

Definition 2.11 A CFG 𝐺 = (Σ, Δ, 𝑃, 𝑆) is linear (LG) if each rule 𝑥 → 𝑦 ∈ 𝑃


satisfies 𝑦 ∈ Δ∗ (Σ − Δ)Δ∗ . An LG defined in this way generates a linear language.
The family of linear languages is denoted by LIN.
Definition 2.12 A CFG 𝐺 = (Σ, Δ, 𝑃, 𝑆) is right-linear (RLG) if each rule 𝑥 → 𝑦 ∈
𝑃 satisfies 𝑦 ∈ Δ∗ ∪ Δ∗ (Σ − Δ).
Definition 2.13 A CFG 𝐺 = (Σ, Δ, 𝑃, 𝑆) is regular (RG) if each rule 𝑥 → 𝑦 ∈ 𝑃
satisfies 𝑦 ∈ Δ∪Δ(Σ, Δ). A RG and a RLG define regular and right-linear language,
respectively. The family of both of these types of languages is denoted as the family
of regular languages by REG.
In addition, REG is characterized by FAs (see Section 2.2.1) as well.
Theorem 2.5 (see Theorem 3.38 in Meduna [2014]) 𝐿 ∈ REG if and only if there
is an FA 𝑀 such that 𝐿(𝑀) = 𝐿.
The classes of grammars defined in this section define the language families of
the well-known Chomsky hierarchy, diagrammed in Figure 2.5.
Theorem 2.6 FIN ⊂ REG ⊂ LIN ⊂ CF ⊂ CS ⊂ RE ⊂ ALL
Next, we give several important results together with references in which their
proofs are to be found.
Theorem 2.7 (Sipser [2006]; Rozenberg and Salomaa [1997a]; Meduna [2007])
REG is closed under union, concatenation, closure, positive closure, intersection,
complementation, finite substitution, homomorphism, and regular substitution.
Theorem 2.8 (Meduna [2007]) CF is closed under union, concatenation, closure,
complementation, reversal and homomorphism.
The following theorem gives a characterization of the family of recursively enu-
merable languages by context-free languages.
Theorem 2.9 (Ginsburg et al. [1967]) For every recursively enumerable language
𝐿, there exist two context-free languages, 𝐿 1 and 𝐿 2 , and a homomorphism ℎ such
that
𝐿 = ℎ(𝐿 1 ∩ 𝐿 2 )
Part II
Jumping Automata
This part, consisting of Chapters 3 and 4, presents the fundamentals of jumping
finite automata. 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).
Chapter 3 gives a systematic body of up-to-date knowledge concerning jumping
one-head finite automata, which actually originated the theory of jumping models as
a whole. It demonstrates several fundamental results about these automata in most
common areas of formal language theory, such as their expressive power, closure
properties, infinite language family hierarchy resulting from them, and the effect
resulting from various restrictions placed on the jumping direction. Although the
knowledge about these automata is solidly established today, Chapter 3 points out
several open questions. To complete the study of one-head jumping automata models,
Chapter 3 covers one-way jumping finite automata as well.
One-head jumping finite automata obviously formalize discontinuous computa-
tion more properly than classical finite automata. Nevertheless, they always apply a
single rule during every jump, thus principally failing to formalize another impor-
tant feature of today’s computation—parallelism. Therefore, Chapter 4 generalizes
them to their multi-head versions that perform a simultaneous application of several
rules during any jump, thus reflecting and formalizing discontinuous parallelism
more properly than their original one-head versions. Chapter 4 defines and ex-
plores a large variety of these multi-head versions, ranging from strictly two-head
jumping automata through jumping automata having any number of heads up to
jumping Watson–Crick finite automata, which are frequently used in practice of
today’s computer science. Perhaps most importantly, concerning the Watson–Crick
automata, Chapter 4 thoroughly covers their crucially important special cases—
jumping Watson–Crick finite automata and jumping 5′ → 3′ Watson–Crick finite au-
tomata, whose bioinformatically oriented applications are overwhelming at present.
Chapter 3
Jumping One-Head Automata

As computational models, finite automata are conceptualized so simply and natu-


rally that they definitely belong to the most intensively investigated and, perhaps
even more importantly, applied automata in computer science as a whole. Recently,
the theory of computation has introduced their jumping versions (see Meduna and
Zemek [2012] introducing jumping finite automata) as the very first jumping mech-
anism in this theory. As their name suggests, these automata jump across their input
strings in a discontinuous way while keeping the simple concept of their classical
counterparts unchanged. The fundamental reason for this introduction was that the
jumping versions properly reflect and formalize discontinuous information process-
ing, which is quite central to today’s computation and which was virtually unknown
in the past.
To put this reason into a historical perspective, in the previous century, most
classical computer science methods were developed for continuous information pro-
cessing, and the concept of classical finite automata obviously formalizes this kind
of processing very well. That is, the classical finite automata work on strings, rep-
resenting information, in a strictly continuous left-to-right symbol-by-symbol way.
Working in this continuous way, however, makes them unable to act as adequate
models of current computational methods, which often process information in an
extremely discontinuous way. Indeed, within a particular running process, a typical
computational step is usually performed somewhere in the middle of information,
while the very next computational step is executed far away from it; therefore, before
the next step is carried out, the process has to jump over a large portion of the infor-
mation to the desired position of execution. As is obvious, classical finite automata
cannot model discontinuous computation of this kind adequately while their jumping
versions can.
To sketch the difference between both versions in greater detail, reconsider the
general notion of a classical finite automaton 𝐶 (see Definition 2.2). 𝐶 consists of
an input tape, a read head, and a finite state control. The input tape is divided into
squares, each of which contains one symbol of an input string with the current input
symbol right under the read head of 𝐶. The finite control is represented by a finite
set of states together with a set of computational rules. 𝐶 works by making moves.

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.

3.1 Basic and Generalized Jumping Finite Automata

In this subsection, we define a variety of jumping finite automata discussed in this


section and illustrate them by examples.
Definition 3.1 A general jumping finite automaton (GJFA) is a quintuple 𝑀 = (𝑄,
Δ, 𝑅, 𝑠, 𝐹), where Δ is the input alphabet of 𝑀, and 𝑄, 𝑠, 𝑅 have the same meaning as
in Definition 2.2, except that 𝑎 ∈ Δ∗ for every 𝑞𝑎 → 𝑝 ∈ 𝑅. Furthermore, we define
3.1 Basic and Generalized Jumping Finite Automata 37

the binary jumping relation over Δ∗ 𝑄Δ∗ , symbolically denoted by ↷, as follows.


Let 𝑥, 𝑧, 𝑥 ′ , 𝑧 ′ ∈ Δ∗ such that 𝑥𝑧 = 𝑥 ′ 𝑧 ′ and 𝑝𝑦 → 𝑞 ∈ 𝑅; then, 𝑀 makes a jump
from 𝑥 𝑝𝑦𝑧 to 𝑥 ′ 𝑞𝑧 ′ , symbolically written as 𝑥 𝑝𝑦𝑧 ↷ 𝑥 ′ 𝑞𝑧 ′ . In the standard manner,
we extend ↷ to ↷𝑚 , where 𝑚 ≥ 0, ↷+ , and ↷∗ .
The language accepted by 𝑀 with ↷, denoted by 𝐿(𝑀, ↷), is defined as 𝐿(𝑀, ↷
) = {𝑢𝑣 | 𝑢, 𝑣 ∈ Δ∗ , 𝑢𝑠𝑣 ↷∗ 𝑓 , 𝑓 ∈ 𝐹}. Let 𝑤 ∈ Δ∗ . We say that 𝑀 accepts 𝑤 if and
only if 𝑤 ∈ 𝐿 (𝑀, ↷); 𝑀 rejects 𝑤, otherwise. Two GJFAs 𝑀 and 𝑀 ′ are said to be
equivalent if and only if 𝐿 (𝑀, ↷) = 𝐿 (𝑀 ′ , ↷).

𝑥 𝑤 𝑧 𝑥 𝑧

... 𝑏 ... 𝑐 ... ↷ ... 𝑏 𝑐 ... 𝑑 ...

𝑝 𝑞

Fig. 3.1 GJFA jump.

𝑥 𝑧 𝑥 𝑧

... 𝑏 𝑎 𝑐 ... ↷ ... 𝑏 𝑐 ... 𝑑 ...

𝑝 𝑞

Fig. 3.2 JFA jump.

Definition 3.2 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. 𝑀 is an 𝜀-free GJFA if 𝑝𝑦 →


𝑞 ∈ 𝑅 implies that |𝑦| ≥ 1. 𝑀 is of degree 𝑛, where 𝑛 ≥ 0, if 𝑝𝑦 → 𝑞 ∈ 𝑅 implies
that |𝑦| ≤ 𝑛. 𝑀 is a jumping finite automaton (JFA) if its degree is 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.

Definition 3.3 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a JFA. Analogously to a GJFA, 𝑀 is an


𝜀-free JFA if 𝑝𝑦 → 𝑞 ∈ 𝑅 implies that |𝑦| = 1. 𝑀 is a deterministic JFA (DJFA)
if (1) it is an 𝜀-free JFA and (2) for each 𝑝 ∈ 𝑄 and each 𝑎 ∈ Δ, there is no more
than one 𝑞 ∈ 𝑄 such that 𝑝𝑎 → 𝑞 ∈ 𝑅. 𝑀 is a complete JFA (CJFA) if (1) it is a
DJFA and (2) for each 𝑝 ∈ 𝑄 and each 𝑎 ∈ Δ, there is precisely one 𝑞 ∈ 𝑄 such that
𝑝𝑎 → 𝑞 ∈ 𝑅.
38 3 Jumping One-Head Automata

Definition 3.4 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. The transition graph of 𝑀,


denoted by Γ(𝑀), is a multi-graph, where nodes are states from 𝑄, and there is
an edge from 𝑝 to 𝑞 labeled with 𝑦 if and only if 𝑝𝑦 → 𝑞 ∈ 𝑅. A state 𝑞 ∈ 𝑄 is
reachable if there is a walk from 𝑠 to 𝑞 in Γ(𝑀); 𝑞 is terminating if there is a walk
from 𝑞 to some 𝑓 ∈ 𝐹. If there is a walk from 𝑝 to 𝑞, 𝑝 = 𝑞 1 , 𝑞 2 , . . . , 𝑞 𝑛 = 𝑞, for
some 𝑛 ≥ 2, where 𝑞 𝑖 𝑦 𝑖 → 𝑞 𝑖+1 ∈ 𝑅 for all 𝑖 = 1, . . . , 𝑛 − 1, then we write

𝑝𝑦 1 𝑦 2 · · · 𝑦 𝑛 ⇝ 𝑞

Next, we illustrate the previous definitions by two examples.

Example 3.1 Consider the DJFA



𝑀 = {𝑠, 𝑟, 𝑡}, Δ, 𝑅, 𝑠, {𝑠}

where Δ = {𝑎, 𝑏, 𝑐} and



𝑅 = 𝑠𝑎 → 𝑟, 𝑟𝑏 → 𝑡, 𝑡𝑐 → 𝑠

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

𝐿(𝑀, ↷) = 𝑤 ∈ Δ∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)




𝑎
𝑠 𝑟

𝑐 𝑏
𝑡

Fig. 3.3 Diagram of a finite automaton accepting {𝑎𝑏𝑐} ∗ .

Recall that 𝐿 (𝑀, ↷) in Example 3.1 is a well-known non-context-free context-


sensitive language.

Example 3.2 Consider the GJFA



𝑀 = {𝑠, 𝑡, 𝑓 }, {𝑎, 𝑏}, 𝑅, 𝑠, { 𝑓 }

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]).

Denotation of Language Families

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 𝑎 𝑖𝑛 → 𝑠𝑖𝑛

where 𝑠 𝑗 ∈ 𝑄 for all 𝑗 ∈ {𝑖 1 , 𝑖2 , . . . , 𝑖 𝑛 }, (𝑖1 , 𝑖 2 , . . . , 𝑖 𝑛 ) is a permutation of (1, 2,


. . . , 𝑛), and 𝑠𝑖𝑛 ∈ 𝐹. However, this implies that 𝑎 𝑘1 𝑎 𝑘2 · · · 𝑎 𝑘𝑛 ∈ 𝐿 (𝑀, ↷), where
(𝑘 1 , 𝑘 2 , . . . , 𝑘 𝑛 ) is a permutation of (1, 2, . . . , 𝑛), so perm(𝑤) ⊆ 𝐿 (𝑀, ↷). □
From Theorem 3.5, we obtain the following two corollaries, which are used in
subsequent proofs.
Corollary 3.2 There is no JFA that accepts {𝑎𝑏}∗ .
Corollary 3.3 There is no JFA that accepts {𝑎, 𝑏}∗ {𝑏𝑎}{𝑎, 𝑏}∗ .
Consider the language of primes 𝐾 from Corollary 3.1. Since 𝐾 = perm(𝐾), the
condition from Theorem 3.5 is not sufficient for a language to be in JFA. This is
stated in the following corollary.
3.1 Basic and Generalized Jumping Finite Automata 41

Corollary 3.4 There is a language 𝐾 satisfying 𝐾 = perm(𝐾) that cannot be ac-


cepted by any JFA.

The next theorem gives both a necessary and sufficient condition for a language
to be accepted by a JFA.

Theorem 3.6 Let 𝐿 be an arbitrary language. 𝐿 ∈ JFA if and only if 𝐿 = perm(𝐾),


where 𝐾 is a regular language.

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.

Theorem 3.7 JFA ⊂ GJFA

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

Relationships with Well-Known Language Families

In this section, we establish relationships between GJFA, JFA, and some well-known
language families, including FIN, REG, CF, and CS.

Theorem 3.8 FIN ⊂ GJFA

Proof Let 𝐾 ∈ FIN. Since 𝐾 is a finite, there exists 𝑛 ≥ 0 such that card(𝐾) = 𝑛.
Therefore, we can express 𝐾 as 𝐾 = {𝑤 1 , 𝑤 2 , . . . , 𝑤 𝑛 }. Define the GJFA

𝑀 = {𝑠, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }

where Δ = symbols(𝐾) and 𝑅 = {𝑠𝑤 1 → 𝑓 , 𝑠𝑤 2 → 𝑓 , . . . , 𝑠𝑤 𝑛 → 𝑓 }. Clearly,


𝐿 (𝑀, ↷) = 𝐾. Therefore, FIN ⊆ GJFA. From Example 3.1, GJFA − FIN ≠ ∅,
which proves the theorem. □

Lemma 3.3 There is no GJFA that accepts {𝑎}∗ {𝑏}∗ .

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
{𝑎}∗ {𝑏}∗ . □

Theorem 3.9 REG and GJFA are incomparable.

Proof GJFA ⊈ REG follows from Example 3.1. REG ⊈ GJFA follows from
Lemma 3.3. □

Theorem 3.10 CF and GJFA are incomparable.

Proof GJFA ⊈ CF follows from Example 3.1, and CF ⊈ GJFA follows from
Lemma 3.3. □

Theorem 3.11 GJFA ⊂ CS

Proof Clearly, jumps of GJFAs can be simulated by context-sensitive grammars, so


GJFA ⊆ CS. From Lemma 3.3, it follows that CS − GJFA ≠ ∅. □

Theorem 3.12 FIN and JFA are incomparable.

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.

Theorem 3.14 JFA is closed under shuffle and iterated shuffle.

Proof Let 𝑀1 = (𝑄 1 , Δ1 , 𝑅1 , 𝑠1 , 𝐹1 ) and 𝑀2 = (𝑄 2 , Δ2 , 𝑅2 , 𝑠2 , 𝐹2 ) be two JFAs.


Without any loss of generality, we assume that 𝑄 1 ∩ 𝑄 2 = ∅. Define the JFA

𝐻 = 𝑄 1 ∪ 𝑄 2 , Δ1 ∪ Δ2 , 𝑅1 ∪ 𝑅2 ∪ { 𝑓 → 𝑠2 | 𝑓 ∈ 𝐹1 }, 𝑠1 , 𝐹2

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.

Proof Let 𝑀1 = (𝑄 1 , Δ1 , 𝑅1 , 𝑠1 , 𝐹1 ) and 𝑀2 = (𝑄 2 , Δ2 , 𝑅2 , 𝑠2 , 𝐹2 ) be two GJFAs.


Without any loss of generality, we assume that 𝑄 1 ∩ 𝑄 2 = ∅ and 𝑠 ∉ (𝑄 1 ∪ 𝑄 2 ).
Define the GJFA
44 3 Jumping One-Head Automata

𝐻 = 𝑄 1 ∪ 𝑄 2 ∪ {𝑠}, Δ1 ∪ Δ2 , 𝑅1 ∪ 𝑅2 ∪ {𝑠 → 𝑠1 , 𝑠 → 𝑠2 }, 𝑠, 𝐹1 ∪ 𝐹2

Clearly, 𝐿(𝐻) = 𝐿 (𝑀1 , ↷) ∪ 𝐿 (𝑀2 , ↷), and if both 𝑀1 and 𝑀2 are JFAs, then 𝐻
is also a JFA. □

Theorem 3.17 GJFA is not closed under complement.

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). □

Theorem 3.18 JFA is closed under complement.

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a JFA. Without any loss of generality, we assume


that 𝑀 is a CJFA (JFA = DJFA by Theorem 3.3 and every DJFA can be converted
to an equivalent CJFA by Theorem 3.1). Then, the JFA

𝑀 ′ = 𝑄, Δ, 𝑅, 𝑠, 𝑄 − 𝐹


accepts ∼ 𝐿(𝑀, ↷). □

Lemma 3.4 (Vorel [2018]) For Δ = {𝑎, 𝑏}, {𝑎𝑏}∗ ∉ GJFA.

By using De Morgan’s laws, we obtain the following two corollaries of Theo-


rems 3.16, 3.17, and 3.18.

Corollary 3.6 GJFA is not closed under intersection.

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. □

Corollary 3.7 JFA is closed under intersection.

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. □

Theorem 3.20 JFA is closed under reversal.

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.

Theorem 3.23 JFA is not closed under 𝜀-free homomorphism.

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.

Since 𝜀-free homomorphism is a special case of homomorphism, and since ho-


momorphism is a special case of finite substitution, we obtain the following corollary
of Theorems 3.23 and 3.24.

Corollary 3.9 GJFA and JFA are not closed under homomorphism.

Corollary 3.10 GJFA and JFA are not closed under finite substitution.

Theorem 3.25 JFA is closed under inverse homomorphism.


46 3 Jumping One-Head Automata

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a JFA, Δ′ be an alphabet, and 𝜙 be a homo-


morphism from Δ′∗ to Δ∗ . We next construct a JFA 𝑀 ′ such that 𝐿 (𝑀 ′ , ↷) =
𝜙 −1 (𝐿(𝑀, ↷)). Define
𝑀 ′ = 𝑄, Δ′ , 𝑅 ′ , 𝑠, 𝐹


where
𝑅 ′ = 𝑝𝑎 → 𝑞 | 𝑎 ∈ Δ′ , 𝑝𝜙(𝑎) ⇝ 𝑞 in Γ(𝑀)


Observe that 𝑤 1 𝑠𝑤 2 ↷∗ 𝑞 in 𝑀 if and only if 𝑤 1′ 𝑠𝑤 2′ ↷∗ 𝑞 in 𝑀 ′ , where 𝑤 1 𝑤 2 =


𝜙(𝑤 1′ 𝑤 2′ ) and 𝑞 ∈ 𝑄, so 𝐿(𝑀 ′ , ↷) = 𝜙 −1 (𝐿 (𝑀, ↷)). A fully rigorous proof is left
to the reader. □
However, the same does not hold for GJFAs.

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 − +

Table 3.1 Closure properties of GJFA and JFA.


3.1 Basic and Generalized Jumping Finite Automata 47

Decidability

In this section, we prove the decidability of some decision problems with regard
to GJFA and JFA.

Lemma 3.6 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. Then, 𝐿 (𝑀, ↷) is infinite if and


only if 𝑝𝑦 ⇝ 𝑝 in Γ(𝑀), for some 𝑦 ∈ Δ+ and 𝑝 ∈ 𝑄 such that 𝑝 is both reachable
and terminating in Γ(𝑀).

Proof If. Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA such that 𝑝𝑦 ⇝ 𝑝 in Γ(𝑀), for some
𝑦 ∈ Δ+ and 𝑝 ∈ 𝑄 such that 𝑝 is both reachable and terminating in Γ(𝑀). Then,

𝑤 1 𝑠𝑤 2 ↷∗ 𝑢 𝑝𝑣 ↷+ 𝑥 𝑝𝑧 ↷∗ 𝑓

where 𝑤 1 𝑤 2 ∈ 𝐿 (𝑀, ↷), 𝑢, 𝑣, 𝑥, 𝑧 ∈ Δ∗ , 𝑝 ∈ 𝑄, and 𝑓 ∈ 𝐹. Consequently,

𝑤 1 𝑠𝑤 2 ↷∗ 𝑢 𝑝𝑣𝑦 ′ ↷+ 𝑥 𝑝𝑧 ↷∗ 𝑓

where 𝑦 ′ = 𝑦 𝑛 for all 𝑛 ≥ 0. Therefore, 𝐿 (𝑀, ↷) is infinite, so the if part holds.


Only If. Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA such that 𝐿 (𝑀, ↷) is infinite. Without
any loss of generality, we assume that 𝑀 is 𝜀-free (see Lemma 3.1). Then,

𝑤 1 𝑠𝑤 2 ↷∗ 𝑢 𝑝𝑣 ↷+ 𝑥 𝑝𝑧 ↷∗ 𝑓

for some 𝑤 1 𝑤 2 ∈ 𝐿(𝑀, ↷), 𝑢, 𝑣, 𝑥, 𝑧 ∈ Δ∗ , 𝑝 ∈ 𝑄, and 𝑓 ∈ 𝐹. This implies that 𝑝


is both terminating and reachable in Γ(𝑀). Let 𝑦 ∈ Δ+ be a string read by 𝑀 during
𝑢 𝑝𝑣 ↷+ 𝑥 𝑝𝑧. Then, 𝑝𝑦 ⇝ 𝑝 in Γ(𝑀), so the only-if part holds. □

Theorem 3.29 Both finiteness and infiniteness are decidable for GJFA.

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. By Lemma 3.6, 𝐿(𝑀, ↷) is infinite


if and only if 𝑝𝑦 ⇝ 𝑝 in Γ(𝑀), for some 𝑦 ∈ Δ+ and 𝑝 ∈ 𝑄 such that 𝑝 is both
reachable and terminating in Γ(𝑀). This condition can be checked by any graph
searching algorithm, such as breadth-first search (see [Russell and Norvig, 2002,
page 73]). Therefore, the theorem holds. □

Corollary 3.11 Both finiteness and infiniteness are decidable for JFA.

Observe that since there is no deterministic version of a GJFA, the following


proof of Theorem 3.30 is not as straightforward as in terms of regular languages and
classical deterministic finite automata.

Theorem 3.30 The membership problem is decidable for GJFA.

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA, and let 𝑥 ∈ Δ∗ . Without any loss of


generality, we assume that 𝑀 is 𝜀-free (see Theorem 3.2). If 𝑥 = 𝜀, then 𝑥 ∈ 𝐿 (𝑀, ↷)
if and only if 𝑠 ∈ 𝐹, so assume that 𝑥 ≠ 𝜀. Set
48 3 Jumping One-Head Automata

Ψ = (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 ) | 𝑥𝑖 ∈ Δ+ , 1 ≤ 𝑖 ≤ 𝑛, 𝑥1 𝑥2 · · · 𝑥 𝑛 = 𝑥, 𝑛 ≥ 1


and

Ψ 𝑝 = (𝑦 1 , 𝑦 2 , . . . , 𝑦 𝑛 ) | (𝑥 1 , 𝑥2 , . . . , 𝑥 𝑛 ) ∈ Ψ, 𝑛 ≥ 1, (𝑦 1 , 𝑦 2 , . . . , 𝑦 𝑛 ) is
a permutation of (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 )

If there exist (𝑦 1 , 𝑦 2 , . . . , 𝑦 𝑛 ) ∈ Ψ 𝑝 and 𝑞 1 , 𝑞 2 , . . . , 𝑞 𝑛+1 ∈ 𝑄, for some 𝑛, 1 ≤ 𝑛 ≤


|𝑥|, such that 𝑠 = 𝑞 1 , 𝑞 𝑛+1 ∈ 𝐹, and 𝑞 𝑖 𝑦 𝑖 → 𝑞 𝑖+1 ∈ 𝑅 for all 𝑖 = 1, 2, . . . , 𝑛, then
𝑥 ∈ 𝐿(𝑀, ↷); otherwise, 𝑥 ∉ 𝐿(𝑀, ↷). Since both 𝑄 and Ψ 𝑝 are finite, this check
can be performed in finite time. □

Corollary 3.12 The membership problem is decidable for JFA.

Theorem 3.31 The emptiness problem is decidable for GJFA.

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. Then, 𝐿(𝑀, ↷) is empty if and only


if no 𝑓 ∈ 𝐹 is reachable in Γ(𝑀). This check can be done by any graph searching
algorithm, such as breadth-first search (see [Russell and Norvig, 2002, page 73]). □

Corollary 3.13 The emptiness problem is decidable for JFA.

GJFA JFA
membership + +
emptiness + +
finiteness + +
infiniteness + +

Table 3.2 Decidability properties.

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.

An Infinite Hierarchy of Language Families

In this section, we establish an infinite hierarchy of language families resulting from


GJFAs of degree 𝑛, where 𝑛 ≥ 0. Let GJFA𝑛 and GJFA𝑛− 𝜀 denote the families
of languages accepted by GJFAs of degree 𝑛 and by 𝜀-free GJFAs of degree 𝑛,
respectively. Observe that GJFA𝑛 = GJFA𝑛− 𝜀 by the definition of a GJFA (see
Def. 3.1) and by Lemma 3.1, for all 𝑛 ≥ 0.
3.1 Basic and Generalized Jumping Finite Automata 49

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. □

Theorem 3.32 GJFA𝑛 ⊂ GJFA𝑛+1 for all 𝑛 ≥ 0.

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.

Corollary 3.14 GJFA𝑛− 𝜀 ⊂ GJFA𝑛+1


−𝜀
for all 𝑛 ≥ 0.

Left and Right Jumps

We define two special cases of the jumping relation.

Definition 3.5 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. Let 𝑤, 𝑥, 𝑦, 𝑧 ∈ Δ∗ , and 𝑝𝑦 →


𝑞 ∈ 𝑅; then, (1) 𝑀 makes a left jump from 𝑤𝑥 𝑝𝑦𝑧 to 𝑤𝑞𝑥𝑧, symbolically written as

𝑤𝑥 𝑝𝑦𝑧 𝑙 ↷ 𝑤𝑞𝑥𝑧
50 3 Jumping One-Head Automata

and (2) 𝑀 makes a right jump from 𝑤 𝑝𝑦𝑥𝑧 to 𝑤𝑥𝑞𝑧, written as

𝑤 𝑝𝑦𝑥𝑧 𝑟 ↷ 𝑤𝑥𝑞𝑧

Let 𝑢, 𝑣 ∈ Δ∗ 𝑄Δ∗ ; then, 𝑢 ↷ 𝑣 if and only if 𝑢 𝑙 ↷ 𝑣 or 𝑢 𝑟 ↷ 𝑣. Extend 𝑙 ↷


and 𝑟 ↷ to 𝑙 ↷𝑚 , 𝑙 ↷∗ , 𝑙 ↷+ , 𝑟 ↷𝑚 , 𝑟 ↷∗ , and 𝑟 ↷+ , where 𝑚 ≥ 0, by analogy
with extending ↷. Set
∗ ∗

𝑙 𝐿(𝑀, ↷) = 𝑢𝑣 | 𝑢, 𝑣 ∈ Δ , 𝑢𝑠𝑣 𝑙 ↷ 𝑓 with 𝑓 ∈ 𝐹

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.

Theorem 3.33 𝑟 GJFA = 𝑟 JFA = REG

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.

Theorem 3.34 𝑙 JFA − REG ≠ ∅

Proof Consider the JFA



𝑀 = {𝑠, 𝑝, 𝑞}, {𝑎, 𝑏}, 𝑅, 𝑠, {𝑠}

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

occurrence of 𝑏 or 𝑎, respectively. Then, it consumes it by using 𝑝𝑏 → 𝑠 or 𝑞𝑎 → 𝑠,


respectively. If this read symbol was the rightmost one, it jumps one symbol to the
left and repeats the process. Otherwise, it makes no jumps at all. Observe that in this
way, every configuration is of the form 𝑢𝑟𝑣, where 𝑟 ∈ {𝑠, 𝑝, 𝑞}, 𝑢 ∈ {𝑎, 𝑏}∗ , and
either 𝑣 ∈ {𝑎, 𝜀}{𝑏}∗ or 𝑣 ∈ {𝑏, 𝜀}{𝑎}∗ .
Based on the previous observations, we see that

𝑙 𝐿(𝑀, ↷) = 𝑤 | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)

Since 𝐿(𝑀, ↷) is not regular, 𝑙 JFA − REG ≠ ∅, so the theorem holds. □

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

JFA = JFA−ε = DJFA GJFA1


FIN

Fig. 3.4 Relationships between JFA, GJFA, and the Chomsky hierarchy.
52 3 Jumping One-Head Automata

A Variety of Start Configurations

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.

Definition 3.6 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA. Set


𝑏
𝐿(𝑀, ↷) = {𝑤 ∈ Δ∗ | 𝑠𝑤 ↷∗ 𝑓 with 𝑓 ∈ 𝐹}
𝑎
𝐿(𝑀, ↷) = {𝑢𝑣 | 𝑢, 𝑣 ∈ Δ∗ , 𝑢𝑠𝑣 ↷∗ 𝑓 with 𝑓 ∈ 𝐹}
𝑒
𝐿(𝑀, ↷) = {𝑤 ∈ Δ∗ | 𝑤𝑠 ↷∗ 𝑓 with 𝑓 ∈ 𝐹}

Intuitively, 𝑏, 𝑎, and 𝑒 stand for beginning, anywhere, and end, respectively; in


this way, we express where the acceptance process starts. Observe that we simplify
𝑎
𝐿 (𝑀, ↷) to 𝐿(𝑀, ↷) because we pay a principal attention to the languages ac-
cepted in this way in this chapter. Let 𝑏 GJFA, 𝑎 GJFA, 𝑒 GJFA, 𝑏 JFA, 𝑎 JFA, and
𝑒
JFA denote the families of languages accepted by GJFAs starting at the beginning,
GJFAs starting anywhere, GJFAs starting at the end, JFAs starting at the beginning,
JFAs starting anywhere, and JFAs starting at the end, respectively.
We show that
(1) starting at the beginning increases the acceptance power of GJFAs and JFAs,
and
(2) starting at the end does not increase the acceptance power of GJFAs and JFAs.

Theorem 3.35 𝑎 JFA ⊂ 𝑏 JFA

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a JFA. The JFA

𝑀 ′ = 𝑄, Δ, 𝑅 ∪ {𝑠 → 𝑠}, 𝑠, 𝐹


clearly satisfies 𝑎 𝐿 (𝑀, ↷) = 𝑏 𝐿 (𝑀 ′ , ↷), so 𝑎 JFA ⊆ 𝑏 JFA. We prove that this


inclusion is, in fact, proper. Consider the language 𝐾 = {𝑎}{𝑏}∗ . The JFA

𝐻 = {𝑠, 𝑓 }, {𝑎, 𝑏}, {𝑠𝑎 → 𝑓 , 𝑓 𝑏 → 𝑓 }, 𝑠, { 𝑓 }

satisfies 𝑏 𝐿(𝐻) = 𝐾. However, observe that 𝑎 𝐿(𝐻) = {𝑏}∗ {𝑎}{𝑏}∗ , which differs
from 𝐾. By Theorem 3.5, for every JFA 𝑁, it holds that 𝑎 𝐿(𝑁) ≠ 𝐾. Hence,
𝑎
JFA ⊂ 𝑏 JFA. □

Theorem 3.36 𝑎 GJFA ⊂ 𝑏 GJFA

Proof This theorem can be proved by analogy with the proof of Theorem 3.35. □

Lemma 3.8 Let 𝑀 be a GJFA of degree 𝑛 ≥ 0. Then, there is a GJFA 𝑀 ′ of degree 𝑛


such that 𝑎 𝐿(𝑀, ↷) = 𝑒 𝐿(𝑀 ′ , ↷).
3.1 Basic and Generalized Jumping Finite Automata 53

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA of degree 𝑛. Then, the GJFA

𝑀 ′ = 𝑄, Δ, 𝑅 ∪ {𝑠 → 𝑠}, 𝑠, 𝐹


is of degree 𝑛 and satisfies 𝑎 𝐿(𝑀, ↷) = 𝑒 𝐿(𝑀 ′ , ↷). □

Lemma 3.9 Let 𝑀 be a GJFA of degree 𝑛 ≥ 0. Then, there is a GJFA 𝑀ˆ of degree 𝑛


𝑎
ˆ
such that 𝑒 𝐿 (𝑀, ↷) = 𝐿( 𝑀).

Proof Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA of degree 𝑛. If 𝑒 𝐿(𝑀, ↷) = ∅, then the


GJFA
𝑀 ′ = {𝑠}, Δ, ∅, 𝑠, ∅


is of degree 𝑛 and satisfies 𝑎 𝐿(𝑀 ′ , ↷) = ∅. If 𝑒 𝐿 (𝑀, ↷) = {𝜀}, then the GJFA

𝑀 ′′ = {𝑠}, Δ, ∅, 𝑠, {𝑠}


is of degree 𝑛 and satisfies 𝑎 𝐿(𝑀 ′′ , ↷) = {𝜀}. Therefore, assume that 𝑤 ∈ 𝑒 𝐿(𝑀, ↷


), where 𝑤 ∈ Δ+ . Then, 𝑠 → 𝑝 ∈ 𝑅, for some 𝑝 ∈ 𝑄. Indeed, observe that either
𝑒
𝐿 (𝑀, ↷) = ∅ or 𝑒 𝐿(𝑀, ↷) = {𝜀}, which follows from the observation that if 𝑀
starts at the end of an input string, then it first has to jump to the left to be able to
read some symbols.
Define the GJFA 𝑀ˆ = (𝑄, Δ, 𝑅, ˆ 𝑠, 𝐹), where

𝑅ˆ = 𝑅 − 𝑠𝑢 → 𝑞 | 𝑢 ∈ Δ+ , 𝑞 ∈ 𝑄, and there is no 𝑥 ∈ Δ+


such that 𝑠𝑥 ⇝ 𝑠 in Γ(𝑀)

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.□

Theorem 3.37 𝑒 GJFA = 𝑎 GJFA and 𝑒 JFA = 𝑎 JFA

Proof This theorem follows from Lemmas 3.8 and 3.9. □


We also consider combinations of left jumps, right jumps, and various start
configurations. For this purpose, by analogy with the previous denotations, we define
𝑏 𝑎 𝑒 𝑏 𝑎 𝑒 𝑏 𝑎 𝑒 𝑏
𝑙 GJFA, 𝑙 GJFA, 𝑙 GJFA, 𝑟 GJFA, 𝑟 GJFA, 𝑟 GJFA, 𝑙 JFA, 𝑙 JFA, 𝑙 JFA, 𝑟 JFA,
𝑎 𝑒 𝑏
𝑟 JFA, and 𝑟 JFA. For example, 𝑟 GJFA denotes the family of languages accepted by
GJFAs that perform only right jumps and starts at the beginning.

Theorem 3.38 𝑟𝑎 GJFA = 𝑟𝑎 JFA = 𝑟𝑏 GJFA = 𝑟𝑏 JFA = 𝑙𝑏 GJFA = 𝑙𝑏 JFA = REG

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

Theorem 3.39 𝑟𝑒 GJFA = 𝑟𝑒 JFA = {∅, {𝜀}}


Proof Consider JFAs 𝑀 = ({𝑠}, {𝑎}, ∅, 𝑠, ∅) and 𝑀 ′ = ({𝑠}, {𝑎}, ∅, 𝑠, {𝑠}) to see
that {∅, {𝜀}} ⊆ 𝑟𝑒 GJFA and {∅, {𝜀}} ⊆ 𝑟𝑒 JFA. The converse inclusion also holds.
Indeed, any GJFA that starts the acceptance process of a string 𝑤 from 𝑤𝑠 and that
can make only right jumps accepts either ∅ or {𝜀}. □
Open Problem What are the properties of 𝑙𝑒 GJFA and 𝑙𝑒 JFA? □
Notice that Open Problem, in fact, suggests an investigation of the properties
of 𝑙𝑎 GJFA and 𝑙𝑎 JFA.

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.

Other models that characterize GJFA and JFA

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

commutative context-free grammars, letter bounded languages, and regular expres-


sions over comutative monoids. None of them, however, works as acceptors while
JFAs and GJFAs do, thus resembling the way ordinary FAs work. This resemblance
is probably the key reason why the automata theory has recently paid greater at-
tention to them than the other formalisms that define GJFA and JFA. Moreover, in
Vorel [2018], the connection of GJFAs with graph-controlled insertion systems and
Galiukschov semicontextual grammars is established.

3.2 One-Way Jumping Finite Automata

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.

Definitions and Examples

Let us now formally define two types of one-way jumping finite automata.

Definition 3.7 A right one-way jumping finite automaton (ROWJFA) is a quintuple


𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹), where 𝑄 is a finite set of states, Δ is an input alphabet of 𝑀,
𝑄 ∩ Δ = ∅, 𝑠 ∈ 𝑄 is the start state, 𝐹 ⊆ 𝑄 is a set of final states, and 𝑅 ⊆ 𝑄 × Δ × 𝑄
is finite set of rules. 𝑅 differs from FA (see Definition 2.2) such that 𝑎 ∈ Δ for every
𝑞𝑎 → 𝑝 ∈ 𝑅, and no two rules in 𝑅 have the same left-hand side. A configuration of
𝑀 is simply any string in 𝑄Δ∗ . Furthermore, we define the right one-way jumping
relation over 𝑄Δ∗ , symbolically denoted by ⟳, as follows. Let 𝑥, 𝑦 ∈ Δ∗ , 𝑎 ∈ Δ,
56 3 Jumping One-Head Automata

𝑝, 𝑞 ∈ 𝑄 and 𝑝𝑎 → 𝑞 ∈ 𝑅. Then 𝑀 makes a jump from 𝑝𝑥𝑎𝑦 to 𝑞𝑦𝑥, symbolically


written as

𝑝𝑥𝑎𝑦 ⟳ 𝑞𝑦𝑥
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

𝐿(𝑀, ⟳) = {𝑤 ∈ Δ∗ | 𝑠𝑤 ⟳∗ 𝑓 for some 𝑓 ∈ 𝐹}.

𝑝
𝑑 𝑑
𝑒

𝑒
⟳ 𝑝

𝑏
𝑏

𝑎 𝑐
𝑐

Fig. 3.5 A ROWJFA jump.

Definition 3.8 A left one-way jumping finite automaton (LOWJFA) is a quintuple


𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) where 𝑄, Δ, 𝑅, 𝑠, and 𝐹 are defined as in a ROWJFA. A
configuration of 𝑀 is any string in Σ∗ 𝑄. The binary left one-way jumping relation,
symbolically denoted by ⟲, over Σ∗ 𝑄, is defined as follows. Let 𝑥, 𝑦 ∈ Σ∗ , 𝑎 ∈ Σ,
𝑝, 𝑞 ∈ 𝑄, and 𝑝𝑎 → 𝑞 ∈ 𝑅. Then, 𝑀 makes a jump from 𝑦𝑎𝑥 𝑝 to 𝑥𝑦𝑞, symbolically
written as

𝑦𝑎𝑥 𝑝 ⟲ 𝑥𝑦𝑞
)∗
if 𝑥 ∈ (Δ − Δ 𝑝 where Δ 𝑝 = {𝑏 ∈ Δ | 𝑝𝑏 → 𝑏 ∈ 𝑅}.
In a straightforward analogy with a ROWJFA, we can define ⟲𝑚 where 𝑚 ≥ 0,
⟲+ , ⟲∗ , and 𝐿 (𝑀).

We denote the families of languages accepted by ROWJFAs and LOWJFA by


ROWJFA and LOWJFA, respectively.
Observe that when 𝑀 applies a rule 𝑝𝑎 → 𝑞, it first jumps to the appropriate
position while skipping the symbols no rule in 𝑝 can read and, then, 𝑀 reads 𝑎
which is different from JFAs.
Notice that the majority of results study a ROWJFA instead of a LOWJFA.

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

𝑠𝑎𝑎𝑏𝑎 ⟳ 𝑠𝑎𝑏𝑎 ⟳ 𝑠𝑏𝑎 ⟳ 𝑓 𝑎


Since both 𝑎 and 𝑏 can be read in the start state, 𝑀 cannot skip any 𝑎 or 𝑏, and
after reading first 𝑏, 𝑀 cannot read 𝑎 anymore. Hence, 𝑀 accepts 𝐿(𝑀) = {𝑎}∗ {𝑏}∗
which is accepted neither by an JFA nor a GJFA (see Lemma 3.3).
Example 3.4 Consider a ROWJFA 𝑀 = ({𝑠, 𝑝, 𝑞}, Δ = {𝑎, 𝑏, 𝑐}, 𝑅, 𝑠, {𝑠}), where 𝑅
consists of

𝑠𝑎 → 𝑝, 𝑝𝑏 → 𝑞, 𝑞𝑐 → 𝑠
Although 𝑀 can deterministically jump only to the right, thanks to implicit
continuation of the input string from the end back to the beginning, 𝑀 accepts, for
instance, 𝑏𝑐𝑎𝑎𝑐𝑏 as follows

𝑠𝑏𝑐𝑎𝑎𝑐𝑏 ⟳ 𝑝𝑎𝑐𝑏𝑏𝑐 ⟳ 𝑞𝑏𝑐𝑎𝑐 ⟳ 𝑠𝑎𝑐𝑏 ⟳ 𝑝𝑐𝑏 ⟳ 𝑞𝑐 ⟳ 𝑠


Obviously, 𝑀 accepts 𝐿 (𝑀) = {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) =
occur(𝑤, 𝑐)} which is another non-context-free language.
Note that it is straighforward to add more states and more rules to handle a
balanced number of occurrences of symbols in Δ such that card(Δ) ≥ 2. On the
other hand, Beier and Holzer [2019] prove that {𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) ≠
occur(𝑤, 𝑏)} ∉ ROWJFA.

Results and Properties

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

Similarly to Theorem 3.4, every language accepted by a ROWJFA working with


a unary alphabet is regular.
Theorem 3.41 (Chigahara et al. [2016]) Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a ROWJFA
such that card(Δ) = 1. Then, 𝐿(𝑀) is regular.

Corollary 3.15 (Chigahara et al. [2016]) {𝑎 𝑝 | 𝑝 is a prime number} ∉ ROWJFA.

Based on the properties of right one-way jumping relation, there is a corollary


in Chigahara et al. [2016] that resembles the pumping lemma for regular languages
(see [Meduna, 2000, Lemma 4.1.1]).
Corollary 3.16 (Chigahara et al. [2016]) For any 𝐿 ∈ ROWJFA there is a constant
𝑘 ∈ N such that for every string 𝑤 ∈ 𝐿 with |𝑤| ≥ 𝑘, there exists 𝑥𝑦𝑧 ∈ perm(𝑤)
satisfying the following three conditions:
(1) 𝑦 ≠ 𝜀;
(2) |𝑥𝑦| ≤ 𝑘;
(3) 𝑥𝑦 𝑚 𝑧 ∈ 𝐿, for all 𝑚 ≥ 0.

Corollary 3.17 (Beier and Holzer [2019])


(i) REG ⊂ ROWJFA ⊂ CS.
(ii) ROWJFA and JFA are incomparable.
(iii) Every language 𝐿 ∈ ROWJFA is semilinear.

Corollary 3.18 (Chigahara et al. [2016]) {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0} ∉ ROWJFA

Theorem 3.42 ROWJFA is not closed under Kleene star and Kleene plus.

Proof (sketch) Consider 𝐿 = {𝑐𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏), 𝑤 ∈


{𝑎, 𝑏}∗ }. There is a ROWJFA 𝑀 that accepts 𝐿 such that 𝑀 = ({𝑠, 𝑡, 𝑞, 𝑓 }, {𝑎, 𝑏, 𝑐},
𝑅, 𝑠, { 𝑓 }), where 𝑅 consists of

𝑠𝑎 → 𝑡, 𝑠𝑏 → 𝑡, 𝑠𝑐 → 𝑓 , 𝑓 𝑎 → 𝑞, 𝑞𝑏 → 𝑓
Similarly to the proof of Theorem 3.40, 𝑡 represents a trap state, so again 𝑀 cannot
accept the input string after entering 𝑡. Clearly, 𝐿 ∗ ∉ ROWJFA and 𝐿 + ∉ ROWJFA
that is proved in details in Chigahara et al. [2016]. □
The summary of closure properties of ROWJFA family compared with the prop-
erties of DJFA (see Theorem 3.3 and Table 3.1) are given in Table 3.3, where + and
− mark closure and non-closure, respectively. These results are proved in Chigahara
et al. [2016] and Beier and Holzer [2019].
3.2 One-Way Jumping Finite Automata 59

ROWJFA DJFA
concatenation − −
union − +
complement − +
intersection − +
int. with regular languages − −
Kleene star − −
mirror image − +
substitution − −
homomorphism − −
inverse homomorphism − +

Table 3.3 Closure properties of ROWJFA compared with JFA.

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

Other Jumping Models

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

When we talk about parallelism in modern computer science, we almost automati-


cally mean some form of parallel processing or parallel computing. By these terms
we refer to situations where we want to split some large task into smaller chunks of
work in such a way that the chunks can be executed in parallel on separate process-
ing units, and the whole task can thus be computed faster than if it was executed
completely sequentially on a single processing unit.
Nonetheless, this perception of the notion of parallelism can change quite rapidly
when we wander into more theoretical branches of computer science; especially if
we consider the basic research in the theory of formal languages. There are many
formal models in this area that incorporate some form of parallelism, but they utilize
very diverse mechanics in the background to achieve their goal. If we take a broader
look at these formal models and the basic research in general, we can roughly divide
parallelism in formal language theory into the following three categories:
(P.1) Power-increasing Parallelism that increases the expressive power of the
model;
(P.2) Behavior-changing Parallelism that is a fundamental part of the behavior of
the model;
4 Jumping Multi-Head Automata 63

(P.3) Work-distributing Parallelism that splits the work of the task.


Power-increasing Parallelism. The most commonly studied category in the basic
research is probably category (P.1). This is especially noticeable in formal grammars.
Considering classical formal grammars in general, there is a big difference if a model
can use only context-free rules or also non-context-free rules. It is much harder to
deal with the non-context-free rules from both the theoretical and practical points
of view. Therefore, there is a large incentive to study models that can use only the
context-free (or even more restricted) rules but that also incorporate some additional
mechanisms which further increase their generative power.
In formal grammars, the models can incorporate parallelism in such a way that,
in each step of the rewriting process, the grammar rewrites several symbols in the
sentential form at once in parallel. Let us mention some well-known models that
match this description:
• scattered context grammars (see Definition 6.1);
• 𝑛-parallel (right-)linear grammars (see Definition 4.3);
• simple matrix grammars (see Ibarra [1970] and Rosebrugh and Wood [1974]);
• unordered scattered context grammars (see Mayer [1972]);
• substitution selective grammars (see Kleijn [1983]).
In the case of finite automata, we can imagine the parallelism of category (P.1)
as a parallel cooperation of multiple heads. There are several well-known models
of finite automata that utilize more than one head; nonetheless, their behavior does
not fall precisely into one specific category of parallelism. So we will leave their
description for later.
A very common property of models from this category is that we can freely select
their degree of parallelism. More specifically, we can choose 𝑛 which represents the
number of symbols or heads that are considered together in a single step of the model.
Then, if 𝑛 = 1, we get the power of a classical non-augmented model (e.g., the power
of context-free grammars); and, for 𝑛 > 1, we either get an infinite hierarchy of more
powerful models or the power of the model increases at first but then stabilizes.
Behavior-changing Parallelism. Considering category (P.2), we are looking at the
models that have parallelism rooted inseparably into their core structure. From our
exploration of this topic, it seems that the models which fall into this category are
usually related to biology.
On the one hand, there are massively parallel models such as Lindenmayer sys-
tems (see Rozenberg and Salomaa [1980, 1997a]; Meduna and Švec [2005]; Meduna
and Zemek [2014]; Meduna and Soukup [2017b]) that are based on the evolution
process. In these models, all eligible symbols in the sentential form are always rewrit-
ten together at once in parallel. Consequently, it is not possible to select a constant
degree of parallelism for these models since the conditions continuously change
depending on the current task. Indian grammars (see Siromoney and Krithivasan
[1974]) represent another grammatical parallelism of this kind: during every deriva-
tion step, they select any rule and simultaneously apply it to all occurrences of its
left-hand side in the current sentential form.
64 4 Jumping Multi-Head Automata

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.

Parallelism and Finite Automata

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

necessarily work in a parallel way. Considering multi-head finite automata that


actually do work in a parallel way, we can find two distinct categories of their
behavior:
(PA.1) Multi-head automata where each head works on an independent copy of
the input;
(PA.2) Multi-head automata where heads cooperate to process the single input.
The first category seems to be the most studied one so far. Let us mention
some prominent models that fit into this description: classical Watson–Crick finite
automata (see Section 2.2.3), multi-head finite automata (see Rosenberg [1965];
Inoue et al. [1979]; Ďuriš and Hromkovič [1983]; Holzer et al. [2009]), and parallel
communicating finite automata systems (see Holzer et al. [2009]). In these models,
the heads can work in parallel; however, their behavior can be hardly seen as parallel
processing since it does not speed up the task in any way. In most cases, there is a
single read-only input tape that must be completely traversed with all heads until the
conclusion about the acceptance of the input is reached.
We only know about a few models that fall into the second category. These are
finite automaton models introduced by Nagy that utilize two heads with the following
behavior. The first head reads the input from left to right, the second head reads the
input from right to left, and the processing of the input ends when the heads meet
each other on the tape. This concept was explored several times in various models:
• Two-head finite automata (see Nagy [2012]);
• 5′ → 3′ Watson–Crick finite automata (see Nagy [2008, 2009, 2010, 2013];
Nagy et al. [2017]; Parchami and Nagy [2018]; Nagy and Parchami [2020]);
• Multicounter 5′ → 3′ Watson–Crick finite automata (see Eğecioğlu et al. [2010];
Nagy et al. [2011]; Hegedüs et al. [2012]);
• Two-head finite-state acceptors with translucent letters (see Nagy and Otto [2019,
2020]).
In these models, the heads truly cooperate in parallel on a single tape such that each
head exclusively process only some portion of the input string; thus, this behavior
can be seen as parallel processing. Naturally, their degree of parallelism is always
two.
In this chapter, apart from jumping Watson–Crick finite automata that belongs
into (PA.1) category, all remaining studied models in this chapter fall into (PA.2)
category, since each head of these automata typically processes only a part of the
input string.

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.

4.1 Double-Jumping Finite Automata

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.

Definitions and Examples

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.

𝑟 : 𝑝𝑥 → 𝑞

𝑟 : 𝑝𝑥 → 𝑞

↶ ↷ ↶ ↷
𝑝 ... 𝑥 ... 𝑥 ...

Fig. 4.1 GJFA with 2-jumping relation ♦♦ ↷.

𝑟 : 𝑝𝑥 → 𝑞

𝑟 : 𝑝𝑥 → 𝑞

↶ ↷
𝑝 ... 𝑥 ... 𝑥 ...

Fig. 4.2 GJFA with 2-jumping relation ◀▶ ↷.

An investigation of these new relations represents the central subject of this


section, which demonstrates a significant impact on the behavior of the jumping
4.1 Double-Jumping Finite Automata 69

automata under consideration. In the correspondence to these relations, it describes


and compares the language families accepted by these automata and studies closure
properties of these families.
Definition 4.1 Let 𝑋 denote the set of all configurations of 𝑀. A 2-configuration
of 𝑀 is any string in 𝑋 𝑋. Let 𝑋 2 denote the set of all 2-configurations of 𝑀. For
brevity, let 𝑡 1 𝑡2 ∈ {♦♦, ▶▶, ▶◀, ◀▶, ◀◀} such that 𝑡 1 , 𝑡2 ∈ {♦, ▶, ◀}. The binary 𝑡1 𝑡 2
2-jumping relation, symbolically denoted by 𝑡1 𝑡2 ↷, over 𝑋 2 , is defined as follows. Let
𝜁1 𝜁2 , 𝜗1 𝜗2 ∈ 𝑋 2 , where 𝜁1 , 𝜁2 , 𝜗1 , 𝜗2 ∈ 𝑋, and ℎ ∈ 𝑅; then, 𝑀 makes a 𝑡 1 𝑡 2 2-jump
from 𝜁1 𝜁2 to 𝜗1 𝜗2 according to ℎ, symbolically written as 𝜁1 𝜁2 𝑡1 𝑡2 ↷ 𝜗1 𝜗2 [ℎ]
if and only if 𝜁1 𝑡1 ↷ 𝜗1 [ℎ] and 𝜁2 𝑡2 ↷ 𝜗2 [ℎ]. Depending on the specific type of
jumps ♦♦, ▶▶, ▶◀, ◀▶, ◀◀, we use the following naming: unrestricted, right-right,
right-left, left-right, left-left 2-jumping relation (or 2-jump), respectively.
Let 𝑜 be any of the jumping direct relations introduced above. In the standard
way, extend 𝑜 to 𝑜 𝑚 , 𝑚 ≥ 0; 𝑜+ ; and 𝑜∗ . To express that 𝑀 only performs jumps
according to 𝑜, write 𝑀𝑜 . If 𝑜 is one of the relations ♦ ↷, ▶ ↷, ◀ ↷, set 𝐿(𝑀𝑜 ) =
{𝑢𝑣 | 𝑢, 𝑣 ∈ Δ∗ , 𝑢𝑠𝑣 𝑜∗ 𝑓 , 𝑓 ∈ 𝐹}. In fact, by Definition 3.1, GJFA coincides
to {𝐿 (𝑀♦ ↷ ) | 𝑀 is a GJFA}, 𝑙 GJFA to {𝐿(𝑀◀ ↷ ) | 𝑀 is a GJFA}, and 𝑟 GJFA to
{𝐿(𝑀▶ ↷ ) | 𝑀 is a GJFA}.
If 𝑜 is one of the relations ♦♦ ↷, ▶▶ ↷, ▶◀ ↷, ◀▶ ↷, ◀◀ ↷, we call 𝑀𝑜 a double-
jumping finite automaton and set 𝐿 (𝑀𝑜 ) = {𝑢𝑣𝑤 | 𝑢, 𝑣, 𝑤 ∈ Δ∗ , 𝑢𝑠𝑣𝑠𝑤 𝑜 ∗ 𝑓 𝑓 , 𝑓 ∈
𝐹}. 𝐿(𝑀𝑜 ) is referred to as the language of 𝑀𝑜 .
To illustrate this terminology, take 𝑜 = ♦♦ ↷. Consider 𝑀♦♦ ↷ . Notice that
𝐿(𝑀♦♦ ↷ ) = {𝑢𝑣𝑤 | 𝑢, 𝑣, 𝑤 ∈ Δ∗ , 𝑢𝑠𝑣𝑠𝑤 ♦♦ ↷∗ 𝑓 𝑓 , 𝑓 ∈ 𝐹}. 𝐿 (𝑀♦♦ ↷ ) is re-
ferred to as the language of 𝑀♦♦ ↷ . Set DJFA♦♦ = {𝐿(𝑀♦♦ ↷ ) | 𝑀 is a GJFA};
DJFA♦♦ is referred to as the language family accepted by GJFAs according to ♦♦ ↷.
Furthermore, set DJFA2 = DJFA♦♦ ∪ DJFA▶▶ ∪ DJFA▶◀ ∪ DJFA◀▶ ∪ DJFA◀◀ .
Example 4.1 Let 𝑀 = ({𝑠}, {𝑎, 𝑏}, 𝑅, 𝑠, {𝑠}) be very simple GJFA, where 𝑅 consists
of a single rule 1 : 𝑠𝑎𝑏 → 𝑠. Let us explore 𝑀 working with some 2-jumping relations
for an input 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑏.
First, see 𝑀 accepts 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑏 by ♦♦ ↷:

𝑎𝑠𝑎𝑏𝑏 𝑠𝑎𝑏𝑎𝑏 ♦♦ ↷ 𝑠𝑎𝑏 𝑠𝑎𝑏 ♦♦ ↷ 𝑠𝑠

We get a different behavior for ◀▶ ↷:

𝑎𝑠𝑎𝑏𝑏 𝑠𝑎𝑏𝑎𝑏 ◀▶ ↷ 𝑎𝑠𝑏 𝑠𝑎𝑏

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

Therefore, it is easy to see that 𝐿(𝑀♦♦ ↷ ) ⊂ 𝐿(𝑀◀▶↷ ) = 𝐿 (𝑀▶◀↷ ) = {𝑎𝑏𝑎𝑏}∗ .

Lastly, we define an auxiliary subfamily of the family of regular languages that


will be useful to the study of the accepting power of GJFAs that perform right-left
and left-right 2-jumps.

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.

𝑐𝑠𝑎𝑏𝑐𝑠𝑎𝑏𝑐𝑐 ♦♦ ↷ 𝑓 𝑐𝑐𝑐 𝑓 𝑐 [1] ♦♦ ↷ 𝑓 𝑐 𝑓 𝑐 [2] ♦♦ ↷ 𝑓 𝑓 [2]


Therefore, the accepted language is 𝐿 (𝑀♦♦ ↷ ) = {𝑐 𝑘 𝑎𝑏𝑐 𝑚 𝑎𝑏𝑐 𝑛 | 𝑘 + 𝑚 +
𝑛 is an even integer, 𝑘, 𝑚, 𝑛 ≥ 0}.

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.

On the unrestricted 2-jumping relation

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

Lemma 4.2 There is no GJFA 𝑀♦ ↷ that accepts {𝑐 𝑘 𝑎𝑏𝑐 𝑚 𝑎𝑏𝑐 𝑛 | 𝑘 + 𝑚 + 𝑛 is an


even integer, 𝑘, 𝑚, 𝑛 ≥ 0}.

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}.□

Theorem 4.1 GJFA and DJFA♦♦ are incomparable.

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 {𝑎𝑎}. □

On the right-left 2-jumping relation

Lemma 4.3 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA; then, every 𝑥 ∈ 𝐿(𝑀▶◀ ↷ ) can be


written as 𝑥 = 𝑢 1 𝑢 2 . . . 𝑢 𝑛 𝑢 𝑛 . . . 𝑢 2 𝑢 1 , where 𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛.

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

We follow Lemma 4.3 and its proof. Let 𝑝, 𝑞 ∈ 𝑄, 𝑓 ∈ 𝐹, and 𝑦, 𝑢, 𝑣, 𝑤 ∈ Δ∗ .


Observe that every time 𝑀 can make a 2-jump 𝑝𝑦𝑤𝑦 𝑝 ▶◀ ↷ 𝑞𝑤𝑞 according to
( 𝑝, 𝑦, 𝑞) ∈ 𝑃, 𝐺 can also make the derivation step 𝑢 𝑝𝑣 ⇒ 𝑢𝑦𝑞𝑦𝑣 according to
𝑝 → 𝑦𝑞𝑦 ∈ 𝑃. Moreover, every time 𝑀 is in a final state 𝑓 , 𝐺 can finish the string
with 𝑓 → 𝜀 ∈ 𝑃. Finally, observe that 𝐺 cannot do any other action; therefore,
𝐿(𝑀▶◀ ↷ ) = 𝐿 (𝐺). □

Theorem 4.2 DJFA▶◀ ⊂ LINeven .

Proof DJFA▶◀ ⊆ LINeven follows from Lemma 4.4 and the structure of its proof.
LINeven ⊈ DJFA▶◀ follows from Lemma 4.1. □

Lemma 4.5 There is a GJFA 𝑀 such that 𝐿(𝑀▶◀ ↷ ) = {𝑤 ∈ Δ∗ | 𝑤 is an even


palindrome}.

Proof Consider an arbitrary alphabet Δ. Define the GJFA 𝑀▶◀ ↷ = ({ 𝑓 }, Δ, 𝑅, 𝑓 ,


{ 𝑓 }) where 𝑅 = {( 𝑓 , 𝑎, 𝑓 ) | 𝑎 ∈ Δ}. We follow Lemma 4.3 and its proof, which
shows that every 𝑥 ∈ 𝐿 (𝑀▶◀ ↷ ) can be written as 𝑥 = 𝑢 1 𝑢 2 . . . 𝑢 𝑛 𝑢 𝑛 . . . 𝑢 2 𝑢 1 , where
𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛. Observe that we use only rules reading single symbols,
thus we can even say that 𝑢 𝑖 ∈ (Δ ∪ {𝜀}), 1 ≤ 𝑖 ≤ 𝑛, which, in fact, models the string
pattern of the even palindrome. Moreover, we use only one sole state that can accept
all symbols from Δ; therefore, 𝐿(𝑀▶◀ ↷ ) = {𝑤 ∈ Δ∗ | 𝑤 is an even palindrome}. □

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, 𝐾𝑚,𝑛 = 𝐿(𝐺). □

Theorem 4.3 SEL ⊂ REGeven .

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. □

Theorem 4.4 SEL ⊂ DJFA▶◀ .

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. □

Theorem 4.5 The following pairs of language families are incomparable:


(i) DJFA▶◀ and REG (REGeven );
(ii) DJFA▶◀ and FIN (FINeven ).

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 = ∅? □

On the left-right 2-jumping relation

Lemma 4.8 Let 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹) be a GJFA; then, every 𝑥 ∈ 𝐿(𝑀◀▶ ↷ ) can be


written as 𝑥 = 𝑢 𝑛 . . . 𝑢 2 𝑢 1 𝑢 1 𝑢 2 . . . 𝑢 𝑛 , where 𝑛 ∈ N, and 𝑢 𝑖 ∈ Δ∗ , 1 ≤ 𝑖 ≤ 𝑛.
74 4 Jumping Multi-Head Automata

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.

On the right-right 2-jumping relation

Example 4.3 Consider the GJFA 𝑀▶▶ ↷ = ({𝑠, 𝑝, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }), where Δ =


{𝑎, 𝑏, 𝑐} and 𝑅 consists of the rules (𝑠, 𝑎𝑏, 𝑝) and ( 𝑝, 𝑐, 𝑓 ). Starting from 𝑠, 𝑀
4.1 Double-Jumping Finite Automata 75

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

with the assumption that 𝐿 (𝑀▶▶ ↷ ) is a context-free language. Therefore, 𝐿(𝑀▶▶ ↷ )


is a non-context-free language.

Theorem 4.7 DJFA▶▶ ⊂ CSeven .

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, 𝐿(𝑀▶▶ ↷ ) = 𝐿 (𝐺). □

Theorem 4.8 The following pairs of language families are incomparable:


(i) DJFA▶▶ and CF (CFeven );
(ii) DJFA▶▶ and REG (REGeven );
(iii) DJFA▶▶ and FIN (FINeven ).

Proof DJFA▶▶ ⊈ CF (CFeven ), DJFA▶▶ ⊈ REG (REGeven ), and DJFA▶▶ ⊈ FIN


(FINeven ) follow from Example 4.5. CF (CFeven ) ⊈ DJFA▶▶ , REG (REGeven ) ⊈
DJFA▶▶ , and FIN (FINeven ) ⊈ DJFA▶▶ follow from Lemma 4.1. Moreover, observe
that DJFA▶▶ clearly contains the context-free language from Example 4.4, regular
language {𝑎 2𝑛 | 𝑛 ≥ 0}, and finite language from Example 4.3. □

On the left-left 2-jumping relation

Example 4.6 Consider the GJFA 𝑀◀◀ ↷ = ({𝑠, 𝑝, 𝑓 }, Δ, 𝑅, 𝑠, { 𝑓 }), where Δ =


{𝑎, 𝑏, 𝑐} and 𝑅 consists of the rules (𝑠, 𝑐, 𝑝) and ( 𝑝, 𝑎𝑏, 𝑓 ). Starting from 𝑠,
𝑀 has to read two times 𝑐 and two times 𝑎𝑏. Observe that if the second jump
skips some symbols, then they cannot be ever read afterward. However, the first
jump is not so harshly restricted and can potentially skip some symbols which
will be read later by the second jump. Note that this precisely resembles the in-
verted behavior of the right-right 2-jumping relation. As a result, the language is
𝐿 (𝑀◀◀ ↷ ) = {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}.
4.1 Double-Jumping Finite Automata 77

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.

Theorem 4.9 DJFA◀◀ ⊂ CSeven .

Proof The reasoning is identical to Theorem 4.7. □

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 𝐿(𝑀◀◀ ↷ ) = 𝐿 (𝐺).

Proof The reasoning is exactly the same as in Lemma 4.11. □

Theorem 4.10 The following pairs of language families are incomparable:


(i) DJFA◀◀ and CF (CFeven );
(ii) DJFA◀◀ and REG (REGeven );
(iii) DJFA◀◀ and FIN (FINeven ).

Proof DJFA◀◀ ⊈ CF (CFeven ), DJFA◀◀ ⊈ REG (REGeven ), and DJFA◀◀ ⊈ FIN


(FINeven ) follow from Example 4.8. CF (CFeven ) ⊈ DJFA◀◀ , REG (REGeven )
⊈ DJFA◀◀ , and FIN (FINeven ) ⊈ DJFA◀◀ follow from Lemma 4.1. Moreover,
DJFA◀◀ contains the context-free language from Example 4.7, regular language
{𝑎 2𝑛 | 𝑛 ≥ 0}, and finite language from Example 4.6. □

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
{𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑎𝑐𝑏𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}. □

Lemma 4.14 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 {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}. □

Theorem 4.11 DJFA▶▶ and DJFA◀◀ are incomparable.

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

In this section, we show the closure properties of DJFA▶◀ , DJFA◀▶ , DJFA▶▶ ,


and DJFA◀◀ under various operations. Recall that, by Theorem 4.6, DJFA▶◀ and
DJFA◀▶ are equivalent, and so their closure properties coincide.
4.1 Double-Jumping Finite Automata 79

CSeven

LINeven CF

REGeven DJFA▶◀ DJFA◀▶ DJFA▶▶ DJFA◀◀

FINeven SEL REG

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. □

Theorem 4.13 DJFA▶◀ (DJFA◀▶ ) is closed under endmarking on both sides.

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.

Proof Let 𝑜 be one of the relations ▶◀ ↷, ▶▶ ↷, and ◀◀ ↷; and 𝑀𝑜 = (𝑄 1 , Δ1 ,


𝑅1 , 𝑠1 , 𝐹1 ), and 𝑁𝑜 = (𝑄 2 , Δ2 , 𝑅2 , 𝑠2 , 𝐹2 ) be two GJFAs. Without a loss of generality,
assume that 𝑄 1 ∩ 𝑄 2 = ∅ and 𝑠 ∉ (𝑄 1 ∪ 𝑄 2 ). Define the GJFA 𝐻𝑜 = (𝑄 1 ∪ 𝑄 2 ∪
{𝑠}, Δ1 ∪ Δ2 , 𝑅1 ∪ 𝑅2 ∪ {(𝑠, 𝜀, 𝑠1 ), (𝑠, 𝜀, 𝑠2 )}, 𝑠, 𝐹1 ∪ 𝐹2 ). Observe that 𝐿(𝐻𝑜 ) =
𝐿 (𝑀𝑜 ) ∪ 𝐿 (𝑁𝑜 ) holds in all modes. Indeed, the leading 2-jump only selects whether
𝐻𝑜 enters 𝑀𝑜 or 𝑁𝑜 , and this leading 2-jump introduces no other new configuration
to the configurations of 𝑀𝑜 and 𝑁𝑜 . □

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.

Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄 1 , Δ, 𝑅1 , 𝑠1 , 𝐹1 ) and FA 𝑁 = (𝑄 2 , Δ, 𝑅2 ,


𝑠2 , 𝐹2 ). We can define a new GJFA 𝐻▶◀ ↷ = (𝑄 3 , Δ, 𝑅3 , 𝑠3 , 𝐹3 ) that simulates both
𝑀 and 𝑁 in the same time and that accepts the input string 𝑥 if and only if both
𝑀 and 𝑁 also accept 𝑥. Note that the requirement of identical Δ does not affect the
generality of the result. We are going to use two auxiliary functions that will help us
4.1 Double-Jumping Finite Automata 81

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, 𝐿 (𝐻▶◀ ↷ ) = 𝐿 (𝑀▶◀ ↷ ) ∩ 𝐿 (𝑁). □

Theorem 4.21 DJFA▶◀ (DJFA◀▶ ) is closed under intersection.

Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄 1 , Δ, 𝑅1 , 𝑠1 , 𝐹1 ) and GJFA 𝑁 ▶◀ ↷ = (𝑄 2 ,


Δ, 𝑅2 , 𝑠2 , 𝐹2 ). We can define a new GJFA 𝐻▶◀ ↷ = (𝑄, Δ, 𝑅, 𝑠, 𝐹) that simulates
both 𝑀 and 𝑁 in the same time such that 𝐿(𝐻▶◀ ↷ ) = 𝐿Ð(𝑀▶◀ ↷ ) ∩ 𝐿 (𝑁 ▶◀ ↷ ).
To support the construction of 𝑄 and 𝑅, define Δ ≤ℎ = 𝑖=0 ℎ
Δ𝑖 , and let 𝑘 be
the maximum length of the right-hand sides of the rules from 𝑅1 ∪ 𝑅2 . First,
set 𝑄 to {⟨𝑞 1 , 𝑥, 𝑥 ′ , 𝑞 2 , 𝑦, 𝑦 ′ ⟩ | 𝑞 1 ∈ 𝑄 1 , 𝑞 2 ∈ 𝑄 2 , 𝑥, 𝑥 ′ , 𝑦, 𝑦 ′ ∈ Δ ≤2𝑘−1 }, 𝐹 to
{⟨ 𝑓1 , 𝜀, 𝜀, 𝑓2 , 𝜀, 𝜀⟩ | 𝑓1 ∈ 𝐹1 , 𝑓2 ∈ 𝐹2 }, and 𝑠 = ⟨𝑠1 , 𝜀, 𝜀, 𝑠2 , 𝜀, 𝜀⟩. Then, we con-
struct 𝑅 in the following way:
(I) Add (⟨𝑝, 𝑥, 𝑥 ′ , 𝑞, 𝑦, 𝑦 ′ ⟩, 𝑎, ⟨𝑝, 𝑥𝑎, 𝑎𝑥 ′ , 𝑞, 𝑦𝑎, 𝑎𝑦 ′ ⟩) to 𝑅, for all 𝑎 ∈ Δ ≤ 𝑘 , 𝑝 ∈ 𝑄 1 ,
𝑞 ∈ 𝑄 2 , and 𝑥, 𝑥 ′ , 𝑦, 𝑦 ′ ∈ Δ ≤2𝑘−1− | 𝑎| .
(II) For each ( 𝑝, 𝑎, 𝑝 ′ ) ∈ 𝑅1 , add (⟨𝑝, 𝑎𝑥, 𝑥 ′ 𝑎, 𝑞, 𝑦, 𝑦 ′ ⟩, 𝜀, ⟨𝑝 ′ , 𝑥, 𝑥 ′ , 𝑞, 𝑦, 𝑦 ′ ⟩) to 𝑅,
for all 𝑥, 𝑥 ′ ∈ Δ ≤2𝑘−1− | 𝑎| , 𝑞 ∈ 𝑄 2 , and 𝑦, 𝑦 ′ ∈ Δ ≤2𝑘−1 .
(III) For each (𝑞, 𝑏, 𝑞 ′ ) ∈ 𝑅2 , add (⟨𝑝, 𝑥, 𝑥 ′ , 𝑞, 𝑏𝑦, 𝑦 ′ 𝑏⟩, 𝜀, ⟨𝑝, 𝑥, 𝑥 ′ , 𝑞 ′ , 𝑦, 𝑦 ′ ⟩) to 𝑅,
for all 𝑝 ∈ 𝑄 1 , 𝑥, 𝑥 ′ ∈ Δ ≤2𝑘−1 , and 𝑦, 𝑦 ′ ∈ Δ ≤2𝑘−1− |𝑏| .
82 4 Jumping Multi-Head Automata

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 two GJFAs:


𝑀▶▶ ↷ = ({𝑠, 𝑟, 𝑝, 𝑓 }, {𝑎, 𝑏}, {(𝑠, 𝑎, 𝑟), (𝑟, 𝑏𝑏, 𝑝), ( 𝑝, 𝑎, 𝑓 )}, 𝑠, { 𝑓 });
𝐿(𝑀▶▶ ↷ ) = {𝑎𝑏𝑏𝑎𝑎𝑏𝑏𝑎, 𝑎𝑏𝑏𝑎𝑏𝑏𝑎𝑎, 𝑎𝑏𝑎𝑏𝑎𝑏𝑏𝑎, 𝑎𝑏𝑎𝑏𝑏𝑏𝑎𝑎, 𝑎𝑎𝑏𝑏𝑎𝑏𝑏𝑎, 𝑎𝑎𝑏𝑏𝑏𝑏𝑎𝑎},
and 𝑁 ▶▶ ↷ = ({𝑠, 𝑟, 𝑝, 𝑓 }, {𝑎, 𝑏}, {(𝑠, 𝑎, 𝑟), (𝑟, 𝑏, 𝑝), ( 𝑝, 𝑏𝑎, 𝑓 )}, 𝑠, { 𝑓 });
𝐿 (𝑁 ▶▶ ↷ ) = {𝑎𝑏𝑏𝑎𝑎𝑏𝑏𝑎, 𝑎𝑏𝑏𝑎𝑏𝑎𝑏𝑎, 𝑎𝑏𝑎𝑏𝑎𝑏𝑏𝑎, 𝑎𝑏𝑎𝑏𝑏𝑎𝑏𝑎, 𝑎𝑎𝑏𝑏𝑎𝑏𝑏𝑎, 𝑎𝑎𝑏𝑏𝑏𝑎𝑏𝑎}.
The intersection 𝐿 ∩ = 𝐿(𝑀▶▶ ↷ )∩𝐿 (𝑁 ▶▶ ↷ ) = {𝑎𝑏𝑏𝑎𝑎𝑏𝑏𝑎, 𝑎𝑏𝑎𝑏𝑎𝑏𝑏𝑎, 𝑎𝑎𝑏𝑏𝑎𝑏𝑏𝑎}
should also belong into DJFA▶▶ . However, consider the simplest GJFA 𝑃▶▶ ↷ that
can accept string 𝑎𝑎𝑏𝑏𝑎𝑏𝑏𝑎; it surely has to start with reading two times only one
symbol 𝑎, then it can read two times 𝑏𝑏 together, and then it finishes by reading
two times symbol 𝑎. However, this is exactly the behavior of 𝑀▶▶ ↷ , and we see that
𝐿(𝑀▶▶ ↷ ) is a proper superset of 𝐿 ∩ . Therefore, there cannot be any GJFA 𝐻▶▶ ↷
that defines 𝐿 ∩ . Trivially, both 𝐿 (𝑀▶▶ ↷ ) and 𝐿 (𝑁 ▶▶ ↷ ) are also regular languages.
The similar proof for DJFA◀◀ is left to the reader. □

Theorem 4.23 DJFA▶◀ (DJFA◀▶ ) is closed under reversal.


4.1 Double-Jumping Finite Automata 83

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.

Proof Consider language 𝐾 = {𝑎𝑏𝑎𝑏𝑐𝑐, 𝑎𝑏𝑐𝑎𝑏𝑐}, which is accepted by the GJFA


𝑀▶▶ ↷ = ({𝑠, 𝑟, 𝑓 }, {𝑎, 𝑏, 𝑐}, {(𝑠, 𝑎𝑏, 𝑟), (𝑟, 𝑐, 𝑓 )}, 𝑠, { 𝑓 }). Therefore, the mirror
language 𝐾𝑚𝑖 = {𝑐𝑐𝑏𝑎𝑏𝑎, 𝑐𝑏𝑎𝑐𝑏𝑎} should also belong into DJFA▶▶ . However,
consider the simplest GJFA 𝑁 ▶▶ ↷ that can accept string 𝑐𝑐𝑏𝑎𝑏𝑎; it surely has to
start with reading two times only symbol 𝑐, then it can read two times 𝑏𝑎 together.
Even in such a case 𝐿(𝑁 ▶▶ ↷ ) = {𝑐𝑐𝑏𝑎𝑏𝑎, 𝑐𝑏𝑐𝑎𝑏𝑎, 𝑐𝑏𝑎𝑐𝑏𝑎}; which is a proper
superset of 𝐾𝑚𝑖 . Therefore, there cannot be any GJFA 𝐻▶▶ ↷ that defines 𝐾𝑚𝑖 . The
similar proof for DJFA◀◀ is left to the reader. □

Theorem 4.25 All DJFA▶◀ (DJFA◀▶ ), DJFA▶▶ , and DJFA◀◀ are not closed under
finite substitution.

Proof Consider language 𝐿 = {𝑎 2𝑛 | 𝑛 ≥ 0}, which clearly belongs into DJFA▶◀ ,



DJFA▶▶ , and DJFA◀◀ . Define the finite substitution 𝜑 : {𝑎}∗ → 2 {𝑎} as 𝜑(𝑎) =
{𝜀, 𝑎}. Observe that 𝜑(𝐿) contains odd-length strings. However, in consequence of
Lemma 4.1, we know that no 2-jumping mode can accept such strings. □

Theorem 4.26 DJFA▶◀ (DJFA◀▶ ) is closed under homomorphism and 𝜀-free ho-
momorphism.

Proof Consider any GJFA 𝑀▶◀ ↷ = (𝑄, Δ, 𝑅1 , 𝑠, 𝐹) and arbitrary homomorphism


𝜑 : Δ∗ → Δ′∗ . Define the GJFA 𝑁 ▶◀ ↷ = (𝑄, Δ′ , 𝑅2 , 𝑠, 𝐹), where 𝑅2 is con-
structed in the following way. For each ( 𝑝, 𝑎, 𝑞) ∈ 𝑅1 , add ( 𝑝, 𝜑(𝑎), 𝑞) to 𝑅2 .
Observe 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. Then, every 𝑦 ∈ 𝐿(𝑁 ▶◀ ↷ ) can
be surely written as 𝑦 = 𝜑(𝑢 1 )𝜑(𝑢 2 ) . . . 𝜑(𝑢 𝑛 )𝜑(𝑢 𝑛 ) . . . 𝜑(𝑢 2 )𝜑(𝑢 1 ), and clearly
𝜑(𝐿 (𝑀▶◀ ↷ )) = 𝐿 (𝑁 ▶◀ ↷ ). □

Theorem 4.27 Both DJFA▶▶ and DJFA◀◀ are not closed under homomorphism
and 𝜀-free homomorphism.

Proof Consider language 𝐾 = {𝑎𝑏𝑎𝑏, 𝑎𝑎𝑏𝑏}, which is accepted by the GJFA


𝑀▶▶ ↷ = ({𝑠, 𝑟, 𝑓 }, {𝑎, 𝑏}, {(𝑠, 𝑎, 𝑟), (𝑟, 𝑏, 𝑓 )}, 𝑠, { 𝑓 }). Define the 𝜀-free homo-
morphism 𝜑 : {𝑎, 𝑏}+ → {𝑎, 𝑏, 𝑐}+ as 𝜑(𝑎) = 𝑎 and 𝜑(𝑏) = 𝑏𝑐. By applying
𝜑 to 𝐾, we get 𝜑(𝐾) = {𝑎𝑏𝑐𝑎𝑏𝑐, 𝑎𝑎𝑏𝑐𝑏𝑐}. Consider the simplest GJFA 𝑁 ▶▶ ↷
84 4 Jumping Multi-Head Automata

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. □

The summary of closure properties of DJFA▶◀ , DJFA◀▶ , DJFA▶▶ , and DJFA◀◀


is given in Figure 4.4, where + marks closure, and − marks non-closure.

DJFA▶◀ , DJFA◀▶ DJFA▶▶ DJFA◀◀


endmarking (both sides) − (+) − (−) − (−)
concatenation − − −
square (𝐿 2 ) − − −
shuffle − − −
union + + +
complement − − −
intersection + − −
int. with regular languages + − −
reversal + − −
finite substitution − − −
homomorphism + − −
𝜀-free homomorphism + − −
inverse homomorphism − − −

Fig. 4.4 Summary of closure properties.

Remarks and Conclusion

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.

4.2 Multi-Parallel Jumping Finite Automata

This section proposes a modification of jumping finite automata—𝑛-parallel jump-


ing finite automata, originated in Kocman and Meduna [2016]. This modification
presents a concept where the input is divided into several arbitrary parts and these
parts are then separately processed with distinct synchronized heads. A quite sim-
ilar concept was thoroughly studied in terms of formal grammars, where several
nonterminals are being synchronously rewritten at once; for example, simple matrix
grammars (see Ibarra [1970]) and 𝑛-parallel grammars (see Rosebrugh and Wood
[1975]; Wood [1977, 1973]; Rosebrugh and Wood [1973, 1974]). However, to the
best of our knowledge, no such research was done in terms of automata, where 𝑛
heads synchronously read from distinct parts on the single tape. When this concept
is combined with the mechanics of jumping finite automata, each part can be read
discontinuously, but the overall order between parts is preserved; such an automaton
then can handle additional languages (e.g., {𝑎}∗ {𝑏}∗ ). Therefore, this modification
represents the combined model of discontinuous and continuous reading.
The unrestricted version of jumping finite automata accepts a quite unique lan-
guage family which initially had no known counterparts in grammars until jumping
grammars were introduced (see Křivka and Meduna [2015]). Therefore, we have de-
cided to base our initial research mainly on the restricted version of these automata
which use only right jumps. Note that restricted jumping finite automata define the
same language family as classical finite automata. However, when such a restriction
86 4 Jumping Multi-Head Automata

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]).

Definition 4.3 For 𝑛 ≥ 1, an 𝑛-parallel right-linear grammar (𝑛-PRLG) is an (𝑛+3)-


tuple 
𝐺 = 𝑁1 , . . . , 𝑁 𝑛 , Δ, 𝑆, 𝑃
where 𝑁𝑖 , 1 ≤ 𝑖 ≤ 𝑛, are pairwise disjoint nonterminal alphabets, Δ is a terminal
alphabet, 𝑆 ∉ 𝑁 is an initial symbol, where 𝑁 = 𝑁1 ∪ · · · ∪ 𝑁 𝑛 , and 𝑃 is a finite set
of rules that contains these three kinds of rules
1. 𝑆 → 𝑋1 · · · 𝑋𝑛 , 𝑋𝑖 ∈ 𝑁𝑖 , 1 ≤ 𝑖 ≤ 𝑛;
2. 𝑋 → 𝑤𝑌 , 𝑋, 𝑌 ∈ 𝑁𝑖 for some 𝑖, 1 ≤ 𝑖 ≤ 𝑛, 𝑤 ∈ Δ∗ ;
3. 𝑋 → 𝑤, 𝑋 ∈ 𝑁, 𝑤 ∈ Δ∗ .
For 𝑥, 𝑦 ∈ (𝑁 ∪ Δ ∪ {𝑆}) ∗ ,
𝑥 ⇒𝐺 𝑦
if and only if
1. either 𝑥 = 𝑆 and 𝑆 → 𝑦 ∈ 𝑃,
2. or 𝑥 = 𝑦 1 𝑋1 · · · 𝑦 𝑛 𝑋𝑛 , 𝑦 = 𝑦 1 𝑥1 · · · 𝑦 𝑛 𝑥 𝑛 , where 𝑦 𝑖 ∈ Δ∗ , 𝑥𝑖 ∈ Δ∗ 𝑁 ∪Δ∗ , 𝑋𝑖 ∈ 𝑁𝑖 ,
and 𝑋𝑖 → 𝑥𝑖 ∈ 𝑃, 1 ≤ 𝑖 ≤ 𝑛.
Let 𝑥, 𝑦 ∈ (𝑁 ∪ Δ ∪ {𝑆}) ∗ and ℓ > 0. Then, 𝑥 ⇒ℓ𝐺 𝑦 if and only if there exists a
sequence
𝑥 0 ⇒𝐺 𝑥 1 ⇒𝐺 · · · ⇒𝐺 𝑥 ℓ
where 𝑥0 = 𝑥, 𝑥ℓ = 𝑦. As usual, 𝑥 ⇒+𝐺 𝑦 if and only if there exists ℓ > 0 such that
𝑥 ⇒ℓ𝐺 𝑦, and 𝑥 ⇒∗𝐺 𝑦 if and only if 𝑥 = 𝑦 or 𝑥 ⇒+𝐺 𝑦.
The language of 𝐺 is defined as

𝐿(𝐺) = 𝑤 ∈ Δ∗ | 𝑆 ⇒+𝐺 𝑤

4.2 Multi-Parallel Jumping Finite Automata 87

A language 𝐾 ⊆ Δ∗ is an 𝑛-parallel right-linear language if there is an 𝑛-


PRLG 𝐺 such that 𝐾 = 𝐿 (𝐺). The family of 𝑛-parallel right-linear languages is
denoted by 𝑛-PRL.

Definitions

In this section, we define a modification of jumping finite automata—𝑛-parallel


jumping finite automata—which read input strings discontinuously with multiple
synchronized heads. Moreover, we also define a more restricted mode for these
automata which uses only the right jumps.

Definition 4.4 For 𝑛 ≥ 1, an 𝑛-parallel general jumping finite automaton (𝑛-PGJFA)


is a quintuple
𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹)
where 𝑄 is a finite set of states, Δ is an input alphabet, 𝑄 ∩ Δ = ∅, 𝑅 ⊆ 𝑄 × Δ∗ × 𝑄
is finite, 𝑆 ⊆ 𝑄 𝑛 is a set of start state strings, and 𝐹 ⊆ 𝑄 is a set of final states.
Members of 𝑅 are referred to as rules of 𝑀 and instead of ( 𝑝, 𝑦, 𝑞) ∈ 𝑅, we write
𝑝𝑦 → 𝑞 ∈ 𝑅.
A configuration of 𝑀 is any string in Δ∗ 𝑄Δ∗ . Let 𝑋 denote the set of all config-
urations over 𝑀. The binary jumping relation, symbolically denoted by ↷, over 𝑋,
is defined as follows. Let 𝑥, 𝑧, 𝑥 ′ , 𝑧 ′ ∈ Δ∗ such that 𝑥𝑧 = 𝑥 ′ 𝑧 ′ and 𝑝𝑦 → 𝑞 ∈ 𝑅; then,
𝑀 makes a jump from 𝑥 𝑝𝑦𝑧 to 𝑥 ′ 𝑞𝑧 ′ , symbolically written as

𝑥 𝑝𝑦𝑧 ↷ 𝑥 ′ 𝑞𝑧 ′

Let $ be a special symbol, $ ∉ (𝑄 ∪ Δ). An 𝑛-configuration of 𝑀 is any string


in (𝑋 {$}) 𝑛 . Let 𝑛 𝑋 denote the set of all 𝑛-configurations over 𝑀. The binary 𝑛-
jumping relation, symbolically denoted by 𝑛 ↷, over 𝑛 𝑋, is defined as follows. Let
𝜁1 $ · · · 𝜁 𝑛 $, 𝜗1 $ · · · 𝜗𝑛 $ ∈ 𝑛 𝑋, so 𝜁𝑖 , 𝜗𝑖 ∈ 𝑋, 1 ≤ 𝑖 ≤ 𝑛; then, 𝑀 makes an 𝑛-jump
from 𝜁1 $ · · · 𝜁 𝑛 $ to 𝜗1 $ · · · 𝜗𝑛 $, symbolically written as

𝜁1 $ · · · 𝜁 𝑛 $ 𝑛↷ 𝜗1 $ · · · 𝜗𝑛 $

if and only if 𝜁𝑖 ↷ 𝜗𝑖 for all 1 ≤ 𝑖 ≤ 𝑛. In the standard manner, we extend 𝑛 ↷ to


+ ∗
𝑛 ↷ , where 𝑚 ≥ 0. Let 𝑛 ↷ and 𝑛 ↷ denote the transitive closure of 𝑛 ↷ and
𝑚

transitive-reflexive closure of 𝑛 ↷, respectively.


The language accepted by 𝑀, denoted by 𝐿(𝑀, 𝑛), is defined as

𝐿(𝑀, 𝑛) = {𝑢 1 𝑣 1 · · · 𝑢 𝑛 𝑣 𝑛 | 𝑢 1 𝑠1 𝑣 1 $ · · · 𝑢 𝑛 𝑠 𝑛 𝑣 𝑛 $ 𝑛↷ 𝑓1 $ · · · 𝑓𝑛 $,

𝑢 𝑖 , 𝑣 𝑖 ∈ Δ , 𝑠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 𝑦1 → 𝑞1 𝑝2 𝑦2 → 𝑞2 𝑝𝑛 𝑦𝑛 → 𝑞𝑛

𝑝1 𝑝2 𝑝𝑛

Fig. 4.5 𝑛-PGJFA.

𝜁1 𝜁2 𝜁𝑛

... 𝑦1 ... $ ... 𝑦2 ... $ ··· $ ... 𝑦𝑛 ...


↷ ↷ ↷
𝑝1 𝑦1 → 𝑞1 𝑝2 𝑦2 → 𝑞2 𝑝𝑛 𝑦𝑛 → 𝑞𝑛

𝑝1 𝑝2 𝑝𝑛

Fig. 4.6 𝑛-PGJFA using right 𝑛-jumps.

Definition 4.5 For 𝑛 ≥ 1, let 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹) be an 𝑛-PGJFA, and let 𝑋 denote


the set of all configurations over 𝑀. The binary right jumping relation, symbolically
denoted by 𝑟 ↷, over 𝑋, is defined as follows. Let 𝑤, 𝑥, 𝑦, 𝑧 ∈ Δ∗ , and 𝑝𝑦 → 𝑞 ∈ 𝑅;
then, 𝑀 makes a right jump from 𝑤 𝑝𝑦𝑥𝑧 to 𝑤𝑥𝑞𝑧, symbolically written as

𝑤 𝑝𝑦𝑥𝑧 𝑟 ↷ 𝑤𝑥𝑞𝑧

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 $ · · · 𝜗𝑛 $

if and only if 𝜁𝑖 𝑟 ↷ 𝜗𝑖 for all 1 ≤ 𝑖 ≤ 𝑛.


We extend 𝑛−𝑟 ↷ to 𝑛−𝑟 ↷𝑚 , 𝑛−𝑟 ↷+ , and 𝑛−𝑟 ↷∗ , where 𝑚 ≥ 0, by analogy with
extending the corresponding notations for 𝑛 ↷. Let 𝐿(𝑀, 𝑛−𝑟) denote the language
accepted by 𝑀 using only right 𝑛-jumps.

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

To demonstrate the behavior of these automata, we present two simple examples.

Example 4.9 Consider the 2-PGJFA

𝑀 = ({𝑠, 𝑟, 𝑝, 𝑞}, Δ, 𝑅, {𝑠𝑟 }, {𝑠, 𝑟})

where Δ = {𝑎, 𝑏, 𝑐, 𝑑} and 𝑅 consists of the rules

𝑠𝑎 → 𝑝, 𝑝𝑏 → 𝑠, 𝑟𝑐 → 𝑞, 𝑞𝑑 → 𝑟

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

𝐿 (𝑀, 2) = {𝑢𝑣 | 𝑢 ∈ {𝑎, 𝑏}∗ , 𝑣 ∈ {𝑐, 𝑑}∗ , occur(𝑢, 𝑎) = occur(𝑢, 𝑏) =


occur(𝑣, 𝑐) = occur(𝑣, 𝑑)}

𝐿(𝑀, 2−𝑟) = {(𝑎𝑏) 𝑛 (𝑐𝑑) 𝑛 | 𝑛 ≥ 0}

Example 4.10 Consider the 2-PGJFA

𝑀 = ({𝑠, 𝑟, 𝑡}, Δ, 𝑅, {𝑠𝑠}, {𝑠})

where Δ = {𝑎, 𝑏, 𝑐} and 𝑅 consists of the rules

𝑠𝑎 → 𝑟, 𝑟𝑏 → 𝑡, 𝑡𝑐 → 𝑠

Starting from 𝑠𝑠, 𝑀 has to read some 𝑎, 𝑏, and 𝑐 with both heads, entering again the
start (and also the final) states 𝑠𝑠. Therefore, the accepted languages are

𝐿(𝑀, 2) = {𝑢𝑣 | 𝑢, 𝑣 ∈ {𝑎, 𝑏, 𝑐}∗ , occur(𝑢, 𝑎) = occur(𝑢, 𝑏) = occur(𝑢, 𝑐) =


occur(𝑣, 𝑎) = occur(𝑣, 𝑏) = occur(𝑣, 𝑐)}

𝐿(𝑀, 2−𝑟) = {𝑢𝑢 | 𝑢 ∈ {𝑎𝑏𝑐}∗ }

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

Unrestricted 𝒏-Jumping Relation

This section gives a basic characterization of the language families accepted by


𝑛-PGJFAs with unrestricted 𝑛-jumps. Most notably, we show that 𝑛-PGJFAs with
unrestricted 𝑛-jumps define an infinite hierarchy of language families.

Theorem 4.29 PGJFA♦1 = GJFA.

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. □

Lemma 4.15 For all 𝑛 ≥ 1, there is an 𝑛-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹) such that


Δ = {𝑎 1 , . . . , 𝑎 𝑛 } and 𝐿(𝑀, 𝑛) = {𝑎 1 }∗ · · · {𝑎 𝑛 }∗ .

Proof For any 𝑛 ≥ 1, define the 𝑛-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹), where 𝑄 =


{𝑠1 , . . . , 𝑠 𝑛 }, Δ = {𝑎 1 , . . . , 𝑎 𝑛 }, 𝑅 = {𝑠𝑖 𝑎 𝑖 → 𝑠𝑖 , 𝑠𝑖 → 𝑠𝑖 | 1 ≥ 𝑖 ≥ 𝑛},
𝑆 = {𝑠1 · · · 𝑠 𝑛 }, and 𝐹 = 𝑄. Observe that each head handles a different symbol
and that it can read zero or one occurrence of this symbol in each step. Therefore,
the accepted language is clearly 𝐿 (𝑀, 𝑛) = {𝑎 1 }∗ · · · {𝑎 𝑛 }∗ . □

Lemma 4.16 For all 𝑛 ≥ 1 and 𝑚 > 𝑛, there is no 𝑛-PGJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑆, 𝐹)


such that Δ = {𝑎 1 , . . . , 𝑎 𝑚 } and 𝐿(𝑀, 𝑛) = {𝑎 1 }∗ · · · {𝑎 𝑚 }∗ .

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 }∗ · · · {𝑎 𝑚 }∗ . □

Theorem 4.30 For all 𝑛 ≥ 1, PGJFA♦𝑛 ⊂ PGJFA♦(𝑛+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

that 𝑓 ∉ (𝑄 ∪Δ), 𝑄 ′ = 𝑄 ∪{ 𝑓 }, 𝑅 ′ = 𝑅∪{ 𝑓 → 𝑓 }, 𝑆 ′ = {𝑤 𝑓 | 𝑤 ∈ 𝑆}, 𝐹 ′ = 𝐹 ∪{ 𝑓 }.


It is not hard to see that 𝐿(𝑀, 𝑛) = 𝐿 (𝑁, 𝑛 + 1). Second, for all 𝑛 ≥ 1, PGJFA♦(𝑛+1)
⊈ PGJFA♦𝑛 follows directly from Lemmas 4.15 and 4.16. □

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.

Theorem 4.31 For all 𝑛 ≥ 1, FIN ⊂ PGJFA♦𝑛 .

Proof This theorem directly follows from FIN ⊂ GJFA (see Theorem 3.8). □

Theorem 4.32 For all 𝑛 ≥ 1, PGJFA♦𝑛 ⊈ REG and PGJFA♦𝑛 ⊈ CF.

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). □

Theorem 4.33 For all 𝑛 ≥ 1, PGJFA♦𝑛 ⊂ CS.

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♦𝑛 ≠ ∅. □

Right 𝒏-Jumping Relation

This section gives a detailed characterization of the language families accepted by


𝑛-PGJFA with right 𝑛-jumps. First, we prove that 𝑛-PGJFAs with right 𝑛-jumps and
𝑛-PRLGs define the same language families.

Lemma 4.17 For every 𝑛-PRLG 𝐺 = (𝑁1 , . . . , 𝑁 𝑛 , Δ, 𝑆1 , 𝑃), there is an 𝑛-PGJFA


𝑀 = (𝑄, Δ, 𝑅, 𝑆2 , 𝐹) using only right 𝑛-jumps such that 𝐿 (𝑀, 𝑛−𝑟) = 𝐿 (𝐺).

Proof Let 𝐺 = (𝑁1 , . . . , 𝑁 𝑛 , Δ, 𝑆1 , 𝑃) be an 𝑛-PRLG. Without loss of generality,


assume that 𝑓 ∉ (𝑁1 ∪ · · · ∪ 𝑁 𝑛 ∪ Δ). Keep the same 𝑛 and define the 𝑛-PGJFA

𝑀 = ({ 𝑓 } ∪ 𝑁1 ∪ · · · ∪ 𝑁 𝑛 , Δ, 𝑅, 𝑆2 , { 𝑓 }),

where 𝑅 and 𝑆2 are constructed in the following way:


(1) For each rule of the form 𝑆1 → 𝑋1 · · · 𝑋𝑛 , 𝑋𝑖 ∈ 𝑁𝑖 , 1 ≤ 𝑖 ≤ 𝑛, in 𝑃,
add the start state string 𝑋1 · · · 𝑋𝑛 to 𝑆2 .
(2) For each rule of the form 𝑋 → 𝑎𝑌 , 𝑋, 𝑌 ∈ 𝑁𝑖 , for some 𝑖, 1 ≤ 𝑖 ≤ 𝑛, 𝑎 ∈ Δ∗ , in
𝑃, add the rule 𝑋𝑎 → 𝑌 to 𝑅.
(3) For each rule of the form 𝑋 → 𝑎, 𝑋 ∈ 𝑁𝑖 , for some 𝑖, 1 ≤ 𝑖 ≤ 𝑛, 𝑎 ∈ Δ∗ , in 𝑃,
add the rule 𝑋𝑎 → 𝑓 to 𝑅.
92 4 Jumping Multi-Head Automata

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 , 𝑃),

where 𝑁1 , . . . , 𝑁 𝑛 , and 𝑃 are constructed in the following way:


(1) For each state 𝑝 ∈ 𝑄,
add the nonterminal 𝑝 𝑖 to 𝑁𝑖 for all 1 ≤ 𝑖 ≤ 𝑛.
(2) For each start state string 𝑝 1 · · · 𝑝 𝑛 ∈ 𝑆2 , 𝑝 𝑖 ∈ 𝑄, 1 ≤ 𝑖 ≤ 𝑛,
add the start rule 𝑆1 → 𝑝 11 · · · 𝑝 𝑛𝑛 to 𝑃.
(3) For each rule 𝑝𝑦 → 𝑞 ∈ 𝑅, 𝑝, 𝑞 ∈ 𝑄, 𝑦 ∈ Δ∗ ,
add the rule 𝑝 𝑖 → 𝑦𝑞 𝑖 to 𝑃 for all 1 ≤ 𝑖 ≤ 𝑛.
(4) For each state 𝑝 ∈ 𝐹,
add the rule 𝑝 𝑖 → 𝜀 to 𝑃 for all 1 ≤ 𝑖 ≤ 𝑛.
4.2 Multi-Parallel Jumping Finite Automata 93

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

REG PGJFA▶1 = 1-PRL r GJFA


PGJFA♦1 = GJFA

FIN

Fig. 4.7 PGJFA▶𝑛 related to other language families.

Theorem 4.38 PGJFA▶1 = 𝑟 GJFA = REG.


Proof This theorem directly follows from 1-PRL = REG (see Rosebrugh and Wood
[1975]) and from 𝑟 GJFA = REG (see Theorem 3.33). □
Theorem 4.39 PGJFA▶2 ⊂ CF.
Proof This theorem directly follows from 2-PRL ⊂ CF (see Rosebrugh and Wood
[1975]). □
Theorem 4.40 PGJFA▶𝑛 ⊂ CS and there exist non-context-free languages in
PGJFA▶𝑛 for all 𝑛 ≥ 3.
Proof This theorem directly follows from the same results for 𝑛-PRL (see Rosebrugh
and Wood [1975]). □
Figure 4.7 displays the mutual relationships between the language families resulting
from 𝑛-PGJFAs with unrestricted 𝑛-jumps as well as 𝑛-PGJFAs with right 𝑛-jumps;
FIN, REG, CF, and CS are included, too.

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.

4.3 Jumping Watson–Crick Finite Automata

In this section, we concetrate our principal attention to special variants of WKFAs


with two simultaneously working heads that process their input strings in a non-
continuous manner. Specifically, we explore jumping Watson–Crick finite automata,
introduced in Mahalingam et al. [2019], which represent a straightforward application
of jumping computation in terms of WKFAs, discussed in Section 2.2.3.
Recall that in many respects, WKFAs resemble classical FAs, but their tapes
always carry double-stranded (DS) sequences of symbols from an alphabet, Δ. At
the beginning, both strands necessarily satisfy a symmetric complementarity relation,
𝜌. Formally, the notion of a WKFA is defined as a sextuple 𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹),
where 𝑄, Δ, 𝑠, and 𝐹 have the same meaning as in the definition of an FA (see
96 4 Jumping Multi-Head Automata

Section 2.2.1); apart from these components, however, 𝜌 is a symmetric relation on


Δ, and 𝑅 is a finite set of rules of the form
𝑢
𝑝 𝑣 →𝑞
∗
where 𝑝, 𝑞 ∈ 𝑄 and 𝑢, 𝑣 ∈ Δ∗ or in the DS notation 𝑢𝑣 ∈ 𝑉

𝑉∗ .
Now, we give an intuitive insight into the way 𝑀 works. 𝑀 has a single tape
containing a DS string on which 𝑀 works from left to right by performing com-
putational steps according to rules from 𝑅. During a step, 𝑀 independently reads
both strands. Initially, on its tape, 𝑀 has a DS string with both strands satifying
the complementarity defined by 𝜌, and it starts working on its tape from 𝑠 with its
both heads at the leftmost position. If starting from this initial configuration, 𝑀 can
make a sequence of computational steps so it completely reads both strands and
ends up in a final state, the input DS string is accepted. It is worth pointing out that
the complementarity is verified only in the initial configuration; during the rest of
computation, it is not.

↶ ↷
... 𝑎 ... upper strand
𝑝

... 𝑏 ... lower strand


↶ ↷

Fig. 4.8 JWKFA.

It is worth making a note about the notation concerning Watson–Crick models.


As opposed to our specification of 𝑀 given above, many studies describe 𝑀 as
𝑀 = (Δ, 𝜌, 𝑄, 𝑠, 𝐹, 𝑅) instead of 𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹). We use the latter in order
to uniformly specify automata throughout the present book as a whole.
The jumping version of WKFAs explored in the present section works similarly
to the way sketched above except that the read heads are placed at any positions in
the initial configuration, and after performing a computational step, either head can
jump at any position in its strand (see Figure 4.8).
Note that jumping WKFAs fall into the category (PA.1) of parallelism in finite
automata (see page 65).

Definitions and Examples

Now, we formally define jumping Watson–Crick finite automata.


4.3 Jumping Watson–Crick Finite Automata 97

Definition 4.6 A jumping Watson–Crick finite automaton (JWKFA ) is a sextuple


𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹), where 𝑄, Δ, 𝜌, 𝑠, and 𝐹 are the same as in WKFA (see
Definition 2.6), Δ ∩ 𝑄 = ∅, and
∗
𝑅 ⊆ 𝑄 × ΔΔ∗ × 𝑄

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 𝜌 (Δ)

The family of languages accepted by JWKFAs is denoted by JWK.


To demonstrate the behavior of the automata, we present a few simple examples.
Example 4.11 Let a JWKFA 𝑀 = ({𝑠, 𝑞, 𝑓 }, {𝑎, 𝑏, 𝑐}, 𝜌, 𝑅, 𝑠, { 𝑓 }), where 𝜌 is the
identity relation and 𝑅 consists of
 𝑎𝑏  𝜀  𝜀 
𝑠 𝜀 → 𝑠, 𝑠 𝑏𝑐 → 𝑞, 𝑞 𝑏𝑐 → 𝑞,
𝑐 𝑐
𝑞 𝑎 → 𝑓, 𝑓 𝑎 → 𝑓 .
 
Using the rules of 𝑀, we illustrate the acceptance of DS string 𝑎𝑎𝑏𝑏𝑐𝑐
𝑎𝑎𝑏𝑏𝑐𝑐 :

𝑎  𝑎𝑏𝑏𝑐𝑐  𝜀  𝑎𝑏𝑐𝑐  𝑐𝑐  𝜀 
𝑎𝑎𝑏𝑏𝑐𝑐 𝑠 𝜀 𝑊𝐾
↷ 𝑎𝑎𝑏𝑏𝑐𝑐 𝑠 𝜀 𝑊𝐾
↷ 𝑎𝑎𝑏𝑏 𝑠 𝑏𝑐𝑐 𝑊𝐾

𝑐𝑐  𝜀  𝑎𝑎𝑏𝑐  𝑐𝑐  𝑎𝑎𝑏𝑐𝑐  𝑐 
𝑎𝑎 𝑞 𝑏𝑐 𝑊𝐾
↷ 𝑎 𝑞 𝑎𝑏𝑐𝑐𝑐 𝑊𝐾
↷ 𝑎𝑎 𝑓 𝑎𝑏𝑐𝑐𝑐 𝑊𝐾
↷ 𝑓
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
 𝑎  
𝑠 𝜀 → 𝑝, 𝑝 𝑏𝜀 → 𝑞, 𝑞 𝑐𝜀 → 𝑠,
  
𝑠 𝑎𝜀 → 𝑟, 𝑟 𝑏𝜀 → 𝑡, 𝑡 𝑐𝜀 → 𝑠 .

Obviously, the language accepted by 𝑀 is 𝐿(𝑀) = {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) =


occur(𝑤, 𝑏) = occur(𝑤, 𝑐)} which is another non-context-free language.

Variants of JWKFA Models

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.

Example 4.13 To demonstrate a restricted variant introduced in the previous defini-


tion, consider a simple JWKFA 𝑀 = ({𝑠, 𝑝, 𝑓 }, {𝑎, 𝑏}, 𝜌, 𝑅, 𝑠, {𝑠, 𝑓 }), where 𝜌 is
the identity relation and 𝑅 consists of
 𝑎𝑏  𝜀   
𝑠 𝜀 → 𝑠, 𝑠 𝑏𝑎 → 𝑠, 𝑠 𝑎𝜀 → 𝑝, 𝑝 𝑏𝜀 → 𝑓

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

The language accepted by 𝑀 coincides with that from Example 4.12—𝐿(𝑀) =


{𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}.
Consider a similar language, which is, however, based upon a simpler condition;
for instance, take 𝐿 𝑎𝑏 = {𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)}. Notice that
even for a simpler language like this, the construction of a JWKFA that accepts it
represents a non-trivial task.

Results and Properties

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

Proof (sketch) Without loss of generality, assume an 𝜀-free GJFA 𝑀 = (𝑄 𝑀 , Δ,


𝑅 𝑀 , 𝑠, 𝐹) (see Theorem 3.2). We construct an equivalent simple JWKFA 𝑁 = (𝑄 𝑁 ,
Δ, 𝜌, 𝑅 𝑁 , 𝑠, 𝐹), where 𝜌 is the identity relation on Δ.
For every labeled rule 𝑖 : 𝑝𝑤 → 𝑞 from 𝑅 𝑀 , we add the following two rules into
𝑅 𝑁 (with assumption that 𝑞 𝑖 ∉ 𝑄 𝑀 and 𝑞 𝑖 is a new state in 𝑄 𝑁 ):
 
𝑝 𝑤𝜀 → 𝑞 𝑖 and 𝑞 𝑖 𝑤𝜀 → 𝑞

Set 𝑄 𝑁 = 𝑄 𝑀 ∪ {𝑞 𝑖 | 𝑖 is a label of 𝑟 ∈ 𝑅 𝑀 }. It is easy to demonstrate that


𝐿 (𝑀, ↷) = 𝐿 (𝑁), so GJFA ⊆ SJWK. Next, let 𝐿 = {𝑎𝑏}∗ . By Lemma 3.4,
𝐿 ∉ GJFA, and by Example 4.13, 𝐿 ∈ SJWK, so GJFA ⊂ SJWK.
In analogy, we get JFA ⊆ 1JWK. □
Similarly to Theorem 3.5, we have the relation to permutation even for JWKFAs.

Lemma 4.20 (Mahalingam et al. [2019])


 If 𝑀 = (𝑄, Δ, 𝜌, 𝑅, 𝑠, 𝐹) is a JWKFA
with rules from 𝑅 of the form 𝑝 𝑦𝑥 → 𝑞 such that |𝑥| ≤ 1 and |𝑦| ≤ 1, then
𝐿(𝑀) = perm(𝐿(𝑀)).

Corollary 4.1 The following are true:


(i) If 𝐿 ∈ 1JWK, then 𝐿 = perm(𝐿).
(ii) {𝑎𝑏} ∉ 1JWK.

Using anologous technique to the proof of Lemma 3.3, we get the following result.

Lemma 4.21 (Mahalingam et al. [2019]) {𝑎}∗ {𝑏}∗ ∉ JWK


In addition, observe that by Theorem 2.2, REG ⊂ WK, so regular language
{𝑎}∗ {𝑏}∗ ∈ WK. On the other hand, by Lemma 4.21, {𝑎}∗ {𝑏}∗ ∉ JWK, so WK ⊈
JWK. Further, by Example 4.13 and REG ⊂ WK, {𝑎𝑏}∗ ∈ WK ∩ JWK.
100 4 Jumping Multi-Head Automata

Lemma 4.22 (Mahalingam et al. [2019]) FIN ⊂ SJWK

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.

Lemma 4.23 (Mahalingam et al. [2019]) N1JWK ⊂ NSJWK

Proof (sketch) By Definition 4.7, N1JWK ⊆ NSJWK. Consider a stateless


JWKFA 𝑀 with 𝑄 = 𝐹 = {𝑠}, Δ = {𝑎, 𝑏}, the identity relation 𝜌, and 𝑅 con-
taining two rules  𝜀 
𝑠 𝑎𝑏𝜀 → 𝑠 and 𝑠 𝑎𝑏 →𝑠
Obviously, 𝑀 accepts semi-Dyck language 𝐷 1 over {a,b} (see Example 2.9). By (i)
in Corollary 4.1, it is required that not only {𝑎𝑏} but also {𝑏𝑎} belongs to 𝐷 1 which
is a contradiction, so 𝐷 1 ∉ N1JWK. Therefore, N1JWK ⊂ NSJWK. □
Based on the same argument as in the previous proof, we can show that
(i) F1JWK ⊂ FSJWK
(ii) NSJWK ⊂ FSJWK
(iii) N1JWK ⊂ F1JWK
(iv) N1JWK ⊂ FSJWK
Further, by Lemma 4.22 and (ii) in Corollary 4.1, 1JWK ⊂ SJWK. Finally, using
𝐷 1 from the proof of Lemma 4.23 and (i) in Corollary 4.1, we show that NSJWK
F1JWK are incomparable.

Conclusion

Key results comparing the accepting power of different variants of jumping WK


automata are summarized in Figure 4.9.
The results of closure properties of various JWK families are given in Table 4.1,
where + marks closure, − marks non-closure, and ? marks open problem. These
results are proved in Mahalingam et al. [2019, 2020]; Mishra et al. [2021c].
As observed in this and the previous sections of this chapter, there are many ways
we can apply the jumping computation in parallel and/or multi-tape finite automata.
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 101

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].

JWK NJWK FJWK SJWK 1JWK F1JWK N1JWK FSJWK NSJWK


concatenation − − − − − − − − −
union + − + + + + − + −
complement − − − − ? − − − −
intersection ? ? ? ? ? ? + ? ?
Kleene star ? + ? ? − − + ? +
homomorphism ? − ? ? − − − ? −

Table 4.1 Closure properties of JWK families.

4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata

To extend the study of application of jumping computation in DNA computing, this


section investigates alternative variant of Watson–Crick finite automata (WKFAs) in
combination with general jumping finite automata (GJFAs).
Recall that the DNA strands are oriented, consist of four different nucleotides,
and have a 5′ end and a 3′ end. Whenever a two-stranded DNA is considered,
the two strands are oriented in the opposite way, and the nucleotides at the same
position of the two strands must be in Watson–Crick (WK) complementarity relation,
that is, Adenine appears with Thymine on the other strand, and Cytosine appears
with Guanine on the other strand. As described in Section 2.2.3, WKFAs represent
biology-inspired models that can be used to formally process DNA strands. In
essence, a WKFA also works just like a classical finite automaton (FA) except it uses
a WK tape (i.e., double-stranded tape), and it has a separate head for each of the
two strands in the tape. Therefore, this is a group of models that always naturally
use two heads. The classical version of a WKFA processes the input tape quite
conventionally: each head works separately on its own strand of the tape, and both
heads read the input in the traditional symbol-by-symbol left-to-right way.
102 4 Jumping Multi-Head Automata

5′ → 3′ Sensing Watson–Crick Automaton

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(

𝑠 − |𝑥| − |𝑦| if 𝑠 − |𝑥| − |𝑦| ≥ 0;


and 𝑠′ =
−∞ in other cases.
Note that there are no possible steps for the sensing distance −∞. In the standard
manner, let us extend ⇒ to ⇒𝑛 , where 𝑛 ≥ 0; then, based on ⇒𝑛 , let us define ⇒+
and ⇒∗ . The set of all accepted double-stranded strings from WK𝜌 (𝑉), denoted by
𝐿 𝑀 (𝑀), can be defined by the final accepting configurations  that can be reached
from the initial one: A double-stranded string 𝑤 𝑤2
1
∈ WK 𝜌 (𝑉) is accepted by a
104 4 Jumping Multi-Head Automata
 𝑤′   𝑤 ′′ 
sensing 5′ → 3′ WKFA 𝑀 if and only if 𝑤𝜀2 (𝑞 0 , 𝑠0 ) 𝑤𝜀1 ⇒∗ 𝑤1′ (𝑞 𝑓 , 0) 𝑤1′′ ,
 
2 2
 𝑤 ′   𝑤 ′′   1
for 𝑞 𝑓 ∈ 𝐹, where 𝑤1′ 𝑤1′′ = 𝑤 𝑤2 with the proper value of 𝑠 0 (it is +∞ if
2 2
|𝑤 1 | > 𝑟 max , elsewhere it is |𝑤 1 |). Then, the language accepted by 𝑀, denoted
𝐿 (𝑀), is defined as 𝐿(𝑀) = ↑𝑉 (𝐿𝑀 (𝑀)).

Lastly, we briefly mention other closely related 5′ → 3′ WK automata models.


Besides the sensing version, the papers Nagy [2008, 2010, 2013] also define the full-
reading sensing version. The formal definition remains almost identical; however,
the automaton continues with the reading after the heads meet, and both heads
have to read their strand completely from the 5′ end to the 3′ end. Therefore,
this model actually defines the remaining steps for the sensing distance −∞. The
resulting behavior then combines some properties of classical WKFAs and sensing
5′ → 3′ WKFAs. It can be easily seen that the full-reading sensing version is
generally stronger than the sensing version. And finally, the paper by Nagy et al.
[2017] introduces a new version of sensing 5′ → 3′ WKFAs without the sensing
distance. It shows that it is not strictly necessary to know the precise sensing distance
and that we can obtain the same power even if we are able to recognize only the
actual meeting event of heads. Nonetheless, this result does not hold in general if we
consider restricted variants of these models.

Definitions

Considering the previously described sensing 5′ → 3′ WKFAs and full-reading


sensing 5′ → 3′ WKFAs, there is quite a large gap between their behaviors. On
the one hand, sensing 5′ → 3′ WKFAs deliberately read only one of the letters
from each complementary pair of the input sequence. However, this also limits the
movement of their heads because they can read their strands only until they meet.
On the other hand, the definition of full-reading sensing 5′ → 3′ WKFAs allows
both heads to traverse their strands completely. Nonetheless, this also means that
all complementary pairs of the input sequence are again read twice (as in classical
WKFAs). If we consider other formal models, we can see that GJFAs utilize a
mechanism that allows heads to skip (jump over) symbols. Furthermore, the recently
introduced double-jumping modes already behave very similarly to 5′ → 3′ WKFAs.
Due to this natural fit, it is our intention to fill and explore this gap by introducing
the jumping mechanism into sensing 5′ → 3′ WKFAs. We want both heads to be
able to traverse their strands completely, but we also want to read only one of the
letters from each complementary pair of the input sequence. For visual illustration,
see the scheme in Figure 4.10.
From a theoretical perspective, the study of such a model is also beneficial for
the further understanding of the jumping mechanism. In Section 3.1, it was clearly
established that the general behavior of jumping finite automata models is highly
nondeterministic. This can be problematic when we try to create viable parsing
algorithms based on these models (see Fernau et al. [2017]). Therefore, there is an
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 105


3′ 5′
... 𝑎 ...
𝑝
5′ 3′
... 𝑏 ...

Fig. 4.10 A jumping 5′ → 3′ WKFA.

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].

Definition 4.9 A sensing 5′ → 3′ Watson–Crick finite automaton with jumping


feature (sensing 5′ → 3′ WKFA with jumping feature, for short) is a sextuple 𝑀 =
(𝑄, Δ, 𝜌, 𝛿, 𝑞∗ 0 , 𝐹), where 𝑄, Δ, 𝜌, 𝑞 0 , and 𝐹 are the same as in WKFAs, Δ ∩ {#} = ∅,
𝛿 : (𝑄 × ΔΔ∗ × 𝐷) → 2𝑄 , where 𝐷 = {⊕, ⊖} indicates the mutual position of
heads, and 𝛿(𝑞, 𝑤 1
𝑤2 , 𝑠) ≠ ∅ only for finitely many quadruples (𝑞, 𝑤 1 , 𝑤 2 , 𝑠) ∈
∗ ∗
𝑄 × Δ × Δ × 𝐷. We denote the head as ▶-head or ◀-head if it reads from left
to right or from right to left, respectively. We use the symbol ⊕ if the ▶-head is
on the input tape positioned before the ◀-head; otherwise, we use the symbol ⊖. A
 𝑤1′  ′ ′
configuration 𝑤 1
𝑤2 (𝑞, 𝑠) 𝑤2′ has the same structure as in sensing 5 → 3 WKFAs;
however, 𝑠 indicates only the mutual position of heads, and a partially processed
𝑤 𝑤′ 
input 𝑤1 𝑤1′ may not satisfy the complementarity 𝜌. A step of the automaton can be
2 2
of the following two types: Let 𝑤 1′ , 𝑤 2 , 𝑥, 𝑦, 𝑢, 𝑣 ∈ Δ∗ and 𝑤 1 , 𝑤 2′ ∈ (Δ ∪ {#}) ∗ .
𝑥𝑤 ′  | 𝑥|  𝑤′
(1) Reading steps: 𝑤𝑤21𝑦 (𝑞, 𝑠) 𝑤 ′1 ↷ 𝑤1 {#} (𝑞 ′ , 𝑠′ ) {#} |𝑦|1 𝑤 ′ , where 𝑞 ′ ∈
 
2
𝑤2
2
𝛿(𝑞, 𝑦𝑥 , 𝑠), and 𝑠′ is either ⊕ if |𝑤 2 | > |𝑤 1 𝑥| or ⊖ in other cases.

𝑢𝑤 ′  𝑤′ 
(2) Jumping steps: 𝑤𝑤21𝑣 (𝑞, 𝑠) 𝑤 ′1 ↷ 𝑤𝑤12𝑢 (𝑞, 𝑠′ ) 𝑣𝑤1′ , where 𝑠′ is either ⊕ if
 
2 2
|𝑤 2 | > |𝑤 1 𝑢| or ⊖ in other cases.
Note that the jumping steps are an integral and inseparable part of the behavior of
the automaton, and thus they are not affected by the state transition function. In
the standard manner, let us extend ↷ to ↷𝑛 , where 𝑛 ≥ 0; then, based on ↷𝑛 ,
let us define ↷+ and ↷∗ . The set of all accepted double-stranded strings from
WK𝜌 (Δ), denoted by 𝐿 𝑀 (𝑀), can be defined by the final accepting configurations
106 4 Jumping Multi-Head Automata
 1
that can be reached from the initial one: A double-stranded string 𝑤 𝑤2 ∈ WK𝜌 (Δ)
is accepted by a sensing 5 ′ → 3′ WKFA with jumping feature 𝑀 if and only
′
if 𝑤𝜀2 (𝑞 0 , ⊕) 𝑤𝜀1 ↷∗ 𝑤𝜀1 (𝑞 𝑓 , ⊖) 𝑤𝜀′ , for 𝑞 𝑓 ∈ 𝐹, where 𝑤 1′ = 𝑎 1 𝑎 2 · · · 𝑎 𝑚 ,
  
2
𝑤 2′ = 𝑏 1 𝑏 2 · · · 𝑏 𝑚 , 𝑎 𝑖 , 𝑏 𝑖 ∈ (Δ ∪ {#}), and either 𝑎 𝑖 = # and 𝑏 𝑖 ∈ Δ, or 𝑎 𝑖 ∈ Δ and
𝑏 𝑖 = #, for all 𝑖 = 1, . . . , 𝑚, 𝑚 = |𝑤 1 |. The language accepted by 𝑀, denoted 𝐿 (𝑀),
is defined as 𝐿(𝑀) = ↑Δ (𝐿 𝑀 (𝑀)).
From a practical point of view, however, this definition is not ideal. The automaton
can easily end up in a configuration that cannot yield accepting results, and the
correct positions of auxiliary symbols # need to be checked separately at the end
of the process. Therefore, we present a modified definition that has the jumping
mechanism more integrated into its structure. We are also using a simplification for
complementary pairs and treat them as single letters; such a change has no effect
on the accepting power, and this form of input is more natural for formal language
theory.
Definition 4.10 A jumping 5′ → 3′ Watson–Crick finite automaton (jumping 5′ →
3′ WKFA, for short) is a quintuple 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹), where 𝑄, Δ, 𝑞 0 , and 𝐹
are the same as in WKFAs, Δ ∩ {#} = ∅, 𝛿 : (𝑄 × Δ∗ × Δ∗ × 𝐷) → 2𝑄 , where
𝐷 = {⊕, ⊖} indicates the mutual position of heads, and 𝛿(𝑞, 𝑤 1 , 𝑤 2 , 𝑠) ≠ ∅ only
for finitely many quadruples (𝑞, 𝑤 1 , 𝑤 2 , 𝑠) ∈ 𝑄 × Δ∗ × Δ∗ × 𝐷. A configuration
(𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) consists of the state 𝑞 ∈ 𝑄, the mutual position of heads 𝑠 ∈ 𝐷,
and the three unprocessed portions of the input tape: (a) before the first head (𝑤 1 ), (b)
between the heads (𝑤 2 ), and (c) after the second head (𝑤 3 ). A step of the automaton
can be of the following four types: Let 𝑥, 𝑦, 𝑢, 𝑣, 𝑤 2 ∈ Δ∗ and 𝑤 1 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ .
(1) ⊕-reading: (𝑞, ⊕, 𝑤 1 , 𝑥𝑤 2 𝑦, 𝑤 3 ) ↷ (𝑞 ′ , 𝑠, 𝑤 1 {#} | 𝑥 | , 𝑤 2 , {#} | 𝑦 | 𝑤 3 ), where 𝑞 ′ ∈
𝛿(𝑞, 𝑥, 𝑦, ⊕), and 𝑠 is either ⊕ if |𝑤 2 | > 0 or ⊖ in other cases.
(2) ⊖-reading: (𝑞, ⊖, 𝑤 1 𝑦, 𝜀, 𝑥𝑤 3 ) ↷ (𝑞 ′ , ⊖, 𝑤 1 , 𝜀, 𝑤 3 ), where 𝑞 ′ ∈ 𝛿(𝑞, 𝑥, 𝑦, ⊖).
(3) ⊕-jumping: (𝑞, ⊕, 𝑤 1 , 𝑢𝑤 2 𝑣, 𝑤 3 ) ↷ (𝑞, 𝑠, 𝑤 1 𝑢, 𝑤 2 , 𝑣𝑤 3 ), where 𝑠 is either ⊕ if
|𝑤 2 | > 0 or ⊖ in other cases.
(4) ⊖-jumping: (𝑞, ⊖, 𝑤 1 {#}∗ , 𝜀, {#}∗ 𝑤 3 ) ↷ (𝑞, ⊖, 𝑤 1 , 𝜀, 𝑤 3 ).
In the standard manner, let us extend ↷ to ↷𝑛 , where 𝑛 ≥ 0; then, based on ↷𝑛 , let
us define ↷+ and ↷∗ . The accepted language, denoted by 𝐿(𝑀), can be defined by
the final accepting configurations that can be reached from the initial one: A string
𝑤 is accepted by a jumping 5′ → 3′ WKFA 𝑀 if and only if (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) ↷∗
(𝑞 𝑓 , ⊖, 𝜀, 𝜀, 𝜀), for 𝑞 𝑓 ∈ 𝐹.
Even though the structure of this modified definition is considerably different
from Definition 4.9, it is not very difficult to show that both models indeed accept
the same family of languages.
Lemma 4.24 For every sensing 5′ → 3′ WKFA with jumping feature 𝑀, there is a
jumping 5′ → 3′ WKFA 𝑁 such that 𝐿 (𝑀) = 𝐿 (𝑁).
Proof Consider any sensing 5′ → 3′ WKFA with jumping feature 𝑀 = (𝑄, Δ,
𝜌, 𝛿, 𝑞 0 , 𝐹). In [Kuske and Weigel, 2004, Theorem 4], it was shown that any
classical WKFA 𝑀 ′ = (𝑄 ′ , Δ′ , 𝜌 ′ , 𝛿 ′ , 𝑞 0′ , 𝐹 ′ ) can be converted into the classical
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 107

WKFA 𝑀 ′′ = (Δ′ , 𝜌 ′′ , 𝑄 ′ , 𝑞 0′ , 𝐹 ′ , 𝛿 ′′ ) such that 𝜌 ′′ = {(𝑎, 𝑎) | 𝑎 ∈ Δ′ } and 𝐿 (𝑀 ′ ) =


𝐿(𝑀 ′′ ). The new transition ′′
 𝑤 function 𝛿 ′is constructed′ in the following way: For
′ ′
each 𝑞 ∈ 𝛿 (𝑞, 𝑣 ) and 𝑣 ∈ WK𝜌′ (Δ ), where 𝑞, 𝑞 ∈ 𝑄 ′ and 𝑢, 𝑣, 𝑤 ∈ Δ′∗ , let
𝑢

𝑞 ′ ∈ 𝛿 ′′ (𝑞, 𝑤𝑢 ). A similar approach also works for sensing 5′ → 3′ WKFAs. Thus,


without loss of generality, assume that 𝜌 in 𝑀 is an identity relation. Now, let us
define the jumping 5′ → 3′ WKFA 𝑁 = (𝑄, Δ, 𝛿 ′ , 𝑞 0 , 𝐹), where 𝛿 ′ (𝑞, 𝑤 1 , 𝑤 2 , 𝑠) =
𝛿(𝑞, 𝑤 ∗
𝑤2 , 𝑠) for all 𝑞 ∈ 𝑄, 𝑤 1 , 𝑤 2 ∈ Δ , and 𝑠 ∈ {⊕, ⊖}.
1

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

To demonstrate the behavior of the automata, we present a few simple examples.


Example 4.15 Let us recall that 𝐿 = {𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)} is a
well-known nonlinear context-free language. We show that, even though the jumping
directions in the model are quite restricted, we are able to accept such a language.
Consider the following jumping 5′ → 3′ WKFA

𝑀 = ({𝑎, 𝑏}, {𝑠}, 𝑠, {𝑠}, 𝛿)

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:

(𝑠, ⊕, 𝜀, 𝑎𝑎𝑎𝑏𝑏𝑏, 𝜀) ↷ (𝑠, ⊕, #, 𝑎𝑎𝑏𝑏, #) ↷ (𝑠, ⊕, ##, 𝑎𝑏, ##) ↷


(𝑠, ⊖, ###, 𝜀, ###) ↷ (𝑠, ⊖, 𝜀, 𝜀, 𝜀).
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 109

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 𝐿 (𝑀) = 𝐿.

Example 4.16 Consider the following jumping 5′ → 3′ WKFA

𝑀 = ({𝑎, 𝑏}, {𝑠}, 𝑠, {𝑠}, 𝛿)

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.

Example 4.17 Consider the following jumping 5′ → 3′ WKFA

𝑀 = ({𝑎, 𝑏, 𝑐}, {𝑠0 , 𝑠1 , 𝑠2 }, 𝑠0 , {𝑠0 }, 𝛿)

with 𝛿: 𝛿(𝑠0 , 𝑎, 𝑏, ⊕) = {𝑠1 }, 𝛿(𝑠1 , 𝜀, 𝑏, ⊕) = {𝑠0 }, 𝛿(𝑠0 , 𝑐, 𝑐, ⊖) = {𝑠2 }, and 𝛿(𝑠2 , 𝜀,


𝑐, ⊖) = {𝑠0 }. We can divide the accepting process of 𝑀 into two stages. First,
before the heads meet, the automaton ensures that for every 𝑎 on the left-hand
side there are two 𝑏’s on the right-hand side; other symbols are skipped with the
jumps. Second, after the heads meet, the automaton checks if the part before the
meeting point has double the number of 𝑐’s as the part after the meeting point. Thus,
𝐿 (𝑀) = {𝑤 1 𝑤 2 | 𝑤 1 ∈ {𝑎, 𝑐}∗ , 𝑤 2 ∈ {𝑏, 𝑐}∗ , 2 · occur(𝑤 1 , 𝑎) = occur(𝑤 2 , 𝑏),
occur(𝑤 1 , 𝑐) = 2 · occur(𝑤 2 , 𝑐)}.

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.

Definition 4.11 Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a jumping 5′ → 3′ WKFA. Assuming


some states 𝑞, 𝑞 ′ ∈ 𝑄 and a mutual position of heads 𝑠 ∈ {⊕, ⊖}, we say that
𝑞 ′ is reachable from 𝑞 and 𝑠 if there exists a configuration (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) such
that (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) ↷∗ (𝑞 ′ , 𝑠′ , 𝑤 1′ , 𝑤 2′ , 𝑤 3′ ) in 𝑀, 𝑠′ ∈ {⊕, ⊖}, 𝑤 1 , 𝑤 2 , 𝑤 3 , 𝑤 1′ ,
𝑤 2′ , 𝑤 3′ ∈ (Δ ∪ {#}) ∗ .

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.

Lemma 4.27 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 𝑘.

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

S⊖′′ = ( 𝑝 0′′ , 𝑐 0 , 𝑑0 , ⊖, 𝑞 0′′ ) · · · ( 𝑝 ′′ ′′


𝑚 , 𝑐 𝑚 , 𝑑 𝑚 , ⊖, 𝑞 𝑚 ), where 𝑛, 𝑚 ≥ 0, 𝑖 = 0, . . . , 𝑛,
′ ′ ′′ ′′
𝑗 = 0, . . . , 𝑚, 𝑝 𝑖 , 𝑞 𝑖 , 𝑝 𝑗 , 𝑞 𝑗 ∈ 𝑄, 𝑎 𝑖 , 𝑏 𝑖 , 𝑐 𝑗 , 𝑑 𝑗 ∈ Δ∗ .
Third, we consider input 𝑤 ′ = 𝑎 0 · · · 𝑎 𝑛 𝑑 𝑚 · · · 𝑑0 𝑐 0 · · · 𝑐 𝑚 𝑏 𝑛 · · · 𝑏 0 . It is not
hard to construct a computation C ′ of 𝑀 from S⊕′′ , one ⊕-jumping step, S⊖′′ , and
one ⊖-jumping step such that (𝑞 0 , ⊕, 𝜀, 𝑎 0 · · · 𝑎 𝑛 𝑑 𝑚 · · · 𝑑0 𝑐 0 · · · 𝑐 𝑚 𝑏 𝑛 · · · 𝑏 0 , 𝜀) ↷∗
(𝑞 ′ , 𝑠′′′ , {#} | 𝑎0 ···𝑎𝑛 | , 𝑑 𝑚 · · · 𝑑0 𝑐 0 · · · 𝑐 𝑚 , {#} |𝑏𝑛 ···𝑏0 | ) ↷ (𝑞 ′ , ⊖, {#} | 𝑎0 ···𝑎𝑛 | 𝑑 𝑚 · · · 𝑑0 ,
𝜀, 𝑐 0 · · · 𝑐 𝑚 {#} |𝑏𝑛 ···𝑏0 | ) ↷∗ ( 𝑓 , ⊖, {#} | 𝑎0 ···𝑎𝑛 | , 𝜀, {#} |𝑏𝑛 ···𝑏0 | ) ↷ ( 𝑓 , ⊖, 𝜀, 𝜀, 𝜀),
𝑞 ′ ∈ 𝑄, 𝑠′′′ ∈ {⊕, ⊖}. Thus, 𝑤 ′ ∈ 𝐿(𝑀) and there exists 𝑘 ≤ 𝑘 ′ for 𝑀 that
bounds the number of additional steps. □
Next, based on known 𝑀 and 𝐿 (𝑀), we can define the debt of a configuration
of 𝑀. If we follow a computation of 𝑀 on an input 𝑤, we can easily determine
the Parikh vector 𝑜 of symbols already processed from 𝑤 in a current configuration
𝛾. Additionally, with the known 𝐿(𝑀), we can determine Parikh vectors for all
𝑤 ′ ∈ 𝐿(𝑀). The debt of the configuration 𝛾 represents the minimum number of
symbols that have to be added to 𝑜 so that 𝑜 matches the Parikh vector of some
𝑤 ′ ∈ 𝐿(𝑀). Note that we use ∞ to cover situations when no match is possible.

Definition 4.12 Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a jumping 5′ → 3′ WKFA, where


Δ = {𝑎 1 , . . . , 𝑎 𝑛 }, and let 𝑤 ∈ Δ∗ . We define the Parikh vector 𝑜 = (𝑜1 , . . . , 𝑜 𝑛 )
of processed (read) symbols from 𝑤 in a configuration 𝛾 = (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) of
𝑀 reached from an initial configuration (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) of 𝑀 as 𝑜 = 𝜓 Δ (𝑤) −
𝜓 Δ (𝑤 1 𝑤 2 𝑤 3 ), 𝑞 ∈ 𝑄, 𝑠 ∈ {⊕, ⊖}, 𝑤 ∈ Δ∗ , 𝑤 1 , 𝑤 2 , 𝑤 3 ∈ (Δ ∪ {#}) ∗ . Using the
Í𝑛
Parikh mapping of 𝐿(𝑀), we define Δ(𝑜) = { 𝑖=1 (𝑚 𝑖 − 𝑜 𝑖 ) | (𝑚 1 , . . . , 𝑚 𝑛 ) ∈
𝜓 Δ (𝐿(𝑀)), 𝑚 𝑖 ≥ 𝑜𝑖 , 1 ≤ 𝑖 ≤ 𝑛} ∪ {∞}. Finally, we define the debt of the
configuration 𝛾 of 𝑀 as min Δ(𝑜).

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.

Lemma 4.28 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 𝑘.

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

there is no computation that takes 𝑀 from 𝛾 to a final accepting configuration. Thus,


when 𝑀 accepts 𝑤, it must be done over configurations with the debt ≤ 𝑘 ′ . However,
that is a contradiction with the assumption that 𝑀 can accept some 𝑤 ∈ 𝐿 over a
configuration for which the debt cannot be bounded by any 𝑘. □
Observe that the debt alone does not depend on the order of symbols in the strings
of 𝐿(𝑀), e.g., 𝜓 Δ ({(𝑎𝑏𝑐) 𝑛 | 𝑛 ≥ 0}) = 𝜓 Δ ({𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 0}), for Δ = {𝑎, 𝑏, 𝑐}.
However, when the debt is combined with the computational possibilities of 𝑀 on
an input 𝑤, we can show that a language 𝐿 cannot be accepted by 𝑀 if there is no
constant 𝑘 for 𝑀 such that all 𝑤 ∈ 𝐿 can be fully processed over configurations of
𝑀 with the debt bounded by 𝑘.
Lemma 4.29 There is no jumping 5′ → 3′ WKFA 𝑀 such that 𝐿 (𝑀) = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 |
𝑛 ≥ 0}.
Proof Basic idea. Considering any sufficiently large constant 𝑘, we show that 𝑀
cannot process all symbols of 𝑎 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 all 𝑤 ∈ 𝐿 using only configurations
that have their debt bounded by 𝑘. (Observe that if Lemma 4.28 holds for some
constant 𝑘 ′ , it also holds for all 𝑘 ′′ > 𝑘 ′ .) Let 𝑘 min = max{|𝑢𝑣| | 𝛿(𝑞, 𝑢, 𝑣, 𝑠) ≠
∅, 𝑞 ∈ 𝑄, 𝑢, 𝑣 ∈ Δ∗ , 𝑠 ∈ {⊕, ⊖}}. Consider any 𝑘 for 𝑀 such that 𝑘 > 𝑘 min .
Due to the structure of 𝐿, we can represent the debt of the configuration of 𝑀
as ⟨𝑑 𝑎 , 𝑑 𝑏 , 𝑑 𝑐 ⟩, where 𝑑 𝑎 , 𝑑 𝑏 , 𝑑 𝑐 is the minimum number of symbols 𝑎, 𝑏, 𝑐
that 𝑀 must yet to read to get the balanced number of processed symbols. (For
illustration, an initial configuration of 𝑀 has the debt ⟨0, 0, 0⟩. When 𝑀 reads 𝑎,
the following configuration has the debt ⟨0, 1, 1⟩ because at least one 𝑏 and one
𝑐 have yet to be read to keep the number of processed symbols balanced.) When
(𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) ↷∗ (𝑞 𝑓 , ⊖, 𝜀, 𝜀, 𝜀) in 𝑀, 𝑞 𝑓 ∈ 𝐹, for all traversed configurations
must hold 𝑑 𝑎 + 𝑑 𝑏 + 𝑑 𝑐 ≤ 𝑘. Let 𝑤 = 𝑎 10𝑘 𝑏 10𝑘 𝑐10𝑘 .
First, we explore the maximum number of symbols that 𝑀 can read from 𝑤 before
the heads meet. Starting from the initial configuration (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) with the debt
⟨0, 0, 0⟩ and until the mutual position ⊖ is reached, 𝑀 can use ⊕-reading steps to
process symbols and ⊕-jumping steps to skip symbols. Consider different reading
strategies that try to process the maximum number of symbols from 𝑎 10𝑘 𝑏 10𝑘 𝑐10𝑘
before the heads meet. There are three distinct places where the heads of 𝑀 can
meet:
(A) Assume that the heads meet inside the segment of 𝑎’s:
(1) 𝑀 can process (with multiple steps) 𝑎 𝑘 and 𝑐 𝑘 until it reaches the debt
⟨0, 𝑘, 0⟩. Then, 𝑀 has to start read 𝑏’s.
(2) 𝑀 can read 𝑙 symbols together in one step (balanced number of 𝑎’s, 𝑏’s, and
𝑐’s) while keeping the debt ⟨0, 𝑘, 0⟩, 𝑙 < 𝑘. Nonetheless, the ◀-head ends
up in the segment of 𝑏’s.
(3) 𝑀 can process 𝑎 𝑘 and 𝑏 2𝑘 until it reaches the debt ⟨0, 0, 𝑘⟩. Clearly, there
is no way how to read additional 𝑐’s.
114 4 Jumping Multi-Head Automata

No further reading is possible, and this strategy can process 5𝑘 + 𝑙 symbols.


(B) Assume that the heads meet inside the segment of 𝑐’s. Then, this is just a mirror
case of (A), and this strategy can process 5𝑘 + 𝑙 symbols.
(C) Assume that the heads meet inside the segment of 𝑏’s. Observe that in (A) and
(B) the heads can meet on the border of 𝑎’s and 𝑏’s or 𝑏’s and 𝑐’s. There are
no additional possibilities when both heads read 𝑏’s since the debt is limited by
the letters that were already skipped by one of the heads. Thus, this strategy can
process 5𝑘 + 𝑙 symbols as well.
Consequently, before the heads meet, 𝑀 can process no more than 5𝑘 + 𝑙 symbols.
Second, when the heads meet, 𝑎 >4𝑘 𝑏 >4𝑘 𝑐 >4𝑘 has yet to be processed. The heads
are next to each other, and 𝑀 can use ⊖-reading steps to process symbols and ⊖-
jumping steps to remove the auxiliary #’s. Consider different reading strategies that
try to process the maximum number of symbols after the heads meet. There are
several distinct places where the heads of 𝑀 can be positioned:
(A) Assume that the heads are between 𝑎’s and 𝑏’s. It is possible to start with a debt
up to 𝑘. Consider the debt ⟨0, 𝑘, 0⟩. 𝑀 can process 𝑎 𝑘 and 𝑏 2𝑘 until it reaches
the debt ⟨0, 0, 𝑘⟩. Since there is 𝑏 >4𝑘 , it is not possible to reach 𝑐’s. Clearly, it is
not possible to select a different debt that would yield a better result. Thus, this
strategy can process 3𝑘 symbols.
(B) Assume that the heads are between 𝑏’s and 𝑐’s. Then, this is just a mirror case
of (A), and this strategy can process 3𝑘 symbols.
(C) Assume that the heads are in the middle of 𝑏’s with the debt ⟨0, 𝑘, 0⟩. 𝑀 can
3
process 𝑏 2 𝑘 until it reaches ⟨ 12 𝑘, 0, 21 𝑘⟩. It is not possible to reach neither 𝑎’s
nor 𝑐’s. Thus, this strategy can process 32 𝑘 symbols.
(D) Any other position of heads can be seen as a slightly modified case of (A), (B),
or (C). Since neither of these cases is able to reach all three types of symbols,
they can process only up to 3𝑘 symbols.
Consequently, after the heads meet, 𝑀 can process no more than 3𝑘 symbols.
Finally, we can see that 𝑀 is not able to process more than 8𝑘 + 𝑙 symbols from
𝑤 = 𝑎 10𝑘 𝑏 10𝑘 𝑐10𝑘 when the debt of configurations of 𝑀 is bounded by 𝑘. Since, for
any 𝑘, 𝑤 ∈ 𝐿 and 𝑤 contains 30𝑘 symbols, 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}. □
Lemma 4.30 There is no jumping 5′ → 3′ WKFA 𝑀 such that 𝐿(𝑀) = {𝑤 ∈
{𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}.
Proof Let 𝑁 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a jumping 5′ → 3′ WKFA, 𝐿 = {𝑤 ∈
{𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}, and 𝐾 = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 0}.
Let 𝑤 be an input of the form {𝑎}∗ {𝑏}∗ {𝑐}∗ . Let 𝛾 be a configuration of 𝑁 reached
from an initial configuration (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) of 𝑁. Let 𝑜 be the Parikh vector of pro-
cessed symbols from 𝑤 in 𝛾. Observe that, for any configuration 𝛾, the debt of the
configuration min Δ(𝑜) is similar for 𝐿(𝑁) = 𝐿 and 𝐿 (𝑁) = 𝐾 since it only depends
on 𝑜 and the quantities of symbols in the strings of the language 𝐿(𝑁). Consequently,
the proof that there is no such 𝑀 is analogous to the proof of Lemma 4.29. □
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 115

Proposition 4.3 J5′→ 3′ WK is incomparable with GJFA and JFA.

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.

Theorem 4.43 J5′→ 3′ WK ⊂ CS.

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 ≠ ∅. □

Lemma 4.31 There are some non-context-free languages accepted by jumping 5′ →


3′ WKFAs.

Proof (by contradition) Consider the following jumping 5′ → 3′ WKFA

𝑀 = ({𝑠}, {𝑎, 𝑏, 𝑐, 𝑑}, 𝛿, 𝑠, {𝑠})

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. □

Lemma 4.32 There is no jumping 5′ → 3′ WKFA 𝑀 such that 𝐿 (𝑀) = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑚 𝑑 𝑚 |


𝑛, 𝑚 ≥ 0}.

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}. □

Theorem 4.44 J5′→ 3′ WK and CF are incomparable.

Proof J5′→ 3′ WK ⊈ CF follows from Lemma 4.31. CF ⊈ J5′→ 3′ WK follows


from Lemma 4.32. Lastly, LIN ⊂ J5′→ 3′ WK and LIN ⊂ CF. □

Results on Restricted Variants

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). □

On the simple restriction

Theorem 4.45 S J5′→ 3′ WK = J5′→ 3′ WK.

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

On the 1-limited restriction

Example 4.18 Consider the following jumping 5′ → 3′ WKFA 𝑀 = ({𝑠, 𝑓 }, {𝑎, 𝑏,


𝑐}, 𝛿, 𝑠, { 𝑓 }) with the state transition function 𝛿:

𝛿(𝑠, 𝑎, 𝑏, ⊕) = {𝑠}, 𝛿( 𝑓 , 𝑎, 𝑏, ⊕) = { 𝑓 }, 𝛿( 𝑓 , 𝑎, 𝑏, ⊖) = { 𝑓 },
𝛿(𝑠, 𝑐𝑐, 𝜀, ⊕) = { 𝑓 }, 𝛿(𝑠, 𝜀, 𝑐𝑐, ⊕) = { 𝑓 }.

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 , 𝑏)}. □

Theorem 4.46 1 J5′→ 3′ WK ⊂ J5′→ 3′ WK.

Proof This theorem follows directly from Example 4.18 and Lemma 4.35. □

Example 4.19 Consider the following 1 jumping 5′ → 3′ WKFA 𝑀 = ({𝑠, 𝑝},


{𝑎, 𝑏}, 𝛿, 𝑠, {𝑠}) with the state transition function 𝛿:

𝛿(𝑠, 𝑎, 𝜀, ⊕) = {𝑝}, 𝛿( 𝑝, 𝜀, 𝑏, ⊕) = {𝑠},


𝛿(𝑠, 𝑎, 𝜀, ⊖) = {𝑝}, 𝛿( 𝑝, 𝜀, 𝑏, ⊖) = {𝑠}.

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(𝑤, 𝑏)}.

Lemma 4.36 For every linear grammar 𝐺, there is a 1 jumping 5′ → 3′ WKFA 𝑀


such that 𝐿 (𝐺) = 𝐿 (𝑀).
4.4 Jumping 5′ → 3′ Watson–Crick Finite Automata 121

Proof Consider any linear grammar 𝐺 = (Σ, Δ, 𝑃, 𝑆) with 𝑁 = Σ − Δ. Every linear


grammar has an equivalent grammar with rules in the form: (1) 𝑆 → 𝜀, (2) 𝐴 → 𝑎𝐵,
(3) 𝐴 → 𝐵𝑎, (4) 𝐴 → 𝑎, where 𝐴 ∈ 𝑁, 𝐵 ∈ (𝑁 − {𝑆}), and 𝑎 ∈ Δ. Without loss of
generality, assume that 𝐺 satisfies this special form of rules and 𝑞 𝑓 ∉ Σ. Define the 1
jumping 5′ → 3′ WKFA 𝑀 = (𝑁 ∪ {𝑞 𝑓 }, Δ, 𝛿, 𝑆, 𝐹), where 𝐹 and 𝛿 are constructed
in the following way:
(1) Set 𝐹 = {𝑞 𝑓 }. If 𝑆 → 𝜀 ∈ 𝑃, add 𝑆 to 𝐹.
(2) For each 𝐴 → 𝑎𝐵 ∈ 𝑃, add 𝐵 to 𝛿( 𝐴, 𝑎, 𝜀, ⊕).
(3) For each 𝐴 → 𝐵𝑎 ∈ 𝑃, add 𝐵 to 𝛿( 𝐴, 𝜀, 𝑎, ⊕).
(4) For each 𝐴 → 𝑎 ∈ 𝑃, add 𝑞 𝑓 to 𝛿( 𝐴, 𝑎, 𝜀, ⊕).
Following the same reasoning as in Lemma 4.26, 𝐿(𝑀) = 𝐿 (𝐺). □

Theorem 4.47 LIN ⊂ 1 J5′→ 3′ WK.

Proof This theorem follows directly from Example 4.19 and Lemma 4.36. □

On the all-final restriction

Lemma 4.37 There is no F jumping 5′ → 3′ WKFA 𝑀 such that 𝐿 (𝑀) =


{𝑐𝑎 𝑛 𝑐𝑏 𝑛 𝑐 | 𝑛 ≥ 0} ∪ {𝜀}.

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. □

Theorem 4.48 F J5′→ 3′ WK ⊂ J5′→ 3′ WK.

Proof This theorem follows directly from Theorem 4.41 and Lemma 4.37. □

Proposition 4.4 F J5′→ 3′ WK and LIN are incomparable.

Proof LIN ⊈ F J5′→ 3′ WK follows from Lemma 4.37. F J5′→ 3′ WK ⊈ LIN


follows from Example 4.15. Lastly, F J5′→ 3′ WK and LIN contain the language
{𝑎}∗ . □

Lemma 4.38 For every 𝐿 ∈ F J5′→ 3′ WK it holds that 𝜀 ∈ 𝐿.

Proof Consider any F jumping 5′ → 3′ WKFA 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹). Since 𝑄 = 𝐹,


𝑞 0 is a final state and (𝑞 0 , ⊕, 𝜀, 𝜀, 𝜀) ↷ (𝑞 0 , ⊖, 𝜀, 𝜀, 𝜀) can be done with a ⊕-jumping
step; thus, 𝜀 ∈ 𝐿 (𝑀). □
122 4 Jumping Multi-Head Automata

Proposition 4.5 F J5′→ 3′ WK and FIN are incomparable.

Proof FIN ⊈ F J5′→ 3′ WK follows from Lemma 4.38. F J5′→ 3′ WK ⊈ FIN


follows from Example 4.15. Lastly, it is trivial to construct an F jumping 5′ → 3′
WKFA with two states that accepts the finite language {𝜀, 𝑎}. □

Theorem 4.49 FIN 𝜀-inc ⊂ F J5′→ 3′ WK.

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(𝑤, 𝑏)}.

Proposition 4.6 F J5′→ 3′ WK and 1 J5′→ 3′ WK are incomparable.

Proof First, 1 J5′→ 3′ WK ⊈ F J5′→ 3′ WK follows from Theorem 4.47 and


Lemma 4.37. Second, let 𝐿 be the language 𝐿(𝑀) from Example 4.20. The proof by
contradiction from Lemma 4.35 can be modified in a straightforward way so that it
shows that there is no 1 jumping 5′ → 3′ WKFA 𝑀 such that 𝐿(𝑀) = 𝐿. Therefore,
F J5′→ 3′ WK ⊈ 1 J5′→ 3′ WK. Lastly, both families contain {𝑎}∗ . □

On the stateless restriction

Lemma 4.39 There is no N jumping 5′ → 3′ WKFA 𝑀 = ({𝑞 0 }, Δ, 𝛿, 𝑞 0 , {𝑞 0 })


such that 𝐿 (𝑀) ∈ FIN and 𝐿(𝑀) ≠ {𝜀}.

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

Theorem 4.50 N J5′→ 3′ WK ⊂ F J5′→ 3′ WK.

Proof From Lemma 4.33, N J5′→ 3′ WK ⊆ F J5′→ 3′ WK. F J5′→ 3′ WK ⊈ N


J5′→ 3′ WK follows from Theorem 4.49 and Lemma 4.39. □

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 . □

Proposition 4.8 N J5′→ 3′ WK and 1 J5′→ 3′ WK are incomparable.

Proof First, 1 J5′→ 3′ WK ⊈ N J5′→ 3′ WK follows from Theorem 4.47 and


Lemma 4.39. Second, N J5′→ 3′ WK ⊈ 1 J5′→ 3′ WK follows from Example 4.20
and the proof of Proposition 4.6. Lastly, both families contain the language {𝑎}∗ . □

On the combined restrictions

Proposition 4.9 FS J5′→ 3′ WK ⊂ F J5′→ 3′ WK.

Proof Let 𝐿 = {𝑐𝑐𝑎 𝑛 𝑐𝑐 | 𝑛 ≥ 0} ∪ {𝜀}. It is trivial to construct an F jumping 5′ → 3′


WKFA that accepts 𝐿. However, there is no FS jumping 5′ → 3′ WKFA that accepts
𝐿. By contradiction. Assume that there is an FS jumping 5′ → 3′ WKFA 𝑀 such
that 𝐿(𝑀) = 𝐿. Using the basic premise of Lemma 4.37, all 𝑐’s has to be read with
the first nonempty reading step. Nonetheless, a single head cannot read all 𝑐’s in
one step if they are arbitrarily far away from each other—a contradiction with the
assumption that 𝑀 exists. □

Theorem 4.51 FIN 𝜀-inc ⊂ FS J5′→ 3′ WK.

Proof FS J5′→ 3′ WK ⊈ FIN 𝜀-inc follows from {𝑎}∗ ∈ FS J5′→ 3′ WK. The rest of
the proof is analogous to Theorem 4.49. □

Example 4.21 Consider the following FS jumping 5′ → 3′ WKFA 𝑀 = ({𝑠, 𝑝},


{𝑎, 𝑏, 𝑐}, 𝛿, 𝑠, {𝑠, 𝑝}) with the state transition function 𝛿:

𝛿(𝑠, 𝑎, 𝜀, ⊕) = {𝑝}, 𝛿( 𝑝, 𝜀, 𝑏, ⊕) = {𝑠},


𝛿(𝑠, 𝑎, 𝜀, ⊖) = {𝑝}, 𝛿( 𝑝, 𝜀, 𝑏, ⊖) = {𝑠},
𝛿(𝑠, 𝑐𝑐, 𝜀, ⊕) = {𝑠}, 𝛿(𝑠, 𝜀, 𝑐𝑐, ⊕) = {𝑠},
𝛿( 𝑝, 𝑐𝑐, 𝜀, ⊕) = {𝑝}, 𝛿( 𝑝, 𝜀, 𝑐𝑐, ⊕) = {𝑝}.

As a result, 𝐿 (𝑀) = {𝑤 ∈ {𝑎, 𝑏, 𝑐𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) or occur(𝑤, 𝑎) =


occur(𝑤, 𝑏) + 1}.
This automaton is just a combination of previous approaches from Examples 4.19
and 4.20. Note that 𝐿 (𝑀) resembles the resulting language of Example 4.20.
124 4 Jumping Multi-Head Automata

Proposition 4.10 FS J5′→ 3′ WK and 1 J5′→ 3′ WK are incomparable.


Proof First, 1 J5′→ 3′ WK ⊈ FS J5′→ 3′ WK follows from the language in the
proof of Proposition 4.9. Second, let 𝐿 be the language 𝐿(𝑀) from Example 4.21.
The proof by contradiction from Lemma 4.35 can be modified in a straightforward
way so that it shows that there is no 1 jumping 5′ → 3′ WKFA 𝑀 such that
𝐿 (𝑀) = 𝐿. Therefore, FS J5′→ 3′ WK ⊈ 1 J5′→ 3′ WK. Lastly, FS J5′→ 3′ WK
and 1 J5′→ 3′ WK contain the language {𝑎}∗ . □
Proposition 4.11 F1 J5′→ 3′ WK ⊂ FS J5′→ 3′ WK.
Proof From Lemma 4.33, F1 J5′→ 3′ WK ⊆ FS J5′→ 3′ WK. It is trivial to construct
an FS jumping 5′ → 3′ WKFA that accepts {𝑎𝑎}∗ . However, there cannot be an F1
jumping 5′ → 3′ WKFA that accepts only even-length inputs. □
Proposition 4.12 F1 J5′→ 3′ WK and LIN are incomparable.
Proof LIN ⊈ F1 J5′→ 3′ WK follows from {𝑎𝑎}∗ ∈ LIN. Considering Exam-
ple 4.21, there is an F1 jumping 5′ → 3′ WKFA 𝑀 such that 𝐿 (𝑀) = {𝑤 ∈
{𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) or occur(𝑤, 𝑎) = occur(𝑤, 𝑏) + 1}. Clearly,
𝐿 (𝑀) is not a linear language. Lastly, F1 J5′→ 3′ WK and LIN contain the language
{𝑎}∗ . □
Corollary 4.2 F1 J5′→ 3′ WK ⊂ 1 J5′→ 3′ WK.
Theorem 4.52 NS J5′→ 3′ WK ⊂ REG.
Proof NS J5′→ 3′ WK ⊆ REG can be proven by construction. We show that for any
NS jumping 5′ → 3′ WKFA we can construct a finite automaton that accepts the same
language. Consider any NS jumping 5′ → 3′ WKFA 𝑀 = ({𝑞 0 }, Δ, 𝛿, 𝑞 0 , {𝑞 0 }).
The following claims hold:
Claim A Any 𝑤 ∈ 𝐿(𝑀) can be expressed in the following special form 𝑤 =
𝑥1 𝑦 1′ · · · 𝑥 𝑛 𝑦 ′𝑛 𝑥1′ 𝑦 1 · · · 𝑥 𝑚
′ 𝑦 , where 𝑥 , 𝑦 ′ , 𝑥 ′ , 𝑦
𝑚 𝑖 𝑖 𝑗

𝑗 ∈ Δ , for all 𝑖 = 1, . . . , 𝑛 and
′ ′
𝑗 = 1, . . . , 𝑚, for some 𝑛, 𝑚 ≥ 1, and for all 𝑥𝑖 , 𝑦 𝑖 , 𝑥 𝑗 , 𝑦 𝑗 hold:
(i) either 𝑥𝑖 = 𝜀 or 𝛿(𝑞 0 , 𝑥𝑖 , 𝜀, ⊕) = {𝑞 0 },
(ii) either 𝑦 𝑗 = 𝜀 or 𝛿(𝑞 0 , 𝜀, 𝑦 𝑗 , ⊕) = {𝑞 0 },
(iii) either 𝑥 ′𝑗 = 𝜀 or 𝛿(𝑞 0 , 𝑥 ′𝑗 , 𝜀, ⊖) = {𝑞 0 },
(iv) either 𝑦 𝑖′ = 𝜀 or 𝛿(𝑞 0 , 𝜀, 𝑦 𝑖′ , ⊖) = {𝑞 0 }. □

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

Proposition 4.17 REG is incomparable with F J5′→ 3′ WK, N J5′→ 3′ WK, FS


J5′→ 3′ WK, and F1 J5′→ 3′ WK.

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.18 FIN is incomparable with FS J5′→ 3′ WK, F1 J5′→ 3′ WK, NS


J5′→ 3′ WK, and N1 J5′→ 3′ WK.

Proof Considering previous results. First, FS J5′→ 3′ WK, F1 J5′→ 3′ WK, NS


J5′→ 3′ WK, and N1 J5′→ 3′ WK cannot contain ∅. Second, FS J5′→ 3′ WK, F1
J5′→ 3′ WK, NS J5′→ 3′ WK, and N1 J5′→ 3′ WK contain {𝑎}∗ . Lastly, all families
contain {𝜀}. □

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

LIN 1 J5′→ 3′ WK FS J5′→ 3′ WK N 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

This three-section chapter is organized as follows. Section 5.1 gives an introduction


into its subject. Section 5.2 recalls all the definitions that are needed and illustrates
them by examples. Then, Section 5.3 presents fundamental results as well as open
problems concerning 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,

𝐺𝐺𝐺𝐺 𝐴𝐺𝑇𝐺𝐺𝐺 𝐴𝑇𝑇𝐺𝐺𝐺 𝐴𝐺 𝐴𝐺𝐺𝐺𝐺𝑇𝑇𝑇𝐺𝐶𝐶𝐶𝐶𝐺𝐶𝑇𝐶𝐶𝐶

Suppose that a DNA-computing-related investigation needs to study all the strings


that contain the same number of 𝐶s and 𝐺s and the same number of 𝐴s and 𝑇s;
for instance, 𝐶𝐺𝐺𝐶 𝐴𝑇𝐶𝐶𝐺𝐺𝑇 𝐴 is a proper string, but 𝐶𝐺𝐶 𝐴𝐶𝐶𝐺𝐺𝑇 𝐴 is not.
Consider the jumping right-linear grammar containing rules

1 → 𝐶2, 2 → 𝐺1, 1 → 3, 3 → 𝐴4, 4 → 𝑇3, 3 → 𝜀


where 1 through 4 are nonterminal symbols with 1 being the start nonterminal,
and 𝐺, 𝐴, 𝑇, and 𝐶 are terminal symbols. As is obvious, this 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 in the future, and we return to this topic in Chapter 9 in
greater detail.

5.2 Definitions and Examples

Now, we introduce four modes of derivation relations, three of which represent


jumping derivation steps. We also briefly recall some terminology, such as the notion
of a phrase-structure grammar, introduced earlier in this book (see Section 2.3).

Definition 5.1 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be a PSG. We introduce four modes of derivation


steps as derivation relations over Σ∗ —namely, 𝑠 ⇒, 𝑙 𝑗 ⇒, 𝑟 𝑗 ⇒, and 𝑗 ⇒.
Let 𝑢, 𝑣 ∈ Σ∗ . We define the four derivation relations as follows:
(i) 𝑢 𝑠 ⇒ 𝑣 in 𝐺 iff there exist 𝑥 → 𝑦 ∈ 𝑃 and 𝑤, 𝑧 ∈ Σ∗ such that 𝑢 = 𝑤𝑥𝑧 and
𝑣 = 𝑤𝑦𝑧;
(ii) 𝑢 𝑙𝑗 ⇒ 𝑣 in 𝐺 iff there exist 𝑥 → 𝑦 ∈ 𝑃 and 𝑤, 𝑡, 𝑧 ∈ Σ∗ such that 𝑢 = 𝑤𝑡𝑥𝑧 and
𝑣 = 𝑤𝑦𝑡𝑧;
(iii) 𝑢 𝑟𝑗 ⇒ 𝑣 in 𝐺 iff there exist 𝑥 → 𝑦 ∈ 𝑃 and 𝑤, 𝑡, 𝑧 ∈ Σ∗ such that 𝑢 = 𝑤𝑥𝑡𝑧 and
𝑣 = 𝑤𝑡𝑦𝑧;
(iv) 𝑢 𝑗 ⇒ 𝑣 in 𝐺 iff 𝑢 𝑙𝑗 ⇒ 𝑣 or 𝑢 𝑟𝑗 ⇒ 𝑣 in 𝐺.
134 5 Sequential Jumping Grammars

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.1 Consider the following RG

𝐺 = ({𝐴, 𝐵, 𝐶, 𝑎, 𝑏, 𝑐}, Δ = {𝑎, 𝑏, 𝑐}, 𝑃, 𝐴)

where 𝑃 = { 𝐴 → 𝑎𝐵, 𝐵 → 𝑏𝐶, 𝐶 → 𝑐 𝐴, 𝐶 → 𝑐}. Observe that

𝐿(𝐺, 𝑠 ⇒) = {𝑎𝑏𝑐}{𝑎𝑏𝑐}∗ , but

𝐿 (𝐺, 𝑗 ⇒) = {𝑤 ∈ Δ∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}


Notice that although 𝐿 (𝐺, 𝑠 ⇒) is regular, 𝐿 (𝐺, 𝑗 ⇒) ∈ CS is a well-known
non-context-free language.

Example 5.2 Consider the following CSG 𝐺 = ({𝑆, 𝐴, 𝐵, 𝑎, 𝑏}, {𝑎, 𝑏}, 𝑃, 𝑆)
containing the following rules:

𝑆 → 𝑎 𝐴𝐵𝑏
𝑆 → 𝑎𝑏
𝐴𝐵 → 𝐴𝐴𝐵𝐵
𝑎𝐴 → 𝑎𝑎
𝐵𝑏 → 𝑏𝑏

Trivially, 𝐿 (𝐺, 𝑠 ⇒) = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 1}. Using 𝑗 ⇒, we can make the following


derivation sequence (the rewritten substring is underlined):

𝑆 𝑗 ⇒ 𝑎 𝐴𝐵𝑏 𝑗 ⇒ 𝑎 𝐴𝐴𝐵𝐵𝑏 𝑗 ⇒ 𝑎 𝐴𝐴𝐵𝑏𝑏 𝑗 ⇒ 𝑎𝑎 𝐴𝐵𝑏𝑏 𝑗 ⇒ 𝑎𝐵𝑏𝑏𝑎𝑎 𝑗 ⇒ 𝑎𝑏𝑏𝑏𝑎𝑎

Notice that 𝐿(𝐺, 𝑠 ⇒) is context-free, but we cannot generate this language by


any CFG, CSG or even MONG in jumping derivation mode.

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

Since 𝐻 is a RLG, there is at most one occurrence of 𝐸 in any sentential form


derived from 𝐸 in 𝐻, so 𝐻 is of index 1. Next, we sketch a proof that 𝐿(𝐺, 𝑠 ⇒) =
𝐿(𝐻, 𝑗 ⇒). As is obvious, {𝜀, (), []} ⊆ 𝐿(𝐺, 𝑠 ⇒) ∩ 𝐿(𝐻, 𝑗 ⇒). Consider

𝛼𝐸 𝛽 𝑠 ⇒ 𝛼(𝐸)𝐸 𝛽 [𝐸 → (𝐸)𝐸] 𝑠 ⇒∗ 𝛼(𝛾)𝛿𝛽

in 𝐺 with 𝛾 ≠ 𝜀. 𝐻 can simulate this derivation as follows

𝛼𝐸 𝛽 𝑗 ⇒ 𝛼()𝐸 𝛽 𝑗 ⇒∗ 𝛼()𝛿 ′ 𝐸𝛿 ′′ 𝛽 𝑗 ⇒ 𝛼(𝑥𝐸)𝛿𝛽 𝑗 ⇒∗ 𝛼(𝛾)𝛿𝛽

where 𝛿 = 𝛿 ′ 𝛿 ′′ , 𝑥 ∈ {(), []}, and 𝛼, 𝛽, 𝛾, 𝛿 ∈ Σ∗ . For 𝛾 = 𝜀, we modify the previous


jumping derivation so we make a jumping derivation step from 𝛼()𝛿 ′ 𝐸𝛿 ′′ 𝛽 to 𝛼()𝛿𝛽
by 𝐸 → 𝜀 in 𝐻. We deal with 𝐸 → [𝐸]𝐸 analogically, so 𝐿 (𝐺, 𝑠 ⇒) ⊆ 𝐿 (𝐻, 𝑗 ⇒).
Since 𝐿 (𝐺, 𝑠 ⇒) contains all proper strings with the three types of parentheses, to
prove 𝐿 (𝐻, 𝑗 ⇒) ⊆ 𝐿(𝐺, 𝑠 ⇒), we have to show that 𝐻 cannot generate an improper
string of parentheses. As each non-erasing rule of 𝐻 inserts both left and right
parentheses in the sentential form at once, the numbers of parentheses are always
correctly balanced. In addition, in 𝐻 we cannot generate an improper mixture of two
kinds of parentheses, such as ( [)], or an improper parenthesis order, such as ) (, so
𝐿 (𝐺, 𝑠 ⇒) = 𝐿 (𝐻, 𝑗 ⇒).

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.

Lemma 5.1 {𝑎}∗ {𝑏}∗ ∉ JMON.

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

{𝑎, 𝑏}∗ {𝑏}{𝑎, 𝑏}∗ {𝑎}{𝑎, 𝑏}∗

that does not belong to {𝑎}∗ {𝑏}∗ .


(ii) By analogy, if 𝑦 contains at least one symbol 𝑎, the last jumping derivation step
can place 𝑦 at the end of the sentence and, therefore, place at least one 𝑎 behind
some 𝑏s.
This is a contradiction, so there is no MONG that generates the regular language
{𝑎}∗ {𝑏}∗ using 𝑗 ⇒. □
We reopen a discussion related to Lemma 5.1 at the end of of this section.

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,

{𝑎}∗ {𝑏}∗ ∈ REG − JMON.

In Example 5.1, we define a jumping RG that generates a non-context-free language


that belongs to JREG − CF. Observe that regular language {𝑎}∗ belongs to JREG,
so REG ∩ JREG is nonempty. □

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? □

Theorem 5.1 JMON ⊂ CS.

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 = {𝑋 𝜋(𝛽) → 𝜋(𝛽) 𝑋, 𝜋(𝛽) 𝑋 → 𝑋 𝜋(𝛽) | 𝑋 ∈ Σ𝐺 }
𝛼→𝛽 ∈ 𝑃𝐺

As is obvious, 𝐿(𝐺, 𝑗 ⇒) = 𝐿(𝐻, 𝑠 ⇒). Clearly, {𝑎}∗ {𝑏}∗ ∈ CS. Thus, by


Lemma 5.1, CS − JMON ≠ ∅, so this theorem holds. □

Relationships between the Language Families Resulting from Various


Jumping Grammars

We establish several relationships between the language families generated by jump-


ing versions of grammars defined earlier in this section.

Theorem 5.2 JRL = JLIN = JCFfin.


Proof Since JRL ⊆ JLIN ⊆ JCFfin follows from the definitions, it suffices to
proof that JCFfin ⊆ JRL.
Construction. Let Σ and Δ be an alphabet and an alphabet of terminals, respectively.
Set 𝑁 = Σ − Δ. Let 𝜂 : Σ → 𝑁 ∪ {𝜀} be the homomorphism such that 𝜂(𝑋) = 𝑋
if 𝑋 ∈ 𝑁; otherwise, 𝜂(𝑋) = 𝜀. Let 𝜏 : Σ → Δ ∪ {𝜀} be the homomorphism such
that 𝜏(𝑋) = 𝑋 if 𝑋 ∈ Δ; otherwise, 𝜂(𝑋) = 𝜀. As usual, extend 𝜂 and 𝜏 to strings of
symbols.
For every CFG 𝐺 = (Σ𝐺 , Δ, 𝑃𝐺 , 𝑆) and index 𝑘 ≥ 1, we construct a RLG
𝐻 = (Σ 𝐻 , Δ, 𝑃 𝐻 , ⟨𝑆⟩) such that 𝐿 (𝐺, 𝑗 ⇒ 𝑘 ) = 𝐿(𝐻, 𝑗 ⇒). Set

𝑘
Ø
Σ 𝐻 = {⟨𝑥⟩ | 𝑥 ∈ (Σ𝐺 − Δ) 𝑖 } ∪ Δ
𝑖=1

and set

𝑃 𝐻 = {⟨𝛼𝐴𝛽⟩ → 𝜏(𝑥)⟨𝛾⟩ | 𝐴 → 𝑥 ∈ 𝑃𝐺 , 𝛼, 𝛽 ∈ 𝑁 ∗ , 𝛾 = 𝛼𝛽𝜂(𝑥), 1 ≤ |𝛾| ≤ 𝑘 }

∪ {⟨𝐴⟩ → 𝑥 | 𝐴 → 𝑥 ∈ 𝑃𝐺 , 𝑥 ∈ Δ∗ }

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].

Theorem 5.3 ([Madejski, 2016, Theorem 3.10])

JCFfin ⊂ JCF.

Indeed, from a broader perspective, an investigation of finite-index-based re-


strictions placed upon various jumping grammars and their effect on the resulting
generative power represents a challenging open problem area as illustrated by Ex-
ample 5.3.

Theorem 5.4 JCF− 𝜀 = JCF.

Proof It is straightforward to establish this theorem by analogy with the same


statement reformulated in terms of ordinary CFGs, which work based on 𝑠 ⇒ (see
[Meduna, 2000, Theorem 5.1.3.2.4 on page 328]). □

Lemma 5.2 RE ⊆ JRE.

Proof Construction. For every PSG 𝐺 = (Σ𝐺 , Δ, 𝑃𝐺 , 𝑆𝐺 ), we construct an-


other PSG 𝐻 = (Σ 𝐻 = Σ𝐺 ∪ {𝑆 𝐻 , $, #, ⌊, ⌋}, Δ, 𝑃 𝐻 , 𝑆 𝐻 ) such that 𝐿 (𝐺, 𝑠 ⇒) =
𝐿(𝐻, 𝑗 ⇒). 𝑆 𝐻 , $, #, ⌊, and ⌋ are new nonterminal symbols in 𝐻. Set

𝑃 𝐻 = {𝑆 𝐻 → #𝑆𝐺 , # → ⌊$, ⌊ ⌋ → #, # → 𝜀}

∪{$𝛼 →⌋ 𝛽 | 𝛼 → 𝛽 ∈ 𝑃𝐺 }

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.

Claim A Let 𝑦 be a sentential form of 𝐻; that is, 𝑆 𝐻 𝑗 ⇒∗ 𝑦. For every 𝑋 ∈


{#, $, ⌊, ⌋, 𝑆 𝐻 }, occur(𝑦, 𝑋) ≤ 1. □
5.3 Results 139

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. □

Define the homomorphism ℎ : Σ∗𝐻 → Σ𝐺 ∗ as ℎ(𝑋) = 𝑋 for all 𝑋 ∈ Σ , ℎ(𝑆 ) =


𝐺 𝐻
𝑆𝐺 , and ℎ(𝑌 ) = 𝜀 for all 𝑌 ∈ {$, #, ⌊, ⌋}.

Claim B If 𝑆𝐺 𝑠 ⇒𝑚 𝑤 in 𝐺, where 𝑤 ∈ Δ∗ and 𝑚 ≥ 0, then 𝑆 𝐻 𝑗 ⇒∗ 𝑤 in 𝐻. □

Proof (Claim B) First, we prove by induction on 𝑚 ≥ 0 that for every 𝑆𝐺 𝑠 ⇒𝑚 𝑥 in


∗ , there is 𝑆
𝐺 with 𝑥 ∈ Σ𝐺 ∗ ′ ′
𝐻 𝑗 ⇒ 𝑥 in 𝐻 such that ℎ(𝑥 ) = 𝑥.

Basis. For 𝑆𝐺 𝑠 ⇒0 𝑆𝐺 in 𝐺, there is 𝑆 𝐻 𝑗 ⇒ #𝑆𝐺 in 𝐻.


Induction Hypothesis. Suppose there exists 𝑘 ≥ 0 such that 𝑆𝐺 𝑠 ⇒𝑚 𝑥 in 𝐺 implies
that 𝑆 𝐻 𝑗 ⇒∗ 𝑥 ′ in 𝐻, where ℎ(𝑥 ′ ) = 𝑥, for all 0 ≤ 𝑚 ≤ 𝑘.

Induction Step. Assume that 𝑆𝐺 𝑠 ⇒ 𝑘 𝑦 𝑠 ⇒ 𝑥 in 𝐺. By the induction hypothesis,


𝑆 𝐻 𝑗 ⇒∗ 𝑦 ′ in 𝐻 with ℎ(𝑦 ′ ) = 𝑦.
The derivation step 𝑦 𝑠 ⇒ 𝑥 in 𝐺 is simulated by an application of three jumping
rules from 𝑃 𝐻 in 𝐻 to get 𝑦 ′ 𝑗 ⇒3 𝑥 ′ with ℎ(𝑥 ′ ) = 𝑥 as follows.

𝑦 ′ = 𝑢 ′ #𝑣 ′ 𝑗 ⇒ 𝑢 ′′ ⌊$𝛼𝑣 ′′ [# → ⌊$]
′′ ′′
𝑗 ⇒ 𝑢 ⌊ ⌋ 𝛽𝑣 [⌊ ⌋ → #]
′′′ ′′′ [# → 𝜀] = 𝑥 ′
𝑗 ⇒ 𝑢 #𝑣

where 𝑢 ′ 𝑣 ′ = 𝑢 ′′ 𝛼𝑣 ′′ and 𝑢 ′′ 𝛽𝑣 ′′ = 𝑢 ′′′ 𝑣 ′′′ .


In case 𝑥 ∈ Δ∗ , there is one additional jumping derivation step during the simu-
lation that erases the only occurrence of #-symbol (see Claim A) by rule # → 𝜀.
Note that ℎ(𝑥) for 𝑥 ∈ Δ∗ is the identity. Therefore, in case 𝑥 ∈ Δ∗ the induction
proves the claim. □

Claim C If 𝑆 𝐻 𝑗 ⇒𝑚 𝑤 in 𝐻, for some 𝑚 ≥ 0, where 𝑤 ∈ Δ∗ , then 𝑆𝐺 𝑠 ⇒∗ 𝑤 in 𝐺.□

Proof (Claim C) To prove this claim, first, we prove by induction on 𝑚 ≥ 0 that


for every 𝑆 𝐻 𝑗 ⇒𝑚 𝑥 in 𝐻 with 𝑥 ∈ Σ∗𝐻 such that there exists a jumping derivation
𝑥 𝑗 ⇒∗ 𝑤, where 𝑤 ∈ Δ∗ , then 𝑆𝐺 𝑠 ⇒∗ 𝑥 ′ in 𝐺 such that ℎ(𝑥) = 𝑥 ′ .

Basis. For 𝑚 = 0, when we have 𝑆 𝐻 𝑗 ⇒0 𝑆 𝐻 𝑗 ⇒∗ 𝑤 in 𝐻, then there is 𝑆𝐺 𝑠 ⇒0 𝑆𝐺


in 𝐺 such that ℎ(𝑆 𝐻 ) = 𝑆𝐺 . Furthermore, for 𝑚 = 1, we have 𝑆 𝐻 𝑗 ⇒1 #𝑆𝐺 𝑗 ⇒∗ 𝑤
in 𝐻, then again there is 𝑆𝐺 𝑠 ⇒0 𝑆𝐺 in 𝐺 such that ℎ(#𝑆𝐺 ) = 𝑆𝐺 , so the basis holds.
Induction Hypothesis. Suppose there exists 𝑘 ≥ 1 such that 𝑆 𝐻 𝑗 ⇒𝑚 𝑥 𝑗 ⇒∗ 𝑤 in 𝐻
implies that 𝑆𝐺 𝑠 ⇒∗ 𝑥 ′ in 𝐺, where ℎ(𝑥) = 𝑥 ′ , for all 1 ≤ 𝑚 ≤ 𝑘.
Induction Step. Assume that 𝑆 𝐻 𝑗 ⇒ 𝑘 𝑦 𝑗 ⇒ 𝑥 𝑗 ⇒∗ 𝑤 in 𝐻 with 𝑤 ∈ Δ∗ . By
the induction hypothesis, 𝑆𝐺 𝑠 ⇒∗ 𝑦 ′ in 𝐺 such that ℎ(𝑦) = 𝑦 ′ . Let 𝑢, 𝑣 ∈ Σ𝐺
∗ and

¯ 𝑣¯ ∈ Σ 𝐻 . Let us examine the following possibilities of 𝑦 𝑗 ⇒ 𝑥 in 𝐻:
𝑢,
140 5 Sequential Jumping Grammars

(i) 𝑦 = 𝑢#𝑣 𝑗 ⇒ 𝑢⌊$¯ 𝑣¯ = 𝑥 in 𝐻 such that 𝑢𝑣 = 𝑢¯ 𝑣¯ : Simply, 𝑦 ′ = 𝑢𝑣 𝑠 ⇒0 𝑢𝑣 in 𝐺 and


by Claim A ℎ( 𝑢⌊$¯ 𝑣¯ ) = ℎ( 𝑢¯ 𝑣¯ ) = ℎ(𝑢𝑣) = 𝑢𝑣.
(ii) 𝑢⌊$𝛼𝑣 𝑗 ⇒ 𝑢⌋ ¯ 𝛽𝑣¯ in 𝐻 by rule $𝛼 →⌋ 𝛽 such that 𝑢𝑣 = 𝑢¯ 𝑣¯ : In fact, to be able to
rewrite ⌊, the symbol ⌊ needs ⌋ as its right neighbor, so 𝑢 = 𝑢¯ and 𝑣 = 𝑣¯ in this
jumping derivation step; otherwise, the jumping derivation is prevented from
generating a string of terminals. According to rule 𝛼 → 𝛽, 𝑢𝛼𝑣 𝑠 ⇒ 𝑢𝛽𝑣 in 𝐺
¯ 𝛽𝑣¯ ) = 𝑢𝛽𝑣.
and ℎ( 𝑢⌋
¯ 𝑣¯ in 𝐻 such that 𝑢𝑣 = 𝑢¯ 𝑣¯ : In 𝐺, 𝑢𝑣 𝑠 ⇒0 𝑢𝑣 and ℎ( 𝑢#
(iii) 𝑢⌊ ⌋𝑣 𝑗 ⇒ 𝑢# ¯ 𝑣¯ ) = ℎ( 𝑢¯ 𝑣¯ ) =
ℎ(𝑢𝑣) = 𝑢𝑣.
(iv) 𝑢#𝑣 𝑗 ⇒ 𝑢𝑣 in 𝐻 by # → 𝜀: Trivially, 𝑢𝑣 𝑠 ⇒0 𝑢𝑣 in 𝐺 and ℎ(𝑢𝑣) = 𝑢𝑣. □
If 𝑥 ∈ Δ∗ , then the induction proves the claim. □
This closes the proof of Lemma 5.2.

Theorem 5.5 JRE = RE.

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. □

Properties of Jumping Derivations

We demonstrate that the order of nonterminals in a sentential form of jumping CFGs


is irrelevant. Then, in this section, we study the semilinearity of language families
generated by various jumping grammars.
As a generalization of the proof of Theorem 5.2, we give the following lemma
demonstrating that the order in which nonterminals occur in sentential forms is irrel-
evant in jumping derivation mode based on context-free rules in terms of generative
power.

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 𝐺.

Proof We prove this lemma by induction on 𝑚 ≥ 0.


Basis. Let 𝑚 = 0. That is, 𝑆 𝑗 ⇒∗ 𝛾 𝑗 ⇒0 𝑤 in 𝐺, so 𝛾 = 𝑤. By 𝜏(𝛿) = 𝜏(𝛾), we have
𝛾 = 𝑤 = 𝛿, so 𝛿 𝑗 ⇒0 𝑤 in 𝐺.
Induction Hypothesis. Assume that there exists 𝑘 ≥ 0 such that the lemma holds for
all 0 ≤ 𝑚 ≤ 𝑘.
Induction Step. Assume that 𝑆 𝑗 ⇒∗ 𝛾 𝑗 ⇒ 𝛾 ′ [ 𝐴 → 𝑥] 𝑗 ⇒ 𝑘 𝑤 in 𝐺 with 𝑘 ≥
0. Observe that 𝜏(𝛿) = 𝜏(𝛾) and 𝜂(𝛿) ∈ perm(𝜂(𝛾)). By the above-mentioned
assumption, |𝜂(𝛾)| ≥ 1—that is |𝜂(𝛿)| ≥ 1. Thus, the jumping derivation 𝛿 𝑗 ⇒∗ 𝑤
5.3 Results 141

in 𝐺 can be written as 𝛿 𝑗 ⇒ 𝛿 ′ [ 𝐴 → 𝑥] 𝑗 ⇒∗ 𝑤. Since all the rules in 𝐺 are context-


free, the position of 𝐴 in 𝛿 and its context is irrelevant, and the occurrence of 𝐴 in
𝛿 is guaranteed by the lemma precondition. During the application of 𝐴 → 𝑥, (1)
an occurrence of 𝐴 is found in 𝛿, (2) removed, and (3) the right-hand side of the
rule, 𝑥, is inserted anywhere in 𝛿 instead of 𝐴 without preserving the position of the
rewritten 𝐴. Assume 𝑥 is inserted into 𝛿 ′ so that 𝜏(𝛿 ′ ) = 𝜏(𝛾 ′ ). We also preserve
that 𝜂(𝛿 ′ ) ∈ perm(𝜂(𝛾 ′ )); therefore, the lemma holds.
Notice that even if there is no derivation 𝑆 𝑗 ⇒∗ 𝛿 in 𝐺, the lemma holds.
Note that based on the proof of Lemma 5.3, we can turn any jumping version of a
CFG to an equivalent jumping CFG satisfying a modified Greibach normal form, in
which each rule is of the form 𝐴 → 𝛼𝛽, where 𝛼 ∈ Δ∗ , 𝛽 ∈ 𝑁 ∗ . Observe that 𝛼 ∉ Δ.
Consider, for instance, a context-free rule 𝑝 with 𝛼 = 𝑎 1 · · · 𝑎 𝑛 . By an application
of 𝑝 during a derivation of a string of terminals 𝑤, we arrange that 𝑎 1 appears
somewhere in front of 𝑎 𝑛 in 𝑤. In other words, from Theorem 3.5 and Corollary 3.2
together with Theorem 5.8, it follows that for any language 𝐿, 𝐿 ∈ JREG implies
𝐿 = perm(𝐿), which means that the order of all terminals in 𝑤 ∈ 𝐿 is utterly
irrelevant.

Corollary 5.2 Let 𝑋 ∈ {RG, RLG, LG, CFG}. For every 𝑋 𝐺, 𝑆 𝑗 ⇒∗ 𝛾 𝑗 ⇒∗ 𝑤 in


𝐺 implies an existence of a derivation of the following form

𝑆 𝑗 ⇒∗ 𝛼𝛽 𝑗 ⇒∗ 𝑤 in 𝐺

where 𝛼 = 𝜏(𝛾), 𝛽 ∈ perm(𝜂(𝛾)), 𝑆 is the start nonterminal, and 𝑤 is a string of


terminals.

Lemma 5.4 JREG, JRL, JLIN, and JCF are semilinear.

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

Definition 5.2 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be a PSG and 𝑢, 𝑣 ∈ Σ∗ ; then, 𝑢 𝑚 ⇒ 𝑣 [𝑥 → 𝑦]


in 𝐺 iff there exist 𝑥 → 𝑦 ∈ 𝑃 and 𝑡, 𝑡 ′ , 𝑧, 𝑧 ′ ∈ Σ∗ such that 𝑡𝑥𝑡 ′ ∈ perm(𝑢),
𝑧𝑦𝑧 ′ ∈ perm(𝑣), and 𝑡𝑡 ′ ∈ perm(𝑧𝑧 ′ ).
Lemma 5.5 Let 𝐺 be a PSG; then, 𝑤 ∈ 𝐿(𝐺, 𝑚 ⇒) implies that perm(𝑤) ⊆
𝐿(𝐺, 𝑚 ⇒).
Proof Consider Definition 5.2 with 𝑣 representing every permutation of 𝑣 in every
𝑢 𝑚 ⇒ 𝑣 in 𝐺 to see that this lemma holds true. □
Let the family of languages generated by a MONG using 𝑚 ⇒ be denoted by
mMON. Recall that mMON is not semilinear (see Kudlek et al. [2000]). As every
context-sensitive multiset grammar can be transformed into a CSG that generates the
same language under jumping derivation mode, we establish the following theorem.
Theorem 5.6 JCS is not semilinear. Neither is JMON.
Proof Recall that mMON contains non-semilinear languages (see [Kudlek et al.,
2000, Theorem 1]). Thus, to prove Theorem 5.6, we only need to prove that mMON ⊆
JCS because JCS ⊆ JMON follows from Definition 5.1.
Construction. For every MONG 𝐺 = (Σ𝐺 , Δ, 𝑃𝐺 , 𝑆), we next construct a CSG
𝐻 = (Σ 𝐻 , Δ, 𝑃 𝐻 , 𝑆) such that 𝐿(𝐺, 𝑚 ⇒) = 𝐿(𝐻, 𝑗 ⇒). Let 𝑁𝐺 = Σ𝐺 − Δ and ℎ
be the homomorphism ℎ : Σ𝐺 ∗ → Σ ∗ defined as ℎ(𝑋) = 𝑋 for all 𝑋 ∈ 𝑁 and
𝐻 𝐺
ℎ(𝑎) = ⟨𝑎⟩ for all 𝑎 ∈ Δ. First, set Σ 𝐻 = Σ𝐺 ∪ 𝑁𝑡 ∪ 𝑁 𝑐𝑠 , where 𝑁𝑡 = {⟨𝑎⟩ | 𝑎 ∈ Δ}
and 𝑁 𝑐𝑠 = { 𝑝 𝑋 | 𝑋 ∈ 𝑁𝐺 ∪ 𝑁𝑡 , 𝑝 ∈ 𝑃𝐺 with | lhs( 𝑝)| > 1}. For every 𝑝 ∈ 𝑃𝐺
with | lhs( 𝑝)| > 1, let 𝑔 𝑝 : (𝑁𝐺 ∪ 𝑁𝑡 ) ∗ → 𝑁 𝑐𝑠
∗ be the homomorphism defined

as 𝑔 𝑝 (𝑋) = 𝑝 𝑋 for all 𝑋 ∈ 𝑁𝐺 ∪ 𝑁𝑡 . Set 𝑃𝑡 = {⟨𝑎⟩ → 𝑎 | 𝑎 ∈ Δ}, 𝑃𝑐 𝑓 =


{ 𝐴 → ℎ(𝑥) | 𝐴 → 𝑥 ∈ 𝑃𝐺 , 𝐴 ∈ Σ𝐺 − Δ and 𝑥 ∈ Σ𝐺 ∗ }, and 𝑃
𝑐𝑠 = ∅. For every
rule 𝑝 : 𝑋1 𝑋2 · · · 𝑋𝑛 → 𝑌1𝑌2 · · · 𝑌𝑚 ∈ 𝑃𝐺 with 2 ≤ 𝑛 ≤ 𝑚, where 𝑋𝑖 , 𝑌𝑖 ′ ∈ Σ𝐺 ,
1 ≤ 𝑖 ≤ 𝑛, and 1 ≤ 𝑖 ′ ≤ 𝑚, add these 2𝑛 new rules with labels 𝑝 1 , 𝑝 2 , . . ., 𝑝 2𝑛
𝑝1 : ℎ(𝑋1 𝑋2 · · · 𝑋𝑛 ) → 𝑔 𝑝 (ℎ(𝑋1 ))ℎ(𝑋2 · · · 𝑋𝑛 )
𝑝2 : 𝑔 𝑝 (ℎ(𝑋1 ))ℎ(𝑋2 · · · 𝑋𝑛 ) → 𝑔 𝑝 (ℎ(𝑋1 𝑋2 ))ℎ(𝑋3 · · · 𝑋𝑛 )
..
.
𝑝 𝑛 : 𝑔 𝑝 (ℎ(𝑋1 𝑋2 · · · 𝑋𝑛−1 ))ℎ(𝑋𝑛 ) → 𝑔 𝑝 (ℎ(𝑋1 𝑋2 · · · 𝑋𝑛−1 𝑋𝑛 ))
𝑝 𝑛+1 : 𝑔 𝑝 (ℎ(𝑋1 𝑋2 · · · 𝑋𝑛 )) → ℎ(𝑌1 )𝑔 𝑝 (ℎ(𝑋2 · · · 𝑋𝑛 ))
𝑝 𝑛+2 : ℎ(𝑌1 )𝑔 𝑝 (ℎ(𝑋2 · · · 𝑋𝑛 )) → ℎ(𝑌1𝑌2 )𝑔 𝑝 (ℎ(𝑋3 · · · 𝑋𝑛 ))
..
.
𝑝 2𝑛 : ℎ(𝑌1𝑌2 · · · 𝑌𝑛−1 )𝑔 𝑝 (ℎ(𝑋𝑛 )) → ℎ(𝑌1𝑌2 · · · 𝑌𝑛−1𝑌𝑛𝑌𝑛+1 · · · 𝑌𝑚 )
into 𝑃𝑐𝑠 . Set 𝑃𝑐 = { 𝐴 → 𝐴 | 𝐴 ∈ Σ 𝐻 − Δ}. Finally, set 𝑃 𝐻 = 𝑃𝑐 𝑓 ∪ 𝑃𝑡 ∪ 𝑃𝑐 ∪ 𝑃𝑐𝑠 .
Basic Idea. There are two essential differences between multiset derivation mode of
a MONG and jumping derivation mode of a CSG.
(I) While a MONG rewrites a string at once in a single derivation step, a CSG
rewrites only a single nonterminal that occurs within a given context during a
single derivation step.
5.3 Results 143

(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
𝑝 𝑋, 𝑋 ∈ 𝑁 𝐺 ∪ 𝑁 𝑡 .

𝑢 𝑗 ⇒∗ 𝛼0 𝑋1′ 𝑋2′ · · · 𝑋𝑛′ 𝛽0 [𝜌0 ] 𝑗⇒ 𝑢1 [ 𝑝1 ]


∗ 𝛼1 𝑝 𝑋1′ 𝑋2′ · · · 𝑋𝑛′ 𝛽1 [𝜌1 ]
𝑗⇒ 𝑗 ⇒ 𝑢2 [ 𝑝2 ]
∗ 𝛼2 𝑝 𝑋1′ 𝑝 𝑋2′ · · · 𝑋𝑛′ 𝛽2 [𝜌2 ]
𝑗⇒ 𝑗 ⇒ 𝑢3 [ 𝑝3 ]
..
.
⇒ ∗ 𝛼 ′ ′ ′ ′
𝑗 𝑛−1 𝑝 𝑋1 𝑝 𝑋2 · · · 𝑝 𝑋𝑛−1 𝑋𝑛 𝛽 𝑛−1 [𝜌 𝑛−1 ] 𝑗⇒ 𝑢𝑛 [ 𝑝𝑛]

where 𝜌𝑖 ∈ 𝑃𝑐∗ for 0 ≤ 𝑖 < 𝑛 and 𝑋ℓ′ = ℎ(𝑋ℓ ) for 1 ≤ ℓ ≤ 𝑛.


(ii) Then, by performing 𝑢 𝑛 𝑗 ⇒∗ 𝑣, 𝐻 simulates the application of 𝑝 in 𝐺.

𝑢 𝑛 𝑗 ⇒∗ 𝛼𝑛 𝑝 𝑋1′ 𝑝 𝑋2′ · · · 𝑝 𝑋𝑛′ 𝛽𝑛 [𝜌 𝑛 ] 𝑗⇒ 𝑢 𝑛+1 [ 𝑝 𝑛+1 ]


∗ 𝛼𝑛+1 𝑌1′ 𝑝 𝑋2′ · · · 𝑝 𝑋𝑛′ 𝛽𝑛+1 [𝜌 𝑛+1 ]
𝑗⇒ 𝑗 ⇒ 𝑢 𝑛+2 [ 𝑝 𝑛+2 ]
.. □
.
⇒ ∗ 𝛼 ′ ′ ′ ′
𝑗 2𝑛−1 𝑌1 𝑌2 · · · 𝑌𝑛−1 𝑝 𝑋𝑛 𝛽2𝑛−1 [𝜌2𝑛−1 ] 𝑗⇒ 𝑢 2𝑛 [ 𝑝 2𝑛 ]
= 𝛼2𝑛 𝑌1𝑌2 · · · 𝑌𝑚′ 𝛽2𝑛
′ ′
𝑗⇒
∗ 𝑣 [𝜌2𝑛 ]

where 𝜌𝑖 ∈ 𝑃𝑐∗ for 𝑛 ≤ 𝑖 ≤ 2𝑛, 𝑋ℓ′ = ℎ(𝑋ℓ ) for 1 ≤ ℓ ≤ 𝑛, and 𝑌𝑘′ = ℎ(𝑌𝑘 ) for
1 ≤ 𝑘 ≤ 𝑚.
144 5 Sequential Jumping Grammars

The simulation of application of rules of 𝑃𝐺 is repeated using rules from 𝑃𝑐 ∪


𝑃𝑐 𝑓 ∪ 𝑃𝑐𝑠 in 𝐻 until a multiset derivation of a string of terminals in 𝐺 is simulated.
(In fact, we can simultaneously simulate more than one application of a rule from
𝑃𝐺 if there is no interference in 𝐻.)
Then, in the final phase of the entire simulation, each nonterminal ⟨𝑎⟩ is replaced
with terminal 𝑎 by using rules from 𝑃𝑡 . To be precise, the rules of 𝑃𝑡 can be applied
even sooner, but symbols rewritten by these rules can be no longer rewritten by rules
from 𝑃𝑐 ∪ 𝑃𝑐 𝑓 ∪ 𝑃𝑐𝑠 in 𝐻.
To formally prove that 𝐿 (𝐺, 𝑚 ⇒) = 𝐿 (𝐻, 𝑗 ⇒), we establish the following
claims.
Claim A Every 𝑤 ∈ 𝐿 (𝐻, 𝑗 ⇒) can be generated by a derivation of the form

𝑆 𝑗 ⇒∗ 𝑤 ′ 𝑗 ⇒∗ 𝑤 in 𝐻 such that 𝑤 ′ = ℎ(𝑤) and 𝑤 ∈ Δ∗

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

𝑘
𝑆 𝑚⇒ 𝑢 𝑚⇒ 𝑣 [ 𝑝 : 𝑥 → 𝑦]

in 𝐺. By the induction hypothesis, 𝑆 𝑗 ⇒∗ 𝑢 ′ in 𝐻 such that 𝑢 ′ ∈ perm(ℎ(𝑢)).


According to the form of monotonous rule 𝑝 : 𝑥 → 𝑦 ∈ 𝑃𝐺 , there are the following
two cases, (i) and (ii), concerning 𝑢 𝑚 ⇒ 𝑣 in 𝐺 to examine.
(i) |𝑥| = 1: Let 𝑥 = 𝐴. By the induction hypothesis, occur(𝑢, 𝐴) ≥ 1 implies
occur(𝑢 ′ , 𝐴) ≥ 1. By the construction according to 𝑝, we have 𝑝 ′ : 𝐴 → ℎ(𝑦) ∈
𝑃𝑐 𝑓 . Assume 𝑢 = 𝑢 1 𝐴𝑢 2 𝑚 ⇒ 𝑣 in 𝐺 with 𝑢 1 𝑦𝑢 2 ∈ perm(𝑣). Then, 𝑢 ′ =
𝑢 1′ 𝐴𝑢 2′ 𝑗 ⇒ 𝑢 3′ ℎ(𝑦)𝑢 4′ [ 𝑝 ′ ] = 𝑣 ′ in 𝐻, where 𝑢 1′ 𝑢 2′ = 𝑢 3′ 𝑢 4′ , so 𝑣 ′ ∈ perm(ℎ(𝑣)).
5.3 Results 145

(ii) |𝑥| ≥ 2: Let 𝑥 = 𝑋1 𝑋2 · · · 𝑋𝑛 , 𝑦 = 𝑌1𝑌2 · · · 𝑌𝑚 , where |𝑥| = 𝑛 ≤ 𝑚 = |𝑦|,


𝑋𝑖 ∈ Σ𝐺 , 1 ≤ 𝑖 ≤ 𝑛, but 𝑥 ∉ Δ∗ , 𝑌𝑖 ′ ∈ Σ𝐺 , 1 ≤ 𝑖 ′ ≤ 𝑚. By con-
struction of 𝑃𝑐𝑠 , we have 𝑝 1 , 𝑝 2 , . . ., 𝑝 2𝑛 ∈ 𝑃 𝐻 . If 𝑝 can be applied in
𝐺, then, by the induction hypothesis, occur(𝑢, 𝑋𝑖 ) = occur(𝑢 ′ , {ℎ(𝑋𝑖 )}) for
1 ≤ 𝑖 ≤ 𝑛. To simulate the application of 𝑝 in 𝐻, first, apply rules from 𝑃𝑐
to yield 𝑢 ′ 𝑗 ⇒∗ 𝑢 1′ ℎ(𝑋1 𝑋2 · · · 𝑋𝑛 )𝑢 2′ . Next, consecutively apply 𝑝 1 , 𝑝 2 , . . ., 𝑝 2𝑛
so 𝑢 1′ ℎ(𝑋1 𝑋2 · · · 𝑋𝑛 )𝑢 2′ 𝑗 ⇒∗ 𝑢 3′ ℎ(𝑌1𝑌2 · · · 𝑌𝑚 )𝑢 4′ = 𝑣 ′ with 𝑢 1′ 𝑢 2′ = 𝑢 3′ 𝑢 4′ and
𝑣 ′ ∈ perm(ℎ(𝑣)). □
By Claim C with 𝑣 = 𝑤 and 𝑤 ∈ Δ∗ , for every 𝑆 𝑚 ⇒∗ 𝑤 in 𝐺, there is a derivation
𝑆 𝑗 ⇒∗ 𝑤 ′′ in 𝐻 such that 𝑤 ′′ ∈ perm(ℎ(𝑤)). By Claim A, there is a jumping
derivation in 𝐻 from 𝑤 ′′ to 𝑤 ′ such that 𝑤 ′ ∈ Δ∗ and 𝑤 ′ ∈ perm(𝑤). Therefore,
by Lemma 5.5 and Claim B, if 𝑤 ∈ 𝐿 (𝐺, 𝑚 ⇒), then perm(𝑤) ⊆ 𝐿(𝐻, 𝑗 ⇒), so
𝐿(𝐺, 𝑚 ⇒) ⊆ 𝐿 (𝐻, 𝑗 ⇒).

Claim D If 𝑆 𝑗 ⇒ℓ 𝑣 𝑗 ⇒∗ 𝑣¯ in 𝐻 for some ℓ ≥ 0, then 𝑆 𝑚⇒


∗ 𝑣 ′ in 𝐺 such that
𝑣¯ ∈ perm(ℎ(𝑣 ′ )). □
Proof (Claim D) We prove this claim by induction on ℓ ≥ 0.
Basis. Let ℓ = 0. Express 𝑆 𝑗 ⇒0 𝑆 𝑗 ⇒∗ 𝑆 as 𝑆 𝑗 ⇒0 𝑆 𝑗 ⇒0 𝑆 in 𝐻; therefore,
𝑆 𝑚 ⇒0 𝑆 in 𝐺. By ℎ(𝑆) = 𝑆, 𝑆 ∈ perm(ℎ(𝑆)).
Induction Hypothesis. Assume that the claim holds for all 0 ≤ ℓ ≤ 𝑘, for some 𝑘 ≥ 0.
Induction Step. Take any 𝑆 𝑗 ⇒ 𝑘+1 𝑣 𝑗 ⇒∗ 𝑣¯ . Express 𝑆 𝑗 ⇒ 𝑘+1 𝑣 𝑗 ⇒∗ 𝑣¯ as

𝑆 𝑗 ⇒ 𝑘 𝑢 𝑗 ⇒ 𝑣 [𝑞 : 𝑥 → 𝑦] 𝑗 ⇒∗ 𝑣¯

in 𝐻. Without any loss of generality, assume that 𝑞 ∈ 𝑃 𝐻 − 𝑃𝑡 so 𝑢, 𝑣 ∈ (Σ 𝐻 − Δ) ∗


(see Claim A). If 𝑞 ∈ 𝑃𝑐 𝑓 ∪ 𝑃𝑐𝑠 , then 𝑝 denotes the rule from 𝑃𝐺 that implied
the addition of 𝑞 into 𝑃𝑐 𝑓 or 𝑃𝑐𝑠 during the construction in the proof of Theorem
5.6. Without any loss of generality and with respect to 𝑝 from 𝑃𝐺 , assume that
there is no simulation of another context-sensitive rule from 𝑃𝐺 in progress in 𝐻
so occur(𝑢 1 𝑢 2 , 𝑁 𝑐𝑠 ) = occur(𝑣 1 𝑣 2 , 𝑁 𝑐𝑠 ) = 0, where 𝑢 = 𝑢 1 𝑥𝑢 2 and 𝑣 = 𝑣 1 𝑦𝑣 2 . By
the induction hypothesis, 𝑆 𝑗 ⇒∗ 𝑢 𝑗 ⇒∗ 𝑢¯ in 𝐻 implies 𝑆 𝑚 ⇒∗ 𝑢 ′ in 𝐺 such that
𝑢¯ ∈ perm(ℎ(𝑢 ′ )). Now, we study several cases based on the form of 𝑞:
(i) 𝑞 ∈ 𝑃𝑐 and 𝑥 = 𝑦 = 𝐴 : Then, in a jumping derivation 𝑢 𝑗 ⇒ 𝑣 [𝑞] 𝑗 ⇒0 𝑣¯ in
𝐻, 𝑢 = 𝑢 1 𝐴𝑢 2 and 𝑣 = 𝑣 1 𝐴𝑣 2 , where 𝑢 1 𝑢 2 = 𝑣 1 𝑣 2 , so 𝑣 = 𝑣¯ ∈ perm(𝑢). By
the induction hypothesis, with 𝑢 𝑗 ⇒0 𝑢¯ in 𝐻 so 𝑢 = 𝑢, ¯ there is a derivation
𝑆 𝑚 ⇒∗ 𝑢 ′ in 𝐺 such that 𝑢 ∈ perm(ℎ(𝑢 ′ )). Together with 𝑣¯ ∈ perm(𝑢), there is
also a derivation 𝑆 𝑚 ⇒∗ 𝑢 ′ 𝑚 ⇒0 𝑣 ′ in 𝐺 with 𝑣¯ ∈ perm(ℎ(𝑣 ′ )).
(ii) 𝑞 ∈ 𝑃𝑐 𝑓 and 𝑥 = 𝐴 : Then, 𝑢 = 𝑢 1 𝐴𝑢 2 and 𝑣 = 𝑣 1 𝑦𝑣 2 with 𝑢 1 𝑢 2 = 𝑣 1 𝑣 2
and 𝑣 𝑗 ⇒0 𝑣¯ in 𝐻, so 𝑣 = 𝑣¯ . By the induction hypothesis, with 𝑢 𝑗 ⇒0 𝑢¯ in
𝐻 so 𝑢 = 𝑢, ¯ there is 𝑆 𝑚 ⇒∗ 𝑢 ′ in 𝐺 with 𝑢 ∈ perm(ℎ(𝑢 ′ )) and we can write
′ ′ ′
𝑢 = 𝑢 1 𝐴𝑢 2 . By the construction, 𝑝 : 𝐴 → 𝑦 ∈ 𝑃𝐺 , so together with the induction
hypothesis we have 𝑆 𝑚 ⇒∗ 𝑢 1′ 𝐴𝑢 2′ 𝑚 ⇒ 𝑣 ′ [ 𝑝] in 𝐺, where 𝑣 ′ ∈ perm(𝑢 1′ 𝑦𝑢 2′ ),
so 𝑣¯ ∈ perm(ℎ(𝑣 ′ )).
146 5 Sequential Jumping Grammars

(iii) 𝑞 = 𝑝 𝑖 ∈ 𝑃𝑐𝑠 , where 1 ≤ 𝑖 ≤ 2𝑛 and 𝑛 = | lhs( 𝑝)| : Express 𝑆 𝑗 ⇒ 𝑘 𝑢 𝑗 ⇒ 𝑣 𝑗 ⇒∗


𝑣¯ in 𝐻 as

˜ 𝑗 ⇒ 𝑣 [ 𝑝 𝑖 ] 𝑗 ⇒∗ 𝛼2𝑛 ℎ(𝑌1𝑌2 · · · 𝑌𝑚 ) 𝛽2𝑛 [ 𝜌]


𝑆 𝑗 ⇒ 𝑘−𝑖+1 𝑢˜ 𝑗 ⇒𝑖−1 𝑢 [ 𝜌] ¯ = 𝑣¯

in 𝐻. By the construction of 𝑃𝑐𝑠 according to 𝑝 and by the induction hypothesis,


𝜌˜ = 𝑝 1 · · · 𝑝 𝑖−1 and 𝜌¯ = 𝑝 𝑖+1 · · · 𝑝 2𝑛 . By the induction hypothesis, 𝑆 𝑚 ⇒∗ 𝑢˜ ′
in 𝐺 such that 𝑢˜ ∈ perm(ℎ( 𝑢˜ ′ )). Then, by the application of 𝑝 ∈ 𝑃𝐺 , we have
𝑆 𝑚 ⇒∗ 𝑢˜ ′ 𝑚 ⇒ 𝑣 ′ such that 𝑣¯ ∈ perm(ℎ(𝑣 ′ )).
In (iii), there are three subcases of 𝑢 𝑗 ⇒ 𝑣 with 𝑢 1 𝑢 2 = 𝑣 1 𝑣 2 in 𝐻:

(iii.a) 1 ≤ 𝑖 ≤ 𝑛 : Then, 𝑢 = 𝑢 1 𝑔 𝑝 (ℎ(𝑋1 · · · 𝑋𝑖−1 ))ℎ(𝑋𝑖 𝑋𝑖+1 · · · 𝑋𝑛 )𝑢 2 and


𝑣 = 𝑣 1 𝑔 𝑝 (ℎ(𝑋1 · · · 𝑋𝑖−1 𝑋𝑖 ))ℎ(𝑋𝑖+1 · · · 𝑋𝑛 )𝑣 2 .
(iii.b) 𝑛 < 𝑖 < 2𝑛 and 𝑖 ′ = 𝑖 − 𝑛 : Then, 𝑢 = 𝑢 1 ℎ(𝑌1 · · · 𝑌𝑖 ′ −1 )𝑔 𝑝 (ℎ(𝑋𝑖 ′ 𝑋𝑖 ′ +1 · · ·
𝑋𝑛 ))𝑢 2 and 𝑣 = 𝑣 1 ℎ(𝑌1 · · · 𝑌𝑖 ′ )𝑔 𝑝 (ℎ(𝑋𝑖 ′ +1 · · · 𝑋𝑛 ))𝑣 2 .
(iii.c) 𝑖 = 2𝑛 : Then, 𝑢 = 𝑢 1 ℎ(𝑌1 · · · 𝑌𝑛−1 )𝑔 𝑝 (ℎ(𝑋𝑛 ))𝑢 2 and 𝑣 = 𝑣 1 ℎ(𝑌1 · · ·
𝑌𝑛−1𝑌𝑛 · · · 𝑌𝑚 )𝑣 2 .
Therefore, the claim holds for 𝑘 + 1 as well. □
Assume 𝑣 ∈ 𝑁𝑡∗ in Claim D so 𝑣 ′ ∈ Δ∗ . Based on Claim A, without any loss
of generality, we can assume that all rules from 𝑃𝑡 are applied in the end of a
derivation of 𝑤 ∈ Δ∗ in 𝐻. Specifically, 𝑆 𝑗 ⇒∗ 𝑣 [𝜌 𝑣 ] 𝑗 ⇒∗ 𝑤 [𝜌 𝑤 ] in 𝐻, where
𝜌 𝑣 ∈ (𝑃 𝐻 − 𝑃𝑡 ) ∗ , 𝜌 𝑤 ∈ 𝑃𝑡∗ , and 𝑣 = ℎ(𝑤). By Claim D, we have 𝑆 𝑚 ⇒∗ 𝑣 ′ in 𝐺
with 𝑣 ∈ perm(ℎ(𝑣 ′ )). Recall that 𝑣 ∈ 𝑁𝑡∗ and 𝑣 ′ ∈ Δ∗ . Therefore, 𝑆 𝑚 ⇒∗ 𝑣 ′ in 𝐺
and 𝑤 ∈ perm(𝑣 ′ ).
Next, by Claim B, 𝑤 ∈ 𝐿 (𝐻, 𝑗 ⇒) implies perm(𝑤) ⊆ 𝐿 (𝐻, 𝑗 ⇒). By the
previous paragraph and Lemma 5.5, for 𝑤, we generate perm(𝑤) in 𝐺 included in
𝐿 (𝐺, 𝑚 ⇒), that is, 𝐿 (𝐻, 𝑗 ⇒) ⊆ 𝐿 (𝐺, 𝑚 ⇒).
This closes the proof of Theorem 5.6. □
Concerning the semilinearity of language families defined by jumping gram-
mars under investigation, the following corollary sums up all important properties
established in this section.
Corollary 5.3 JREG, JRL, JLIN, JCF are semilinear, and JCS, JMON, JRE are
not semilinear.
Proof For JRE, the non-semilinearity follows from the well-known facts that CS is
not semilinear (see [Dassow and Păun, 1989, Example 2.3.1 and Theorem 2.3.1])
and CS ⊂ RE and from Theorem 5.5. The rest follows from Lemma 5.4 and
Theorem 5.6. □

Corollary 5.4 JCF ⊂ JCS.

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

Relationships Between Jumping Automata and Jumping Grammars

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.

Lemma 5.6 GJFA ⊆ JRL.

Proof Construction. For every GJFA 𝑀 = (𝑄, Δ, 𝑅, 𝑠, 𝐹), we construct a RLG


𝐺 = (𝑄 ∪ Δ ∪ {𝑆}, Δ, 𝑃′ , 𝑆), where 𝑆 is a new nonterminal, 𝑆 ∉ 𝑄 ∪ Δ, such
that 𝐿(𝑀, ↷) = 𝐿 (𝐺, 𝑗 ⇒). Set 𝑃′ = {𝑆 → 𝑓 | 𝑓 ∈ 𝐹} ∪ {𝑞 → 𝑥 𝑝 | 𝑝𝑥 → 𝑞 ∈
𝑅} ∪ {𝑞 → 𝑥 | 𝑠𝑥 → 𝑞 ∈ 𝑅}.
Basic Idea. The principle of the conversion is analogical to the conversion from
classical lazy finite automata to equivalent RLGs with sequential derivation mode
(see Section 2.6.2 in Wood [1987] and Theorem 4.1 in Salomaa [1973]).
The states of 𝑀 are used as nonterminals in 𝐺. In addition, we introduce new
start nonterminal 𝑆 in 𝐺. The input symbols Δ are terminal symbols in 𝐺.
During the simulation of 𝑀 in 𝐺 there is always exactly one nonterminal symbol
in the sentential form until the last jumping derivation step that produces the string
of terminal symbols. If there is a sequence of jumping moves 𝑢𝑠𝑣 ↷∗ 𝑦 𝑝𝑥𝑦 ′ ↷
𝑧𝑞𝑧 ′ 𝑧 ′′ ↷∗ 𝑓 in 𝑀, then 𝐺 simulates it by jumping derivation

𝑆 𝑗⇒ 𝑓 𝑗⇒ 𝑧𝑧 ′ 𝑞𝑧 ′′ 𝑗 ⇒ 𝑦𝑥 𝑝𝑦 ′ 𝑗 ⇒∗ 𝑤,

where 𝑦𝑦 ′ = 𝑧𝑧 ′ 𝑧 ′′ and 𝑤 = 𝑢𝑣. Firstly, 𝑆 is nondeterministically rewritten to some 𝑓


in 𝐺 to simulate the entrance to the corresponding accepting final state of 𝑀. Then,
for each rule 𝑝𝑥 → 𝑞 in 𝑀 that processes substring 𝑥 in the input string, there is 𝑥
generated by the corresponding rule of the form 𝑞 → 𝑥 𝑝 in 𝐺. As the last jumping
derivation step in 𝐺, we simulate the first jumping move of 𝑀 from the start state 𝑠
by rewriting the only nonterminal in the sentential form of 𝐺 to a string of terminals
and the simulation of 𝑀 by 𝐺 is completed.

Lemma 5.7 JRL ⊆ GJFA.

Proof Construction. For every RLG 𝐺 = (Σ, Δ, 𝑃′ , 𝑆), we construct a GJFA


𝑀 = (𝑁 ∪ {𝜎}, Δ, 𝑅, 𝜎, {𝑆}), where 𝜎 is a new start state, 𝜎 ∉ Σ and 𝑁 = Σ − Δ,
such that 𝐿(𝐺, 𝑗 ⇒) = 𝐿 (𝑀, ↷). Set 𝑅 = {𝐵𝑥 → 𝐴 | 𝐴 → 𝑥𝐵 ∈ 𝑃′ , 𝐴, 𝐵 ∈ 𝑁,
𝑥 ∈ Δ∗ } ∪ {𝜎𝑥 → 𝐴 | 𝐴 → 𝑥 ∈ 𝑃′ , 𝑥 ∈ Δ∗ }.
Basic Idea. In the simulation of 𝐺 in 𝑀 we use nonterminals 𝑁 as states, new state 𝜎
as the start state, and terminals Δ corresponds to input symbols of 𝑀. In addition, the
start nonterminal of 𝐺 corresponds to the only final state of 𝑀. Every application of a
148 5 Sequential Jumping Grammars

rule from 𝑃′ in 𝐺 is simulated by a move according to the corresponding rule from 𝑅


constructed above. If there is a jumping derivation 𝑆 𝑗 ⇒∗ 𝑦𝑦 ′ 𝐴𝑦 ′′ 𝑗 ⇒ 𝑧𝑥𝐵𝑧 ′ 𝑗 ⇒∗ 𝑤
in 𝐺, then 𝑀 simulates it by jumping moves 𝑢𝜎𝑣 ↷∗ 𝑧𝐵𝑥𝑧 ′ ↷ 𝑦 𝐴𝑦 ′ 𝑦 ′′ ↷∗ 𝑆,
where 𝑦𝑦 ′ 𝑦 ′′ = 𝑧𝑧 ′ and 𝑤 = 𝑢𝑣. □

Theorem 5.7 GJFA = JRL.

Proof This theorem holds by Lemmas 5.6 and 5.7. □


In the following theorem, consider jumping finite automata that process only one
input symbol in one move. We state their equivalence with jumping RGs.

Theorem 5.8 JFA = JREG.

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

We close this chapter by proposing several future investigation areas concerning


jumping grammars. Some of them relate to specific open questions pointed out
earlier in this chapter; next, we formulate them from broader viewpoint.
I. Other Types of Grammars. The present chapter has concentrated its attention
on the language families resulting from classical grammars, such as the gram-
mars underlying the Chomsky hierarchy (see Chomsky [1959]). Apart from
them, however, the formal language theory has introduced many other types
of grammars, ranging from regulated grammars (see Dassow and Păun [1989];
Meduna and Zemek [2014]) through WK grammars (see Mohamad Zulkufli
et al. [2016]), parallel grammars (see Greibach and Hopcroft [1969]; Siromoney
and Krithivasan [1974]), and pure grammars (see Gabrielian [1970]) up to gram-
mar systems (see Csuhaj-Varju et al. [1994]). Naturally, their jumping versions
are also worth to be studied as demonstrated in the following two chapters.
II. Left and Right Jumping Mode. Considering the left and right jumps introduced
in Definition 5.1, study them in terms of classical types of grammars. Later
in Section 3.1, this book gives an introduction to discussion of left and right
jumping derivation modes in terms of automata.
III. Closure Properties. Several results and some open problems concerning closure
properties follow from Section 5.3. Additionally, study closure properties of
language families generated in a jumping way. Specifically, investigate these
properties in terms of CFGs, CSGs, and MONGs.
IV. Alternative Definition of Jumping Mode with Context. Assume context-sensitive
rules (CSG) of the following form

𝛼𝐴𝛽 → 𝛼𝛾 𝛽, where 𝐴 ∈ 𝑁, 𝛼, 𝛽, 𝛾 ∈ Σ∗ , 𝛾 ≠ 𝜀.

There are three interesting ways of defining a jumping derivation step:


IV.a Using the previous definition (see Definition 5.1) of jumping derivation;
that is, find 𝛼𝐴𝛽 in the current sentential form 𝑢𝛼𝐴𝛽𝑣, remove 𝛼𝐴𝛽, and
place 𝛼𝛾𝛽 anywhere in 𝑢𝑣. For instance,

𝑎 𝐴𝑏𝑐 𝑗 ⇒ 𝑐𝑎𝑥𝑏 [𝑎 𝐴𝑏 → 𝑎𝑥𝑏]

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

the same occurrence of 𝛼 and 𝛽. As a consequence, context-sensitive rules


are applied sequentially even in this jumping derivation mode. For instance,

𝑎 𝐴𝑏𝑎𝑏 𝑗 ′′ ⇒ 𝑎𝑥𝑏𝑎𝑏 [𝑎 𝐴𝑏 → 𝑎𝑥𝑏]

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.

V. Relationship with Formal Macroset Theory. Recently, formal language theory


has introduced various rewriting devices that generate different objects than
classical formal languages. Specifically, in this way, Formal Macroset Theory
has investigated the generation of macrosets—that is, sets of multisets over
alphabets. Notice that some of its results resemble results achieved in the present
study (c.f., for instance, Theorem 1 in Kudlek et al. [2000] and Theorems 5.2
and 5.3 above). Explain this resemblance mathematically.
Chapter 6
Parallel Jumping Grammars

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

(4.b) a central 𝑢 𝑖 is nondeterministically chosen, for some 0 ≤ 𝑖 ≤ 𝑛;


(4.c) 𝑥𝑖 and 𝑥 𝑖+1 are inserted into 𝑢 𝑖 ;
(4.d) 𝑥 𝑗 is inserted between 𝑢 𝑗 and 𝑢 𝑗+1 , for all 𝑗 < 𝑖;
(4.e) 𝑥 𝑘 is inserted between 𝑢 𝑘−2 and 𝑢 𝑘−1 , for all 𝑘 > 𝑖 + 1.
(5) In Mode 5, 𝑣 is obtained from 𝑢 by (5.a) through (5.e), given next:
(5.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(5.b) a central 𝑢 𝑖 is nondeterministically chosen, for some 0 ≤ 𝑖 ≤ 𝑛;
(5.c) 𝑥1 and 𝑥 𝑛 are inserted into 𝑢 0 and 𝑢 𝑛 , respectively;
(5.d) 𝑥 𝑗 is inserted between 𝑢 𝑗 −2 and 𝑢 𝑗 −1 , for all 1 < 𝑗 ≤ 𝑖;
(5.e) 𝑥 𝑘 is inserted between 𝑢 𝑘 and 𝑢 𝑘+1 , for all 𝑖 + 1 ≤ 𝑘 < 𝑛.
(6) Mode 6 derives 𝑣 from 𝑢 applying the next steps:
(6.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(6.b) a central 𝑢 𝑖 is nondeterministically chosen, for some 0 ≤ 𝑖 ≤ 𝑛;
(6.c) 𝑥 𝑗 is inserted between 𝑢 𝑗 and 𝑢 𝑗+1 , for all 𝑗 < 𝑖;
(6.d) 𝑥 𝑘 is inserted between 𝑢 𝑘−2 and 𝑢 𝑘−1 , for all 𝑘 > 𝑖 + 1.
(7) Mode 7 obtains 𝑣 from 𝑢 performing the steps stated below:
(7.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(7.b) a central 𝑢 𝑖 is nondeterministically chosen, for some 0 ≤ 𝑖 ≤ 𝑛;
(7.c) 𝑥 𝑗 is inserted between 𝑢 𝑗 −2 and 𝑢 𝑗 −1 , for all 1 < 𝑗 ≤ 𝑖;
(7.d) 𝑥 𝑘 is inserted between 𝑢 𝑘 and 𝑢 𝑘+1 , for all 𝑖 + 1 ≤ 𝑘 < 𝑛.
(8) In Mode 8, 𝑣 is produced from 𝑢 by following the given steps:
(8.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(8.b) 𝑥1 and 𝑥 𝑛 are inserted into 𝑢 1 and 𝑢 𝑛−1 , respectively;
(8.c) 𝑥𝑖 is inserted into 𝑢 𝑖−1 𝑢 𝑖 , for all 1 < 𝑖 < 𝑛, to the right of 𝑥𝑖−1 and to the
left of 𝑥 𝑖+1 .
(9) Mode 9 derives 𝑣 from 𝑢 by the next procedure:
(9.a) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(9.b) 𝑥1 and 𝑥 𝑛 are inserted into 𝑢 0 and 𝑢 𝑛 , respectively;
(9.c) 𝑥𝑖 is inserted into 𝑢 𝑖−1 𝑢 𝑖 , for all 1 < 𝑖 < 𝑛, to the right of 𝑥𝑖−1 and to the
left of 𝑥 𝑖+1 .
As is obvious, all these jumping derivation modes reflect and formalize the
above-described four-phase computation performed in a discontinuous way more
adequately than their standard counterpart. Consequently, applications of these gram-
mars are expected in any scientific area involving this kind of computation, ranging
from applied mathematics through computational linguistics and compiler writing
up to data mining and bioinformatics.
154 6 Parallel Jumping Grammars

6.2 Definitions

First, recall a parallel language generation represented by the notion of a scattered


context grammar (introduced in Greibach and Hopcroft [1969]) that modifies a
context-free grammar such that it can simultaneously apply several rules during a
single derivation step while keeping the rest of the rewritten string unchanged.

Definition 6.1 A scattered context grammar (SCG) is a quadruple



𝐺 = Σ, Δ, 𝑃, 𝑆 ; 𝑁 = Σ − Δ

where
• Σ is a total alphabet;
• Δ ⊂ Σ an alphabet of terminals;

•𝑃⊆ 𝑁 𝑚 × (Σ∗ ) 𝑚 is a finite set of rules of the form
Ð
𝑚=1

( 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 ) → (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 )

where 𝐴𝑖 ∈ 𝑁, and 𝑥 𝑖 ∈ Σ∗ , for 1 ≤ 𝑖 ≤ 𝑛, for some 𝑛 ≥ 1;


• 𝑆 ∈ Σ − Δ is the start symbol;
• 𝑁 is an alphabet of nonterminals.
If
𝑢 = 𝑢 1 𝐴1 . . . 𝑢 𝑛 𝐴𝑛 𝑢 𝑛+1
𝑣 = 𝑢 1 𝑥1 . . . 𝑢 𝑛 𝑥 𝑛 𝑢 𝑛+1
and 𝑝 = ( 𝐴1 , . . . , 𝐴𝑛 ) → (𝑥1 , . . . , 𝑥 𝑛 ) ∈ 𝑃, where 𝑢 𝑖 ∈ Σ∗ , for all 𝑖, 1 ≤ 𝑖 ≤ 𝑛 + 1,
then 𝐺 makes a derivation step from 𝑢 to 𝑣 according to 𝑝, symbolically written as

𝑢 ⇒𝐺 𝑣 [ 𝑝]

or, simply, 𝑢 ⇒𝐺 𝑣. Set


lhs( 𝑝) = 𝐴1 . . . 𝐴𝑛
rhs( 𝑝) = 𝑥1 . . . 𝑥 𝑛 .
If 𝑛 ≥ 2, 𝑝 is said to be a context-sensitive rule while for 𝑛 = 1, 𝑝 is said to be
context-free. Define ⇒𝐺𝑘 , ⇒∗ , and ⇒+ in the standard way. The language of 𝐺 is
𝐺 𝐺
denoted by 𝐿(𝐺) and defined as

𝐿 (𝐺) = 𝑤 ∈ Δ∗ | 𝑆 ⇒∗𝐺 𝑤


A language 𝐿 is a scattered context language if there exists a scattered context


grammar 𝐺 such that 𝐿 = 𝐿 (𝐺).

Definition 6.2 A propagating scattered context grammar is a scattered context gram-


mar 
𝐺 = Σ, Δ, 𝑃, 𝑆
6.2 Definitions 155

in which every ( 𝐴1 , . . . , 𝐴𝑛 ) → (𝑥1 , . . . , 𝑥 𝑛 ) ∈ 𝑅 satisfies |𝑥 𝑖 | ≥ 1, for all 𝑖,


1 ≤ 𝑖 ≤ 𝑛. A propagating scattered context language is the language generated by a
propagating SCG.

In the following example, we illustrate how SCG works.

Example 6.1 Consider the non-context-free language 𝐿 = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 1}. This


language can be generated by the SCG

𝐺 = {𝑆, 𝐴, 𝑎, 𝑏, 𝑐}, {𝑎, 𝑏, 𝑐}, 𝑃, 𝑆

where 
𝑃 = (𝑆) → (𝑎 𝐴𝑏 𝐴𝑐 𝐴),
( 𝐴, 𝐴, 𝐴) → (𝑎 𝐴, 𝑏 𝐴, 𝑐 𝐴),
( 𝐴, 𝐴, 𝐴) → (𝜀, 𝜀, 𝜀)
For example, the sentence 𝑎𝑎𝑏𝑏𝑐𝑐 is generated by 𝐺 as follows:

𝑆 ⇒𝐺 𝑎 𝐴𝑏 𝐴𝑐 𝐴 ⇒𝐺 𝑎𝑎 𝐴𝑏𝑏 𝐴𝑐𝑐 𝐴 ⇒𝐺 𝑎𝑎𝑏𝑏𝑐𝑐

Notice, however, that 𝐿 can be also generated by the propagating SCG

𝐺 ′ = {𝑆, 𝐴, 𝑎, 𝑏, 𝑐}, {𝑎, 𝑏, 𝑐}, 𝑃′ , 𝑆




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

𝐿(𝐺, 𝜚) = {𝑥 | 𝑥 ∈ Δ∗ , 𝑆 𝜚∗ 𝑥}

𝐿 (𝐺, 𝜚) is said to be the language that 𝐺 generates by 𝜚. Set

JSC 𝜚 = {𝐿 (𝐺, 𝜚) | 𝐺 is an SCG}

JSC 𝜚 is said to be the language family that SCGs generate by 𝜚.

Definition 6.4 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Next, we rigorously define the


following direct derivation relations 1⇒ through 9⇒ over Σ∗ , intuitively sketched in
the previous introductory section.
156 6 Parallel Jumping Grammars

First, let ( 𝐴) → (𝑥) ∈ 𝑃 and 𝑢 = 𝑤 1 𝐴𝑤 2 ∈ Σ∗ . Then,

𝑤 1 𝐴𝑤 2 𝑖⇒ 𝑤 1 𝑥𝑤 2 , for 𝑖 = 1, . . . , 9

Second, let ( 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 ) → (𝑥1 , 𝑥2 , . . . , 𝑥 𝑛 ) ∈ 𝑃, 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 , and


𝑢 0 𝑢 1 . . . 𝑢 𝑛 = 𝑣 0 𝑣 1 . . . 𝑣 𝑛 , where 𝑢 𝑖 , 𝑣 𝑖 ∈ Σ∗ , 0 ≤ 𝑖 ≤ 𝑛, for some 𝑛 ≥ 2. Then,
(1) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 1⇒ 𝑢 0 𝑥1 𝑢 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑢 𝑛 ;
(2) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 2⇒ 𝑣 0 𝑥1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 , where 𝑢 0 𝑧 1 = 𝑣 0 , 𝑧2 𝑢 𝑛 = 𝑣 𝑛 ;
(3) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 3⇒ 𝑣 0 𝑥1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 , where 𝑢 0 = 𝑣 0 𝑧1 , 𝑢 𝑛 = 𝑧2 𝑣 𝑛 ;
(4) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛 4⇒
𝑢 0 𝑢 1 𝑥 1 𝑢 2 𝑥2 . . . 𝑢 𝑖−1 𝑥 𝑖−1 𝑢 𝑖1 𝑥𝑖 𝑢 𝑖2 𝑥𝑖+1 𝑢 𝑖3 𝑥𝑖+2 𝑢 𝑖+1 . . . 𝑥 𝑛 𝑢 𝑛−1 𝑢 𝑛 , where 𝑢 𝑖 = 𝑢 𝑖1 𝑢 𝑖2 𝑢 𝑖3 ;
(5) 𝑢 0 𝐴1 𝑢 1 𝐴2 . . . 𝑢 𝑖−1 𝐴𝑖−1 𝑢 𝑖 𝐴𝑖 𝑢 𝑖+1 . . . 𝐴𝑛 𝑢 𝑛 5⇒
𝑢 01 𝑥1 𝑢 02 𝑥2 𝑢 1 . . . 𝑥 𝑖−1 𝑢 𝑖−1 𝑢 𝑖 𝑢 𝑖+1 𝑥 𝑖 . . . 𝑢 𝑛1 𝑥 𝑛 𝑢 𝑛2 ,
where 𝑢 0 = 𝑢 01 𝑢 02 , 𝑢 𝑛 = 𝑢 𝑛1 𝑢 𝑛2 ;
(6) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛 6⇒
𝑢 0 𝑢 1 𝑥1 𝑢 2 𝑥2 . . . 𝑢 𝑖−1 𝑥𝑖−1 𝑢 𝑖 𝑥 𝑖+2 𝑢 𝑖+1 . . . 𝑥 𝑛 𝑢 𝑛−1 𝑢 𝑛 ;
(7) 𝑢 0 𝐴1 𝑢 1 𝐴2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝐴𝑛 𝑢 𝑛 7⇒
𝑢 0 𝑥 2 𝑢 1 . . . 𝑥 𝑖 𝑢 𝑖−1 𝑢 𝑖 𝑢 𝑖+1 𝑥𝑖+1 . . . 𝑢 𝑛 ;
(8) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 8 ⇒ 𝑣 0 𝑥 1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 , where 𝑢 0 𝑧1 = 𝑣 0 , 𝑧 2 𝑢 𝑛 = 𝑣 𝑛 ,
|𝑢 0 𝑢 1 . . . 𝑢 𝑗 −1 | ≤ |𝑣 0 𝑣 1 . . . 𝑣 𝑗 |, |𝑢 𝑗+1 . . . 𝑢 𝑛 | ≤ |𝑣 𝑗 𝑣 𝑗+1 . . . 𝑣 𝑛 |, 0 < 𝑗 < 𝑛;
(9) 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 9 ⇒ 𝑣 0 𝑥 1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 , where 𝑢 0 = 𝑣 0 𝑧1 , 𝑢 𝑛 = 𝑧2 𝑣 𝑛 ,
|𝑢 0 𝑢 1 . . . 𝑢 𝑗 −1 | ≤ |𝑣 0 𝑣 1 . . . 𝑣 𝑗 |, |𝑢 𝑗+1 . . . 𝑢 𝑛 | ≤ |𝑣 𝑗 𝑣 𝑗+1 . . . 𝑣 𝑛 |,
0 < 𝑗 < 𝑛.
We close this section by illustrating the above-introduced notation in Defini-
tion 6.3. Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG; then, 𝐿 (𝐺, 5⇒) = {𝑥 | 𝑥 ∈ Δ∗ , 𝑆 5⇒∗ 𝑥}
and JSC5 ⇒ = {𝐿(𝐺, 5⇒) | 𝐺 is an SCG}. To give another example, JSC1 ⇒ denotes
the family of all scattered context languages.

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.

Jumping Derivation Mode 1

1⇒ represents, in fact, the ordinary scattered context derivation mode.


6.3 Results 157

Definition 6.5 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and


( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 1. Then,

𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 1⇒ 𝑢 0 𝑥1 𝑢 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑢 𝑛

Example 6.2 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG, where Σ = {𝑆, 𝑆 ′ , 𝑆 ′′ , 𝑆 ′′′ , 𝐴, 𝐵, 𝐶


𝐴′ , 𝐵′ , 𝐶 ′ , 𝑎, 𝑏, 𝑐}, Δ = {𝑎, 𝑏, 𝑐}, and 𝑃 contains the following rules:

(i) (𝑆) → (𝑎𝑆 𝐴) (vii) (𝑆 ′ , 𝐶) → (𝑐𝑆 ′ , 𝐶 ′ )


(ii) (𝑆) → (𝑏𝑆𝐵) (viii) (𝑆 ′ , 𝑆 ′′ ) → (𝜀, 𝑆 ′′′ )
(iii) (𝑆) → (𝑐𝑆𝐶) (ix) (𝑆 ′′′ , 𝐴′ ) → (𝑆 ′′′ , 𝑎)
(iv) (𝑆) → (𝑆 ′ 𝑆 ′′ ) (x) (𝑆 ′′′ , 𝐵′ ) → (𝑆 ′′′ , 𝑏)
(v) (𝑆 ′ , 𝐴) → (𝑎𝑆 ′ , 𝐴′ ) (xi) (𝑆 ′′′ , 𝐶 ′ ) → (𝑆 ′′′ , 𝑐)
(vi) (𝑆 ′ , 𝐵) → (𝑏𝑆 ′ , 𝐵′ ) (xii) (𝑆 ′′′ → 𝜀)

Consider 1⇒. Then, the derivation of 𝐺 is as follows.


First, 𝐺 generates any string 𝑤 ∈ Δ∗ to the left of 𝑆 and its reversal in capital
letters to the right of 𝑆 with linear rules. Then, it replaces 𝑆 with 𝑆 ′ 𝑆 ′′ . Next, while
nondeterministically rewriting nonterminal symbols to the right of 𝑆 ′′ to their prime
versions, it generates the sequence of terminals in the same order to the left of 𝑆 ′ ,
which we denote 𝑤 ′ . Since all the symbols to the right of 𝑆 ′ must be rewritten, the
sequence of symbols generated to the left of 𝑆 ′ must have the same composition
of symbols. Otherwise, no terminal string can be generated, so the derivation is
blocked. Thereafter, 𝑆 ′ is erased, and 𝑆 ′′ is rewritten to 𝑆 ′′′ . Finally, the prime
versions of symbols to the right of 𝑆 ′′′ are rewritten to the terminal string denoted
𝑤 ′′ . Consequently,

𝐿(𝐺, 1⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑤𝑤 ′ 𝑤 ′′ , 𝑤 = reversal(𝑤 ′′ ), 𝑤 ′ is any permutation of 𝑤




For instance, the string 𝑎𝑏𝑐𝑐𝑎𝑏𝑐𝑏𝑎 is generated by 𝐺 in the following way:


𝑆 1⇒ 𝑎𝑆 𝐴 1⇒ 𝑎𝑏𝑆𝐵𝐴 1⇒ 𝑎𝑏𝑐𝑆𝐶 𝐵𝐴 1⇒ 𝑎𝑏𝑐𝑆 ′ 𝑆 ′′ 𝐶 𝐵𝐴 1⇒ 𝑎𝑏𝑐𝑐𝑆 ′ 𝑆 ′′ 𝐶 ′ 𝐵𝐴
′ ′′ ′ ′ ′ ′′ ′ ′ ′ ′′′ ′ ′ ′
1⇒ 𝑎𝑏𝑐𝑐𝑎𝑆 𝑆 𝐶 𝐵𝐴 1⇒ 𝑎𝑏𝑐𝑐𝑎𝑏𝑆 𝑆 𝐶 𝐵 𝐴 1⇒ 𝑎𝑏𝑐𝑐𝑎𝑏𝑆 𝐶 𝐵 𝐴
′′′ ′ ′ ′′′ ′ ′′′
1⇒ 𝑎𝑏𝑐𝑐𝑎𝑏𝑆 𝑐𝐵 𝐴 1⇒ 𝑎𝑏𝑐𝑐𝑎𝑏𝑆 𝑐𝑏 𝐴 1⇒ 𝑎𝑏𝑐𝑐𝑎𝑏𝑆 𝑐𝑏𝑎 1⇒ 𝑎𝑏𝑐𝑐𝑎𝑏𝑐𝑏𝑎

Next, we prove that SCGs working under 1⇒ characterize RE.

Theorem 6.1 (Fernau and Meduna [2003]) JSC1 ⇒ = RE.

Proof As is obvious, any SCG 𝐺 can be turned to a Turing machine 𝑀 so 𝑀 accepts


𝐿(𝐺, 1⇒). Thus, JSC1 ⇒ ⊆ RE. Therefore, we only need to prove RE ⊆ JSC1 ⇒ .
Let 𝐿 ∈ RE. Express 𝐿 = ℎ(𝐿 1 ∩ 𝐿 2 ), where ℎ, 𝐿 1 , and 𝐿 2 have the same
meaning as in Theorem 2.9. Since 𝐿 2 is context-free, so is reversal(𝐿 2 ) (see page
419 in Wood [1987]). Thus, there are context-free grammars 𝐺 1 and 𝐺 2 that generate
𝐿 1 and reversal(𝐿 2 ), respectively. More precisely, let 𝐺 𝑖 = (Σ𝑖 , Δ, 𝑃𝑖 , 𝑆𝑖 ) for 𝑖 = 1, 2.
Let Δ = {𝑎 1 , . . . , 𝑎 𝑛 } and 0, 1, $, 𝑆 ∉ Σ1 ∪ Σ2 be the new symbols. Without any loss
of generality, assume that Σ1 ∩ Σ2 = ∅. Define the new morphisms
158 6 Parallel Jumping Grammars

(I) 𝑐 : 𝑎 𝑖 ↦→ 10𝑖 1; (IV) 𝑓 : 𝑎 𝑖 ↦→ ℎ(𝑎 𝑖 )𝑐(𝑎 𝑖 );


∗ ∗ (V) 𝑡 : Δ ∪ {0, 1, $} → Δ ∪ {𝜀},
 1 : Σ1 ∪ Δ → Σ1 ∪ Δ {0, 1} ,
(II) 𝐶
𝐴 ↦→ 𝐴, 𝐴 ∈ Σ1 − Δ, 𝑎 ↦→ 𝑎, 𝑎 ∈ Δ,
𝑎 ↦→ 𝑓 (𝑎), 𝑎 ∈ Δ; 𝐴 ↦→ 𝜀, 𝐴 ∉ Δ;
 2 : Σ2 ∪ Δ → Σ2 ∪ {0, 1} ,
(III) 𝐶 ∗ (VI) 𝑡′ : Δ ∪ {0, 1, $} → {0, 1, 𝜀},
𝐴 ↦→ 𝐴, 𝐴 ∈ Σ2 − Δ, 𝑎 ↦→ 𝑎, 𝑎 ∈ {0, 1},
𝑎 ↦→ 𝑐(𝑎), 𝑎 ∈ Δ; 𝐴 ↦→ 𝜀, 𝐴 ∉ {0, 1}.

Finally, let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be SCG, with Σ = Σ1 ∪Σ2 ∪ {𝑆, 0, 1, $} and 𝑃 containing


the rules
(1) (𝑆) → ($𝑆1 1111𝑆2 $);
(2) ( 𝐴) → (𝐶𝑖 (𝑤)), for all 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) ($, 𝑎, 𝑎, $) → (𝜀, $, $, 𝜀), for 𝑎 = 0, 1;
(4) ($) → (𝜀).

Claim A 𝐿(𝐺, 1⇒) = 𝐿. □

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

Jumping Derivation Mode 2

Definition 6.6 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and


( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 1. Then,

𝑢 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,

𝐿(𝐺, 2⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑤𝑤 ′ 𝑤 ′′ , 𝑤 ′ , 𝑤 ′′ are any permutations of 𝑤




For example, the string 𝑎𝑏𝑐𝑎𝑐𝑏𝑏𝑎𝑐 is generated by 𝐺 in the following way:


𝑆 2⇒ 𝑎𝑆 𝐴 2⇒ 𝑎𝑏𝑆𝐵𝐴 2⇒ 𝑎𝑏𝑐𝑆𝐶 𝐵𝐴 2⇒ 𝑎𝑏𝑐𝑆 ′ 𝑆 ′′ 𝐶 𝐵𝐴 2⇒ 𝑎𝑏𝑐𝑎𝑆 ′ 𝑆 ′′ 𝐴′ 𝐶 𝐵
′ ′′ ′ ′ ′ ′′ ′ ′ ′ ′′′ ′ ′ ′
2⇒ 𝑎𝑏𝑐𝑎𝑐𝑆 𝑆 𝐴 𝐶 𝐵 2⇒ 𝑎𝑏𝑐𝑎𝑐𝑏𝑆 𝑆 𝐵 𝐴 𝐶 2⇒ 𝑎𝑏𝑐𝑎𝑐𝑏𝑆 𝐵 𝐴 𝐶
⇒ 𝑎𝑏𝑐𝑎𝑐𝑏𝑆 ′′′ 𝐵 ′ 𝐴′ 𝑐 ⇒ 𝑎𝑏𝑐𝑎𝑐𝑏𝑆 ′′′ 𝑏 𝐴′ 𝑐 ⇒ 𝑎𝑏𝑐𝑎𝑐𝑏𝑆 ′′′ 𝑏𝑎𝑐 ⇒ 𝑎𝑏𝑐𝑎𝑐𝑏𝑏𝑎𝑐
2 2 2 2

Theorem 6.2 JSC2 ⇒ = RE.


Proof Clearly JSC2 ⇒ ⊆ RE, so we only need to prove RE ⊆ JSC2 ⇒ .
Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be the SCG constructed in the proof of Theorem 6.1. First,
we modify 𝐺 to a new SCG 𝐺 ′ so 𝐿(𝐺, 1 ⇒) = 𝐿(𝐺 ′ , 1 ⇒). Then, we prove
𝐿(𝐺 ′ , 2⇒) = 𝐿(𝐺 ′ , 1⇒).
160 6 Parallel Jumping Grammars

Construction. Set

𝑁 = {⌈, ⌉, ⌊, ⌋, |, 𝑋, 𝑋, 𝑋, 𝑋, 𝑌 , 𝑌 , 𝑌 , 𝑌 }

where Σ ∩ 𝑁 = ∅. Define the new morphisms


∗ ∗
(I) 𝐶 1 : Σ1 ∪ Δ → Σ1 ∪ Δ {0, 1} ,
𝐴 ↦→ 𝐴, 𝐴 ∈ Σ1 − Δ,
𝑎 ↦→ ⌈ 𝑓 (𝑎)⌉ |, 𝑎 ∈ Δ;

(II) 𝐶 2 : Σ2 ∪ Δ → Σ2 ∪ (𝑁 ∪ {0, 1}) ,
𝐴 ↦→ 𝐴, 𝐴 ∈ Σ2 − Δ,
𝑎 ↦→ | ⌈𝑐(𝑎)⌉, 𝑎 ∈ Δ;
(III) 𝑏 : Δ ∪ {0, 1, $} ∪ 𝑁 → {0, 1, 𝜀},
𝐴 ↦→ 𝐴, 𝐴 ∈ {0, 1},
𝐴 ↦→ 𝜀, 𝐴 ∉ {0, 1};

(IV) 𝑡 : Δ ∪ {0, 1, $} ∪ 𝑁 → {0, 1, $, 𝜀} ∪ 𝑁,
𝐴 ↦→ 𝐴, 𝐴 ∈ {$} ∪ 𝑁,
𝐴 ↦→ 𝑡 ′ ( 𝐴), 𝐴 ∉ {$} ∪ 𝑁.
Let 𝐺 ′ = (Σ′ , Δ, 𝑃′ , 𝑆) be SCG, with Σ′ = Σ ∪ 𝑁 and 𝑃′ containing
(1) (𝑆) → (⌉ 𝑋$𝑆1 ⌈11 || 11⌉𝑆2 $𝑌 ⌈);
(2) ( 𝐴) → (𝐶 𝑖 (𝑤)) for 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) (⌉, 𝑋, ⌈) → (⌋, 𝑋, ⌋), (⌉, 𝑌 , ⌈) → ( ⌊, 𝑌 , ⌊);
(4) (⌋, 𝑋, ⌋) → (⌋, 𝑋, ⌋), ( ⌊, 𝑌 , ⌊) → ( ⌊, 𝑌 , ⌊);
(5) ($, 0, 𝑋, 𝑌 , 0, $) → (𝜀, $, 𝑋, 𝑌 , $, 𝜀);
(6) ($, 𝑋, 𝑌 , $) → (𝜀, 𝑋$, $𝑌 , 𝜀);
(7) (⌋, 𝑋, $, ⌋, ⌊, $, 𝑌 , ⌊) → (𝜀, 𝜀, 𝜀, 𝑋$, $𝑌 , 𝜀, 𝜀, 𝜀);
(8) (𝑋, 1, 1, |, |, 1, 1, 𝑌 ) → (𝜀, 𝜀, 𝜀, 𝑋, 𝑌 , 𝜀, 𝜀, 𝜀);
(9) ($) → (𝜀), (𝑋) → (𝜀), (𝑌 ) → (𝜀).
Notice that 𝑋 and 𝑌 hold the current state of computation and force the context-
sensitive rules to be used in the following order:
(a) after applying rules from (3), only rules from (4) may be applied;
(b) after applying rules from (4), only rule (5) or rule (6) may be applied;
(c) after applying rule (5), only rules from (4) may be applied;
(d) after applying rule (6), only rule (7) may be applied;
(e) after applying rule (7), only rule (8) may be applied;
(f) after applying rule (8), only rules from (3) may be applied.

Claim A 𝐿(𝐺 ′ , 1⇒) = 𝐿(𝐺, 1⇒). □

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

𝑆 1⇒∗ ⌉ 𝑋$𝑤 1 ⌈11 || 11⌉𝑤 2 $𝑌 ⌈= 𝑤

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⇒∗ 𝑣 ′ , 𝑣 ′ ∈ Δ∗

if and only if 𝑡 ′ (𝑣 1 ) = reversal(𝑣 2 ). Note, 𝑣 ′ = 𝑡 (𝑣). Therefore, we have to prove

𝑤 1⇒∗ 𝑤 ′ , 𝑤 ′ ∈ Δ∗

if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ). Then, 𝑣 ′ = 𝑤 ′ .


Claim B In 𝐺 ′ , for

𝑆 1⇒∗ ⌉ 𝑋$𝑤 1 ⌈11 || 11⌉𝑤 2 $𝑌 ⌈= 𝑤, symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅

where 𝑤 is generated by using rules from (1) and (2),

𝑤 1⇒∗ 𝑤 ′

where 𝑤 ′ ∈ Δ∗ if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ). □


For the sake of readability, in the next proof we omit all symbols from Δ in
𝑤 1 —that is, we consider only nonterminal symbols, which are to be erased.
Proof (Claim B) If. Suppose 𝑤 1 = reversal(𝑤 2 ), then 𝑤 1⇒∗ 𝜀. From the construc-
tion of 𝐺 ′ , 𝑤 1 = ( ⌈10𝑖1 1⌉ |) ( ⌈10𝑖2 1⌉ |) . . . ( ⌈10𝑖𝑛 1⌉ |), where 𝑖 𝑗 ∈ {1, . . . , card(Δ)},
1 ≤ 𝑗 ≤ 𝑛, 𝑛 ≥ 0. Consider two cases—(I) 𝑛 = 0 and (II) 𝑛 ≥ 1.
(I) If 𝑛 = 0, 𝑤 =⌉ 𝑋$⌈11 || 11⌉$𝑌 ⌈. Then, by using rules from (3) and (4), rules (7)
and (8), and four times rules from (9), we obtain

⌉ 𝑋$⌈11 || 11⌉$𝑌 ⌈ 1⇒⌋ 𝑋$⌋11 || 11⌉$𝑌 ⌈ 1⇒


⌋ 𝑋$⌋11 || 11⌊$𝑌 ⌊ 1⇒⌋ 𝑋$⌋11 || 11⌊$𝑌 ⌊ 1⇒
⌋ 𝑋$⌋11 || 11⌊$𝑌 ⌊ 1⇒ 𝑋$11 || 11$𝑌 1⇒
$𝑋𝑌 $ 1⇒ 𝑋𝑌 $ 1⇒ 𝑌 $ 1⇒ $ 1⇒ 𝜀

and the claim holds.


(II) Let 𝑛 ≥ 1,
′ ′
𝑤 =⌉ 𝑋$⌈10𝑖 1⌉ | ( ⌈10𝑖𝑚 1⌉ |) 𝑘 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑘 | ⌈10 𝑗 1⌉$𝑌 ⌈
′ ′
=⌉ 𝑋$⌈10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉$𝑌 ⌈
162 6 Parallel Jumping Grammars

where 𝑘 ≥ 0, 𝑚, 𝑚 ′ ∈ {1, . . . , 𝑘 }, 𝑖 ′ , 𝑖 𝑚 , 𝑗 ′ , 𝑗 𝑚′ ∈ {1, . . . , card(Δ)}. Sequen-


tially using rules from (3) and rules from (4) and rule (7) we obtain the derivation
′ ′ ′ ′
⌉ 𝑋$⌈10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉$𝑌 ⌈ 1⇒ ⌋ 𝑋$⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉$𝑌 ⌈ 1⇒
′ ′ ′ ′
⌋ 𝑋$⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊$𝑌 ⌊ 1⇒⌋ 𝑋$⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊$𝑌 ⌊ 1⇒
′ ′ ′ ′
⌋ 𝑋$⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊$𝑌 ⌊ 1⇒ 𝑋$10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 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 $

Since 𝑖 ′ = 𝑗 ′ , both sequences of 0s are simultaneously erased by repeatedly


using both rules from (4) and the rule from (5). Observe that
′ ′
$0𝑖 ⌋ 𝑋⌋11 || 11⌊𝑌 ⌊0 𝑗 $ 1⇒∗ $⌋ 𝑋⌋11 || 11⌊𝑌 ⌊$

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⇒∗ 𝜀

where 𝑚, 𝑚 ′ ∈ {1, . . . , 𝑙}, 𝑖 ′ , 𝑖 𝑚 , 𝑗 ′ , 𝑗 𝑚′ ∈ {1, . . . , card(Δ)}, for all 0 ≤ 𝑙 ≤ 𝑘.


Induction Step. Consider any
′ ′
𝑤 ′ = 𝑋$10𝑖 1⌉ | ( ⌈10𝑖𝑚 1⌉ |) 𝑘+1 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑘+1 | ⌈10 𝑗 1$𝑌

where 𝑚, 𝑚 ′ ∈ {1, . . . , 𝑘 + 1}, 𝑖 ′ , 𝑖 𝑚 , 𝑗 ′ , 𝑗 𝑚′ ∈ {1, . . . , card(Δ)}. Since 𝑘 + 1 ≥ 1


′ ′′ ′′ ′
𝑤 ′ = 𝑋$10𝑖 1⌉ | ⌈10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉ | ⌈10 𝑗 1$𝑌
𝑢 = ( ⌈10𝑖𝑚 1⌉ |) 𝑘 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑘
6.3 Results 163

By using rule (8) and both rules from (3) 𝐺 ′ performs


′ ′′ ′′ ′
𝑋$10𝑖 1⌉ | ⌈10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉ | ⌈10 𝑗 1$𝑌 1⇒
′ ′′ ′′ ′
$0𝑖 ⌉ 𝑋 ⌈10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉𝑌 ⌈0 𝑗 $ 1⇒
′ ′′ ′′ ′
$0𝑖 ⌋ 𝑋⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌉𝑌 ⌈0 𝑗 $ 1⇒
′ ′′ ′′ ′
$0𝑖 ⌋ 𝑋⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊𝑌 ⌊0 𝑗 $

Since 𝑖 ′ = 𝑗 ′ , the prefix of 0s and the suffix of 0s are simultaneously erased by


repeatedly using rules from (4) and rule (5).
′ ′′ ′′ ′ ′′ ′′
$0𝑖 ⌋ 𝑋⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊𝑌 ⌊0 𝑗 $ 1⇒∗ $⌋ 𝑋⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊𝑌 ⌊$

Finally, 𝐺 ′ uses the rule (6) and the rule (7)


′′ ′′ ′′ ′′
$⌋ 𝑋⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊𝑌 ⌊$ 1⇒ ⌋ 𝑋$⌋10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1⌊$𝑌 ⌊ 1⇒
′′ ′′
𝑋$10𝑖 1⌉ | 𝑢 | ⌈10 𝑗 1$𝑌 = 𝑤 ′′
where
′′ ′′
𝑤 ′′ = 𝑋$10𝑖 1⌉ | ( ⌈10𝑖𝑚 1⌉ |) 𝑘 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑘 | ⌈10 𝑗 1$𝑌

By the induction hypothesis, 𝑤 ′′ 1⇒∗ 𝜀, which completes the proof.


Only if. Suppose that 𝑤 1 ≠ reversal(𝑤 2 ), then there is no 𝑤 ′ satisfying 𝑤 1⇒∗ 𝑤 ′
and 𝑤 ′ = 𝜀.
From the construction of 𝐺 ′ , there is no rule shifting the left $ to the left and no
rule shifting the right $ to the right. Since rule (5) is the only one erasing 0s and
these 0s must occur between two $s, if there is any 0, which is not between the two
$s, it is unable to be erased. Moreover, an application of rule (5) moves the left $
on the previous position of erased left 0; if it is not the leftmost, the derivation is
blocked. It is symmetric on the right. A similar situation is regarding 1s, 𝑋, and 𝑌 .
Thus, for the sentential form 𝑤, if 0 or 1 is the rightmost or the leftmost symbol of
𝑤, no terminal string can be generated.
Since 𝑤 1 ≠ reversal(𝑤 2 ), the codings of terminal strings generated by 𝐺 1 and
𝐺 2 are different. Then, there is 𝑎 and 𝑎 ′ , where 𝑤 1 = 𝑣𝑎𝑢, 𝑤 2 = 𝑢 ′ 𝑎 ′ 𝑣, and 𝑎 ≠ 𝑎 ′ .
Observe that always the outermost 0 or 1 is erased; otherwise, the derivation is
blocked. Suppose the derivation correctly erases both strings 𝑣, so 𝑎 and 𝑎 ′ are the
outermost symbols. The derivation can continue in the following two ways:
(I) Suppose the outermost 0s are erased before the outermost 1s. Then, rule (5) is
used, which requires 𝑋 and 𝑌 between the previous positions of 0s. However,
there is 1, 𝑎 or 𝑎 ′ , which is not between 𝑋 and 𝑌 .
(II) Suppose the outermost 1s are erased before the outermost 0s. Then, rule (8) is
used, which requires 𝑋 and 𝑌 in the current sentential form. The symbols 𝑋 and
𝑌 are produced by rule (7), which requires 𝑋 and $ between two symbols ⌋ and
𝑌 and $ between two symbols ⌊. Suppose 𝑤 ′ is the current sentential form. Since
𝑤 1 or reversal(𝑤 2 ) is of the form
164 6 Parallel Jumping Grammars

. . . ⌈10𝑖0 1⌉ | ⌈10𝑖1 1⌉ | ⌈10𝑖2 1⌉ | . . .

where 𝑖 0 , 𝑖1 , 𝑖2 ∈ {1, . . . , card(Δ)}, there is 0 as the leftmost or rightmost symbol


of 𝑤 ′ and 𝑋$ and $𝑌 occurs between ⌋s and ⌊s, respectively. However, this 0
is obviously not between the two $ and remains permanently in the sentential
form.
We showed that 𝐺 ′ can generate the terminal string from the sentential form 𝑤 if
and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), so the claim holds. □
We proved that for any 𝑤 ∈ Δ∗ , 𝑆 1⇒∗ 𝑤 in 𝐺 if and only if 𝑆 1⇒∗ 𝑤 in 𝐺 ′ , and
Claim A holds. □
Let us turn to 2⇒.

Claim C 𝐿 (𝐺 ′ , 2⇒) = 𝐿(𝐺 ′ , 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

𝑤 ∉ 𝐿(𝐺 ′ , 1⇒) ⇒ 𝑤 ∉ 𝐿(𝐺 ′ , 2⇒)

Therefore, to complete the proof of Claim C, we establish the following claim:

Claim D In 𝐺 ′ , for

𝑆 1⇒∗ ⌉ 𝑋$𝑤 1 ⌈11 || 11⌉𝑤 2 $𝑌 ⌈= 𝑤, symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅

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

𝑆 1⇒∗ 𝑤 =⌉ 𝑋$𝑤 1 ⌈11 || 11⌉𝑤 2 $𝑌 ⌈

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⌊$𝑌 ⌊

Notice that if neighboring nonterminals are rewritten, 2 ⇒ do not shift any


symbol.
Next, rule (7) is the only applicable rule, which shifts 𝑋, 𝑌 , and $s inside
into the current sentential form. However, if any shift is performed, there is a
symbol 1 as the outermost symbol, which is obviously unable to be erased. Thus,

⌋ 𝑋$⌋11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1⌊$𝑌 ⌊2⇒

𝑋$11 || 11⌉ (| ⌈10𝑖𝑚 1⌉) 𝑘 | ⌈10𝑖 1$𝑌 = 𝑤 ′
Next, consider two cases depending on 𝑘.

(I.i) Suppose 𝑘 = 0. Then,


𝑤 ′ = 𝑋$11 || 11⌉ | ⌈10𝑖 1$𝑌

Since 𝑖 ′ > 0, rule (5) must be used. It requires presence of 𝑋 and 𝑌 in


the current sentential form. These can be obtained only by application of
rule (8) and both rules from (3) and (4). However, it must rewrite two pairs
166 6 Parallel Jumping Grammars

of ⌉,⌈, but there is only one remaining. Therefore, there are 𝑖 ′ symbols 0,
which cannot be erased, and no terminal string can be generated.

(I.ii) Suppose 𝑘 > 0. Then, 𝑤 ′ is of the form


𝑋$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𝑖 $

Without any loss of generality, we omit other possibilities of erasing the


symbols | or 1, because the derivation would be blocked in the same way.
Since there is no 0 to the left of 𝑋, the future application of rule (5) is
excluded, and the rightmost sequence of 0s is obviously skipped and cannot
be erased any more.

(II) Suppose the condition applies. Then,


′ ′
𝑤 = ⌉ 𝑋$⌈10𝑖 1⌉ | ( ⌈10 𝑗𝑚 1⌉ |) 𝑘 ⌈11 || 11⌉ (| ⌈10 𝑗𝑚′ 1⌉) 𝑘 | ⌈10𝑖 1⌉$𝑌 ⌈

= ⌉ 𝑋$⌈10𝑖 1⌉ | ⌈𝑢⌉ | ⌈10𝑖 1⌉$𝑌 ⌈

where 𝑘, 𝑘 ′ ≥ 0, 𝑚 ∈ {1, . . . , 𝑘 }, 𝑚 ′ ∈ {1, . . . , 𝑘 ′ }, 𝑖 𝑚 , 𝑖 ′𝑚 , 𝑗, 𝑗 ′ ∈ {1, . . . ,


card(Δ)}.
First, the situation is completely the same as in (I), the only possibly non-
blocking derivation consists of application of both rules from (3) and (4) followed
by application of rule (7). No left-hand-side string may be shifted during the
application of these rules or the derivation is blocked.

′ ′
⌉ 𝑋$⌈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:

(II.i) Suppose 𝑎𝑢 = 𝜀. Then, 𝑢 ′ 𝑎 ′ ≠ 𝜀 and the situation is the same as in (I), no


terminal string can be generated and the derivation is blocked.

(II.ii) Suppose 𝑎𝑢 ≠ 𝜀, 𝑢 ′ 𝑎 ′ ≠ 𝜀. If the derivation is not blocked before, it may


generate the sentential form


$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

Jumping Derivation Mode 3

Definition 6.7 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and


( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 1. Then,

𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 3⇒ 𝑣 0 𝑥1 𝑣 1 𝑥2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛

where 𝑢 0 𝑢 1 . . . 𝑢 𝑛 = 𝑣 0 𝑣 1 . . . 𝑣 𝑛 , 𝑢 0 = 𝑣 0 𝑧 1 and 𝑢 𝑛 = 𝑧 2 𝑣 𝑛 , 𝑧1 , 𝑧2 ∈ Σ∗ .

Informally, 𝐺 obtains 𝑣 = 𝑣 0 𝑥1 𝑣 1 𝑥 2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 from 𝑢 = 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛


by ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃 in terms of 3⇒ as follows:
(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(2) 𝑥 1 and 𝑥 𝑛 are inserted into 𝑢 0 and 𝑢 𝑛 , respectively;
(3) 𝑥 2 through 𝑥 𝑛−1 are inserted between the newly inserted 𝑥1 and 𝑥 𝑛 .

Example 6.4 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, $, 𝑎, 𝑏}, Δ = {𝑎, 𝑏}, be an
SCG with 𝑃 containing the following rules:

(i) (𝑆) → ( 𝐴$) (iv) ( 𝐴) → (𝜀)


(ii) ( 𝐴) → (𝑎 𝐴𝑏) (v) ($) → (𝜀)
(iii) ( 𝐴, $) → ( 𝐴, $)

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,


and 𝑣 is defined recursively as 𝑥


For example, the string 𝑎𝑎𝑎𝑎𝑏𝑎𝑏𝑏𝑎𝑏𝑏𝑏 is generated by 𝐺 in the following way:
𝑆 3⇒ 𝐴$ 3⇒ 𝑎 𝐴𝑏$ 3⇒ 𝑎𝑎 𝐴𝑏𝑏$ 3⇒ 𝑎𝑎𝑎 𝐴𝑏𝑏𝑏$ 3⇒ 𝑎𝑎 𝐴𝑎𝑏𝑏𝑏$
3⇒ 𝑎𝑎𝑎 𝐴𝑏𝑎𝑏𝑏𝑏$ 3⇒ 𝑎𝑎𝑎𝑎 𝐴𝑏𝑏𝑎𝑏𝑏𝑏$ 3⇒ 𝑎𝑎𝑎 𝐴𝑎𝑏𝑏𝑎𝑏𝑏𝑏$
3⇒ 𝑎𝑎𝑎𝑎 𝐴𝑏𝑎𝑏𝑏𝑎𝑏𝑏𝑏$ 3⇒ 𝑎𝑎𝑎𝑎𝑏𝑎𝑏𝑏𝑎𝑏𝑏𝑏$ 3⇒ 𝑎𝑎𝑎𝑎𝑏𝑎𝑏𝑏𝑎𝑏𝑏𝑏

Theorem 6.3 JSC3 ⇒ = RE.

Proof Clearly JSC3 ⇒ ⊆ RE, so we only need to prove RE ⊆ JSC3 ⇒ .


Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be the SCG constructed in the proof of Theorem 6.1. Next,
we modify 𝐺 to a new SCG 𝐺 ′ satisfying 𝐿 (𝐺, 1⇒) = 𝐿 (𝐺 ′ , 1⇒). Finally, we prove
𝐿 (𝐺 ′ , 3⇒) = 𝐿(𝐺 ′ , 1⇒).

Construction. Let 𝐺 ′ = (Σ, Δ, 𝑃′ , 𝑆) be SCG with 𝑃′ containing


6.3 Results 169

(1) (𝑆) → (𝑆1 11$$11𝑆2 );


(2) ( 𝐴) → (𝐶𝑖 (𝑤)) for 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) (𝑎, $, $, 𝑎) → ($, 𝜀, 𝜀, $), for 𝑎 = 0, 1;
(4) ($) → (𝜀).
We establish the proof of Theorem 6.3 by demonstrating the following two claims.

Claim A 𝐿 (𝐺 ′ , 1⇒) = 𝐿(𝐺, 1⇒). □

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. □

Claim B 𝐿 (𝐺 ′ , 3⇒) = 𝐿 (𝐺 ′ , 1⇒). □

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

Then, 𝑤 3⇒∗ 𝑤 ′ , where 𝑤 ′ ∈ Δ∗ if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 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

𝑤 = 10𝑚1 110𝑚2 1 . . . 10𝑚𝑙 111$$1110𝑚𝑙 1 . . . 10𝑚2 110𝑚1 1

Suppose the check works properly not skipping any symbol. Then,

𝑤 3⇒∗ 𝑤 ′ = $$

and twice applying rule (4) the derivation finishes.


Only if. If 𝑤 1 ≠ reversal(𝑤 2 ), though the check works properly,

𝑤 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. □

Jumping Derivation Mode 4

Definition 6.8 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 𝐴𝑣 ∈ Σ∗ and ( 𝐴) → (𝑥) ∈


𝑃. Then, 𝑢 𝐴𝑣 4 ⇒ 𝑢𝑥𝑣. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) →
(𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 2. Then,
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛 4⇒
𝑢 0 𝑢 1 𝑥1 𝑢 2 𝑥 2 . . . 𝑢 𝑖−1 𝑥𝑖−1 𝑢 𝑖1 𝑥 𝑖 𝑢 𝑖2 𝑥 𝑖+1 𝑢 𝑖3 𝑥 𝑖+2 𝑢 𝑖+1 . . . 𝑥 𝑛 𝑢 𝑛−1 𝑢 𝑛
where 𝑢 𝑖 = 𝑢 𝑖1 𝑢 𝑖2 𝑢 𝑖3 .

Informally, 𝑣 = 𝑢 0 𝑢 1 𝑥1 𝑢 2 𝑥2 . . . 𝑢 𝑖−1 𝑥 𝑖−1 𝑢 𝑖1 𝑥𝑖 𝑢 𝑖2 𝑥𝑖+1 𝑢 𝑖3 𝑥𝑖+2 𝑢 𝑖+1 . . . 𝑥 𝑛 𝑢 𝑛−1 𝑢 𝑛 is


obtained from 𝑢 = 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛 in 𝐺 by ( 𝐴1 ,
𝐴2 , . . . , 𝐴𝑛 ) → (𝑥1 , 𝑥 2 , . . . , 𝑥 𝑛 ) ∈ 𝑃 in 4⇒ as follows:
(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(2) a central 𝑢 𝑖 is nondeterministically chosen, for some 𝑖 ∈ {0, . . . , 𝑛};
(3) 𝑥𝑖 and 𝑥 𝑖+1 are inserted into 𝑢 𝑖 ;
6.3 Results 171

(4) 𝑥 𝑗 is inserted between 𝑢 𝑗 and 𝑢 𝑗+1 , for all 𝑗 < 𝑖;


(5) 𝑥 𝑘 is inserted between 𝑢 𝑘−2 and 𝑢 𝑘−1 , for all 𝑘 > 𝑖 + 1.

Example 6.5 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, 𝐵, 𝐶, $, 𝑎, 𝑏, 𝑐, 𝑑}, Δ = {𝑎, 𝑏,


𝑐, 𝑑}, be an SCG with 𝑃 containing the following rules:

(i) (𝑆) → ( 𝐴𝐵$$𝐵𝐴) (iv) ( 𝐴, 𝐵, 𝐵, 𝐴) → ( 𝐴, 𝐶, 𝐶, 𝐴)


(ii) ( 𝐴) → (𝑎 𝐴𝑏) (v) ($, 𝐶, 𝐶, $) → (𝜀, 𝜀, 𝜀, 𝜀)
(iii) (𝐵) → (𝑐𝐵𝑑) (vi) ( 𝐴) → (𝜀)

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⇒ 𝑎𝑎𝑏𝑏𝑐𝑎𝑏𝑑𝑐𝑐𝑑𝑑𝑎𝑏

Theorem 6.4 JSC4 ⇒ = RE.

Proof As is obvious, JSC4 ⇒ ⊆ RE, so we only prove RE ⊆ JSC4 ⇒ .


Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be the SCG constructed in the proof of Theorem 6.1. Next,
we modify 𝐺 to a new SCG 𝐺 ′ so 𝐿(𝐺, 1⇒) = 𝐿 (𝐺 ′ , 4⇒).

Construction. Introduce five new symbols—𝐷,𝐸,𝐹,|, and ⊤. Set 𝑁 = {𝐷,𝐸,𝐹,|,⊤}.


Let 𝐺 ′ = (Σ′ , Δ, 𝑃′ , 𝑆) be SCG, with Σ′ = Σ ∪ 𝑁 and 𝑃′ containing the rules
172 6 Parallel Jumping Grammars

(1) (𝑆) → (𝐹$𝑆1 11|𝐸 |11𝑆2 $𝐹);


(2) ( 𝐴) → (𝐶𝑖 (𝑤)) for 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) (𝐹) → (𝐹𝐹);
(4) ($, 𝑎, 𝑎, $) → (𝜀, 𝐷, 𝐷, 𝜀), for 𝑎 = 0, 1;
(5) (𝐹, 𝐷, |, |, 𝐷, 𝐹) → ($, 𝜀, ⊤, ⊤, 𝜀, $);
(6) (⊤, 𝐸, ⊤) → (𝜀, |𝐸 |, 𝜀);
(7) ($) → (𝜀), (𝐸) → (𝜀), (|) → (𝜀).

Claim A 𝐿 (𝐺, 1⇒) = 𝐿 (𝐺 ′ , 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

𝑆 4⇒∗ 𝐹$𝑤 1 11|𝐸 |11𝑤 2 $##𝐹 = 𝑤 ′

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⇒∗ 𝑣, 𝑣 ∈ Δ∗

if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ); then 𝑣 = 𝑡 (𝑤). Therefore, we have to prove

𝑤 ′ 4⇒∗ 𝑣 ′ , 𝑣 ′ ∈ Δ∗

if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ). Then, obviously 𝑣 ′ = 𝑣 and we can complete


the proof by the following claim.

Claim B In 𝐺 ′ , for

𝑆 4⇒∗ 𝑤 = 𝐹 𝑖1 $𝑤 1 11|𝐸 |11𝑤 2 $##𝐹 𝑖2 , symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅

where 𝑤 is generated only by using the rule (1) and rules from (2),

𝑤 4⇒∗ 𝑤 ′

where 𝑤 ′ ∈ Δ∗ if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ), for some 𝑖1 , 𝑖2 ≥ 0. □

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

𝐹𝐹$11|𝐸 |11$𝐹𝐹 4⇒ 𝐹𝐹 𝐷1|𝐸 |1𝐷𝐹𝐹

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

𝐹𝐹 𝐷1|𝐸 |1𝐷𝐹𝐹 4⇒ 𝐹$1⊤𝐸⊤1$𝐹

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,

𝐹$1⊤𝐸⊤1$𝐹 4⇒ 𝐹$1|𝐸 |1$𝐹

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$𝐹 4⇒ 𝐹 𝐷 |𝐸 |𝐷𝐹 4⇒ $⊤𝐸⊤$4⇒ $|𝐸 |$4⇒∗ 𝜀

and the basis holds.


Induction Hypothesis. Suppose there exists 𝑘 ≥ 0 such that the claim holds for all
0 ≤ 𝑚 ≤ 𝑘, where

𝑤 = 𝐹 𝑖1 $𝑤 1 11|𝐸 |11𝑤 2 $𝐹 𝑖2 , |𝑤 1 | = |𝑤 2 | = 𝑚

Induction Step. Consider 𝐺 ′ generating 𝑤 with


𝑤 = 𝐹 𝑖1 $𝑤 1 11|𝐸 |11𝑤 2 $𝐹 𝑖2
where |𝑤 1 | = |𝑤 2 | = 𝑘 + 1, 𝑤 1 = reversal(𝑤 2 ) = 𝑎𝑤 1′ , and 𝑎 ∈ {0, 1}. Except for the
rules from (7), a rule from (4) is the only applicable one. The center for interchanging
of the right-hand-side strings must be chosen between the two rewritten 0s or 1s and
additionally inserted 𝐷s must remain on the different sides of the central string |𝐸 |.
174 6 Parallel Jumping Grammars

Moreover, the outermost 0s or 1s must be rewritten, and 𝐷s may not be shifted


between the new outermost ones; otherwise, they cannot be erased.

𝐹 𝑖1 $𝑤 1 11|𝐸 |11𝑤 2 $𝐹 𝑖2 4⇒ 𝐹 𝑖1 𝐷𝑤 1′ 11|𝐸 |11𝑤 2′ 𝐷𝐹 𝑖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 = 𝑤 ′

By the induction hypothesis, 𝑤 ′ 4⇒∗ 𝜀, which completes the proof.

Only if. Suppose 𝑤 1 ≠ reversal(𝑤 2 ); there is no 𝑤 ′ , where 𝑤 4⇒∗ 𝑤 ′ and 𝑤 ′ = 𝜀.


Since 𝑤 1 ≠ reversal(𝑤 2 ), 𝑤 1 = 𝑣𝑎𝑢, 𝑤 2 = 𝑢 ′ 𝑎 ′ 𝑣, and 𝑎 ≠ 𝑎 ′ . Suppose both 𝑣s
are correctly erased, and no symbol is skipped producing the sentential form

𝐹 𝑖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. □

Jumping Derivation Mode 5

Definition 6.9 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 𝐴𝑣 ∈ Σ∗ and ( 𝐴) → (𝑥) ∈


𝑃. Then, 𝑢 𝐴𝑣 5 ⇒ 𝑢𝑥𝑣. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) →
(𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 2. Then,
𝑢 0 𝐴1 𝑢 1 𝐴2 . . . 𝑢 𝑖−1 𝐴𝑖−1 𝑢 𝑖 𝐴𝑖 𝑢 𝑖+1 . . . 𝐴𝑛 𝑢 𝑛 5⇒
𝑢 01 𝑥1 𝑢 02 𝑥 2 𝑢 1 . . . 𝑥𝑖−1 𝑢 𝑖−1 𝑢 𝑖 𝑢 𝑖+1 𝑥 𝑖 . . . 𝑢 𝑛1 𝑥 𝑛 𝑢 𝑛2
6.3 Results 175

where 𝑢 0 = 𝑢 01 𝑢 02 , 𝑢 𝑛 = 𝑢 𝑛1 𝑢 𝑛2 .

Informally, 𝐺 obtains 𝑢 01 𝑥1 𝑢 02 𝑥2 𝑢 1 . . . 𝑥 𝑖−1 𝑢 𝑖−1 𝑢 𝑖 𝑢 𝑖+1 𝑥 𝑖 . . . 𝑢 𝑛1 𝑥 𝑛 𝑢 𝑛2 from 𝑢 0 𝐴1


𝑢 1 𝐴2 . . . 𝑢 𝑖−1 𝐴𝑖−1 𝑢 𝑖 𝐴𝑖 𝑢 𝑖+1 . . . 𝐴𝑛 𝑢 𝑛 by ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃 in
5⇒ as follows:

(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;


(2) a central 𝑢 𝑖 is nondeterministically chosen, for some 𝑖 ∈ {0, . . . , 𝑛};
(3) 𝑥1 and 𝑥 𝑛 are inserted into 𝑢 0 and 𝑢 𝑛 , respectively;
(4) 𝑥 𝑗 is inserted between 𝑢 𝑗 −2 and 𝑢 𝑗 −1 , for all 1 < 𝑗 ≤ 𝑖;
(5) 𝑥 𝑘 is inserted between 𝑢 𝑘 and 𝑢 𝑘+1 , for all 𝑖 + 1 ≤ 𝑘 < 𝑛.

Example 6.6 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, 𝐵, $, 𝑎, 𝑏}, Δ = {𝑎, 𝑏}, be an
SCG with 𝑃 containing the following rules:

(i) (𝑆) → ($𝐴𝐴$) (iv) (𝐵, $, $, 𝐵) → ( 𝐴, 𝜀, 𝜀, 𝐴)


(ii) ( 𝐴) → (𝑎 𝐴𝑏) (v) ( 𝐴) → (𝜀)
(iii) ( 𝐴, 𝐴) → (𝐵, 𝐵)

Recall Example 6.5. 4 ⇒ interchanges the positions of nonterminals influenced


by context-sensitive rules in the direction from the outer ones to the central ones.
Opposed to 4⇒, 5⇒ interchanges nonterminals in the direction from a nondetermin-
istically chosen center. In the present example, we show one possibility to control
the choice.
Consider 𝐺 uses 5 ⇒. First, rule (i) rewrites 𝑆 to $𝐴𝐴$. Then, 𝐺 uses rule (ii)
generating the sentential form

$𝑎 𝑚 𝐴𝑏 𝑚 𝑎 𝑛 𝐴𝑏 𝑛 $

where 𝑚, 𝑛 ≥ 0. If rule (v) is used, derivation is blocked, because there is no


way to erase the symbols $. Next, 𝐺 uses the context-sensitive rule (iii), which
nondeterministically chooses a center and nondeterministically shifts 𝐵s from the
previous positions of 𝐴s in the direction from this center. However, for the future
application of rule (iv) the chosen center must lie between 𝐴s, and moreover 𝐵s must
be inserted as the leftmost and the rightmost symbols of the current sentential form.
The subsequent usage of rule (iv) preserves 𝐴s as the leftmost and the rightmost
symbols independently of the effect of 5⇒. Finally, 𝐺 continues by using rule (ii)
and eventually finishes twice rule (v). If rule (iii) is used again, there is no possibility
to erase inserted 𝐵s. Consequently,
𝐿(𝐺, 5⇒) = 𝑥 ∈ Δ∗ | 𝑥 = 𝑎 𝑘 𝑏 𝑘 𝑎 𝑙 𝑏 𝑙 𝑎 𝑚 𝑏 𝑚 𝑎 𝑛 𝑏 𝑛 , 𝑘, 𝑙, 𝑚, 𝑛 ≥ 0


Then, the string 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎𝑎𝑏𝑏𝑏 is generated by 𝐺 in the following way:


𝑆 5⇒ $𝐴𝐴$ 5⇒ $𝑎 𝐴𝑏 𝐴$ 5⇒ $𝑎𝑎 𝐴𝑏𝑏 𝐴$ 5⇒ $𝑎𝑎 𝐴𝑏𝑏𝑎 𝐴𝑏$
5⇒ 𝐵$𝑎𝑎𝑏𝑏𝑎𝑏$𝐵 5⇒ 𝐴𝑎𝑎𝑏𝑏𝑎𝑏 𝐴 5⇒ 𝐴𝑎𝑎𝑏𝑏𝑎𝑏𝑎 𝐴𝑏 5⇒ 𝐴𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎 𝐴𝑏𝑏
5⇒ 𝐴𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎𝑎 𝐴𝑏𝑏𝑏 5⇒ 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎𝑎 𝐴𝑏𝑏𝑏 5⇒ 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎𝑎𝑏𝑏𝑏
176 6 Parallel Jumping Grammars

Theorem 6.5 JSC5 ⇒ = RE.

Proof As is obvious, JSC5 ⇒ ⊆ RE, so we only prove RE ⊆ JSC5 ⇒ .


Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be the SCG constructed in the proof of Theorem 6.1. Next,
we modify 𝐺 to a new SCG 𝐺 ′ so 𝐿(𝐺, 1⇒) = 𝐿(𝐺 ′ , 5⇒).

Construction. Introduce four new symbols—𝐷,𝐸,𝐹, and ◦. Set 𝑁 = {𝐷,𝐸,𝐹,◦}. Let


𝐺 ′ = (Σ′ , Δ, 𝑃′ , 𝑆) be SCG, with Σ′ = Σ ∪ 𝑁 and 𝑃′ containing the rules
(1) (𝑆) → ($𝑆1 1111𝑆2 $ ◦ 𝐸 ◦ 𝐹);
(2) ( 𝐴) → (𝐶𝑖 (𝑤)) for 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) (𝐹) → (𝐹𝐹);
(4) ($, 𝑎, 𝑎, $, 𝐸, 𝐹) → (𝜀, 𝜀, $, $, 𝜀, 𝐷), for 𝑎 = 0, 1;
(5) (◦, 𝐷, ◦) → (𝜀, ◦𝐸◦, 𝜀);
(6) ($) → (𝜀), (𝐸) → (𝜀), (◦) → (𝜀).

Claim A 𝐿 (𝐺, 1⇒) = 𝐿 (𝐺 ′ , 5⇒). □

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. □

Jumping Derivation Mode 6

Definition 6.10 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 𝐴𝑣 ∈ Σ∗ and ( 𝐴) → (𝑥) ∈


𝑃. Then, 𝑢 𝐴𝑣 6 ⇒ 𝑢𝑥𝑣. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) →
(𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 2. Then,
𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛 6⇒
𝑢 0 𝑢 1 𝑥1 𝑢 2 𝑥 2 . . . 𝑢 𝑖−1 𝑥𝑖−1 𝑢 𝑖 𝑥𝑖+2 𝑢 𝑖+1 . . . 𝑥 𝑛 𝑢 𝑛−1 𝑢 𝑛

Informally, 𝐺 obtains 𝑢 0 𝑢 1 𝑥1 𝑢 2 𝑥 2 . . . 𝑢 𝑖−1 𝑥𝑖−1 𝑢 𝑖 𝑥𝑖+2 𝑢 𝑖+1 . . . 𝑥 𝑛 𝑢 𝑛−1 𝑢 𝑛 from 𝑢 0 𝐴1 𝑢 1


𝐴2 𝑢 2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝑢 𝑛−1 𝐴𝑛 𝑢 𝑛 by using ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈
𝑃 in 6⇒ as follows:
6.3 Results 177

(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;


(2) a central 𝑢 𝑖 is nondeterministically chosen, for some 𝑖 ∈ {0, . . . , 𝑛};
(3) 𝑥 𝑗 is inserted between 𝑢 𝑗 and 𝑢 𝑗+1 , for all 𝑗 < 𝑖;
(4) 𝑥 𝑘 is inserted between 𝑢 𝑘−2 and 𝑢 𝑘−1 , for all 𝑘 > 𝑖 + 1.

Example 6.7 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, 𝐵, 𝑎, 𝑏}, Δ = {𝑎, 𝑏}, be an
SCG with 𝑃 containing the following rules:

(i) (𝑆) → ( 𝐴𝐵𝐵𝐴) (iii) ( 𝐴, 𝐵, 𝐵, 𝐴) → ( 𝐴𝐵, 𝐵, 𝐵, 𝐵𝐴)


(ii) ( 𝐴) → (𝑎 𝐴𝑏) (iv) ( 𝐴, 𝐵, 𝐵, 𝐴) → (𝜀, 𝐵, 𝐵, 𝜀)

Consider 𝐺 uses 6 ⇒. 6 ⇒ interchanges nonterminals similarly as 4 ⇒ does in


Example 6.5; however, the central nonterminals are removed. This property can be
used to eliminate nondeterminism of choosing of the center, which we demonstrate
next.
Rules (i) and (ii) are context-free, not affected by 6⇒. First the starting rule (i)
rewrites 𝑆 to 𝐴𝐵𝐵𝐴. Then, 𝐺 uses rule (ii) generating the sentential form

𝑎 𝑚 𝐴𝑏 𝑚 𝐵𝐵𝑎 𝑛 𝐴𝑏 𝑛

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𝑘


Then, the string 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎𝑏𝑏𝑎𝑏 is generated by 𝐺 in the following way:


𝑆 6⇒ 𝐴𝐵𝐵𝐴 6⇒ 𝑎 𝐴𝑏𝐵𝐵𝐴 6⇒ 𝑎𝑎 𝐴𝑏𝑏𝐵𝐵𝐴 6⇒ 𝑎𝑎 𝐴𝑏𝑏𝐵𝐵𝑎 𝐴𝑏
6⇒ 𝑎𝑎𝑏𝑏 𝐴𝐵𝐵𝐴𝑎𝑏 6⇒ 𝑎𝑎𝑏𝑏𝑎 𝐴𝑏𝐵𝐵𝐴𝑎𝑏 6⇒ 𝑎𝑎𝑏𝑏𝑎 𝐴𝑏𝐵𝐵𝑎 𝐴𝑏𝑎𝑏
6⇒ 𝑎𝑎𝑏𝑏𝑎 𝐴𝑏𝐵𝐵𝑎𝑎 𝐴𝑏𝑏𝑎𝑏 6⇒ 𝑎𝑎𝑏𝑏𝑎𝑏𝑎𝑎𝑏𝑏𝑎𝑏

Theorem 6.6 JSC6 ⇒ = RE.

Proof Clearly, JSC6 ⇒ ⊆ RE. Next, we prove RE ⊆ JSC6 ⇒ .


Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be the SCG constructed in the proof of Theorem 6.1. Next,
we modify 𝐺 to a new SCG 𝐺 ′ so 𝐿(𝐺, 1⇒) = 𝐿(𝐺 ′ , 6⇒).

Construction. Introduce two new symbols—𝐸 and 𝐹. Let 𝐺 ′ = (Σ′ , Δ, 𝑃′ , 𝑆) be


SCG, with Σ′ = Σ ∪ {𝐸, 𝐹} and 𝑃′ containing the rules
178 6 Parallel Jumping Grammars

(1) (𝑆) → (𝐹$𝑆1 1111𝑆2 $);


(2) ( 𝐴) → (𝐶𝑖 (𝑤)) for 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) (𝐹) → (𝐹𝐹);
(4) (𝐹, $, 𝑎, 𝑎, $) → (𝐸, 𝐸, 𝜀, $, $), for 𝑎 = 0, 1;
(5) ($) → (𝜀).
Claim A 𝐿 (𝐺, 1⇒) = 𝐿 (𝐺 ′ , 6⇒). □
Proof (Claim A) Context-free rules are not influenced by 6 ⇒. Context-sensitive
rules of 𝐺 ′ closely correspond to context-sensitive rules of 𝐺. The new symbols are
used to force modified rules to act in the same way as sample ones do. The symbols
𝐹 are first multiplied and then consumed by context-sensitive rules, so their number
must equal the number of usages of these rules. The new symbols 𝐸 are essential. 𝐸
never appears on the left-hand side of any rule; thus, whenever it is inserted into the
sentential form, no terminal string can be generated. Therefore, the center is always
chosen between two 𝐸s, which are basically never inserted, and other right-hand-side
strings are then inserted deterministically.
𝐺 ′ with 6⇒ works in the same way as 𝐺 with 1⇒ does. □
𝐿 (𝐺, 1⇒) = 𝐿 (𝐺 ′ , 6⇒), hence 𝐿 (𝐺 ′ , 6⇒) = 𝐿. Thus, the proof of Theorem 6.6
is completed. □

Jumping Derivation Mode 7

Definition 6.11 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let ( 𝐴) → (𝑥) ∈ 𝑃 and 𝑢 𝐴𝑣 ∈


Σ∗ . Then, 𝑢 𝐴𝑣 7 ⇒ 𝑢𝑥𝑣. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗ and ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) →
(𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 2. Then,
𝑢 0 𝐴1 𝑢 1 𝐴2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝐴𝑛 𝑢 𝑛 7⇒
𝑢 0 𝑥2 𝑢 1 . . . 𝑥𝑖 𝑢 𝑖−1 𝑢 𝑖 𝑢 𝑖+1 𝑥𝑖+1 . . . 𝑢 𝑛
Informally, by using the rule ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, 𝐺 obtains
𝑢 0 𝑥 2 𝑢 1 . . . 𝑥𝑖 𝑢 𝑖−1 𝑢 𝑖 𝑢 𝑖+1 𝑥𝑖+1 . . . 𝑢 𝑛 from 𝑢 0 𝐴1 𝑢 1 𝐴2 . . . 𝑢 𝑖−1 𝐴𝑖 𝑢 𝑖 𝐴𝑖+1 𝑢 𝑖+1 . . . 𝐴𝑛 𝑢 𝑛 in
7⇒ as follows:

(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;


(2) a central 𝑢 𝑖 is nondeterministically chosen, for some 𝑖 ∈ {0 . . . , 𝑛};
(3) 𝑥 𝑗 is inserted between 𝑢 𝑗 −2 and 𝑢 𝑗 −1 , for all 1 < 𝑗 ≤ 𝑖;
(4) 𝑥 𝑘 is inserted between 𝑢 𝑘 and 𝑢 𝑘+1 , for all 𝑖 + 1 ≤ 𝑘 < 𝑛.
Example 6.8 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝐴, 𝐵, 𝐶, $, 𝑎, 𝑏, 𝑐}, Δ = {𝑎, 𝑏,
𝑐}, be an SCG with 𝑃 containing the following rules:

(i) (𝑆) → ( 𝐴𝐵𝐶$) (v) ( 𝐴, 𝐵, 𝐶) → ( 𝐴, 𝐵, 𝐶)


(ii) ( 𝐴) → (𝑎 𝐴𝑎) (vi) ( 𝐴, 𝐵) → ( 𝐴, 𝐵)
(iii) (𝐵) → (𝑏𝐵𝑏) (vii) ( 𝐴, $) → (𝜀, 𝜀)
(iv) (𝐶) → (𝑐𝐶𝑐)
6.3 Results 179

Consider 𝐺 uses 7 ⇒. 7 ⇒ interchanges nonterminals in the direction from the


nondeterministically chosen center and erases the outermost nonterminals. In this
example, we show that we may force the center to lie outside the part of a sentential
form between the affected nonterminals.
The derivation starts by using the starting rule (i) and continues by using rules
(ii) through (iv) generating the sentential form

𝑎 𝑚 𝐴𝑎 𝑚 𝑏 𝑛 𝐵𝑏 𝑛 𝑐𝑙 𝐶𝑐𝑙 $

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⇒).

Construction. Introduce four new symbols—𝐸,𝐹,𝐻, and |. Set 𝑁 = {𝐸,𝐹,𝐻,|}. Let


𝐺 ′ = (Σ′ , Δ, 𝑃′ , 𝑆) be SCG, with Σ′ = Σ ∪ 𝑁 and 𝑃′ containing the rules:
(1) (𝑆) → (𝐹𝐻𝑆1 11$|$11𝑆2 );
(2) ( 𝐴) → (𝐶𝑖 (𝑤)) for 𝐴 → 𝑤 ∈ 𝑃𝑖 , where 𝑖 = 1, 2;
(3) (𝐹) → (𝐹𝐹);
(4) (𝑎, $, $, 𝑎) → (𝜀, 𝐸, 𝐸, 𝜀), for 𝑎 = 0, 1;
(5) (𝐹, 𝐻, 𝐸, |, 𝐸) → (𝐻, $, |, $, 𝜀);
(6) ($) → (𝜀), (𝐻) → (𝜀), (|) → (𝜀).
Claim A 𝐿 (𝐺, 1⇒) = 𝐿 (𝐺 ′ , 7⇒). □
Proof (Claim A) The behavior of context-free rules remains unchanged under 7⇒.
Since the rules of 𝐺 ′ simulating the derivations of 𝐺 1 , 𝐺 2 , respectively, are identical
to the ones of 𝐺 simulating both grammars, for every derivation of 𝐺
180 6 Parallel Jumping Grammars

𝑆 1⇒∗ $𝑤 1 1111𝑤 2 $ = 𝑤

where 𝑤 is generated only by using rule (1) and rules from (2) constructed in 𝐺 and
symbols(𝑤) ∩ (𝑁1 ∪ 𝑁2 ) = ∅, there is

𝑆 7⇒∗ 𝐹𝐻𝑤 1 11$|$11𝑤 2 = 𝑤 ′

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⇒∗ 𝑣, 𝑣 ∈ Δ∗

if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ); then 𝑣 = 𝑡 (𝑤). Therefore, we have to prove

𝑤 ′ 4⇒∗ 𝑣 ′ , 𝑣 ′ ∈ Δ∗

if and only if 𝑡 ′ (𝑤 1 ) = reversal(𝑤 2 ). Then, obviously 𝑣 ′ = 𝑣 and we can complete


the proof by the following claim.

Claim B In 𝐺 ′ , for some 𝑖 ≥ 1,

𝑆 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 ≤ 𝑚 ≤ 𝑘

Induction Step. Consider 𝐺 ′ generates 𝑤, where

𝑤 = 𝐹 𝑘+1 𝐻𝑤 1 $|$𝑤 2 , |𝑤 1 | = |𝑤 2 | = 𝑘 + 1

Since 𝑤 1 = reversal(𝑤 2 ) and |𝑤 1 | = |𝑤 2 | = 𝑘 +1, 𝑤 1 = 𝑤 1′ 𝑎, 𝑤 2 = 𝑎𝑤 2′ . The symbols


𝑎 can be erased by application of rules from (4) and rule (5) under several conditions.
First, when a rule from (4) is applied, the center for interchanging right-hand-side
strings must be chosen between the two $s; otherwise, both 𝐸s appear on the same
side of the symbol | and rule (5) is not applicable. Next, no 0 or 1 may be skipped,
while proceeding in the direction from the center to the edges. Finally, when rule (5)
is applied, a center must be chosen to the left of 𝐹; otherwise, 𝐻 is erased and the
future application of this rule is excluded.

𝐹 𝑘+1 𝐻𝑤 1′ 𝑎$|$𝑎𝑤 2′ 7⇒ 𝐹 𝑘+1 𝐻𝑤 1′ 𝐷 |𝐷𝑤 2′ 7⇒ 𝐹 𝑘 𝐻𝑤 1′ $|$𝑤 2′ = 𝑤 ′

By the induction hypothesis, 𝑤 ′ 7⇒∗ 𝜀, which completes the proof.

Only if. Suppose 𝑤 1 ≠ reversal(𝑤 2 ), then, there is no 𝑤 ′ , where 𝑤 7 ⇒∗ 𝑤 ′ and


𝑤 ′ = 𝜀.
Since 𝑤 1 ≠ reversal(𝑤 2 ), 𝑤 1 = 𝑢𝑎𝑣, 𝑤 2 = 𝑣𝑎 ′ 𝑢 ′ , and 𝑎 ≠ 𝑎 ′ . Suppose both 𝑣s
are correctly erased, and no symbol is skipped producing the sentential form

𝐹 𝑖 𝐻𝑢𝑎$|$𝑎 ′ 𝑢 ′

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. □

Jumping Derivation Mode 8

Definition 6.12 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗


and ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 1. Then,

𝑢 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 ∈ Σ∗ .

Informally, 𝐺 obtains 𝑣 0 𝑥1 𝑣 1 𝑥 2 𝑣 2 . . . 𝑥 𝑛 𝑣 𝑛 from 𝑢 0 𝐴1 𝑢 1 𝐴2 𝑢 2 . . . 𝐴𝑛 𝑢 𝑛 by using


( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥 2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃 in 8⇒ as follows:
(1) 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 are deleted;
(2) 𝑥1 and 𝑥 𝑛 are inserted into 𝑢 1 and 𝑢 𝑛−1 , respectively;
(3) 𝑥𝑖 is inserted into 𝑢 𝑖−1 𝑢 𝑖 , for all 1 < 𝑖 < 𝑛, to the right of 𝑥𝑖−1 and to the left of
𝑥𝑖+1 .

Example 6.9 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆), where Σ = {𝑆, 𝑆, 𝐴, 𝐵, 𝐶, 𝑎, 𝑏, 𝑐}, Δ = {𝑎, 𝑏,


𝑐}, be an SCG with 𝑃 containing the following rules:

(i) (𝑆) → ( 𝐴𝑆) (iv) (𝑆) → (𝐵)


(ii) (𝑆) → (𝑆) (v) (𝐵) → (𝐵𝐵)
(iii) (𝑆) → (𝑏𝑆𝑐𝐶) (vi) ( 𝐴, 𝐵, 𝐶) → (𝑎, 𝜀, 𝜀)

Consider 𝐺 uses 8 ⇒. 8 ⇒ acts in a similar way as 2 ⇒ does. 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 to this
center, but not farther than the neighboring affected nonterminal was.
Rules (i) through (v) are context-free. Without any loss of generality, we suppose
these rules are used only before the first application of rule (vi) producing the string

𝐴𝑚 𝑏 𝑛 𝐵𝑙 (𝑐𝐶) 𝑛

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⇒
𝑏𝑎𝑎𝑏𝑏𝑎𝑐𝑐𝑐

Theorem 6.8 JSC8 ⇒ = RE.

Proof Prove this theorem by analogy with the proof of Theorem 6.2. □
6.3 Results 183

Jumping Derivation Mode 9

Definition 6.13 Let 𝐺 = (Σ, Δ, 𝑃, 𝑆) be an SCG. Let 𝑢 = 𝑢 0 𝐴1 𝑢 1 . . . 𝐴𝑛 𝑢 𝑛 ∈ Σ∗


and ( 𝐴1 ,𝐴2 ,. . . ,𝐴𝑛 ) → (𝑥1 ,𝑥2 ,. . . ,𝑥 𝑛 ) ∈ 𝑃, for 𝑛 ≥ 1. Then,

𝑢 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:

(i) (𝑆) → (𝑎𝑆𝑎) (v) (𝐶) → (𝑐𝐵𝐶$)


(ii) (𝑆) → ( 𝐴) (vi) (𝐶) → (𝜀)
(iii) ( 𝐴) → ($𝐴) (vii) ($, 𝐵, $) → (𝜀, 𝑏, 𝜀)
(iv) ( 𝐴) → (𝐶)

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

Theorem 6.9 JSC9 ⇒ = RE.

Proof Prove this theorem by analogy with the proof of Theorem 6.3. □

Open Problem Areas

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

Jumping versions of language-defining rewriting systems, such as grammars and


automata, represent a brand new trend in formal language theory. In essence, they act
just like classical rewriting systems except that they work on strings discontinuously.
That is, they apply a production rule so they erase an occurrence of its left-hand side
in the rewritten string while placing the right-hand side anywhere in the string, so
the position of the insertion may occur far away from the position of the erasure.
The present chapter contributes to this trend by investigating the generative power
of jumping versions of pure grammars, whose original versions were introduced in
Gabrielian [1970], and their properties are still intensively investigated in language
theory (see Bordihn et al. [2002]; Novotný [2002]). Recently, regulated versions of
these grammars have been discussed, too (see Chapter 5 in Dassow and Păun [1989]
and Langer and Kelemenová [2012]; Křivka et al. [2014]).
The notion of a pure grammar 𝐺 represents a language-generating rewriting
system based upon an alphabet of symbols and a finite set of production rules (as
opposed to the notion of an unrestricted grammar, its alphabet of symbols is not
divided into the alphabet of terminals and the alphabet of nonterminals). 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 𝑥 → 𝑦, respectively. Starting from a special start
string, 𝐺 repeatedly rewrites strings according to its rules, and the set of all strings
obtained in this way represents the language generated by 𝐺. In a greater detail, 𝐺

185
186 7 Pure Jumping Grammars

rewrites a string 𝑧 according to 𝑥 → 𝑦 so it (i) selects an occurrence of 𝑥 in 𝑧, (ii)


erases it, and (iii) inserts 𝑦 precisely at the position of this erasure. More formally,
let 𝑧 = 𝑢𝑥𝑣, where 𝑢 and 𝑣 are strings. By using 𝑥 → 𝑦, 𝐺 rewrites 𝑢𝑥𝑣 as 𝑢𝑦𝑣.
The notion of a jumping pure grammar—that is, the key notion (see Křivka et al.
[2018]) introduced in this chapter—is conceptualized just like that of a classical pure
grammar; however, it rewrites strings in a slightly different way. Let 𝐺, 𝑧, and 𝑥 → 𝑦
have the same meaning as above. 𝐺 rewrites a string 𝑧 according to 𝑥 → 𝑦, so it
performs (i) and (ii) as described above, but during (iii), 𝐺 can jump over a portion
of the rewritten string in either direction and inserts 𝑦 there. More formally, by using
𝑥 → 𝑦, 𝐺 rewrites 𝑢𝑐𝑣 as 𝑢𝑑𝑣, where 𝑢, 𝑣, 𝑤, 𝑐, 𝑑 are strings such that either (a)
𝑐 = 𝑥𝑤 and 𝑑 = 𝑤𝑦 or (b) 𝑐 = 𝑤𝑥 and 𝑑 = 𝑦𝑤. Otherwise, 𝐺 works as described
above.
The present chapter compares the generative power of classical and jumping ver-
sions of pure grammars. It distinguishes between these grammars with and without
erasing rules. Apart from these sequential versions of pure grammars, it also con-
siders parallel versions of classical and jumping pure grammars represented by 0L
grammars (see Rozenberg and Doucet [1971]). As a result, the chapter studies the
mutual relationships between eight language families corresponding to the following
derivations modes (see Definition 7.1) performed by pure grammars both with and
without erasing rules:
• classical sequential mode (𝑠 ⇒);
• jumping sequential mode ( 𝑗 ⇒);
• classical parallel mode ( 𝑝 ⇒);
• jumping parallel mode ( 𝑗 𝑝 ⇒).
In essence, the chapter demonstrates that any version of these grammars with
erasing rules is stronger than the same version without them. Furthermore, it shows
that almost all of the eight language families under considerations are pairwise
incomparable—that is, any two families are not subfamilies of each other, but not
disjoint.

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

If 𝐽 is the union of a finite number of linear sets, we say that 𝐽 is semilinear. If


Σ = {𝑎 1 , 𝑎 2 , . . . , 𝑎 𝑛 } is an alphabet, then for 𝑤 ∈ Σ∗ ,

𝜓 Σ (𝑤) = (occur(𝑤, 𝑎 1 ), occur(𝑤, 𝑎 2 ), . . . , occur(𝑤, 𝑎 𝑛 ))

denote the commutative (Parikh) image of 𝑤. For 𝐿 ⊆ Σ∗ , 𝜓 Σ (𝐿) = {𝜓 Σ (𝑤) | 𝑤 ∈ 𝐿}


denote the commutative (Parikh) map of 𝐿. We say that 𝐿 is a semilinear language
if and only if 𝜓 Σ (𝐿) is a semilinear set.
Let 𝑆 be a finite set. Define a permutation of 𝑆 in the terms of bijective mappings
as follows: Let 𝐼 = {1, 2, . . . , card(𝑆)} be a set of indices. The set of all permutations
of elements of 𝑆, setperm(𝑆), is the set of all bijections from 𝐼 to 𝑆.
An unrestricted grammar is a quadruple 𝐺 = (𝑉, Σ, 𝑃, 𝜎), where 𝑉 is a total
alphabet, Σ ⊆ 𝑉 is an alphabet of terminal symbols, 𝑃 ⊆ 𝑉 + × 𝑉 ∗ is a finite relation,
and 𝜎 ∈ 𝑉 + is the start string of 𝐺, called axiom. Members of 𝑃 are called production
rules or rules. Instead of (𝑥, 𝑦) ∈ 𝑃, we write 𝑥 → 𝑦 throughout. For brevity, we
sometimes denote a rule 𝑥 → 𝑦 with a unique label 𝑟 as 𝑟 : 𝑥 → 𝑦, and instead of
𝑥 → 𝑦 ∈ 𝑃, we simply write 𝑟 ∈ 𝑃. We say that 𝑥 → 𝑦 is a unit rule if 𝑥, 𝑦 ∈ 𝑉. A
relation of direct derivation in 𝐺, denoted ⇒, is defined as follows: If 𝑢, 𝑣, 𝑥, 𝑦 ∈ 𝑉 ∗
and 𝑥 → 𝑦 ∈ 𝑃, then 𝑢𝑥𝑣 ⇒ 𝑢𝑦𝑣. The language generated by 𝐺, denoted 𝐿(𝐺),
is defined as 𝐿(𝐺) = {𝑤 | 𝜎 ⇒∗ 𝑤, 𝑤 ∈ Σ∗ }. 𝐺 is said to be context-free iff for
every production rule 𝑥 → 𝑦 ∈ 𝑃, |𝑥| = 1. Furthermore, 𝐺 is said to be context-
sensitive iff every 𝑥 → 𝑦 ∈ 𝑃 satisfies |𝑥| ≤ |𝑦|. A language is context-free iff it
is generated by some context-free grammar, and a language is context-sensitive iff
it is generated by some context-sensitive grammar. By CF and CS, we denote the
families of context-free and context-sensitive languages, respectively.
Next, we give the formal definition of pure grammars (see Maurer et al. [1980];
Dassow and Păun [1989]), together with six modes of derivations.
Definition 7.1 Let 𝐺 = (Σ, Δ, 𝑃, 𝜎) be an unrestricted grammar. 𝐺 is a pure gram-
mar (PG), if Σ = Δ. For brevity, we simplify 𝐺 = (Σ, Δ, 𝑃, 𝜎) to 𝐺 = (Σ, 𝑃, 𝜎).
We say that 𝐺 is propagating or without erasing rules iff for every rule 𝑥 → 𝑦 ∈ 𝑃,
𝑦 ≠ 𝜀.
Next, we introduce six modes of direct derivation steps as derivation relations
over Σ∗ . Let 𝑢, 𝑣 ∈ Σ∗ . The six derivation relations are defined as follows:
(i) 𝑢 𝑠 ⇒ 𝑣 in 𝐺 iff there exists 𝑥 → 𝑦 ∈ 𝑃 and 𝑤, 𝑧 ∈ Σ∗ such that 𝑢 = 𝑤𝑥𝑧 and
𝑣 = 𝑤𝑦𝑧;
(ii) 𝑢 𝑙 𝑗 ⇒ 𝑣 in 𝐺 iff there exists 𝑥 → 𝑦 ∈ 𝑃 and 𝑤, 𝑡, 𝑧 ∈ Σ∗ such that 𝑢 = 𝑤𝑡𝑥𝑧 and
𝑣 = 𝑤𝑦𝑡𝑧;
(iii) 𝑢 𝑟 𝑗 ⇒ 𝑣 in 𝐺 iff there exists 𝑥 → 𝑦 ∈ 𝑃 and 𝑤, 𝑡, 𝑧 ∈ Σ∗ such that 𝑢 = 𝑤𝑥𝑡𝑧 and
𝑣 = 𝑤𝑡𝑦𝑧;
(iv) 𝑢 𝑗 ⇒ 𝑣 in 𝐺 iff 𝑢 𝑙 𝑗 ⇒ 𝑣 or 𝑢 𝑟 𝑗 ⇒ 𝑣 in 𝐺;
(v) 𝑢 𝑝 ⇒ 𝑣 in 𝐺 iff there exist 𝑥1 → 𝑦 1 , 𝑥2 → 𝑦 2 , . . . , 𝑥 𝑛 → 𝑦 𝑛 ∈ 𝑃 such that
𝑢 = 𝑥1 𝑥2 . . . 𝑥 𝑛 and 𝑣 = 𝑦 1 𝑦 2 . . . 𝑦 𝑛 , where 𝑛 ≥ 0;
(vi) 𝑢 𝑗 𝑝 ⇒ 𝑣 in 𝐺 iff there exist 𝑥1 → 𝑦 1 , 𝑥2 → 𝑦 2 , . . . , 𝑥 𝑛 → 𝑦 𝑛 ∈ 𝑃 such that
𝑢 = 𝑥 1 𝑥2 . . . 𝑥 𝑛 and 𝑣 = 𝑦 𝑝 (1) 𝑦 𝑝 (2) . . . 𝑦 𝑝 (𝑛) , where 𝑝 ∈ setperm({1, 2, . . . , 𝑛}),
𝑛 ≥ 0.
188 7 Pure Jumping Grammars

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.

Let 𝐺 = (Σ, 𝑃, 𝜎) be a PG. 𝐺 is said to be a pure context-free grammar (PCFG)


if every 𝑥 → 𝑦 ∈ 𝑃 satisfies 𝑥 ∈ Σ. The set of all PCFGs and the set of all PCFGs
without erasing rules are denoted ΓPCFG and ΓPCFG− 𝜀 , respectively.

Remark 7.1 The inclusions ΓPCFG ⊆ ΓPG , ΓPCFG− 𝜀 ⊆ ΓPCFG , and ΓPG− 𝜀 ⊆ ΓPG are
obvious.

Definition 7.2 Set


(1) SP = {𝐿 (𝐺, 𝑠 ⇒) | 𝐺 ∈ ΓPG };
(2) SP− 𝜀 = {𝐿(𝐺, 𝑠 ⇒) | 𝐺 ∈ ΓPG− 𝜀 };
(3) JSP = {𝐿 (𝐺, 𝑗 ⇒) | 𝐺 ∈ ΓPG };
(4) JSP− 𝜀 = {𝐿 (𝐺, 𝑗 ⇒) | 𝐺 ∈ ΓPG− 𝜀 };
(5) PP = {𝐿(𝐺, 𝑝 ⇒) | 𝐺 ∈ ΓPG };
(6) PP− 𝜀 = {𝐿(𝐺, 𝑝 ⇒) | 𝐺 ∈ ΓPG− 𝜀 };
(7) JPP = {𝐿 (𝐺, 𝑗 𝑝 ⇒) | 𝐺 ∈ ΓPG };
(8) JPP− 𝜀 = {𝐿 (𝐺, 𝑗 𝑝 ⇒) | 𝐺 ∈ ΓPG− 𝜀 };
(9) SPCF = {𝐿 (𝐺, 𝑠 ⇒) | 𝐺 ∈ ΓPCFG };
(10) SPCF− 𝜀 = {𝐿(𝐺, 𝑠 ⇒) | 𝐺 ∈ ΓPCFG− 𝜀 };
(11) JSPCF = {𝐿 (𝐺, 𝑗 ⇒) | 𝐺 ∈ ΓPCFG };
(12) JSPCF− 𝜀 = {𝐿 (𝐺, 𝑗 ⇒) | 𝐺 ∈ ΓPCFG− 𝜀 };
(13) PPCF = {𝐿(𝐺, 𝑝 ⇒) | 𝐺 ∈ ΓPCFG };
(14) PPCF− 𝜀 = {𝐿(𝐺, 𝑝 ⇒) | 𝐺 ∈ ΓPCFG− 𝜀 };
(15) 0L = {𝐿 (𝐺, 𝑝 ⇒) | 𝐺 ∈ ΓPCFG , 𝐺 = (Σ, 𝑃, 𝜎), dom(𝑃) = Σ} (see Rozenberg
and Doucet [1971]);
(16) 0L− 𝜀 = {𝐿(𝐺, 𝑝 ⇒) | 𝐺 ∈ ΓPCFG− 𝜀 , 𝐺 = (Σ, 𝑃, 𝜎), dom(𝑃) = Σ} (see Rozen-
berg and Doucet [1971], where 0L− 𝜀 is denoted by P0L);
(17) JPPCF = {𝐿 (𝐺, 𝑗 𝑝 ⇒) | 𝐺 ∈ ΓPCFG };
(18) JPPCF− 𝜀 = {𝐿 (𝐺, 𝑗 𝑝 ⇒) | 𝐺 ∈ ΓPCFG− 𝜀 }.

Example 7.1 Consider the following PCFG

𝐺 = (Σ = {𝑎, 𝑏, 𝑐, 𝑑}, 𝑃, 𝑎)

where 𝑃 = {𝑎 → 𝑎𝑏𝑐𝑑, 𝑎 → 𝑎, 𝑏 → 𝑏, 𝑐 → 𝑐, 𝑑 → 𝑑}. Observe that 𝐿(𝐺, 𝑠 ⇒) =


𝐿(𝐺, 𝑝 ⇒) = {𝑎}{𝑏𝑐𝑑}∗ is a regular language, but 𝐿(𝐺, 𝑗 ⇒) = 𝐿(𝐺, 𝑗 𝑝 ⇒) =
7.3 Results 189

{𝑤 | occur(𝑤, 𝑎) = 1, occur(𝑤, 𝑏) = occur(𝑤, 𝑐) = occur(𝑤, 𝑑), 𝑤 ∈ Σ+ } is a


non-context-free language.
To illustrate variants of derivation relations, we show how we can generate
𝑎𝑏𝑐𝑑𝑏𝑐𝑑𝑏𝑐𝑑 by using 𝑠 ⇒ and 𝑝 ⇒:

𝑎 𝑠 ⇒ 𝑎𝑏𝑐𝑑 𝑠 ⇒ 𝑎𝑏𝑐𝑑𝑏𝑐𝑑 𝑠 ⇒ 𝑎𝑏𝑐𝑑𝑏𝑐𝑑𝑏𝑐𝑑


𝑎 𝑝 ⇒ 𝑎𝑏𝑐𝑑 𝑝 ⇒ 𝑎𝑏𝑐𝑑𝑏𝑐𝑑 𝑝 ⇒ 𝑎𝑏𝑐𝑑𝑏𝑐𝑑𝑏𝑐𝑑
On the other hand, by 𝑗 ⇒ and 𝑗 𝑝 ⇒, we generate, for instance, 𝑑𝑐𝑎𝑏𝑐𝑑𝑏 as
follows:
𝑎 𝑗 ⇒ 𝑎𝑏𝑐𝑑 𝑗 ⇒ 𝑑𝑎𝑏𝑐 𝑗 ⇒ 𝑑𝑎𝑏𝑐𝑑𝑏𝑐 𝑗 ⇒ 𝑑𝑐𝑎𝑏𝑐𝑑𝑏
𝑎 𝑗 𝑝⇒ 𝑎𝑏𝑐𝑑 𝑗 𝑝⇒ 𝑑𝑐𝑎𝑏𝑐𝑑𝑏

7.3 Results

In this section, we first give an overview about several elementary properties of


pure grammars. Second, we investigate the mutual relationships of SPCF, JSPCF,
PPCF, JPPCF, CF, and CS and summarize the results by Euler diagram in Figure
7.1. Finally, we study the former without erasing rules and sum up the investigated
relations in Table 7.1.
SPCF
SPCF− 𝜀
JSPCF
JSPCF− 𝜀
PPCF
PPCF− 𝜀
JPPCF
JPPCF− 𝜀
0L
0L− 𝜀

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. □

Theorem 7.1 SPCF and JSPCF are semilinear.

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. □

Theorem 7.2 SPCF ⊂ PPCF.

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 (Claim A) Let 𝜎 𝑠 ⇒ 𝑘+1 𝑤 in 𝐺, where 𝑤 ∈ Σ∗ . Express 𝜎 𝑠 ⇒ 𝑘+1 𝑤 as


𝜎 𝑠 ⇒ 𝑘 𝑢𝑎𝑣 𝑠 ⇒ 𝑢𝑥𝑣, where 𝑢, 𝑣, 𝑥 ∈ Σ∗ , 𝑎 ∈ Σ, 𝑎 → 𝑥 ∈ 𝑃, and 𝑢𝑥𝑣 = 𝑤. By the
induction hypothesis, there exists a derivation 𝜎 ′ 𝑝 ⇒∗ 𝑢𝑎𝑣 in 𝐺 ′ . Since 𝑃 ⊆ 𝑃′ and
there are also unit rules 𝑏 → 𝑏 ∈ 𝑃′ , for every 𝑏 ∈ Σ, clearly 𝑢𝑎𝑣 𝑝 ⇒ 𝑢𝑥𝑣 in 𝐺 ′ ,
which completes the induction step. □

Claim B Let 𝜎 ′ 𝑝 ⇒𝑚 𝑤 in 𝐺 ′ , where 𝑤 ∈ Σ∗ . Then 𝜎 𝑠 ⇒∗ 𝑤 in 𝐺. □

Proof (Claim B) Let 𝜎 ′ 𝑝 ⇒ 𝑘+1 𝑤 in 𝐺 ′ , where 𝑤 ∈ Σ∗ . Express 𝜎 ′ 𝑝 ⇒ 𝑘+1 𝑤 as


𝜎 ′ 𝑝 ⇒ 𝑘 𝑥 𝑝 ⇒ 𝑤, where 𝑥 ∈ Σ∗ . Set 𝑛 = |𝑥|. Express 𝑥 and 𝑤 as 𝑥 = 𝑎 1 𝑎 2 . . . 𝑎 𝑛 and
𝑤 = 𝑦 1 𝑦 2 . . . 𝑦 𝑛 , respectively, where 𝑎 𝑖 ∈ Σ, 𝑦 𝑖 ∈ Σ∗ , and 𝑎 𝑖 → 𝑦 𝑖 ∈ 𝑃′ , 1 ≤ 𝑖 ≤ 𝑛.
Observe that 𝑎 𝑖 → 𝑦 𝑖 ∈ 𝑃′ and 𝑎 𝑖 ≠ 𝑦 𝑖 implies 𝑎 𝑖 → 𝑦 𝑖 ∈ 𝑃, for all 1 ≤ 𝑖 ≤ 𝑛.
Thus, 𝑥 𝑠 ⇒∗ 𝑤 in 𝐺. By the induction hypothesis, we have that 𝜎 𝑠 ⇒∗ 𝑥 in 𝐺, which
completes the induction step. □

By Claim A and Claim B, 𝜎 𝑠 ⇒∗ 𝑤 in 𝐺 iff 𝜎 ′ 𝑝 ⇒∗ 𝑤 in 𝐺 ′ , that is 𝐿 (𝐺, 𝑠 ⇒) =


𝐿(𝐺 ′ , 𝑝 ⇒), so SPCF ⊆ PPCF. By [Rozenberg and Doucet, 1971, Theorem 4.7],
0L ⊈ CF. Clearly, 0L ⊈ SPCF. Since 0L ⊂ PPCF, PPCF ⊈ SPCF and hence
SPCF ⊂ PPCF. □

Corollary 7.1 SPCF ⊂ 0L.


192 7 Pure Jumping Grammars

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

𝐺 = (Σ, {𝑎 → 𝑐𝑐, 𝑏 → 𝑑𝑑, 𝑐 → 𝑐, 𝑑 → 𝑑}, 𝑎𝑏)

such that 𝐿 = 𝐿 (𝐺, 𝑝 ⇒). We show by contradiction that there is no PCFG 𝐺 ′ =


(Σ, 𝑃′ , 𝜎) such that 𝐿(𝐺 ′ , 𝑠 ⇒) = 𝐿. Clearly, 𝜎 must be either 𝑎𝑏 or 𝑐𝑐𝑑𝑑. If we
take 𝑐𝑐𝑑𝑑 as the axiom, there must be 𝑐 → 𝜀 or 𝑑 → 𝜀 in 𝑃′ and hence 𝑐𝑑𝑑 or 𝑐𝑐𝑑
are contained in 𝐿, which is a contradiction. On the other hand, if we take 𝑎𝑏, there
is no possible way to directly derive 𝑐𝑐𝑑𝑑 from 𝑎𝑏 by using 𝑠 ⇒. Hence, 𝐿 ∉ SPCF,
which completes the proof. □
Corollary 7.2 SPCF ⊂ CF ∩ 0L.
Theorem 7.4 For a unary alphabet, 0L = PPCF = JPPCF.
Proof It follows directly from the definition of 𝑝 ⇒ and 𝑗 𝑝 ⇒ and from the definition
of ⇒ in 0L systems (see Rozenberg and Doucet [1971]). □
Theorem 7.5 For a unary alphabet, SPCF = JSPCF.
Proof It follows directly from the definition of 𝑠 ⇒ and 𝑗 ⇒. □
Now, we recall the following lemma from Rozenberg and Doucet [1971].
Lemma 7.2 ([Rozenberg and Doucet, 1971, Lemma 4.8 on page 313]) Let 𝐺 be
a 0L system. Then there exists a number 𝑘 such that for every string 𝑤 in 𝐿 (𝐺) there
exists a derivation such that |𝑢| ≤ 𝑘 |𝑤| for every string 𝑢 in that derivation.
By analogy with the proof of Lemma 7.2, it is easy to prove the following lemma
because PCFGs do not differ from 0L systems when only the longest sentential forms
are considered during the derivation of any sentence 𝑤.
Lemma 7.3 Let 𝐺 be a PCFG. Let ℎ ∈ {𝑠, 𝑗, 𝑝, 𝑗 𝑝}. Then there exists a number
𝑘 such that for every string 𝑤 in 𝐿(𝐺, ℎ ⇒) there exists a derivation such that
|𝑢| ≤ 𝑘 |𝑤| for every string 𝑢 in that derivation.
Lemma 7.4 CS − JPPCF ≠ ∅.
Proof The language 𝑋 = {𝑎 𝑝 | 𝑝 is a prime} over a unary alphabet {𝑎} is a well-
known context-sensitive non-context-free language (see Hopcroft et al. [2006]).
By contradiction, we show that 𝑋 ∉ JPPCF. Assume that there is a PCFG 𝐺 =
({𝑎}, 𝑃, 𝜎) such that 𝐿 (𝐺, 𝑗 𝑝 ⇒) = 𝑋. Obviously 𝑎 → 𝜀 ∉ 𝑃 and 𝜎 = 𝑎 2 since 2
is the smallest prime. As 3 is also prime, 𝑎 2 𝑗 𝑝 ⇒∗ 𝑎 3 and we have 𝑎 → 𝑎 ∈ 𝑃 and
𝑎 → 𝑎 2 ∈ 𝑃. Thus, 𝑎 2 𝑗 𝑝 ⇒∗ 𝑎 4 . Since 4 is not a prime, we have a contradiction. □
7.3 Results 193

Corollary 7.3 CS − JSPCF ≠ ∅.

Proof From Lemma 7.4, we have that 𝑋 = {𝑎 𝑝 | 𝑝 is a prime} is not contained


in JPPCF. Since 𝑋 is a unary language and for unary languages holds JSPCF =
SPCF ⊂ PPCF = JPPCF (see Theorems 7.2, 7.4, and 7.5), we have that 𝑋 ∉
JSPCF. □

Theorem 7.6 JPPCF ⊂ CS.

Proof Let 𝐺 = (Σ, 𝑃, 𝜎) be a PCFG. As is obvious, there is an unrestricted grammar


𝐻 = (𝑉, Σ, 𝑃′ , 𝑆) such that 𝐿(𝐻) = 𝐿(𝐺, 𝑗 𝑝 ⇒). More precisely, we are able to
construct 𝐻 in the way that 𝐻 simulates 𝐺. In this case, Lemma 7.3 also holds for
𝐻. Observe that Lemma 7.3 is the workspace theorem, and every language from
JPPCF must be then context-sensitive.
As CS − JPPCF ≠ ∅ by Lemma 7.4, we have JPPCF ⊂ CS. □

Theorem 7.7 JSPCF ⊂ CS.

Proof JSPCF ⊆ CS can be proved analogously as JPPCF ⊆ CS from Theorem


7.6. Together with Corollary 7.3, we have JSPCF ⊂ CS. □

Mutual Relationships of SPCF, JSPCF, PPCF, JPPCF, CF, and CS

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).

Theorem 7.8 (Subfamily A)

PPCF − (CF ∪ JSPCF ∪ JPPCF) ≠ ∅


𝑛 𝑛
Proof Let Σ = {𝑎, 𝑏} be an alphabet. Let 𝑋 = {𝑎 2 𝑏 2 | 𝑛 ≥ 0} be a language over
Σ. Clearly, 𝑋 ∈ PPCF, since there exists a PCFG, 𝐺 = (Σ, {𝑎 → 𝑎𝑎, 𝑏 → 𝑏𝑏}, 𝑎𝑏),
such that 𝐿 (𝐺, 𝑝 ⇒) = 𝑋. 𝑋 ∉ CF and 𝑋 ∉ JSPCF is satisfied since 𝑋 is not
semilinear. By contradiction, we show that 𝑋 ∉ JPPCF.
Consider that there is a PCFG, 𝐺 ′ = (Σ, 𝑃′ , 𝜎 ′ ), such that 𝐿(𝐺 ′ , 𝑗 𝑝 ⇒) = 𝑋.
Observe that 𝑎𝑏 ∈ 𝐿(𝐺 ′ , 𝑗 𝑝 ⇒). Let 𝑎 → 𝑥, 𝑏 → 𝑦 be production rules from 𝑃′ ,
𝑥, 𝑦 ∈ Σ∗ . Then, there exist two derivations, 𝑎𝑏 𝑗 𝑝 ⇒ 𝑥𝑦 and 𝑎𝑏 𝑗 𝑝 ⇒ 𝑦𝑥, in 𝐺 ′ . Now,
consider the following cases:
194 7 Pure Jumping Grammars

• 𝑥 = 𝜀 (𝑦 = 𝜀). If 𝑦 ∈ 𝑋 (𝑥 ∈ 𝑋), then either 𝑎𝑏 is the only string derivable


in 𝐺 ′ using 𝑗 𝑝 ⇒ or there is a derivation 𝑦 𝑗 𝑝 ⇒∗ 𝑧 (𝑥 𝑗 𝑝 ⇒∗ 𝑧) in 𝐺 ′ such that
𝑏𝑎 ∈ substrings(𝑧), which is a contradiction. If 𝑦 ∉ 𝑋, such as 𝑦 ∈ {𝜀, 𝑎, 𝑏}
(𝑥 ∉ 𝑋, such as 𝑥 ∈ {𝜀, 𝑎, 𝑏}), then 𝑎𝑏 𝑗 𝑝 ⇒ 𝑦 (𝑎𝑏 𝑗 𝑝 ⇒ 𝑥), so 𝑦 ∈ 𝑋 (𝑥 ∈ 𝑋),
which is a contradiction as well. In the following, we assume that 𝑥 ≠ 𝜀 and
𝑦 ≠ 𝜀.
• 𝑥 = 𝑏𝑥 ′ or 𝑦 = 𝑏𝑦 ′ , where 𝑥 ′ , 𝑦 ′ ∈ Σ∗ . Then, there is a derivation 𝑎𝑏 𝑗 𝑝 ⇒ 𝑏𝑧 in
𝐺 ′ , where 𝑧 ∈ Σ∗ , and thus 𝑏𝑧 ∈ 𝑋, which is a contradiction.
• 𝑥 = 𝑥 ′ 𝑎 or 𝑦 = 𝑦 ′ 𝑎, where 𝑥 ′ , 𝑦 ′ ∈ Σ∗ . Then, there is a derivation 𝑎𝑏 𝑗 𝑝 ⇒ 𝑧𝑎 in
𝐺 ′ , where 𝑧 ∈ Σ∗ , and thus 𝑧𝑎 ∈ 𝑋, which is a contradiction.
• 𝑥 = 𝑎𝑥 ′ 𝑏 and 𝑦 = 𝑎𝑦 ′ 𝑏, where 𝑥 ′ , 𝑦 ′ ∈ Σ∗ . Then, there is a derivation 𝑎𝑏 𝑗 𝑝 ⇒ 𝑧
in 𝐺 ′ such that 𝑏𝑎 ∈ substrings(𝑧), which is a contradiction.
If 𝑎 → 𝑥 or 𝑏 → 𝑦 is missing in 𝑃′ , then 𝑋 is finite—a contradiction. No other cases
are possible, which completes the proof. □
Several intersections of some language families are hard to investigate. Such an
intersection is PPCF ∩ JSPCF. At this moment, we are not able to prove whether
PPCF ∩ JSPCF ⊆ CF or not. For this reason, we leave the subfamilies B and C as
open problems.
Open Problem (Subfamily B) Is it true that

(PPCF ∩ JSPCF) − (CF ∪ JPPCF) ≠ ∅?

Open Problem (Subfamily C) Is it true that

(PPCF ∩ JSPCF ∩ JPPCF) − CF ≠ ∅?

Theorem 7.9 (Subfamily D)

(PPCF ∩ JPPCF) − (CF ∪ JSPCF) ≠ ∅

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}. □

Theorem 7.10 (Subfamily E)

SPCF − (JSPCF ∪ JPPCF) ≠ ∅

Proof Let Σ = {𝑎, 𝑏, 𝑐} be an alphabet. Let 𝑋 = {𝑎 𝑛 𝑐𝑏 𝑛 | 𝑛 ≥ 0} be a language over


Σ. Clearly, there exists a PCFG 𝐺 = (Σ, {𝑐 → 𝑎𝑐𝑏}, 𝑐) such that 𝐿 (𝐺, 𝑠 ⇒) = 𝑋 and
hence 𝑋 ∈ SPCF. We prove by contradiction that 𝑋 is neither jumping sequential
pure context-free nor jumping parallel pure context-free language.
𝑋 ∉ JSPCF. Assume that there is a PCFG 𝐺 ′ = (Σ, 𝑃′ , 𝜎 ′ ) such that
7.3 Results 195

𝐿(𝐺 ′ , 𝑗 ⇒) = 𝑋.

Clearly, 𝜎 ′ = 𝑐 must be the axiom since there must be no erasing rules in 𝑃′


(observe that 𝑎𝑏, 𝑎𝑐, 𝑐𝑏 ∉ 𝑋). Because 𝑎𝑐𝑏 ∈ 𝑋, we have that 𝑐 → 𝑎𝑐𝑏 ∈ 𝑃′ . But
𝑎𝑐𝑏 𝑗 ⇒ 𝑎𝑏𝑎𝑐𝑏 and 𝑎𝑏𝑎𝑐𝑏 ∉ 𝑋, which is a contradiction.
𝑋 ∉ JPPCF. Assume that there is a PCFG 𝐻 = (Σ, 𝑅, 𝜔) such that 𝐿 (𝐻, 𝑗 𝑝 ⇒) =
𝑋. First, let 𝑘 ≥ 1 and assume that 𝜔 = 𝑎 𝑘 𝑐𝑏 𝑘 is an axiom. Since 𝜔 𝑗 𝑝 ⇒∗ 𝑐, there
must be rules 𝑎 → 𝜀, 𝑏 → 𝜀, and 𝑐 → 𝑐 contained in 𝑅. Now, assume that
• 𝑑ˆ → 𝑑𝑥 ∈ 𝑅, 𝑑ˆ ∈ {𝑎, 𝑏}, 𝑑 ∈ Σ, 𝑥 ∈ Σ∗ ; then, 𝜔 𝑗 𝑝 ⇒∗ 𝑢𝑑𝑥𝑐𝑣 and 𝜔 𝑗 𝑝 ⇒∗ 𝑢𝑐𝑑𝑥𝑣
and obviously for 𝑑 = 𝑎 holds 𝑢𝑐𝑑𝑥𝑣 ∉ 𝑋 and for 𝑑 = 𝑏 holds 𝑢𝑑𝑥𝑐𝑣 ∉ 𝑋,
𝑢, 𝑣 ∈ Σ∗ ; 𝑑 = 𝑐 is obvious;
• 𝑑ˆ → 𝑥𝑑 ∈ 𝑅, 𝑑ˆ ∈ {𝑎, 𝑏}, 𝑑 ∈ Σ, 𝑥 ∈ Σ∗ ; then, 𝜔 𝑗 𝑝 ⇒∗ 𝑢𝑥𝑑𝑐𝑣 and 𝜔 𝑗 𝑝 ⇒∗ 𝑢𝑐𝑥𝑑𝑣
and obviously for 𝑑 = 𝑎 holds 𝑢𝑐𝑥𝑑𝑣 ∉ 𝑋 and for 𝑑 = 𝑏 holds 𝑢𝑥𝑑𝑐𝑣 ∉ 𝑋,
𝑢, 𝑣 ∈ Σ∗ ; 𝑑 = 𝑐 is obvious.
Therefore, 𝑎 → 𝑥, 𝑏 → 𝑦 ∈ 𝑅 implies 𝑥 = 𝑦 = 𝜀. Hence, only rules of the form
𝑐 → 𝑧, where 𝑧 ∈ 𝑋, can be considered. But the finiteness of 𝑅 implies the finiteness
of 𝑋, which is a contradiction.
Clearly, the axiom must be 𝜔 = 𝑐, which implies that 𝑅 contains rules of the
form 𝑐 → 𝑧, where 𝑧 ∈ 𝑋. Obviously, there must be also rules 𝑎 → 𝑥, 𝑏 → 𝑦 ∈ 𝑅,
𝑥, 𝑦 ∈ Σ∗ . If 𝑥 = 𝑦 = 𝜀, 𝑋 must be finite. Thus, assume that 𝑥 ≠ 𝜀 or 𝑦 ≠ 𝜀. Then,
like before, we can derive a string which is not contained in 𝑋—a contradiction. □
Theorem 7.11 (Subfamily F)

(SPCF ∩ JSPCF) − JPPCF ≠ ∅

Proof Let Σ = {𝑎, 𝑏, 𝑐} be an alphabet and let 𝑋 = {𝑎𝑎, 𝑎𝑎𝑏, 𝑎𝑎𝑐, 𝑎𝑎𝑏𝑐} be a
language over Σ. Consider a PCFG

𝐺 = (Σ, {𝑏 → 𝜀, 𝑐 → 𝜀}, 𝑎𝑎𝑏𝑐).

Clearly, 𝐿(𝐺, 𝑠 ⇒) = 𝐿 (𝐺, 𝑗 ⇒) = 𝑋 and hence 𝑋 ∈ SPCF ∩ JSPCF.


To show that 𝑋 ∉ JPPCF, we use a contradiction. Assume that there exists a PCFG
𝐺 ′ = (Σ, 𝑃′ , 𝜎) such that 𝐿(𝐺 ′ , 𝑗 𝑝 ⇒) = 𝑋. Since 𝜎 ∈ 𝑋 and 𝑋 ⊆ {𝑎𝑎}{𝑏}∗ {𝑐}∗ ,
there must be a rule 𝑎 → 𝑥 in 𝑃′ with 𝑥 ∈ Σ∗ . But this implies that there must be a
derivation 𝜎 𝑗 𝑝 ⇒∗ 𝑎𝑎 𝑗 𝑝 ⇒ 𝑥𝑥 in 𝐺 ′ . The only string from 𝑋 that has a form 𝑥𝑥 is
𝑎𝑎 so 𝑎 → 𝑎 is the only rule with 𝑎 on its left-hand side so 𝑎 → 𝑎 ∈ 𝑃′ .
Next, we choose 𝜎. Clearly, 𝜎 ≠ 𝑎𝑎. Furthermore, 𝜎 ∉ {𝑎𝑎𝑏, 𝑎𝑎𝑐} since 𝜎 𝑗 𝑝 ⇒
𝑎𝑎𝑏𝑐 implies that 𝜎 𝑗 𝑝 ⇒∗ 𝑎𝑏𝑐𝑎, and 𝑎𝑏𝑐𝑎 ∉ 𝑋. Thus, the only possibility is to
choose 𝜎 = 𝑎𝑎𝑏𝑐. But 𝑎𝑎𝑏𝑐 𝑗 𝑝 ⇒ 𝑎𝑎𝑏 means that {𝑏 → 𝑏, 𝑐 → 𝜀} ⊆ 𝑃′ or
{𝑏 → 𝜀, 𝑐 → 𝑏} ⊆ 𝑃′ . In both cases, 𝑎𝑎𝑏𝑐 𝑗 𝑝 ⇒ 𝑎𝑏𝑎. As 𝑎𝑏𝑎 ∉ 𝑋, there is no
PCFG 𝐺 ′ such that 𝐿 (𝐺 ′ , 𝑗 𝑝 ⇒) = 𝑋, which is a contradiction. □
Theorem 7.12 (Subfamily G)

SPCF ∩ JSPCF ∩ JPPCF ≠ ∅


196 7 Pure Jumping Grammars

Proof Let 𝐺 = ({𝑎}, {𝑎 → 𝑎, 𝑎 → 𝑎𝑎}, 𝑎) be a PCFG. It is easy to see that

𝐿(𝐺, 𝑠 ⇒) = 𝐿(𝐺, 𝑗 ⇒) = 𝐿(𝐺, 𝑗 𝑝 ⇒) = {𝑎}+ .

Open Problem (Subfamily H) Is it true that

(SPCF ∩ JPPCF) − JSPCF ≠ ∅?

Theorem 7.13 (Subfamily I)

(PPCF ∩ CF) − (SPCF ∪ JSPCF ∪ JPPCF) ≠ ∅

Proof Let 𝑋 = {𝑎𝑎𝑏𝑏, 𝑐𝑐𝑑𝑑} be a language over an alphabet Σ = {𝑎, 𝑏, 𝑐, 𝑑}.


Clearly, 𝑋 ∈ CF. Since there exists a PCFG 𝐺 = (Σ, {𝑎 → 𝑐, 𝑏 → 𝑑}, 𝑎𝑎𝑏𝑏) such
that 𝐿 (𝐺, 𝑝 ⇒) = 𝑋, 𝑋 ∈ PPCF. Furthermore, observe that derivations 𝑎𝑎𝑏𝑏 𝑠 ⇒
𝑐𝑐𝑑𝑑 (𝑎𝑎𝑏𝑏 𝑗 ⇒𝑐𝑐𝑑𝑑) or 𝑐𝑐𝑑𝑑 𝑠 ⇒𝑎𝑎𝑏𝑏 (𝑐𝑐𝑑𝑑 𝑗 ⇒𝑎𝑎𝑏𝑏) cannot be performed due to
the definition of 𝑠 ⇒ ( 𝑗 ⇒), and hence there is no PCFG 𝐺 ′ such that 𝐿 (𝐺 ′ , 𝑠 ⇒) = 𝑋
(𝐿(𝐺 ′ , 𝑗 ⇒) = 𝑋). Thus, 𝑋 ∉ SPCF and 𝑋 ∉ JSPCF.
Now, suppose that there is a PCFG 𝐻 = (Σ, 𝑃, 𝜎) such that 𝐿(𝐻, 𝑗 𝑝 ⇒) = 𝑋.
For 𝜎 = 𝑎𝑎𝑏𝑏, we have 𝑎𝑎𝑏𝑏 𝑗 𝑝 ⇒ 𝑐𝑐𝑑𝑑. If 𝑎 → 𝜀 ∈ 𝑃 or 𝑏 → 𝜀 ∈ 𝑃, then
𝑎𝑎𝑏𝑏 𝑗 𝑝 ⇒ 𝑥, where 𝑥 ∉ 𝑋. Thus, 𝑎 → 𝑦 and 𝑏 → 𝑧, where 𝑦, 𝑧 ∈ {𝑐, 𝑑}, are only
possible production rules in 𝑃. But 𝑎𝑎𝑏𝑏 𝑗 𝑝 ⇒ 𝑐𝑑𝑐𝑑 and since 𝑐𝑑𝑐𝑑 ∉ 𝑋, there
is no PCFG 𝐻 such that 𝐿(𝐻, 𝑗 𝑝 ⇒) = 𝑋. Analogously for 𝜎 = 𝑐𝑐𝑑𝑑. We have a
contradiction and therefore 𝑋 ∉ JPPCF. □
Open Problem (Subfamily J) Is it true that

(PPCF ∩ CF ∩ JSPCF) − (SPCF ∪ JPPCF) ≠ ∅?

Open Problem (Subfamily K) Is it true that

(PPCF ∩ CF ∩ JSPCF ∩ JPPCF) − SPCF ≠ ∅?

Theorem 7.14 (Subfamily L)

(PPCF ∩ CF ∩ JPPCF) − (SPCF ∪ JSPCF) ≠ ∅

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

𝐺 = (Σ, {𝑎 → 𝑐, 𝑏 → 𝑑, 𝑐 → 𝑑, 𝑑 → 𝑐}, 𝑎𝑏)

such that 𝐿(𝐺, 𝑝 ⇒) = 𝐿 (𝐺, 𝑗 𝑝 ⇒) = 𝑋, 𝑋 ∈ PPCF ∩ JPPCF. □


7.3 Results 197

Theorem 7.15 (Subfamily M)

CF − (PPCF ∪ JSPCF ∪ JPPCF) ≠ ∅

Proof Let Σ = {𝑎, 𝑏} and let 𝑋 = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 1} be a language over Σ. In-


disputably, 𝑋 is a well-known context-free language. According to Rozenberg and
Doucet [1971], 𝑋 ∉ 0L. Observe that every language 𝑌 that belongs to (PPCF − 0L)
can be generated by PCFG 𝐺 = (Σ, 𝑃, 𝜎) such that there exists 𝑐 ∈ Σ such that for
every 𝑥 ∈ Σ∗ , 𝑐 → 𝑥 ∉ 𝑃. Thus, if 𝑋 ∈ (PPCF − 0L), then 𝑋 must be a finite
language (since either 𝑎 or 𝑏 blocks deriving of any string from axiom), which is
a contradiction. Therefore, 𝑋 ∉ (PPCF − 0L) and clearly 𝑋 ∉ PPCF. Next, we
demonstrate that 𝑋 ∉ JSPCF and 𝑋 ∉ JPPCF.
𝑋 ∉ JSPCF. Suppose that 𝑋 ∈ JSPCF, so there exists a PCFG 𝐺 ′ = (Σ, 𝑃′ , 𝜎 ′ )
such that 𝐿(𝐺 ′ , 𝑗 ⇒) = 𝑋. As 𝑎, 𝑏 ∉ 𝑋, there are no erasing rules in 𝑃′ and thus
𝜎 ′ = 𝑎𝑏 must be the axiom. Now consider a derivation 𝑎𝑏 𝑗 ⇒ 𝑎𝑎𝑏𝑏. There are
exactly two possibilities how to get a string 𝑎𝑎𝑏𝑏 directly from the axiom 𝑎𝑏—
either expand 𝑎 to 𝑎𝑎𝑏 (𝑎 → 𝑎𝑎𝑏 ∈ 𝑃′ ) or expand 𝑏 to 𝑎𝑏𝑏 (𝑏 → 𝑎𝑏𝑏 ∈ 𝑃′ ).
Due to the definition of 𝑗 ⇒, 𝑎𝑏 𝑗 ⇒ 𝑏𝑎𝑎𝑏 in the first case, and 𝑎𝑏 𝑗 ⇒ 𝑎𝑏𝑏𝑎 in the
second case. Since neither 𝑏𝑎𝑎𝑏 nor 𝑎𝑏𝑏𝑎 belongs to 𝑋, 𝑋 ∉ JSPCF, which is a
contradiction.
𝑋 ∉ JPPCF. Suppose that 𝑋 ∈ JPPCF, so there exists a PCFG 𝐻 = (Σ, 𝑅, 𝜔)
such that 𝐿 (𝐻, 𝑗 𝑝 ⇒) = 𝑋. As for all 𝑖 ≥ 0, 𝑎 𝑖 , 𝑏 𝑖 ∉ 𝑋, there are no erasing rules
in 𝑅 and thus 𝜔 = 𝑎𝑏 must be the axiom. Clearly, 𝑎𝑏 𝑗 𝑝 ⇒ 𝑎𝑎𝑏𝑏. There are exactly
three ways to get 𝑎𝑎𝑏𝑏 from 𝑎𝑏:
• 𝑎 → 𝑎 ∈ 𝑅, 𝑏 → 𝑎𝑏𝑏 ∈ 𝑅. In this case, 𝑎𝑏 𝑗 𝑝 ⇒𝑎𝑎𝑏𝑏 implies that 𝑎𝑏 𝑗 𝑝 ⇒𝑎𝑏𝑏𝑎,
but 𝑎𝑏𝑏𝑎 ∉ 𝑋.
• 𝑎 → 𝑎𝑎 ∈ 𝑅, 𝑏 → 𝑏𝑏 ∈ 𝑅. In this case, 𝑎𝑏 𝑗 𝑝 ⇒𝑎𝑎𝑏𝑏 implies that 𝑎𝑏 𝑗 𝑝 ⇒𝑏𝑏𝑎𝑎,
but 𝑏𝑏𝑎𝑎 ∉ 𝑋.
• 𝑎 → 𝑎𝑎𝑏 ∈ 𝑅, 𝑏 → 𝑏 ∈ 𝑅. In this case, 𝑎𝑏 𝑗 𝑝 ⇒𝑎𝑎𝑏𝑏 implies that 𝑎𝑏 𝑗 𝑝 ⇒𝑏𝑎𝑎𝑏,
but 𝑏𝑎𝑎𝑏 ∉ 𝑋.
Thus, 𝑋 ∉ JPPCF, which is a contradiction. □

Open Problem (Subfamily N) Is it true that

(CF ∩ JSPCF) − (PPCF ∪ JPPCF) ≠ ∅?

Theorem 7.16 (Subfamily O)

(CF ∩ JSPCF ∩ JPPCF) − PPCF ≠ ∅

Proof Let Σ = {𝑎, 𝑏} be an alphabet and let

𝑋 = {𝑎𝑎𝑏𝑏, 𝑎𝑏𝑎𝑏, 𝑎𝑏𝑏𝑎, 𝑏𝑎𝑎𝑏, 𝑏𝑎𝑏𝑎, 𝑏𝑏𝑎𝑎}

be a language over Σ. Since 𝑋 is finite, 𝑋 is context-free. Given a PCFG


198 7 Pure Jumping Grammars

𝐺 = (Σ, {𝑎 → 𝑎, 𝑏 → 𝑏}, 𝑎𝑎𝑏𝑏).

Clearly, 𝐿 (𝐺, 𝑗 ⇒) = 𝐿(𝐺, 𝑗 𝑝 ⇒) = 𝑋. Hence, 𝑋 ∈ CF ∩ JSPCF ∩ JPPCF.


By contradiction, we show that 𝑋 ∉ PPCF. Assume that there is a PCFG 𝐻 =
(Σ, 𝑃, 𝜎) such that 𝐿 (𝐻, 𝑝 ⇒) = 𝑋. First, we show that 𝑃 contains no erasing rules:
• If 𝑎 → 𝜀 ∈ 𝑃 and 𝑏 → 𝜀 ∈ 𝑃, we have 𝜀 ∈ 𝑋, which is a contradiction.
• If 𝑎 → 𝜀 ∈ 𝑃, then 𝑏 → 𝑥 ∈ 𝑃 implies that 𝑥 ∈ {𝑎𝑎, 𝑏𝑏, 𝑎𝑏, 𝑏𝑎} because for
every 𝑤 ∈ 𝑋, |𝑤| = 4. Clearly, if 𝑏 → 𝑎𝑎 ∈ 𝑃, then 𝑎𝑎𝑎𝑎 ∈ 𝑋, and if 𝑏 → 𝑏𝑏 ∈
𝑃, then 𝑏𝑏𝑏𝑏 ∈ 𝑋. As is obvious, both cases represent a contradiction. On the
other hand, if there are no rules in 𝑃 starting from 𝑏 apart from 𝑏 → 𝑎𝑏 and/or
𝑏 → 𝑏𝑎, then 𝑎𝑎𝑏𝑏 ∉ 𝑋, which is a contradiction. Similarly for 𝑏 → 𝜀 ∈ 𝑃.
Since all strings in 𝑋 have the same length and there are no erasing rules in 𝑃,
only unit rules can be contained in 𝑃. Because 𝑎𝑎𝑎𝑎 ∉ 𝑋 and 𝑏𝑏𝑏𝑏 ∉ 𝑋, either
𝑃 = {𝑎 → 𝑎, 𝑏 → 𝑏} or 𝑃 = {𝑎 → 𝑏, 𝑏 → 𝑎}. In both cases, we never get 𝑋. Thus,
there is no PCFG 𝐻 such that 𝐿(𝐻, 𝑝 ⇒) = 𝑋, and hence 𝑋 ∉ PPCF. □

Theorem 7.17 (Subfamily P)

(CF ∩ JPPCF) − (PPCF ∪ JSPCF) ≠ ∅

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

JSPCF − (CF ∪ PPCF ∪ JPPCF) ≠ ∅?

Theorem 7.18 (Subfamily R)

(JSPCF ∩ JPPCF) − (CF ∪ PPCF) ≠ ∅

Proof Let Σ = {𝑎, 𝑏, 𝑐} be an alphabet and let 𝑋 = {𝑤 | occur(𝑤, 𝑎) − 1 =


occur(𝑤, 𝑏) = occur(𝑤, 𝑐), 𝑤 ∈ Σ+ } be a language over Σ. 𝑋 ∈ JSPCF ∩ JPPCF
since there is a PCFG

𝐺 = (Σ, {𝑎 → 𝑎𝑏𝑐𝑎, 𝑎 → 𝑎, 𝑏 → 𝑏, 𝑐 → 𝑐}, 𝑎)

such that 𝐿 (𝐺, 𝑗 ⇒) = 𝐿 (𝐺, 𝑗 𝑝 ⇒) = 𝑋. By pumping lemma for context-free lan-


guages, 𝑋 ∉ CF.
7.3 Results 199

By contradiction, we show that 𝑋 ∉ PPCF. Assume that there is a PCFG 𝐻 =


(Σ, 𝑃, 𝜎) such that 𝐿 (𝐻, 𝑝 ⇒) = 𝑋. First, we show that 𝜎 = 𝑎. Assume that 𝜎 ≠ 𝑎.
Then, 𝜎 𝑝 ⇒∗ 𝑎 implies that 𝑎 → 𝜀 ∈ 𝑃 and we have that 𝜀 ∈ 𝑋, which is a
contradiction. Thus, 𝑎 must be the axiom, and 𝑎 → 𝑥 ∈ 𝑃 implies that 𝑥 ∈ 𝑋.
Let 𝑙 = 3 max{|𝛽| | 𝛼 → 𝛽 ∈ 𝑃}. The smallest possible value of 𝑙 is 3. Let
𝜔 = 𝑎 𝑙+1 𝑏 𝑙 𝑐𝑙 . Clearly, 𝜔 ∈ 𝑋. Then there is a direct derivation step 𝜃 𝑝 ⇒ 𝜔, where
𝜃 ∈ 𝑋. Next, we make the following observations about 𝜃 and 𝑃:
(1) 𝜃 ≠ 𝑎, since 𝑎 → 𝜔 ∉ 𝑃. The choice of 𝑙 excludes such situation.
(2) 𝜃 contains all three symbols 𝑎, 𝑏, and 𝑐.
(3) 𝑎 → 𝑎 ∈ 𝑃 is the only production rule with 𝑎 on its left-hand side that is used
during 𝜃 𝑝 ⇒ 𝜔. Observe that if 𝑎 → 𝑥 ∈ 𝑃 is chosen to rewrite 𝑎 during 𝜃 𝑝 ⇒ 𝜔,
then 𝑥 ∈ 𝑋 and 𝑥 must be a substring of 𝜔. Only 𝑥 = 𝑎 meets these requirements.
(4) 𝜃 can be expressed as 𝑎 + 𝜃 ′ , where 𝜃 ′ ∈ {𝑏, 𝑐}∗ . This follows from the form of 𝜔
and the third observation.
(5) During 𝜃 𝑝 ⇒ 𝜔 are used production rules 𝑏 → 𝑦, 𝑐 → 𝑦 ′ ∈ 𝑃 such that each of
𝑦, 𝑦 ′ do not contain at least one symbol from Σ. This is secured by the choice of
𝑙.
(6) Every rule with 𝑏 on its left-hand side in 𝑃 has the same Parikh (commutative)
image of its right-hand side, and every rule with 𝑐 on its left-hand side in 𝑃 has the
same Parikh (commutative) image of its right-hand side. To not break a number
of occurrences of symbols 𝑎, 𝑏, and 𝑐 in 𝜔 during 𝜃 𝑝 ⇒ 𝜔, when 𝑏 → 𝑦 ∈ 𝑃
is used, then the corresponding 𝑐 → 𝑦 ′ ∈ 𝑃 must be also used simultaneously
with it. To preserve the proper number of occurrences of 𝑎, 𝑏, and 𝑐 in 𝜔, we
have card({𝜓 Σ (𝛽) | 𝑏 → 𝛽 ∈ 𝑃}) = 1 and card({𝜓 Σ (𝛾) | 𝑐 → 𝛾 ∈ 𝑃}) = 1.
Now, we inspect the ways 𝑎 + 𝜃 ′ 𝑝 ⇒ 𝜔 could be made. Suppose that the first symbol
of 𝜃 ′ is 𝑏:
• 𝑏 → 𝜀 ∈ 𝑃 was used. Then, 𝑐 → 𝑏𝑐 ∈ 𝑃 must be used (𝑐 → 𝑐𝑏 is excluded
since 𝑐 is not before 𝑏 in 𝜔). As there are at least two 𝑐s in 𝜃 ′ , applying 𝑐 → 𝑏𝑐
brings 𝑐 before 𝑏 which is in a contradiction with the form of 𝜔.
• Let 𝑖 ≥ 1 and let 𝑏 → 𝑎 𝑖 ∈ 𝑃. Then, 𝑐 → 𝑏 𝑖+1 𝑐𝑖+1 ∈ 𝑃. Since |𝑏 𝑖+1 𝑐𝑖+1 | is at
most 3𝑙 , there are at least two occurrences of 𝑐 in 𝜃 ′ , and then we obtain 𝑐 before
𝑏 in 𝜔.
• Let 𝑖 ≥ 1 and let 𝑗 be a non-negative integer such that 𝑗 ≤ 𝑖 + 1. Let 𝑏 → 𝑎 𝑖 𝑏 𝑗 ∈
𝑃. Then 𝑐 → 𝑏 𝑘 𝑐 𝑚 ∈ 𝑃, where 𝑗 + 𝑘 = 𝑚 = 𝑖 + 1. As in the previous case, when
these rules are used during 𝜃 𝑝 ⇒ 𝜔, we get 𝑏 before 𝑎 or 𝑐 before 𝑏 in 𝜔.
• No 𝑎s were added during 𝜃 𝑝 ⇒ 𝜔. In this case, the only rules with 𝑏 and 𝑐 on
their left-hand sides in 𝑃 can be either 𝑏 → 𝑏𝑐 and 𝑐 → 𝜀, or 𝑏 → 𝑏 and 𝑐 → 𝑐,
or 𝑏 → 𝑐 and 𝑐 → 𝑏. This implies that the only way to get 𝜃 from 𝑎 is to use
𝑎 → 𝜃 rule that is clearly not in 𝑃.
For the case that 𝑐 is the first symbol of 𝜃 ′ , we can proceed analogously. Therefore,
𝜔 ∉ 𝐿 (𝐻, 𝑝 ⇒), which implies that 𝑋 ∉ PPCF. □

Theorem 7.19 (Subfamily S)


200 7 Pure Jumping Grammars

JPPCF − (CF ∪ PPCF ∪ JSPCF) ≠ ∅

Proof Let Σ = {𝑎, 𝑏, 𝑐, 𝑎, ˆ 𝑐}


ˆ 𝑏, ˆ be an alphabet and let

𝑋 = { 𝑎ˆ 𝑏ˆ 𝑐}
ˆ ∪ {𝑥 | occur(𝑥, 𝑎) − 1 = occur(𝑥, 𝑏) = occur(𝑥, 𝑐),
𝑥 ∈ {𝑎, 𝑏, 𝑐}+ }

be a language over Σ. Following the pumping lemma for context-free languages,


𝑋 ∉ CF. Since there is a PCFG 𝐺 = (Σ, { 𝑎ˆ → 𝑎, 𝑏ˆ → 𝜀, 𝑐ˆ → 𝜀, 𝑎 → 𝑎𝑏𝑐𝑎, 𝑎 →
𝑎, 𝑏 → 𝑏, 𝑐 → 𝑐}, 𝑎ˆ 𝑏ˆ 𝑐)
ˆ such that 𝐿 (𝐺, 𝑗 𝑝 ⇒) = 𝑋, 𝑋 ∈ JPPCF. By contradiction,
we show that 𝑋 ∉ JSPCF and 𝑋 ∉ PPCF.
Suppose that 𝑋 ∈ JSPCF. Then, there is a PCFG 𝐻 = (Σ, 𝑃, 𝜎) such that
𝐿(𝐻, 𝑗 ⇒) = 𝑋. First, we choose 𝜎. From the definition of 𝑋, 𝑎 ∈ 𝑋 and for every
string 𝑥 ∈ 𝑋 − {𝑎} holds |𝑥| ≥ 3. Since we are able to erase only one symbol during
direct derivation step by 𝑗 ⇒ and there is no string of length 2 contained in 𝑋, we
must choose 𝜎 = 𝑎 as the axiom. Because 𝑎𝑏𝑐𝑎 ∈ 𝑋 and 𝑎ˆ 𝑏ˆ 𝑐ˆ ∈ 𝑋, there must be
two derivations, 𝑎 𝑗 ⇒∗ 𝑎𝑏𝑐𝑎 and 𝑎 𝑗 ⇒∗ 𝑎ˆ 𝑏ˆ 𝑐,ˆ and this implies that there exists also
∗ ˆ
a derivation 𝑎 𝑗 ⇒ 𝑎ˆ 𝑏 𝑐𝑏𝑐𝑎.
ˆ ˆ
Since 𝑎ˆ 𝑏 𝑐𝑏𝑐𝑎
ˆ ∉ 𝑋, we have a contradiction.
Next, suppose that 𝑋 ∈ PPCF, so there exists a PCFG 𝐻 ′ = (Σ, 𝑃′ , 𝜎 ′ ) such that
𝐿 (𝐻 ′ , 𝑝 ⇒) = 𝑋. In this case, we must choose 𝜎 ′ = 𝑎ˆ 𝑏ˆ 𝑐ˆ as the axiom. If we choose
𝑎, then 𝑎 𝑝 ⇒∗ 𝑎𝑏𝑐𝑎 and 𝑎 𝑝 ⇒∗ 𝑎ˆ 𝑏ˆ 𝑐ˆ implies that 𝑎 𝑝 ⇒∗ 𝑢 1 𝑎𝑢 2 𝑎𝑢
ˆ 3 , 𝑢 1 , 𝑢 2 , 𝑢 3 ∈ Σ∗ ,
ˆ 3 ∉ 𝑋. If we choose 𝑎𝑏𝑐𝑎 or similar, then 𝑎𝑏𝑐𝑎 𝑝 ⇒∗ 𝑎 implies that
and 𝑢 1 𝑎𝑢 2 𝑎𝑢
𝑎 𝑝 ⇒ 𝜀, and 𝜀 ∉ 𝑋. Without loss of generality, assume that for every 𝛼 → 𝛽 ∈ 𝑃′ ,

𝛽 ∈ {𝑎, 𝑏, 𝑐}∗ (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. □

Theorem 7.20 (Subfamily T)

CS − (CF ∪ JSPCF ∪ PPCF ∪ JPPCF) ≠ ∅

Proof Let 𝑋 = {𝑎 𝑝 | 𝑝 is a prime} be a language over unary alphabet {𝑎}. 𝑋 ∈ CS


and 𝑋 ∉ CF are well-known containments (see Hopcroft et al. [2006]). By Lemma
7.4 and Corollary 7.3, 𝑋 ∉ JPPCF and 𝑋 ∉ JSPCF. As for unary languages
PPCF = JPPCF, 𝑋 ∉ PPCF. □
The summary of Theorems 7.8 through 7.20 is visualized in Figure 7.1.

Absence of Erasing Rules

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

𝑋 ∈ {SPCF, JSPCF, PPCF, JPPCF, 0L}.

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

Open Problem What is the relation between JSPCF− 𝜀 and JPPCF− 𝜀 ? □


Open Problem What is the relation between JSPCF− 𝜀 and JPPCF? □
Theorem 7.24 PPCF− 𝜀 and 0L are incomparable.
Proof Let 𝑋 = {𝑎𝑎, 𝑎𝑎𝑏} and 𝑌 = {𝑎, 𝑎𝑎𝑏} be two languages over {𝑎, 𝑏}. 𝑋 ∉
PPCF− 𝜀 , 𝑋 ∈ 0L, 𝑌 ∈ PPCF− 𝜀 , and 𝑌 ∉ 0L proves the incomparability, while
{𝑎}+ ∈ PPCF− 𝜀 ∩ 0L proves the disjointness. □

Remark on Unary Alphabets

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,

SPCF− 𝜀 = JSPCF− 𝜀 ⊂ PPCF− 𝜀 =


JPPCF− 𝜀 = 0L− 𝜀 .

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

Consider SPCF, JSPCF, PPCF, JPPCF, 0L, SPCF− 𝜀 , JSPCF− 𝜀 , PPCF− 𝜀 ,


JPPCF− 𝜀 , and 0L− 𝜀 (see Section 7.2). The present chapter has investigated mutual
relations between these language families, which are summarized in Table 7.1 and
Figure 7.1. As a special case, it has also performed an analogical study in terms of
unary alphabets (see Figure 7.2).
Although we have already pointed out several open problems earlier in this chapter
(see Open Problems), we repeat the questions of a particular significance next.
• Is it true that (PPCF ∩ JSPCF) − (CF ∪ JPPCF) ≠ ∅ (Open Problem)?
7.3 Results 203

PPCF− 𝜀 JPPCF− 𝜀 0L− 𝜀

PPCF JPPCF 0L

SPCF JSPCF

SPCF− 𝜀 JSPCF− 𝜀

Fig. 7.2 Relationships between unary-language families defined by pure grammars.

• Is it true that (PPCF ∩ JSPCF ∩ JPPCF) − CF ≠ ∅ (Open Problem)?


• Is it true that (SPCF ∩ JPPCF) − JSPCF ≠ ∅ (Open Problem)?
• Is it true that (PPCF ∩ CF ∩ JSPCF) − (SPCF ∪ JPPCF) ≠ ∅ (Open Problem)?
• Is it true that (PPCF ∩ CF ∩ JSPCF ∩ JPPCF) − SPCF ≠ ∅ (Open Problem)?
• Is it true that (CF ∩ JSPCF) − (PPCF ∪ JPPCF) ≠ ∅ (Open Problem)?
• Is it true that JSPCF − (CF ∪ PPCF ∪ JPPCF) ≠ ∅ (Open Problem)?
• Let 𝑋 ∈ {SP, JSP, PP, JPP}. Is the inclusion 𝑋 − 𝜀 ⊆ 𝑋, in fact, proper (Open
Problem)?
• What is the relation between JSPCF− 𝜀 and JPPCF− 𝜀 (Open Problem)?
• What is the relation between JSPCF− 𝜀 and JPPCF (Open Problem)?
Recall that the present study has only considered pure grammars based upon
context-free production rules. Of course, from a broader perspective, we might
reconsider all the study in terms of grammars that allow non-context-free production
rules as well.
Part IV
Conclusion
This concluding part consists of three chapters. Chapter 8 outlines other important
approaches to discontinuous computation and its formalizations. Chapter 9 sketches
applications of jumping automata and grammars. In addition, it suggests its future
possibilities. Chapter 10 summarizes the book as a whole. It places all its material
into a historical and bibliographical context. Also, it recommends further crucially
important reading to the serious reader who finds jumping automata and grammars
interesting.
Chapter 8
Other Models of Discontinuous Computation

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.

8.1 Deep Pushdown Automata

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

The concept of deep pushdown automata is inspired by the well-known transforma-


tion of a context-free grammar to an equivalent pushdown automaton 𝑀, referred
to as the general top-down parser for the grammar (see [Rozenberg and Salomaa,
1997a, page 176]). During every move, 𝑀 either pops or expands its pushdown.
More precisely, 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 so it replaces the top nonterminal with a string. 𝑀 accepts an input
string if it makes a sequence of moves so it completely reads the string, empties its
pushdown, and enters a final state.
Compared to 𝑀, a deep pushdown automaton 𝑑𝑒𝑒 𝑝 𝑀 works in a slightly general-
ized way. Indeed, 𝑑𝑒𝑒 𝑝 𝑀 functions exactly as 𝑀 except that it may make expansions
of depth 𝑚 so 𝑑𝑒𝑒 𝑝 𝑀 replaces the 𝑚th topmost pushdown symbol with a string, for
some 𝑚 ≥ 1. We demonstrate that the deep pushdown automata that make expan-
sions of depth 𝑚 or less, where 𝑚 ≥ 1, are equivalent to 𝑚-limited state grammars
(see Definition 8.2), so these automata accept a proper language subfamily of the
language family accepted by deep pushdown automata that make expansions of depth
𝑚 + 1 or less. The resulting infinite hierarchy of language families obtained in this
way occurs between the families of context-free and context-sensitive languages. For
8.1 Deep Pushdown Automata 209

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.

Definitions and Examples

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.

Definition 8.1 A deep pushdown automaton (DPDA) is a septuple



𝑀 = 𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹

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

𝑥 𝑒⊢ 𝑦

if 𝑥 = (𝑞, 𝑤, 𝑢 𝐴𝑧), 𝑦 = ( 𝑝, 𝑤, 𝑢𝑣𝑧), 𝑚𝑞 𝐴 → 𝑝𝑣 ∈ 𝑅, where 𝑞, 𝑝 ∈ 𝑄, 𝑤 ∈ Δ∗ ,


𝐴 ∈ Γ, 𝑢, 𝑣, 𝑧 ∈ Γ∗ , and occur(𝑢, Γ − Δ) = 𝑚 − 1. To express that 𝑀 makes 𝑥 𝑒 ⊢ 𝑦
according to 𝑚𝑞 𝐴 → 𝑝𝑣, we write

𝑥 𝑒 ⊢ 𝑦 [𝑚𝑞 𝐴 → 𝑝𝑣]

We say that 𝑚𝑞 𝐴 → 𝑝𝑣 is a rule of depth 𝑚; accordingly, 𝑥 𝑒 ⊢ 𝑦 [𝑚𝑞 𝐴 → 𝑝𝑣] is an


expansion of depth 𝑚. 𝑀 makes a move from 𝑥 to 𝑦, symbolically written as
210 8 Other Models of Discontinuous Computation

𝑥⊢𝑦

if 𝑀 makes either 𝑥 𝑒 ⊢ 𝑦 or 𝑥 𝑝 ⊢ 𝑦. If 𝑛 ∈ N is the minimal positive integer such


that each rule of 𝑀 is of depth 𝑛 or less, we say that 𝑀 is of depth 𝑛, symbolically
written as 𝑛 𝑀. In the standard manner, we extend 𝑝 ⊢, 𝑒 ⊢, and ⊢ to 𝑝 ⊢𝑚 , 𝑒 ⊢𝑚 , and
⊢𝑚 , respectively, for 𝑚 ≥ 0; then, based on 𝑝 ⊢𝑚 , 𝑒 ⊢𝑚 , and ⊢𝑚 , we define 𝑝 ⊢+ , 𝑝 ⊢∗ ,
+ ∗ + ∗
𝑒 ⊢ , 𝑒 ⊢ , ⊢ , and ⊢ .
Let 𝑀 be of depth 𝑛, for some 𝑛 ∈ N. We define the language accepted by 𝑛 𝑀,
𝐿(𝑛 𝑀), as

𝐿(𝑛 𝑀) = 𝑤 ∈ Δ∗ | (𝑠, 𝑤, 𝑆#) ⊢∗ ( 𝑓 , 𝜀, #) in 𝑛 𝑀 with 𝑓 ∈ 𝐹




In addition, we define the language that 𝑛 𝑀 accepts by empty pushdown, 𝐸 (𝑛 𝑀), as

𝐸 (𝑛 𝑀) = 𝑤 ∈ Δ∗ | (𝑠, 𝑤, 𝑆#) ⊢∗ (𝑞, 𝜀, #) in 𝑛 𝑀 with 𝑞 ∈ 𝑄




For every 𝑘 ≥ 1, DPDA 𝑘 denotes the family of languages defined by DPDAs of


depth 𝑖, where 1 ≤ 𝑖 ≤ 𝑘. Analogously, DEPDA 𝑘 denotes the family of languages
defined by DPDAs of depth 𝑖 by empty pushdown, where 1 ≤ 𝑖 ≤ 𝑘.
The following example gives a DPDA accepting a language from
 
DPDA2 ∩ DEPDA2 ∩ CS − CF

Example 8.1 Consider the DPDA



2𝑀 = {𝑠, 𝑞, 𝑝}, {𝑎, 𝑏, 𝑐}, { 𝐴, 𝑆, #}, 𝑅, 𝑠, 𝑆, { 𝑓 }

with 𝑅 containing the following five rules

1𝑠𝑆 → 𝑞 𝐴𝐴 1𝑞 𝐴 → 𝑓 𝑎𝑏 1𝑓 𝐴 → 𝑓𝑐
1𝑞 𝐴 → 𝑝𝑎 𝐴𝑏 2𝑝 𝐴 → 𝑞 𝐴𝑐

On 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑀 makes

(𝑠, 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑆#) 𝑒 ⊢ (𝑞, 𝑎𝑎𝑏𝑏𝑐𝑐, 𝐴𝐴#) [1𝑠𝑆 → 𝑞 𝐴𝐴]


𝑒⊢ ( 𝑝, 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑎 𝐴𝑏 𝐴#) [1𝑞 𝐴 → 𝑝𝑎 𝐴𝑏]
𝑝⊢ ( 𝑝, 𝑎𝑏𝑏𝑐𝑐, 𝐴𝑏 𝐴#)
𝑒⊢ (𝑞, 𝑎𝑏𝑏𝑐𝑐, 𝐴𝑏 𝐴𝑐#) [2𝑝 𝐴 → 𝑞 𝐴𝑐]
𝑒⊢ (𝑞, 𝑎𝑏𝑏𝑐𝑐, 𝑎𝑏𝑏 𝐴𝑐#) [1𝑞 𝐴 → 𝑓 𝑎𝑏]
𝑝⊢ ( 𝑓 , 𝑏𝑐𝑐, 𝑏 𝐴𝑐#)
𝑝⊢ ( 𝑓 , 𝑐𝑐, 𝐴𝑐#)
𝑒⊢ ( 𝑓 , 𝑐𝑐, 𝐴𝑐#) [1 𝑓 𝐴 → 𝑓 𝑐]
𝑝⊢ ( 𝑓 , 𝑐𝑐, 𝑐𝑐#)
𝑝⊢ ( 𝑓 , 𝑐, 𝑐#)
𝑝⊢ ( 𝑓 , 𝜀, #)
8.1 Deep Pushdown Automata 211

In brief, (𝑠, 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑆#) ⊢∗ ( 𝑓 , 𝜀, #). Observe that 𝐿(2 𝑀) = 𝐸 (2 𝑀) = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 |𝑛 ≥


1}, which belongs to CS − CF.

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.

Definition 8.2 A state grammar (see Kasai [1970]) is a quintuple



𝐺 = Σ, 𝑊, Δ, 𝑅, 𝑆

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

(𝑞, 𝑥 𝐴𝑦) →𝑛 ( 𝑝, 𝑥𝑣𝑦) [(𝑞, 𝐴) → ( 𝑝, 𝑣)]

Whenever there is no danger of confusion, we simplify (𝑞, 𝑥 𝐴𝑦) ⇒ ( 𝑝, 𝑥𝑣𝑦)


[(𝑞, 𝐴) → ( 𝑝, 𝑣)] and (𝑞, 𝑥 𝐴𝑦) ⇒𝑛 ( 𝑝, 𝑥𝑣𝑦) [(𝑞, 𝐴) → ( 𝑝, 𝑣)] to

(𝑞, 𝑥 𝐴𝑦) ⇒ ( 𝑝, 𝑥𝑣𝑦)


212 8 Other Models of Discontinuous Computation

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

𝐿 (𝐺) = 𝑤 ∈ Δ∗ | (𝑞, 𝑆) ⇒∗ ( 𝑝, 𝑤), 𝑞, 𝑝 ∈ 𝑊




Furthermore, for every 𝑛 ≥ 1, define

𝐿(𝐺, 𝑛) = 𝑤 ∈ Δ∗ | (𝑞, 𝑆) 𝑛 ⇒∗ ( 𝑝, 𝑤), 𝑞, 𝑝 ∈ 𝑊




A derivation of the form (𝑞, 𝑆) 𝑛 ⇒∗ ( 𝑝, 𝑤), where 𝑞, 𝑝 ∈ 𝑊 and 𝑤 ∈ Δ∗ , represents


a successful 𝑛-limited generation of 𝑤 in 𝐺.

Next, we illustrate the previous definition by an example.

Example 8.2 Consider the state grammar



𝐺 = {𝑆, 𝑋, 𝑌 , 𝑎, 𝑏}, {𝑝 0 , 𝑝 1 , 𝑝 2 , 𝑝 3 , 𝑝 4 }, {𝑎, 𝑏}, 𝑅, 𝑆

with the following nine rules in 𝑅

( 𝑝 0 , 𝑆) → ( 𝑝 0 , 𝑋𝑌 ) ( 𝑝 0 , 𝑋) → ( 𝑝 3 , 𝑎)
( 𝑝 0 , 𝑋) → ( 𝑝 1 , 𝑎𝑋) ( 𝑝 3 , 𝑌 ) → ( 𝑝 0 , 𝑎)
( 𝑝 1 , 𝑌 ) → ( 𝑝 0 , 𝑎𝑌 ) ( 𝑝 0 , 𝑋) → ( 𝑝 4 , 𝑏)
( 𝑝 0 , 𝑋) → ( 𝑝 2 , 𝑏𝑋) ( 𝑝 4 , 𝑌 ) → ( 𝑝 0 , 𝑏)
( 𝑝 2 , 𝑌 ) → ( 𝑝 0 , 𝑏𝑌 )

Observe that 𝐺 generates the non-context-free language

𝐿(𝐺) = 𝑤𝑤 | 𝑤 ∈ {𝑎, 𝑏}+




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].

Theorem 8.1 CF = ST1 ⊂ ST2 ⊂ · · · ⊂ ST∞ ⊂ ST = CS

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,

DEPDA𝑛 = DPDA𝑛 ⊂ DEPDA𝑛+1 = DPDA𝑛+1 ⊂ CS

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 𝐿 (𝐺, 𝑛) = 𝐿 (𝑛 𝑀).

Proof Let 𝐺 = (Σ, 𝑊, Δ, 𝑅, 𝑆) be a state grammar and let 𝑛 ≥ 1. Set 𝑁 = Σ − Δ.


Define the homomorphism 𝑓 over ({#} ∪ Σ) ∗ as 𝑓 ( 𝐴) = 𝐴, for every 𝐴 ∈ {#} ∪ 𝑁,
and 𝑓 (𝑎) = 𝜀, for every 𝑎 ∈ Δ. Introduce the DPDA of depth 𝑛
214 8 Other Models of Discontinuous Computation

𝑛𝑀 = 𝑄, Δ, {#} ∪ Σ, 𝑅, 𝑠, 𝑆, {$}

where
𝑄 = 𝑆, $ ∪ ⟨𝑝, 𝑢⟩ | 𝑝 ∈ 𝑊, 𝑢 ∈ 𝑁 ∗ {#} 𝑛 , |𝑢| ≤ 𝑛
 

and 𝑅 is constructed by performing the following four steps:


1. for each ( 𝑝, 𝑆) → (𝑞, 𝑥) ∈ 𝑅, 𝑝, 𝑞 ∈ 𝑊, 𝑥 ∈ Σ+ , add
1𝑠𝑆 → ⟨𝑝, 𝑆⟩𝑆 to 𝑅;
2. if ( 𝑝, 𝐴) → (𝑞, 𝑥) ∈ 𝑅, ⟨𝑝, 𝑢 𝐴𝑣⟩ ∈ 𝑄, 𝑝, 𝑞 ∈ 𝑊, 𝐴 ∈ 𝑁, 𝑥 ∈ Σ+ , 𝑢 ∈ 𝑁 ∗ ,
𝑣 ∈ 𝑁 ∗ {#}∗ , |𝑢 𝐴𝑣| = 𝑛, 𝑝 ∉ 𝐺 𝑠𝑡𝑎𝑡𝑒𝑠(𝑢), add
|𝑢 𝐴|⟨𝑝, 𝑢 𝐴𝑣⟩ 𝐴 → ⟨𝑞, prefix(𝑢 𝑓 (𝑥)𝑣, 𝑛, ⟩)𝑥 to 𝑅;
3. if 𝐴 ∈ 𝑁, 𝑝 ∈ 𝑊, 𝑢 ∈ 𝑁 ∗ , 𝑣 ∈ {#}∗ , |𝑢𝑣| ≤ 𝑛 − 1, 𝑝 ∉ 𝐺 𝑠𝑡𝑎𝑡𝑒𝑠(𝑢), add
|𝑢 𝐴|⟨𝑝, 𝑢𝑣⟩ 𝐴 → ⟨𝑝, 𝑢 𝐴𝑣⟩ 𝐴 and
|𝑢 𝐴|⟨𝑝, 𝑢𝑣⟩# → ⟨𝑝, 𝑢𝑣#⟩# to 𝑅;
4. for each 𝑞 ∈ 𝑊, add
1⟨𝑞, #𝑛 ⟩# → $# to 𝑅.
𝑛 𝑀 simulates 𝑛-limited derivations of 𝐺 so it always records the first 𝑛 nonter-
minals occurring in the current sentential form in its state (if there appear fewer
than 𝑛 nonterminals in the sentential form, it completes them to 𝑛 in the state by #𝑠
from behind). 𝑛 𝑀 simulates a derivation step in the pushdown and, simultaneously,
records the newly generated nonterminals in the state. When 𝐺 successfully com-
pletes the generation of a terminal string, 𝑛 𝑀 completes reading the string, empties
its pushdown, and enters the final state $.
We refer to Meduna [2006], to see that 𝐿(𝐺, 𝑛) = 𝐿(𝑛 𝑀) rigorously.
Consider the previous claim for 𝑏 = 𝑦 = 𝜀 to see that

(⟨𝑝, 𝑆#𝑛−1 ⟩, 𝑐, 𝑆#) ⊢∗ (⟨𝑞, prefix( 𝑓 (#), 𝑛, ⟩), 𝜀, #𝑛 ) in 𝑛 𝑀

implies that ( 𝑝, 𝑆) 𝑛 ⇒∗ (𝑞, 𝑐) in 𝐺. Let 𝑐 ∈ 𝐿(𝑛 𝑀). Then,

(𝑠, 𝑐, 𝑆#) ⊢∗ ($, 𝜀, #) in 𝑛 𝑀

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

Therefore, 𝑐 ∈ 𝐿 (𝑛 𝑀) implies that 𝑐 ∈ 𝐿(𝐺, 𝑛), so 𝐿(𝑛 𝑀) ⊆ 𝐿 (𝐺, 𝑛).


As 𝐿(𝑛 𝑀) ⊆ 𝐿(𝐺, 𝑛) and 𝐿(𝐺, 𝑛) ⊆ 𝐿(𝑛 𝑀), 𝐿(𝐺, 𝑛) = 𝐿(𝑛 𝑀). Thus,
Lemma 8.1 holds. □

Lemma 8.2 ([Meduna, 2006, Lemma 2]) For every 𝑛 ≥ 1 and every DPDA 𝑛 𝑀,
there exists a state grammar 𝐺 such that 𝐿 (𝐺, 𝑛) = 𝐿 (𝑛 𝑀).

Proof Let 𝑛 ≥ 1 and 𝑛 𝑀 = (𝑄, Δ, Σ, 𝑅, 𝑠, 𝑆, 𝐹) be a DPDA. Let 𝑍 and $ be two


new symbols that occur in no component of 𝑛 𝑀. Set 𝑁 = Σ − Δ. Introduce sets

𝐶 = ⟨𝑞, 𝑖, ⊲⟩ | 𝑞 ∈ 𝑄, 1 ≤ 𝑖 ≤ 𝑛 − 1

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:

1. add (𝑠, 𝑍) → (⟨𝑠, 1, ⊲⟩, ℎ(𝑆)) to 𝑅;


2. for each 𝑞 ∈ 𝑄, 𝐴 ∈ 𝑁, 1 ≤ 𝑖 ≤ 𝑛 − 1, 𝑥 ∈ Σ+ , add
a. (⟨𝑞, 𝑖, ⊲⟩, 𝐴) → (⟨𝑞, 𝑖 + 1, ⊲⟩, 𝑖 𝑔( 𝐴)) and
b. (⟨𝑞, 𝑖, ⊳⟩, 𝑖 𝑔( 𝐴)) → (⟨𝑝, 𝑖 − 1, ⊳⟩, 𝐴) to 𝑅;
3. if 𝑖 𝑝 𝐴 → 𝑞𝑥𝑌 ∈ 𝑅, for some 𝑝, 𝑞 ∈ 𝑄, 𝐴 ∈ 𝑁, 𝑥 ∈ Σ∗ , 𝑌 ∈ Σ, 𝑖 = 1, . . . , 𝑛, add
(⟨𝑝, 𝑖, ⊲⟩, 𝐴) → (⟨𝑞, 𝑖 − 1, ⊳⟩, 𝑥𝑌 ) and
(⟨𝑝, 𝑖, ⊲⟩, ℎ( 𝐴)) → (⟨𝑞, 𝑖 − 1, ⊳⟩, 𝑥ℎ(𝑌 )) to 𝑅;
4. for each 𝑞 ∈ 𝑄, 𝐴 ∈ 𝑁, add
(⟨𝑞, 0, ⊳⟩, 𝐴) → (⟨𝑞, 1, ⊲⟩, 𝐴) and
(⟨𝑞, 0, ⊳⟩, ℎ(𝑌 )) → (⟨𝑞, 1, ⊲⟩, ℎ(𝑌 )) to 𝑅;
5. for each 𝑞 ∈ 𝐹, 𝑎 ∈ Δ, add
(⟨𝑞, 0, ⊳⟩, ℎ(𝑎)) → ($, 𝑎) to 𝑅.
𝐺 simulates the application of 𝑖 𝑝 𝐴 → 𝑞𝑦 ∈ 𝑅 so it makes a left-to-right scan of
the sentential form, counting the occurrences of nonterminals until it reaches the 𝑖th
occurrence of a nonterminal. If this occurrence equals 𝐴, it replaces this 𝐴 with 𝑦
and returns to the beginning of the sentential form in order to analogously simulate a
move from 𝑞. Throughout the simulation of moves of 𝑛 𝑀 by 𝐺, the rightmost symbol
216 8 Other Models of Discontinuous Computation

of every sentential form is from 𝑊. 𝐺 completes the simulation of an acceptance of


a string 𝑥 by 𝑛 𝑀 so it uses a rule introduced in step (5) of the construction of 𝑅 to
change the rightmost symbol of 𝑥, ℎ(𝑎), to 𝑎 and, thereby, to generate 𝑥.
We next establish 𝐿(𝐺, 𝑛) = 𝐿 (𝑛 𝑀). To keep the rest of the proof as readable as
possible, we omit some details in what follows. The reader can easily fill them in.
As 𝐿(𝑛 𝑀) ⊆ 𝐿 (𝐺, 𝑛) and 𝐿 (𝐺, 𝑛) ⊆ 𝐿 (𝑛 𝑀), we have 𝐿(𝐺, 𝑛) = 𝐿(𝑛 𝑀), so this
lemma holds true. □

Theorem 8.2 For every 𝑛 ≥ 1 and for every language 𝐿, 𝐿 = 𝐿 (𝐺, 𝑛) for a state
grammar 𝐺 if and only if 𝐿 = 𝐿 (𝑛 𝑀) for a DPDA 𝑛 𝑀.

Proof This theorem follows from Lemmas 8.1 and 8.2. □

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 𝑛 𝑀.

The main result of this chapter follows next.

Corollary 8.1 For every 𝑛 ≥ 1,

DEPDA𝑛 = DPDA𝑛 ⊂ DPDA𝑛+1 = DEPDA𝑛+1

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.

Corollary 8.2 DPDA1 = DEPDA1 = CF

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. □

Corollary 8.3 For every 𝑛 ≥ 1, DPDA𝑛 = DEPDA𝑛 ⊂ CS.

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

Finally, we suggest two open problem areas concerning DPDAs.


8.1 Deep Pushdown Automata 217

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 𝑚𝑞 𝐴 → 𝑝𝑣 ∈ 𝑅,

card({𝑚𝑞 𝐴 → 𝑜𝑤 | 𝑚𝑞 𝐴 → 𝑜𝑤 ∈ 𝑅, 𝑜 ∈ 𝑄, 𝑤 ∈ Γ+ } − {𝑚𝑞 𝐴 → 𝑝𝑣}) = 0

As a weaker form of determinism, we obtain the following definition.


Definition 8.4 Let 𝑀 = (𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹) be a deep pushdown automaton. We
say that 𝑀 is deterministic with respect to the depth of its expansions if for every
𝑞∈𝑄
card({𝑚 | 𝑚𝑞 𝐴 → 𝑝𝑣 ∈ 𝑅, 𝐴 ∈ Γ, 𝑝 ∈ 𝑄, 𝑣 ∈ Γ+ }) ≤ 1
because at this point from the same state, all expansions that 𝑀 can make are of the
same depth.
To illustrate, consider, for instance, the DPDA 2 𝑀 from Example 8.1. This au-
tomaton is deterministic with respect to the depth of its expansions; however, it
does not satisfy the strict determinism. Notice that 𝑛 𝑀 constructed in the proof of
Lemma 8.1 is deterministic with respect to the depth of its expansions, so we obtain
this corollary.
Corollary 8.4 For every state grammar 𝐺 and for every 𝑛 ≥ 1, there exists a
DPDA 𝑛 𝑀 such that 𝐿 (𝐺, 𝑛) = 𝐿(𝑛 𝑀) and 𝑛 𝑀 is deterministic with respect to the
depth of its expansions.
Open Problem Can an analogical statement to Corollary 8.4 be established in terms
of the strict determinism? □

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

In essence, DPDAs represent language-accepting models based upon a generalized


concept of classical stacks. Apart from the standard topmost modification, this
generalized concept allows stacks to be modified under their top. As a result, these
automata can make expansions deeper in their pushdown lists as opposed to ordinary
pushdown automata, which can expand only the very pushdown top.
The present section narrows its attention to 𝑛-expandable deep pushdown au-
tomata, where 𝑛 is a positive integer. In essence, during any computation, their
pushdown lists contain #, which always appears as the pushdown bottom, and no
more than 𝑛 − 1 occurrences of other non-input symbols. This section demonstrates
how to reduce the number of their non-input pushdown symbols different from # to
one symbol, denoted by $, without affecting the power of these automata. Based on
this main result, we establish an infinite hierarchy of language families resulting from
these reduced versions of 𝑛-expandable deep pushdown automata. More precisely,
consider 𝑛-expandable deep pushdown automata with pushdown alphabets contain-
ing #, $, and input symbols. This section shows that (𝑛 + 1)-expandable versions
of these automata are stronger than their 𝑛-expandable versions, for every positive
integer 𝑛. In addition, it points out that these automata with # as their only non-input
symbol characterize the family of regular languages. In its conclusion, this section
formulates several open problem areas related to the subject for the future study.

Preliminaries and Definitions

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.

Let 𝑛, 𝑟 ∈ N. 𝑛 DPDA denotes the language family accepted by 𝑛-expandable


deep pushdown automata. 𝑛 DPDA𝑟 denotes the language family accepted by 𝑛-
expandable deep pushdown automata with # and no more than (𝑟 − 1) non-input
pushdown symbols.
A right-linear grammar is a quadruple 𝐺 = (𝑁, Δ, 𝑅, 𝑆), where 𝑁 is an alphabet
of nonterminals, Δ is an alphabet of terminals such that 𝑁 ∩ Δ = ∅, 𝑅 is a finite
subset of 𝑁 × Δ∗ (𝑁 ∪ {𝜖 }), and 𝑆 ∈ 𝑁. 𝑅 is called the set of rules in 𝐺; instead of
( 𝐴, 𝑥) ∈ 𝑅, we write 𝐴 → 𝑥. Define the language of 𝐺, 𝐿 (𝐺), as usual (see Meduna
[2000]).
REG denotes the regular language family. Recall that REG is characterized by
right-linear grammars (see Theorem 7.2.2. in Meduna [2000]).
8.1 Deep Pushdown Automata 219

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 #.

Proof Construction. Let 𝑛 ∈ N. Let

𝑀 = (𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹)

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

𝑀𝑅 = (𝑄 𝑅 , Δ, Δ ∪ {$, #}, 𝑅 𝑅 , 𝑠 𝑅 , $, 𝐹𝑅 )

by performing (i) through (iv), given next:


1. Add 𝑚⟨𝑞; 𝑢 𝐴𝑧⟩$ → ⟨𝑝; 𝑢 𝑓 (𝑣)𝑧⟩𝑔(𝑣) to 𝑅 𝑅 and add ⟨𝑞; 𝑢 𝐴𝑧⟩, ⟨𝑝; 𝑢 𝑓 (𝑣)𝑧⟩ to
𝑄 𝑅 if 𝑚𝑞 𝐴 → 𝑝𝑣 ∈ 𝑅, 𝑢, 𝑧 ∈ 𝑁 ∗ , |𝑢| = 𝑚 − 1, |𝑧| ≤ 𝑛 − 𝑚 − 1, |𝑢 𝑓 (𝑣)𝑧| < 𝑛,
𝑚 ∈ N, 𝑞, 𝑝 ∈ 𝑄, 𝐴 ∈ 𝑁, and 𝑣 ∈ (Γ − {#}) + ;
2. Add 𝑚⟨𝑞; 𝑢⟩# → ⟨𝑝; 𝑢 𝑓 (𝑣)⟩𝑔(𝑣)# to 𝑅 𝑅 and add ⟨𝑞; 𝑢⟩, ⟨𝑝; 𝑢 𝑓 (𝑣)⟩ to 𝑄 𝑅 if
𝑚𝑞# → 𝑝𝑣# ∈ 𝑅, 𝑢 ∈ 𝑁 ∗ , |𝑢| = 𝑚 − 1, |𝑢 𝑓 (𝑣)| < 𝑛, 𝑚 ∈ N, 𝑞, 𝑝 ∈ 𝑄, and
𝑣 ∈ (Γ − {#}) ∗ ;
3. Set 𝑠 𝑅 = ⟨𝑠; 𝑆⟩;
4. Add all ⟨𝑝; 𝑢⟩ to 𝐹𝑅 , where 𝑝 ∈ 𝐹, 𝑢 ∈ 𝑁 ∗ , 𝑢 < 𝑛. □
Later in this proof, we demonstrate that 𝐿(𝑀) = 𝐿 (𝑀𝑅 ).
Basic Idea. States in 𝑄 𝑅 include not only the states corresponding to the states in
𝑄 but also strings of non-input symbols. Whenever 𝑀 pushes a non-input symbol
onto the pushdown, 𝑀𝑅 records this information within its current state and pushes
$ onto the pushdown instead.
By [Leupold and Meduna, 2010, Lemma 3.1], any 𝑛-expandable deep pushdown
automaton 𝑀 can accept every 𝑤 ∈ 𝐿 (𝑀) so all expansions precede all pops during
the accepting process. Without any loss of generality, we assume that 𝑀 and 𝑀𝑅
work in this way in what follows, too.
To establish 𝐿 (𝑀) = 𝐿 (𝑀𝑅 ), see the proof of in [Meduna, 2006, Claims 1 and
2].

The next example illustrates the construction described in the previous proof.
Example. Take this three-expandable DPDA

𝑀 = ({𝑠, 𝑞, 𝑝}, {𝑎, 𝑏, 𝑐}, {𝑎, 𝑏, 𝑐, 𝐴, 𝑆, #}, 𝑅, 𝑠, 𝑆, { 𝑓 }),


220 8 Other Models of Discontinuous Computation

with the set of rules defined as

𝑅 = {1𝑠𝑆 → 𝑞 𝐴𝐴,
1𝑞 𝐴 → 𝑓 𝑎𝑏,
1 𝑓 𝐴 → 𝑓 𝑐,
1𝑞 𝐴 → 𝑝𝑎 𝐴𝑏,
2𝑝 𝐴 → 𝑞 𝐴𝑐}

By the construction given in the proof of Lemma 8.3, we construct 𝑀𝑅 = (𝑄 𝑅 ,


{𝑎, 𝑏, 𝑐}, {𝑎, 𝑏, 𝑐, $, #}, 𝑅 𝑅 , ⟨𝑠; 𝑆⟩, $, {⟨ 𝑓 ; 𝐴⟩, ⟨ 𝑓 ; 𝜖⟩}), where 𝑄 𝑅 = {⟨𝑠; 𝑆⟩, ⟨𝑞; 𝐴𝐴⟩,
⟨ 𝑓 ; 𝐴⟩, ⟨ 𝑓 ; 𝜖⟩, ⟨𝑝; 𝐴𝐴⟩} and

𝑅 𝑅 = {1⟨𝑠; 𝑆⟩$ → ⟨𝑞; 𝐴𝐴⟩$$,


1⟨𝑞; 𝐴𝐴⟩$ → ⟨ 𝑓 ; 𝐴⟩𝑎𝑏,
1⟨ 𝑓 ; 𝐴⟩$ → ⟨ 𝑓 ; 𝜖⟩𝑐,
1⟨𝑞; 𝐴𝐴⟩$ → ⟨𝑝; 𝐴𝐴⟩𝑎$𝑏,
2⟨𝑝; 𝐴𝐴⟩$ → ⟨𝑞; 𝐴𝐴⟩$𝑐}

For instance, 𝑀𝑅 makes

(⟨𝑠; 𝑆⟩, 𝑎𝑎𝑏𝑏𝑐𝑐, $#) 𝑒 ⊢ (⟨𝑞; 𝐴𝐴⟩, 𝑎𝑎𝑏𝑏𝑐𝑐, $$#) [1⟨𝑠; 𝑆⟩$ → ⟨𝑞; 𝐴𝐴⟩$$]
𝑒⊢ (⟨𝑝; 𝐴𝐴⟩, 𝑎𝑎𝑏𝑏𝑐𝑐, 𝑎$𝑏$#) [1⟨𝑞; 𝐴𝐴⟩$ → ⟨𝑝; 𝐴𝐴⟩𝑎$𝑏]
𝑝⊢ (⟨𝑝; 𝐴𝐴⟩, 𝑎𝑏𝑏𝑐𝑐, $𝑏$#)
𝑒⊢ (⟨𝑞; 𝐴𝐴⟩, 𝑎𝑏𝑏𝑐𝑐, $𝑏$𝑐#) [2⟨𝑝; 𝐴𝐴⟩$ → ⟨𝑞; 𝐴𝐴⟩$𝑐]
𝑒 ⊢ (⟨ 𝑓 ; 𝐴⟩, 𝑎𝑏𝑏𝑐𝑐, 𝑎𝑏𝑏$𝑐#) [1⟨𝑞; 𝐴𝐴⟩$ → ⟨ 𝑓 ; 𝐴⟩𝑎𝑏]
𝑝⊢ (⟨ 𝑓 ; 𝐴⟩, 𝑐𝑐, $𝑐#)
𝑒⊢ (⟨ 𝑓 ; 𝜖⟩, 𝑐𝑐, 𝑐𝑐#) [1⟨ 𝑓 ; 𝐴⟩$ → ⟨ 𝑓 ; 𝜖⟩𝑐]
𝑝⊢ (⟨ 𝑓 ; 𝜖⟩, 𝜖, #)

Theorem 8.4 For all 𝑛 ≥ 1, 𝑛 DPDA = 𝑛 DPDA2 .

Proof This theorem follows from Lemma 8.3. □

Corollary 8.5 For all 𝑛 ≥ 1, 𝑛 DPDA2 ⊂ 𝑛 + 1DPDA2 .

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.

Lemma 8.4 Let 𝑀 = (𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹) be a 𝐷𝑃𝐷 𝐴 with Γ − Δ = {#}. Then, there


is a right-linear grammar 𝐺 such that 𝐿 (𝐺) = 𝐿(𝑀).
8.2 Computation over Unordered Strings 221

Proof Let 𝑀 = (𝑄, Δ, Γ, 𝑅, 𝑠, 𝑆, 𝐹) with Γ − Δ = {#}. Thus, every rule in 𝑅 is of


the form 1𝑞# → 𝑝𝑥#, where 𝑞, 𝑝 ∈ 𝑄, 𝑥 ∈ Δ∗ . Next, we construct a right-linear
grammar 𝐺 = (𝑄, Δ, 𝑅, 𝑠) so 𝐿(𝑀) = 𝐿 (𝐺). We construct 𝑅 as follows:
1. For every 1𝑞# → 𝑝𝑥# ∈ 𝑅, where 𝑝, 𝑞 ∈ 𝑄, 𝑥 ∈ Δ∗ , add 𝑞 → 𝑥 𝑝 to 𝑅;
2. For every 𝑓 ∈ 𝐹, add 𝑓 → 𝜖 to 𝑅.
A rigorous proof that 𝐿(𝑀) = 𝐿(𝐺) is left to the reader. □

Theorem 8.5 REG = 1 DPDA1 = 𝑛 DPDA1 , for any 𝑛 ≥ 1.

Proof Let 𝑛 ≥ 1. REG ⊆ 1 DPDA1 = 𝑛 DPDA1 is clear. Recall that right-linear


grammars characterize REG, so 𝑛 DPDA1 ⊆ REG follows from Lemma 8.4. Thus,
REG = 𝑛 DPDA1 . □

Corollary 8.6 REG = 1 DPDA1 = 𝑛 DPDA1 ⊂ 𝑛 DPDA2 , for all 𝑛 ≥ 2.

Proof Let 𝑛 ≥ 1. As is obvious, 1 DPDA1 = 𝑛 DPDA1 ⊆ 𝑛 DPDA2 . Observe that

{𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 1} ∈ 𝑛 DPDA2 − 𝑛 DPDA1

Therefore, Corollary 8.6 holds. □

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.

8.2 Computation over Unordered Strings

The order of symbols in a string is a fundamental part of the string’s identity—𝑎𝑏


and 𝑏𝑎 are not the same string despite containing exactly the same symbols exactly
the same number of times. This is of course desirable, as a lot of information can
be encoded using this aspect of strings, and it is an important consideration for
222 8 Other Models of Discontinuous Computation

most computational models. However, a somewhat relaxed approach to the order of


symbols, at least on a non-local level, is at the very core of what jumping models
are, and some of them can even be said to ignore it completely.
As an example, consider a jumping finite automaton 𝑀 (see Definition 3.2) such
that its input alphabet contains both symbols 𝑎, 𝑏. No matter what its rules are, 𝑀 is
unable to distinguish between 𝑎𝑏 and 𝑏𝑎—either it accepts both of them, or neither
of them. In fact, given any string 𝑤 over the input alphabet of 𝑀, 𝑀 accepts 𝑤 if
and only if 𝑀 accepts all permutations of 𝑤 (see Theorem 3.6). This suggests an
interesting mathematical possibility—instead of adding an extra jumping mechanic
to traditional computational models designed to work with strings and thus also with
their order, we can look for some other mathematical concept to serve as unordered
strings as a basis for an entirely new type of computational model.

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

1 Some definitions also allow infinite multiplicities.


8.2 Computation over Unordered Strings 223

𝑎 ∈ Δ 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:
∑︁
|𝜎| = 𝜎(𝑎).
𝑎∈Σ

For any two bags 𝜎, 𝜏 ∈ ∗ Σ,


we say that 𝜎 is included in 𝜏, denoted by 𝜎 ⊆ 𝜏, if
and only if 𝜎(𝑎) ≤ 𝜏(𝑎) holds for all 𝑎 ∈ Σ. We can also define the sum, difference,
union and intersection of 𝜎 and 𝜏, denoted by 𝜎 + 𝜏, 𝜎 − 𝜏, 𝜎 ∪ 𝜏 and 𝜎 ∩ 𝜏,
respectively, as operations on bags such that the following equalities hold for all
𝑎 ∈ Σ (note, however, that 𝜎 − 𝜏 is defined only if 𝜎 ⊆ 𝜏):

(𝜎 + 𝜏) (𝑎) = 𝜎(𝑎) + 𝜏(𝑎)


(𝜎 − 𝜏) (𝑎) = 𝜎(𝑎) − 𝜏(𝑎)
(𝜎 ∪ 𝜏) (𝑎) = max{𝜎(𝑎), 𝜏(𝑎)}
(𝜎 ∩ 𝜏) (𝑎) = min{𝜎(𝑎), 𝜏(𝑎)}
The sum is also called the concatenation in some contexts, denoted by 𝜎𝜏 rather
than 𝜎 + 𝜏. We will, however, avoid this notation, as it can lead to confusion between
bags and strings in some contexts. This operation also serves as a basis for the 𝑖th
power of a bag for any 𝑖 ∈ 0 N, defined for 𝜎 ∈ ∗ Σ recursively as 𝜎 0 = 𝜀 for 𝑖 = 0
and 𝜎 𝑖 = 𝜎 + 𝜎 𝑖−1 otherwise.
To give some examples, 𝑎 2 𝑏 + 𝑎𝑏𝑐2 = 𝑎 3 𝑏 2 𝑐2 , 𝑎 2 𝑏 ∪ 𝑎𝑏𝑐2 = 𝑎 2 𝑏 2 𝑐, 𝑎 2 𝑏 ∩ 𝑎𝑏𝑐2 =
𝑎𝑏, and 𝑎 2 𝑏 − 𝑎𝑏𝑐2 is undefined, as is 𝑎𝑏𝑐2 − 𝑎 2 𝑏, because these two bags are
incomparable with respect to multiset inclusion. However, 𝑎 2 𝑏 − 𝑎𝑏 = 𝑎. Finally,
(𝑎 2 𝑏) 3 = 𝑎 2 𝑏 + 𝑎 2 𝑏 + 𝑎 2 𝑏 = 𝑎 6 𝑏 3 . It is left as an exercise to the reader to prove that
if 𝜎, 𝜏 ∈ ∗ Σ, then also 𝜎 + 𝜏, 𝜎 ∪ 𝜏, 𝜎 ∩ 𝜏 ∈ ∗ Σ, and furthermore, if also 𝜎 ⊆ 𝜏, then
also 𝜎 − 𝜏 ∈ ∗ Σ.
224 8 Other Models of Discontinuous Computation

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
𝜎 ∈ ∗ Σ:

ℎΣ (𝜎) = (𝜎(𝑎 1 ), . . . , 𝜎(𝑎 𝑘 )).


It is easy to see that ℎΣ is a bijection, supporting the claim about the repre-
sentability of bags as vectors of integers. Note that by composing this function with
the Parikh mapping, we can also use it to directly map strings to vectors of numbers
of occurences of each symbol. Such an object is then closer to the original notion of
a Parikh vector:

ℎΣ (ΨΣ (𝑤)) = (occur(𝑤, 𝑎 1 ), . . . , occur(𝑤, 𝑎 𝑘 )).


The mapping Ψ is surjective and non-injective, pointing to the rather obvious
fact that in general, multiple strings are mapped to the same bag. Therefore, when
viewing the structures of Σ∗ and ∗ Σ through the lens of this mapping, it appears
as if bags are in some sense less numerous than strings. More precisely, assuming
𝑘 = card(Σ) and given a size limit 𝑛 ∈ 0 N, there will be more strings of length 𝑛
over Σ than there will be bags of cardinality 𝑛 over Σ, as long as 𝑘 ≥ 2 and 𝑛 ≥ 2
(and in the instances that 𝑘 = 1 or 𝑛 ≤ 1, the number of strings and bags of given
size over Σ is equal). To give precise figures, there are 𝑘 𝑛 different strings of length 𝑛
over an alphabet with 𝑘 distinct symbols, whereas the number   of bags of cardinality
𝑛 over said alphabet is given by the multiset coefficient 𝑛𝑘 , read “𝑘 multichoose
𝑛”, defined as follows based on the binomial coefficient:
   
𝑘 𝑛+𝑘 −1 (𝑛 + 𝑘 − 1)!
= = .
𝑛 𝑛 𝑛!(𝑘 − 1)!
8.2 Computation over Unordered Strings 225

Note that arriving at this number corresponds to the combinatorial problem of


counting so-called 𝑛-combinations with repetition from a set of 𝑘 elements. In such
contexts, the symbols 𝑛 and 𝑘 are usually interchanged.
It would be a mistake, however, to concede that bags are somewhat inferior
to strings, that they somehow hold less information. Even though we arrived at
bags while searching for some notion of unordered strings, they are nevertheless a
fundamentally different way of using symbols to represent data. Thus, comparing
strings and bags “of the same size” is not a fair comparison, because the length of
a string and the cardinality of a bag are simply not the same thing—pragmatically,
we can in general encode bags of cardinality 𝑛 much more efficiently than strings of
length 𝑛 due to fundamental differences in their nature. Furthermore, due to both Σ∗
and ∗ Σ being countably infinite (assuming a finite, nonempty Σ), bags can, at least
in principle, encode information just as well as strings can.
An interesting interpretation of bags arises if you consider their representation as
𝑘-tuples of natural numbers—in this sense, a bag over an alphabet can be thought
of as a fixed-length string over 0 N. Thus, analogously to how strings over a given
alphabet can have arbitrary length but select their symbols from a limited, finite set,
bags over the same alphabet can be thought of as strings of limited length which
select from arbitrarily many possible symbols to put at each position.
Let us now define more complex notions built on bags with the ultimate goal of
exploring multiset computation.

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

𝑝REG ⊆ 𝑝LIN ⊆ 𝑝CF ⊆ 𝑝CS ⊆ 𝑝RE,

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.

Theorem 8.6 Parikh’s Theorem

𝑝CF = 𝑝REG = 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 , . . . , 𝑠 𝑚 ∈ Δ∗ be strings such that Ψ(𝑠𝑖 ) = 𝜎𝑖 for 1 ≤ 𝑖 ≤ 𝑚. Also, let 𝑆 ′ ∉ Δ be a


new symbol. Define a new set of right-linear production rules, 𝑃′ , as follows:

𝑃′ = {𝑆 ′ → 𝑠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.

Definition 8.6 A multiset grammar (also called a commutative grammar) is a quadru-


ple 𝐺 = (Σ, Δ, 𝑅, 𝐴), where
• Σ is a nonempty total alphabet called the total alphabet;
• Δ ⊆ Σ is the set of terminals;
• 𝑅 ⊆ ( ∗ Σ − ∗ Δ) × ∗ Σ is a finite set of multiset rewriting rules;
• 𝐴 ⊆ ∗ Σ is a finite macroset called the start macroset; elements of 𝐴 are called
axioms.
Rewriting rules (𝜇1 , 𝜇2 ) ∈ 𝑅 are written as 𝜇1 → 𝜇2 . Let 𝜎, 𝜏 ∈ ∗ Σ and let
𝜇1 → 𝜇2 ∈ 𝑅. We say that 𝜎 directly derives 𝜏 in 𝐺 using 𝜇1 → 𝜇2 , written as

𝜎 ⇒𝐺 𝜏 [𝜇1 → 𝜇2 ]

if and only if 𝜇1 ⊆ 𝜎 and 𝜏 = 𝜎 − 𝜇1 + 𝜇2 . The subscript 𝐺 is omitted whenever


not necessary, meaning that we usually always write ⇒ instead of ⇒𝐺 . We also
define ⇒ 𝑘 for every non-negative integer 𝑘, ⇒∗ and ⇒+ similarly as for traditional
grammars. The macroset generated by 𝐺 is denoted by 𝑀 (𝐺) and defined as

𝑀 (𝐺) = {𝜎 ∈ ∗ Δ | 𝛼 ⇒∗ 𝜎 for some 𝛼 ∈ 𝐴}.

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

this, we need to introduce yet another class of multiset grammars—matrix multiset


grammars.

Definition 8.7 A matrix multiset grammar with appearance checking is a pair 𝐻 =


(𝐺, 𝑀, 𝑊), where
• 𝐺 = (Σ, Δ, 𝑅, 𝐴) is a context-free multiset grammar called the core grammar,
• 𝑀 ⊆ 𝑅 + is a finite language over 𝑅 called the set of matrices,
• 𝑊 ⊆ Σ − Δ is the appearance checking set.
If 𝑊 = ∅, 𝐻 is simply called a matrix multiset grammar (without appearance
checking). Furthermore, 𝐻 is propagating if none of its production rules has 𝜀 as
its right-hand side. Let 𝜎, 𝜏 ∈ ∗ Σ and let 𝑚 ∈ 𝑀. Note that 𝑚 = 𝑟 1 · · · 𝑟 𝑘 for some
𝑘 ≥ 1 and 𝑟 𝑖 ∈ 𝑅 for 1 ≤ 𝑖 ≤ 𝑘. We say that 𝜎 directly derives 𝜏 in 𝐻 using 𝑚,
written as
𝜎 ⇒ 𝐻 𝜏 [𝑚]
if and only if there exist bags 𝜒0 , . . . , 𝜒𝑘 ∈ ∗ Σ such that 𝜒0 = 𝜎, 𝜒𝑘 = 𝜏, and for
each 1 ≤ 𝑖 ≤ 𝑘 one of the following holds:
(a) 𝜒𝑖−1 ⇒𝐺 𝜒𝑖 [𝑟 𝑖 ],
(b) 𝜒𝑖−1 ( 𝐴) = 0, 𝐴 ∈ 𝑊 and 𝜒𝑖−1 = 𝜒𝑖 , where 𝐴 is the left-hand side of 𝑟 𝑖 .
Again, we omit the subscript 𝐻 unless necessary. We also define ⇒ 𝑘 for every
non-negative integer 𝑘, ⇒∗ and ⇒+ similarly as for traditional grammars. The
macroset generated by 𝐻 is denoted by 𝑀 (𝐻) and defined as

𝑀 (𝐺) = {𝜎 ∈ ∗ Δ | 𝛼 ⇒∗𝐻 𝜎 for some 𝛼 ∈ 𝐴}.

These grammars are introduced as multiset counterparts of matrix grammars, a


well-established regulated language model, the strongest of which achieve Turing
power. Unlike traditional Chomsky types of grammars, however, they have the prop-
erty that given any matrix grammar 𝐺, it is the case that Ψ(𝐿(𝐺)) = 𝑀 (Φ(𝐺)).
This is easily demonstrated by analyzing how these models work—all individual
rewritings are context-free, and the control mechanisms beyond remain unchanged
between the string-based and the multiset-based models.
The families of languages generated by (propagating) matrix multiset grammars
and (propagating) matrix multiset grammars with appearance checking are denoted
by 𝑚M− 𝜀 , 𝑚M, 𝑚M𝑎𝑐 − 𝜀 , and 𝑚M , respectively.
𝑎𝑐
The main reason we are interested in matrix multiset grammars in this section
is their relation to monotone and phrase-structure multiset grammars. These have
the same generative power as the propagating and non-propagating variant of matrix
multiset grammars without appearance checking, respectively, as formalized in the
following two theorems.

Theorem 8.8 𝑚M− 𝜀 = 𝑚MON,


8.2 Computation over Unordered Strings 231

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. □

Theorem 8.9 𝑚M = 𝑚PS.

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

𝑚M𝑎𝑐 = 𝑝M𝑎𝑐 = 𝑝RE

𝑝CS

𝑚PS = 𝑝M = 𝑚M

− 𝜀 = 𝑚M − 𝜀
𝑝M𝑎𝑐 𝑎𝑐

𝑚MON = 𝑝M− 𝜀 = 𝑚M− 𝜀

𝑚CF = 𝑝CF = SLin

Fig. 8.1 Language families resulting from multiset grammars.

𝑏, 𝑌 𝐴 → 𝑌 𝑎, 𝑌 → 𝑋 𝑏}. The macroset generated by this grammar is 𝑀 (𝐺 2 ) = {𝜇 ∈


∗ {𝑎, 𝑏} | 1 ≤ 𝜇(𝑎) ≤ 2 𝜇 (𝑏) −1 }, which is not a semilinear set.
The inclusion 𝑚MON ⊂ 𝑚PS can be proven using complexity arguments—it
follows easily from the facts that 𝑚MON ⊆ PSPACE ⊂ EXPSPACE and that the
uniform word problem for 𝑚PS is EXPSPACE-hard, where EXPSPACE is the set
of all decision problems solvable by a deterministic Turing machine in exponential
space (see Sipser [2006]).
We will prove the remaining proper inclusions using the following theorem, which
we include without proof (which can be found in Hauschildt and Jantzen [1994]).
Let the language family generated by classical matrix grammars be denoted by M.

Theorem 8.10 All unary languages in M are regular.


𝑛
Notice that the language 𝐿 = {𝑎 2 |𝑛 ≥ 0} is not context-free and its corresponding
macroset 𝑀 = Ψ(𝐿) is not semilinear. It thus follows from the previous theorem
that 𝐿 ∉ M. Furthermore, as 𝐿 is unary, there is no other language 𝐿 ′ such that
Ψ(𝐿 ′ ) = 𝑀 and 𝐿 ′ ≠ 𝐿. As a consequence, 𝑀 ∉ 𝑝M = 𝑚PS. However, because 𝐿
can be generated by a propagating matrix grammar with appearance checking, it is
also the case that 𝑀 ∈ 𝑝M𝑎𝑐− 𝜀 = 𝑚M − 𝜀 , thus proving the final two proper inclusions,
𝑎𝑐
𝑚MON ⊂ 𝑚M𝑎𝑐 − 𝜀 and 𝑚PS ⊂ 𝑚M
𝑎𝑐 = 𝑝RE.

Corollary 8.7 The inclusions shown in Figure 8.1 hold.


8.2 Computation over Unordered Strings 233

𝑎 𝑝 𝑏 𝑞
𝑠

Fig. 8.2 𝐴1 .

Multiset Automata

In the previous section we examined multiset-based counterparts of traditional,


string-based grammars. It is a natural next step to do the same for traditional automata.
Therefore, let us introduce the first of these models.

Definition 8.8 A multiset finite automaton (MFA) is a quintuple 𝐴 = (𝑄, Δ, 𝑓 , 𝑠, 𝐹),


where
• 𝑄 is a finite set of states,
• Δ is the input alphabet,
• 𝑓 : 𝑄 × Δ → power(𝑄) is the transition mapping,
• 𝑠 ∈ 𝑄 is the initial state, and
• 𝐹 ⊆ 𝑄 is the set of final states.
A configuration of 𝐴 is a pair (𝑞, 𝜏) ∈ 𝑄 × ∗ Δ, and we define the relation ⊢ 𝐴 on
the set of all configurations as follows. For any 𝑝, 𝑞 ∈ 𝑄 and 𝜏, 𝜌 ∈ ∗ Δ,

( 𝑝, 𝜏) ⊢ 𝐴 (𝑞, 𝜌)

if and only if there is a symbol 𝑎 ∈ Δ such that 𝜏(𝑎) ≥ 1, 𝑞 ∈ 𝑓 ( 𝑝, 𝑎) and 𝜌 = 𝜏 − 𝑎.


We also define ⊢ 𝑘𝐴 for every non-negative integer 𝑘, ⊢∗𝐴 and ⊢+𝐴 similarly as for
traditional automata, and we omit the subscript whenever it is not necessary. The
macroset accepted by 𝐴 is denoted by 𝑀 ( 𝐴) and defined as

𝑀 ( 𝐴) = {𝜏 ∈ ∗ Δ | (𝑠, 𝜏) ⊢∗𝑀 ( 𝑓 , 𝜀) for some 𝑓 ∈ 𝐹}.

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.

Definition 8.9 A multiset finite automaton with detection (MFAD) is a quintuple


𝐴 = (𝑄, Δ, 𝑓 , 𝑠, 𝐹), where
• 𝑄, Δ, 𝑠 and 𝐹 are defined exactly as in Definition 8.8,
• Δ̄ = { 𝑎¯ | 𝑎 ∈ Δ} is a new alphabet consisting of barred copies of symbols of Δ,
Δ ∩ Δ̄ = ∅,
• 𝑓 : 𝑄 × (Δ ∪ Δ̄) → power(𝑄) is the transition mapping.
For convenience, barring a barred symbol turns it into its unbarred version, that
is, 𝑎¯ = 𝑎. For any 𝑝, 𝑞 ∈ 𝑄 and 𝜏, 𝜌 ∈ ∗ Δ,

( 𝑝, 𝜏) ⊢ 𝐴 (𝑞, 𝜌)

if and only if one of the following conditions holds:


(a) there is a symbol 𝑎 ∈ Δ such that 𝑞 ∈ 𝑓 ( 𝑝, 𝑎) and 𝜌 = 𝜏 − 𝑎,
(b) there is a symbol 𝑎 ∈ Δ such that 𝑞 ∈ 𝑓 ( 𝑝, 𝑎),
¯ 𝜏(𝑎) = 0 and 𝜌 = 𝜏.

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.

Definition 8.10 A multiset linear bounded automaton (MLBA) is a sextuple 𝑁 =


(𝑄, Δ, 𝑈, 𝑓 , 𝑠, 𝐹), where
• 𝑄 is a finite set of states,
• Δ is the input alphabet,
• 𝑈 is the bag alphabet, Δ ⊆ 𝑈,
• 𝑓 : 𝑄 × 𝑈 → power(𝑄 × (𝑈 ∪ {𝜀})) is the transition mapping,
• 𝑠 ∈ 𝑄 is the initial state, and
• 𝐹 ⊆ 𝑄 is the set of final states.
A configuration of 𝑁 is a pair (𝑞, 𝜏) ∈ 𝑄 × ∗𝑈, and we define the relation ⊢ 𝑁 on
the set of all configurations as follows. For any 𝑝, 𝑞 ∈ 𝑄 and 𝜏, 𝜌 ∈ ∗𝑈,

( 𝑝, 𝜏) ⊢ 𝑁 (𝑞, 𝜌)

if and only if there are 𝑎 ∈ 𝑈, 𝑏 ∈ 𝑈 ∪ {𝜀} such that 𝜏(𝑎) ≥ 1, (𝑞, 𝑏) ∈ 𝑓 ( 𝑝, 𝑎)


and 𝜌 = 𝜏 − 𝑎 + 𝑏. We also define ⊢ 𝑘𝑁 for every non-negative integer 𝑘, ⊢∗𝑁 and ⊢+𝑁
similarly as for traditional automata, and we omit the subscript whenever it is not
necessary. The macroset accepted by 𝑁 is denoted by 𝑀 (𝑁) and defined as

𝑀 (𝑁) = {𝜏 ∈ ∗ Δ | (𝑠, 𝜏) ⊢∗𝑁 ( 𝑓 , 𝜀) for some 𝑓 ∈ 𝐹}.

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

𝑁1 = ({𝑞 0 , 𝑞 1 , 𝑞 𝑟 , 𝑝 0 , 𝑝 1 , 𝑝 𝑟 , 𝑞 𝑒 , 𝑞 𝑓 }, {𝑎}, {𝑎, 𝑏}, 𝑓 𝑁1 , 𝑞 0 , {𝑞 𝑓 })

where the transition mapping, 𝑓 𝑁1 , is described in Figure 8.2—an arrow from 𝑝 to


𝑞 labeled “𝑥/𝑦” means that (𝑞, 𝑦) ∈ 𝑓 𝑁1 ( 𝑝, 𝑥), and 𝑓 𝑁1 is fully described by these
arrows. The automaton starts its computation with some number of 𝑎s in its bag,
and, moving between the pair of states 𝑞 0 and 𝑞 1 , rewrites it to half as many 𝑏s,
passing control to the pair of states 𝑝 0 and 𝑝 1 , where it rewrites these 𝑏s to half as
many 𝑎s, and so on, until an odd number of symbols is detected by transitioning
into one of the states 𝑞 𝑟 , 𝑝 𝑟 . The automaton then decides whether or not to accept
the input by determining whether the odd number that has just been detected was 1
or not (based on whether some new symbols of the other kind had been generated
before determining the number to be odd). It is therefore not hard to see that the
𝑛
macroset accepted by this automaton is 𝑀 (𝑁1 ) = {𝑎 2 | 𝑛 ≥ 0}. Notice also that 𝑁1
is deterministic (and thus a DMLBAD).
By MLBA, MLBAD, DMLBA, and DMLBAD, we denote the classes of
macrosets generated by MLBAs, MLBADs, DMLBAs, and DMLBADs, respec-
tively. Just like with MFA, it again follows from definition that DMLBA ⊆ MLBA ⊆
MLBAD and DMLBA ⊆ DMLBAD ⊆ MLBAD. However, this time, detection ac-
tually increases the accepting power of the model. Indeed, it is proven in Csuhaj-Varjú
et al. [2001] that MLBA = 𝑚MON, and thus by Theorem 8.10 and 𝑚MON ⊆ 𝑚M,
all unary languages in MLBA are semilinear. However, the MLBAD 𝑁1 described
8.2 Computation over Unordered Strings 237

𝑎/𝜀 ¯
𝑎/𝜀
𝑞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

DMLBA ⊂ MLBA = 𝑚MON ⊂ MLBAD

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.

Definition 8.11 A multiset Turing machine (MTM) is a sextuple 𝑁 = (𝑄, Δ, 𝑈, 𝑓 ,


𝑠, 𝐹), where
• 𝑄 is a finite set of states,
• Δ is the input alphabet,
238 8 Other Models of Discontinuous Computation

• 𝑈 is the bag alphabet, Δ ⊆ 𝑈,


• 𝑓 : 𝑄 × (𝑈 ∪ {𝜀}) → power(𝑄 × (𝑈 ∪ {𝜀})) is the transition mapping,
• 𝑠 ∈ 𝑄 is the initial state, and
• 𝐹 ⊆ 𝑄 is the set of final states.
A configuration of 𝑁 is a pair (𝑞, 𝜏) ∈ 𝑄 × ∗𝑈, and we define the relation ⊢ 𝑁 on
the set of all configurations as follows. For any 𝑝, 𝑞 ∈ 𝑄 and 𝜏, 𝜌 ∈ ∗𝑈,

( 𝑝, 𝜏) ⊢ 𝑁 (𝑞, 𝜌)

if and only if there are 𝑎, 𝑏 ∈ 𝑈 ∪ {𝜀} such that (𝑞, 𝑏) ∈ 𝑓 ( 𝑝, 𝑎) and 𝜌 = 𝜏 − 𝑎 + 𝑏.


We also define ⊢ 𝑘𝑁 for every non-negative integer 𝑘, ⊢∗𝑁 and ⊢+𝑁 similarly as for
traditional automata, and we omit the subscript whenever it is not necessary. The
macroset accepted by 𝑁 is denoted by 𝑀 (𝑁) and defined as

𝑀 (𝑁) = {𝜏 ∈ ∗ Δ | (𝑠, 𝜏) ⊢∗𝑁 ( 𝑓 , 𝜀) for some 𝑓 ∈ 𝐹}.

A MTM (or a MTMD) is deterministic (a DMTM or a DMTMD) if no more than


a single move is possible from any given configuration.
MTM, MTMD, DMTM, and DMTMD denote the classes of macrosets gen-
erated by MTMs, MTMDs, DMTMs, and DMTMDs, respectively. Analogously to
MLBA, it can be proven that MTM = 𝑚PS, and DMTM are, again, unable to accept
simple macrosets such as {𝑎, 𝑏}. MTMDs are again more powerful than MTMs. In
fact, as a MTMD is essentially a register machine, it is a Turing-complete model,
meaning that MTMD = 𝑝PS. DMTMDs are clearly strictly more powerful than
DMTMs, but their relationship with the other two variants is unclear. The relation-
ships of the other three models can be summarized as follows:

DMTM ⊂ MTM = 𝑚PS ⊂ MTMD = 𝑝PS.


This concludes our discussion of multiset-based grammars and automata, and
we will shift our attention to Petri nets which are very closely related to multiset
computation despite being based on different principles.

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

Fig. 8.4 A Petri net.

places and transitions—from the perspective of a transition, incoming arrows specify


the places it receives tokens from, and outgoing arrows specify the places it sends
tokens to.
Definition 8.12 A net is a triple 𝑁 = (𝑃, 𝑇, 𝐹), where
• 𝑃 and 𝑇 are finite disjoint sets of places and transitions,
• 𝐹 ⊆ (𝑃 × 𝑇) ∪ (𝑇 × 𝑃) is the flow relation.
Let 𝑥 ∈ (𝑃 ∪ 𝑇). The set {𝑦 | 𝑦𝐹𝑥}, denoted by • 𝑥, is the preset of 𝑥, and the set
{𝑦 | 𝑥𝐹 𝑦}, denoted by 𝑥 • , is the postset of 𝑥.
This definition provides the underlying structure of a Petri net, but it says nothing
about its behavior. Thus, many different types of Petri nets can be built on top of
Definition 8.12; however, we will focus our attention on the type most closely resem-
bling multiset computation—Place/Transition Petri nets, more commonly referred
to simply as P/T Petri nets.
Throughout this section, starting with the following definition, we will be using
the symbol 𝜔 alongside natural numbers to represent an unlimited amount. To specify
its semantics in various arithmetic expressions, we require 𝜔 to satisfy the following
three rules:
1. 𝑛 < 𝜔 for all 𝑛 ∈ N,
2. 𝑚 + 𝜔 = 𝑚 + 𝜔 = 𝜔 − 𝑚 = 𝜔 for all 𝑚 ∈ N ∪ {𝜔},
3. sup( 𝐴) = 𝜔 for any infinitely large set 𝐴 ⊆ N.
Definition 8.13 A P/T Petri net is a sextuple 𝑁 = (𝑃, 𝑇, 𝐹, 𝑊, 𝐾, 𝑀0 ), where
• (𝑃, 𝑇, 𝐹) is a net,
• 𝑊 : 𝐹 → N is a function specifying the weight of each arc,
• 𝐾 : 𝑃 → 0 N ∪ {𝜔} is a function specifying the capacity of each place, with 𝜔
representing an unlimited capacity,
240 8 Other Models of Discontinuous Computation

• 𝑀0 : 𝑃 → 0 N ∪ {𝜔} is the initial marking of 𝑁, which must satisfy 𝑀0 ( 𝑝) ≤


𝐾 ( 𝑝) for all 𝑝 ∈ 𝑃.
A marking of 𝑁 is any function 𝑀 : 𝑃 → 0 N ∪ {𝜔} which satisfies 𝑀 ( 𝑝) ≤ 𝐾 ( 𝑝)
for all 𝑝 ∈ 𝑃.
A transition 𝑡 ∈ 𝑇 is enabled in 𝑀 (or 𝑀-enabled) if:
• 𝑀 ( 𝑝) ≥ 𝑊 ( 𝑝, 𝑡) for all 𝑝 ∈ • 𝑡, and
• 𝑀 ( 𝑝) + 𝑊 (𝑡, 𝑝) ≥ 𝐾 ( 𝑝) for all 𝑝 ∈ 𝑡 • .
Let 𝑊 ′ : (𝑃×𝑇)∪(𝑇 ×𝑃) → 0 N be a total function defined as 𝑊 ′ (𝑎, 𝑏) = 𝑊 (𝑎, 𝑏)
for (𝑎, 𝑏) ∈ 𝐹, and 𝑊 ′ (𝑎, 𝑏) = 0, otherwise.
In marking 𝑀, any 𝑀-enabled transition 𝑡 can be fired, resulting in a new marking,
𝑀 ′ , defined as 𝑀 ′ ( 𝑝) = 𝑀 ( 𝑝) − 𝑊 ′ ( 𝑝, 𝑡) + 𝑊 ′ (𝑡, 𝑝) for all places 𝑝 ∈ 𝑃. We denote
this relation between the markings and the transition as 𝑀 [𝑡⟩𝑀 ′ .

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]).

8.3 Permutation Grammars

This section modifies phrase-structure grammars by adding extra non-context-free


rules, referred to as permutation rules, which can permutate substrings of sentential
forms.

Definition 8.14 A phrase-structure grammar 𝐺 = (Σ, Δ, 𝑃, 𝑆) is a permutation


grammar, if for every 𝑟 ∈ 𝑃 one of the following holds:
1. Either 𝑟 is a non-erasing2 context-free rule 𝑟 : 𝐴 → 𝛾, 𝐴 ∈ 𝑁, 𝛾 ∈ Σ+ with
𝑁 = Σ ∪ Δ,
2. or 𝑟 is a permutation rule 𝑟 : 𝛼 → 𝛽 where 𝜓 Σ (𝛼) = 𝜓 Σ (𝛽), 𝛼 ≠ 𝛽.

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

The language generated by 𝐺, 𝐿 (𝐺), is a permutation language. The family of


all permutation languages is denoted by Perm.
Let 𝐿 = 𝐿(𝐺) and let 𝑃′ ⊆ 𝑃 denote the set of all context-free rules in 𝑃. Then,
𝐺 = (Σ, Δ, 𝑃′ , 𝑆) is a context-free grammar, and the language 𝐿 𝐵 = 𝐿(𝐺 ′ ) is the

basis language of 𝐿 with regard to 𝐺.

For convenience, if there are two mutually inverse rules 𝛼 → 𝛽 and 𝛽 → 𝛼 in a


grammar, we denote them both by 𝛼 ↔ 𝛽.

Lemma 8.5 CF ⊆ Perm ⊆ CS.

Proof Follows directly from the definition—clearly, any context-free grammar is


also a permutation grammar (with no permutation rules), and as the production
rules of a permutation grammar are all non-contracting, they cannot exceed context-
sensitive grammars in power. □
In fact, it can quite easily be shown that the above inclusions are proper, by
examining two example languages—a permutation language which is not context-
free, and a context-sensitive language which is not a permutation language.

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𝐵 = {𝑎𝑏𝑐}∗ .

Example 8.4 Conversely, let us consider a counter-example of a permutation lan-


guage. Let 𝐿 2 = {𝑎 𝑛 𝑏 𝑛 𝑐 𝑛 | 𝑛 ≥ 1}. This is a well-known example of a context-
sensitive language; however, it is not a permutation language, following from the
fact that despite being infinite, it contains no infinite context-free subsets, which
means that there is no possible basis language for 𝐿 2 . Any permutation grammar
capable of generating all the strings of 𝐿 2 will necessarily generate some strings not
in 𝐿 2 .
242 8 Other Models of Discontinuous Computation

Theorem 8.11 CF ⊂ Perm ⊂ CS.

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.

Definition 8.15 Let 𝑛 be a positive integer. A permutation rule 𝛼 → 𝛽 is of length


𝑛 if |𝛼| = |𝛽| = 𝑛. A permutation grammar containing permutation rules of length
at most 𝑛 is a permutation grammar of order 𝑛, and the language it generates is
a permutation language of order 𝑛. The class of all such languages is denoted by
Perm𝑛 .

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.

Theorem 8.12 For 𝑛 ≥ 1, Perm4𝑛−2 ⊂ Perm4𝑛−1 .

Proof See Madejski [2014]. □


Chapter 9
Remarks on Applications and Their Perspectives

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.

9.1 Jumping Automata Used as Language-Defining Devices

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

can or should properly cover all needs of discontinuous information processing.


Indeed, there are many formal models that try to adequately capture different parts
of this phenomenon (see the introduction of Chapter 3). This diversity stems from
the fact that, with these new models, we are trying to move some complex parts of
the behavior of the computation methods into the core structure of the models. As
a result, these new models are then more suited for specific tasks rather than for
general purpose computing.
Let us take a closer look at the original jumping finite automata (JFA; see Chapter
3). Generally, these models can very easily compare quantities of input symbols.
Observe the increasing complexity of crossed agreements on the number of symbols
in the languages like:
• {𝑤 ∈ {𝑎, 𝑏}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)},
• {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐)}, and
• {𝑤 ∈ {𝑎, 𝑏, 𝑐, 𝑑}∗ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏) = occur(𝑤, 𝑐) = occur(𝑤, 𝑑)}.
Since classical formal models need to handle all symbols in the precise order, we
quickly get out of the capabilities of even pushdown automata. On the other hand,
there is almost no increase in the complexity of the model when we accept these
languages with jumping finite automata. For instance, in Obare et al. [2019], JFAs
are built to evaluate the counts of the occurrences of keywords in order to implement
basic comprehension of tweets. Nonetheless, the discontinuous nature of jumping
finite automata has its severe drawbacks when we try to accept languages that actually
do require some precise reading order. We can see that JFAs cannot accept even the
trivial language {𝑎𝑏}. This can be partially overcome with GJFAs for finite strings.
However, there is no GJFA that could accept the simple regular language {𝑎}∗ {𝑏}∗ .
Moreover, we pay a significant price for this partial reading order with the increased
expected parsing complexity. According to Fernau et al. [2015, 2017] and using the
standard complexity classes from computational complexity theory, we know that
the parsing of JFAs falls into NL, whereas the parsing of GJFAs falls into NP and
there exists a GJFA for which the parsing is NP-complete.
In this regard, we can see the behavior of original jumping finite automata mainly
as a purely discontinuous reading.
If we take a look at the automata introduced in Chapter 4, we can say that these
parallel versions of jumping finite automata explore controlled discontinuous reading
behaviors.

𝒏-Parallel Jumping Finite Automata

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]).

Double-Jumping Finite Automata

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

Jumping 5′ → 3′ Watson–Crick Finite Automata

Compared to the previous models, jumping 5′ → 3′ Watson–Crick finite automata


are already constructed with more specific types of tasks in mind. Furthermore, they
offer a significant control of their reading behavior that can be adjusted with the
rules in the model. We can explore languages accepted by these automata from two
points of view.
First, from a purely theoretical point of view, we can observe how the rules of the
model affects the reading behavior. Considering Lemma 4.26 and Theorem 4.42, we
can see that if we use only certain types of rules, we can almost completely disable
the jumping behavior of the model. Observe that the meeting point of the heads splits
the input string into two parts in which different rules are used. The heads are able
to jump in the given part only in cases in which both heads can read some symbols
in this part according to the rules of the model. Thus, we can force the heads to read
some parts of the input completely continuously. This allows us to accept all regular
and even all linear languages. Furthermore, the model is also able to accept some of
the more complicated languages with balanced quantities of symbols. Nonetheless,
the model is not able to work in a completely discontinuous way, and thus there are
more severe restrictions on the form of these languages compared to the original
jumping finite automata.
Second, from a more practical point of view, let us consider the biology inspired
nature of this model. As we have mentioned in Section 2.2.3, Watson–Crick finite
automata work with double-stranded strings, each strand of the string has 5′ end and
3′ end, and the strands are combined together from opposite directions. Therefore,
if we want both heads to read each strand from 5′ end to 3′ end, one head must read
from left to right, and the other head must read from right to left. Since this is not
a typical behavior of finite automata, it is useful to have special models for these
tasks. There are already (full-reading) sensing 5′ → 3′ Watson–Crick finite automata
that work in this way, but their heads can read the input only in a continuous way.
Our jumping version of 5′ → 3′ Watson–Crick finite automata can cover situations
where we want to search for sequences in DNA that are not necessarily continuous
but rather interlined together from both directions. Of course, one of the imminent
follow-up questions is the complexity of a parsing algorithm that would be based on
this model. We do not have an answer yet, but we hope that the controlled nature of
this discontinuous reading will help us find shortcuts for the parsing process.

9.2 Jumping Grammars Used as Models of DNA Computation

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

9.2.1 DNA Processing with Jumping Scattered Context Derivations

In this section, we add some remarks concerning application-related perspectives of


jumping scattered context grammars (see Chapter 6) in terms of molecular biology—
namely, DNA processing.
As already sketched, jumping grammars serve as grammatical models that allow
us to explore information processing performed in a discontinuous way adequately
and rigorously. Taking into account the way these grammars are conceptualized,
we see that they are particularly useful and applicable under the circumstances that
primarily concern the number of occurrences of various symbols or substrings rather
than their mutual context.
Recall that a DNA is a molecule encoding genetic information by a repetition of
four basic units called nucleotides—namely, guanine, adenine, thymine, and cyto-
sine, denoted by letters 𝐺, 𝐴, 𝑇, and 𝐶, respectively. In terms of formal language
theory, a DNA is described as a string over {𝐺, 𝐴, 𝑇, 𝐶}; for instance,

𝐺𝐺𝐺𝐺 𝐴𝐺𝑇𝐺𝐺𝐺 𝐴𝑇𝑇𝐺𝐺𝐺 𝐴𝐺 𝐴𝐺𝐺𝐺𝐺𝑇𝑇𝑇𝐺𝐶𝐶𝐶𝐶𝐺𝐶𝑇𝐶𝐶𝐶

Suppose that a DNA-computing-related investigation needs to study all the strings


that contain the same number of 𝐴s and 𝐶s so all 𝐴s precede 𝐶s; for instance,
𝐴𝐺𝐺 𝐴𝐴𝑇𝐶𝐺𝐶𝐺𝑇𝐶 is a proper string, but 𝐶𝐺𝐶 𝐴𝐶𝐶𝐺𝐺𝑇 𝐴 is not. Consider the
jumping scattered context grammar

𝐺 = ({1, 2, 3, 4, 𝐺, 𝐴, 𝑇, 𝐶}, {𝐺, 𝐴, 𝑇, 𝐶}, 𝑃, 1)

with 𝑃 containing rules

(1) → (23) (3) → (𝐺3)


(3) → (𝑇3) (3) → (4)
(2, 4) → ( 𝐴2, 4𝐶) (2)|(4) → (𝜀)

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.

9.2.2 Genetic Algorithms Supported by Pure Jumping Grammars

While Chapter 7 discusses pure jumping grammars from a theoretical viewpoint,


the present section deals with them from a more practical standpoint. Specifically,
it sketches their use within the framework of genetic algorithms, into which a brief
insight is given next.
Genetic algorithms (see Koza [1992]) are inspired by natural evolution, and
they are customarily used to find an approximate solution of NP-hard problems.
In a genetic algorithm, a solution of a problem is represented by a chromosome.
A chromosome is a sequence of genes, where any gene can represent a property
or a parameter, depending on what kind of a problem is to be solved. A set of
chromosomes is called a population. An important part of a genetic algorithm is a
fitness function. Its purpose is to map a chromosome to its fitness value, while its
definition depends on the given problem. Based on its fitness value, it is decided
whether an individual’s chromosome survives or not.
Any genetic algorithm works as follows. In the beginning, an initial population is
generated. Then, individuals with the best fitness values are selected. These individ-
uals become parents of a new population. Two parental chromosomes, 𝑢𝑣 and 𝑥𝑦, are
combined to make a new pair of chromosomes, 𝑥𝑣 and 𝑢𝑦, called an offspring. This
process is called a crossover. Offsprings are then included into the new population.
At times, some offspring genes may be randomly changed. This process is called
mutation, and it introduces a diversity element. The new population is then used
in the next iteration of the algorithm. The algorithm terminates when there are no
notable differences between the new and old population.
In terms of the formal language theory, genes can be represented by symbols,
chromosomes by strings, and population by finite languages. Suppose that chromo-
somes of individuals consist of genes 𝑎, 𝑏, and 𝑐, whereas only individuals with
chromosomes with the number of 𝑎s equal to the number of 𝑏s can survive. This can
be expressed by the language
250 9 Remarks on Applications and Their Perspectives

𝐿 𝑎𝑏 = {𝑤 ∈ {𝑎, 𝑏, 𝑐}+ | occur(𝑤, 𝑎) = occur(𝑤, 𝑏)}


generated by the sequential context-free pure jumping grammar

𝐺 𝑎𝑏 = ({𝑎, 𝑏, 𝑐}, {𝑐 → 𝑐𝑐, 𝑐 → 𝑎𝑏, 𝑎 → 𝑎, 𝑏 → 𝑏}, {𝑐})


Of course, 𝐿 𝑎𝑏 can be also generated by the unrestricted grammar

𝐻 𝑎𝑏 = ({𝑆, 𝐴, 𝐵, 𝑎, 𝑏, 𝑐}, {𝑎, 𝑏, 𝑐}, 𝑃, 𝑆)


with 𝑃 containing rules

𝑆 → 𝑆𝑆, 𝑆 → 𝐴𝐵, 𝑆 → 𝑐,
𝑆𝐴 → 𝐴𝑆, 𝑆𝐵 → 𝐵𝑆, 𝐴𝑆 → 𝑆 𝐴,
𝐴𝐵 → 𝐵𝐴, 𝐵𝑆 → 𝑆𝐵, 𝐵𝐴 → 𝐴𝐵,
𝐴 → 𝑎, 𝐵 → 𝑏
However, 𝐺 𝑎𝑏 contains only four rules and, therefore, describes 𝐿 𝑎𝑏 in a more
economical way than 𝐻 𝑎𝑏 does.

9.3 Theoretically Oriented Applications

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 𝑘.

For convenience, we name it the debt lemma. Traditionally, when we want to


show that a language is not accepted by the model in question, we use some form
of a pumping lemma (see Rozenberg and Salomaa [1997a]). Nonetheless, pumping
lemmas usually reason about the resulting language families and not about the actual
models. This can become limiting in situations where we do not know how the
resulting language family precisely looks like, but where we otherwise know a lot
about the model that defines it. This situation seems to be quite common for jumping
models because the details of the jumping behavior have a large impact on the
resulting language family. If we look at other approaches, it is common in finite
automata to say that the model has a finite state control and thus it cannot remember
an infinite amount of information. This is, however, only an informal reasoning that
9.3 Theoretically Oriented Applications 251

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:

Definition 4.11 (see page 111) Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a jumping 5′ → 3′


WKFA. Assuming some states 𝑞, 𝑞 ′ ∈ 𝑄 and a mutual position of heads 𝑠 ∈
{⊕, ⊖}, we say that 𝑞 ′ is reachable from 𝑞 and 𝑠 if there exists a configuration
(𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) such that (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) ↷∗ (𝑞 ′ , 𝑠′ , 𝑤 1′ , 𝑤 2′ , 𝑤 3′ ) in 𝑀, 𝑠′ ∈
{⊕, ⊖}, 𝑤 1 , 𝑤 2 , 𝑤 3 , 𝑤 1′ , 𝑤 2′ , 𝑤 3′ ∈ (Δ ∪ {#}) ∗ .

Definition 9.1 Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a finite automaton. Assuming some states


𝑞, 𝑞 ′ ∈ 𝑄, we say that 𝑞 ′ is reachable from 𝑞 if there exists a configuration 𝑞𝑤 such
that 𝑞𝑤 ⇒∗ 𝑞 ′ in 𝑀, 𝑤 ∈ Δ∗ .

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. □

Definition 4.12 (see page 112) Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a jumping 5′ → 3′


WKFA, where Δ = {𝑎 1 , . . . , 𝑎 𝑛 }, and let 𝑤 ∈ Δ∗ . We define the Parikh vec-
tor 𝑜 = (𝑜1 , . . . , 𝑜 𝑛 ) of processed (read) symbols from 𝑤 in a configuration
𝛾 = (𝑞, 𝑠, 𝑤 1 , 𝑤 2 , 𝑤 3 ) of 𝑀 reached from an initial configuration (𝑞 0 , ⊕, 𝜀, 𝑤, 𝜀) of
𝑀 as 𝑜 = 𝜓 Δ (𝑤) − 𝜓 Δ (𝑤 1 𝑤 2 𝑤 3 ), 𝑞 ∈ 𝑄, 𝑠 ∈ {⊕, ⊖}, 𝑤 1 , 𝑤 2 , 𝑤 3 ∈ (Δ∪ {#}) ∗ . Using
252 9 Remarks on Applications and Their Perspectives
Í𝑛
the Parikh mapping of 𝐿 (𝑀), we define Δ(𝑜) = { 𝑖=1 (𝑚 𝑖 − 𝑜𝑖 ) | (𝑚 1 , . . . , 𝑚 𝑛 ) ∈
𝜓 Δ (𝐿(𝑀)), 𝑚 𝑖 ≥ 𝑜𝑖 , 1 ≤ 𝑖 ≤ 𝑛} ∪ {∞}. Finally, we define the debt of the configu-
ration 𝛾 of 𝑀 as min Δ(𝑜).
Definition 9.2 Let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a finite automaton, where Δ = {𝑎 1 , . . . ,
𝑎 𝑛 }, and let 𝑤 ∈ Δ∗ . We define the Parikh vector 𝑜 = (𝑜1 , . . . , 𝑜 𝑛 ) of processed (read)
symbols from 𝑤 in a configuration 𝛾 = 𝑞𝑤 ′ of 𝑀 reached from an initial configuration
𝑞 0 𝑤 of 𝑀 as 𝑜 = 𝜓 Δ (𝑤) − 𝜓 Δ (𝑤 ′ ), 𝑞 ∈ 𝑄, 𝑤 ′ ∈ Δ∗ . Using the Parikh mapping of
Í𝑛
𝐿(𝑀), we define Δ(𝑜) = { 𝑖=1 (𝑚 𝑖 − 𝑜𝑖 ) | (𝑚 1 , . . . , 𝑚 𝑛 ) ∈ 𝜓 Δ (𝐿(𝑀)), 𝑚 𝑖 ≥ 𝑜𝑖 , 1 ≤
𝑖 ≤ 𝑛} ∪ {∞}. Finally, we define the debt of the configuration 𝛾 of 𝑀 as min Δ(𝑜).
Now, we can adapt the main debt lemma:
Lemma 9.2 Let 𝐿 be a language, and let 𝑀 = (𝑄, Δ, 𝛿, 𝑞 0 , 𝐹) be a finite automaton.
If 𝐿 (𝑀) = 𝐿, there exists a constant 𝑘 for 𝑀 such that 𝑀 accepts all 𝑤 ∈ 𝐿 using
only configurations that have their debt bounded by 𝑘.
Proof By contradiction. Assume 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 𝑞 ∈ 𝑄 from
which a final state 𝑓 ∈ 𝐹 is reachable. Then, due to Lemma 9.1, thereÍ is 𝑤 ′ ∈ 𝐿(𝑀)
′ ′ 𝑛
such that 𝜓 Δ (𝑤 ) = (𝑚 1 , . . . , 𝑚 𝑛 ), 𝑚 𝑖 ≥ 𝑜𝑖 , 1 ≤ 𝑖 ≤ 𝑛, and |𝑤 | ≤ 𝑖=1 (𝑜𝑖 ) + 𝑘 ′ ,
′ ′
where 𝑘 is some constant for 𝑀. According to Definition 9.2, 𝑤 ∈ 𝐿(𝑀) implies
min Δ(𝑜) ≤ 𝑘 ′ . Second, assume that 𝛾 contains a state 𝑞 from which no final state
𝑓 is reachable. Then, by Definition 9.1, there is no computation that takes 𝑀 from
𝛾 to a final accepting configuration. Thus, when 𝑀 accepts 𝑤, it must be done
over configurations with the debt ≤ 𝑘 ′ . However, that is a contradiction with the
assumption that 𝑀 can accept some 𝑤 ∈ 𝐿 over a configuration for which the debt
cannot be bounded by any 𝑘. □
Finally, we show how the adapted debt lemma can be used in the proof that finite
automata cannot define the context-free language 𝐿 = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}.
Theorem 9.1 There is no finite automaton 𝑀 such that 𝐿(𝑀) = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}.
Proof By contradiction. Let 𝐿 = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}, and let 𝑀 be a finite automaton
such that 𝐿 (𝑀) = 𝐿. Due to Lemma 9.2, there must exist a constant 𝑘 for 𝑀 such
that 𝑀 accepts all 𝑤 ∈ 𝐿 using only configurations that have their debt bounded by
𝑘. Consider any 𝑘 ≥ 0. Let 𝑤 = 𝑎 𝑘+1 𝑏 𝑘+1 . Clearly, after reading 𝑎 𝑘 , the debt of the
configuration is 𝑘, and no further reading is possible. Thus, we can see that 𝑀 is
not able to accept 𝑤 = 𝑎 𝑘+1 𝑏 𝑘+1 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 finite automaton 𝑀 such that
𝐿 (𝑀) = {𝑎 𝑛 𝑏 𝑛 | 𝑛 ≥ 0}. □
9.3 Theoretically Oriented Applications 253

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

investigation represents a vivid trend in the theory of computation as a whole. It


pays a special attention to the power of these jumping models because it significantly
differs from that of the classical models. To rephrase this difference in terms of the
language families resulting from the jumping versions of automata and grammars,
these families usually intersect the well-known language families of the Chomsky
hierarchy. Apart from this topic, the book also discusses most other common themes
of the language theory, such as closure properties and decidability. The principal goal
of all this investigation consists in obtaining a systematized body of mathematically
established knowledge concerning methods underlain by discontinuously working
computation.
Secondarily, from a more practical standpoint, the text constantly struggles to
maintain a balance between the theory of jumping models and the practice of dis-
continuous computation formalized by them. In fact, the text quite realistically il-
lustrates the applicability of these models by several computer-science engineering
techniques, such as the use of jumping automata as language-defining devices or the
use of jumping grammars in bioinformatics.
The entire text of the present book is divided into the following four parts.
Part I, consisting of Chapters 1 and 2, gives an introduction to this book. Chap-
ter 1 reviews basic mathematical notions used throughout the book. Chapter 2, in
a greater detail, gives the essentials of formal language theory, including automata
and grammars.
Part II consists of Chapters 3 and 4. Chapter 3 is solely devoted to one-head
jumping finite automata as the very basic model of discontinuous computation.
Chapter 4 explores jumping finite automata that have more than one head.
Part III, consisting of Chapters 5 through 7, covers jumping grammars as cru-
cially 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 parallel gram-
mars represented by scattered context grammars. Finally, Chapter 7 explores the
jumping generation of language by pure sequential and parallel grammars, which
use only one kind of symbols, namely, terminals.
Part IV is the present three-chapter part. Chapter 8 gives an outline of other
important approaches to discontinuous computation and its formalizations. Chapter
9 sketches current applications of jumping automata and grammars and sketches its
perspectives. Chapter 10 summarizes the book as a whole.
We close this chapter and, in fact, the entire book by placing jumping automata
and grammars into a historical and bibliographical context. Numerous papers on
these models have been published since their introduction. Rather than attempt to be
encyclopedic, we recommend only those that appear to be of the greatest interest to
the serious reader who finds this subject worth studying in the future.
10 Summary and Bibliographical Remarks 257

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

used in classical automata, such as finite-state, pushdown or linear bounded automata.


The paper concentrates on determining the language families resulting from these
modified jumping automata. It establishes several new results, such as pumping
lemmas, closure properties as well as non-closure properties. Based on these results,
the paper develops methods to decide whether or not a given language belongs to
some of these families. In addition, this paper establishes basic relationships, such
as inclusion or incomparability, between these families.
Bibliography

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

Madejski, G. and A. Szepietowski (2017). Membership problem for two-dimensional jumping


finite automata. In Ninth Workshop on Non-Classical Models of Automata and Applications,
NCMA 2017 (Short Papers), pp. 33–40.
Mahalingam, K., U. K. Mishra, and R. Raghavan (2020). Watson–Crick jumping finite automata.
International Journal of Foundations of Computer Science 31(07), 891–913.
Mahalingam, K., R. Raghavan, and U. K. Mishra (2019). Watson–Crick jumping finite automata.
In Theory and Applications of Models of Computation, TAMC 2019, Volume 11436 of LNCS,
pp. 467–480. Springer International Publishing.
Martı́n-Vide, C., A. Mateescu, and V. Mitrana (2002). Parallel finite automata systems communi-
cating by states. International Journal of Foundations of Computer Science 13(05), 733–749.
Martı́n-Vide, C. and V. Mitrana (2000). Parallel communicating automata systems — a survey.
Korean Journal of Applied Mathematics and Computing 7(2), 237–257.
Martı́n-Vide, C. and G. Păun (2000). The Complete Linguist: A Collection of Papers in Honour of
Alexis Manaster Ramer, Chapter Normal forms for Watson–Crick finite automata, pp. 281–296.
Lincom Europa.
Masopust, T. and A. Meduna (2009). Descriptional complexity of three-nonterminal scattered con-
text grammars: An improvement. In Proceedings of 11th International Workshop on Descrip-
tional Complexity of Formal Systems, pp. 235–245. Otto-von-Guericke-Universität Magdeburg.
Maurer, H. A., A. Salomaa, and D. Wood (1980). Pure grammars. Information and Control 44(1),
47–72.
Mayer, O. (1972). Some restrictive devices for context-free grammars. Information and Control 20,
69–92.
Meduna, A. (2000). Automata and Languages: Theory and Applications. Springer, London.
Meduna, A. (2006). Deep pushdown automata. Acta Informatica 2006(98), 114–124.
Meduna, A. (2007). Elements of Compiler Design. Auerbach Publications, Boston.
Meduna, A. (2014). Formal Languages and Computation: Models and Their Applications. Taylor
& Francis, New York.
Meduna, A. and T. Masopust (2007). Self-regulating finite automata. Acta Cybernetica 18(1),
135–153.
Meduna, A. and O. Soukup (2017a). Jumping scattered context grammars. Fundam. Inf. 152(1),
51–86.
Meduna, A. and O. Soukup (2017b). Modern Language Models and Computation: Theory with
Applications. Springer.
Meduna, A. and J. Techet (2010). Scattered Context Grammars and their Applications. WIT Press,
Southampton.
Meduna, A. and M. Švec (2005). Grammars with Context Conditions and Their Applications.
Wiley, New Jersey.
Meduna, A. and P. Zemek (2012). Jumping finite automata. International Journal of Foundations
of Computer Science 23(7), 1555–1578.
Meduna, A. and P. Zemek (2014). Regulated Grammars and Automata. Springer US.
Mishra, U. K., K. Mahalingam, and R. Raghavan (2021a). Generalized circular one-way jumping
finite automata. CoRR abs/2106.03852.
Mishra, U. K., K. Mahalingam, and R. Raghavan (2021b). Generalized linear one-way jumping
finite automata. CoRR abs/2106.02937.
Mishra, U. K., K. Mahalingam, and R. Raghavan (2021c). Watson–Crick jumping finite automata:
Combination, comparison and closure. The Computer Journal. bxaa166.
Mohamad Zulkufli, N. L., S. Turaev, M. I. Mohd Tamrin, and A. Messikh (2016). Generative power
and closure properties of Watson–Crick grammars. Applied Computational Intelligence and
Soft Computing 2016, 1–12.
Mohamad Zulkufli, N. L., S. Turaev, M. I. Mohd Tamrin, and A. Messikh (2018). Watson–
Crick context-free grammars: Grammar simplifications and a parsing algorithm. The Computer
Journal 61(9), 1361–1373.
Mohamad Zulkufli, N. L., S. Turaev, M. I. M. Tamrin, and A. Messikh (2017). The computational
power of Watson–Crick grammars: Revisited. In Bio-inspired Computing – Theories and
Bibliography 265

Applications, Volume 681 of Communications in Computer and Information Science, Singapore,


pp. 215–225. Springer Singapore.
Nagy, B. (2008). On 5′ → 3′ sensing Watson–Crick finite automata. In M. H. Garzon and H. Yan
(Eds.), DNA Computing, 13th International Meeting on DNA Computing, DNA13, Memphis,
TN, USA, June 4-8, 2007, Revised Selected Papers, Volume 4848 of Lecture Notes in Computer
Science, pp. 256–262. Springer.
Nagy, B. (2009). On a hierarchy of 5′ → 3′ sensing WK finite automata languages. In Computability
in Europe 2009: Mathematical Theory and Computational Practice, CiE 2009, pp. 266–275.
Nagy, B. (2010). 5′ → 3′ sensing Watson–Crick finite automata. In G. Fung (Ed.), Sequence and
Genome Analysis II – Methods and Applications, pp. 39–56. iConcept Press.
Nagy, B. (2012). A class of 2-head finite automata for linear languages. Triangle (Languages:
Mathematical Approaches) 8, 89–99.
Nagy, B. (2013). On a hierarchy of 5′ → 3′ sensing Watson–Crick finite automata languages. J.
Log. Comput. 23(4), 855–872.
Nagy, B. (2020). 5′ → 3′ Watson–Crick pushdown automata. Information Sciences 537, 452–466.
Nagy, B., L. Hegedüs, and O. Eğecioğlu (2011). Hierarchy results on stateless multicounter 5′ → 3′
Watson–Crick automata. In Advances in Computational Intelligence: 11th International Work-
Conference on Artificial Neural Networks, IWANN 2011, Volume 6691 of LNCS, pp. 465–472.
Springer.
Nagy, B. and Z. Kovács (2019). On simple 5′ → 3′ sensing Watson–Crick finite-state transducers.
In Eleventh Workshop on Non-Classical Models of Automata and Applications (NCMA 2019),
pp. 155–170.
Nagy, B. and F. Otto (2019). Two-head finite-state acceptors with translucent letters. In SOFSEM
2019, Volume 11376 of LNCS, pp. 406–418.
Nagy, B. and F. Otto (2020). Linear automata with translucent letters and linear context-free trace
languages. RAIRO-Theor. Inf. Appl. 54(3), 23.
Nagy, B. and S. Parchami (2020). On deterministic sensing 5′ → 3′ Watson–Crick finite automata:
a full hierarchy in 2detLIN. Acta Informatica 58(3), 153–175.
Nagy, B., S. Parchami, and H. Mir-Mohammad-Sadeghi (2017). A new sensing 5′ → 3′ Watson–
Crick automata concept. In AFL 2017, Volume 252 of EPTCS, pp. 195–204.
Novotný, M. (2002). Construction of pure grammars. Fundam. Inform. 52(4), 345–360.
Obare, S., A. Ade-Ibijola, and G. Okeyo (2019). Jumping finite automata for tweet comprehen-
sion. In International Multidisciplinary Information Technology and Engineering Conference
(IMITEC), pp. 7. IEEE.
Parchami, S. and B. Nagy (2018). Deterministic sensing 5′ → 3′ Watson–Crick automata without
sensing parameter. In UCNC 2018, Volume 10876 of LNCS, pp. 173–187.
Parikh, R. J. (1966). On context-free languages. J. ACM 13(4), 570–581.
Păun, G., G. Rozenberg, and A. Salomaa (1998). DNA Computing: New Computing Paradigms,
Chapter Watson–Crick Automata, pp. 151–186. Springer Berlin Heidelberg.
Rosebrugh, R. D. and D. Wood (1973). A characterization theorem for 𝑛-parallel right linear
languages. Journal of Computer and System Sciences 7, 579–582.
Rosebrugh, R. D. and D. Wood (1974). Image theorem for simple matrix languages and 𝑛-parallel
languages. Mathematical Systems Theory 8(2), 150–155.
Rosebrugh, R. D. and D. Wood (1975). Restricted parallelism and right linear grammars. Utilitas
Mathematica 7, 151–186.
Rosenberg, A. L. (1965). On multi-head finite automata. In 6th Annual Symposium on Switching
Circuit Theory and Logical Design, SWCT 1965, pp. 221–228.
Rozenberg, G. and P. G. Doucet (1971). On 0L-languages. Information and Control 19(4), 302–318.
Rozenberg, G. and A. Salomaa (1980). Mathematical Theory of L Systems. Academic Press,
Orlando.
Rozenberg, G. and A. Salomaa (1986). The Book of L. Springer-Verlag, New York.
Rozenberg, G. and A. Salomaa (Eds.) (1997a). Handbook of Formal Languages, Vol. 1: Word,
Language, Grammar. Springer, New York.
266 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

Index to Key Language Families

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.

Abbr. Pages Family


0L 188 0L languages
0L− 𝜀 188 propagating 0L languages
1 J5′→ 3′ WK 117 accepted by 1-limited jumping 5′ → 3′ WKFAs
ALL 7 all languages
CF 31 context-free languages
CS 31 context-sensitive languages
DEPDA 𝑘 210 accepted by deep PDAs of depth 𝑘 by empty pushdown
DJFA 39 accepted by deterministic JFAs
DJFA𝑜 69 accepted by GJFAs that make 𝑜-jumps,
where 𝑜 ∈ {2, ♦♦, ▶◀, . . . }
DPDA 𝑘 210 accepted by deep PDAs of depth 𝑘
𝑛 DPDA 218 accepted by 𝑛-expandable deep PDAs
EXPSPACE 232 exponential-space complexity class
F1 J5′→ 3′ WK 117 accepted by all-final 1-limited jumping 5′ → 3′ WKFAs
FIN 7 finite languages
FIN 𝜀-inc 117 finite languages which contain the empty string
F J5′→ 3′ WK 117 accepted by all-final jumping 5′ → 3′ WKFAs
FS J5′→ 3′ WK 117 accepted by all-final simple jumping 5′ → 3′ WKFAs
GJFA 39 accepted by GJFAs
GJFA𝑛 48 accepted by GJFAs of degree 𝑛
𝑙 GJFA 50 accepted by GJFAs that make only left jumps
𝑟 GJFA 50 accepted by GJFAs that make only right jumps
𝑥
GJFA 52 accepted by 𝑥-starting GJFAs with 𝑥 standing
for beginning, anywhere, or end
𝑥
𝑦 GJFA 53 accepted by GJFAs, 𝑥 ∈ {𝑏, 𝑎, 𝑒}, 𝑦 ∈ {𝑙, 𝑟},
where 𝑏, 𝑎, 𝑒, 𝑙, and 𝑟 have the same meaning as above
INFIN 7 infinite languages
J5′→ 3′ WK 109 accepted by jumping 5′ → 3′ WKFAs
JCF 138 generated by jumping CFGs
JCFfin 137 generated by jumping CFGs of finite index
JCS 136 generated by jumping CSGs
JFA 39 accepted by JFAs
𝑙 JFA 50 accepted by JFAs that make only left jumps
Index to Key Language Families 269

Abbr. Pages Family


𝑟 JFA 50 accepted by JFAs that make only right jumps
𝑥
JFA 52 accepted by 𝑥-starting JFAs with 𝑥 standing
for beginning, anywhere, or end
𝑥
𝑦 JFA 53 accepted by JFAs, 𝑥 ∈ {𝑏, 𝑎, 𝑒}, 𝑦 ∈ {𝑙, 𝑟},
where 𝑏, 𝑎, 𝑒, 𝑙, and 𝑟 have the same meaning as above
JLIN 137 generated by jumping LGs
JMON 135 generated by jumping MONGs
JPP 188 generated by PGs with 𝑗 𝑝 ⇒
JPPCF 188 generated by PCFGs with 𝑗 𝑝 ⇒
JRE 138 generated by jumping PSGs
JREG 136 generated by jumping RGs
JRL 137 generated by jumping RLGs
JSCi ⇒ 156-184 generated by jumping SCGs with 𝑖⇒, 𝑖 ∈ {1, 2, . . . , 9}
JSP 188 generated by PGs with 𝑗 ⇒
JSPCF 188 generated by propagating PCFGs with 𝑗 ⇒
Xeven 70 {𝐿 | 𝐿 ∈ X, 𝐿 has even-length strings},
where X ∈ {CS, CF, . . . }
Lin 226 linear macrosets
LIN 32 linear languages
M 232 generated by matrix grammars
MFA 234 accepted by MFAs
MLBA 236 accepted by MLBAs
𝑚M 231 generated by matrix multiset grammars
MTM 238 accepted by MTMs
𝑚𝑋 228 generated by 𝑋 multiset grammars with 𝑋 being regular,
linear, context-free, monotone, or phrase-structure
N1 J5′→ 3′ WK 117 accepted by stateless 1-limited jumping 5′ → 3′ WKFAs
N J5′→ 3′ WK 117 accepted by stateless jumping 5′ → 3′ WKFAs
NL 244 nondeterministic logarithmic-space complexity class
NP 244 nondeterministic polynomial-time complexity class
𝑛-PRL 87 generated by 𝑛-PRLGs
NS J5′→ 3′ WK 117 accepted by stateless simple jumping 5′ → 3′ WKFAs
Perm 241 generated by permutation grammars
PGJFA♦𝑛 88 accepted by 𝑛-parallel GJFAs
PGJFA▶𝑛 88 accepted by 𝑛-parallel GJFAs using only right 𝑛-jumps
PP 188 generated by PGs with 𝑝 ⇒
PPCF 188 generated by propagating PCFGs with 𝑝 ⇒
PSPACE 232 polynomial-space complexity class
𝑝X 226 Parikh images for 𝑋, where X ∈ {RE, CS, M, . . . }
RE 30 recursively enumerable languages
REG 32 regular languages
SEL 70 simply expandable languages
Sen5′→ 3′ WK 109 accepted by sensing 5′ → 3′ WKFAs
270 Indices

Abbr. Pages Family


SJ5′→ 3′ WK 117 accepted by simple jumping 5′ → 3′ WKFAs
SLin 226 semilinear macrosets
SP 188 generated by PGs with 𝑠 ⇒
SPCF 188 generated by propagating PCFGs with 𝑠 ⇒
ST 213 generated by state grammars
ST𝑛 213 generated by 𝑛-limited state grammars
WK 27 accepted by WKFAs
Subject Index

5′ → 3′ Watson–Crick finite jumping finite automaton, 37


automaton, 102 computational step, 23
concatenation, 7
alphabet, 6 configuration, 23, 209
input, 23 start, 52
pushdown, 23 context-free
total, 29
rule, 154
ancestor, 13
context-sensitive
automaton
rule, 154
finite
contradiction, 4, 5
jumping, 37
countable, 10
Watson–Crick, 26
axiom, see nonterminal, starting cycle, 12

bag, see multiset De Morgan’s laws, 6


alphabet, 235, 238 debt, 112, 250
bijection, 9 deep pushdown automaton, 209
bottom symbol, 209 of depth 𝑛, 210
cardinality, 5, 10 degree
Cartesian product, 9 of general jumping finite
child, 13 automaton, 37
Chomsky hierarchy, 32, 51, 148, depth, 13
226, 242 derivation
closed, 8 direct, 30
closure, 8 mode, 133
positive, 8 successful, 30
reflexive, 11 derivation step, 30
transitive, 10 descendant, 13
complement, 6, 7, 9, 44, 80 deterministic
complete deep pushdown automaton, 217

271
272 Subject Index

with respect to depth of jumping Watson–Crick, 97


expansions, 217 jumping Watson–Crick
jumping finite automaton, 37 1-limited, 98
diagonalization, 10 all-final, 98
difference, 6 simple, 98
direct stateless, 98
derivation, 154, 211 lazy, 20
move, 209 multiset, 233
disjoint, 6 sensing 5′ → 3′ Watson–Crick
pairwise, 6 with jumping feature, 105
domain, 9 Watson–Crick, 26
double-jumping finite automaton, 69 1-limited, 28
double-jumping mode, 68 all-final, 28
DPDA, see deep pushdown simple, 28
automaton stateless, 28
frontier, 13
edge, 12
function, 9
element, 5
partial, 9
empty string, 7
total, 9
enumerable, 10
𝜀-free
general finite automaton, 20
context-free grammar, 31
general jumping finite automaton, 36
general jumping finite automaton,
generated language, 86, 87
37
GFA, see general finite automaton
jumping finite automaton, 37
GJFA, see jumping finite automaton,
erasing rule, 31
general
expansion
grammar
of depth 𝑚, 209
commutative, see grammar,
of pushdown, 209
multiset
extension, 11
context-free, 31
FA, see finite automaton 𝜀-free, 31
final context-sensitive, 30
state, 209 jumping, 133
finite automaton, 21 jumping pure, 187
𝑛-parallel general jumping, 87 jumping scattered context, 155
deterministic, 21 linear, 32
deterministic multiset, 234 multiset, 228
deterministic multiset with permutation, 240
detection, 234 phrase-structure, 29
general, 20 pure, 187
jumping pure context-free, 188
general, 36 regular, 32
jumping 5′ → 3′ Watson–Crick, right-linear, 32
106 scattered context, 154
finite automaton state, 211
Subject Index 273

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

P/T Petri, 239 alphabet, 209


node, 12 pushdown automaton
interior, 13 classical, 23
nonterminal, 30 deep, 209, 217
alphabet, 86, 154 extended, 23
starting, 30 pushdown top, 23

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

infinite, 5 𝑛-limited generation, 212


shuffle, 8 suffix, 8
start proper, 8
from anywhere, 52 surjection, 9
from the beginning, 52 symbol, 3, 6, 7
from the end, 52 starting, 30
pushdown symbol, 209 starting pushdown, 23
state, 209 symbols, 8
symbol, 154, 211 symmetric, 10
state, 23, 209, 211
final, 23 terminal, 30
grammar, 211 alphabet, 86, 154, 211
reachable, 38 terminating state, 38
starting, 23 theorem, 3
terminating, 38 total
string, 7 alphabet, 154, 211
transition, 23
double-stranded, 26
graph, 38
valid, 26
mapping, 233, 235, 238
empty, see empty string
translation, 11
strings(), 212
tree, 13
sublanguage, 7
ordered, 13
subrelation, 9
subset, 6 unary, 12
proper, 6 uncountable, 10
substitution, 11 union, 6
substring, 8 universe, 5
proper, 8
substrings, 8 Watson–Crick finite automaton, 26
subtree, 13 WKFA, see Watson–Crick finite
elementary, 13 automaton
successful word, see string

You might also like