# **In Memoriam, Solomon Marcus**

Edited by Cristian S. Calude and Gheorghe Păun Printed Edition of the Special Issue Published in *Axioms*

www.mdpi.com/journal/axioms

## **In Memoriam, Solomon Marcus**

## **In Memoriam, Solomon Marcus**

Editors

**Cristian S. Calude Gheorghe Paun**

MDPI • Basel • Beijing • Wuhan • Barcelona • Belgrade • Manchester • Tokyo • Cluj • Tianjin

*Editors* Cristian S. Calude University of Auckland New Zealand

Gheorghe Paun Institute of Mathematics of the Romanian Academy Romania

*Editorial Office* MDPI St. Alban-Anlage 66 4052 Basel, Switzerland

This is a reprint of articles from the Special Issue published online in the open access journal *Axioms* (ISSN 2075-1680) (available at: http://www.mdpi.com).

For citation purposes, cite each article independently as indicated on the article page online and as indicated below:

LastName, A.A.; LastName, B.B.; LastName, C.C. Article Title. *Journal Name* **Year**, *Volume Number*, Page Range.

**ISBN 978-3-0365-3475-6 (Hbk) ISBN 978-3-0365-3476-3 (PDF)**

Cover image courtesy of Cristian S. Calude

© 2022 by the authors. Articles in this book are Open Access and distributed under the Creative Commons Attribution (CC BY) license, which allows users to download, copy and build upon published articles, as long as the author and publisher are properly credited, which ensures maximum dissemination and a wider impact of our publications.

The book as a whole is distributed by MDPI under the terms and conditions of the Creative Commons license CC BY-NC-ND.

## **Contents**


### **About the Editors**

**Cristian S. Calude** is a member of Academia Europaea, a Chair Professor of Computer Science and Director of the Centre for Discrete Mathematics and Theoretical Computer Science at the University of Auckland, New Zealand. He has results in computational complexity, algorithmic information theory, quantum theory, history and philosophy of mathematics and computer science. Websites: http://en.wikipedia.org/wiki/Cristian S. Calude, https://www.cs.auckland.ac.nz/%7Ecristian/awards.html

**Gheorghe Paun** is a member of the Romanian Academy and of Academia Europaea, and has now retired from the Institute of Mathematics of the Romanian Academy. Paun's research interests lie in formal language theory, DNA computing, and membrane computing.

### **Preface to "In Memoriam, Solomon Marcus"**

Solomon Marcus (https://en.wikipedia.org/wiki/Solomon Marcus) was a Romanian mathematician, member of the Romanian Academy, and professor at the University of Bucharest. He was a polymath with research in mathematics (mathematical analysis, measure theory, topology, mathematical and computational linguistics), theoretical computer science, poetics, linguistics, semiotics, philosophy, and history of science and education.

This book commemorates Marcus's fifth death anniversary with a selection of articles in mathematics, theoretical computer science, and physics written by authors who work in Marcus's research fields, some of whom have been influenced by his results and/or have collaborated with him. Marcus's (currently) final mathematical paper was published in *Axioms*, https://www.mdpi.com/2075-1680/7/1/15.

This book includes ten papers, one reviewing the contributions of Solomon Marcus to Theoretical Computer Science and Applications, and the others devoted to Membrane Computing, Interdimensionality, Network Topologies, Turing Machines, Complexity of Quasiperiodic Infinite Words, Kolmogorov Complexity, Cover Automata, and Communication Patterns.

> **Cristian S. Calude , Gheorghe Paun** *Editors*

### *Commentary* **Solomon Marcus Contributions to Theoretical Computer Science and Applications**

**Cristian S. Calude 1,\*,† and Gheorghe P ˘aun 2,†**


**Abstract:** Solomon Marcus (1925–2016) was one of the founders of the Romanian theoretical computer science. His pioneering contributions to automata and formal language theories, mathematical linguistics and natural computing have been widely recognised internationally. In this paper we briefly present his publications in theoretical computer science and related areas, which consist in almost ninety papers. Finally we present a selection of ten Marcus books in these areas.

**Keywords:** automata theory; formal language theory; bio-informatics; recursive function theory

#### **1. Introduction**

In 2005, on the occasion of the 80th birthday anniversary of Professor Solomon Marcus, the editors of the present volume, both his disciples, together with his friend Professor G. Rozenberg, from Leiden, The Netherlands, have edited a special issue of *Fundamenta Informaticae* (vol. 64), with the title *Contagious Creativity*. This syntagma describes accurately the activity and the character of Marcus, a Renaissance-like personality, with remarkable contributions to several research areas (mathematical analysis, mathematical linguistics, theoretical computer science, semiotics, applications of all these in various areas, history and philosophy of science, education), with many disciples in Romania and abroad and with a wide recognition all around the world. Marcus projected his mathematical thinking in all domains in which he worked. Here is an example from semiotics, in the words of the Finnish musicologist and semiologist E. Tarasti (President of the International Association for Semiotic Studies (2004–2014), see N.-S. Dr ˘agan, In Memoriam Solomon Marcus, "Hide and seek" with Solomon Marcus and Umberto Eco, *Book of Abstracts*, First Edition of the International Conference Semiosis in Communication, 1–3, Bucharest, 2016.):

No other semiotician is so accurate and challenging in his reasoning about fundamental issues of our discipline.

In what follows we only briefly describe his contributions to theoretical computer science and related areas, especially to automata and formal language theories, natural computing (DNA and membrane computing), applications of grammars in various domains, recursive function theory and provability in mathematics, as well as a selection of his many books in these areas. Some re-printed in S. Marcus, *Words and Languages Everywhere*, Polimetrica, Milano, 2007, but almost all collected in the two-volume book G. P ˘aun (ed.), *Solomon Marcus, Selected Papers—Computer Science*, Spandugino Publ. House, Bucharest, 2018, abbreviated SPCS. Our choices have been guided by *SPCS*.

Marcus' pioneering book *Gramatici ¸si automate finite (Grammars and Finite Automata)*, published in 1964 in Romanian is one of the first monographs in the world on this subject. This book, written in a rigorous mathematical language at a time when the domain was in infancy, covers automata and language theories, closely linking finite automata and Chomsky regular grammars. The book ends with a chapter on the relations between

**Citation:** Calude, C.S.; P ˘aun, G. Solomon Marcus Contributions to Theoretical Computer Science and Applications. *Axioms* **2021**, *10*, 54. https://doi.org/10.3390/axioms 10020054

Academic Editor: Florin Felix Nichita

Received: 4 March 2021 Accepted: 30 March 2021 Published: 5 April 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

natural languages and regular grammars, a theme which motivated Marcus' interest and his many publications in mathematical linguistics. Unfortunately, the book, written in Romanian, was not translated into any other language; hence, it remained almost unknown internationally. This is not the case with many of his subsequent books, specifically those in mathematical linguistics, some of which will be listed in this paper. These books have been translated in several languages (French, English, German, Russian, Italian, Czech, Spanish, Greek and other languages) and then published by Academic Press, Dunod, Nauka and other well-known international publishers. Without exception, they had a very high international audience and impact.

His first paper in formal language theory was published in 1963 and it is illustrative for his permanent interest in building bridges between apparently disjoint research areas; in this case, finite automata, regular grammars, arithmetical progressions. Symmetrically, his last paper, published 50 years later, returns to bio-informatics, a domain which he somehow prognosticated (too early) in the beginning of the 70's.

#### **2. A Working Classification**

It is difficult to classify the theoretical computer science papers of Marcus because of their inter/multi-disciplinarity. In *SPCS*, the papers have been classified into four large categories: Formal language theory, applications of formal language theory, bio-informatics, and recursive function theory. We will use this classification here too.

In the first class there are papers dealing with finite state grammars and automata, contextual grammars, the history of formal language theory, combinatorics on words and on infinite sequences (periodicity and quasi-periodicity, unavoidable patterns, density of words of a given length), mathematical analysis notions adapted to formal language theory, and so on.

The last category deserves a closer study, which we only suggest here: To systematically extend notions/ideas from mathematical analysis to formal language theory in general and to combinatorics on words in particular (a symmetric study is worth carrying out for applications of formal languages to other mathematical areas, e.g., number theory by classifying various classes of numbers in Chomsky's hierarchy, characterising them with grammars, etc.). This was a direction of research programmatically explored by Marcus. The title of his 1999 paper is explicit and significant in this respect: *From real analysis to discrete mathematics and back*, followed by details: *Symmetry, convexity, almost periodicity, and strange attractors*. In the beginning of this paper he wrote:

Despite its importance, the relation between continuous and discrete mathematics is a rather neglected topic. (. . . ) Working in real analysis in the fifties and in the sixties and then in discrete mathematics (the mathematical theory of languages), I became interested to look for the discrete analog of some facts belonging to continuous mathematics.

Among the most fruitful ideas of this kind we mention several variants of the Darboux property for languages, the basic one being the following: If we have three families of languages, L<sup>1</sup> ⊂ L<sup>2</sup> ⊂ L3, conceivably belonging to a larger hierarchy of families of languages, possibly infinite, and two languages *L*<sup>1</sup> ∈ L1, *L*<sup>3</sup> ∈ L<sup>3</sup> \ L2, can we find a language *L*<sup>2</sup> ∈ L<sup>2</sup> such that *L*<sup>1</sup> ⊂ *L*<sup>2</sup> ⊂ *L*3? Various definitions of symmetry, attractors, periodicity, convexity, etc., have been extended to strings. In all cases, Marcus used to define a series of subtle variants, of the type left-, right-, almost-, pseudo-, weak-, strong-, etc. Marcus had an unbounded creativity to pose open problems, and these papers never missed them; quite a few papers solved such problems, some of them with Marcus as a coauthor.

Actually, formulating open problems and suggesting research directions is one of the specific features of "Marcus' style". Many of the questions formulated by Marcus were addressed by his disciples, collaborators, by researchers in mathematics and computer science from Romania and other countries. Some problems were, partially or totally, solved—many of them are still waiting for solutions.

#### **3. A Constant Interest for Bio-Informatics**

We mentioned before that in the 1970s Marcus published "too early" a paper dealing with applications of mathematical linguistics and formal language theory in biology, specifically in the genomics area. The year was 1974 and the title of the paper is *Linguistic structures and generative devices in molecular genetics*.

Bio-informatics can be understood in two senses, as an attempt to use computer science in biology, providing notions, tools, techniques to the biologist and, mainly in the last decades, in the opposite direction, to utilise ideas inspired from biology in developing algorithms in computer science, and in hardware too, as is the case in DNA computing—DNA molecules do computations. In his paper, Marcus considered both directions. In the first direction of research he synthesised previous approaches and results; in the second one he proposed new research vistas for using mathematical (linguistic) tools in addressing questions in the genetic area, to model the DNA and its biochemistry. Speculations about using DNA molecules as a support for computations were published only later (by M. Conrad, R. Feynman, C. H. Bennet), while the first computing model based on an operation specific to DNA recombination was introduced only in 1987 by T. Head (another friend of Marcus). However, it is worth emphasising the attention paid by Marcus, in this first paper and also in many others, to a 1965 proposal formulated by the Polish mathematician Z. Pawlak (famous for introducing in early 1990s, the rough sets), to generate proteins starting from amino acids; the method used a specific representation of amino acids and certain picture grammars. (This is the reason Marcus considered Z. Pawlak a precursor of picture grammars, a type of generative mechanisms developed later.)

Over the years, Marcus was constantly interested in the (mathematical) linguistic approach to cellular biology, to applications in genomics and life sciences. For instance, after the apparition of DNA computing in 1994, and especially after the initiation of membrane computing in 1998, he had contributed to these areas with a series of papers and participated to several international meetings dedicated to these subjects, in Romania and abroad. As expected, the inter-disciplinary approach, typical to Marcus, is always present in his contributions—here are two illustrative titles of papers in membrane computing, *Membranes versus DNA* and *Bridging P systems and genomics*, presented at the first meetings devoted to membrane computing (Curtea de Arge¸s, Romania, 2001, 2002). Actually, in 2002, he proposed a slogan which became folklore in this research area:

Life = DNA software + membrane hardware.

As expected, in this area too he proposed several research directions, some of them truly "non-standard" ("too" inter-disciplinary) at the first sight. We only cite two examples of ideas not yet explored: To consider membranes with a topology different from the usual one (vesicle-like membranes), where the separation between inside and outside is crisp (for example, to study membranes similar to Klein's bottle), and, respectively, to use multisets, the sets with a multiplicity associated with their elements (the usual data structure in membrane computing) described by Pawlak rough sets.

#### **4. Marcus Contextual Grammars**

In a paper simply called "Contextual grammars" (published in 1969 in *Revue Roumaine de Mathématiques Pures et Appliquées*) Marcus has introduced the grammars which are now called Marcus contextual grammars, a branch of formal language theory. In fact, the paper was presented one year before in an international linguistics conference held in Stockholm, Sweden.

The paper has ten pages, but currently there probably exist more than 400 papers on contextual grammars, about two dozen of PhD and Master Theses, as well as two monographs, one published by the Publishing House of the Romanian Academy, Bucharest, 1982 (in Romanian), and one by Kluwer Publishing, The Netherlands, in 1997 (Marcus Contextual Grammars), both of them authored by Gh. P˘aun. In the second volume of the massive *Handbook of Formal Languages*, Springer-Verlag, 1997 (three volumes), edited by G. Rozenberg and A. Salomaa, there are two chapters dedicated to this topic, one by

Marcus, "Contextual grammars and natural languages", which discusses motivations and developments in this area, and another more technical one, "Contextual grammars and formal languages", by A. Ehrenfeucht, Gh. P ˘aun, and G. Rozenberg.

The idea has the origins in algebraic linguistics: For a natural language *L* (over an alphabet *V*), with every word *w* over *V* one associates a set of contexts *u*, *v* over *V* which accept *w* with respect to *L* (that is, *uwv* ∈ *L*). Can we use this process of selecting words by contexts, in order to describe a language? One can also conversely state it. The answer was initially given in the form of simple contextual grammars, triples of the form *G* = (*V*, *A*, *C*), where *V* is an alphabet, *A* is a finite language over *V* (its elements are called axioms), and *C* is a finite set of contexts over *V*. Such a grammar generates a language *L*(*G*) which contains (1) all axioms in *A* and (2) all strings obtained from axioms by adjoining contexts to them. More formally, *L*(*G*) contains all strings of the form *un* ... *u*1*xv*<sup>1</sup> ... *vn*, where *x* ∈ *A* and *ui*, *vi* ∈ *C* for all 1 ≤ *i* ≤ *n*, with *n* ≥ 0; for *n* = 0 the string is an axiom from *A*.

This simple model does not have a powerful generative capacity. Moreover, it does not take into consideration the string-contexts selectivity mentioned above. However, at the end of the paper, Marcus also proposes the contextual grammars with choice, *G* = (*V*, *A*, *C*, *ϕ*), where *<sup>ϕ</sup>* : *<sup>V</sup>*<sup>∗</sup> <sup>→</sup> <sup>2</sup>*<sup>C</sup>* is the selection mapping (of contexts by the strings). This time, a string is in *L*(*G*) if it is of the form *un* ... *u*1*xv*<sup>1</sup> ... *vn* as above with *x* ∈ *A*, *u*1, *v*1 ∈ *ϕ*(*x*), and *ui*, *vi* ∈ *<sup>ϕ</sup>*(*ui*−<sup>1</sup> ... *<sup>u</sup>*1*xv*<sup>1</sup> ... *ui*−1) for all *<sup>i</sup>* = 2, . . . , *<sup>n</sup>*.

A great research program started from there, following the usual questions of formal language theory: Variants (extensions and restrictions), characterisations, generative power, comparisons of the obtained families among them and with the known families of languages, especially with those in the Chomsky hierarchy, closure and decidability properties, parsing complexity, equivalent automata, etc.

An important detail, which makes Marcus contextual grammars so attractive is the fact that they are not using, like the Chomsky grammars, nonterminal symbols, categorial auxiliary symbols: They are intrinsic grammars as each derived string belongs to the generated language.

Still, there was an embarrassing restriction in the initial model, the possibility to adjoin contexts only in the ends of the current string. A real breakthrough was proposed at the end of the 1970s, when the Vietnamese Nguyen Xuan My came to Romania to start a PhD with Marcus. In a joint paper Nguyen-P˘aun, the inner contextual grammars have been introduced: The contexts can be added in any place inside the current string, under the control of the selection mapping. (Formally, an inner contextual grammar is a usual contextual grammar with choice, *<sup>G</sup>* = (*V*, *<sup>A</sup>*, *<sup>C</sup>*, *<sup>ϕ</sup>*), with *<sup>ϕ</sup>* : *<sup>V</sup>*<sup>∗</sup> <sup>→</sup> <sup>2</sup>*C*, with the language *L*(*G*) defined as the smallest language *L* ⊆ *V*<sup>∗</sup> such that (i) *A* ⊆ *L* and (ii) if *x*1*x*2*x*<sup>3</sup> ∈ *L* and *u*, *v* ∈ *ϕ*(*x*2), then *x*1*ux*2*vx*<sup>3</sup> ∈ *L*.) In this way, the generative capacity has significantly increased, the flexibility (hence the adequacy) of the model has been accordingly augmented.

Another important advance in this area was made at the beginning of the 1990s, when G. Rozenberg, A. Salomaa, A. Ehrenfeucht became interested in contextual grammars. Details can be found in Kluwer's monograph mentioned before and in two chapters in the *Handbook of Formal Languages*.

Progress was rather rapid. Certain classes of contextual grammars have been proved to be relevant for modelling typical constructions in natural languages (duplication, multiple agreements, crossed agreements) and classes of contextual grammars which are mildly context sensitive in the sense requested by linguists (A. K. Joshi and others) have been introduced. They are parsable in polynomial time and contain strings whose lengths do not make large jumps—sometimes one asks only that the language be semilinear.

In this way, the impressive bibliography we mentioned above has been accumulated and this bibliography is still growing.

#### **5. Applications of Formal Language Theory**

In this class we have included the papers devoted to applications of grammars and automata. This was a really central and continuous interest of Marcus, also passed onto his students and collaborators. The domains of applicability are very diverse: Natural and programming languages, the semiotics of folklore fairy tales, the modelling of economic processes, diplomatic negotiations, the medical diagnosis, the semiotics of theatre, action theory, learning theory, chemistry, genetics.

These applications should be placed in a more general context under the slogan linguistics as a pilot-science, a catchphrase coined by C. Levi-Strauss: Adopted, extended and transformed by Marcus it became a real research program for his Romanian school of mathematical linguistics and formal language theory.

The grounding assumption, also explored by M. Nowakowska in her book *Languages of Action, Languages of Motivations*, Mouton, The Hague, 1973, was that many processes/activities can be described as sequences of elementary actions ("semantic marks"), sequences which are governed by precise restrictions which can be described by syntactic rules. Thus, languages describing actions and grammars describing languages of actions came into stage. Combined with the Chomskian hypothesis that the linguistic competence is innate and influences all other competences of the human brain, Levi-Strauss's slogan became Marcus' formal linguistics as a pilot-science. Indeed, a large variety of processes, from fairy tales description to economic processes proved to be described, at convenient levels of abstraction, by grammars of the types initially developed in linguistics.

#### **6. Recursive Function Theory and Provability**

The last category of papers we mention deals with recursive functions and provability in mathematics; it contains fewer papers, but some of these papers have a special significance, as they clarify an important paternity in the history of computability. Specifically, they proved that the first example of a recursive function which is not primitive recursive was constructed by G. Sudan in 1927, simultaneously with and independently of W. Ackermann, who was credited before with this achievement (1928). The problem was examined by Marcus in collaboration with C. Calude and I. ¸Tevy, following a suggestion coming from G. C. Moisil.

It is important to mention that Marcus was constantly concerned with adequately valuing the history of the Romanian mathematics: Pointing out the priorities in this area was already one of the main goals of his well-known book *Din gândirea matematic˘a româneasc˘a (From the Romanian Mathematical Thinking)*, Scientific and Encyclopaedic Publishing House, Bucharest, 1975.

This group also includes a few papers on provability in mathematics, at different levels of formalisation and with various tools, including proof-assistants.

#### **7. Papers**

#### *7.1. Formal Language Theory*


#### *7.2. Applications of Formal Languages*


P ˘aun, G. Rozenberg, A. Salomaa, C. Zandron, eds.), LNCS 2597, Springer, Berlin, 2003, 371–376.


#### **8. Selected Books**


**Author Contributions:** Authors have contributed in equal parts. Both authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

### *Article* **Simulations between Network Topologies in Networks of Evolutionary Processors**

**José Ángel Sánchez Martín <sup>1</sup> and Victor Mitrana 1,2,\***


**Abstract:** In this paper, we propose direct simulations between a given network of evolutionary processors with an arbitrary topology of the underlying graph and a network of evolutionary processors with underlying graphs—that is, a complete graph, a star graph and a grid graph, respectively. All of these simulations are time complexity preserving—namely, each computational step in the given network is simulated by a constant number of computational steps in the constructed network. These results might be used to efficiently convert a solution of a problem based on networks of evolutionary processors provided that the underlying graph of the solution is not desired.

**Keywords:** evolutionary processor; network of evolutionary processors; network topology; theory of computation; computational models

#### **1. Introduction**

Networks of evolutionary processors (NEPs for short) have been extensively investigated in the last two decades since their generative variant has been introduced in [1]. An informal description of a NEP is as follows: it is a graph whose nodes are hosts for some very simple processors inspired by the basic mutations at the DNA nucleotide level, namely insertion, deletion, and substitution. Each processor is able to make just one of these operations on the data existing in the node that hosts it. Data may be organized as strings, multisets, two-dimensional pictures, graphs, etc. In this work, we consider that the data consist of strings. A very important assumption is that each string appears in an arbitrarily large number of identical copies such that if the processor can apply an operation to different sites of a string, the operation is actually applied simultaneously to each of these sites in different copies of the string. Furthermore, if more that one rule can be applied to a string, each rule is applied to a different copy of that string. This process described above is considered to be an evolutionary step. Each evolutionary step alternates with a communication step. In a communication step, all the strings that can leave a node (they can pass the output filter associated with that node) actually leave the node and copies of them enter each node connected to the left node, provided that they can pass the input filter of the arriving node. We say that an input string, which initially is in a designated node, called the input node, is accepted if another designated node, called the output node, is non-empty after a finite number of computational steps (evolution, communication). The complexity of a computation is defined in the usual way.

From the very beginning, NEPs have been proven to be computationally complete models [2,3], such that they have been used to solve hard problems [4]. Several variants have been considered depending on the positions of filters: filters associated with nodes (different filters [3], uniform filters [5], polarization [6]) or filters associated with edges [7]. Later on, several ways of simulating and implementing different variants of these networks have been reported [8–11]. A rather new and attractive direction of research has been to

**Citation:** Sánchez Martín, J.Á.; Mitrana V. Simulations between Network Topologies in Networks of Evolutionary Processors. *Axioms* **2021**, *10*, 183. https://doi.org/10.3390/ axioms10030183

Academic Editor: Cristian S. Calude

Received: 19 July 2021 Accepted: 6 August 2021 Published: 11 August 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

investigate the possibility of simulating directly and efficiently one variant by another without the intermediate step of an extra computational model (Turing machine, tag-system, register machine, etc.) in between, see, e.g., [5].

This work continues this line of research by proposing direct simulations between two NEPs such that the input one is an arbitrary NEP while the output one has a predefined topology that can be a complete graph, a star graph, or a grid. Thus, after a preliminary section with the basic definitions and concepts, we give the construction of a complete NEP equivalent to a given NEP. We continue with another section, where we give such a construction for a star graph and finally a construction for a grid NEP. A short conclusion ends the paper.

#### **2. Basic Definitions**

The basic concepts and notations that are to be used throughout the paper are defined in the sequel; the reader may consult [12] for basic concepts that are not defined here. We use the following concepts and notations:


We now recall some definitions from a few papers where the networks of evolutionary processors have been introduced, see, e.g., [1], for the generating model, and [3,13,14], for the accepting model. Let *a* → *b* be a rule, where *a*, *b* ∈ (*V* ∪ {*ε*}):


The set of all substitution, deletion, and insertion rules over *V* is denoted by *SubV*, *DelV*, and *InsV*, respectively.

Given a rule *σ* as above and a string *w* ∈ *V*∗, we define the following *actions* of *σ* on *w* , to any position (∗), to the leftmost position (*l*), and to the rightmost position (*r*), as explained in the sequel:

– If *σ* ≡ *a* → *b* ∈ *SubV*, then

$$\sigma^\*(w) = \left\{ \begin{array}{l} \{ \iota bv \text{ : } \exists \iota\_\prime v \in V^\* \ (w = \iota a v) \}, \\ \{ w \}, \text{ otherwise} \end{array} \right\}$$

According to this definition, applying a rule to a string may result in a finite number of strings. This implies that in our setting each string may appear in an arbitrarily large number of copies.

$$\text{--}\qquad \text{If } \sigma \equiv a \rightarrow \varepsilon \in \text{Del}\_V \text{ then } \sigma^\*(w) = \left\{ \begin{array}{l} \{uv : \exists u, v \in V^\* \ (w = uw) \}, \\ \{w\} , \text{ otherwise} \end{array} \right\},$$

$$\sigma^r(w) = \left\{ \begin{array}{l} \{u : w = ua\}\_{\prime} \\ \{w\}\_{\prime} \text{ otherwise} \end{array} \qquad \sigma^l(w) = \left\{ \begin{array}{l} \{v : w = av\}\_{\prime} \\ \{w\}\_{\prime} \text{ otherwise} \end{array} \right.$$

– If *σ* ≡ *ε* → *a* ∈ *InsV*, then *σ*∗(*w*) = {*uav* : ∃*u*, *v* ∈ *V*<sup>∗</sup> (*w* = *uv*)}, *<sup>σ</sup>r*(*w*) = {*wa*}, *<sup>σ</sup><sup>l</sup>* (*w*) = {*aw*}.

For every rule *<sup>σ</sup>*, *<sup>α</sup>* ∈ {∗, *<sup>l</sup>*,*r*}, and *<sup>L</sup>* <sup>⊆</sup> *<sup>V</sup>*∗, we define *<sup>σ</sup>α*(*L*) = *w*∈*L σα*(*w*). Given a

{*w*}, otherwise

finite and non-empty set of rules *M*, a string *w* and a language *L*, we define the followings:

$$M^{\mathfrak{a}}(w) = \bigcup\_{\sigma \in M} \sigma^{\mathfrak{a}}(w) \text{ and } M^{\mathfrak{a}}(L) = \bigcup\_{w \in L} M^{\mathfrak{a}}(w).$$

In the original papers mentioned above, the rewriting operations defined above were referred as *evolutionary operations* since they may be viewed as formal operations abstracted from local DNA mutations.

For two disjoint subsets *P* (permitting symbols) and *F* (forbidding symbols) of an alphabet *V* and a string *z* over *V*, we define the predicates:

$$\begin{array}{ccc}\varrho^{(s)}(z;P,F) \equiv & P \subseteq \operatorname{alph}(z) & \wedge & F \cap \operatorname{alph}(z) = \mathcal{O} \\ \varrho^{(w)}(z;P,F) \equiv & (P \neq \mathcal{O}) \to (\operatorname{alph}(z) \cap P \neq \mathcal{O}) & \wedge & F \cap \operatorname{alph}(z) = \mathcal{O}.\end{array}$$

For every language *L* ⊆ *V*<sup>∗</sup> and *β* ∈ {(*s*),(*w*)}, we define:

$$
\varphi^\S(L, P, F) = \{ z \in L \mid \varphi^\S(z; P, F) \}.
$$

An *evolutionary processor* (EP) over an alphabet *V* is a tuple (*M*, *PI*, *F I*, *PO*, *FO*), where:


We denote the set of evolutionary processors over *V* by *EPV*. A *network of evolutionary processors* (NEP for short) is a seven-tuple Γ = (*V*, *U*, *G*, N , *α*, *β*, *In*,*Out*), where:


$$\begin{array}{l}\text{input filter: } \rho\_{\mathbf{x}}(\cdot) = \rho^{\beta(\mathbf{x})}(\cdot; PI\_{\mathbf{x}\prime}FI\_{\mathbf{x}})\_{\prime} \\\text{output filter: } \tau\_{\mathbf{x}}(\cdot) = \rho^{\beta(\mathbf{x})}(\cdot; PO\_{\mathbf{x}\prime}FO\_{\mathbf{x}})\_{\prime} .\end{array}$$

That is, *ρx*(*z*) (resp. *τx*(*z*)) indicates whether or not the string *z* can pass the input (resp. output) filter of *x*. More generally, *ρx*(*L*) (resp. *τx*(*L*)) is the set of strings of *L* that can pass the input (resp. output) filter of *x*.

• *In* and *Out* ∈ *XG* are the *input node*, and the *output node*, respectively, of the NEP.

<sup>A</sup> *configuration* of a NEP <sup>Γ</sup> as above is a function *<sup>C</sup>* : *XG* −→ <sup>2</sup>*U*<sup>∗</sup> which associates a multiset of strings *C*(*x*) with every node *x* of Γ. As each string appears in an arbitrarily large number of copies, we work with the support of this multiset. For a string *w* ∈ *V*∗, we define the initial configuration of Γ on *w* by *C*(*w*) <sup>0</sup> (*In*) = {*w*} and *<sup>C</sup>*(*w*) <sup>0</sup> (*x*) = ∅ for all *x* ∈ *XG* \ {*In*}.

A configuration is followed by another configuration either by an *evolutionary step* or by a *communication step*. A configuration *C* follows a configuration *C* by an evolutionary step if each component *C* (*x*), for some node *x*, is the result of applying all the evolutionary rules in the set *Mx* that can be applied to the strings in the set *C*(*x*). Formally, configuration *C* follows the configuration *C* by a an evolutionary step, written as *C* =⇒ *C* , if

$$\mathcal{C}'(\mathfrak{x}) = M\_{\mathfrak{x}}^{\alpha\_x}(\mathbb{C}(\mathfrak{x})) \text{ for all } \mathfrak{x} \in X\_G.$$

In a communication step of a NEP the following actions take place simultaneously for every node *x*:

(i) All the strings that can pass the output filter of a node are sent out of that node;

(ii) All the strings that left their nodes enter all the nodes connected to their original ones, provided that they can pass the input filter of the receiving nodes.

Note that, according to this definition, those strings that are sent out of a node and cannot pass the input filter of any node are lost.

Formally, a configuration *C* follows a configuration *C* by a communication step (we write *C* |= *C*) iff for all *x* ∈ *XG*

$$C'(\mathbf{x}) = (\mathsf{C}(\mathbf{x}) \mid \tau\_{\mathbf{x}}(\mathsf{C}(\mathbf{x}))) \cup \bigcup\_{\{\mathbf{x}, \mathbf{y}\} \in E\_G} (\tau\_{\mathbf{y}}(\mathsf{C}(\mathbf{y})) \cap \rho\_{\mathbf{x}}(\mathsf{C}(\mathbf{y}))).$$

Let Γ be a NEP, the computation of Γ on the input string *w* ∈ *V*<sup>∗</sup> is a sequence of configurations *C*(*w*) <sup>0</sup> , *<sup>C</sup>*(*w*) <sup>1</sup> , *<sup>C</sup>*(*w*) <sup>2</sup> , ... , where *<sup>C</sup>*(*w*) <sup>0</sup> is the initial configuration of Γ on *w*, *C*(*w*) <sup>2</sup>*<sup>i</sup>* <sup>=</sup><sup>⇒</sup> *<sup>C</sup>*(*w*) <sup>2</sup>*i*+<sup>1</sup> and *<sup>C</sup>*(*w*) <sup>2</sup>*i*+<sup>1</sup> <sup>|</sup><sup>=</sup> *<sup>C</sup>*(*w*) <sup>2</sup>*i*+2, by a for all *i* ≥ 0. Note that the configurations are changed by alternative steps.

A computation as above *halts*, if there exists a configuration in which the set of strings existing in the output node *Out* is non-empty. Given a NEP Γ and an input string *w*, we say that Γ accepts *w* if the computation of Γ on *w* halts. Consequently, we define the *language accepted* by Γ by

*L*(Γ) = {*z* ∈ *V*<sup>∗</sup> | the computation of Γ on *z* halts}.

The *time complexity* of the halting computation *<sup>C</sup>*(*z*) <sup>0</sup> , *<sup>C</sup>*(*z*) <sup>1</sup> , *<sup>C</sup>*(*z*) <sup>2</sup> , ... *<sup>C</sup>*(*z*) *<sup>m</sup>* of Γ on *z* ∈ *V*<sup>∗</sup> is denoted by *time*Γ(*z*) and equals *m*. The time complexity of Γ is the function from *IN* to *IN*, *Time*Γ(*n*) = max{*time*Γ(*z*) | *z* ∈ *L*(Γ), |*z*| = *n*}. In other words, *Time*Γ(*n*) delivers the maximal number of computational steps carried out by Γ for accepting an input string of length *n*.

#### **3. Simulating Any NEP with a Complete NEP**

**Theorem 1.** *Given an arbitrary NEP* Γ*, there exists a complete NEP* Γ *such that the following two conditions are satisfied:*

*1. L*(Γ) = *L*(Γ )*;*

*2. Time*Γ(*n*) ∈ O(*Time*Γ(*n*))*.*

**Proof.** Let Γ = (*V*, *U*, *G*, N , *α*, *β*, *x*1, *xn*) be a NEP with the underlying graph *G* = (*XG*, *EG*) and *XG* = {*x*1, *x*2, ... , *xn*} for some *n* ≥ 1; *x*<sup>1</sup> ≡ *In* and *xn* ≡ *Halt*. We construct the NEP Γ = (*V* , *U* , *G* , N , *α* , *β* , *xstart*, *x<sup>s</sup> <sup>n</sup>*); *xstart* <sup>≡</sup> *In* and *<sup>x</sup><sup>s</sup> <sup>n</sup>* ≡ *Halt*, where

$$\begin{array}{c} V' = V\_{\prime} \\ T = \{t\_{i}^{l}, t\_{i}^{r}, t\_{i}^{l'}, t\_{i}^{r'}, t\_{i}^{l''}, t\_{i}^{r''} \mid 1 \le i \le n\} \end{array} \quad \mathcal{U}' = \mathcal{U} \cup T\_{\prime}.$$

Note that the underlying graph *G* is a complete graph. First, we add the following nodes to *G* :

• node *xstart* : *M* = {*ε* → *t l* 1 }, if *<sup>α</sup>*(*x*1) <sup>=</sup> *<sup>l</sup>* {*ε* → *t r* 1 }, if *<sup>α</sup>*(*x*1) = *<sup>l</sup>* , *PI* = ∅, *F I* = *T*, *PO* = ∅, *FO* = ∅, *α* = - *l*, if *α*(*x*1) = *l <sup>r</sup>*, if *<sup>α</sup>*(*x*1) = *<sup>l</sup>* , *<sup>β</sup>* = (*w*). • nodes *<sup>x</sup><sup>s</sup> <sup>i</sup>* , 1 ≤ *i* ≤ *n* (they actually simulate the work of *xi* in Γ):


For each node *xi*, 1 ≤ *i* ≤ *n* in Γ we add a subnetwork to Γ according to the subsequent cases:

*Case 1.* If *α*(*xi*) = *l*, the subnetwork is defined as follows (these nodes are used for preparing the string in the aim of processing them in the nodes *x<sup>s</sup> i*):

• nodes *<sup>x</sup>Ins <sup>i</sup>* , 1 ≤ *i* ≤ *n* : *M* = {*ε* → *t r i* }, *PI* = {*t l i* }, *F I* = ∅, *PO* = {*t r i* }, *FO* = ∅, *α* = *r*, *β* = (*w*).

$$\bullet \qquad \begin{array}{c} \text{nodes } x\_i^{Dcl}, \; 1 \le i \le n: \\ \hline \end{array} \\ \begin{array}{c} \text{nodes } x\_i^{Dcl}, \; 1 \le i \le n: \\ \hline \end{array} \\ \begin{array}{c} FI = \bigotimes\_r \\ \hline \end{array} \\ \begin{array}{c} FI = \bigotimes\_r \\ \hline \end{array} \\ \begin{array}{c} \text{nodes } x\_i^{Dcl}, \; 1 \le i \le n: \\ \hline \end{array} \\ \begin{array}{c} \text{nodes } x\_i^{Dcl}, \; 1 \le i \le n: \\ \hline \end{array} \\ \begin{array}{c} \text{nodes } x\_i^{Dcl}, \; 1 \le i \le n: \\ \hline \end{array} \\ \end{array}$$

$$\bullet \quad \begin{array}{c} \quad \begin{array}{c} \quad \begin{array}{c} \quad = \{ t\_{i}^{r} \to t\_{j}^{r'} \mid \{ \{ x\_{i}, x\_{j} \} \in \Gamma \} \cup \\ \{ t\_{i}^{r'} \to t\_{i}^{r} \} \cup \{ t\_{i}^{r'} \to t\_{i}^{r} \}, \end{array} \\ \hline \begin{array}{c} \text{nodes } x\_{i}^{Sub}, 1 \le i \le n: \\ \quad \begin{array}{c} PI = \{ t\_{i}^{r}, t\_{i}^{r'}, t\_{i}^{r'} \}, \\ \quad PO = \mathcal{O}, \\ \quad \end{array} \end{array} \quad \begin{array}{c} FI = \{ t\_{i}^{l'} \}, \\ \quad \begin{array}{c} FI = \{ t\_{i}^{l'} \}, \\ \quad \begin{array}{c} PI = \{ t\_{i}^{l'} \}, \\ \quad \beta = (w). \end{array} \end{array} \end{array}$$

*Case 2.* If *α*(*xi*) = *r*, the subnetwork is analogous to the *Case 1* with the characters *l* and *r* interchanged.

*Case 3.* If *α*(*xi*) = ∗, the subnetwork is defined as follows (the role of these nodes is the same as above, namely to prepare the strings for being processed in the nodes *x<sup>s</sup> i*):

$$\begin{array}{c} \mathcal{M} = \{t\_{i}^{r} \to t\_{j}^{\prime\prime} \mid \{\mathbf{x}\_{i}, \mathbf{x}\_{j}\} \in \Gamma\} \cup \\ \quad \{t\_{i}^{l} \to t\_{j}^{l'} \mid \{\mathbf{x}\_{i}, \mathbf{x}\_{j}\} \in \Gamma\} \cup \\ \quad \text{nodes } \mathbf{x}\_{i}^{\text{Sub}}, 1 \le i \le n: \\ \quad \begin{array}{c} \text{nodes } \mathbf{x}\_{i}^{\text{Sub}}, 1 \le i \le n: \\ \quad \{t\_{i}^{r} \to t\_{i}^{r}\} \cup \{t\_{i}^{l'} \to t\_{j}^{l}\} \cup \{t\_{i}^{\prime\prime} \to t\_{i}^{l}\}, \\ \quad \text{P} I = \{t\_{i}^{l}, t\_{i}^{r}, t\_{i}^{l'}, t\_{i}^{r'}, t\_{i}^{l'}\}, \\ \quad \quad \begin{array}{c} \text{F} I = \mathcal{O}, \\ \text{F} O = \mathcal{O}, \\ \text{F} = (\text{w}). \end{array} \end{array} \} $$

Let *w* be the input string in Γ. In the input node *xstart*, the character *t l* 1 is inserted at the beginning of the string if *α*(*x*1) ∈ {*r*, ∗}, or the character *t r* 1 is inserted at the end of the string, provided that *α*(*x*1) = *l*. Next, the string enters *xSub* <sup>1</sup> where the character is replaced with *t l* <sup>1</sup> and *t r* <sup>1</sup>, respectively. Then, the string can only enter *<sup>x</sup><sup>s</sup>* <sup>1</sup> and the simulation starts. Note that the same evolutionary rules applicable in *<sup>x</sup>*<sup>1</sup> <sup>∈</sup> <sup>Γ</sup> are also possible in *<sup>x</sup><sup>s</sup>* <sup>1</sup> since the special character *t l* 1 or *t r* 1 is set up in a way that it does not block the computation of nodes with *α* = *r* and *α* = *l*, respectively. Inductively, we may assume that a string of the form *t l i w* or *wt<sup>r</sup> <sup>i</sup>* lies in the node *<sup>x</sup><sup>s</sup> <sup>i</sup>* ∈ Γ if and only if the string *w* lies in the node *xi* ∈ Γ.

Let *w* be transformed into *w* in the node *xi* and sent to the connected nodes to *xi* in Γ. Then, a string *t l i w* or a string *wt<sup>r</sup> <sup>i</sup>* is produced in the node *<sup>x</sup><sup>s</sup> <sup>i</sup>* and sent to the node *<sup>x</sup>Sub <sup>i</sup>* . Let us analyze the case of a string *t l i w* . The process is analogous for the other string. In *xSub <sup>i</sup>* , the character *t l <sup>i</sup>* is replaced with the symbol *t l j* , assuming that {*xi*, *xj*} ∈ Γ, which ensures the new string can only be accepted by subnetworks *j* corresponding to nodes *xj* connected to *xi* in the original network Γ. From here, the process differs in accordance with the value *α* of the connected node *xj*.


#### **4. Simulating Any NEP with a Star NEP**

**Theorem 2.** *Given an arbitrary NEP* Γ*, there exists a star NEP* Γ *such that the following two conditions are satisfied:*

*1. L*(Γ) = *L*(Γ )*; 2. Time*Γ(*n*) ∈ O(*Time*Γ(*n*))*.*

**Proof.** Let Γ = (*V*, *U*, *G*, N , *α*, *β*, *x*1, *xn*) be a NEP with the underlying graph *G* = (*XG*, *EG*) and *XG* = {*x*1, *x*2, ... , *xn*} for some *n* ≥ 1; *x*<sup>1</sup> ≡ *In* and *xn* ≡ *Halt*. We construct the NEP Γ = (*V* , *U* , *G* , N , *α* , *β* , *xstart*, *x<sup>s</sup> <sup>n</sup>*); *xstart* <sup>≡</sup> *In* and *<sup>x</sup><sup>s</sup> <sup>n</sup>* ≡ *Halt*, where

$$\begin{aligned} V' &= V, & \mathcal{U}' &= \mathcal{U} \cup T, \\ T &= \{ t\_{i'}^l, t\_{i'}^r, t\_{i'}^{l'}, t\_{i'}^{l''}, t\_{i'}^{l'''}, t\_{i'}^{l'''}, t\_{i'}^{l'''} \mid 1 \le i \le n \} \end{aligned}$$

The *star* network uses the definitions illustrated above for the *complete* network, with the following modifications:

We add a new node *Star* to the subnetwork which acts as the center of the *star* network.

$$\begin{array}{c} \begin{array}{c} M = \{t\_{i}^{l} \rightarrow t\_{j}^{l'} \mid \{\mathbf{x}\_{i}, \mathbf{x}\_{j}\} \in \Gamma\} \cup \{t\_{i}^{r} \rightarrow t\_{j}^{r'} \mid \{\mathbf{x}\_{i}, \mathbf{x}\_{j}\} \in \Gamma\} \cup \\\ \begin{array}{c} \begin{array}{c} t\_{i}^{l'''} \rightarrow t\_{i}^{l} \end{array} \rightarrow t\_{i}^{l} \mid \cup \{t\_{i}^{r''} \rightarrow t\_{j}^{r}\}, \\\ PI = \mathcal{Q}, \\\ \text{PO} = \mathcal{Q}, \\\ \mathfrak{a} = \star, \end{array} \end{array} \end{array} \qquad \begin{array}{c} \begin{array}{c} \begin{array}{c} t\_{i}^{r} \rightarrow t\_{j}^{r} \mid \{\mathbf{x}\_{i}^{r} \rightarrow t\_{j}^{r} \mid \{\mathbf{x}\_{i}, \mathbf{x}\_{j}\} \in \Gamma\} \cup \{\mathbf{x}\_{i}, \mathbf{x}\_{j}\} \\\ \end{array} \end{array} \qquad \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} t\_{i}^{r} \rightarrow t\_{j}^{r} \end{array} \rightarrow \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \\ \end{array} \end{array} \end{array} \end{array} \end{array} \end{array} \right\} \end{array} \} \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \begin{array}{c} \\ \end{array} \end{array} \end{array} \end{array} \right\} \end{aligned}$$

The nodes *xSub <sup>i</sup>* , 1 ≤ *i* ≤ *n* are modified as follows: *Case 1.* If *α*(*xi*) = *l*:

$$\bullet \quad \begin{array}{c} \quad \begin{array}{c} \quad \begin{array}{c} \quad = \{t\_{i}^{r'} \to t\_{i}^{\prime\prime\prime}\} \cup \{t\_{i}^{r'\prime} \to t\_{i}^{\prime\prime\prime}\}, \\ \quad \end{array} \\ \hline \begin{array}{c} \text{nodes } x\_{i}^{Sub}, \; 1 \le i \le n: \\ \quad \begin{array}{c} PI = \{t\_{i}^{\prime\prime}, t\_{i}^{\prime\prime\prime}\}, \\ \quad \quad \begin{array}{c} FI = \{t\_{i}^{\prime\prime}\}, \\ \quad \end{array} \\ \quad \beta = (w). \end{array} \end{array} \end{array} \qquad \begin{array}{c} FI = \{t\_{i}^{\prime\prime}\}, \\ \quad \begin{array}{c} FI = \{t\_{i}^{\prime\prime}\}, \\ \quad \begin{array}{c} FI = \{t\_{i}^{\prime\prime}\}, \\ \quad \beta = (w). \end{array} \end{array}$$

*Case 2.* If *α*(*xi*) = *r*, the nodes *xSub <sup>i</sup>* are analogous to the *case 1* with the characters *l* and *r* interchanged.

*Case 3.* If *<sup>α</sup>*(*xi*) = <sup>∗</sup>, the nodes *<sup>x</sup>Sub <sup>i</sup>* , 1 ≤ *i* ≤ *n* are defined in the following way:

$$\bullet \quad \begin{array}{c} \mathcal{M} = \{ t\_i^{\prime\prime} \to t\_i^{\prime\prime\prime\prime} \} \cup \{ t\_i^{\prime\prime} \to t\_i^{\prime\prime\prime} \} \cup \\ \{ t\_i^{\prime\prime} \to t\_i^{\prime\prime\prime} \}, \\ \mathcal{H} = \{ t\_i^{\prime\prime}, t\_i^{\prime\prime}, t\_i^{\prime\prime\prime} \}, \\ \mathcal{O} = \mathcal{O}, \\ \mathfrak{a} = \*, \end{array} \qquad \begin{array}{c} \mathcal{M} = \{ t\_i^{\prime\prime} \to t\_i^{\prime\prime\prime\prime} \} \cup \{ t\_i^{\prime\prime} \to t\_i^{\prime\prime\prime} \} \cup \\ \{ \begin{array}{c} \mathcal{O} = \mathcal{O}, \\ \mathcal{O} = \mathcal{O}, \\ \mathcal{O} = \mathcal{O}, \\ \mathcal{O} = (\infty). \end{array} \}$$

Let *w* be the input string in Γ. In the input node *xstart*, the character *t l* 1 is inserted in the left-hand side of the string if *α*(*x*1) ∈ {*r*, ∗}, or the character *t r* 1 is inserted at the end of the string provided that *α*(*x*1) = *l*. Next, the string enters *Star* where no rule can be applied. From *Star*, it can only enter *xSub* <sup>1</sup> where the character is replaced with *t l* 1 and *t r* 1 , respectively. The new string returns to *Star* where *t l* 1 and *t r* 1 are changed to *t l* 1 and *t r* <sup>1</sup>. Then, the string can only enter *<sup>x</sup><sup>s</sup>* <sup>1</sup> and the simulation starts. Note that the same evolutionary rules applicable in *<sup>x</sup>*<sup>1</sup> <sup>∈</sup> <sup>Γ</sup> are also possible in *<sup>x</sup><sup>s</sup>* <sup>1</sup> since the special character *t l* 1 or *t r* 1 is set up in a way that it does not block the computation of nodes with *α* = *r* and *α* = *l*, respectively. Inductively, we may assume that a string of the form *t l i w* or *wt<sup>r</sup> <sup>i</sup>* lies in the node *x<sup>s</sup> <sup>i</sup>* ∈ Γ if and only if the string *w* lies in the node *xi* ∈ Γ.

Let *w* be transformed into *w* in the node *xi* and sent to the connected nodes to *xi* in Γ. Then, a string *t l i w* or a string *w t r <sup>i</sup>* is produced in the node *<sup>x</sup><sup>s</sup> <sup>i</sup>* and sent to the node *Star*. Let us analyze the case of a string *t l i w* . The process is analogous for the other string. In *Star*, the character *t l <sup>i</sup>* is replaced with the symbol *t l j* , granted that {*xi*, *xj*} ∈ Γ, which ensures the new string can only be accepted by subnetworks *j* corresponding to nodes *xj* connected to *xi* in the original network Γ. From here, the process is similar to the one described in the previous proof.


The explanations above allow us to infer that any step in Γ is simulated by a constant number of steps in Γ ; hence, *Time*Γ(*n*) ∈ O(*Time*Γ(*n*)) holds.

#### **5. Simulating Any NEP with a Grid NEP**

**Theorem 3.** *Given an arbitrary NEP* Γ *there exists a grid NEP* Γ *such that the following two conditions are satisfied:*


**Proof.** Let Γ = (*V*, *U*, *G*, N , *α*, *β*, *x*1, *xn*) be a NEP with the underlying graph *G* = (*XG*, *EG*) and *XG* = {*x*1, *x*2, ... , *xn*} for some *n* ≥ 1; *x*<sup>1</sup> ≡ *In* and *xn* ≡ *Halt*. We construct the NEP Γ = (*V* , *U* , *G* , N , *α* , *β* , *xstart*, *x<sup>s</sup> <sup>n</sup>*); *xstart* <sup>≡</sup> *In* and *<sup>x</sup><sup>s</sup> <sup>n</sup>* ≡ *Halt*, where

$$\begin{aligned} V' &= V\_{\prime} & \cup I' &= \cup I \cup T\_{\prime}, \\ T &= \{ t\_{i\prime}^l, t\_{i\prime}^r, t\_{i\prime}^{l\prime}, t\_i^{r\prime} \mid 1 \le i \le n \} \end{aligned}$$

First, we add the following nodes to Γ :

$$\begin{array}{c} \mathcal{M} = \left\{ \begin{array}{l} \{\varepsilon \to t\_{1}^{l}\}, \text{ if } a(x\_{1}) \neq l \\ \{\varepsilon \to t\_{1}^{l}\}, \text{ if } a(x\_{1}) = l \end{array} \right. \\ \mathsf{onde } \mathtt{x}\_{start}: \begin{array}{l} PI = \mathcal{O}\_{\prime} \\ PO = \mathcal{O}\_{\prime} \end{array} \right. \\ \mathsf{e} = \left\{ \begin{array}{l} l\_{\prime} \text{ if } a(x\_{1}) \neq l \\ r\_{\prime} \text{ if } a(x\_{1}) = l \end{array} \right. \\ \end{array} \qquad \begin{array}{l} FI = T\_{\prime} \\ FO = \mathcal{O}\_{\prime} \end{array} \qquad \begin{array}{l} FI = T\_{\prime} \\ FO = \mathcal{O}\_{\prime} \end{array} \qquad \begin{array}{l} FI = T\_{\prime} \\ FO = \mathcal{O}\_{\prime} \end{array} \} \\ \mathcal{A} = (w). \end{array}$$

• nodes *<sup>x</sup><sup>s</sup> <sup>i</sup>* , 1 ≤ *i* ≤ *n* : *M* = *M*(*xi*), *PI* = *PI*(*xi*), *F I* = *F I*(*xi*) ∪ *T* \ {*t l i* , *t r i* }, *PO* = *PO*(*xi*), *FO* = *FO*(*xi*), *α* = *α*(*xi*), *β* = *β*(*xi*).

For each node *xi*, 1 ≤ *i* ≤ *n* in Γ we add a subnetwork to Γ according to the subsequent cases:

*Case 1.* If *α*(*xi*) = *l*, the subnetwork is defined as follows:


*Case 2.* If *α*(*xi*) = *r*, the subnetwork is analogous to the *case 1* with the symbols *l* and *r* interchanged.

*Case 3.* If *α*(*xi*) = ∗, the subnetwork is defined as follows:

$$\bullet \quad \begin{array}{c} \mathcal{M} = \{ t\_i^r \to t\_j^{r'} \mid \{ x\_i, x\_j \} \in \Gamma \} \cup \\ \{ t\_i^l \to t\_j^{l'} \mid \{ x\_i, x\_j \} \in \Gamma \} \cup \\ \hline \end{array} \begin{array}{c} \{ t\_i^l \to t\_j^{r'} \mid \{ x\_i, x\_j \} \in \Gamma \} \cup \\ \{ t\_i^{l'} \to t\_j^{l} \} \cup \{ t\_i^{r'} \to t\_i^{r} \} \end{array}$$

Lastly, we add a set of dummy nodes to complete the grid topology with the specifications below:

$$\begin{array}{llll} \bullet & \text{nodes } D\_{i\prime} \ 1 \le i \le 2n \land \alpha(\mathbf{x}\_i) = \star: & PI = \mathcal{O}\_{\prime} & FI = \mathcal{U}\_{\prime} \\ & & \begin{array}{llll} \text{nodes } D\_{i\prime} \ 1 \le i \le 2n \land \alpha(\mathbf{x}\_i) = \star: & PI = \mathcal{O}\_{\prime} \\ \text{PO} = \mathcal{O}\_{\prime} & \text{FO} = \mathcal{O}\_{\prime} \\ \text{a} = \ast, & \beta = (\text{w}). \end{array} \end{array}$$

• nodes *D* : *M* = ∅, *PI* = ∅, *F I* = {*t l i* , *t r <sup>i</sup>* | 1 ≤ *i* ≤ *n*}, *PO* = ∅, *FO* = ∅, *α* = ∗, *β* = (*w*).

The grid network is set up in the following way.


Let *w* be the input string in Γ. In the input node *xstart*, the character *t l* <sup>1</sup> is inserted in the beginning of the string if *α*(*x*1) ∈ {*r*, ∗}, or the character *t r* <sup>1</sup> is inserted at the end of the string, if *<sup>α</sup>*(*x*<sup>1</sup> <sup>∈</sup> <sup>Γ</sup>) = *<sup>l</sup>*. Then, the string can only enter *<sup>x</sup><sup>s</sup>* <sup>1</sup> and the simulation starts. Note that the same evolutionary rules applicable in *<sup>x</sup>*<sup>1</sup> <sup>∈</sup> <sup>Γ</sup> are also possible in *<sup>x</sup><sup>s</sup>* <sup>1</sup> since the special character *t l* <sup>1</sup> or *t r* <sup>1</sup> is set up in a way that it does not block the computation of nodes with *α* = *r* and *α* = *l*, respectively. Inductively, we may assume that a string of the form *t l i w* or *wt<sup>r</sup> <sup>i</sup>* lies in the node *<sup>x</sup><sup>s</sup> <sup>i</sup>* ∈ Γ if and only if the string *w* lies in the node *xi* ∈ Γ.

Let *w* be transformed into *w* in the node *xi* and sent to the connected nodes to *xi* in Γ. Then, a string *t l i w* or a string *wt<sup>r</sup> <sup>i</sup>* is produced in the node *<sup>x</sup><sup>s</sup> <sup>i</sup>* and sent to the connected node *xSub <sup>i</sup>* . In this node, the symbols *t l <sup>i</sup>* and *t r <sup>i</sup>* are replaced with *t l j* and *t r j* , respectively, granted that {*xi*, *xj*} ∈ <sup>Γ</sup>. Then, the string continues through the second column of *<sup>x</sup>Sub <sup>i</sup>* nodes until it ultimately enters the node *xSub <sup>j</sup>* . Note that even if the string passes through the other nodes *xSub <sup>k</sup>* | *k* = *j*, no rule can applied so the string remains unchanged until it gets to the desired node. Next, the computation can be continued in one of the following ways:


#### **6. Conclusions and Further Work**

We have proposed three constructions for simulating an arbitrary NEP by a NEP having an underlying structure that is a complete graph, a star graph, and a two-dimensional grid, respectively. All these simulations are time efficient in the sense that every computational step in the given network is simulated by a constant number of computational steps in the constructed network.

In our view, it would be of interest whether or not similar results are valid for other variants of NEPs, such as polarized NEPs or NEPs with filtered connections as well as for variants of networks of splicing processors.

**Author Contributions:** Conceptualization, V.M.; methodology, V.M. and J.Á.S.M.; validation, V.M. and J.Á.S.M.; formal analysis, J.Á.S.M.; investigation, V.M. and J.Á.S.M.; writing—original draft preparation, J.Á.S.M.; writing—review and editing, V.M. and J.Á.S.M.; supervision, V.M.; funding acquisition, V.M. Both authors have read and agreed to the published version of the manuscript.

**Funding:** This work was partially supported by a grant of the Romanian Ministry of Education and Research, CCCDI-UEFISCDI, Project No. PN-III-P2-2.1-PED-2019-2391, within PNCDI III.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


### *Article* **Interdimensionality**

**Karl Svozil**

Institute for Theoretical Physics, TU Wien, Wiedner Hauptstrasse 8-10/136, 1040 Vienna, Austria; svozil@tuwien.ac.at

**Abstract:** In this speculative analysis, interdimensionality is introduced as the (co)existence of universes embedded into larger ones. These interdimensional universes may be isolated or intertwined, suggesting a variety of interdimensional intrinsic phenomena that can only be understood in terms of the outer, extrinsic reality.

**Keywords:** intrinsic perception; Hausdorff dimension; fractal

**MSC:** 00A73; 28A78; 28A80; 37C45; 54F35; 54F45; 83E15

#### **1. A Caveat: Speculation and Progress**

Rule inference is the process of hypothesizing a general rule or "law" from examples or "phenomena" [1,2]. The halting problem is the task to determine, given an arbitrary computer program and an input, whether the program will eventually halt or continue to run forever. This has been proven to be unsolvable in general. As the former rule inference problem can be reduced to the latter halting problem, it is provable unsolvable in general. This constraint on induction has been coped with by the philosophy of science in a variety of ways:

Popper suggested that, instead of induction and verification, which appears to be a hopeless endeavor, falsification might be a good demarcation criterion between science on the one hand, and on the other hand ideology, sophisms, or, in a more frugal term, bullshit [3]. Lakatos responded by criticizing that, due to side assumptions and a vast 'protective belt' of auxiliary hypotheses, in many practical circumstances, falsification fails. As a result, contemporaries can seldom predict what might turn out to become a progressive versus a degenerative research program [4].

Kuhn observed that science may be characterized by brief iconoclastic periods of revolution, followed by longer conformist periods of consolidation [5]. Feyerabend even challenged methodology as mythology and ideology akin to religious dogmas, and suggested keeping science wide open and performing an "exhaustive search" of ideas by allowing "anything" to enter the scientific debate, thereby, imposing little methodological restrictions [6]; he also recommended a formal separation between state and science, and lay judges for the evaluation of success [7] and the allocation of scientific funding.

In any case, there seems to be no convergence of conceptual progression. Taking gravity and celestial motion, for example: the Ptolemaic system was expressed in terms of geometry. It was superseded by the Copernican revolution that later became based on Newtonian gravitational forces. Later on, Newtonian gravity was replaced by the curved geometry of space–time of Einstein's theory of general relativity. By analogy, it appears highly likely that our contemporaries would view any model superseding the present canon as utterly speculative, if not outright nonsense.

Such a historic perspective leads to greater liberty and openness of ideas, and yet this creativity needs to be guided and stimulated by empirical findings and attempts to falsify consequences and claims. This amounts to an amalgam of the aforementioned ideas brought forward in the philosophy of science, resulting in a sort of pragmatism that is

**Citation:** Svozil, K.

Interdimensionality. *Axioms* **2021**, *10*, 300. https://doi.org/10.3390/ axioms10040300

Academic Editor: Palle E. T. Jorgensen

Received: 19 October 2021 Accepted: 9 November 2021 Published: 12 November 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

well balanced between wild fantasy and empirical grounding. Exactly how much of those ingredients are in order may greatly depend on the temperament and character of the individual researcher.

We, therefore, present the following considerations with a caveat to the reader, as it trespasses far beyond any empirically verifiable physics of our time; and yet some aspects of it might indicate the way to fruitful avenues of scientific modeling. We hope that the following speculations are not too weird for the realistic, critical, and sober mind. At best this could be seen as a vision of things to come.

#### **2. Definition**

Interdimensionality, or, by another naming, dimensional shadowing [8]—the "emulation" of a lowerdimensional configuration space by a fractal subset of a higherdimensional manifold—is the (co)existence and (co)habitation of parts or fragments of an "outer" space of a "higher" extrinsic Hausdorff dimension [9] by some "inner" subspace entity that has a "lower" or equal intrinsic Hausdorff dimension. One may imagine such a situation as a fractal of Hausdorff dimension *d* embedded in a continuum, such as the Hilbert space R*<sup>n</sup>* or C*n*, with *d* ≤ *n*. Therefore, pointedly speaking, we might exist on a sort of Cantor set or Menger sponge-like structure—fractals obtained by self-similar elimination of proper parts—of (almost) an integer Hausdorff dimension, which is part of a high-dimensional super-verse.

Formally, the Hausdorff dimension *<sup>d</sup>* of a set *<sup>A</sup>* <sup>∈</sup> <sup>R</sup>*n*, defined via the *<sup>d</sup>*-dimensional Hausdorff measure, is based on its "umklapp" property—the sudden change from measure value zero to infinity if the dimension parameter is taken higher or lower than a unique value—as follows. Suppose ∪*iFi* covers *A*, and suppose further that there exists a limit in which all individual constituents *Fi* of this covering become infinitesimal in diameter. Then, the Hausdorff measure *μd*, and a unique dimensional parameter *d* called the Hausdorff dimension is

$$\mu\_{\delta}(A) = \lim\_{\epsilon \to 0+} \inf\_{\{\overline{r}\_i\}} \left\{ \sum\_{i} \left( \text{diam } F\_i \right)^{\delta} \, \middle| \, \delta \in \mathbb{R}, \, \delta > 0, \, \cup\_i F\_i \supset A, \, \left( \text{diam } F\_i \right) \le \epsilon \right\}, \tag{1}$$

where the infimum is over all countable -covers {*Fi*} of *A*; with the dimension *d* as an "umklapp" parameter of

$$\mu\_{\delta}(A) = \begin{cases} 0 & \text{if } \delta > d, \\ \infty & \text{if } \delta < d. \end{cases} \tag{2}$$

That is, the Hausdorff dimension *d* is the unique dimensional parameter at which the measure *μδ* as a function of the dimensional parameter value *δ* smaller or larger than *d* is infinite or vanishes, respectively. Note that the diameter "diam" presupposes the notion of a distance defined via a metric. For self-similar fractal sets, the capacity dimension *c* is defined by

$$\mathfrak{c} = \lim\_{\mathfrak{e} \to 0+} \log[n(\mathfrak{e})] / \log \mathfrak{e}^{-1} \mathfrak{h} \,\tag{3}$$

where *n*() is the number of segments of length , equals the Hausdorff dimension *d*.

An example of a set of integer dimension *m* embedded into an outer space R*<sup>n</sup>* with *n* > *m* is the set whose (contravariant) coordinates with respect to some (covariant) basis R*<sup>n</sup>* is given by

$$\left\{ \left( \mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_m, r\_1(\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_m), \dots, r\_{n-m}(\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_m) \right)^\top \Big| \mathbf{x}\_i, r\_j \in \mathbb{R} \right\},\tag{4}$$

where *ri*(*x*1, *x*2, ... , *xm*), 1 ≤ *i* ≤ *n* − *m* are some total, possibly constant or random, choice functions.

For most practical operational purposes [10,11] the intrinsic perception of the dimensionality of such shadowed, interdimensional object might effectively remain that of a "solid continuum" of that intrinsic (Hausdorff) dimension. It may not be too unreasonable

to compare this to the common notion of "emptiness of space in-between point particles" constituting solid physical objects, or the "perceived continuous motion" from individual still frames [12,13].

There are some findings consistent such speculations: For instance, associated with every integer-dimensional regular rectifiable *m*-dimensional fractal embedded in R*n*, there exists a locally defined tangential *m*–dimensional vector subspace of R*<sup>n</sup>* [9,14]. Even for non-integer-dimensional fractals, integer-dimensional tangent spaces may be "good" approximations for all practical physical purposes.

Further examples for cohabitation of continua that need not involve fractals are paradoxical decompositions, such as Vitali's partition of the unit interval and the decomposition of the sphere by Hausdorff [15]. If we relax the definition of dimension, we may also speak of (dense) "scattered" point sets "inhabiting" the continuum. The variations may be manyfold; for instance, one may consider partitions or intertwined subsets of continua. One may not even deal with extrinsic continua but with general sets that allow some form of intrinsic embedding.

Let us finally review two almost trivial examples of an arbitrary number of onedimensional subspaces of R2, as schematically depicted in Figure 1. The first one is a collection of parallel lines. The second one is a star-shaped configuration intertwining in the origin, spanned by respective mutually distinct unit vectors. In the latter case, the only way for "flatlanders" [16] living on different subspaces to communicate with each other is through a single point—the origin.

**Figure 1.** Schematic drawing of interdimensional configurations that are (**a**) isolated or (**b**) intertwine, as seen from some outer, embedding space.

In general, fractals need not be regular and rectifiable and of integer dimension. Rather they may be "cloud-like shapes", with "scattered" holes and gaps. Those gaps will not be perceived intrinsically. Indeed, one may speculate that this situation gives rise to a metric that essentially mimics curvature [17].

Fractal theory has inspired and evolved into many innovative, useful, and interesting applications, especially in new materials and nanostructures. Such important developments can lead us to new views of, and physical means related to, dimensionality [18,19].

As the aim is the provision of a very general analysis that is unconstrained by the technicalities of specific models, no concrete theory is discussed. Nevertheless, it might be not too far-fetched to briefly mention some potential connections between interdimensionality and various paradigms in modern particle physics and cosmology. Some of these involve the description of a volume of space as conceptualized by holographic principles, such as the AdS/CFT correspondence related to D-branes in string theory, or the ekpyrotic models relying on string theory, branes, and extra "hidden" dimensions. Other scenarios in the context of the theory of general relativity involve traversable wormholes (aka Einstein–Rosen bridges) linking disparate points in spacetime.

#### **3. Disjoint and Intertwining Shadows**

To proceed to interdimensional motion, we need to consider intertwining areas of interdimensionality. The simplest nontrivial case is the one schematically depicted in

Figure 1b in which all universes share a single point of communication. Of greater interest might be a situation in which an entire region of space is shared. One might think also of a "small" fraction of a universe "traversing" another universe, such that, compared to the overall extension of these universes, this common share appears like the tip of an iceberg.

#### **4. Interdimensional Motion**

Interdimensional motion is the motion of some "inner" intrinsic subspace in the "outer", extrinsic space. If two inner spaces are involved, it may happen that certain limits of motion, such as continuity or maximal speed, that are valid in one subspace, can be breached and overcome by another subspace. In what follows, some scenarios will be discussed. We shall adopt the following notation: inner "intrinsic" subspaces will be denoted by *M* and *N*.

Let us discuss this by considering a simple example of a rotating point, as schematically drawn in Figure 2a. From the point of view of *M* the rotation in *N* is observed as periodic (dis)appearances of some object rotating in *M*.

Another "wormhole"-like scenario schematically drawn in Figure 2b is a "bend" or "curved" (relative to the exterior "outer" continuum) reference frame *M* that is intermittantly accessed from *N*. Suppose that the propagation speed limit for motion is the same *cM* = *cN* in both frames. Then, the object appears to be traveling with a velocity greater than this limit velocity in *M* because of the "shortcut" access through *N*.

Still another scenario schematically drawn in Figure 2c is one in which *N* allows for faster that *M*–light motion—that is, *cM cN*—and this property is used to access regions in *M* through motion in *N* that appear space-like separated in *M*'s frame of reference.

**Figure 2.** Schematic drawing of worldlines of interdimensional motion, as seen from the outer, embedding space: (**a**) periodic, (**b**) shortcut, and (**c**) coevolution.

#### *4.1. Interdimensional Chronology Protection*

In these and similar situations, no issues with respect inconsistent evolution, in particular, time paradoxes, arise. As whatever relative space–time reference frames are operationally constructed [20] in *M* and *N*, the "outer" extrinsic space, in which both *M* and *N* are embedded, regulates the phenomenology.

Indeed, from an extrinsic, "God's eye view" of the outer space there is no consistency issue because the evolution seen from this "global" comprehensive perspective never yields or allows inconsistent phenomena. Concerns raised by intrinsic space–time frames generated with the means available in *M* and *N* are merely epistemic, and the means are relative to the devices and conventions (such as for synchronizing clocks) available to the inhabitants of *M* and *N*.

This results in an interdimensional scheme of chronology protection based on the epistemic relativity of reference frames. At the same time, from an "outer" (i.e., ontological) point of view, those frames are "bundled together" through the coembedding and cohabitation of some outer space.

There are similarities between the consistency of observable phenomena regarding the higher-dimensional bulk space and the consistent histories approach to the Many Worlds models [21]. Both involve multiple "merging" paths.

#### *4.2. Examples of Dimensional Relativity*

The following examples closely follow the scenarios schematically depicted in Figure 2b,c. They have some similarities to ballistic missiles that avoid the limitations of velocity from atmospheric drag (friction) by leaving and re-entering Earth's atmosphere, or are analogs of supercavitation—the formation of vapor bubbles in a liquid caused by flow around an object, allowing minimal friction movement inside liquids at nearly the speed of sound.

The first example, depicted in Figure 3, shows an interdimensional dive into a dimension that allows higher velocities, or rather traversals of space per time, in *M* through "jump" into another dimension *N*, thereby, creating a shortcut from two space–time points *A* to *B*. This is different from breaking the intradimensional warp barrier by hyper-fast solitons in Einstein–Maxwell-plasma theory [22] as it employs dimensional capacities that are not bound by intradimensional motion.

**Figure 3.** Schematic drawing of (**a**) worldlines of interdimensional "jump" motion, as seen from the outer, embedding space: (**a**) "dive" into *N* at *A*, reappearance at *B*; (**b**) space–time diagram as seen from intrinsic coordinates in *M*; (**c**) space–time diagram as seen from intrinsic coordinates in *N*.

The second example, depicted in Figure 4, shows an interdimensional "drag" motion that uses a dimensional motion in *N* whose velocity exceeds that of the normal signal velocity in *M*. As already mentioned, in both of these cases, consistency is guaranteed by the overall consistency in the outer embedding space.

**Figure 4.** Schematic drawing of (**a**) worldlines of interdimensional forced, continuous motion, as seen from the outer, embedding space: (**a**) until *A* and from *B*, the motion is dominated by constraints on the velocity *vN*, and between *A* and *B*, the velocity *cN* dominates; (**b**) space–time diagram as seen from intrinsic coordinates in *M*; (**c**) space–time diagram as seen from intrinsic coordinates in *N*.

#### **5. Further Speculations**

Let us conclude this article with some speculative thoughts. The first is on limits to isolating the dimensions from one another, from "keeping them apart"; in particular, in the event of some catastrophic occurrence. It may well be that the domain of dimensional intersections may increase, as such events may dominate and spread to larger parts of the "outer" space.

Secondly, interdimensionality can be compared to computer simulations, with interfaces between such universes serving as intertwining regions. The difference between virtual reality (exchanges) and (intertwining) interdimensionality is the emphasis on measuretheoretic aspects in the latter case.

The matters discussed here must be considered highly speculative, and far from a fully developed formal theory. Nevertheless, it is our conviction that, to progress, science has to expand and explore a great variety of options, even if they appear remote to the contemporary mind.

**Funding:** This research was funded in whole, or in part, by the Austrian Science Fund (FWF), Project No. I 4579-N. For the purpose of open access, the author has applied a CC BY public copyright license to any Author Accepted Manuscript version arising from this submission.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The author declares no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

#### **References**


### *Article* **On Turing Machines Deciding According to the Shortest Computations**

**Florin Manea 1,2**


**Abstract:** In this paper we propose and analyse from the computational complexity point of view several new variants of nondeterministic Turing machines. In the first such variant, a machine accepts a given input word if and only if one of its shortest possible computations on that word is accepting; on the other hand, the machine rejects the input word when all the shortest computations performed by the machine on that word are rejecting. We are able to show that the class of languages decided in polynomial time by such machines is **PNP**[log] . When we consider machines that decide a word according to the decision taken by the lexicographically first shortest computation, we obtain a new characterization of **PNP**. A series of other ways of deciding a language with respect to the shortest computations of a Turing machine are also discussed.

**Keywords:** computational complexity; Turing machine; oracle Turing machine; shortest computations

#### **1. Introduction**

The computation of a nondeterministic Turing machine and, in fact, any computation of a nondeterministic machine that consists of a sequence of moves can be represented as a (potentially infinite) tree. Each node of this tree is an instantaneous description (ID for short); that is, a string encoding the configuration of the machine at a given moment: the content of the machine's memory and the current state of the machine. The children of a node are the IDs encoding the possible configurations in which the machine can be found after a (nondeterministic) move is performed starting from the ID corresponding to that node. If the computation is finite then the tree is also finite and each leaf of the tree encodes a final ID: an ID in which the state is either accepting or rejecting. The machine accepts if and only if one of the leaves encodes the accepting state (also in the case of infinite trees), and rejects if the tree is finite and all the leaves encode the rejecting state.

Therefore, in the case of finite computations, one can check if a word is accepted/rejected by a machine by searching in the computation tree for a leaf that encodes an accepting ID. Theoretically, this is done by a simultaneous traversal of all the possible paths in the tree (as we can deduce, for instance, from the definition of the time complexity of a nondeterministic computation). However, in practice, it is done by traversing each path at a time, until an accepting ID is found, or until the whole tree was traversed. Unfortunately, this may be a very time consuming task. Consequently, one may be interested in heuristic methods that may speed up this search, or, in other words, methods of using nondeterministic machines in a more efficient manner.

Our paper proposes such a method: the machine accepts a word if and only if one of the shortest paths in the computation tree ends with an accepting ID and rejects the input word if all the shortest paths end with rejecting IDs. Intuitively, we traverse the computation tree on levels and, as soon as we reach a level containing a leaf, we check if there is a leaf encoding an accepting ID on that level, and accept, or if all the leaves on that level are rejecting IDs, and, consequently, reject. While it is not hard to see that the

**Citation:** Manea, F. On Turing Machines Deciding According to the Shortest Computations. *Axioms* **2021**, *10*, 304. https://doi.org/10.3390/ axioms10040304

Academic Editor: Cristian S. Calude

Received: 13 October 2021 Accepted: 11 November 2021 Published: 13 November 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

class of languages which are accepted (respectively decided) by these machines is the class of recursively enumerable languages (respectively, the class of recursive languages), we are able to show that the class of languages that are decided according to this strategy by Turing machines, whose shortest computations have a polynomial number of steps, equals the class **PNP**[log] . As a consequence of this result we can also show that the class of languages that are decided by Turing machines, working in nondeterministic polynomial time on any input but deciding according to the computations that have a minimal number of nondeterministic moves, also equals the class **PNP**[log] . These results continue a series of characterizations of **PNP**[log] , started in [1–3].

Then, we propose another method: the machine accepts (rejects) a word if and only if the the first leaf that we meet in a breadth-first-traversal of the computation tree encodes an accepting ID (respectively, encodes a rejecting ID); note that in this case, one must define first an order between the sons of a node in the computation tree. Again, it is not hard to show that these machines have the same computational power as unrestricted Turing machines. However, we show that, in the case of ordering the tree lexicographically, the class of languages that are decided, according to this new strategy, by Turing machines whose shortest computations have a polynomial number of steps, equals the class **PNP**.

The research presented in this paper is related to a series of papers presenting variants of nondeterministic Turing machines, working in polynomial time, that accept (or reject) a word if and only if a specific property is (respectively, is not) verified by the possible computations of the machine on that word. We recall, for instance: polynomial machines that accept if and only if the number of accepting paths is even (⊕**P** from [4]), polynomial machines which accept if at least 1/2 of their computations are accepting, and reject if at least 1/2 of their computations are rejecting (the class **PP** [5], which coincidentally include **PNP**[**log**] [6]), or polynomial machines that accept if at least 2/3 of the computation paths accept and reject if at most 1/3 of the computation paths accept (the class of boundederror probabilistic polynomial time **BPPpath** from [7]); several other examples can be found on the Complexity Zoo web page (https://complexityzoo.net/ (accessed on 10 November 2021), a web page constructed and maintained, at the time when this paper was submitted, by the zookeeper Scott Aaronson, the veterinarian Greg Kuperberg, and the zoo conservationist Oliver Habryka on behalf of the LessWrong community) or in [8]. However, instead of looking at all the computations, we look just at the shortest ones, and instead of asking questions regarding the number of accepting/rejecting computations, we just ask existential questions about the shortest computations.

Our work finds motivations also in the area of nature-inspired supercomputing models. Some of these models (see [9,10], for instance) were shown to be complete by simulating, in a massively parallel manner, all the possible computations of a nondeterministic Turing machine; characterizations of several complexity classes, like **NP**, **P** and **PSPACE**, were obtained in this framework. However, these machines were, generally, used to accept languages, not to decide them; in the case when a deciding model was considered [9], the rejecting condition was just a mimic of the rejecting condition from classical computing models. Modifying such nature-inspired machines in order to decide as soon as a possible accepting/rejecting configuration is obtained, in one of the computations simulated in parallel, seems to be worth analysing: such a halting condition looks closer to what really happens in nature, and it leads to a reduced use of resources, comparing to the case when the machine kept on computing until all the possibilities were explored. Moreover, from a theoretical point of view, considering such halting conditions could lead to novel characterizations of a series of complexity classes (like the ones discussed in this paper) by means of nature-inspired computational models, as they seem quite close to the idea of deciding with respect to the shortest computations. To this end, we refer to the papers [11,12], and we leave open the question of whether similar results could be obtained for bio-inspired machines with more particular and compact structure [13–15] or for bio-inspired problem solvers [16].

#### **2. Basic Definitions**

The reader is referred to [8,17,18] for the basic definitions regarding Turing machines, oracle Turing machines, complexity classes and complete problems. In the following we present just the intuition behind these concepts, as a more detailed presentation would exceed the purpose of this paper.

A *k*-tape Turing machine is a construct *M* = (*Q*, *V*, *U*, *q*0, *acc*,*rej*, *B*, *δ*), where *Q* is a finite set of states, *q*<sup>0</sup> is the initial state, *acc* and *rej* are the accepting state, respectively, the rejecting state, *U* is the working alphabet, *B* is the blank-symbol, *V* is the input alphabet and *<sup>δ</sup>* : (*<sup>Q</sup>* \ {*acc*,*rej*}) <sup>×</sup> *<sup>U</sup><sup>k</sup>* <sup>→</sup> <sup>2</sup>(*Q*×(*U*\{*B*})*k*×{*L*,*R*}*<sup>k</sup>* ) is the transition function (that defines the moves of the machine). An instantaneous description (ID for short) of a Turing machine is a word that encodes the state of the machine and the contents of the tapes (actually, the finite strings of nonblank symbols that exist on each tape), and the position of the tape heads, at a given moment of the computation. An ID is said to be final if the state encoded in it is the accepting or the rejecting state. A computation of a Turing machine on a given word can be described as a sequence of IDs: each ID is transformed into the next one by simulating a move of the machine. If the computation is finite then the associated sequence is also finite and it ends with a final ID; a computation is said to be an accepting (respectively, rejecting) one, if and only if the final ID encodes the accepting state (respectively, rejecting state). All the possible computations of a nondeterministic machine on a given word can be described as a (potentially infinite) tree of IDs: each ID is transformed into its sons by simulating the possible moves of the machine; this tree is called a computation tree.

A word is accepted by a Turing machine if there exists an accepting computation of the machine on that word; it is rejected if all the computations are rejecting. A language is accepted (decided) by a Turing machine if all its words are accepted by the Turing machine, and no other words are accepted by that machine (respectively, all the other words are rejected by that machine). The class of languages accepted by Turing machines is denoted by **RE** (and is known as the class of recursively enumerable languages), while the class of languages decided by Turing machines is denoted by **REC** (and called the class of recursive languages).

The time complexity (or length) of a finite computation on a given word is the minimum between the number of IDs that occur in an accepting computation of that word and the height of the computations-tree of the machine on the word. A language is said to be decided in polynomial time if there exists a Turing *M* machine and a polynomial *f* such that the time complexity of a computation of *M* on each word of length *n* is less than *f*(*n*), and *M* accepts exactly the given language. The class of languages decided by deterministic Turing machines in polynomial time is denoted **P** and the class of languages decided by nondeterministic Turing machines in polynomial time is denoted **NP**. If a machine decides a language in polynomial time we usually say that this machine works in polynomial time.

A Turing machine with oracle *A*, where *A* is a language over the working alphabet of the machine, is a regular Turing machine that has a special tape (the oracle tape) and a special state (the query state). The oracle tape is just as any other tape of the machine, but, every time the machine enters the query state, a move of the machine consists of checking if the word found on the oracle tape is in *A* or not, and returning the answer.

We denote by **PNP** the class of languages decided by deterministic Turing machines, that work in polynomial time, with oracles from **NP**. We denote by **PNP**[log] the class of languages decided by deterministic Turing machines, that work in polynomial time, with oracles from **NP**, and which can enter the query state at most O(log *n*) times in a computation on a input word of length *n*.

The following problem is complete for **PNP**, with respect to polynomial time reductions (see [19] for a proof):

**Problem 1.** *(Odd—Travelling Salesman Problem, TSPodd) Let n be a natural number, and d be a function d* : {1, ... , *n*}×{1, ... , *n*} → *IN. Decide if the minimum value of the set I* = {∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> *d*(*π*(*i*), *π*(*i* + 1)) | *π is a permutation of* {1, . . . , *n*}*, and π*(*n* + 1) = *π*(1)} *is odd.*

We assume that the input of this problem is given as the natural number *n*, and *n*<sup>2</sup> numbers representing the values *d*(*i*, *j*), for all *i* and *j*. The size of the input is the number of bits needed to represent the values of *d* times *n*2.

Next we describe a **PNP**[log] -complete problem; however, we need a few preliminary notions (see [20] for a detailed presentation). Let *n* be a natural number and let *C* = {*c*1, ... , *cn*} be a set of *n* candidates. A preference order on *C* is an ordered list *cπ*(1) < *cπ*(2) < ... < *cπ*(*n*), where *π* is a permutation of {1, ... , *n*}; if *ci* appears before *cj* in the list we say that the candidate *ci* is preferred to the candidate *cj* in this order. Given a multiset *V* of preference orders on a set of *n* candidates *C* (usually *V* is given as a list of preference orders) we say that the candidate *ci* is a Condorcet winner, with respect to the preference orders of *V*, if *ci* is preferred to each other candidate in strictly more than half of the preference orders. We define the Dodgson score of a candidate *c*, with respect to *V*, as the smallest number of exchanges of two adjacent elements in the preference orders from *V* (switches, for short) needed to make *c* a Condorcet winner; we denote this score with *Score*(*C*, *c*, *V*). In [20] it was shown that the following problem is **PNP**[log] -complete, with respect to polynomial time reductions:

**Problem 2.** *(Dodgson Ranking, DodRank) Let n be a natural number, let C be a set of n candidates, and c and d two candidates from C. Let V be a multiset of preference orders on C. Decide if Score*(*C*, *c*, *V*) ≤ *Score*(*C*, *d*, *V*)*.*

We assume that the input of this problem is given as the natural number *n*, two numbers *c* and *d* less or equal to *n*, and a list of preference orders *V*, encoded as permutations of the set {1, ... , *n*}. If we denote by #(*V*) the number of preference orders in *V*, then the size of the input is O(#(*V*)*n* log *n*).

The connection between decision problems and languages is discussed in [18]. When we say that a decision problem is solved by a Turing machine, of certain type, we actually mean that the language corresponding to that decision problem is decided by that machine.

#### **3. Shortest Computations**

In this section we propose a modification of the way Turing machines decide an input word. Then we propose a series of results on the computational power of these machines and the computational complexity classes defined by them.

**Definition 1.** *Let M be a Turing machine and w be a word over the input alphabet of M. We say that w is accepted by M with respect to shortest computations if there exists at least one finite possible computation of M on w, and one of the shortest computations of M on w is accepting; w is rejected by M with regard to shortest computations if there exists at least one finite computation of M on w, and all the shortest computations of M on w are rejecting. We denote by Lsc*(*M*) *the language accepted by M with regard to shortest computations, i.e., the set of all words accepted by M, with regard to shortest computations. We say that the language Lsc*(*M*) *is decided by M with regard to shortest computations if all the words not accepted by M, with regard to shortest computations, are rejected with regard to shortest computations.*

The following remark shows that the computational power of the newly defined machines coincides with that of classic Turing machines.

**Remark 1.** *The class of languages accepted by Turing machines with regard to shortest computations equals* **RE***, while the class of languages decided by Turing machines with regard to shortest computations equals* **REC***.*

**Proof.** On the one hand, since any language from **REC** (respectively, **RE**) is decided (accepted) by a deterministic Turing machine, it is clear that it is also decided (accepted) with regard to shortest computations by the same machine. Indeed, a deterministic machine has a single computation, and this is also the shortest computation, so the decision reached

on this computation is the same decision reached when the machine works according to the shortest computation policy.

On the other hand, if a language is decided (respectively, accepted) by a Turing machine *M* with regard to shortest computations then that language is decided (accepted) by a classic deterministic Turing machine *M* as follows. The machine *M* simply generates the computation tree of *M* on an input word *w* level by level. Basically, this is a very simple process: starting with all the configurations on one level, *M* simulates one computational step of *M* on each of them, and collects the resulting configurations. In this way, *M* explores, in order, the levels of the computation tree of *M*. Then, the machine *M* stops as soon as it generates a level of the computation tree of *M* which contains a final ID. It accepts the input word if the respective level contains an accepting ID, and rejects otherwise. To a certain extent, the deterministic machine *M* explores the computation tree of *M* breadthfirst, and stops this exploration on the first level of this computation tree which contains final ID; the decision is then made by analysing the IDs of the respective level.

Next we define a computational complexity measure for the Turing machines that decide the shortest computations.

**Definition 2.** *Let M be a Turing machine, and w be a word over the input alphabet of M. The time complexity of the computation of M on w, measured with regard to shortest computations, is the length of the shortest possible computation of M on w. A language L is said to be decided in polynomial time with regard to shortest computations if there exists a Turing M machine and a polynomial f such that the time complexity of a computation of M on each word of length n, measured with regard to shortest computations, is less than f*(*n*)*, and Lsc*(*M*) = *L. We denote by PTimesc the class of languages decided by Turing machines in polynomial time with regard to shortest computations.*

The main result of this section is the following:

**Theorem 1.** *PTimesc* = **PNP**[log] *.*

**Proof.** The proof will be structured in two parts. First, we show the *upper bound PTimesc* ⊆ **PNP**[log] , and then we show the *lower bound PTimesc* <sup>⊇</sup> **<sup>P</sup>NP**[log] .

For the first part of the proof, let *L* ⊆ *V*<sup>∗</sup> be a language in *PTimesc* and let *M* be a Turing machine that decides *L* in polynomial time with regard to shortest computations. Additionally, let *f* be a polynomial such that the time complexity of the computation of *M* on each word of length *n*, measured with regard to shortest computations, is less than *f*(*n*). Finally, let # be a symbol not contained in *V*.

We define the language *<sup>L</sup>* <sup>=</sup> {*x*#*w*#1*<sup>k</sup>* <sup>|</sup> *<sup>w</sup>* <sup>∈</sup> *<sup>V</sup>*∗, *<sup>x</sup>* ∈ {0, 1}, and, if *<sup>x</sup>* <sup>=</sup> 1 (respectively, *x* = 0) there exists an accepting (respectively, rejecting) computation of *M*, of length less than *k*, on the input word *w*}. It is not hard to see that *L* is in **NP**. A nondeterministic machine deciding *L* works as follows: it simulates, nondeterministically, a computation of at most *k* steps of *M*, and accepts if and only if *x* = 1, or, respectively, *x* = 0, and the simulated computation is accepting, or, respectively, rejecting; otherwise (i.e., if in the *k* steps simulated by the machine a final configuration was not obtained) it rejects. Clearly, this machine works in polynomial time.

A deterministic Turing machine *M* , with oracle *L* , accepting *L* implements the following strategy, on an input word *w*:


by another oracle query, if 0#*w*#1*n*0−<sup>1</sup> <sup>∈</sup> *<sup>L</sup>* (i.e., if there exists a shorter rejecting computation of *M*). If the answer of the last query is positive, *M* rejects the input word, otherwise, it accepts.

Since the machine *M* has at least one possible computation on *w* of length less than *f*(|*w*|), and that *w* ∈ *L* if and only if the shortest computation of *M* accepts, it is clear that the machine *M* decides the language *L*. Furthermore, *M* works in polynomial time and makes at most O(log *n*) queries to the oracle *L* ; therefore, *<sup>L</sup>* <sup>∈</sup> **<sup>P</sup>NP**[log] . This completes the proof of the upper bound.

For the second inclusion, note that the class *PTimesc* is closed to polynomial-time reductions. That is, if *L* ∈ *PTimesc* and *L* is polynomial-time reducible to *L*, then *L* ∈ *PTimesc*. Indeed, assume that *g* is a function, that can be computed in polynomial time by a deterministic Turing machine such that, *w* ∈ *L* if and only if *g*(*w*) ∈ *L*. A machine that decides with regard to shortest computations the language *L* works as follows: first, for the input *w*, it computes deterministically the function *g*(*w*), and, then, runs the machine accepting *L* on the input *g*(*w*); it is clear that this machine implements the desired behaviour, and that it works in polynomial time, measured with regard to shortest computations. Therefore, it is sufficient to show that the **PNP**[log] -complete problem *DodRan* can be solved in polynomial time by a Turing machine *M* that makes a decision with regard to shortest computations.

Let us first make several denotations. The input of *M* consists in the number *n*, the set *C* of *n* candidates, *c* and *d* two candidates from *C*, and *V* the multiset of preference orders on *C* (encoded as explained in the previous section). It is not hard to see that one can verify if a candidate is a Condorcet winner for the multiset *V* of preference orders on *C* in polynomial time; let *f* be a polynomial that upper bounds the time needed to do this checking, for every *n* and #(*V*). Note that one needs at most (*n* − 1) #(*V*) 2 + 1 switches to make a candidate a Condorcet winner, since, in the worst case, we must bring this candidate from the last position to the first position in #(*V*) 2 + 1 of the orders. Additionally, making (*n* − 1) #(*V*) 2 + 1 switches in the orders of *V* requires polynomial time. Let *g* be a polynomial that sets the upper bounds for the time needed to make (*n* − 1) #(*V*) 2 + 1 switches, for every *n* and #(*V*).

This machine implements the following algorithm:


First, let us see that *M* works correctly. In step 1 it chooses nondeterministically some switches in *V*, that are supposed to make *c* and *d* Condorcet winners, respectively. Notice that the length of a possible computation performed in this step depends on the choice of the numbers *k*<sup>1</sup> and *k*2; if these numbers are smaller, then the computation is shorter. Then in step 2 the machine actually makes (deterministically) the switches chosen in the previous step. The length of a possible computation, until this moment, is still determined

by the choice of *k*<sup>1</sup> and *k*2. In steps 3 and 4 the machine verifies if those switches were indeed good to make *c* and *d* winners, according to the orders modified by the previously chosen moves. If they were both transformed in winners by the chosen switches, the computation continues with to step 5; otherwise, the machine makes a sequence of dummy steps, long enough to make that computation irrelevant for the final answer of the machine on the given input. Note that at least one choice of the switches, in step 1, makes both *c* and *d* winners. Now, the shortest computations are those ones in which both *c* and *d* were transformed into winners and the chosen numbers *k*<sup>1</sup> and *k*<sup>2</sup> are minimal. Yet this is exactly the case when *k*<sup>1</sup> = *Score*(*C*, *c*, *V*) and *k*<sup>2</sup> = *Score*(*C*, *d*, *V*). In the step 5, all the computations in which *c* and *d* were transformed into winners are completed by a deterministic comparison between *k*<sup>1</sup> and *k*2. Thus, after the execution of this step the shortest computations remain the ones where *k*<sup>1</sup> = *Score*(*C*, *c*, *V*) and *k*<sup>2</sup> = *Score*(*C*, *d*, *V*); the decision of this computation is to accept, if *k*<sup>1</sup> ≤ *k*2, or to reject, otherwise. Consequently, *M* accepts if and only if *Score*(*C*, *c*, *V*) ≤ *Score*(*C*, *d*, *V*), and rejects otherwise. Moreover, it is rather easy to see that *M* works in polynomial time, since each of the 5 steps described above can be completed in polynomial time.

In conclusion, we showed that *DodRan* can be solved in polynomial time by a Turing machine that decides with regard to shortest computations. It follows that *PTimesc* ⊇ **PNP**[log] , and this ends our proof.

The technique used in the previous proof to show that **PNP**[log] -complete problems can be solved in polynomial time by Turing machines that decide with regard to shortest computations suggests another characterization of **PNP**[log] . In this respect, consider nondeterministic Turing machines, working in polynomial time, that decide an input according to the decisions of the computations in which the least number of nondeterministic moves is made. Such a machine can be formally defined as follows:

**Definition 3.** *Let M be a Turing machine working in polynomial time and w be a word over the input alphabet of M. We say that w is accepted by M with respect to the computations with a minimum number of nondeterministic moves if one of the possible computations of M on w, in which M makes the minimum number of nondeterministic moves, is accepting; w is rejected by M with regard to the computations with minimum number of nondeterministic moves if all the possible computations of M on w, in which M makes the minimum number of nondeterministic moves, are rejecting.We denote by Lnm*(*M*) *the language decided by M with regard to the computations with a minimum number of nondeterministic moves and by PTimenm the class of all the languages decided in this manner.*

It is not hard to see that, given a Turing machine working in polynomial time and an input word for that machine, the machine will always decide the input word with regard to the computations with minimum number of nondeterministic moves, since all of its computations are finite. One can show the following result.

**Theorem 2.** *PTimenm* = **PNP**[log] *.*

**Proof.** We can use a proof similar to the one of Theorem 1.

For the inclusion *PTimenm* <sup>⊆</sup> **<sup>P</sup>NP**[log] we can assume, without loss of generality, that the machine accepting a language from *PTimenm* has all the possible computations on an input of length *n* of the same length *f*(*n*), for some polynomial *f* (we can complete some of the computations with dummy deterministic steps, in order to make this happen). Then we just have to search (using binary search) for the computation with the minimum number of nondeterministic moves, and check if it is an accepting or rejecting one.

For the inclusion *PTimenm* <sup>⊇</sup> **<sup>P</sup>NP**[log] , we use the machine constructed in the proof of *PTimesc* <sup>⊇</sup> **<sup>P</sup>NP**[log] , and note that the shortest computations performed by this machine on a certain input are also the computations where the minimum number of nondeterministic moves are made. This concludes our proof.

#### **4. The First Shortest Computation**

*4.1. Ordered Turing Machines*

In the previous section we proposed a decision mechanism of Turing machines that basically consisted in identifying the shortest computations of a machine on an input word, and checking if one of these computations is an accepting one, or not. Now we analyse how the properties of the model are changed if we order the computations of a machine and the decision is made according to the first shortest computation, in the defined order.

Let *M* = (*Q*, *V*, *U*, *q*0, *acc*,*rej*, *B*, *δ*) be a *t*-tape Turing machine, and assume that *δ*(*q*, *a*1, ... , *at*) is a totally ordered set, for all *ai* ∈ *U*, *i* ∈ {1, ... , *t*}, and *q* ∈ *Q*; we call such a machine an *ordered Turing machine*. Let *w* be a word over the input alphabet of *M*. Assume that *s*<sup>1</sup> and *s*<sup>2</sup> are two (potentially infinite) sequences describing two possible computations of *M* on *w*. We say that *s*<sup>1</sup> is lexicographically smaller than *s*<sup>2</sup> if *s*<sup>1</sup> has fewer moves than *s*2, or they have the same number of steps (potentially infinite), the first *k* IDs of the two computations coincide and the transition that transforms the *k*th ID of *s*<sup>1</sup> into the *k* + 1th ID of *s*<sup>1</sup> is smaller than the transition that transforms the *k*th ID of *s*<sup>2</sup> into the *k* + 1th ID of *s*2, with respect to the predefined order of the transitions. It is not hard to see that this is a total order on the computations of *M* on *w*. Therefore, given a finite set of computations of *M* on *w*, one can define the lexicographically first computation of the set as that one which is lexicographically smaller than all the others.

**Definition 4.** *Let M be an ordered Turing machine, and w be a word over the input alphabet of M. We say that w is accepted by M with respect to the lexicographically first computation if there exists at least one finite possible computation of M on w, and the lexicographically first computation of M on w is accepting; w is rejected by M with regard to the lexicographically first computation if the lexicographically first computation of M on w is rejecting. We denote by Llex*(*M*) *the language accepted by M with regard to the lexicographically first computation. We say that the language Llex*(*M*) *is decided by M with regard to the lexicographically first computation if all the words not contained in Llex*(*M*) *are rejected by M.*

As in the case of Turing machines that decide with regard to shortest computations, the class of languages accepted by Turing machines with regard to the lexicographically first computation equals **RE**, while the class of languages decided by Turing machines with regard to the lexicographically first computation equals **REC**. The time complexity of the computations of Turing machines that decide with regard to the lexicographically first computation is defined exactly as in the case of machines that decide with regard to shortest computations. We denote by *PTimelex the class of languages decided by Turing machines in polynomial time with regard to the lexicographically first computation.* In this context, we are able to show the following theorem.

### **Theorem 3.** *PTimelex* = **PNP***.*

**Proof.** In the first part of the proof we show that *PTimelex* <sup>⊆</sup> **<sup>P</sup>NP**. Let *<sup>L</sup>* be a language in *PTimelex* and let *M* be a Turing machine that decides *L* in polynomial time with regard to the lexicographically first computation. Additionally, let *f* be a polynomial such that the time complexity of the computation of *M* on each word of length *n*, measured with regard to the lexicographically first computation, is less than *f*(*n*).

We define the language *L* = {*x*#*w*#*w* #1*<sup>k</sup>* <sup>|</sup> *<sup>w</sup>* <sup>∈</sup> *<sup>V</sup>*∗, *<sup>w</sup>* is a sequence of consecutive IDs of *M*, *x* ∈ {0, 1}, and, if *x* = 1 (respectively, *x* = 0) there exists an accepting (respectively, rejecting) computation of *M* on the input word *w* of length less than *k*, starting with the sequence of IDs *w* }. It is not hard to see that *L* is in **NP**. A nondeterministic machine deciding it works as follows: it simulates, nondeterministically, a computation of at most *k* steps of *M*, starting with the IDs in the sequence *w* , and accepts if and only if this *x* = 1,or, respectively, *x* = 0, and the simulated computation is accepting, or, respectively, rejecting; otherwise (i.e., if in the simulated computation steps a final configuration was not obtained), it rejects. Clearly, this machine works in polynomial time.

A deterministic Turing machine *M* , with oracle *L* , accepting *L* implements the following strategy, on an input word *w*:


It is not hard to see that *M* correctly computes the length *n*<sup>0</sup> of the shortest computation of *M* on an input word *w*. Also, once this length computed, the first shortest computation is identified, and the machine checks if this computation is an accepting or a rejecting one. Thus, *M* implements the desired behaviour. Finally, note that *M* works in polynomial time: in step 2 it makes O(*n*0) queries, asking if strings of polynomial length are in *L* , while the rest of the computation is clearly carried out in polynomial time. This completes the proof of the upper bound on *PTimelex*.

To show the second inclusion, note that, similar to the case of machines deciding with regard to shortest computations, the class *PTimelex* is closed to polynomial-time reductions. Thus, it is sufficient to show that the **PNP**-complete problem *TSPodd* can be solved in polynomial time by a Turing machine *M* that decides with regard to the lexicographically first computation.

Therefore, we construct a Turing machine *M* that solves *TSPodd* with regard to the lexicographically first computation. The input of this machine consists in a natural number *<sup>n</sup>*, and *<sup>n</sup>*<sup>2</sup> natural numbers, encoding the values of the function *<sup>d</sup>* : {1, ... , *<sup>n</sup>*}×{1, ... , *<sup>n</sup>*} → *IN*. We can assume, without losing generality, that all the input numbers are given as decimal numbers; furthermore, we assume that all the *n*<sup>2</sup> numbers, that encode the values of the function *d*, have the same number of decimal digits, denoted by *m* (we may add some leading zeros at the beginning of these numbers in order to make this assumption hold). Therefore, the size of the input is <sup>O</sup>(*n*2*m*). Additionally, let us make the assumption that every time we sum up *n* numbers of *m* digits we make exactly *f*(*m*, *n*) steps, where *f* is a polynomial, and the sum is always represented using the same number of digits (clearly bounded by the input size).

This machine implements the following algorithm:


It is important to state that the order of the nondeterministic moves that are executed in steps 1 and 3 has no impact on the computation. For uniformity we consider that they are ordered, but we do not make any assumption on what order is actually used.

Before showing that the machine works correctly, we notice that it works in polynomial time. Indeed, it is not hard to see that every possible computation of *M* consists of a sequence of steps of polynomial length, and always ends with a decision.

To show the soundness of our construction, let us observe that all the possible computations implemented by the first 3 steps of the above algorithm have the same length. In the first of these steps we choose a possible permutation *π* of {1, ... , *n*} and compute the sum *S* = ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> *d*(*π*(*i*), *π*(*i* + 1)); in this way we have computed a possible solution of the Travelling Salesman Problem, defined by the function *d*, and the real solution of the problem should be at most *S*. Then we try to find another permutation *π* that leads to a smaller sum. For this we choose first a number *S*<sup>0</sup> that has as many digits as *S* (of course, it may have several leading zeros); however, the computations are ordered in such a manner that a computation in which smaller numbers are constructed comes before a computation in which a greater number is constructed. Then, in steps 3 and 4, *M* verifies if *S* can be equal to the sum ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> *d*(*π* (*i*), *π* (*i* + 1)), for a permutation *π* nondeterministically chosen. If the answer is yes then it means that *S*<sup>0</sup> is also a possible solution of the problem; otherwise, we conclude that the nondeterministic choices made so far were not really the good ones, so we reject after we make a long enough sequence of dummy steps, in order not to influence the decision of the machine. Finally, we verify if *S*<sup>0</sup> is odd, and accept if and only if this condition holds. By the considerations made above, it is clear that in all the shortest computations we identified some numbers that can represent solutions of the Travelling Salesman Problem; moreover, in the first of the shortest computations we have identified the smallest such number, i.e., the real solution of the problem. Consequently, the decision of the machine is to accept or to reject the input according to the parity of the solution identified in the first shortest computation, which is correct.

Summarizing, we showed that *TSPodd* can be solved in polynomial time by a Turing machine that decides with regard to the lexicographically first computation. It follows that *PTimelex* <sup>⊇</sup> **<sup>P</sup>NP**, and this concludes our proof.

**Remark 2.** *Note that the proof of Theorem 1 shows that* **PNP**[log] *can be also characterized as the class of languages that can be decided in polynomial time with regard to shortest computations by nondeterministic Turing machines whose shortest computations are either all accepting or all rejecting. On the other hand, in the proof of Theorem 3, the machine that we construct to solve with regard to the lexicographically first computation the TSPodd problem may have both accepting and rejecting shortest computations on the same input. This shows that* **PNP**[log] = **PNP** *if and only if all the languages in* **PNP** *can be decided with regard to shortest computations by nondeterministic Turing machines whose shortest computations on a given input are either all accepting or all rejecting.*

#### *4.2. Ordering Functions*

There is a point where the definition of the ordered Turing machine does not seem satisfactory: each time a machine has to execute a nondeterministic move, for a certain state and a tuple of scanned symbols, the order of the possible moves is the same, regardless of the input word and the computation performed until that moment. Therefore, we consider another variant of ordered Turing machines, in which such information is considered: Let *M* be a Turing machine. We denote by *M* a binary encoding of this machine (see, for instance, [18]). It is clear that the length of the string *M* is a polynomial with respect to the number of states and the working alphabet of the machine *M*. Let *g* : {0, 1, #}<sup>∗</sup> → {0, 1, #}<sup>∗</sup> be a function such that *g*(*M*#*w*1#*w*2# ... #*wk*) = *w* 1#*w* <sup>2</sup># ... #*w <sup>p</sup>*, given that *w*1, ... , *wk* are binary encodings of the IDs that appear in a computation of length *k* of *M* (we assume that they appear in this order, and that *w*<sup>1</sup> is an initial configuration), and *w* <sup>1</sup>, ... , *w <sup>p</sup>* are the IDs that can be obtained in one move from *wk*. Clearly, this function induces canonically an ordering on the computations of a Turing machine. Assume *s*<sup>1</sup> and *s*<sup>2</sup> are two (potentially infinite) sequences describing two possible computations of *M* on *w*. We say that *s*<sup>1</sup> is *g*-smaller than *s*<sup>2</sup> if the first *k* IDs of the two computations, which can be encoded by the strings *w*1, ... , *wk*, coincide, and *g*(*M*#*w*1#*w*2# ... #*wk*) = *w* 1#*w* <sup>2</sup># ... #*w <sup>p</sup>*, the *k* + 1th ID of *s*<sup>1</sup> is encoded by *w i* , the *k* + 1th ID of *s*<sup>2</sup> is encoded by *w j* , and *i* < *j*. It is not hard to see that *g* induces a total order on the computations of *M* on *w*; thus, we will call such a function *an ordering function*. Therefore, given a finite set of computations of *M* on *w* we can define the *g*-first computation of the set as the one that is *g*-smaller than all the others.

**Definition 5.** *Let M be a Turing machine, and g* : {0, 1, #}<sup>∗</sup> → {0, 1, #}<sup>∗</sup> *be an ordering function. We say that w is accepted by M with respect to the g-first shortest computation if there exists at least one finite possible computation of M on w, and the g-first of the shortest computations of M on w is an accepting one; w is rejected by M with regard to the lexicographically first computation if the g-first shortest computation of M on w is a rejecting computation. We denote by L<sup>g</sup> f sc*(*M*) *the language accepted by M with regard to the g-first shortest computation, i.e., the set of all words accepted by M, with regard to the g-first shortest computation. As in the case of regular Turing machines, we say that the language L<sup>g</sup> f sc*(*M*) *is decided by M with regard to the g-first shortest computation if all the words not contained in L<sup>g</sup> f sc*(*M*) *are rejected by that machine, with regard to the g-first shortest computation.*

It is not surprising that, if *g* is Turing computable, the class of languages accepted by Turing machines with regard to the *g*-first shortest computation equals **RE**, while the class of languages decided by Turing machines with regard to the lexicographically first computation equals **REC**. The time complexity of the computations of Turing machines that decide with regard to the *g*-first shortest computation is defined exactly as in the case of machines that decide with regard to shortest computations. We denote by *PTime<sup>g</sup> f sc the class of languages decided by Turing machines in polynomial time with regard to the g-first shortest computation.* We also denote by *PTimeof sc* the union of all the classes *PTime<sup>g</sup> f sc*, where the ordering function *g* can be computed in polynomial deterministic time. We are now able to show the following theorem.

**Theorem 4.** *PTimeof sc* = **PNP***.*

**Proof.** In fact, we will show that *PTimeof sc* = *PTimelex*. First, let us observe that the inclusion *PTimeof sc* ⊇ *PTimelex* holds canonically. Indeed, the lexicographical order of the computations defined in the previous section is just a particular case of an order defined by an ordering function computable in deterministic polynomial time.

Further, we show that *PTimeof sc* ⊆ *PTimelex*. Given *g* an ordering function that can be computed in deterministic polynomial time, let *L* be a language and *M* be a Turing machine that decides in polynomial time *L* with regard to the *g*-first shortest computation. Let us assume, without loss of generality, that the time needed to compute the value of *g* for a string of *k* configurations of *M*, all having the same initial configuration, regardless of the configurations. We define an ordered machine *M* and show that it decides *L* with regard to the lexicographically first computation, also in polynomial time.

We will not give the details of the construction of *M* , as they can be quite tedious, but we will give the main idea implemented by this machine. The machine *M* basically simulates the computation of the machine *M* and keeps on a track (called "memory track") the encoding of *M* and the encodings of IDs of *M* that were obtained during the simulated computation. Assume that *M* should simulate a move of *M*, provided that the current state of *M* is *q* and the scanned symbols are (*a*1, ... , *ak*). First, *M* enters in a state *qg* in which it computes the value of the function *g* having as argument the string saved on

the memory track. Suppose that the computed value is the string *w* 1#*w* <sup>2</sup># ... #*w <sup>p</sup>*, and the machine *M* must make the transition *mi* to obtain the ID *w <sup>i</sup>* from the current ID, for *i* ∈ {1, ... , *p*}. Accordingly, the machine *M* enters in a state *qm*1,...,*mp* , and from this state it must make a nondeterministic move that simulates the move of *M*. However, we define *M* such that its possibilities, in this case, are ordered: the first comes the move *m*1, then the move *m*2, and so on, finally coming *mp* (*m*<sup>1</sup> < *m*<sup>2</sup> < ... < *mp*, in the formalism of ordered machines). Once the move is simulated, the machine *M* saves the encoding of the current ID of the simulated machine (again, we may assume that this operation can be done in the same time for any ID, since their length is bounded by a polynomial), and goes on to simulate the next move of *M*.

It is not hard to see that *M* simulates soundly the behaviour of *M*. Basically, *M* keeps a history of the computation performed by *M* and uses a subroutine, computing the function *g*, to ensure that the lexicographical order of the simulated computations coincides with the order defined by the function *g* for the machine *M* and its real computations. Additionally, the part of the algorithm implemented by *M* that is not involved in the actual simulation (that is in keeping the history of the simulated computation and computing the values of *g*) depends only on the number of steps of *M* simulated until that point and on the input word, so it is quite easy to see that the shortest computations of *M* are simulated by the shortest computations of *M* ; moreover, the *g*-first shortest computation of *M* is simulated by the lexicographically first shortest computation of *M* .

It follows that the language *L* is decided by *M* in polynomial time with regard to the lexicographically first computation.

To conclude, we showed that *PTimeof sc* ⊆ *PTimelex*.

It follows that *PTimeof sc* = *PTimelex* and, according to Theorem 3, we obtain the identity *PTimeof sc* = **PNP**.

Notice that **<sup>P</sup>NP**[log] <sup>⊆</sup> *PTime<sup>g</sup> f sc* <sup>⊆</sup> **<sup>P</sup>NP**, for all the ordering functions *<sup>g</sup>* which can be computed in polynomial deterministic time. The second inclusion is immediate from the previous Theorem, while the first one follows from the fact that any language in **PNP**[log] is accepted with regard to shortest computations, in polynomial time, by a nondeterministic Turing machine whose shortest computations are either all accepting or all rejecting; clearly, the same machine can be used to show that the given language is in *PTime<sup>g</sup> f sc*.

It is interesting to see that for some particular ordering functions, as for instance the one that defines the lexicographical order discussed previously, a stronger result holds: *PTime<sup>g</sup> f sc* = **<sup>P</sup>NP** (where *<sup>g</sup>* is the ordering function). We leave as an open problem to see if this relation holds for all the ordering functions, or, if not, to see when it hold.

#### **5. Conclusions and Further Work**

In this paper, we have shown that considering a variant of Turing machine, that decides an input word according to the decisions of the shortest computations of the machine on that word, leads to new characterizations of two well-studied complexity classes **PNP**[log] and **PNP**. These results seem interesting since they provide alternative definitions of these two classes that do not make use of any other notion than the Turing machine (such as oracles, reductions, etc.) Note that some of our proofs rely on showing that complete problems can be solved by machines deciding with respect to the shortest computations. These complete problems were chosen according to the personal preferences of the author; clearly, other complete problems could have been solved similarly with the respective techniques. We feel, however, that our solutions capture entirely the ideas that connect the different complexity classes we characterize with the usage of shortest computations.

From a theoretical point of view, an attractive continuation of the present work would be to analyse if the equality results in Theorems 1–3 relativise. It is not hard to see that the upper bounds shown in these proofs are true even if we allow all the machines to have access to an arbitrary oracle. It remains to be settled if a similar result holds in the case of the lower bounds. However, we conjecture that the lower bounds do not hold in the presence of arbitrary oracles, highlighting, in this way, the difference between the way our variant of Turing machine decides and the way regular oracle Turing machines decide.

Nevertheless, other accepting/rejecting conditions related to the shortest computations could be investigated. As we mentioned in the Introduction, several variants of Turing machines that decide a word according to the number of accepting, or rejecting, computations were already studied. We intend to analyse what happens if we use similar conditions for the shortest computations of a Turing machine. In this respect, using the ideas of the proof of Theorem 3, one can show that

**Theorem 5.** *Given a nondeterministic polynomial Turing machine M*1*, one can construct a nondeterministic polynomial Turing machine, with access to* **NP***-oracle, M*2*, whose computations on an input word correspond bijectively to the short computations of M*<sup>1</sup> *on the same word, such that two corresponding computations are both either accepting, or rejecting.*

**Proof.** Let *M* be a nondeterministic Turing machine working in polynomial time. Furthermore, let *f* be a polynomial such that the time complexity of the computation of *M* on each word of length *n* is less than *f*(*n*).

Recall the language *L* = {*x*#*w*#*w* #1*<sup>k</sup>* <sup>|</sup> *<sup>w</sup>* <sup>∈</sup> *<sup>V</sup>*∗, *<sup>w</sup>* is a sequence of consecutive IDs of *M*, *x* ∈ {0, 1}, and, if *x* = 1 (respectively, *x* = 0) there exists an accepting (respectively, rejecting) computation of *M* on the input word *w* of length less than *k*, starting with the sequence of IDs *w* }, from the proof of Theorem 3. Additionally, recall that *L* is in **NP**.

We construct now a nondeterministic Turing machine *M* , with oracle *L* , that acts as follows:


It is not hard to see that *M* correctly computes the length *n*<sup>0</sup> of the shortest computation of *M* on an input word *w*. Additionally, once this length computed, the shortest computations of *M* are identified, and the machine simulates these computations nondeterministically. Thus, the computations of *M* can be put in a bijective correspondence with the shortest computations of *M* : one of the shortest computations of *M* corresponds to the computation of *M* that simulates this shortest computation. Finally, note that *M* works in nondeterministic polynomial time.

This concludes the proof of Theorem 5.

This Theorem is useful to show upper bounds on the complexity classes defined by counting the accepting/rejecting shortest computations. Some examples in this direction

are: **PPsc** <sup>⊆</sup> **PPNP** (where **PPsc** is the class of decision problems solvable by a nondeterministic polynomial Turing machine which accepts if and only if at least 1/2 of the shortest computations are accepting, and rejects otherwise) or **BPPsc** <sup>⊆</sup> **BPPNP path** (where **BPPsc** is the class of decision problems solvable by a nondeterministic polynomial Turing machine which accepts if at least 2/3 of the shortest computations are accepting, and rejects if at least 2/3 of the shortest computations are rejecting).

**Remark 3.** *However, in some cases, one can show stronger upper bounds; for instance,* **PPsc** ⊆ **PPNP**[log] **ctree** *(where* **PPNP**[log] **ctree** *is the class of decision problems solvable by a* **PP***-machine which can make a total number of* O(log *n*) *queries to an* **NP***-language in its entire computation tree, on an input of length n). It seems an interesting problem to find lower bounds for such classes, as well.*

**Proof.** Let *M* be a nondeterministic Turing machine working in polynomial time. Additionally, let *f* be a polynomial such that the time complexity of the computation of *M* on each word of length *n* is less than *f*(*n*).

Recall the language *L* = {*x*#*w*#*w* #1*<sup>k</sup>* <sup>|</sup> *<sup>w</sup>* <sup>∈</sup> *<sup>V</sup>*∗, *<sup>w</sup>* is a sequence of consecutive IDs of *M*, *x* ∈ {0, 1}, and, if *x* = 1 (respectively, *x* = 0), there exists an accepting (respectively, rejecting) computation of *M* on the input word *w* of length less than *k*, starting with the sequence of IDs *w* }, from the proof of Theorem 3. Recall also that *L* is in **NP**.

We construct now a nondeterministic Turing machine *M* , with oracle *L* , that acts as follows:


It is not hard to see that *M* correctly computes the length *n*<sup>0</sup> of the shortest computation of *M* on an input word *w*. It is also clear that the difference between the number of accepting paths and the number of rejecting paths of *M* equals the difference between the number of accepting shortest computations and rejecting shortest computations of *M*. Finally, note that *M* works in nondeterministic polynomial time, and it makes O(log *n*) queries to a **NP** language, summed up over all the possible computations. Therefore, if we see *M* as a **PP**-machine, it makes exactly the same decision as *M*, seen as a **PPsc**-machine.

Clearly, this implies that **PPsc** <sup>⊆</sup> **PPNP**[log] **ctree** , and our proof is concluded.

Alternatively, one can see that all the languages from **PPsc** can be accepted by deterministic Turing machines working in polynomial time, that are allowed to make O(log *n*) queries to **NP** and exactly one query to **PP**, which gives the decision of the machine, on an input of length *n*. The only difference from the above idea is that step 2 of the algorithm is replaced by a **PP**-language query.

Another remark is that the idea presented above holds in the case of other classes, like ⊕**P** (where ⊕**P** is the class of decision problems solvable by a nondeterministic polynomial Turing machine which accepts if and only if the number of accepting paths is even), which was introduced in [4].

One can show, similarly to the above, that <sup>⊕</sup>**P***sc* ⊆ ⊕**PNP**[log] **ctree** (where <sup>⊕</sup>**PNP**[log] **ctree** is the class of decision problems solvable by a ⊕**P**-machine which can make a total number of O(log *n*) queries to an **NP**-language in its entire computation tree, on an input of length *n*). The only difference from the above proof is that in step 2 of the algorithm, as soon as a computation has more than *n*<sup>0</sup> steps, the machine *M* makes a nondeterministic move with three possible continuations: two possibilities are to accept the input, and the other is to reject it.

The same idea applies to the class **RP**, of decision problems solvable by a nondeterministic polynomial Turing machine which accepts if and only if at least half of the computation paths accept and rejects if and only if all computation paths reject, introduced in [5]. In this case we get **RP***sc* <sup>⊆</sup> **RPNP**[log] **ctree** (where **RPNP**[log] **ctree** is the class of decision problems solvable by a **RP**-machine which can make a total number of O(log *n*) queries to an **NP**-language in its entire computation tree, on an input of length *n*).

According to Remark 2, one can see that the lower bounds **<sup>P</sup>NP**[log] <sup>⊆</sup> **PPsc**, **<sup>P</sup>NP**[log] <sup>⊆</sup> <sup>⊕</sup>**Psc** and **<sup>P</sup>NP**[log] <sup>⊆</sup> **RPsc** hold.

**Funding:** This research was done by the author while being a postdoctoral fellow at the University of Magdeburg, funded by the *Alexander von Humboldt Foundation*, whose support is graciously acknowledged.

**Acknowledgments:** An extended abstract of this paper was presented at the conference *Computability in Europe 2011: Models of Computation in Context* [21]. We thank to all the reviewers of this paper for their very useful comments and suggestions.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**


### *Article* **The Maximal Complexity of Quasiperiodic Infinite Words**

**Ludwig Staiger**

Institut für Informatik, Martin-Luther-Universität Halle-Wittenberg, D-06099 Halle (Saale), Germany; staiger@informatik.uni-halle.de

**Abstract:** A quasiperiod of a finite or infinite string is a word whose occurrences cover every part of the string. An infinite string is referred to as quasiperiodic if it has a quasiperiod. We present a characterisation of the set of infinite strings having a certain word *q* as quasiperiod via a finite language *Pq* consisting of prefixes of the quasiperiod *q*. It turns out its star root ∗ *Pq* is a suffix code having a bounded delay of decipherability. This allows us to calculate the maximal subword (or factor) complexity of quasiperiodic infinite strings having quasiperiod *q* and further to derive that maximally complex quasiperiodic infinite strings have quasiperiods *aba* or *aabaa*. It is shown that, for every length *<sup>l</sup>* <sup>≥</sup> 3, a word of the form *<sup>a</sup>nban* (or *<sup>a</sup>nbban* if *<sup>l</sup>* is even) generates the most complex infinite string having this word as quasiperiod. We give the exact ordering of the lengths *l* with respect to the achievable complexity among all words of length *l*.

**Keywords:** quasiperiod; formal language; asymptotic growth; polynomial

**MSC:** 68Q45

#### **1. Introduction**

In his tutorials [1–3] Solomon Marcus dealt with several properties of infinite words. Among them he considered quasiperiodicity and its influence on measures of symmetry like complexity, recurrence or entropy. One topic of interest was their *subword complexity* (or *factor complexity* [4]). Besides the asymptotic behaviour of the factor complexity, also known as their topological entropy ([4], Section 4.2.2) or [5] Marcus was also interested in the behaviour of the complexity function *f*(*ξ*, *n*) assigning to a natural number *n* ∈ N the number of subwords of the infinite word (*ω*-word) *ξ*. Here he was also concerned with recurrences in *ω*-words and their influence to subword complexity. A well-known fact established by Grillenberger is that the asymptotic subword complexity (or topological entropy) of an almost periodic (or uniformly recurrent) *ω*-word can be arbitrarily close (but not equal) to the maximal subword complexity (see [4], Theorem 4.4.4).

The present paper summarises results on the subword complexity of infinite words obtained in [6–8]. We study in detail the structure of the set of infinite words having a certain word *q* as quasiperiod and how this is connected with the set of finite words with the same quasiperiod. Moreover, we address a question raised in [9] about the maximally achievable subword complexity of a quasiperiodic infinite word.

A first result shows that for every word *q* there is a value *λq*, 1 ≤ *λ<sup>q</sup>* < 2, such that, for every infinite word *ξ* with quasiperiod *q*, the complexity function *f*(*ξ*, *n*) is bounded by *<sup>O</sup>*(1) · *<sup>λ</sup><sup>n</sup> <sup>q</sup>* , and this bound is achieved for certain infinite words having quasiperiod *q*. The maximally possible value for *λ<sup>q</sup>* is *λ<sup>q</sup>* = *tP* ≈ 1.324718, where *tP* is the smallest Pisot-Vijayaraghavan number, that is, the unique real root *tP* of the cubic polynomial *<sup>x</sup>*<sup>3</sup> <sup>−</sup> *<sup>x</sup>* <sup>−</sup> 1.

As a generalisation of the above-mentioned questions [2,9] we estimate, for every length *n* ≥ 3, the values *λ<sup>n</sup>* = max{*λ<sup>q</sup>* : |*q*| = *n*}, their ordering and the words *q*, |*q*| = *n*, for which *λ<sup>q</sup>* = *λn*. It appears that a two letter alphabet is sufficient for achieving the maximal complexity *λn*.

**Citation:** Staiger, L. The Maximal Complexity of Quasiperiodic Infinite Words. *Axioms* **2021**, *10*, 306. https:// doi.org/10.3390/axioms10040306

Academic Editor: Victor Mitrana

Received: 27 September 2021 Accepted: 11 November 2021 Published: 17 November 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

In order to prove these properties we start with a general investigation of quasiperiodicity of words (as e.g., in [10–12]) and infinite words.

The paper is organised as follows. After introducing some notation we derive in Section 3 a characterisation of quasiperiodic words and *ω*-words having a certain quasiperiod *q*. Moreover, we use the finite basis sets *Pq* and its dual *Rq* (L(*q*) and R(*q*) in [12]) from which the sets of quasiperiodic words or *ω*-words having quasiperiod *q* can be constructed. In Section 4 it is then proved that the star root of *Pq* is a suffix code having a bounded delay of decipherability and, dually, the star root of *Rq* is a prefix code.

This much prerequisites allow us, in Section 5, to estimate the number of subwords of the language *Qq* of all quasiperiodic words having quasiperiod *q*. It turns out that *cq*,1 · *<sup>λ</sup><sup>n</sup> <sup>q</sup>* <sup>≤</sup> *<sup>f</sup>*(*Qq*, *<sup>n</sup>*) <sup>≤</sup> *cq*,2 · *<sup>λ</sup><sup>n</sup> <sup>q</sup>* where *f*(*Qq*, *n*) is the number of subwords of length *n* of words in *Qq* and 1 ≤ *λ<sup>q</sup>* ≤ *tP* depends on *q*. We construct, for every quasiperiod *q*, a quasiperiodic *ω*-word *ξ<sup>q</sup>* with quasiperiod *q* whose subword complexity *f*(*ξq*, *n*) is maximal.

The values *λ<sup>q</sup>* turn out to be maximal positive roots of polynomials associated with the star root ∗ *Pq*. Section 6 deals with the properties of those polynomials. This allows to compare the roots *λq*.

The following Sections 7 and 8 deal with the proof of the above mentioned results on the values *λ<sup>q</sup>* and *λ<sup>n</sup>* = max{*λ<sup>q</sup>* : |*q*| = *n*}. Here we derive also the complete ordering of the values *λn*.

#### **2. Notation and Preliminaries**

In this section we introduce the notation used throughout the paper. By N = {0, 1, 2, ...} we denote the set of natural numbers. Let *X* be an alphabet of cardinality |*X*| = *r* ≥ 2, and let throughout the paper *a*, *b* ∈ *X*, *a* = *b*, be two different letters. By *X*<sup>∗</sup> we denote the set of finite words on *X*, including the *empty word e*, and *X<sup>ω</sup>* is the set of infinite strings (*ω*-words) over *X*. Subsets of *X*∗ will be referred to as *languages* and subsets of *X<sup>ω</sup>* as *ω-languages*.

For *<sup>w</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> and *<sup>η</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup><sup>ω</sup>* let *<sup>w</sup>* · *<sup>η</sup>* be their *concatenation*. This concatenation product extends in an obvious way to subsets *<sup>L</sup>* <sup>⊆</sup> *<sup>X</sup>*<sup>∗</sup> and *<sup>B</sup>* <sup>⊆</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup>ω*. For a language *<sup>L</sup>* let *L*∗ := *<sup>i</sup>*∈<sup>N</sup> *<sup>L</sup><sup>i</sup>* , and by *<sup>L</sup><sup>ω</sup>* :<sup>=</sup> {*w*<sup>1</sup> ··· *wi* ··· : *wi* <sup>∈</sup> *<sup>L</sup>* \ {*e*}} we denote the set of infinite strings formed by concatenating words in *L*. The smallest subset of a language *L* which generates *L*<sup>∗</sup> is called its *star root* ∗ <sup>√</sup>*<sup>L</sup>* [13]. It holds

$$
\sqrt[4]{L} = (L \backslash \{e\}) \backslash (L \backslash \{e\})^2 \cdot L^\* \dots
$$

Furthermore |*w*| is the *length* of the word *w* ∈ *X*<sup>∗</sup> and **pref**(*B*) is the set of all finite prefixes of the strings in *<sup>B</sup>* <sup>⊆</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup>ω*. We shall abbreviate *<sup>w</sup>* <sup>∈</sup> **pref**(*η*) (*<sup>η</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup>ω*) by *w η*.

We denote by *<sup>B</sup>*/*<sup>w</sup>* :<sup>=</sup> {*<sup>η</sup>* : *<sup>w</sup>* · *<sup>η</sup>* <sup>∈</sup> *<sup>B</sup>*} the *left derivative* of the set *<sup>B</sup>* <sup>⊆</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup>ω*. As usual, a language *L* ⊆ *X*<sup>∗</sup> is *regular* provided it is accepted by a finite automaton. An equivalent condition is that its set of left derivatives {*L*/*w* : *w* ∈ *X*∗} is finite.

The sets of infixes of *B* or *η* are **infix**(*B*) := *<sup>w</sup>*∈*X*<sup>∗</sup> **pref**(*B*/*w*) and **infix**(*η*) :<sup>=</sup> *<sup>w</sup>*∈*X*<sup>∗</sup> **pref**({*η*}/*w*), respectively. In the sequel we assume the reader to be familiar with basic facts of language theory.

We call a word *<sup>w</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> \ {*e*} *primitive* if *<sup>w</sup>* <sup>=</sup> *<sup>v</sup><sup>n</sup>* implies *<sup>n</sup>* <sup>=</sup> 1, that is, *<sup>w</sup>* is not the power of a shorter word, and we call *w* ∈ *X*<sup>∗</sup> \ {*e*} *overlap-free* if none of its proper prefixes is a suffix of *w*. The following facts are known (e.g., [14,15]).

**Fact 1.** *Every word w* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> \ {*e*} *has a unique representation w* <sup>=</sup> *<sup>v</sup><sup>n</sup> where v is primitive.*

**Fact 2.** *Let q*, *v*, *w* ∈ *X*∗, 0 < |*v*| < |*q*|*. If v* · *q* = *q* · *w then v* = *u* · *u , q* = (*u* · *u* )*<sup>κ</sup>* · *<sup>u</sup> and w* = *u* · *u for some u*, *u* ∈ *X*∗, *u* = *e*, *and κ* ∈ N*. In particular, q is not overlap-free.*

**Fact 3.** *If w* · *v* = *v* · *w*, *w*, *v* ∈ *X*<sup>∗</sup> *then w*, *v are powers of a common (primitive) word.*

As usual a language *L* ⊆ *X*<sup>∗</sup> is called a *code* provided *w*<sup>1</sup> ··· *wl* = *v*<sup>1</sup> ··· *vk* for *w*1, ... , *wl*, *v*1, ... , *vk* ∈ *L* implies *l* = *k* and *wi* = *vi*. A code *L* is said to be a *prefix code* (*suffix code*) provided no codeword is a prefix (suffix) of another codeword.

#### **3. Quasiperiodicity**

#### *3.1. General Properties*

The notion of quasiperiodicity can be formalised in the following manner. A finite or infinite word *<sup>η</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup><sup>ω</sup>* is referred to as *quasiperiodic* with quasiperiod *<sup>q</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> \ {*e*} provided that for every *j* < |*η*| ∈ N ∪ {∞} there is a prefix *uj η* of length *j* − |*q*| < |*uj*| ≤ *j* such that *uj* · *<sup>q</sup> <sup>η</sup>*, that is, for every *<sup>w</sup> <sup>η</sup>* the relation *<sup>u</sup>*|*w*<sup>|</sup> *<sup>w</sup> <sup>u</sup>*|*w*<sup>|</sup> · *<sup>q</sup>* is valid. Informally, *η* has quasiperiod *q* if every position of *η* occurs within some occurrence of *q* in *η* [11,12].

Let for *q* ∈ *X*<sup>∗</sup> \ {*e*}, *Qq* be the set of quasiperiodic words with quasiperiod *q*. Then {*q*}<sup>∗</sup> ⊆ *Qq* = *Q*<sup>∗</sup> *<sup>q</sup>* and *Qq* \ {*e*} ⊆ *X*<sup>∗</sup> · *q* ∩ *q* · *X*∗. In order to describe the set of quasiperiodic strings having a certain quasiperiod *q* ∈ *X*<sup>∗</sup> \ {*e*} the following definition is helpful.

**Definition 1.** *A family wi* - *<sup>i</sup>*=1*,* - ∈ N ∪ {∞}*, of words wi* ∈ *X*<sup>∗</sup> · *q is referred to as a q*-chain *provided w*<sup>1</sup> = *q, wi wi*+<sup>1</sup> *and* |*wi*+1|−|*wi*|≤|*q*|*.*

It holds the following.

#### **Lemma 1.**


**Proof.** It suffices to show how a family *uj* |*η*|−<sup>1</sup> *<sup>j</sup>*=<sup>0</sup> can be converted to a *<sup>q</sup>*-chain *wi* - *<sup>i</sup>*=<sup>1</sup> and vice versa.

Consider *<sup>η</sup>* <sup>∈</sup> *<sup>X</sup>*<sup>∗</sup> <sup>∪</sup> *<sup>X</sup><sup>ω</sup>* and let *uj* |*η*|−<sup>1</sup> *<sup>j</sup>*=<sup>0</sup> be a family such that *uj* · *q η* and *j* − |*q*| < |*uj*| ≤ *j* for *j* < |*η*|.

Define *<sup>w</sup>*<sup>1</sup> := *<sup>q</sup>* and *wi*+<sup>1</sup> := *<sup>u</sup>*|*wi*<sup>|</sup> · *<sup>q</sup>* as long as |*wi*| < |*η*|. Then *wi <sup>η</sup>* and |*wi*| < -

<sup>|</sup>*wi*+1<sup>|</sup> <sup>=</sup> <sup>|</sup>*u*|*wi*<sup>|</sup> · *<sup>q</sup>*|≤|*wi*<sup>|</sup> <sup>+</sup> <sup>|</sup>*q*|. Thus *wi <sup>i</sup>*=<sup>1</sup> is a *q*-chain with *wi η*.

Conversely, let *wi* - *<sup>i</sup>*=<sup>1</sup> be a *q*-chain such that *wi η* and set

$$\mu\_j := \max\_{\sqsubseteq} \{ w' \, : \, \exists i (w' \cdot q = w\_i \land |w'| \le j) \} \text{ , for } j < |\eta| \, .$$

By definition, *uj* · *q η* and |*uj*| ≤ *j*. Assume |*uj*| ≤ *j* − |*q*| and *uj* · *q* = *wi*. Then |*wi*| ≤ *j* < |*η*|. Consequently, in the *q*-chain there is a successor *wi*+1, |*wi*+1|≤|*wi*| + |*q*| ≤ *j* + |*q*|. Let *wi*+<sup>1</sup> = *w* · *q*. Then *uj w* and |*w*| ≤ *j* which contradicts the maximality of *uj*.

Lemma 1 yields the following consequences.

**Corollary 1.** *Let u* ∈ **pref**(*Qq*)*. Then there are words w*, *w* ∈ *Qq such that w u w and* |*u*|−|*w*|, |*w* |−|*u*|≤|*q*|*.*

**Corollary 2.** *Let <sup>ξ</sup>* <sup>∈</sup> *<sup>X</sup>ω. Then the following are equivalent.*


#### *3.2. Finite Generators for Quasiperiodic Words*

In this part we consider the finite languages *Pq* and *Rq* (L(*q*) and R(*q*) in [12]) which generate the set of quasiperiodic words as well as the set of quasiperiodic *ω*-words having quasiperiod *q*.

We set

$$P\_{\emptyset} := \{ \upsilon : e \sqsubset v \sqsubseteq q \sqsubseteq v \cdot \eta \} = \{ \upsilon : \exists v' (\upsilon' \sqsubseteq q \wedge \upsilon \cdot \upsilon' = q) \}. \tag{1}$$

Then we have the following properties.

#### **Proposition 1.**

*1. q* ∈ *Pq and Pq* = {*q*} *if and only if q is overlap-free. 2. Qq* = *P*<sup>∗</sup> *<sup>q</sup>* · *q* ∪ {*e*} ⊆ *P*<sup>∗</sup> *q 3.* **pref**(*Qq*) = **pref**(*P*<sup>∗</sup> *<sup>q</sup>* ) = *P*<sup>∗</sup> *<sup>q</sup>* · **pref**(*q*)

**Proof.** 1. *q* ∈ *Pq* is obvious and and the equivalence follows immediately from the definition of *Pq*.

2. In order to prove *Qq* ⊆ *P*<sup>∗</sup> *<sup>q</sup>* · *q* ∪ {*e*} we show that *wi* ∈ *P*<sup>∗</sup> *<sup>q</sup>* · *q* for every *q*-chain *wi* - *<sup>i</sup>*=1. This is certainly true for *w*<sup>1</sup> = *q*. Now proceed by induction on *i*. Let *wi* = *w <sup>i</sup>* · *q* ∈ *P*<sup>∗</sup> *<sup>q</sup>* · *q* and *wi*+<sup>1</sup> = *w <sup>i</sup>*+<sup>1</sup> · *q*. Then *w <sup>i</sup>* · *vi* = *w <sup>i</sup>*+1. Now from *wi wi*+<sup>1</sup> we obtain *e vi q vi* · *q*, that is, *vi* ∈ *Pq*.

Conversely, let *vi* ∈ *Pq* and consider *v*<sup>1</sup> ··· *v*- · *q*. Since *q vi* · *q* the family (*v*<sup>1</sup> ··· *vj* · *q*)- *<sup>j</sup>*=<sup>0</sup> is a *q*-chain. This shows *P*<sup>∗</sup> *<sup>q</sup>* · *q* ∪ {*e*} ⊆ *Qq*.

3. is an immediate consequence of 2.

Proposition 1 and Corollary 2 imply the following characterisation of *ω*-words having quasiperiod *q*.

$$\{\emptyset, \ulcorner \emptyset \in X^{\omega} \land \ulcorner \emptyset \text{ has quasiperiod } q\} = P\_q^{\omega} \tag{2}$$

**Proof.** Since *Pq* is finite, *P<sup>ω</sup> <sup>q</sup>* <sup>=</sup> {*<sup>ξ</sup>* : *<sup>ξ</sup>* <sup>∈</sup> *<sup>X</sup><sup>ω</sup>* <sup>∧</sup> **pref**(*ξ*) <sup>⊆</sup> **pref**(*P*<sup>∗</sup> *<sup>q</sup>* )}.

A dual generator of *Qq* is obtained by the right-to-left duality of reading words using the suffix relation ≤<sup>s</sup> instead of the prefix relation .

$$R\_{\emptyset} := \left\{ \upsilon : \iota <\_{\mathfrak{s}} \upsilon \le\_{\mathfrak{s}} q <\_{\mathfrak{s}} q \, \, \middle\vert \, \upsilon \right\} = \left\{ \upsilon : \exists \upsilon' (\upsilon' <\_{\mathfrak{s}} q \wedge \upsilon' \cdot \upsilon = q) \right\}.\tag{3}$$

Analogously to Proposition 1 we obtain

#### **Proposition 2.**


The proof of Items 1 and 2 is similar to the proof of Proposition 1 using the reversed version of *q*-chain, and Item 3 then follows from Item 2. A slight difference appears with an analogy to Equation (2).

$$\{\emptyset^\lnot : \emptyset \in X^\omega \land \emptyset \text{ has quasiperiod } q\} = q \cdot R\_q^\omega \subseteq R\_q^\omega \tag{4}$$

Here the last inclusion might be proper, e.g., for *q* = *aba* where *R<sup>ω</sup> aba* <sup>=</sup> {*ba*, *aba*}*<sup>ω</sup>* <sup>=</sup> *aba* · *<sup>R</sup><sup>ω</sup> aba*.

An alternative derivation of the languages *Pq* and *Rq* can be found in Definition 2 of [12]. Here the borders, that is, prefixes which are simultaneously suffixes of the quasiperiod *q*, are used:

$$\begin{array}{rcl} P\_q &=& \left\{ v : \exists w (w \sqsubset q \land w <\_s q \land q = v \cdot w) \right\} \text{, and} \\ R\_q &=& \left\{ v : \exists w (w \sqsubset q \land w <\_s q \land q = w \cdot v) \right\} \text{.} \end{array}$$

In the subsequent sections we focus on the investigation of *Pq* due to the left-to-right direction of *ω*-words.

#### *3.3. Combinatorial Properties of Pq*

We investigate basic properties of *Pq* using simple facts from combinatorics on words (see e.g., [14–16]).

**Proposition 3.** *<sup>v</sup>* <sup>∈</sup> *Pq if and only if* <sup>|</sup>*v*|≤|*q*<sup>|</sup> *and there is a prefix <sup>v</sup>*¯ *<sup>v</sup> such that <sup>q</sup>* <sup>=</sup> *<sup>v</sup><sup>k</sup>* · *<sup>v</sup>*¯ *for k* = |*q*|/|*v*| *.*

This is an immediate consequence of Fact 2.

**Corollary 3.** *<sup>v</sup>* <sup>∈</sup> *Pq if and only if* <sup>|</sup>*v*|≤|*q*<sup>|</sup> *and there is a k* <sup>∈</sup> <sup>N</sup> *such that q <sup>v</sup>k .*

Now set *q*<sup>0</sup> := min *Pq*. Then in view of Proposition 3 and Corollary 3 we have the following canonical representation.

$$q = q\_0^k \cdot \overline{q} \text{ where } k = \lfloor |q| / |q\_0| \rfloor \text{ and } \overline{q} \subset q\_0 \text{ .} \tag{5}$$

We will refer to *q*<sup>0</sup> as the *repeated prefix* and to *k* as the *repetition factor*. If |*q*0| > |*q*|/2, that is, if *k* = 1 we will refer to *q* as *irreducible*. (Reducible words are also known as periodic words [10,11].)

**Corollary 4.** *Every word v* ∈ <sup>∗</sup> *Pq is primitive.*

**Proof.** Assume *v* = *v<sup>l</sup>* <sup>1</sup> for some *<sup>v</sup>* <sup>∈</sup> <sup>∗</sup> *Pq* and *<sup>l</sup>* <sup>&</sup>gt; 1. Then *<sup>q</sup> <sup>v</sup>k* = *vl*·*k* <sup>1</sup> , and, according to Corollary <sup>3</sup> *<sup>v</sup>*<sup>1</sup> ∈ *Pq* contradicting *<sup>v</sup>* ∈ <sup>∗</sup> *Pq*.

**Proposition 4.** *Let q* <sup>∈</sup> *<sup>X</sup>*∗, *<sup>q</sup>* <sup>=</sup> *e, q*<sup>0</sup> <sup>=</sup> min *Pq, q* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q and v* ¯ ∈ *P*<sup>∗</sup> *<sup>q</sup>* \ {*e*}*.*

*1. If w q then v* · *w q or q v* · *w.*

*2. If w* · *v q then w* ∈ {*q*0}∗*.*

**Proof.** From Proposition 1.2 we know *v* · *q* ∈ *P*<sup>∗</sup> *<sup>q</sup>* · *q* ⊆ *Qq* ⊆ *q* · *X*∗. Consequently, *q v* · *q*. Then *v* · *w v* · *q* implies *v* · *w q* or *q v* · *w* according to whether |*w* · *w*|≤|*q*| or not.

Since *q*<sup>0</sup> *v*, it suffices to prove the second assertion for *q*0. First one observes that, *<sup>w</sup> <sup>q</sup>* and <sup>|</sup>*w*|≤|*q*|−|*q*0|. Thus *<sup>w</sup> <sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>q</sup>*¯. Therefore, we have *<sup>w</sup>* · *<sup>q</sup>*<sup>0</sup> *<sup>q</sup>* and *<sup>q</sup>*<sup>0</sup> · *<sup>w</sup> <sup>q</sup>* which implies *w* · *q*<sup>0</sup> = *q*<sup>0</sup> · *w* and, according to Fact 3, *w* and *q*<sup>0</sup> are powers of a common word. The assertion follows because *q*<sup>0</sup> is primitive.

Next we derive a lower bound on the lengths of words in *Pq* \ {*q*0}∗. To this end, we use the Theorem of Fine and Wilf.

**Theorem 1** ([17])**.** *Let <sup>v</sup>*, *<sup>w</sup>* <sup>∈</sup> *<sup>X</sup>*∗*. Suppose <sup>v</sup><sup>m</sup> and <sup>w</sup>n, for some <sup>m</sup>*, *<sup>n</sup>* <sup>∈</sup> <sup>N</sup>*, have a common prefix of length* |*v*| + |*w*| − gcd (|*v*|, |*w*|)*. Then v and w are powers of a common word u* ∈ *X*<sup>∗</sup> *of length* |*u*| = gcd (|*v*|, |*w*|)*. (Here* gcd (*k*, *l*) *denotes the greatest common divisor of two numbers k*, *l* ∈ N*.)*

**Proposition 5.** *Let <sup>q</sup>* <sup>∈</sup> *<sup>X</sup>*∗, *<sup>q</sup>* <sup>=</sup> *e, <sup>q</sup>*<sup>0</sup> <sup>=</sup> min *Pq, <sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯ *and v* ∈ *Pq* \ {*q*0}∗*. Then* |*v*| > |*q*|−|*q*0| + gcd (|*v*|, |*q*0|)*.*

**Proof.** If *<sup>q</sup>*0, *<sup>v</sup>* <sup>∈</sup> *Pq* Corollary <sup>3</sup> and Equation (5) imply that *<sup>q</sup>* is a common prefix of *<sup>q</sup>k*+<sup>1</sup> <sup>0</sup> and *vk* for some *k* ∈ N. If |*v*|≤|*q*|−|*q*0| + gcd (|*v*|, |*q*0|) then by Theorem 1 *q*<sup>0</sup> and *v* are powers of a common word, that is, *v* is a power of the primitive word *q*0.

**Corollary 5.** ∗ *Pq* <sup>=</sup> *Pq* \ *<sup>q</sup>*<sup>2</sup> <sup>0</sup> · {*q*0}<sup>∗</sup>

**Proof.** It suffices to show *Pq* <sup>∩</sup> *<sup>P</sup>*<sup>2</sup> *<sup>q</sup>* · *P*<sup>∗</sup> *<sup>q</sup>* ⊆ {*q*0}∗. To this end observe that in view of Proposition 5 |*v* · *v* | > |*q*| whenever *v* ∈ *Pq* \ {*q*0}<sup>∗</sup> or *v* ∈ *Pq* \ {*q*0}∗.

As an immediate consequence we obtain that ∗ *Pq* = *Pq* if and only if *q* is an irreducible quasiperiod. Moreover, Proposition 5 shows that

$$\sqrt[4]{P\_{\emptyset}} \subseteq \{q\_0\} \cup \{v' : v' \sqsubseteq q \land |v'| > |q| - |q\_0| + \gcd\left(|v'|, |q\_0|\right)\}\,. \tag{6}$$

*3.4. The Reduced Quasiperiod q*ˆ

Next we investigate the relation between a quasiperiod *q* = *q<sup>k</sup>* <sup>0</sup> · *q*¯ where *q*<sup>0</sup> = min *Pq* and *q*¯ *q*<sup>0</sup> and its *reduced quasiperiod q*ˆ := *q*<sup>0</sup> · *q*¯. Since *q* ∈ *Qq*ˆ, we have *Qq*<sup>ˆ</sup> ⊇ *Qq*.

We continue with a relation between *Pq* and *Pq*ˆ. It is obvious that *q<sup>i</sup>* <sup>0</sup> ∈ *Pq* for every *<sup>i</sup>* <sup>=</sup> 1, . . . , *<sup>k</sup>* and *Pq*<sup>ˆ</sup> ⊆ {*<sup>v</sup>* : *<sup>q</sup>*ˆ0 *<sup>v</sup> <sup>q</sup>*ˆ} . (7)

**Lemma 2** ([7], Lemma 2.2)**.** *Let <sup>q</sup>* <sup>∈</sup> *<sup>X</sup>*∗, *<sup>q</sup>* <sup>=</sup> *e, <sup>q</sup>*<sup>0</sup> <sup>=</sup> min *Pq, <sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯ *and q*ˆ = *q*<sup>0</sup> · *q*¯ *the reduced quasiperiod of q. Then*

$$P\_{\emptyset} = \{q\_0^i : i = 1, \ldots, k - 1\} \cup \{q\_0^{k - 1} \cdot \upsilon : \upsilon \in P\_{\emptyset}\}\dots$$

**Proof.** Consider *<sup>v</sup>* <sup>∈</sup> *Pq*ˆ. Then *<sup>v</sup> <sup>q</sup>*0*q*¯ *<sup>v</sup>* · *<sup>q</sup>*0*q*¯, and, consequently, *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup> <sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯ *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup>* · *<sup>q</sup>*0*q*¯ *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup>* · *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *<sup>q</sup>*¯, that is, *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup>* <sup>∈</sup> *Pq*.

Conversely, let *<sup>v</sup>* <sup>∈</sup> *Pq* and *<sup>v</sup>* ∈ { / *<sup>q</sup><sup>i</sup>* <sup>0</sup> : *i* = 1, ... , *k* − 1}. Then, according to Proposition 5 there is a unique *<sup>v</sup>* <sup>=</sup> *<sup>e</sup>* such that *<sup>v</sup>* <sup>=</sup> *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup>*. Now *<sup>v</sup>* <sup>=</sup> *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup> <sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯ *v* · *q* = *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> · *<sup>v</sup>* · *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *<sup>q</sup>*¯ implies *<sup>v</sup> <sup>q</sup>*<sup>0</sup> · *<sup>q</sup>*¯ *<sup>v</sup>* · *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *<sup>q</sup>*¯. Since <sup>|</sup>*v*|≤|*q*<sup>0</sup> · *<sup>q</sup>*¯<sup>|</sup> and *<sup>q</sup>*<sup>0</sup> · *<sup>q</sup>*¯ *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯, we have *v q*<sup>0</sup> · *q*¯ *v* · *q*<sup>0</sup> · *q*¯.

Together with Corollary 5 this implies

$$P\_{\mathbb{P}} \backslash \{q\_0\}^\* = \sqrt[\ast]{P\_{\mathbb{P}}} \backslash \{q\_0\}^\* = q\_0^{k-1} \cdot (P\_{\mathbb{P}} \backslash \{q\_0\}) \,. \tag{8}$$

Moreover, we have the following.

**Corollary 6.** | ∗ *Pq*| = <sup>1</sup> *if and only if q* ∈ {*q*0}<sup>∗</sup> *and q*<sup>0</sup> *is overlap-free.*

**Proof.** Since *q*<sup>0</sup> ∈ ∗ *Pq*, | ∗ *Pq*| = 1 is equivalent with ∗ *Pq* = {*q*0} or, according to Equation (8), with *Pq*<sup>ˆ</sup> = {*q*0}. This amounts to *q*ˆ = *q*<sup>0</sup> and, following Proposition 1.1 *q*ˆ = *q*<sup>0</sup> has to be overlap-free.

For the repeated prefix *q*ˆ0 of *q*ˆ we have the obvious relation |*q*ˆ0| > |*q*¯|. In case *q*ˆ0 = *q*<sup>0</sup> we can improve this.

**Lemma 3.** *Let q* = *q<sup>k</sup>* <sup>0</sup> · *q with k* ¯ ≥ 2*, q*¯ *q*<sup>0</sup> *and q*ˆ = *q*<sup>0</sup> · *q. If* ¯ *q*ˆ0 = *q*<sup>0</sup> *then*

$$\begin{array}{rcl} \not\subseteq \not q\_0 \sqsubset q\_0 \text{ and } |\not q\_0| > |\not q| + \gcd\left(|\not q\_0|, |\not q\_0|\right), \end{array}$$

*and there is a nonempty suffix v* = *e of q*<sup>0</sup> *such that v q*ˆ0 *and v* · *q*¯ *q*ˆ 2 0*.*

**Proof.** We have *<sup>q</sup>*¯ *<sup>q</sup>*<sup>0</sup> and, since *<sup>q</sup>*<sup>0</sup> <sup>∈</sup> *Pq*ˆ, also *<sup>q</sup>*ˆ0 *<sup>q</sup>*0. Moreover, *<sup>q</sup>*<sup>ˆ</sup> *<sup>q</sup>*<sup>2</sup> <sup>0</sup> and *q*ˆ *q*ˆ *k* <sup>0</sup> for some *k* ∈ N. Since *q*<sup>0</sup> = *q*ˆ0 and both prefixes are primitive words, in view of Theorem 1 as a common prefix of *q*<sup>2</sup> <sup>0</sup> and *q*ˆ |*q*0| <sup>0</sup> the word *q*ˆ = *q*<sup>0</sup> · *q*¯ has to satisfy |*q*ˆ| < |*q*0| + |*q*ˆ0| − gcd (|*q*0|, |*q*ˆ0|), that is, |*q*ˆ0| > |*q*¯| + gcd (|*q*0|, |*q*ˆ0|). The assertion *q*¯ *q*ˆ0 *q*<sup>0</sup> now follows from a comparison of the lengths of *q*¯, *q*ˆ0 *q*0.

Now, let *v* be the suffix of *q*<sup>0</sup> defined by *q*ˆ *k* <sup>0</sup> · *v* = *q*<sup>0</sup> *q*ˆ *k* <sup>+</sup><sup>1</sup> <sup>0</sup> . Then *<sup>v</sup> <sup>q</sup>*ˆ0 and *<sup>v</sup>* · *<sup>q</sup>*¯ (*q*ˆ0)2.

#### *3.5. Primitivity and Superprimitivity*

In this section we consider the inclusion relations between the languages *Qq*, *q* = *e*. Analogously to the primitivity of words in [10–12] a word was referred to as *superprimitive* if it is not covered by a shorter one. This leads to the following definition.

**Definition 2** (superprimitive)**.** *A non-empty word q* ∈ *X*<sup>∗</sup> \ {*e*} *is* superprimitive *if and only if Qq is maximal w.r.t. "*⊆*" in the family* {*Qq* : *q* ∈ *X*<sup>∗</sup> \ {*e*}}*.*

The next proposition relates the irreducibility of quasiperiods to superprimitivity.

**Proposition 6** ([12], Remark 4)**.** *If q* ∈ *X*<sup>∗</sup> \ {*e*} *is superprimitive then* | min *Pq*| > |*q*|/2*, and if* | min *Pq*| > |*q*|/2 *then q is primitive.*

**Proof.** If *<sup>q</sup>*<sup>0</sup> <sup>=</sup> min *Pq* and <sup>|</sup>*q*0|≤|*q*|/2 then *<sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯ for some *q*¯ *q*0. Thus *q* ∈ *Qq*0*q*¯ and *q*0*q*¯ ∈/ *Qq*.

As *<sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>m</sup>* with *<sup>m</sup>* <sup>&</sup>gt; 1 implies <sup>|</sup>*q*0|≤|*q* |≤|*q*|/2, the other assertion follows.

The converse of Proposition 6 is not valid.

**Example 1.** *Let q* = *abaabaababaab. Then Pq* = {*abaabaab*, *abaabaababa*, *q*}*, and* | min *Pq*| = 8 > 13/2 *but as abaabaababaab* ∈ *Qabaab the word q is not superprimitive. The word q* = *ababa is primitive but q*<sup>0</sup> = *ab has* |*q*0|≤|*q*|/2*.*

In contrast to the fact that the word *q*<sup>0</sup> = min *Pq* is always primitive, it need not satisfy | min *Pq*<sup>0</sup> | > |*q*0|/2 let alone be superprimitive..

**Example 2.** *q* = *aabaaabaaaa has q*<sup>0</sup> = *aabaaabaa which, in turn has Pq*<sup>0</sup> = {*aaba*, *aabaaaba*, *q*0} *with* |*aaba*| = 4 < |*q*0|/2*.*

It turns out that every language *Qv* is contained in a unique maximal *Qq*. To this end we derive the following lemma (cf. also [10,11]).

**Lemma 4.** *Let v* ∈ *Qq and u* ∈ **infix**(*v*) ∩ *q* · *X*<sup>∗</sup> ∩ *X*<sup>∗</sup> · *q. Then u* ∈ *Qq.*

For the sake of completeness we give a proof.

**Proof.** We use a maximal *q*-chain (*wi*)*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> with *wn* = *v*. Assume *v* = *u*<sup>1</sup> · *u* · *u*2. Since *u* has *q* as prefix and suffix, there are 1 ≤ *j* ≤ *l* ≤ *n* such that *wj* = *u*<sup>1</sup> · *q* and *wl* = *u*<sup>1</sup> · *u*. Let, for 1 ≤ *i* ≤ *l* − *j* + 1, the words *w <sup>i</sup>* be defined by *wi*+*j*−<sup>1</sup> = *<sup>u</sup>*<sup>1</sup> · *<sup>w</sup> i* . Then (*w i* ) *l*−*j*+1 *<sup>i</sup>*=<sup>1</sup> is a *q*-chain with *wl*−*j*+<sup>1</sup> = *<sup>u</sup>*, that is, *<sup>u</sup>* ∈ *Qq*.

**Corollary 7.** *If v* ∈ *Qq* ∩ *Qu and* |*q*| < |*u*| *then Qu* ⊆ *Qq.*

The corollary shows that every language *Qv* is contained in a unique maximal *Qq* and that two languages *Qu*, *Qq* are either disjoint or compatible w.r.t. set inclusion. The latter is not true for *ω*-languages.

**Example 3.** *Let <sup>q</sup>* <sup>=</sup> *aabaa and <sup>u</sup>* <sup>=</sup> *aabaaa. Then <sup>q</sup><sup>ω</sup>* <sup>∈</sup>/ *<sup>P</sup><sup>ω</sup> <sup>u</sup> , <sup>u</sup><sup>ω</sup>* <sup>∈</sup>/ *<sup>P</sup><sup>ω</sup> <sup>q</sup> but P<sup>ω</sup> <sup>u</sup>* <sup>∩</sup> *<sup>P</sup><sup>ω</sup> q* ⊇ *aa* · {*baaa*, *baaaa*}*ω.*

#### **4.** *Pq* **and** *Rq* **as Codes**

In this section we investigate in more detail the properties of the star root of *Pq*. It turns out that ∗ *Pq* is a suffix code which, additionally, has a bounded delay of decipherability. This delay is closely related to the largest power of *q*<sup>0</sup> being a prefix of *q*.

According to [14,18–20] a subset *C* ⊆ *X*<sup>∗</sup> is a code of a *delay of decipherability m* ∈ N if and only if for all *v*, *v* , *w*1, ... , *wm* ∈ *C* and *u* ∈ *C*<sup>∗</sup> the relation *v* · *w*<sup>1</sup> ··· *wm v* · *u* implies *v* = *v* . Observe that *C* ⊆ *X*<sup>∗</sup> is a prefix code if and only if *C* has delay 0.

First we show that ∗ *Pq* is a suffix code. This generalises Proposition 7 of [12].

**Proposition 7.** ∗ *Pq is a suffix code, and* ∗ *Rq is a prefix code.*

**Proof.** Assume *u* = *w* · *v* for some *u*, *v* ∈ ∗ *Pq* , *<sup>u</sup>* = *<sup>v</sup>*. Then *<sup>u</sup> <sup>q</sup>* and Proposition <sup>4</sup> (2) proves *w* ∈ {*q*0}<sup>∗</sup> \ {*e*}. Consequently, |*v*|≤|*q*|−|*q*0|. Now Proposition 5 implies *v* ∈ {*q*0}<sup>∗</sup> and hence *u* ∈ {*q*0}∗. Since *u*, *v* ∈ ∗ *Pq*, we obtain *<sup>u</sup>* = *<sup>v</sup>* = *<sup>q</sup>*<sup>0</sup> contradicting *<sup>u</sup>* = *<sup>v</sup>*.

Using the duality of *Pq* and *Rq* one shows in an analogous manner that ∗ *Rq* is a prefix code.

An easy consequence of Proposition 7 is the Left and Right Normal Form of a quasiperiodic string ([12], Proposition 8).

**Corollary 8** (Normal Form)**.** *Every word w* ∈ *Qq has a unique factorisation w* = *v*<sup>1</sup> · *v*<sup>2</sup> ··· *vn into words vi* ∈ ∗ *Pq* ( ∗ *Rq*,*respectively*)*.*

Since ∗ *Rq* is a prefix code while the words *<sup>v</sup>* ∈ *Pq* are prefixes of each other, we obtain | ∗ *Pq* ∩ ∗ *Rq*| = 1 generalising Remark 5 of [12]. In fact ∗ *Pq* ∩ ∗ *Rq* = {*q*} or ∗ *Pq* ∩ ∗ *Rq* <sup>=</sup> {*q*0} depending on whether *<sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> or not.

We continue this part by investigating the delay of decipherability of ∗ *Pq*. We prove that the delay depends on the repetition factor *k*.

**Theorem 2.** *Let q* ∈ *X*<sup>∗</sup> \ {*e*}*, q*<sup>0</sup> = min *Pq, and* | ∗ *Pq*| > <sup>1</sup>*. Then* ∗ *Pq is a code having a delay of decipherability of k or k* + 1*.*

**Proof.** If | ∗ *Pq*| > 1 then in view of Proposition <sup>5</sup> there is a *<sup>q</sup>* ∈ ∗ *Pq* with |*q* | > |*q*|−|*q*0|. Since *<sup>q</sup>* <sup>∈</sup> *Pq*, we have *<sup>q</sup> <sup>q</sup>* · *<sup>q</sup>*<sup>0</sup> *<sup>q</sup>* · *<sup>q</sup>*. Consequently, *<sup>q</sup>*<sup>0</sup> · *<sup>q</sup>k*−<sup>1</sup> <sup>0</sup> *<sup>q</sup> <sup>q</sup>* · *<sup>q</sup>*0, that is, the delay of decipherability is at least *k*.

To prove the converse we show that for *<sup>q</sup> <sup>q</sup><sup>m</sup>* <sup>0</sup> the delay cannot exceed *m*.

Assume the contrary, that is, *v* · *w*<sup>1</sup> ··· *wm*+<sup>1</sup> *v* · *u* for some words *v*, *v* , *<sup>w</sup>*1, ... , *wm*+<sup>1</sup> <sup>∈</sup> <sup>∗</sup> *Pq*, *<sup>v</sup>* = *<sup>v</sup>* , and *u* ∈ *P*<sup>∗</sup> *<sup>q</sup>* . From Proposition 4 (1) we obtain *u q* or *q u* and, since |*wi*|≥|*q*0|, also *q w*<sup>1</sup> ··· *wm*+1.

If *v v* , in view of the inequality |*v*| + |*q*|≥|*v* | + |*q*0| our assumption yields *v* · *q*<sup>0</sup> *v* · *q*. Therefore, *w* · *q*<sup>0</sup> *q* for the word *w* = *e* with *v* · *w* = *v* and, according to Proposition 4 (2) *w* ∈ {*q*0}∗. This contradicts the fact that ∗ *Pq* is a suffix code.

If *v v*, then |*u*| > |*w*<sup>1</sup> ··· *wm*+1|≥|*q*|, and via |*v* | + |*q*|≥|*v*| + |*q*0| we obtain *v* · *q*<sup>0</sup> *v* · *q* from our assumption. This yields the same contradiction as in the case *v v* . The observation *<sup>q</sup> <sup>q</sup>k*+<sup>1</sup> <sup>0</sup> finishes the proof.

For *q* = *q<sup>k</sup>* <sup>0</sup> the preceding proof shows the following.

**Corollary 9.** *If q* = *q<sup>k</sup>* <sup>0</sup> *and* | ∗ *Pq*| > <sup>1</sup> *then* ∗ *Pq has a delay of decipherability of exactly k.*

Thus, if | ∗ *Pq*<sup>|</sup> <sup>&</sup>gt; 1 and *<sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> the code ∗ *Pq* may have a minimum delay of decipherability of *k* or *k* + 1. We provide examples that both cases are possible.

**Example 4.** *Let q* := *aabaaaaba. Then q*<sup>0</sup> = *aabaa, k* = 1 *and* ∗ *Pq* = *Pq* = { *<sup>q</sup>*0, *aabaaaab*, *<sup>q</sup>* } *which is a code having a delay of decipherability* 2*.*

*Indeed aabaaaabaa* = *q*<sup>0</sup> · *q*<sup>0</sup> *q* · *q*<sup>0</sup> *or aabaaaabaa* = *q*<sup>0</sup> · *q*<sup>0</sup> *aabaaaab* · *q*<sup>0</sup> .

Moreover, in Example 4, *q* · *q*<sup>0</sup> ∈/ *Qq*. Thus our example shows also that *q* · *P*<sup>∗</sup> *<sup>q</sup>* need not be contained in *Qq*.

**Example 5.** *Let q* := *aba. Then k* = 1 *and Pq* = {*ab*, *aba*} *is a code having a delay of decipherability* 1*.*

Since ∗ *Rq* is a prefix code, every *<sup>ω</sup>*-word *<sup>ξ</sup>* <sup>∈</sup> *<sup>R</sup><sup>ω</sup> <sup>q</sup>* has a unique factorisation into words *w* ∈ ∗ *Rq*. For suffix codes the situation is, in general, different. Consider e.g., the suffix code {*b*, *ba*, *aa*}. Property 4 (ii) of [20] (see also ([21], Proposition 1.9)) shows that codes of bounded delay of decipherability also admit a unique factorisation of *ω*-words. Thus we obtain from Theorem 2.

**Lemma 5** (Normal Form for quasiperiodic *<sup>ω</sup>*-words)**.** *Every <sup>ω</sup>-word <sup>ξ</sup>* <sup>∈</sup> *<sup>P</sup><sup>ω</sup> <sup>q</sup> has a unique factorisation ξ* = *v*<sup>1</sup> · *v*<sup>2</sup> ··· *vi* ··· *into words vi* ∈ ∗ *Pq.*

#### **5. Subword Complexity**

In this section we investigate upper bounds on the the subword complexity function *<sup>f</sup>*(*ξ*, *<sup>n</sup>*) for quasiperiodic *<sup>ω</sup>*-words. If *<sup>ξ</sup>* <sup>∈</sup> *<sup>X</sup><sup>ω</sup>* is quasiperiodic with quasiperiod *<sup>q</sup>* then Proposition 3 and Corollary 3 show **infix**(*ξ*) ⊆ **infix**(*P*<sup>∗</sup> *<sup>q</sup>* ). Thus

$$f(\xi'\_\prime n) \le |\mathbf{infix}(P\_q^\*) \cap X^n| \text{ for } \xi \in P\_q^\omega. \tag{9}$$

Similar to ([22], Proposition 5.5) let *<sup>ξ</sup><sup>q</sup>* := <sup>∏</sup>*v*∈*P*<sup>∗</sup> *<sup>q</sup>* \{*e*} *<sup>v</sup>*. This implies **infix**(*ξq*) = **infix**(*P*∗ *<sup>q</sup>* ). Consequently, the tight upper bound on the subword complexity of quasiperiodic *ω*-words having a certain quasiperiod *q* is *fq*(*n*) := *f*(*ξq*, *n*) = |**infix**(*P*<sup>∗</sup> *<sup>q</sup>* ) <sup>∩</sup> *<sup>X</sup>n*|. Observe that in view of Propositions 1 and 2 the identity

$$\|\mathbf{fix}(P\_q^\*) = \mathbf{init}(R\_q^\*) = \mathbf{init}(Q\_{\mathcal{q}}) \tag{10}$$

holds.

The asymptotic upper bound on the subword complexity *fq*(*n*) is obtained from

$$\lambda\_q = \limsup\_{n \to \infty} \sqrt[n]{|\inf \mathbf{fix}(P\_q^\*) \cap X^n|} \, \tag{11}$$

that is, for large *<sup>n</sup>*, *fq*(*n*) <sup>≤</sup> *<sup>λ</sup>*<sup>ˆ</sup> *<sup>n</sup>* whenever *<sup>λ</sup>*<sup>ˆ</sup> <sup>&</sup>gt; *<sup>λ</sup>q*.

The following facts are known from the theory of formal power series (cf. [23,24]). As **infix**(*P*∗ *<sup>q</sup>* ) is a regular language the power series <sup>∑</sup>*n*∈<sup>N</sup> *fq*(*n*) · *<sup>t</sup> <sup>n</sup>* is a rational series and, therefore, *fq* satisfies a recurrence relation

$$f\_q(n+k) = \sum\_{i=0}^{k-1} a\_i \cdot f\_q(n+i)$$

with integer coefficients *ai* <sup>∈</sup> <sup>Z</sup>. Thus *fq*(*n*) = <sup>∑</sup>*k* −1 *<sup>i</sup>*=<sup>0</sup> *gi*(*n*) · *<sup>θ</sup><sup>n</sup> <sup>i</sup>* where *k* ≤ *k*, *θ<sup>i</sup>* are pairwise distinct roots of the polynomial *t <sup>n</sup>* <sup>−</sup> <sup>∑</sup>*k*−<sup>1</sup> *<sup>i</sup>*=<sup>0</sup> *ai* · *t <sup>i</sup>* and *gi* are polynomials of degree not larger than *k*.

In the subsequent parts we estimate values characterising the exponential growth of the family |**infix**(*P*<sup>∗</sup> *<sup>q</sup>* ) <sup>∩</sup> *<sup>X</sup>n*<sup>|</sup> *<sup>n</sup>*∈N. This growth mainly depends on the root of largest modulus among the *θ<sup>i</sup>* and the corresponding polynomial *gi*.

First we show that, independently of the quasiperiod *q*, the root *θ<sup>i</sup>* of largest modulus is always positive and the corresponding polynomial *gi* is constant.

In the remainder of this section we use, without explicit reference, known results from the theory of formal power series, in particular about generating functions of languages and codes which can be found in the literature, e.g., in [14,23,24].

#### *5.1. The Subword Complexity of a Regular Star Language*

The language *P*∗ *<sup>q</sup>* is a regular star-language of special shape. Here we show that, generally, the number of subwords of regular star-languages grows only exponentially without a polynomial factor. We start with some easily derived relations between the number of words in a regular language and the number of its subwords.

**Lemma 6.** *If L* ⊆ *X*<sup>∗</sup> *is a regular language then there is an m* ∈ N *such that*

<sup>|</sup>*<sup>L</sup>* <sup>∩</sup> *<sup>X</sup>n*|≤|**infix**(*L*) <sup>∩</sup> *<sup>X</sup>n*| ≤ *<sup>m</sup>* · <sup>∑</sup>2*<sup>m</sup> <sup>i</sup>*=<sup>0</sup> <sup>|</sup>*<sup>L</sup>* <sup>∩</sup> *<sup>X</sup>n*+*<sup>i</sup>* | (12)

If the finite automaton accepting *L* has *m* states then for every *w* ∈ **infix**(*L*) there are words *u*, *v* of length ≤ *m* such that *u* · *w* · *v* ∈ *L*. Thus as a suitable *m* one may choose the number of states of an automaton accepting the language *L* ⊆ *X*∗.

A first consequence of Lemma 6 is that the identity

$$\limsup\_{n \to \infty} \sqrt[n]{|L \cap X^n|} = \limsup\_{n \to \infty} \sqrt[n]{|\inf \mathbf{x}(L) \cap X^n|} \tag{13}$$

holds for regular languages *L* ⊆ *X*∗.

In order to derive the announced exponential growth we use Corollary 4 of [25] which shows that for every regular language *L* ⊆ *X*<sup>∗</sup> there are constants *c*1, *c*<sup>2</sup> > 0 and a *λ* ≥ 1 such that

$$c\_1 \cdot \lambda^n \le |\mathbf{pred}(L^\*) \cap X^n| \le c\_2 \cdot \lambda^n. \tag{14}$$

A consequence of Lemma 6 is that Equation (14) holds also (with a different constant *c*2) for **infix**(*L*∗).

#### *5.2. The Subword Complexity of Qq*

In this part we estimate the value *λ<sup>q</sup>* of Equation (11). In view of Equations (10) and (14) the value *<sup>λ</sup><sup>q</sup>* satisfies the inequality *<sup>c</sup>*<sup>1</sup> · *<sup>λ</sup><sup>n</sup> <sup>q</sup>* ≤ |**infix**(*P*<sup>∗</sup> *<sup>q</sup>* ) <sup>∩</sup> *<sup>X</sup>n*| ≤ *<sup>c</sup>*<sup>2</sup> · *<sup>λ</sup><sup>n</sup> q* .

As *P*∗ *<sup>q</sup>* is a regular language Equations (11) and (13) show that

$$\lambda\_q = \limsup\_{n \to \infty} \sqrt[n]{|P\_q^\* \cap X^n|}$$

which is the inverse of the convergence radius rad s<sup>∗</sup> *<sup>q</sup>* of the power series s<sup>∗</sup> *<sup>q</sup>* (*t*) := <sup>∑</sup>*n*∈<sup>N</sup> |*P*<sup>∗</sup> *q* ∩ *<sup>X</sup>n*| · *<sup>t</sup> <sup>n</sup>*. The series s<sup>∗</sup> *<sup>q</sup>* is also known as the structure generating function of the language *P*<sup>∗</sup> *q* .

Since ∗ *Pq* is a code, we have s<sup>∗</sup> *<sup>q</sup>* (*t*) = <sup>1</sup> <sup>1</sup>−s*q*(*t*) where <sup>s</sup>*q*(*t*) :<sup>=</sup> <sup>∑</sup>*v*<sup>∈</sup> <sup>∗</sup> √*Pq t* <sup>|</sup>*v*<sup>|</sup> is the structure generating function of the finite language ∗ *Pq*. As s<sup>∗</sup> *<sup>q</sup>* has non-negative coefficients Pringsheim's theorem shows that rad s<sup>∗</sup> *<sup>q</sup>* = *λ*−<sup>1</sup> *<sup>q</sup>* is a singular point of s<sup>∗</sup> *<sup>q</sup>* . Thus *λ*−<sup>1</sup> *<sup>q</sup>* is the smallest root of 1 − s*q*(*t*). Hence *λ<sup>q</sup>* is the largest positive root of the polynomial *pq*(*t*) := *t* <sup>|</sup>*q*<sup>|</sup> <sup>−</sup> <sup>∑</sup>*v*<sup>∈</sup> <sup>∗</sup> √*Pq t* |*q*|−|*v*| .

**Remark 1.** *If the length of q*<sup>0</sup> = min *Pq does not divide* |*q*| *then pq*(*t*) *is the reversed polynomial of* 1 − s*q*(*t*)*, that is, has as roots exactly the the inverses of the roots of* 1 − s*q*(*t*)*.*

*If* |*q*0| *divides* |*q*| *then q* ∈/ ∗ *Pq (cf. Corollary 5) and pq*(*t*) *has additionally the root* 0 *with multiplicity* |*q*|−|*q* | *where q is the longest word in* ∗ *Pq.*

Summarising our observations we obtain the following.

**Lemma 7.** *Let q* ∈ *X*<sup>∗</sup> \ {*e*}*. Then there are constants cq*,1, *cq*,2 > 0 *such that the structure function of the language* **infix**(*P*∗ *<sup>q</sup>* ) *satisfies*

$$c\_{q,1} \cdot \lambda\_q^n \le |\mathbf{infix}(P\_q^\*) \cap X^n| \le c\_{q,2} \cdot \lambda\_q^n$$

*where λ<sup>q</sup> is the largest (positive) root of the polynomial pq*(*t*)*.*

**Remark 2.** *One could prove Lemma 7 by showing that, for each polynomial pq*(*t*)*, its largest (positive) root has multiplicity* 1*. Referring to Corollary 4 of [25] (see Equation (14)) we avoided these more detailed considerations of a particular class of polynomials.*

Now we are able to formulate our main theorem.

As quasiperiods *q*, |*q*| ≤ 2, have trivially *P*<sup>∗</sup> *<sup>q</sup>* = {*q*0}∗, that is, *λ<sup>q</sup>* = 1, in the sequel we confine our considerations to quasiperiods *q* of length |*q*| ≥ 3, and we will always assume that the first letter of a quasiperiod *q* is *a* ∈ *X*.

Define *<sup>Q</sup>*max :<sup>=</sup> {*anban* : *<sup>n</sup>* <sup>≥</sup> <sup>1</sup>}∪{*anwan* : <sup>|</sup>*w*<sup>|</sup> <sup>=</sup> 2, *<sup>w</sup>* <sup>=</sup> *aa*, *<sup>n</sup>* <sup>≥</sup> <sup>1</sup>}.

**Theorem 3** (Main theorem)**.** *Let q* ∈ *a* · *X*∗, |*q*| ≥ 3, *q* ∈/ *Q*max*, be a quasiperiod and n* = <sup>|</sup>*q*|−<sup>1</sup> <sup>2</sup> *. Then λ<sup>q</sup>* < *λanban or λ<sup>q</sup>* < *λanbban according to whether* |*q*| *is odd or even. Moreover, λ<sup>w</sup>* < *λaba* = *λaabaa if w* ∈ *a* · *X*<sup>∗</sup> \ {*aba*, *aabaa*}*.*

#### **6. Polynomials**

Before proceeding to the proof of our main theorem we derive some properties of polynomials of the form *p*(*t*) = *t <sup>n</sup>* <sup>−</sup> <sup>∑</sup>*i*∈*<sup>M</sup> <sup>t</sup> i* , where *M* ⊆ {*i* : *i* ∈ N ∧ *i* < *n*}. This class of polynomials includes the polynomials *pq*(*t*) whose maximal roots *λ<sup>q</sup>* characterise the growth of **infix**(*P*∗ *<sup>q</sup>* ) as described in Lemma 7. We focus in results which are useful for comparing their maximal roots.

The polynomials *<sup>p</sup>*(*t*) <sup>∈</sup> <sup>P</sup><sup>ˆ</sup> :<sup>=</sup> *t <sup>n</sup>* <sup>−</sup> <sup>∑</sup>*i*∈*<sup>M</sup> <sup>t</sup> <sup>i</sup>* : <sup>∅</sup> <sup>=</sup> *<sup>M</sup>* ⊆ {0, ... , *<sup>n</sup>* <sup>−</sup> <sup>1</sup>} have the following easily verified properties.

$$p(0) \le 0, p(1) \le 0, p(2) \ge 1 \text{ and } p(t) < 0 \text{ for } 0 < t < 1. \tag{15}$$

$$\text{If } \varepsilon > 0 \text{ and } p(t') \ge 0 \text{ for some } t' > 0 \text{ then } p\left((1+\varepsilon)\cdot t'\right) > 0. \tag{16}$$

Since *<sup>p</sup>*(1) <sup>≤</sup> 0 and *<sup>p</sup>*(2) <sup>≥</sup> 1 for *<sup>p</sup>*(*t*) <sup>∈</sup> <sup>P</sup>ˆ, Equation (16) shows that once *<sup>p</sup>*(*<sup>t</sup>* ) ≥ 0, *t* ≥ 1, the polynomial *p*(*t*) has no further root in the interval (*t* , <sup>∞</sup>) and *<sup>p</sup>*(*t*) <sup>∈</sup> <sup>P</sup><sup>ˆ</sup> has exactly one root in the interval [1, 2). This yields the following fundamental property.

**Property 1.** *If <sup>t</sup>*<sup>0</sup> *is the positive root of the polynomial <sup>p</sup>*(*t*) <sup>∈</sup> <sup>P</sup><sup>ˆ</sup> *in* [1, 2) *and* <sup>1</sup> <sup>≤</sup> *<sup>t</sup>* < 2 *then p*(*t* ) ≤ 0 *if and only if t* ≤ *t*0*.*

For the roots of maximal modulus we have the following theorem.

**Theorem 4** (Cauchy)**.** *Let p*(*t*) = ∑*<sup>n</sup> <sup>i</sup>*=<sup>0</sup> *ai* · *t <sup>i</sup> be a complex polynomial. Then every root t of p*(*t*) *satisfies* |*t* | ≤ *t*<sup>0</sup> *where t*<sup>0</sup> *is the maximal root of the polynomial* |*an*| · *t <sup>n</sup>* <sup>−</sup> <sup>∑</sup>*n*−<sup>1</sup> *<sup>i</sup>*=<sup>0</sup> |*ai*| · *t i .*

This implies the following property of polynomials *<sup>p</sup>*(*t*) <sup>∈</sup> <sup>P</sup>ˆ.

$$\text{If } p(t) = 0 \text{ then } |t| \le t\_0 \text{ .} \tag{17}$$

From Property 1 we derive the following criterion to compare the maximal roots of polynomials in <sup>P</sup>ˆ.

**Criterion 1.** *Let <sup>p</sup>*1(*t*), *<sup>p</sup>*2(*t*) <sup>∈</sup> <sup>P</sup><sup>ˆ</sup> *have maximal roots <sup>t</sup>*<sup>1</sup> *and <sup>t</sup>*2*, respectively. Then <sup>p</sup>*2(*t*1) <sup>&</sup>gt; <sup>0</sup> *if and only if t*<sup>1</sup> > *t*2*.*

We conclude this section with a bound on the maximal root of certain polynomials in <sup>P</sup>ˆ.

**Lemma 8.** *Let p*(*t*) = *t <sup>n</sup>* <sup>−</sup> <sup>∑</sup>*<sup>m</sup> <sup>i</sup>*=<sup>0</sup> *t i* , *<sup>n</sup>* > *<sup>m</sup>* ≥ <sup>1</sup>*. Then <sup>p</sup>*(*t*) < <sup>0</sup> *for* <sup>1</sup> ≤ *<sup>t</sup>* ≤ <sup>2</sup>*n*<sup>−</sup> *<sup>m</sup>* (*m* + 1)<sup>2</sup> *and <sup>p</sup>*(*t*) <sup>&</sup>gt; <sup>0</sup> *for <sup>n</sup>*−√*<sup>m</sup> <sup>m</sup>* <sup>+</sup> <sup>1</sup> <sup>≤</sup> *t.*

**Proof.** The assertion follows from the inequality *t <sup>n</sup>* <sup>−</sup> (*<sup>m</sup>* <sup>+</sup> <sup>1</sup>) · *<sup>t</sup> <sup>m</sup>* < *p*(*t*) < *t <sup>n</sup>* <sup>−</sup> (*<sup>m</sup>* <sup>+</sup> 1) · *t <sup>m</sup>*/2 when *t* > 1. The part *p*(*t*) < *t <sup>n</sup>* <sup>−</sup> (*<sup>m</sup>* <sup>+</sup> <sup>1</sup>) · *<sup>t</sup> <sup>m</sup>*/2 uses the arithmetic-geometricmeans inequality ∑*<sup>m</sup> <sup>i</sup>*=<sup>0</sup> *t <sup>i</sup>* <sup>&</sup>gt; (*<sup>m</sup>* <sup>+</sup> <sup>1</sup>) · *<sup>m</sup>*+<sup>1</sup> ∏*<sup>m</sup> <sup>i</sup>*=<sup>0</sup> *t<sup>i</sup>* = (*m* + 1) · *t <sup>m</sup>*/2, and the other part is obvious.

The following special case is needed below in Lemma 12.

$$\text{Corollary 10. } \text{If } p(t) = t^n - \sum\_{i=0}^{n-3} t^i, n \ge 4 \text{, then } p(t) < 0 \text{ for } 1 \le t \le \sqrt[n+3]{(n-2)^2}.$$

The subsequent sections are devoted to the proof of our main theorem.

#### **7. Irreducible Quasiperiods**

We start with irreducible quasiperiods.

#### *7.1. Extremal Polynomials*

The polynomials *pq*(*t*) of irreducible quasiperiods have non-zero coefficients only for <sup>|</sup>*q*<sup>|</sup> and *<sup>i</sup>* <sup>&</sup>lt; <sup>|</sup>*q*<sup>|</sup> <sup>2</sup> . Therefore we investigate the set

$$\mathcal{P} := \left\{ t^n - \sum\_{i \in M} t^i : n \ge 2 \land \mathcal{O} \ne M \subseteq \left\{ i : i \le \frac{n-1}{2} \right\} \right\}.$$

$$\text{Let } p\_n(t) := t^n - \sum\_{i=0}^{\lfloor \frac{n-1}{2} \rfloor} t^i \in \mathcal{P}.$$

**Property 2.** *Let p*(*t*) ∈ P *a polynomial of degree n* ≥ 3*. Then pn*(*t*) ≤ *p*(*t*) *for t* ∈ [1, 2]*, and pn*(*t*) *has the largest positive root among all polynomials of degree n in* P*.*

**Proof.** This follows from *t <sup>n</sup>* <sup>−</sup> <sup>∑</sup> *<sup>n</sup>*−<sup>1</sup> 2 *<sup>i</sup>*=<sup>0</sup> *t <sup>i</sup>* <sup>&</sup>lt; *<sup>p</sup>*(*t*) for *<sup>p</sup>*(*t*) ∈ P\{*pn*(*t*) : *<sup>n</sup>* <sup>≥</sup> <sup>3</sup>} when 1 < *t* ≤ 2 and Criterion 1.

Observe that, for *n* ≥ 1,

$$p\_{2u+1}(t) = t^{2u+1} - 
\sum\_{i=0}^{
\eta} t^i 
\text{ and } p\_{2u+2}(t) = t^{2u+2} - 
\sum\_{i=0}^{
\eta} t^i 
\dots$$

Moreover, the words *<sup>a</sup>nban* <sup>∈</sup> *<sup>Q</sup>*max and *<sup>a</sup>nwan* <sup>∈</sup> *<sup>Q</sup>*max, *<sup>w</sup>* ∈ {*xb*, *bx*}, *<sup>x</sup>* <sup>∈</sup> *<sup>X</sup>* are the quasiperiods corresponding to the extremal polynomials *p*2*n*+1(*t*) ∈ P and *p*2*n*+2(*t*) ∈ P, respectively.

**Lemma 9.** *<sup>Q</sup>*max := {*<sup>q</sup>* : *<sup>q</sup>* ∈ *<sup>a</sup>* · *<sup>X</sup>*<sup>∗</sup> ∧ |*q*| ≥ <sup>3</sup> ∧ *pq*(*t*) = *<sup>p</sup>*|*q*|(*t*)}

**Proof.** If *<sup>q</sup>* ∈ *<sup>Q</sup>*max then obviously *pq*(*t*) = *<sup>p</sup>*|*q*|(*t*). Conversely, if *pq*(*t*) = *<sup>t</sup>* |*q*| − <sup>∑</sup>*v*<sup>∈</sup> <sup>∗</sup> √*Pq t* <sup>|</sup>*q*|−|*v*<sup>|</sup> <sup>=</sup> *<sup>p</sup>*|*q*|(*t*) then <sup>∗</sup> *Pq* <sup>=</sup> {*<sup>v</sup>* : *<sup>v</sup> <sup>q</sup>* ∧ |*v*<sup>|</sup> <sup>&</sup>gt; <sup>|</sup>*q*<sup>|</sup> <sup>2</sup> }. Then, in view of *q v* · *q*, every prefix *<sup>w</sup> <sup>q</sup>* of length <sup>|</sup>*w*<sup>|</sup> <sup>&</sup>lt; <sup>|</sup>*q*<sup>|</sup> <sup>2</sup> is also a suffix of *q*. This is possible only for *q* ∈ *Q*max or *q* ∈ {*a*}∗.

In the sequel the positive root of *pn*(*t*) is denoted by *λn*. From Criterion 1 we obtain immediately.

**Property 3.** *Let t* ≥ 1*. We have t* < *λ<sup>n</sup> if and only if pn*(*t*) < 0*.*

Then Property 2 implies the following.

**Theorem 5.** *If <sup>q</sup>* ∈ *<sup>a</sup>* · *<sup>X</sup>*∗, |*q*| ≥ 3, *is an irreducible quasiperiod then <sup>λ</sup><sup>q</sup>* ≤ *<sup>λ</sup>*|*q*|*, and <sup>λ</sup><sup>q</sup>* = *<sup>λ</sup>*|*q*<sup>|</sup> *if and only if q* ∈ *Q*max*.*

#### *7.2. The Ordering of the Maximal Roots λ<sup>n</sup>*

Before we proceed to the case of reducible quasiperiods we determine the ordering of the maximal roots *λn*. This will not only be interesting for itself but also useful for proving *<sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*<sup>|</sup> when *<sup>q</sup>* is reducible (see Equation (28) below).

The extremal polynomials *pn*(*t*), *n* ≥ 2, satisfy the following general relations (By convention, ∑*<sup>m</sup> <sup>i</sup>*=*<sup>k</sup> ai* = 0 if *k* > *m*).

$$t \cdot p\_{2n}(t) - 1 \quad = \quad p\_{2n+1}(t) \,. \tag{18}$$

$$p\_{2n+2}(t) - t^2 \cdot p\_{2n}(t) \quad = \quad t^{n+1} - t - 1 \,, \tag{19}$$

$$t^{n-2} \cdot p\_{2n+1}(t) - (t^n + 1) \cdot p\_{2n-1}(t) \quad = \quad \sum\_{i=0}^{n-3} t^i \text{, and} \tag{20}$$

$$t^{n-2} \cdot p\_{2n+3}(t) - (t^{n+1} + 1) \cdot p\_{2n}(t) \quad = \quad -t^n + \sum\_{i=0}^{n-3} t^i. \tag{21}$$

**Lemma 10.** *The polynomials t* <sup>3</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup> *and <sup>t</sup>* <sup>5</sup> <sup>−</sup> *<sup>t</sup>* <sup>2</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup> = (*<sup>t</sup>* <sup>2</sup> <sup>+</sup> <sup>1</sup>) · (*<sup>t</sup>* <sup>3</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup>) *have largest positive roots λ*<sup>3</sup> = *λ*<sup>5</sup> *among all polynomials in* P*, λ*<sup>5</sup> > *λ*<sup>4</sup> *and λ*2*n*−<sup>1</sup> > *λ*2*n*+<sup>1</sup> > *λ*2*<sup>n</sup> for n* ≥ 3*.*

**Proof.** From Equation (18) we have *p*2*n*+1(*λ*2*n*) = −1 < 0 and, therefore, *λ*2*<sup>n</sup>* < *λ*2*n*+<sup>1</sup> when *n* ≥ 1.

Similarly, Equation (20) yields *<sup>p</sup>*2*n*+1(*λ*2*n*−1) = *<sup>λ</sup>*−(*n*−2) <sup>2</sup>*n*−<sup>1</sup> · <sup>∑</sup>*n*−<sup>3</sup> *<sup>i</sup>*=<sup>0</sup> *<sup>λ</sup><sup>i</sup>* <sup>2</sup>*n*−<sup>1</sup> <sup>&</sup>gt; 0 which implies *λ*2*n*+<sup>1</sup> < *λ*2*n*−<sup>1</sup> for *n* ≥ 3 and *λ*<sup>3</sup> = *λ*<sup>5</sup> when *n* = 2.

The largest (positive) root *λ*<sup>3</sup> of the polynomial *t* <sup>3</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> 1 is also known as the smallest Pisot-Vijayaraghavan number.

So far we have ordered the 'odd' roots: *λ*<sup>3</sup> = *λ*<sup>5</sup> > *λ*<sup>7</sup> > *λ*<sup>9</sup> > ··· . Next we are going to investigate the ordering of the 'even' roots *λ*2*n*, *n* ≥ 2.

To this end we derive the following bounds.

#### **Lemma 11.**

$$\begin{array}{ll} 1. & ^{3n+1}\sqrt[3n]{n^2} \le \lambda\_{2n} \le \sqrt[n+1]{n} \text{ and } ^{3n-1}\sqrt[3n-1]{n^2} \le \lambda\_{2n-1} \le \sqrt[n]{n} \text{ for } n \ge 2. \\ 2. & \text{Let } n \ge 5. \text{ Then } \lambda\_{2n} \ge \sqrt[n-1]{2}. \end{array}$$

**Proof.** 1. follows from Lemma 8.

2. We calculate *p*2*n*( *<sup>n</sup>*<sup>−</sup> <sup>√</sup><sup>1</sup> <sup>2</sup>) = <sup>4</sup> · *<sup>n</sup>*<sup>−</sup> <sup>√</sup><sup>1</sup> <sup>4</sup> <sup>−</sup> <sup>∑</sup>*n*−<sup>1</sup> *i*=0 *n*− <sup>√</sup><sup>1</sup> <sup>2</sup>*<sup>i</sup>* <sup>≤</sup> <sup>4</sup> · <sup>√</sup><sup>4</sup> <sup>4</sup> <sup>−</sup> (<sup>2</sup> + (*<sup>n</sup>* <sup>−</sup> <sup>1</sup>)) = 4 · <sup>√</sup><sup>2</sup> <sup>−</sup> (*<sup>n</sup>* <sup>+</sup> <sup>1</sup>) <sup>&</sup>lt; 0 if *<sup>n</sup>* <sup>≥</sup> 5 and the assertion follows with Property 1.

**Remark 3.** The lower bound of Lemma 11.2 does not exceed the lower bound in Lemma 11.1. However, the latter is more convenient for the purposes of Lemma 12.

**Lemma 12.** *If n* ≥ 5 *then λ*2*n*−<sup>2</sup> > *λ*2*<sup>n</sup> and λ*2*<sup>n</sup>* > *λ*2*n*+3*.*

**Proof.** If *<sup>t</sup>* <sup>≥</sup> *<sup>n</sup>*<sup>−</sup> <sup>√</sup><sup>1</sup> <sup>2</sup> then *<sup>t</sup> <sup>n</sup>* <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup> <sup>≥</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup> <sup>&</sup>gt; 0. Consequently, Equation (19) and Lemma 11.2 imply *p*2*n*−2(*λ*2*n*) < 0 whence *λ*2*<sup>n</sup>* < *λ*2*n*−2.

If *n* ≥ 5 we have *<sup>n</sup>*<sup>+</sup> <sup>√</sup><sup>1</sup> *<sup>n</sup>* <sup>≤</sup> *<sup>n</sup>*<sup>+</sup> <sup>3</sup> (*<sup>n</sup>* <sup>−</sup> <sup>2</sup>)<sup>2</sup> and, following Lemma 11.1 *<sup>λ</sup>*2*<sup>n</sup>* <sup>≤</sup> *<sup>n</sup>*<sup>+</sup> <sup>3</sup> (*<sup>n</sup>* <sup>−</sup> <sup>2</sup>)2. Then Equation (21) yields <sup>−</sup>*λ*2*<sup>n</sup>* · *<sup>p</sup>*2*n*+3(*λ*2*n*) = *<sup>λ</sup><sup>n</sup>* <sup>2</sup>*<sup>n</sup>* <sup>−</sup> <sup>∑</sup>*n*−<sup>3</sup> *<sup>i</sup>*=<sup>0</sup> *<sup>λ</sup><sup>i</sup>* <sup>2</sup>*n*, and Corollary 10 shows *p*2*n*+3(*λ*2*n*) > 0 whence *λ*2*<sup>n</sup>* > *λ*2*n*+3.

Since *p*8( <sup>√</sup><sup>3</sup> <sup>2</sup>) <sup>&</sup>gt; 0, the proof of Lemma <sup>12</sup> cannot be applied to lower values of *<sup>n</sup>*. Thus it remains to establish the order of the *λ<sup>i</sup>* for *i* ≤ 13. To this end, we consider some special identities and use Criterion 3 and Lemma 12.

$$p\_{12}(t) - (t^8 + t^5 + t^4 + t^2 + t) \cdot p\_4(t) \quad = \quad t^2 - 1 \text{, and} \tag{22}$$

$$p\_{13}(t) - t \cdot \left(t^8 + t^5 + t^4 + t^2 + t\right) \cdot p\_4(t) \quad = \quad t^3 - t - 1 = p\_3(t) \,. \tag{23}$$

**Lemma 13.** *λ*<sup>8</sup> > *λ*<sup>10</sup> > *λ*<sup>13</sup> > *λ*<sup>4</sup> > *λ*<sup>12</sup>

**Proof.** Lemma 12 shows *λ*<sup>8</sup> > *λ*<sup>10</sup> > *λ*13. Equation (22) yields *p*12(*λ*4) = *λ*<sup>2</sup> <sup>4</sup> − 1 > 0 whence *λ*<sup>4</sup> > *λ*12, and Equation (23) yields *p*13(*λ*4) = *p*3(*λ*4) < 0, that is, *λ*<sup>13</sup> > *λ*4. This shows our assertion.

For the remaining part we consider the identities

$$t^2 \cdot p\_{11}(t) - \left(t^5 + 1\right) \cdot p\_8(t) \quad = \quad -t^4 + t + 1 = -p\_4(t) \,. \tag{24}$$

$$p\_{11}(t) - (t^5 + 1) \cdot p\_6(t) \quad = \quad t^3 \cdot p\_4(t) \text{, and} \tag{25}$$

$$t \cdot p\_{\theta}(t) - (t^4 + 1) \cdot p\_{\theta}(t) \quad = \quad -t^3 + 1 \,. \tag{26}$$

**Lemma 14.** *λ*<sup>9</sup> > *λ*<sup>6</sup> > *λ*<sup>11</sup> > *λ*<sup>8</sup>

**Proof.** We use Equations (24)–(26). Then *p*11(*λ*8) = −*p*4(*λ*8) < 0 implies *λ*<sup>11</sup> > *λ*8, *p*11(*λ*6) = *λ*<sup>3</sup> <sup>6</sup> · *<sup>p</sup>*4(*λ*6) <sup>&</sup>gt; 0 implies *<sup>λ</sup>*<sup>6</sup> <sup>&</sup>gt; *<sup>λ</sup>*11, and, finally, *<sup>λ</sup>*<sup>6</sup> · *<sup>p</sup>*9(*λ*6) = <sup>−</sup>*λ*<sup>3</sup> <sup>6</sup> + 1 < 0 implies *λ*<sup>9</sup> > *λ*6.

Now Lemma 10, 12–14 yield the complete ordering of the values *λn*.

**Theorem 6.** *Let λn*, *n* ≥ 3, *be the maximal root of the polynomial pn*(*t*)*. Then the overall ordering of the values λ<sup>n</sup> starts with*

$$
\lambda\_3 = \lambda\_5 > \lambda\_7 > \lambda\_9 > \lambda\_6 > \lambda\_{11} > \lambda\_8 > \lambda\_{10} > \lambda\_{13} > \lambda\_4 > \lambda\_{12}
$$

*and continues as follows λ*2*n*+<sup>1</sup> > *λ*2*<sup>n</sup>* > *λ*2*n*+3, *n* ≥ 7*.*

In connection with Proposition 6 and Corollary 7 we obtain that the Pisot-Vijayaraghavan number *λ*<sup>3</sup> = *λ*<sup>5</sup> is an overall upper bound on the values *λq*.

**Corollary 11.** *If q* ∈ *X*∗, |*q*| ≥ 3, *then λ<sup>q</sup>* ≤ *λ*<sup>3</sup> = *λ*5*.*

From Lemma 11.1 we obtain immediately.

**Corollary 12.** *Let M* ⊆ N \ {0, 1, 2} *be infinite. Then* inf{*λ<sup>i</sup>* : *i* ∈ *M*} = 1*.*

#### **8. Reducible Quasiperiods**

Reducible quasiperiods *q* have a repeated prefix *q*<sup>0</sup> = min *Pq* with |*q*0|≤|*q*|/2 and a repetition factor *<sup>k</sup>* <sup>≥</sup> 2 such that *<sup>q</sup>* <sup>=</sup> *<sup>q</sup><sup>k</sup>* <sup>0</sup> · *q*¯ where *q*¯ *q*0. Moreover |*q*¯| < |*q*0|≤|*q*|/2. Observe that *q*<sup>0</sup> is primitive.

We shall consider three cases depending on the relation between the lengths *n* = |*q*|, -= |*q*0|, the length of the suffix |*q*¯| < |*q*0| and the repetition factor *k* ≥ 2.

IN the first case |*q*0| + |*q*¯| ≤ 2, in view of *q*¯ *q*0, we have necessarily *q*¯ = *e* and *q* ∈ *a*<sup>∗</sup> ∪ {*ab*}∗, *a*, *b* ∈ *X*, *a* = *b* and, therefore, *Qq* = {*q*0}<sup>∗</sup> and *λ<sup>q</sup>* = 1.

Let now |*q*0| + |*q*¯| ≥ 3. We divide the remaining cases according to the additional requirement |*q*| − 2|*q*0| ≥ 3 and its complementary one |*q*| − 2|*q*0| ≤ 2. In the latter case we have necessarily *k* = 2 and |*q*¯| ≤ 2.

*8.1. The Case* |*q*0| + |*q*¯| ≥ 3 ∧ |*q*| − 2|*q*0| ≥ 3

Thus, the preceding consideration shows that we have |*q*¯| ≥ 3 (in particular, if *q* = *q*<sup>2</sup> <sup>0</sup> · *<sup>q</sup>*¯) or the repetition factor *<sup>k</sup>* <sup>≥</sup> 3. This implies <sup>|</sup>*q*<sup>|</sup> <sup>=</sup> 7 (where *<sup>q</sup>* = (*ab*)3*a*) or <sup>|</sup>*q*| ≥ 9. From Equation (6) we have

$$\sqrt[4]{P\_q} \subseteq \{q\_0\} \cup \{v: v \sqsubseteq q \land |v| > |q| - |q\_0| + 1\} \tag{27}$$

This implies that for |*q*0|≤|*q*|/2 the polynomials *pq*(*t*) have non-zero coefficients only for |*q*| = *n*, |*q*|−|*q*0| = *n* − and *i* < |*q*0| − 1, that is, are of the form *pq*(*t*) = *t <sup>n</sup>* <sup>−</sup> *<sup>t</sup> n*−- − ∑*i*∈*Mq t <sup>i</sup>* where *Mq* ⊆ {*<sup>i</sup>* : *<sup>i</sup>* < - − 1}. Therefore, in the sequel we consider the positive roots of polynomials in

$$\mathcal{P}\_{\text{red}} := \left\{ t^n - t^{n-\ell} - \sum\_{i \in M} t^i : n \ge 1 \land \ell \le \frac{n}{2} \land M \subseteq \{ i : i < \ell - 1 \} \right\},$$

Let *pn*,-(*t*) := *t <sup>n</sup>* <sup>−</sup> *<sup>t</sup> n*−- <sup>−</sup> <sup>∑</sup>-−2 *<sup>i</sup>*=<sup>0</sup> *t <sup>i</sup>* ∈ Pred and *<sup>λ</sup>n*, be its maximal root. (In the preceding paper [8] we used a slightly different definition of Pred, and, therefore, of *pn*,-(*t*) and *λn*,-.) Similar to Property 2, Criterion 3 and Theorem 5 we have the following.

**Property 4.** *Let n* ≥ 3, - <sup>≤</sup> *<sup>n</sup>* <sup>2</sup> *and p*(*t*) ∈ Pred*. Then p*(*t*) ≥ *pn*,-(*t*) *for t* ∈ [1, 2]*, and pn*,-(*t*) *has the largest positive root among all polynomials of degree n and parameter in* Pred*.*

**Lemma 15.** *If q*, |*q*| = *n, is a quasiperiod with* |*q*0| = - ≤ *n*/2 *then pq*(*t*) ≥ *pn*,-(*t*) *for t* ≥ 1*, in particular, λ<sup>q</sup>* ≤ *λn*,-*.*

**Remark 4.** *In contrast to Property 2 not for every polynomial pn*,-(*t*) *there is a quasiperiod q such that pn*,-(*t*) = *pq*(*t*)*, see Remark 5 below.*

We have the following relation between the polynomials *pn*(*t*) and *pn*,-(*t*).

$$p\_n(t) - t^\ell \cdot p\_{n-2\ell}(t) = p\_{n,\ell}(t) - t^{\ell-1}, \text{ for } n - 2\ell \ge 3\tag{28}$$

This yields

**Corollary 13.** *Let n* − 2 · - ≥ <sup>3</sup>*. If <sup>λ</sup><sup>n</sup>* < *<sup>λ</sup>n*−2 *then λn*,-< *λn.*

**Proof.** If *<sup>λ</sup><sup>n</sup>* < *<sup>λ</sup>n*−2 then *pn*−2-(*λn*) < *pn*−2-(*λn*−2-) = 0. Thus *pn*,-(*λn*) = <sup>−</sup>*λ*- *n* · *pn*−2-(*λn*) + *λ*-<sup>−</sup><sup>1</sup> *<sup>n</sup>* > 0, that is, *λ<sup>n</sup>* > *λn*,-.

Next we show the relation *<sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*<sup>|</sup> for all quasiperiods *<sup>q</sup>* having |*q*0|≤|*q*|/2 and |*q*0| + |*q*¯| ≥ 3.

**Lemma 16.** *Let* |*q*| − <sup>2</sup>|*q*0| ≥ <sup>3</sup> *and* |*q*0| + |*q*¯| ≥ <sup>3</sup>*. Then <sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*|*.*

**Proof.** Above we have shown that |*q*| − 2|*q*0| ≥ 3 and |*q*0| + |*q*¯| ≥ 3 imply |*q*| ≥ 7 or |*q*| ≥ 10 according to whether |*q*| is odd or even.

The ordering of Theorem 6 and Corollary 13 show *λ<sup>n</sup>* > *λn*, for all odd values *n* ≥ 7 and for all even values *n* ≥ 12.

It remains to consider the exceptional case when *n* = |*q*| = 10. Here |*q*| − 2|*q*0| ≥ 3 and |*q*0| + |*q*¯| ≥ 3 imply - = |*q*0| = 3. Consider *p*10,3(*t*) = *t* <sup>10</sup> <sup>−</sup> *<sup>t</sup>* <sup>7</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup> <sup>=</sup> *<sup>p</sup>*10(*t*) <sup>−</sup> *<sup>t</sup>* <sup>2</sup> · *<sup>p</sup>*5(*t*).

From *<sup>λ</sup>*<sup>5</sup> <sup>&</sup>gt; *<sup>λ</sup>*<sup>10</sup> and *<sup>p</sup>*10(*λ*10) = 0 we have *<sup>p</sup>*10,3(*λ*10) = <sup>−</sup>*λ*<sup>2</sup> <sup>10</sup> · *p*5(*λ*10) > 0, that is, *λ*10,3 < *λ*10.

**Remark 5.** *Equation (6) shows that for n* = |*q*| = 10 *and* - = |*q*0| = 3 *we have* ∗ *Pq* = {*q*0, *<sup>q</sup>*}*, that is, pq*(*t*) = *t* <sup>10</sup> <sup>−</sup> *<sup>t</sup>* <sup>7</sup> <sup>−</sup> <sup>1</sup>*. Thus there is no quasiperiod <sup>q</sup> such that pq*(*t*) = *<sup>p</sup>*10,3(*t*) = *t* <sup>10</sup> <sup>−</sup> *<sup>t</sup>* <sup>7</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup>*.*

*8.2. The Case* |*q*0| + |*q*¯| ≥ 3 ∧ |*q*| − 2|*q*0| ≤ 2

This amounts to |*q*| = 2 · |*q*0| + |*q*¯| where |*q*¯|∈{0, 1, 2}.

Here we have to go into more detail and to take into consideration also the reduced quasiperiod *q*ˆ = *q*<sup>0</sup> · *q*¯ of *q* and its repeated prefix *q*ˆ0 = min *Pq*ˆ. Observe that both repeated prefixes *q*0, *q*ˆ0 are primitive.

For *q* = *q<sup>k</sup>* <sup>0</sup> · *q*¯, *k* ≥ 2, we have from Equations (7) and (8)

$$p\_q(t) \in \left\{ t^{|q|} - t^{|q| - |q\_0|} - \sum\_{i \in M} t^i : M \subseteq \{ 0, \dots, |q| - |q\_0| \} \right\} \dots$$

Observe that |*q*ˆ0| > |*q*¯| (in view of Lemma 3 even |*q*ˆ0| > |*q*¯| + 1 if *q*ˆ0 = *q*0) and thus |*q*ˆ|−|*q*ˆ0| = |*q*0| − (|*q*ˆ0|−|*q*¯|) < |*q*0|.

Let P red := *t <sup>n</sup>* <sup>−</sup> *<sup>t</sup>* - − ∑*i*∈*<sup>M</sup> t <sup>i</sup>* : *n* >-> *j* ∧ *M* ⊆ {0, ... , - − *j*} and *pn*,-,*j*(*t*) = *t <sup>n</sup>* <sup>−</sup> *<sup>t</sup>* - <sup>−</sup> <sup>∑</sup>-−*j <sup>i</sup>*=<sup>0</sup> *t i* . Here the parameter *j* corresponds to the value |*q*ˆ0|−|*q*¯|. Then similar to Property 4 and Lemma 15 we have

**Property 5.** *Let n*, - ≥ 3, - <sup>≤</sup> *<sup>n</sup>* <sup>2</sup> , - > *j*, *and p*(*t*) ∈ P red*. Then p*(*t*) ≥ *pn*,-,*j*(*t*) *for t* ∈ [1, 2]*, and pn*,-,*j*(*t*) *has the largest positive root among all polynomials of degree n and parameters and j in* P red*.*

**Lemma 17.** *If q*, |*q*| = *n, is a quasiperiod with* |*q*0| = - ≤ *n*/2 *and* |*q*ˆ0|−|*q*¯| ≥ *j then pq*(*t*) ≥ *pn*,-,*j*(*t*) *for t* ≥ 1*, in particular, λ<sup>q</sup>* ≤ *λn*,-,*j.*

We consider the cases |*q*¯|∈{0, 1, 2} separately. In the sequel we shall make use of the relation

$$t^3 - t^2 - 1 \le t^2 - t - 1 < 0 \text{ for } 1 \le t \le \lambda\_3 = \max\{\lambda\_n : n \in \mathbb{N}\}.\tag{29}$$

8.2.1. The Case *q* = *q*<sup>2</sup> <sup>0</sup> ∧ |*q*¯| = 0

As shown above the case |*q*0| ≤ 2 and |*q*¯| = 0 amounts to *λ<sup>q</sup>* = 1. Thus we may consider only the case when |*q*0| ≥ 3. Here we have the following relation between *p*2-(*t*) and *p*2-,-,3(*t*).

$$p\_{2\ell}(t) - p\_{2\ell,\ell,3}(t) = t^{\ell-2}(t^2 - t - 1) \tag{30}$$

**Lemma 18.** *If q* = *q*<sup>2</sup> <sup>0</sup> *and* |*q*0| = -≥ <sup>3</sup> *then <sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*|*.*

**Proof.** First we suppose |*q*ˆ0| ≥ 3. Then |*q*ˆ0|−|*q*¯| ≥ 3, and Property 5 and Lemma 17 yield *pq*(*t*) ≥ *p*2-,-,3(*t*) for *t* ∈ [1, 2]. Now Equations (29) and (30) show *pq*(*λ*2-) ≥ *p*2-,-,3(*λ*2-) = −*λ*-−2 2- (*λ*<sup>2</sup> 2- − *λ*2- − 1) > 0, that is *λ<sup>q</sup>* < *λ*2-.

It remains to consider 1 ≤ |*q*ˆ0| ≤ 2. If *<sup>q</sup>*ˆ0 <sup>∈</sup> *<sup>a</sup>*<sup>∗</sup> then *<sup>q</sup>*<sup>0</sup> <sup>=</sup> *<sup>a</sup>* which is not primitive. Thus *<sup>q</sup>*ˆ0 <sup>=</sup> *ab* and, since *<sup>q</sup>*<sup>0</sup> is primitive, *<sup>q</sup>*<sup>0</sup> = (*ab*)*ma*, *<sup>m</sup>* <sup>≥</sup> 1 whence *<sup>q</sup>* <sup>=</sup> *<sup>q</sup>*<sup>2</sup> <sup>0</sup> = (*ab*)*ma* · (*ab*)*ma*. We obtain ∗ *Pq* <sup>=</sup> {(*ab*)*ma* · (*ab*)*<sup>i</sup>* : *<sup>i</sup>* <sup>=</sup> 0, ... , *<sup>m</sup>*} and, consequently, *pq*(*t*) = *<sup>t</sup>* <sup>4</sup>*m*+<sup>2</sup> + ∑*<sup>m</sup> <sup>i</sup>*=<sup>0</sup> *t* <sup>2</sup>*i*<sup>+</sup>1. Then (Observe again ∑*<sup>m</sup>*

$$\begin{aligned} t^{2m+1}. \text{Then (Observe again } \sum\_{i=k}^m a\_i = 0 \text{ if } k > m). \\ p\_q(t) - p\_{4m+2}(t) &= -t^{2m+1} + \sum\_{i=0}^m t^{2i} = -t^{2m+1} + t^{2m} + t^{2m-2} + \sum\_{i=0}^{m-2} t^{2i} \\ &= -t^{2m-2} \cdot (t^3 - t^2 - 1) + \sum\_{i=0}^{m-2} t^{2i} \end{aligned}$$

and from Equation (29) we obtain *pq*(*λ*4*m*+2) ≥ −*λ*2*m*−<sup>2</sup> <sup>4</sup>*m*+2(*λ*<sup>3</sup> <sup>4</sup>*m*+<sup>2</sup> <sup>−</sup> *<sup>λ</sup>*<sup>2</sup> <sup>4</sup>*m*+<sup>2</sup> − 1) > 0. 8.2.2. The Case *q* = *q*<sup>2</sup> <sup>0</sup> · *q*¯ ∧ |*q*¯| = 1

> Here we have the following relation between *p*2-<sup>+</sup>1(*t*) and *p*2-+1,-,2(*t*).

$$p\_{2\ell+1}(t) - p\_{2\ell+1,\ell,2}(t) = t^{\ell-1}(t^2 - t - 1) \tag{31}$$

**Lemma 19.** *If q* = *q*<sup>2</sup> <sup>0</sup> · *<sup>a</sup>*, *<sup>a</sup>* ∈ *<sup>X</sup>*, *then <sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*|*.*

**Proof.** First we suppose |*q*ˆ0|−|*q*¯| ≥ 2. Then - = |*q*0|≥|*q*ˆ0| ≥ 3, and Property 5 and Equation (31) yield *pq*(*λ*2-<sup>+</sup>1) ≥ *p*2-+1,-,2(*λ*2-<sup>+</sup>1) = *p*2-+1(*λ*2-<sup>+</sup>1) <sup>−</sup> *<sup>λ</sup>*-−1 2-+1(*λ*<sup>2</sup> 2-<sup>+</sup><sup>1</sup> − *λ*2-+1 − 1). The assertion *pq*(*λ*2-<sup>+</sup>1) > 0, that is *λ<sup>q</sup>* < *λ*2-<sup>+</sup><sup>1</sup> follows from Equation (29).

It remains to consider |*q*ˆ0| = 2. By Lemma 3 *q*ˆ0 = *q*<sup>0</sup> implies |*q*ˆ0| > |*q*¯| + 1 = 2. Hence *q*ˆ0 = *q*<sup>0</sup> = *ab*, *q* = *ababa* and *pq*(*t*) = *t* <sup>5</sup> <sup>−</sup> *<sup>t</sup>* <sup>3</sup> <sup>−</sup> <sup>1</sup> <sup>=</sup> *<sup>t</sup>* <sup>2</sup> · *<sup>p</sup>*3(*t*) + *<sup>t</sup>* <sup>2</sup> <sup>−</sup> 1. Then *<sup>λ</sup>ababa* <sup>&</sup>lt; *<sup>λ</sup>*<sup>5</sup> follows from *λ*<sup>5</sup> = *λ*<sup>3</sup> and *pq*(*λ*5) = *λ*<sup>2</sup> <sup>5</sup> − 1 > 0.

8.2.3. The Case *q* = *q*<sup>2</sup> <sup>0</sup> · *q*¯ ∧ |*q*¯| = 2

> Here we have the following relation between *p*2-<sup>+</sup>2(*t*) and *p*2-+2,-,2(*t*).

$$p\_{2\ell+2}(t) - p\_{2\ell+2,\ell,2}(t) = t^{\ell-1}(t^3 - t - 1) = t^{\ell-1} \cdot p\_3(t) \tag{32}$$

**Lemma 20.** *If q* = *q*<sup>2</sup> <sup>0</sup> · *q with* ¯ |*q*¯| = <sup>2</sup> *then <sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*|*.*

**Proof.** First we suppose |*q*ˆ0| ≥ 4. Then Property 5, Equation (32) and *λ*2-<sup>+</sup><sup>2</sup> < *λ*<sup>3</sup> yield *pq*(*λ*2-<sup>+</sup>2) ≥ *p*2-+2,-,2(*λ*2-<sup>+</sup>2) = <sup>−</sup>*λ*-−1 2-<sup>+</sup><sup>2</sup> · *p*3(*λ*2-<sup>+</sup>2) > 0, that is, *λ<sup>q</sup>* < *λ*2-<sup>+</sup>2.

It remains to consider |*q*ˆ0| = 3. If *q*ˆ0 = *q*<sup>0</sup> Lemma 3 implies |*q*ˆ0| > |*q*¯| + 1. Consequently, *q*ˆ0 = *q*0. Then |*q*0| = 3 and |*q*| = 8, and Equation (6) yields ∗ *Pq* ⊆ {*q*0, *<sup>v</sup>*, *<sup>q</sup>*} where *v q* and |*v*| = |*q*| − 1 = 7. Thus *pq*(*t*) ≥ *t* <sup>8</sup> <sup>−</sup> *<sup>t</sup>* <sup>5</sup> <sup>−</sup> *<sup>t</sup>* <sup>−</sup> <sup>1</sup> <sup>=</sup> *<sup>p</sup>*8(*t*) <sup>−</sup> *<sup>t</sup>* <sup>2</sup> · *<sup>p</sup>*3(*t*) for 1 ≤ *t* ≤ *λ*3.

This shows *pq*(*λ*8) ≥ −*λ*<sup>2</sup> <sup>8</sup> · *p*3(*λ*8) > 0, that is, *λ<sup>q</sup>* < *λ*8.

Summarising, the results of Section 8 yield

**Theorem 7.** *If q* ∈ *<sup>X</sup>*∗, |*q*| ≥ <sup>3</sup>*, is a reducible quasiperiod then <sup>λ</sup><sup>q</sup>* < *<sup>λ</sup>*|*q*|*.*

Our main theorem (Theorem 3) then follows from Theorems 5 and 7.

Together with Corollary 12 our theorem yields a new proof of a theorem of [5] which shows that multi-scale quasiperiodic infinite words have zero topological entropy. In [5] a *multi-scale quasiperiodic infinite word* is a quasiperiodic infinite word which admits infinitely many quasiperiods.

#### **9. Concluding Remark**

In this paper we dealt with the function *<sup>f</sup>*(*ξ*, *<sup>n</sup>*) = <sup>|</sup>**infix**(*ξ*) <sup>∩</sup> *<sup>X</sup>n*<sup>|</sup> for quasiperiodic *ω*-words. Their factor complexity (or topological entropy) is defined as *τ*(*ξ*) := lim*n*→<sup>∞</sup> log|*X*<sup>|</sup> <sup>|</sup>**infix**(*ξ*)∩*Xn*<sup>|</sup> *<sup>n</sup>* (e.g., [4], Section 4.2.2 or [5,22]). Thus the upper bound for *<sup>ξ</sup>* <sup>∈</sup> *<sup>P</sup><sup>ω</sup> q* is log|*X*<sup>|</sup> *<sup>λ</sup><sup>q</sup>* <sup>≤</sup> log|*X*<sup>|</sup> *tP* which is bounded away from the value 1 for almost periodic *<sup>ω</sup>*words.

Along with the subword complexity in [5] the Kolmogorov complexity of quasiperiodic *ω*-words was addressed. Obviously, subword complexity upper bounds Kolmogorov complexity (e.g., [22]). Since the *ω*-languages *P<sup>ω</sup> <sup>q</sup>* are regular ones, the results of [22] show that there are *<sup>ω</sup>*-words *<sup>ξ</sup>* <sup>∈</sup> *<sup>P</sup><sup>ω</sup> <sup>q</sup>* whose Kolmogorov complexity achieves their subword complexity. Moreover, as *P<sup>ω</sup> <sup>q</sup>* <sup>=</sup> *<sup>q</sup>* · *<sup>R</sup><sup>ω</sup> <sup>q</sup>* where *R<sup>ω</sup> <sup>q</sup>* is a finite prefix code, the results of [22,26,27] give more detailed bounds for most complex quasiperiodic *ω*-words w.r.t. several notions of Kolmogorov complexity [28].

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**


**David Orellana-Martín 1,\*, Luis Valencia-Cabrera 1,2 and Mario J. Pérez-Jiménez 1,2**


**Abstract:** A widely studied field in the framework of membrane computing is computational complexity theory. While some types of P systems are only capable of efficiently solving problems from the class **P**, adding one or more syntactic or semantic ingredients to these membrane systems can give them the ability to efficiently solve presumably intractable problems. These ingredients are called to form a frontier of efficiency, in the sense that passing from the first type of P systems to the second type leads to passing from non-efficiency to the presumed efficiency. In this work, a solution to the SAT problem, a well-known **NP**-complete problem, is obtained by means of a family of recognizer P systems with evolutional symport/antiport rules of length at most (2,1) and division rules where the environment plays a passive role; that is, P systems from CDEC -(2, 1). This result is comparable to the one obtained in the tissue-like counterpart, and gives a glance of a parallelism and the non-evolutionary membrane systems with symport/antiport rules.

**Keywords:** membrane computing; computational complexity theory; **P** vs. **NP** problem; evolutional communication; symport/antiport

**MSC:** 68Q07; 68Q15

#### **1. Introduction**

Membrane computing is a bio-inspired paradigm of computation, based on the structure and behavior of living cells. Introduced in 1998 by Gh. P ˘aun [1], giving birth to devices known as *membrane systems* or *P systems*. There are several different types of P systems, but three of them are specially studied: cell-like membrane systems [1], whose tree-like structure characterizes the relation between its regions; tissue-like membrane systems [2], defined as a set of cells that can interact between them and with the environment, and neural-like membrane systems [3], having an explicitly defined directed graph as a relation of the neurons through synapses. The last paradigm is being intensely studied in practical applications, and different variants have been created to their use in different fields [4–6] The paradigm of membrane computing is very wide, covering topics from theory [7,8] to applications [9–11], dedicating a branch to simulators and in silico implementations [12].

A widely studied question in this framework from the very beginning is which kind of problems can be solved by means of membrane systems. Membrane systems can differ in the type of objects with which they can compute (e.g., symbols, strings, matrices), the type of relation between the regions (e.g., hierarchical structure, directly connected membranes, cells implicitly connected by the rules) and the rules governing the computation of the system (e.g., object evolution rules, symport/antiport rules, division rules), among others. This variety of ingredients can change not only the type of problem that a P system can solve, but how efficiently can it solve a certain problem. More precisely, decision problems are usually studied in the field of computational complexity theory

**Citation:** Orellana-Martín, D.; Valencia-Cabrera, L.; Pérez-Jiménez, M.J. P Systems with Evolutional Communication and Division Rules. *Axioms* **2021**, *10*, 327. https:// doi.org/10.3390/axioms10040327

Academic Editors: Cristian S. Calude and Gheorghe P ˘aun

Received: 1 October 2021 Accepted: 24 November 2021 Published: 30 November 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

in order to classify them in complexity classes that contain problems that can be solved with a similar amount of computational resources [13].

Recognizer membrane systems [14] are P systems with certain ingredients, such as two special objects yes and no, and requisites, such as all the computations halt and return the same result. The design of a family of recognizer membrane systems of a certain type R solving certain decision problems can reveal which kind of problems can be solved efficiently by means of that class of P systems.

A widely studied type of membrane systems in the field of computational complexity theory is the framework of tissue P systems with symport/antiport rules. In [15], a polynomial-time solution to SAT was designed by means of a family of recognizer tissue P systems with symport/antiport rules of length at most five and division rules. In this type of P system, the length is defined as the number of objects implied in the symport/antiport rules of the system (e.g., the length of the rule (*i*, *u*/*v*, *j*) is |*u*| + |*v*|). This result was eventually improved in [16], where the maximum number of objects implied in a communication rule was two. If only one object was allowed in communication rules, then only tractable problems could be efficiently solved, as demonstrated in [17]. A similar frontier of efficiency was found by using separation rules instead of division rules in [18,19], but in this case, the frontier is from passing of communication rules of length at most two to length at most three, instead of passing from one to two. Some results about their relative environmentless counterparts were demonstrated in [20,21]. Symport/antiport rules were first introduced in tissue-like membrane systems, but later used in cell-like membrane systems, where results were surprisingly similar [22–27], giving a glance of the similarity of using both tree-like and directed graph structures.

In [28], tissue P systems with evolutional symport/antiport rules were introduced, including in communication rules the capability to evolve the objects while traveling from one region to another one. In this type of P system, two different definitions of length can be cited: On the one hand, the length of an evolutional communication rule can be defined with a single number that is related with the number of objects in the whole rule (e.g., in the rule *u* [ *v* ] *j i* → *v* [ *u* ] *j i* is |*u*| + |*v*| + |*u* | + |*v* |); on the other hand, the length can be defined as a pair of numbers concerning the number of objects in the left-hand side and the right-hand side of the evolutional communication rules of the system (e.g., the length of the rule *u* [ *v* ] *j i* → *v* [ *u* ] *j i* is (|*u*| + |*v*|, |*u* | + |*v* |)). In [29], several new results were presented, publishing some improvements from [28,30–32]. More precisely, in [32] an efficient family of tissue P systems with evolutional communication rules of length at most (2, 1) and division rules using the environment as an active agent of the system solving the SAT problem is presented. In this work, we investigate the role of evolutional communication rules in cell-like membrane systems that use division rules as exponential workspace-generating rules, and letting the environment as a mere agent that only receives the corresponding answer of the system.

The rest of the paper is structured as follows: Section 2 is dedicated to introducing some terms used throughout the work. In the next section, cell P systems with evolutional symport/antiport rules and division rules are defined, and their recognizer versions are introduced. Sections 4 and 5 are devoted to present a solution to the problem SAT by means of a family of P systems with evolutional communication rules and division rules of length at most (2, 1), and to prove the correctness of the solution. Finally, in Section 6 the results of this paper are discussed, and comparatives with other classes of P systems are given, and some open research lines are proposed, besides a description of the work in progress.

#### **2. Preliminaries**

In this section, some concepts that will be used throughout the paper will be defined. The reader can find expanded and deeper information about formal languages and membrane computing in [8,33].

An alphabet is a non-empty (finite) set, whose elements are usually called *symbols*. A *string* over Γ is a *ordered finite succession* of elements from Γ. We denote the empty string by *λ*.

Given two sets *A* and *B*, the *relative complement A* \ *B* is defined as *A* \ *B* = {*x* ∈ *A* | *x* ∈ *B*}. For each set *A*, we denote by |*A*| the *cardinal* (number of elements) from *A*.

A multiset can be described explicitly as follows: {(*a*1,M(*a*1)), ... ,(*an*,M(*an*))}, and the notation M = *a* M(*a*1) <sup>1</sup> ... *a* <sup>M</sup>(*an*) *<sup>n</sup>* will be used. The cardinal of a multiset <sup>M</sup> over Γ = {*a*1, ... , *an*} is defined as |M| = M(*a*1) + ... + M(*an*). We denote by *Mf*(Γ) the set of all the finite multisets over Γ, and *M*<sup>+</sup> *<sup>f</sup>* (Γ) = *Mf*(Γ) \ {∅}

Given two multisets *M*<sup>1</sup> and *M*<sup>2</sup> over Γ, the *union* of the multisets, denoted as *M*<sup>1</sup> ∪ *M*<sup>2</sup> or *M*<sup>1</sup> + *M*2, is the application over Γ defined as: for each *a* ∈ Γ, (*M*<sup>1</sup> ∪ *M*2)(*a*) = *M*1(*a*) + *M*2(*a*). A multiset *M*<sup>1</sup> is included in *M*2, and it is denoted by *M*<sup>1</sup> ⊆ *M*2, if *M*1(*a*) ≤ *M*2(*a*) for each *a* ∈ Γ.

#### **3. P Systems with Evolutional Communication and Division Rules**

In this section, the framework of cell-like membrane systems where evolutional communication rules and division rules are used is introduced.

**Definition 1.** *A P system with evolutional symport/antiport rules and division rules of degree q* ≥ 1 *is a tuple*

$$\Pi = \left( \Gamma, \mathcal{E}, \mu, \mathcal{M}\_1, \dots, \mathcal{M}\_{\mathfrak{q}}, \mathcal{R}\_1, \dots, \mathcal{R}\_{\mathfrak{q}}, i\_{\mathfrak{q}\mathfrak{t}} \right)$$

*where:*

	- **–** *u* [ ]*<sup>j</sup> i* → [ *u* ]*<sup>j</sup> <sup>i</sup> , with* <sup>0</sup> <sup>≤</sup> *<sup>i</sup>*, *<sup>j</sup>* <sup>≤</sup> *<sup>q</sup>*, *<sup>i</sup>* <sup>=</sup> *<sup>j</sup>*, *<sup>u</sup>* <sup>∈</sup> *<sup>M</sup>*<sup>+</sup> *<sup>f</sup>* (Γ), *u* ∈ *Mf*(Γ)*; in the case that i* = 0*, then u must contain at least one object from* Γ \ E *(evolutional send-in symport rules);*
	- **–** [ *u* ] *j i* → *u* [ ]*<sup>j</sup> <sup>i</sup> , with* <sup>0</sup> <sup>≤</sup> *<sup>i</sup>*, *<sup>j</sup>* <sup>≤</sup> *<sup>q</sup>*, *<sup>i</sup>* <sup>=</sup> *<sup>j</sup>*, *<sup>u</sup>* <sup>∈</sup> *<sup>M</sup>*<sup>+</sup> *<sup>f</sup>* (Γ), *u* ∈ *Mf*(Γ) *(evolutional send-out symport rules);*
	- **–** *u* [ *v* ]*<sup>j</sup> i* → *v* [ *u* ] *j <sup>i</sup> , with* <sup>0</sup> <sup>≤</sup> *<sup>i</sup>*, *<sup>j</sup>* <sup>≤</sup> *<sup>q</sup>*, *<sup>i</sup>* <sup>=</sup> *<sup>j</sup>*, *<sup>u</sup>*, *<sup>v</sup>* <sup>∈</sup> *<sup>M</sup>*<sup>+</sup> *<sup>f</sup>* (Γ), *u* , *v* ∈ *Mf*(Γ) *(evolutional antiport rules);*
	- **–** [ *a* ]*<sup>i</sup>* → [ *b* ] *<sup>i</sup>* [ *c* ] *<sup>i</sup> , with* 1 ≤ *i* ≤ *q*, *i* ∈ {*iout*, *iskin*}, *a*, *b*, *c* ∈ Γ*, being iskin the label of the skin membrane (division rules).*

A P system with evolutional symport/antiport rules and division rules of degree *q* ≥ 1 can be seen as a set of *q* membranes biyectively labelled by 1, ... , *q* organized in the rooted tree structure *μ*, whose root node is the *skin* membrane, and such that (a) E represents the set of objects that are situated in the *environment* an arbitrary number of times; (b) M1, ... ,M*<sup>q</sup>* represents the initial multisets situated in the *q* membranes of the system; (c) *iout* is a distinguished *region i* that will encode the output of the system. The term region *i* will be used to denote the membrane *i*, in case 1 ≤ *i* ≤ *q*, and to the environment in the case *i* = 0 or *i* = *env*. We will use *env* and 0 indistinguishably as the label of the environment. If E = ∅, it is usually omitted from the tuple.

A *configuration* at an instant *t* of such a system is described by the membrane structure of the P system at the instant *t*, the multisets of objects from Γ in each membrane at that instant and the multiset of objects from Γ \ E situated in the environment. The *initial configuration* of Π = <sup>Γ</sup>, <sup>E</sup>, *<sup>μ</sup>*,M1,...,M*q*, <sup>R</sup>1,..., <sup>R</sup>*q*, *iout* is (*μ*,M1,...,M*q*, ∅).

A *evolutional send-in symport rule* is applicable to a configuration C*<sup>t</sup>* at an instant *t* if there exists a region labelled by *i* that has at least a child membrane labelled by *j* and that it contains the multiset *<sup>u</sup>* of objects. The execution of such a rule *u* [ ]*<sup>j</sup> i* → [ *u* ] *j i* in C*<sup>t</sup>* consumes the objects of *u* from such a region *i*, and it produces the multiset of objects *u* in the child membrane *j* in C*t*.

A *evolutional send-out symport rule* is applicable to a configuration C*<sup>t</sup>* at an instant *t* if there exists a region labelled by *i* that has at least a child membrane labelled by *j* and the child membrane contains the multiset *u* of objects. The execution of such a rule [ *u* ] *j i* → *u* [ ]*<sup>j</sup> i* in C*<sup>t</sup>* consumes the objects of *u* from such a region *j*, and it produces the multiset of objects *u* in the child membrane *i* in C*t*.

A *evolutional antiport rule* is applicable to a configuration C*<sup>t</sup>* at an instant *t* if there exists a region labelled by *i* that contains a multiset of objects *u* and it has at least a child membrane labelled by *j* and the child membrane contains the multiset *v* of objects. The execution of such a rule *u* [ *v* ] *j i* → *v* [ *u* ] *j i* in C*<sup>t</sup>* consumes the objects of *u* from such a region *j* and objects from *v* from such a region *i*, and it produces the multiset of objects *u* in that membrane *i* and the multiset of objects *v* in that membrane *j* in C*t*.

A *division rule* is applicable to a configuration C*<sup>t</sup>* at an instant *t* if there exists a region labelled by *i* that contains an object *a*. The execution of such a rule [ *a* ]*<sup>i</sup>* → [ *b* ] *<sup>i</sup>* [ *c* ] *<sup>i</sup>* in C*<sup>t</sup>* consumes the object *a* from the membrane *i*, the membrane is duplicated with its contents included, and objects *b* and *c* are produced one in each new membrane created in C*t*.

As in tissue P systems with evolutional symport/antiport rules, two definitions of *length* (or size) can be described. On the one hand, the *length* of a evolutional communication rule *r* ≡ *u* [ *v* ] *j <sup>i</sup>* → *v* [ *u* ] *j i* can be *length*(*r*)=(|*u*| + |*v*| + |*u* | + |*v* |); on the other hand, it can be described as a pair *length* (*r*)=(|*u*| + |*v*|, |*u* | + |*v* |). The first description corresponds with the sum of the cardinalities of all the multisets in the rule, while the second definition corresponds with the pair such that the first component corresponds with the sum of cardinalities of the left-hand side of the rule (LHS), and the second component corresponds with the sum of the cardinalities of the right-hand side of the rule (RHS). If *r* is a symport rule, then |*v*| = |*v* | = 0 or |*u*| = |*u* | = 0.

We say that a configuration C*<sup>t</sup>* of a P system with evolutional communication rules and division rules Π produces a configuration C*t*+<sup>1</sup> in a *transition step*, denoted by C*<sup>t</sup>* ⇒<sup>Π</sup> C*t*+<sup>1</sup> and we say that C*t*+<sup>1</sup> is a next configuration of C*<sup>t</sup>* if we can pass from C*<sup>t</sup>* to C*t*+<sup>1</sup> applying the rules of Π according to the following principles:


A configuration C*<sup>t</sup>* is a *halting configuration* if no rules can be applied to such configuration at an instant *t*.

A computation C of a P system Π can be described as a tuple C = (C0, C1, ...), where each configuration C*t*+<sup>1</sup> can be obtained from C*t*, except for the initial configuration C0. We say that C is a *halting computation* of length *n* + 1 if the configuration C*<sup>n</sup>* is a halting configuration.

Recognizer membrane systems were introduced in [14] as a way to solve decision problems. We define here recognizer P systems with evolutional communication rules and division rules.

**Definition 2.** *A recognizer P system with evolutional communication rules and division rules of degree q* ≥ 1 *is a tuple* (Π, Σ, *iin*)*, where:*


Let Π = <sup>Γ</sup>, <sup>Σ</sup>, <sup>E</sup>, *<sup>μ</sup>*,M1,...,M*q*, <sup>R</sup>1,..., <sup>R</sup>*q*, *iin*, *iout* be a recognizer P system of this type, then for each input multiset *m* over Σ, we consider the system Π with input multiset *m*, and we denote it by Π + *m*. This is characterized by the fact that the multisets associated with the initial configuration of the system is: (M1, ... ,M*iin* + *m*, ... ,M*q*, ∅); that is, it is obtained from the initial configuration (M1, ... ,M*iin* , ... ,M*q*, ∅) of Π, by adding the multiset *m* to M*iin* .

We define then a *Output*(C) function whose domain is the set of computations of Π. Such a function will formalize the results or outputs of the system. If C is a computation of the system <sup>Π</sup>, then *Output*(C) = yes (respectively, *Output*() = no) if the object yes (resp., object no) appears in the environment associated to the *halting configuration* of <sup>C</sup>, but does not appear in any other configuration of C. A computation C will be called an *accepting computation* (respectively, a *rejecting computation*) if *Output*(C) = yes (resp., *Output*(C) = no). Computations of recognizer membrane systems always halt, and will return either yes or no as a response. A recognizer membrane system with input multiset Π + *m* is *confluent*, in the sense that all the computations give the same answer; that is, given an input multiset *m*, all the computations of a recognizer membrane system with input multiset Π + *m* will be either accepting computations or rejecting computations.

The class of recognizer P systems with evolutional symport/antiport rules of length at most *k* (respectively, with length at most (*k*1, *k*2)) and division rules is denoted by CDEC((*k*)) (resp., CDEC((*k*1, *k*2))). If the environment does not play an active role, we say that it is a recognizer P system with symport/antiport rules of length at most *k* (resp., with length at most (*k*1, *k*2), i.e. LHS with length at most *k*<sup>1</sup> and RHS with length at most *k*2) and division rules without environment, and we denote this class of systems by CDEC -(*k*) (resp., CDEC -(*k*1, *k*2)).

In this work, a family of recognizer P systems will be used in order to solve decision problems. Let *X* = (*IX*, *θX*) a decision problem. We say that *X* is solvable in polynomial time by means of a uniform family of recognizer P systems **Π** = {Π(*n*) : *n* ∈ N} of the class R, and we denote it by *<sup>X</sup>* ∈ **PMC**R, if the following conditions hold:

	- b.1 **Π** is polynomially bounded with respect to (*X*, *cod*,*s*); that is, there exists *k* ∈ N such that for each *u* ∈ *IX*, each computation of Π(*s*(*u*)) + *cod*(*u*) runs, at most, for |*u*| *<sup>k</sup>* computation steps.
	- b.2 **Π** is sound and complete with respect to (*X*, *cod*,*s*).

#### **4. Methods**

Let *ϕ* a propositional formula in CNF with *n* variables and *p* clauses. Let *s*(*ϕ*) = *n*, *p* and *cod*(*ϕ*) contains *xi*,*j*,0 if the literal *xi* is in the clause *Cj*, *xi*,*j*,0 if the literal ¬*xi* is in the clause *Cj* and *x*<sup>∗</sup> *<sup>i</sup>*,*j*,0 if the variable *xi* does not appear in the clause *Cj*. Let the function ⊥(*i*, *j*) = *i*⊥*j* = *i* + *jn*. Then, the system Π(*n*, *p*) will be the responsible of solving *ϕ*. Let

$$\Pi(\langle n, p \rangle) = (\Gamma, \Sigma, \mathcal{E}, \mu, \mathcal{M}\_1, \dots, \mathcal{M}\_{np+5\prime}, \mathcal{R}\_1, \dots, \mathcal{R}\_{np+5\prime}, i\_{\text{in}\prime} i\_{\text{out}\prime})$$

a recognizer membrane system from CDEC((2, 1)), where:

	- M*np*+<sup>2</sup> = {*ai*,*<sup>j</sup>* | 1 ≤ *i* ≤ *n*, 1 ≤ *j* ≤ *p*}∪{*α<sup>j</sup>* | 1 ≤ *j* ≤ *p* + 1}, M*np*+<sup>3</sup> = {*δ* <sup>0</sup>}, M*np*+<sup>4</sup> = {*δ*0}, M*np*+<sup>5</sup> = {*γ*0}.
	- 6.1 Rules for generating all the necessary *γnp*+<sup>2</sup> to simulate the environment.

$$\begin{array}{c} \lfloor \gamma\_k \rfloor\_{np+5} \to \lfloor \gamma\_{k+1} \rfloor\_{np+5} \lfloor \gamma\_{k+1} \rfloor\_{np+5} \quad \text{for} \quad 0 \le k \le np+1\\ \lceil \lfloor \gamma\_{np+2} \rfloor\_{np+5} \rceil\_{np+1} \to \lceil \gamma\_{np+2} \lceil \rceil\_{np+5} \rceil\_{np+1} \end{array}$$

6.2 Rules to generate *p* copies of the 2*<sup>n</sup>* possible truth assignments. For that, 2*np* "partial" truth assignments will be generated.

$$\begin{array}{c} \left[a\_{i,j}\right]\_{np+2} \to \left[\left[T\_{i,j}\right]\_{np+2}\left[F\_{i,j}\right]\_{np+2}\right] \\ \left[\left[T\_{i,j}F\_{i,j'}\right]\_{np+2}\right]\_{np+1} \to \left[\left[\#\left[\right]\right]\_{np+2}\right]\_{np+1} \end{array} \text{ for } \begin{array}{c} 1 \le i \le n \\ 1 \le j, j', \le p \end{array}$$

6.3 Rules to generate 2*np* copies of *cod*(*ϕ*).

 *xi*,*j*,0 [ ]*i*⊥*<sup>j</sup> np*+<sup>1</sup> → [ *xi*,*j*,1 ] *i*⊥*j np*+<sup>1</sup> *xi*,*j*,0 [ ]*i*⊥*<sup>j</sup> np*+<sup>1</sup> → [ *xi*,*j*,1 ] *i*⊥*j np*+<sup>1</sup> *x*∗ *<sup>i</sup>*,*j*,0 [ ]*i*⊥*<sup>j</sup> np*+<sup>1</sup> → [ *x*∗ *<sup>i</sup>*,*j*,1 ] *i*⊥*j np*+1 ⎫ ⎪⎪⎪⎪⎬ ⎪⎪⎪⎪⎭ for 1 ≤ *i* ≤ *n*, 1 ≤ *j* ≤ *p xi*,*j*,*<sup>k</sup> i*⊥*j* → [ *xi*,*j*,*k*+<sup>1</sup> ] *<sup>i</sup>*⊥*<sup>j</sup>* [ *xi*,*j*,*k*+<sup>1</sup> ] *i*⊥*j xi*,*j*,*<sup>k</sup> i*⊥*j* → [ *xi*,*j*,*k*+<sup>1</sup> ] *<sup>i</sup>*⊥*<sup>j</sup>* [ *xi*,*j*,*k*+<sup>1</sup> ] *i*⊥*j x*∗ *i*,*j*,*k i*⊥*j* → [ *x*<sup>∗</sup> *<sup>i</sup>*,*j*,*k*+<sup>1</sup> ] *<sup>i</sup>*⊥*<sup>j</sup>* [ *<sup>x</sup>*<sup>∗</sup> *<sup>i</sup>*,*j*,*k*+<sup>1</sup> ] *i*⊥*j* ⎫ ⎪⎪⎪⎪⎬ ⎪⎪⎪⎪⎭ for 1 ≤ *i* ≤ *n* 1 ≤ *j* ≤ *p* 1 ≤ *k* ≤ *np* + *np*/2 [ *xi*,*j*,*np*+*np*/2+<sup>1</sup> ] *i*⊥*j np*+<sup>1</sup> → *xi*,*<sup>j</sup>* [ ]*i*⊥*<sup>j</sup> np*+<sup>1</sup> [ *xi*,*j*,*np*+*np*/2+<sup>1</sup> ] *i*⊥*j np*+<sup>1</sup> → *xi*,*<sup>j</sup>* [ ]*i*⊥*<sup>j</sup> np*+<sup>1</sup> [ *x*∗ *<sup>i</sup>*,*j*,*np*+*np*/2+<sup>1</sup> ] *i*⊥*j np*+<sup>1</sup> → *x*∗ *<sup>i</sup>*,*<sup>j</sup>* [ ]*i*⊥*<sup>j</sup> np*+1 ⎫ ⎪⎪⎪⎪⎬ ⎪⎪⎪⎪⎭ for 1 ≤ *i* ≤ *n*, 1 ≤ *j* ≤ *p γnp*+<sup>2</sup> [ *δ* 0 ] *np*+3 *np*+<sup>1</sup> → [ *δ* 1 ] *np*+3 *np*+1 *δ k np*+<sup>3</sup> → [ *δ <sup>k</sup>*+<sup>1</sup> ] *np*+<sup>3</sup> [ *δ <sup>k</sup>*+<sup>1</sup> ] *np*+<sup>3</sup> for 1 ≤ *k* ≤ *np* [ *δ np*+<sup>1</sup> ] *np*+3 *np*+<sup>1</sup> → *δ np*+<sup>1</sup> [ ]*np*+<sup>3</sup> *np*+1

6.4 Rules to check which clauses are satisfied.

$$\begin{aligned} & \left[ \tilde{x}\_{i} \right] \left[ \tilde{x}\_{i} \right]\_{\text{hyp} + 2} \left[ \underset{\text{top}}{\text{log}} \right]\_{\text{hyp} + 2} \to \left[ \left[ \left[ \tilde{x}\_{i} \right]\_{\text{hyp} + 2} \right]\_{\text{hyp} + 1} \\ & \left[ \tilde{x}\_{i} \right]\_{\text{hyp} + 2} \left[ \underset{\text{top}}{\text{log}} \right]\_{\text{up} + 1} \to \left[ \left[ \left[ \left[ \tilde{x}\_{i} \right]\_{\text{hyp} + 2} \right]\_{\text{up} + 1} \right]\_{\text{up} + 1} \\ & \left[ \tilde{x}\_{i} \right]\_{\text{hyp} + 2} \left[ \underset{\text{top}}{\text{log}} \right]\_{\text{up} + 1} \to \left[ \left[ \left[ \left[ \left[ \left[ \left[ \tilde{x}\_{i} \right]\_{\text{up} + 2} \right]\_{\text{up} + 1} \right]\_{\text{up} + 1} \right] \right]\_{\text{up} + 1} \right] \\ & \left[ \tilde{x}\_{i} \right]\_{\text{up} + 2} \left[ \underset{\text{top}}{\text{log}} \right]\_{\text{up} + 1} \to \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left[ \left$$

In this section, the behaviour of a recognizer P system from CDEC((2, 1)) solving an instance *<sup>ϕ</sup>* from SAT is described. Let *<sup>ϕ</sup>* <sup>=</sup> *<sup>C</sup>*<sup>1</sup> <sup>∧</sup> ... <sup>∧</sup> *Cp* be a propositional logic formula in CNF, where *Cj* = *l*<sup>1</sup> ∨ ... ∨ *lrj* , *lk* ∈ {*xi*, ¬*xi* | 1 ≤ *i* ≤ *n*}. Then *ϕ* will be processed by the system Π(*s*(*ϕ*)) + *cod*(*ϕ*), where *s*(*ϕ*) = *n*, *p* and *cod*(*ϕ*) = {*xi*,*j*,0 | *xi* ∈ *Cj*}∪{*xi*,*j*,0 | ¬*xi* ∈ *Cj*}∪{*x*<sup>∗</sup> *<sup>i</sup>*,*j*,0 | *xi* ∈ *Cj* ∧ ¬*xi* ∈ *Cj*}.

Let us note *codk*(*ϕ*) the set of all the elements from *cod*(*ϕ*) with the third subscript equal to *k*. Let us note *cod*∗(*ϕ*) the set of all the elements from *cod*(*ϕ*) without the third subscript.

The solution follows a brute force algorithm protocol in the framework of recognizer P systems with evolutional symport/antiport rules and division rules, and consists of the following stages:

#### *4.1. Generation Stage*

In the generation stage, different elements necessary for the rest of the computation are generated at the same time. First, in order to avoid the use of the environment to obtain *γ* objects, it is necessary to use some of the synchronization protocols in [32], 2*np*+<sup>2</sup> copies of the object *γnp*+<sup>2</sup> will be generated in membranes *np* + 5 through the rules from 6.1. These objects will be present in the membrane *np* + 1 at configuration C*np*+3. For generating the different truth assignments, objects *Ti*,*<sup>j</sup>* and *Fi*,*<sup>j</sup>* will represent a partial truth assignment of the variable *xi* in the following sense: Objects *Ti*,*<sup>j</sup>* and *Fi*,*j* , with *i* = *j*, would be incompatible, since two different values would be assigned to the same variable. Therefore, in order to remove this possibility, these two objects will be removed from the system by

means of the rule [ *Ti*,*jFi*,*j* ] *np*+2 *np*+<sup>1</sup> → # [ ]*np*+<sup>2</sup> *np*+1 . After applying these rules, only "real" truth assignments would be present in the system. In fact, there can be assignments where a variables has not been assigned any value. In this case, it will not return a false positive. For generating the different *np* partial truth assignments, *np* computational steps should be applied, but since rules are fired in a non-deterministic way, and the removal of these incompatible variables could be applied in between the process of generation, at most *np*/2 extra steps should be taken into account. Therefore, in configuration C*np*+*np*/2, membranes labelled by *np* + 2 will contain all the possible truth assignments.

Besides, objects from *cod*(*ϕ*) will be sent into their corresponding membrane. From the second computational step, membranes 1, ... , *np* will be duplicated in each step until having 2*np*+*np*/2 copies of the corresponding object from *codnp*<sup>+</sup>*np*/2(*ϕ*). These objects will be sent out to the membrane *np* + 1, and therefore in the configuration C*np*+*np*/2<sup>+</sup>1, 2*np*+*np*/2 copies of *cod*∗(*ϕ*) will be present in the membrane *np* + 1. In this configuration, the next stage begins.

#### *4.2. First Checking Stage*

In this stage, objects from *cod*∗(*ϕ*) will react with objects *Ti*,*<sup>j</sup>* and *Fi*,*<sup>j</sup>* through rules from 6.4. In this stage, an object *cj* will be generated in a membrane *np* + 2 if and only if the truth assignment represented in that membrane makes true the corresponding literal. This stage takes one computational step. At the same time, counters *δ<sup>k</sup>* and *δ <sup>k</sup>* are being generated. *δ<sup>k</sup>* will evolve by using objects *γnp*+<sup>2</sup> as "catalysts", and *np* copies of the object *δ np*+<sup>1</sup> will be present at the membrane *np* + 1 at configuration C2*np*+5. When this happens, the second checking stage starts.

#### *4.3. Second Checking Stage*

The (2*np* <sup>+</sup>6)-th step will consist of the application of the rule *δ np*+<sup>1</sup> [ *αp*+<sup>1</sup> ] *np*+2 *np*+<sup>1</sup> → [ *α* ] *np*+2 *np*+1 , creating an object *α* in each membrane labelled by *np* + 2. At the same time, objects *cj* present in a membrane will remove the corresponding object *aj*; that is, the absence of an object *aj* in a membrane *np* + 2 represents that clause *Cj* is satisfied by the corresponding truth assignment. The object *<sup>α</sup>* will fire a rule [ *αjα* ] *np*+2 *np*+<sup>1</sup> → *n*<sup>1</sup> [ ]*np*+<sup>2</sup> *np*+1 if there exists an object *aj* in such a membrane. This stage takes exactly two computational steps.

#### *4.4. Output Stage*

In configuration C2*np*+7, the existence of an object *α* in a membrane labelled by *np* + 2 implies that no objects *α<sup>j</sup>* remained in such a membrane; that is, that all clauses are satisfied by the corresponding truth assignment. Therefore, if there exists an object *α* in such a membrane, it implies that the formula *ϕ* is satisfiable. Thus, two different scenarios can be observed. On the one hand, if the formula is satisfiable, there exists at least one membrane labelled by *np* + 2 at configuration C2*np*+<sup>7</sup> such that it contains an object *α* . In the next step, an object *y*<sup>1</sup> will be generated in such a membrane, that will be sent out, first to membrane *np* + 1 as an object *y*2, and finally to the environment as an object yes. On the other hand, if the formula is unsatisfiable, no objects *α* remain in any of the membranes labelled by *np* + 2 at configuration C2*np*+7. Objects *n*<sup>1</sup> will be sent to the membrane *np* + 1 and, in the next step, they will be sent back to any membrane *np* + 2, taking into account that the target membranes are selected in a non-deterministic way. In the next step, as the object *δnp*+<sup>3</sup> still exists in membrane *np* + 1, it reacts with an object *n*1, transforming it into an object *n*<sup>2</sup> at the skin membrane, and in the last step of the configuration, it will be sent out to the environment as an object no. It is important to take into account that, in the affirmative case, object *δnp*+<sup>3</sup> is consumed, and since only one object of this kind exists, objects *n*<sup>1</sup> will not have any objects to react with. This stage takes exactly three computational steps, both in the affirmative case and in the negative case. In Figure 1, a graphical description of this process is provided to clarify how this stage works.

**Figure 1.** Evolution of the final stage in the affirmative case (**left**) and in the negative case (**right**).

#### **5. Results**

The results of the paper will be discussed in this section.

**Theorem 1.** SAT <sup>∈</sup> **PMC**CDEC ((2,1))

**Proof.** The family of P systems constructed previously verifies the following:

	- **–** Alphabet size: 3*n*<sup>2</sup> *<sup>p</sup>*<sup>2</sup> + (<sup>11</sup> <sup>+</sup> *np* <sup>2</sup> )*np* <sup>+</sup> <sup>2</sup>*<sup>p</sup>* <sup>+</sup> <sup>16</sup> <sup>∈</sup> <sup>Θ</sup>(*n*<sup>2</sup> *<sup>p</sup>*2)
	- **–** Initial number of membranes: *np* + 5 ∈ Θ(*np*)
	- **–** Initial number of objects in cells: *np* + *p* + 4 ∈ Θ(*np*)
	- **–** Number of rules: 3*n*<sup>2</sup> *<sup>p</sup>*2 *np* <sup>2</sup> <sup>+</sup> <sup>2</sup>*np*<sup>2</sup> <sup>+</sup> <sup>15</sup>*np* <sup>+</sup> <sup>2</sup>*<sup>p</sup>* <sup>+</sup> <sup>16</sup> <sup>∈</sup> <sup>Θ</sup>(*n*<sup>3</sup> *<sup>p</sup>*3)
	- **–** Maximum number of objects involved in a rule: 3 ∈ Θ(1).

**Corollary 1. NP** <sup>∪</sup> **co** <sup>−</sup> **NP** <sup>⊆</sup> **PMC**CDEC ((2,1))

**Proof.** It is enough to observe that SAT is an **NP**-complete problem, SAT <sup>∈</sup> **PMC**CDEC ((2,1)) and the class **PMC**CDEC ((2,1)) is closed under polynomial-time reduction and under complementary.

In fact, this family does not use the environment with an active role, therefore:

**Corollary 2. NP** ∪ **co** − **NP** ⊆ **PMC** CDEC -(2,1)

**Proof.** It is enough to observe that **NP** <sup>∪</sup> **co** <sup>−</sup> **NP** <sup>⊆</sup> **PMC**CDEC ((2,1)) from the fact that a uniform family of recognizer membrane systems from CDEC((2, 1)) solving the problem SAT in polynomial time has been constructed, and this solution does use the environment only as the output of the system, E = ∅, and does not take any object from it.

**Corollary 3. NP** ∪ **co** − **NP** ⊆ **PMC** CDEC -(3)

#### **6. Discussion**

The idea of this solution is to use the power of division rules to generate all the possible truth assignments and objects first, and later on to use the parallel communication between membranes to transport all the needed objects. It is important to take into account that this is a great difference with P systems with active membranes, since in these systems, communication rules between membranes are limited to one object per membrane and time step. While the first stage takes the majority of the time, checking of the clauses

and output of the system are executed in five time steps, using the created workspace in the generation stage. This implies that a great optimization (for instance, in the form of a parallel implementation) would be needed in order to generate the exponential number of membranes in polynomial (in this case, linear) time. In a practical way, this could lead to an interesting competitor with respect to the state-of-art SAT solvers, that are necessary to solve industrial propositional logic formulae used to improve some engineering processes.

#### **7. Contributions**

In this work, a solution to SAT by means of a family of recognizer membrane systems from CDEC -(2, 1) is given. In previous works, a similar result in the tissue-like counterpart was given, but using the environment as an active element. An interesting work would be to prove that the role of the environment is also irrelevant in tissue P systems with evolutional symport/antiport rules and division rules. Besides, similar results using separation rules instead of division rules were provided in the same work. Taking into account the differences between division rules and separation rules and between tissue-like and cell-like, it would be interesting to see if this result can also be translated to the cell-like framework. In this sense, a complete study of the role of the environment while using separation rules, both in the tissue-like and in the cell-like frameworks will be studied.

**Author Contributions:** Conceptualization, D.O.-M. and M.J.P.-J.; methodology, D.O.-M. and L.V.-C.; validation, D.O.-M., L.V.-C. and M.J.P.-J.; formal analysis, M.J.P.-J.; investigation, D.O.-M.; writing original draft preparation, D.O.-M.; writing—review and editing, L.V.-C.; supervision, L.V.-C. and M.J.P.-J. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by "FEDER/Ministerio de Ciencia e Innovación—Agencia Estatal de Investigación/\_Proyecto (TIN2017-89842-P)"—MABICAP. D.O.-M. also acknowledges Contratación de Personal Investigador Doctor. (Convocatoria 2019) 43 Contratos Capital Humano Línea 2. Paidi 2020, supported by the European Social Fund and Junta de Andalucía.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** This work is self-contained, and all the data can be found within the own paper.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


### *Article* **List Approximation for Increasing Kolmogorov Complexity**

**Marius Zimand**

Department of Computer and Information Sciences, Towson University, Baltimore, MD 21252, USA; mzimand@towson.edu

**Abstract:** It is impossible to effectively modify a string in order to increase its Kolmogorov complexity. However, is it possible to construct a few strings, no longer than the input string, so that most of them have larger complexity? We show that the answer is yes. We present an algorithm that takes as input a string *x* of length *n* and returns a list with *O*(*n*2) strings, all of length *n*, such that 99% of them are more complex than *x*, provided the complexity of *x* is less than *n* − log log *n* − *O*(1). We also present an algorithm that obtains a list of quasi-polynomial size in which each element can be produced in polynomial time.

**Keywords:** Kolmogorov complexity; random strings; extractors

**MSC:** 68Q30

#### **1. Introduction**

The Kolmogorov complexity of a binary string *x*, denoted *C*(*x*), is the minimal description length of *x*, i.e., it is the length of the shortest program (in a fixed universal programming system) that prints *x*. We analyze the possibility of modifying a string in an effective way in order to obtain a string with higher complexity, without increasing its length. Strings with high complexity exhibit good randomness properties and are potentially useful, because they can be employed in lieu of random bits in probabilistic algorithms. It is common to define the randomness deficiency of *x* as the difference |*x*| − *C*(*x*) (where |*x*| is the length of *x*) and to say that the smaller the randomness deficiency is, the more random the string is. In this sense, we want to modify a string so that it becomes "more" random. As stated, the above task is impossible, because, clearly, any effective modification cannot increase the Kolmogorov complexity (at least not by more than a constant). If *f* is a computable function, *C*(*f*(*x*)) ≤ *C*(*x*) + *O*(1), for every *x*. Consequently, we have to settle for a weaker solution and the one we consider is that of list approximation. List approximation consists in the construction of a list of objects guaranteed to contain at least one element having the desired property. Here, we try to obtain a stronger type of list approximation, in which, not just one, but *most* of the elements in the list have the desired property. More precisely, we study the following question.

*Question*. Is there a computable function which takes as input a string *x* and outputs a short list of strings, which are not longer than *x*, such that most of the elements in the list have complexity greater than *C*(*x*)?

The formulation of the question rules out some trivial and non-interesting answers. First, the requirement that the list is "short" is necessary, because, otherwise, we can ignore the input *x* and simply take all strings of length *n* and most of them have complexity at least *n* − 2, which is within *O*(1) of the largest complexity of strings of length *n*. Secondly, the restriction that the length is not increased is also necessary, because, otherwise, we can append to the input *x* a random string and obtain, with high probability, a more complex string (see the discussion in Section 2). These restrictions not only make the problem interesting, but also amenable to applications in which the input string and the modified

**Citation:** Zimand, M. List Approximation for Increasing Kolmogorov Complexity. *Axioms* **2021**, *10*, 334. https://doi.org/ 10.3390/axioms10040334

Academic Editor: Victor Mitrana

Received: 27 September 2021 Accepted: 30 November 2021 Published: 7 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

strings need to be in a given finite set. The solution that we give can be readily adjusted to handle such applications.

There are several parameters to consider. The first one is the size of the list. The shorter the list is, the better the approximation is. Next, the increasing-complexity procedure that we seek does not work for all strings *x*. Let us recall that *C*(*x*) ≤ |*x*| + *O*(1) and, if *x* is a string of maximal complexity at its length, then there simply is no string of larger complexity at its length. In general, for strings *x* that have complexity close to |*x*|, it is difficult to increase their complexity. Thus, a second parameter is the bound on the complexity of *x* for which the increasing-complexity procedure succeeds. The closer this bound is to |*x*|, the better the procedure is. The third parameter is the complexity of the procedure. The procedure is required to be computable, but it is preferable if it is computable in polynomial time.

We show the following two results. The first one exhibits a computable list approximation for increasing the Kolmogorov complexity that works for any *x* with complexity *C*(*x*) < |*x*| − log log |*x*| − *O*(1).

**Theorem 1** (Computable list of quadratic size for increasing the Kolmogorov complexity)**.** *There exists a computable function f that takes as input x* ∈ {0, 1}<sup>∗</sup> *and a rational number δ* > 0 *and returns a list of strings of length at most* |*x*| *with the following properties:*


Whether the bound *C*(*x*) < |*x*| − log log |*x*| − *O*(1) can be improved remains open. Further reducing the list size is also an interesting open question. We could not establish a lower bound and, as far as we currently know, it is possible that even a constant list size may be achievable.

In the next result, the complexity-increasing procedure runs in polynomial time in the following sense. The size of the list is only quasi-polynomial, but each string in the list is computed in polynomial time.

**Theorem 2** (Polynomial-time computable list for increasing the Kolmogorov complexity)**.** *There exists a function f that takes as input x* ∈ {0, 1}<sup>∗</sup> *and a constant rational number δ* > 0 *and returns a list of strings of length at most* |*x*| *with the following properties:*


**Remark 1.** *A preliminary version of this paper has appeared in STACS 2017 [1]. In that version, it was claimed that the result in Theorem 1 holds for all strings x with C*(*x*) < |*x*|*. The proof had a bug and we can only prove it for strings satisfying C*(*x*) < |*x*| − log log |*x*| − *O*(1)*. The proof of Theorem 2 given here is different from that in [1]. Theorem 2 has better parameters than its analog in the preliminary version.*

**Remark 2.** *Any procedure that constructs the approximation list can be converted into a probabilistic algorithm that does the same work and picks one random element from the list. The procedure in Theorem 2 can be converted into a polynomial-time probabilistic algorithm, which uses O*(log |*x*| · log(|*x*|/*δ*)) *random bits to pick which element from the list to construct (see item 3 in the statement).*

*Vice-versa, a probabilistic algorithm can be converted into a list-approximation algorithm in the obvious way, i.e., by constructing the list that has as elements the outputs of the algorithm for all choices of the random coins.*

*Thus, a list-approximation algorithm A*1*, in which* (1 − *δ*) *elements in the list have the desired property, is equivalent to a probabilistic algorithm A*<sup>2</sup> *that succeeds with probability* 1 − *δ. The number of random bits used by A*<sup>2</sup> *is the logarithm in base two of the size of the list produced by A*1*.*

#### *1.1. Basic Concepts and Notation*

We recall the standard setup for Kolmogorov complexity. We fix an universal Turing machine *U*. The universality of *U* means that, for any Turing machine *M*, there exists a computable "translator" function *t*, such that, for all strings *p*, *M*(*p*) = *U*(*t*(*p*)) and |*t*(*p*)|≤|*p*| + *O*(1). For the polynomial-time constructions, we also require that *t* is polynomial-time computable. If *U*(*p*) = *x*, we say that *p* is a *program* (or *description*) for *x*. The Kolmogorov complexity of the string *x* is *C*(*x*) = min{|*p*| | *p* is a program for *x*}. If *p* is a program for *x* and |*p*| ≤ *C*(*x*) + *c*, we say that *p* is a *c*-short program for *x*.

#### *1.2. Related Works*

The problem of increasing the Kolmogorov complexity has been studied before by Buhrman, Fortnow, Newman and Vereshchagin [2]. They show that there exists a polynomialtime computable *f* that takes as input *x* of length *n* and returns a list of strings, all having length *n*, such that, if *C*(*x*) < *n*, then there exists *y* in the list with *C*(*y*) > *C*(*x*) (this is Theorem 14 in [2]). In the case of complexity conditioned by the string length, they show that it is even possible to compute in polynomial time a list of constant size. That is, *f*(*x*) is a list with *O*(1) strings of length *n* and, if *C*(*x* | *n*) < *n*, then it contains a string *y* with *C*(*y* | *n*) > *C*(*x* | *n*) (this is Theorem 11 in [2]). Our results are incomparable with the results in [2]. On one hand, their results work for any input *x* with complexity less than |*x*|, while, in Theorem 1, we only handle inputs with complexity at most |*x*| − log log |*x*| − *O*(1) (and, in Theorem 2, the complexity of the input is required to be even lower). On the other hand, they only guarantee that one string in the output list has higher complexity than *x*, while we guarantee this property for most strings in the output list and this can be viewed as a probabilistic algorithm with few random bits as explained in Remark 2.

This paper is inspired by recent list-approximation results regarding another problem in the Kolmogorov complexity, namely, the construction of short programs (or descriptions) for strings. Using a Berry paradox argument, it is easy to see that it is impossible to effectively construct a shortest program for *x* (or, even a, say, *n*/2-short program for *x*). Remarkably, Bauwens et al. [3] show that effective list approximation for short programs is possible. There is an algorithm that, for some constant *c*, takes as input *x* and returns a list with *O*(|*x*| <sup>2</sup>) strings guaranteed to contain a *c*-short program for *x*. They also show a lower bound; The quadratic size of the list is minimal up to constant factors. Bauwens and Zimand [4] consider a more general type of optimal compressor that goes beyond the standard Kolmogorov complexity and, using another type of pseudo-random function called *conductor*, re-obtains the overhead of *O*(log<sup>2</sup> *n*). Theorem 2 directly uses results from the latter, namely, Theorem 3. Theorem 1 uses a novel construction, but some of the ideas are inspired from the papers mentioned above.

#### **2. Technique and Proof Overview**

We start by presenting an approach that probably comes to mind first. It does not work for inputs *x* having a complexity very close to |*x*|, such as in Theorem 1 (for which we use a more complicated argument), but, combined with the results from [4], it yields Theorem 2.

Given that we want to modify a string *x* so that it becomes more complex, which, in a sense, means more random, a simple idea is to just append a random string *z* to *x*. Indeed, if we consider strings *z* of length *c*, then *C*(*xz*) > *C*(*x*) + *c*/2, for most strings *z*, provided

that *c* is large enough. Let us see why this is true. Let *k* = *C*(*x*) and let *z* be a string that satisfies the opposite inequality, that is,

$$\mathbb{C}(xz) \le \mathbb{C}(x) + \mathfrak{c}/2,\tag{1}$$

Given a shortest program for *xz* and a self-delimited representation of the integer *c*, which is 2 log *c* bits long, we obtain a description of *x* with at most *k* + *c*/2 + 2 log *c* bits. Note that, in this way, from different *z*'s satisfying (1), we obtain different programs for *x* that are (*c*/2 + 2 log *c*)-short. By a theorem of Chaitin [5] (also presented as Lemma 3.4.2 in [6]), for any *d*, the number of *d*-short programs for *x* is bounded by *O*(2*d*). Thus, the number of strings *z* satisfying (1) is bounded by 2*c*/2+2 log *<sup>c</sup>*+*O*(1). Since, for large *c*, 2*c*/2+2 log *<sup>c</sup>*+*O*(1) is much smaller than 2*c*, it follows that most strings *z* of length *c* satisfy the claimed inequality (the opposite of (1)). Therefore, we obtain the following lemma.

**Lemma 1.** *If we append to a string x, a string <sup>z</sup> chosen at random in* {0, 1}*c, then <sup>C</sup>*(*xz*) <sup>&</sup>gt; *<sup>C</sup>*(*x*) + *<sup>c</sup>*/2 *with probability* <sup>1</sup> <sup>−</sup> <sup>2</sup>−(*c*/2−2 log *<sup>c</sup>*−*O*(1))*.*

The problem with appending a random *z* to *x* is that this operation not only increases the complexity (which is something we want) but also increases the length (which is something we do not want). The natural way to get around this problem is to first compress *x* to close to the minimal description length using the probabilistic algorithms from [4] described in the Introduction and then append *z*. If we know *C*(*x*), then the algorithms from [4] compress *x* to length *C*(*x*) + Δ(*n*), where *n* is the length of *x* and Δ(*n*) (called the *overhead*) is *O*(log *n*) (or poly(log *n*) for the polynomial-time algorithm). After appending a random *z* of length *c*, we obtain a string of length *C*(*x*) + Δ(*n*) + *c* and, for this to be *n* (so that length is not increased), we need *C*(*x*) ≤ *n* − Δ(*n*) − *c*. This is the idea that we follow for Theorem 2, with an adjustment caused by the fact that we do not know *C*(*x*) but only a bound of it.

However, in this way, we cannot obtain a procedure that works for all *x* with *C*(*x*) < *n* − log log *n* − *O*(1), as required in Theorem 1. Our proof for this theorem is based on a different construction. The centerpiece is a type of bipartite graph with a low congestion property. Once we have the graph (in which the two bipartitions are called the set of left nodes and the set of right nodes), we view *x* as a left node and the list *f*(*x*) consists of some of the nodes at distance 2 from *x* in the graph. (A side remark: Buhrman et al. [2] also use graphs, namely, constant-degree expanders, and they obtain the lists also as the set of neighbors at some given distance.) In our graph, the left side is *<sup>L</sup>* <sup>=</sup> {0, 1}*n*, the set of *<sup>n</sup>*-bit strings, the right side is *<sup>R</sup>* <sup>=</sup> {0, 1}*m*, the set of *<sup>m</sup>*-bit strings, and each left node has degree *D*. The graphs also depend on three parameters, , Δ and *t*, and, for our discussion, it is convenient to also use *δ* = 1/2 and *<sup>s</sup>* <sup>=</sup> *<sup>δ</sup>* · <sup>Δ</sup>. The graphs that we need have two properties:


The graph with the above two properties is constructed using the probabilistic method in Lemma 2.

Let us now see how to use such a graph to increase the Kolmogorov complexity in the list-approximation sense. Let us suppose that we have a graph *G* with the above properties for the parameters *n*, *δ*, Δ, *D*,*s* and *t*.

**Claim 1.** *There is a procedure that takes as input a string x of length n with complexity C*(*x*) < *t and produces a list with D* · Δ *strings, all having length n, such that at least a fraction of* (1 − 2*δ*) *of the strings in the list has a complexity larger than C*(*x*)*.*

Indeed, let *x* be a string of length *n* with *C*(*x*) = *k* < *t*. Let us consider the set *<sup>B</sup>* <sup>=</sup> {*x* ∈ {0, 1}*<sup>n</sup>* <sup>|</sup> *<sup>C</sup>*(*x* ) ≤ *k*}, which we view as a set of left nodes in *G*. Note that the size of *B* is bounded by 2*<sup>t</sup>* . A node that does not have the low-congestion property for *B* is said to be *δ*-BAD(*B*). By the first property of *G*, there are at most *δ*|*B*| elements in *B* that are *δ*-BAD(*B*). It can be shown that *x* is not *δ*-BAD(*B*). The reason is, essentially, that the strings that are *δ*-BAD(*B*) can be enumerated and they make up a small fraction of *B*; therefore, they can be described with less than *k* bits. Now, to construct the list, we view *x* as a left node in *G* and we "go-right-then-go-left". This means that we first "go-right", i.e., we take all the *D* neighbors of *x* and, for each such neighbor *y*, we "go-left", i.e., we take Δ of the *y*'s neighbors and put them in the list. Since *x* is not *δ*-BAD(*B*), (1 − *δ*)*D* of its neighbors have at most *s* = *δ* · Δ elements in *B*. Overall, less than 2*δ* · *D* · Δ of the strings in the list can be in *B* and so at least a fraction of (1 − 2*δ*) of the strings in the list has complexity larger than *k* = *C*(*x*). Our claim is proved.

#### **3. Proof of Theorem 2**

We use the following definition and results from [4].

#### **Definition 1.**


$$\operatorname{Prob}[\mathcal{D}(\mathcal{C}(\epsilon, m, \mathfrak{x})) = \mathfrak{x}] \ge 1 - \epsilon.$$

In other words, if we are given a bound *m* that is at least *C*(*x*)+overhead, then C compresses *x* to a string of length *m*, from which D is able to reconstruct *x* with high probability.

**Theorem 3** (Theorem 1.1 in [4])**.** *There exists a compressor* C *with overhead* Δ(, *m*, *n*) = *O*(log *m* · log(*n*/)) *that is* Δ*-optimal for the Kolmogorov complexity. Furthermore, the compressor* C *takes as input* (, *m*, *x*) *and runs in polynomial time in* |*x*|*, using a random string of length O*(log *m* · log(|*x*|/))*.*

Note: Theorem 1.1 in [4] is more general, but we only need the above version.

**Proof of Theorem 2.** We follow the plan sketched in Section 2; we compress the input *x* to a string *y* with the optimal compressor from Theorem 3 and then append to *y* a random string *z* of constant length. We show that, with high probability, *yz* has the desired properties; it has a complexity larger than *C*(*x*) and it is not longer than *x*. We see below that this randomized algorithm uses *O*(log |*x*| · log |*x*|/)) random bits, which implies the desired list approximation via the observations in Remark 2.

Let the compressor C and the overhead Δ be the functions from Theorem 3. Let  = *δ*/2. We fix *n*; let us consider a string *x* of length *n* such that *C*(*x*) ≤ *n* − 3Δ(, *n*, *n*). Note that *C*(*x*) ≤ *n* − *O*(log *n* · log(*n*/)). Let *m* = *n* − 2Δ(, *n*, *n*) and *y* = C(, *m*, *x*) (note that *y* is a random variable because C is a randomized function). For *n* sufficiently large,

$$
\mathcal{L}(\mathfrak{x}) \le n - \mathfrak{z}\Lambda(\mathfrak{e}, n, n) \le m - \Lambda(\mathfrak{e}, m, n).
$$

Let A be the event by which the decompressor D reconstructs *x* from *y*. By Theorem 3, A has probability 1 − .

We take *c* a constant large enough such that Equations (2) and (3) below are satisfied. Conditioned by A,

$$\mathcal{C}(y) \ge \mathcal{C}(x) - \mathcal{c} \text{ (because } x \text{ is reconstructed from } y) \tag{2}$$

Let *c* = 2*c*. We choose *c* so that

$$2^{-\left(\varepsilon'/2 - 2\log \varepsilon' - O(1)\right)} < \varepsilon\_{\prime} \tag{3}$$

where the *O*(1) term is the constant from Lemma 1.

We append to *<sup>y</sup>* a string *<sup>z</sup>* chosen at random in {0, 1}*c* . By Lemma 1 and Equation (3), with probability 1 − , *C*(*yz*) > *C*(*y*) + *c* /2 = *C*(*y*) + *c*. Now, we condition on A and we obtain that, with probability 1 − 2,

$$\mathcal{C}(yz) > \mathcal{C}(y) + \mathcal{c} \ge \mathcal{C}(x) - \mathcal{c} + \mathcal{c} = \mathcal{C}(x).$$

We take *δ* = 2. Now, let us check the properties of the above algorithm. For every *n*-bit string *x* with *C*(*x*) ≤ *n* − 3Δ(, *n*, *n*) = *n* − *O*(log |*x*| · log |*x*|/*δ*), the algorithm takes as input *x* and *δ* and outputs, in polynomial time, the string *yz* that, with probability 1 − *δ*, has a complexity larger than the complexity of *x*. The string *yz* has length *m* + *c* = *n* − 2Δ(, *n*, *n*) + *c* ≤ *n*. The whole randomized procedure uses *O*(log *m* · log(*n*/)) = *O*(log *n* · log(*n*/*δ*)) random bits for compression with C and *c* = *O*(1) random bits for *z*. The list approximation is obtained from the probabilistic algorithm in the obvious way, i.e., by including in the list one element for each choice of the random string (see Remark 2). The theorem is proved.

#### **4. Proof of Theorem 1**

We split the proof in three parts. In Section 4.1, we introduce *balanced graphs*; in Section 4.2, we show how to increase the Kolmogorov complexity in the list approximation sense using balanced graphs and, in Section 4.3, we use the probabilistic method to obtain the balanced graph with the parameters needed for Theorem 1.

#### *4.1. Balanced Graphs*

Here, we formally define the type of graphs that we need. We work with families of bipartite graphs *Gn* = (*L* ∪ *R*, *E* ⊆ *L* × *R*), indexed by *n*, which have the following structure:


A bipartite graph of this type can be viewed as a function EXT : {0, 1}<sup>n</sup> × {0, 1}<sup>d</sup> <sup>→</sup> {0, 1}n, where EXT(x, y) = z if there is an edge between *<sup>x</sup>* and *<sup>z</sup>* labeled *<sup>y</sup>*. We want EXT to yield a (*k*, ) randomness extractor whenever we consider the modified function EXTk, which takes as input (*x*, *y*) and returns EXT(x, y), from which we keep only the first *k* bits. (Note: A randomness extractor is a type of function that plays a central role in the theory of pseudo-randomness. All we need here is that it satisfies Equation (4).)

From the function EXTk, we go back to the graph representation and we obtain the "prefix" bipartite graph *Gn*,*<sup>k</sup>* = (*<sup>L</sup>* <sup>=</sup> {0, 1}*n*, *Rk* <sup>=</sup> {0, 1}*k*, *Ek* <sup>⊆</sup> *<sup>L</sup>* <sup>×</sup> *Rk*), where, in *Gn*,*k*, we merge the right nodes of *Gn* that have the same prefix of length *k*. The left degrees in the prefix graph do not change. However, the right degrees may change and, as *k* becomes smaller, the right degrees typically become larger due to merging.

The requirement is that, for every subset *<sup>B</sup>* <sup>⊆</sup> *<sup>L</sup>* of size <sup>|</sup>*B*| ≥ <sup>2</sup>*k*, for every *<sup>A</sup>* <sup>⊆</sup> *Rk*,

$$\left| \frac{|E\_k(B, A)|}{|B| \times D} - \frac{|A|}{|R\_k|} \right| \le \epsilon,\tag{4}$$

where *Ek*(*B*, *A*) is the set of edges between *B* and *A* in *Gn*,*k*. (Note: This means that *Gn*,*<sup>k</sup>* is a (*k*, ) randomness extractor.)

We also want to have the guarantee that each right node in *Gn*,*<sup>t</sup>* has degree at least Δ, where Δ and *t* are parameters.

Accordingly, we have the following definition.

**Definition 2.** *A graph Gn* = (*L*, *R*, *E* ⊆ *L* × *R*) *as above is* (, Δ, *t*)*-balanced if the following requirements hold:*


In our application, we need balanced graphs in which the neighbors of a given node can be found effectively. As usual, we consider families of graphs (*Gn*)*n*≥<sup>1</sup> and we say that such a family is *computable* if there is an algorithm that takes as input (*x*, *y*), views *x* as a left node in *G*|*x*|, views *y* as the label of an edge outgoing from *x* and outputs *z*, where *z* is the right node where the edge *y* lands in *G*|*x*|.

The following lemma provides the balanced graphs that we need as explained in the proof overview in Section 2.

**Lemma 2.** *For every rational*  > 0*, there exist some constant c and a computable family of graphs* (*Gn*)*n*≥1*, where each Gn* = (*<sup>L</sup>* <sup>=</sup> {0, 1}*n*, *<sup>R</sup>* <sup>=</sup> {0, 1}*n*, *<sup>E</sup>* <sup>⊆</sup> *<sup>L</sup>* <sup>×</sup> *<sup>R</sup>*) *is* (, Δ, *t*)*-balanced graph, with left degree D* <sup>=</sup> <sup>2</sup>*<sup>d</sup> for d* <sup>=</sup> log(2*n*/<sup>2</sup>)*,* <sup>Δ</sup> <sup>=</sup> <sup>2</sup>(1/)3/2*D and t* <sup>=</sup> *<sup>n</sup>* <sup>−</sup> log log *<sup>n</sup>* <sup>−</sup> *c.*

The proof of Lemma 2 is by the standard probabilistic method and is presented in Section 4.3.

*4.2. From Balanced Graphs to Increasing the Kolmogorov Complexity in the List-Approximation Sense*

The following lemma shows a generic transformation of a balanced graph into a function that takes as input *x* and produces a list so that most of its elements have a complexity larger than *C*(*x*).

**Lemma 3.** *Let us suppose that, for every δ* > 0*, there are t* = *t*(*n*) *and a computable family of graphs* (*Gn*)*n*≥1*, where each Gn* = (*Ln* <sup>=</sup> {0, 1}*n*, *Rn* <sup>=</sup> {0, 1}*n*, *En* <sup>⊆</sup> *Ln* <sup>×</sup> *Rn*) *is* (*δ*2, <sup>Δ</sup>, *<sup>t</sup>*) *balanced graph, with* <sup>Δ</sup> <sup>=</sup> <sup>2</sup>(1/*δ*3) · *D, where D is the left degree.*

*Then, there exists a computable function f that takes as input a string x and a rational number δ* > 0 *and returns a list containing strings of length* |*x*|*; additionally, the following are true:*


*(The constants hidden in O*(·) *do not depend on δ.)*

**Proof.** The following arguments are valid if *δ* is smaller than some small positive constant. We assume that *δ* satisfies this condition and also that it is a power of 1/2. This can be performed because scaling down *δ* by a constant factor only changes the constants in the

*O*(·) in the statement. Let  = *δ*2. We explain how to compute the list *f*(*x*), with the property stipulated in the theorem's statement.

We take *Gn* to be the (, Δ, *t*)-balanced graph with left nodes of length *n* promised by the hypothesis. Let *Gn*,*<sup>t</sup>* be the "prefix" graph obtained from *Gn* by cutting the last *n* − *t* bits in the labels of right nodes (thus preserving the prefix of length *t* in the labels).

The list *f*(*x*) is computed in two steps:


Note that all the elements in the list have length *n* and the size of the list is | *f*(*x*)| = <sup>Δ</sup> · *<sup>D</sup>* <sup>=</sup> <sup>2</sup>(1/*δ*)3*D*2.

Let *x* be a binary string of length *n*, with complexity *C*(*x*) = *k*. We assume that *k* ≤ *t*. The rest of the proof is dedicated to showing that the list *f*(*x*) satisfies the second item in the statement. Let

$$B\_{n,k} = \{ \mathbf{x}' \in \{0, 1\}^n \mid \mathbf{C}(\mathbf{x}') \le k \},$$

and let *Sn*,*<sup>k</sup>* <sup>=</sup> log <sup>|</sup>*Bn*,*k*|. Thus, 2*Sn*,*<sup>k</sup>* ≤ |*Bn*,*k*<sup>|</sup> <sup>&</sup>lt; <sup>2</sup>*Sn*,*k*<sup>+</sup>1. Later, we use the fact that

$$S\_{n,k} \le k \le t. \tag{5}$$

We consider the graph *Gn*,*Sn*,*<sup>k</sup>* , which is obtained, as explained above, from *Gn* by taking the prefixes of the right nodes of length *Sn*,*k*. To simplify notation, we use *G* instead of *Gn*,*Sn*,*<sup>k</sup>* . The set of left nodes in *<sup>G</sup>* is *<sup>L</sup>* <sup>=</sup> {0, 1}*<sup>n</sup>* and the set of right nodes in *<sup>G</sup>* is *<sup>R</sup>* <sup>=</sup> {0, 1}*m*, for *<sup>m</sup>* <sup>=</sup> *Sn*,*k*.

We view *Bn*,*<sup>k</sup>* as a subset of the left nodes in *G*. Let us introduce some helpful terminology. In the following, all the graph concepts (left node, right node, edge and neighbor) refer to the graph *G*. We say that a right node *z* in *G* is (1/)-light if it has at most (1/) · <sup>|</sup>*Bn*,*<sup>k</sup>* |·*<sup>D</sup>* <sup>|</sup>*R*<sup>|</sup> neighbors in *Bn*,*k*. A node that is not (1/)-light is said to be (1/)-heavy. Note that

$$(1/\epsilon) \cdot \frac{|B\_{n,k}| \cdot D}{|R|} \le (1/\epsilon) \frac{2^{S\_{n,k}+1} \cdot D}{2^{S\_{n,k}}} = \delta \Delta\_{\prime}$$

thus, a (1/)-light node has at most *δ*Δ neighbors in *Bn*,*k*.

We also say that a left node in *Bn*,*<sup>k</sup>* is *δ*-BAD with respect to *Bn*,*<sup>k</sup>* if at least a *δ* fraction of the *D* edges outgoing from it lands in the right neighbors that are (1/)-heavy. Let *δ*-BAD(*Bn*,*k*) be the set of nodes that are *δ*-BAD with respect to *Bn*,*k*.

We show the following claim.

**Claim 2.** *At most a* 2*δ fraction of the nodes in Bn*,*<sup>k</sup> is δ-BAD with respect to Bn*,*k.*

*(In other words, for every x in Bn*,*<sup>k</sup> except at most a* 2*δ fraction, at least a* (1 − *δ*) *fraction of the edges going out from x in G lands in the right nodes that have at most* Δ *neighbors with complexity at most k).*

We defer for later the proof of Claim 2 and continue the proof of the theorem. For any positive integer *k*, let

$$B\_k = \{ \mathbf{x}' \mid \mathbf{C}(\mathbf{x}') \le k \text{ and } k \le t(|\mathbf{x}'|) \}.$$

Let *Ik* = {*<sup>n</sup>* | *<sup>k</sup>* ≤ *<sup>t</sup>*(*n*)}. Note that |*Bk*| = <sup>∑</sup>*n*∈*Ik* |*Bn*,*k*|. Let *<sup>x</sup>* ∈ *Bk* and let *<sup>n</sup>* = |*x* |. We say that *x* is *δ*-BAD with respect to *Bk* if, in *Gn* , *x* is *δ*-BAD with respect to *Bn*,*k*. We

denote by *δ*-BAD(*Bk*) the set of nodes that are *δ*-BAD with respect to *Bk*. We upper bound the size of *δ*-BAD(*Bk*) as follows:

$$\begin{array}{l} |\delta \text{-BAD}(B\_k)| &= \sum\_{n' \in I\_k} |\delta \text{-BAD}(B\_{n',k})| \\ &\leq \sum\_{n' \in I\_k} 2\delta \cdot |B\_{n',k}| \quad \text{(by Claim 2)} \\ &= 2\delta \sum\_{n \in I\_k} |B\_{n',k}| \\ &= 2\delta |B\_k| \\ &\leq 2\delta \cdot 2^{k+1}. \end{array}$$

Note that the set *δ*-BAD(*Bk*) can be enumerated given *k* and *δ*. Therefore, a node *x* that is *δ*-BAD with respect to *Bk* can be described by *k*, *δ* and its ordinal number in the enumeration of the set *δ*-BAD(*Bk*). We write the ordinal number on exactly *k* + 2 − log(1/*δ*) bits and *δ* in a self-delimited way on 2 log log(1/*δ*) bits (recall that 1/*δ* is a power of 2), so that *k* can be inferred from the ordinal number and *δ*. It follows that, if *x* is *δ*-BAD with respect to *Bk*, then, provided 1/*δ* is sufficiently large,

$$\mathbb{C}(\mathbf{x'}) \le k + 2 - \log(1/\delta) + 2\log\log(1/\delta) + O(1) < k. \tag{6}$$

Now, we recall our string *<sup>x</sup>* ∈ {0, 1}*n*, which has complexity *<sup>C</sup>*(*x*) = *<sup>k</sup>*. The inequality (6) implies that *x* cannot be *δ*-BAD with respect to *Bk*, which means that (1 − *δ*) of the edges going out from *x* land in neighbors in *G* having at most *δ*Δ neighbors in *Bk*. The same is true if we replace *G* by *Gn*,*t*, because, by the inequality (5), the right nodes in *G* are prefixes of the right nodes in *Gn*,*t*.

Now, let us suppose that we pick at random a neighbor *p* of *x* in *Gn*,*t* and then find a set *Ap* of Δ neighbors of *p* in *Gn*,*t*. Then, with probability 1 − *δ*, only a fraction of *δ* of the elements of *Ap* can be in *Bk*. Let us recall that we have defined the list *f*(*x*) to be

$$f(\mathbf{x}) = \bigcup\_{\substack{p \text{ neighbor of } \mathbf{x} \text{ in } G\_{\mathbf{n},t}}} A\_p.\mathsf{}$$

It follows that at least a (<sup>1</sup> <sup>−</sup> *<sup>δ</sup>*)<sup>2</sup> <sup>&</sup>gt; (<sup>1</sup> <sup>−</sup> <sup>2</sup>*δ*) fraction of the elements in *<sup>f</sup>*(*x*) has complexity larger than *C*(*x*). This ends the proof.

We now prove Claim 2.

**Proof of Claim 2.** Let *A* be the set of right nodes that are (1/)-heavy. Then,

$$|A| \le \epsilon |\mathcal{R}\_\perp|$$

Indeed, the number of edges between *Bn*,*<sup>k</sup>* and *A* is at least |*A*| · (1/) · <sup>|</sup>*Bn*,*<sup>k</sup>* |·*<sup>D</sup>* <sup>|</sup>*R*<sup>|</sup> (by the definition of (1/)-heavy), but, at the same time, the total number of edges between *Bn*,*<sup>k</sup>* and *R* is |*Bn*,*k*| · *D* (because each left node has degree *D*).

Next, we show that

$$|\delta \text{-BAD}(B\_{n.k})| \le 2\delta |B\_{n.k}|. \tag{7}$$

For this, note that *G* is a (*Sn*,*k*, ) randomness extractor and *Bn*,*<sup>k</sup>* has size at least 2*Sn*,*<sup>k</sup>* . Therefore, by the property (4) of extractors,

$$\frac{|E(B\_{n,k},A)|}{|B\_{n,k}| \cdot D} \le \frac{|A|}{|R|} + \epsilon \le 2\epsilon.$$

On the other hand, the number of edges linking *Bn*,*<sup>k</sup>* and *A* is at least the number of edges linking *δ*-BAD(*Bn*,*k*) and *A*; this number is at least |*δ*-BAD(*Bn*,*k*)| · *δD*. Thus,

$$|E(B\_{n,k}, A)| \ge |\delta \text{-BAD}(B\_{n,k})| \cdot \delta D.$$

Combining the last two inequalities, we obtain

$$\frac{|\delta \text{-BAD}(B\_{n,k})|}{|B\_{n,k}|} \le 2\epsilon \cdot \frac{1}{\delta} = 2\delta.$$

This ends the proofs of Claim 2, which is the last piece that we needed for the proof of Lemma 3.

Theorem 1 is obtained by plugging, into the above lemma, the balanced graphs from Lemma 2 with parameter = *δ*2.

#### *4.3. Construction of Balanced Graphs: Proof of Lemma 2*

We use the probabilistic method. We consider a random function EXT : {0, 1}<sup>n</sup> <sup>×</sup> {0, 1}<sup>d</sup> → {0, 1}<sup>n</sup> for *<sup>d</sup>* <sup>=</sup> log(2*n*/<sup>2</sup>). We show the following two claims, which imply that a random function has the desired properties with positive probability. Since the properties can be checked effectively, we can find a graph by exhaustive search. We use the notation from Definition 2 and from the paragraph preceding it.

**Claim 3.** *For sufficiently large n, with probability* ≥ 3/4*, it holds that, for every k* ∈ {1, ... , *n*}*, in the bipartite graph Gn*,*<sup>k</sup>* <sup>=</sup> {*L*, *Rk*, *Ek* <sup>⊆</sup> *<sup>L</sup>* <sup>×</sup> *Rk*}*, every <sup>B</sup>* <sup>⊆</sup> *<sup>L</sup>* <sup>=</sup> {0, 1}*<sup>n</sup> of size* <sup>|</sup>*B*| ≥ <sup>2</sup>*<sup>k</sup> and every A* <sup>⊆</sup> *Rk* <sup>=</sup> {0, 1}*<sup>k</sup> satisfies*

$$\left| \frac{|E\_k(B, A)|}{|B| \times D} - \frac{|A|}{|R\_k|} \right| \le \epsilon. \tag{8}$$

**Claim 4.** *For some constant c and every sufficiently large positive integer n, with probability* ≥ 3/4*, every right node in the graph Gn*,*n*−log log *<sup>n</sup>*−*<sup>c</sup> has degree at least* <sup>Δ</sup>*.*

**Proof of Claim 3.** First, we fix *<sup>k</sup>* ∈ {1, ... , *<sup>n</sup>*} and let *<sup>K</sup>* <sup>=</sup> <sup>2</sup>*<sup>k</sup>* and *<sup>N</sup>* <sup>=</sup> <sup>2</sup>*n*. Let us consider *<sup>B</sup>* ⊆ {0, 1}*<sup>n</sup>* of size <sup>|</sup>*B*| ≥ *<sup>K</sup>* and *<sup>A</sup>* <sup>⊆</sup> *Rk*. For a fixed *<sup>x</sup>* <sup>∈</sup> *<sup>B</sup>* and *<sup>y</sup>* ∈ {0, 1}*d*, the probability that EXTk(x, y) is in *A* is |*A*|/|*Rk*|. By the Chernoff bounds,

$$\text{Prob}\left[\left|\frac{|E\_k(B,A)|}{|B|\times D} - \frac{|A|}{|R\_k|}\right| > \epsilon\right] \le 2^{-\Omega(K \cdot D \cdot \epsilon^2)}\text{.}$$

The probability that relation (8) fails for a fixed *<sup>k</sup>*, some *<sup>B</sup>* ⊆ {0, 1}*<sup>k</sup>* of size <sup>|</sup>*B*| ≥ *<sup>K</sup>* and some *<sup>A</sup>* <sup>⊆</sup> *Rk* is bounded by 2*<sup>K</sup>* · ( *N <sup>K</sup>*) · <sup>2</sup>−Ω(*K*·*D*·<sup>2</sup>), because *A* can be chosen in 2*<sup>K</sup>* ways; further, we can consider that *B* has size exactly *K* and that there are ( *N <sup>K</sup>*) possible choices of such *B*'s. Since *D* ≥ 2*n*/2, the above probability is much less than (1/4)2−*k*. Therefore, the probability that relation (8) fails for some *k* ∈ {1, ... , *n*}, some *B* and some *A* is less than 1/4.

**Proof of Claim 4.** We use a "coupon collector" argument. We consider the graph *Gn*,*n*−log log *<sup>n</sup>*−*<sup>c</sup>* for some constant *c* to be fixed later. This graph is obtained from the above function EXT as explained in Definition 2. The graph *Gn*,*n*−log log *<sup>n</sup>*−*<sup>c</sup>* is a bipartite graph with left side *<sup>L</sup>* <sup>=</sup> {0, 1}*n*, right side *<sup>R</sup>* <sup>=</sup> {0, 1}*n*−log log *<sup>n</sup>*−*<sup>c</sup>* and each left node has degree *<sup>D</sup>* <sup>=</sup> <sup>2</sup>*d*. We show that, with probability <sup>≥</sup> 3/4, every right node in *Gn*,*n*−log log *<sup>n</sup>*−*<sup>c</sup>* has degree at least Δ. The random process consists of drawing, for each *x* ∈ *L* and edge *<sup>y</sup>* ∈ {0, 1}*d*, a random element from *<sup>R</sup>* . Thus, we draw at random *ND* times, with replacement, from a set with |*R* | "coupons". Newman and Shepp [7] have shown that, to obtain at least *h* times each coupon from a set of *p* coupons, the expected number of draws is *p* log *p* + (*h* − 1)*p* log log *p* + *o*(*p*). By Markov's inequality, if the number of draws is 4 times the expected value, we collect each coupon *p* times with probability 3/4. In our case, we have *p* = 2*n*−log log *<sup>n</sup>*−*<sup>c</sup>* and *h* = Δ; it can be checked readily that, for an appropriate choice of the constant *c*, 4(*p* log *p* + (*h* − 1)*p* log log *p* + *o*(*p*)) < *ND*, provided *n* is large enough.

**Funding:** The author has been supported in part by the National Science Foundation through grant CCF 1811729.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The author is grateful to Bruno Bauwens for his insightful observations and to Nikolay Vereshchagin for pointing out an error in an earlier version. The author thanks the anonymous referees for their useful suggestions.

**Conflicts of Interest:** The author declares no conflict of interest..

#### **References**


### *Article* **Two Extensions of Cover Automata**

**Cezar Câmpeanu**

School of Mathematical and Computational Sciences, University of Prince Edward Island, 550 University Ave, Charlottetown, PE C1A 4P3, Canada; ccampeanu@upei.ca

**Abstract:** Deterministic Finite Cover Automata (DFCA) are compact representations of finite languages. Deterministic Finite Automata with "do not care" symbols and Multiple Entry Deterministic Finite Automata are both compact representations of regular languages. This paper studies the benefits of combining these representations to get even more compact representations of finite languages. DFCAs are extended by accepting either "do not care" symbols or considering multiple entry DFCAs. We study for each of the two models the existence of the minimization or simplification algorithms and their computational complexity, the state complexity of these representations compared with other representations of the same language, and the bounds for state complexity in case we perform a representation transformation. Minimization for both models proves to be NP-hard. A method is presented to transform minimization algorithms for deterministic automata into simplification algorithms applicable to these extended models. DFCAs with "do not care" symbols prove to have comparable state complexity as Nondeterministic Finite Cover Automata. Furthermore, for multiple entry DFCAs, we can have a tight estimate of the state complexity of the transformation into equivalent DFCA.

**Keywords:** finite languages; deterministic finite cover automata; multiple entry automata; automata with "do not care" symbols; similarity relations

**1. Introduction**

The concept of Cover Automata was first presented at a conference paper of Câmpeanu et al. at the Workshop on Implementations and Applications of Automata (WIAA) in Rouen (1999) [1,2] when the authors introduced a formal definition of a Deterministic Finite Cover Automaton (DFCA) and a minimization algorithm. A cover language for a language *L* is a superset *L* of *L*. If *L* is a finite non-empty language, then the length of the longest word in *L* exists, and we can denote it with a natural number, *l*. A DFCA for a finite language *L* is a deterministic finite automaton (DFA) accepting a cover language for *L*, such that the accepted words that are not in *L* have their length greater than *l*.

During the last two decades, several papers used DCFAs for compact representation of finite languages. Other efficient minimization algorithms were also published, for example [3–8]. The concept of DFCA was also generalized to the nondeterministic version in a paper presented at AFL 2014 in Szeged by Câmpeanu [9], followed by the journal version [10].

Using nondeterminism, we can reduce the size of the automata recognizing some languages, but minimizing such automata is known to be PSPACE-complete. Therefore, several other intermediate representations of languages that maintain deterministic transitions were proposed. That is why it is a must to study these extensions in case they are applied to cover automata, which we are doing in Section 2. The first extension considered here is to enhance DFCAs with *"do not care"* symbols, thus obtaining finite cover automata with "do not care" symbols, denoted by -DFCAs, in other words, finite cover automata accepting partial words. Fischer and Paterson introduced partial words in [11] in 1974, and the authors in [12,13] prove that the minimization of finite automata with "do not care" symbols is NP-hard. As emphasized by Professor Solomon Marcus in [14], many

**Citation:** Câmpeanu, C. Two Extensions of Cover Automata. *Axioms* **2021**, *10*, 338. https:// doi.org/10.3390/axioms10040338

Academic Editor: Oscar Humberto Montiel Ross

Received: 30 September 2021 Accepted: 7 December 2021 Published: 10 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

researches from other areas studied the same concept, but in a different theoretical setup with different notations. An example of such a paper related to partial words is [15], where the authors show strong connections between graph problems and pattern matching with some of the symbols in the patterns not known. In that paper, the "do not care" symbol denoted here by is denoted by *φ*. We will prefer the notation because most references use this notation and using a symbol that is not part of any alphabet is easier to identify. Holzer et al. in [16,17] prove that "almost all problems related to partial word automata, such as equivalence and universality, are already PSPACE-complete". Some of their proofs link non-deterministic automata problems with graph theory problems in a similar fashion as it is done in [15]. As such, because the minimization of -DFAs is hard, only the simplification algorithms were developed for these types of finite machines, and an example is presented in [13]. A simplification algorithm will eventually produce an equivalent automaton with less states than the input automaton, but it is not guaranteed to be minimal. In Section 3, we show that the same difficulties found for NFCA's simplification are also present for -DFCAs, even though -DFCAs can be considered a particular simpler class of NFCAs. We show a simplification algorithm for -DFCAs that has a better time complexity than the one presented for -DFAs in [13].

In [12], the authors give an example of automaton having limited nondeterminism there is only one transition with degree 2 for the same letter—which is hard to minimize. The same argument can be used to prove that finding the minimal finite cover automaton with *"do not care"* symbols is also a hard problem. We already know that NFCA minimization is NP-hard, and details of why the previous proofs work as well for -DFCAs are presented in Section 3. In the same paper [12], the example of an automaton that is hard to minimize accepts a finite language having all the accepted words of length at most 3. This example is used to show that minimizing multiple entry deterministic automata (MEFA) (When the number *k* of entries is known, we use the term *k*-DFA instead of MEFA) is hard. In Section 4, we show that the method with exactly the same construction will also work for Multiple Entry Finite Cover Automata (MEFCA), or *k*-entry DFCAs (*k*-DFCA), adding the results on *k*-entry FA to the previous ones obtained in [18–21]. In Section 4, we show that for binary alphabets, by transforming a *k*-DFCA into a minimal DFCA we can reach the upper bound for NFA to DFCA transformation. Moreover, we show that the general bound is reached for the state complexity of this transformation. Section 5 includes future work and a list of open problems, and the conclusions are drawn in Section 6.

#### **2. Cover Automata Extensions**

#### *2.1. Notations*

The number of elements of a set *T* is #*T*, an alphabet is usually denoted by Σ, and the set of words over <sup>Σ</sup> is <sup>Σ</sup>. The length of a word *<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> is the number of letters of *w*, and it is denoted by |*w*|. Thus, if *w* = *w*1*w*<sup>2</sup> ··· *wk*, where *wi* ∈ Σ, for all 1 ≤ *i* ≤ *k*, then |*w*| = *k*. In particular, when *k* = 0, we have a word with no letters, denoted by *<sup>ε</sup>*, and <sup>|</sup>*ε*<sup>|</sup> <sup>=</sup> 0. We also use the following notations: <sup>Σ</sup>=*<sup>l</sup>* <sup>=</sup> {*<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> | |*w*<sup>|</sup> <sup>=</sup> *<sup>l</sup>*}, <sup>Σ</sup>≤*<sup>l</sup>* <sup>=</sup> {*<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> | |*w*| ≤ *<sup>l</sup>*}, <sup>Σ</sup>>*<sup>l</sup>* <sup>=</sup> {*<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> | |*w*<sup>|</sup> <sup>&</sup>gt; *<sup>l</sup>*}, <sup>Σ</sup><*<sup>l</sup>* <sup>=</sup> {*<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> | |*w*<sup>|</sup> <sup>&</sup>lt; *<sup>l</sup>*}, and <sup>Σ</sup><sup>+</sup> <sup>=</sup> {*<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> | |*w*<sup>|</sup> <sup>=</sup> *<sup>ε</sup>*} <sup>=</sup> *i*>0 Σ*i* .

A Deterministic Finite Automaton (DFA) is a quintuple *A* = (*Q*, Σ, *δ*, *q*0, *F*), where *Q* is a finite non-empty set, the set of states, Σ is the alphabet, *q*<sup>0</sup> ∈ *Q* is the initial state, *F* ⊆ *Q* is the set of final states, and *δ* : *Q* × Σ −→ *Q* is the transition function. In case the transition function *<sup>δ</sup>* is a partial function, denoted as *<sup>δ</sup>* : *<sup>Q</sup>* <sup>×</sup> <sup>Σ</sup> ◦ −→ *<sup>Q</sup>*, we have a partial DFA. In case *δ* is defined for all values of *s* ∈ *Q* and *a* ∈ Σ, the DFA is complete. If we do not emphasize that the DFA is partial, then we understand that the DFA is complete. The transition function *δ* can be extended in a natural way to *Q* × Σ<sup>∗</sup> as follows: *δ*(*q*,*ε*) = *q*, *δ*(*q*, *wa*) = *δ*(*δ*(*q*, *w*), *a*). For the rest of the paper we denote the extension *δ*, by *δ*. If the transition function *<sup>δ</sup>* : *<sup>Q</sup>* <sup>×</sup> <sup>Σ</sup> ◦ −→ *<sup>Q</sup>* is a partial function, then the automaton is incomplete; otherwise, it is a complete one. A Nondeterministic Finite Automaton (NFA) is a quintuple

*A* = (*Q*, Σ, *δ*, *Q*0, *F*), where all the elements are the same as for a DFA except, *Q*<sup>0</sup> ⊆ *Q* is the set of initial states and the transition function *<sup>δ</sup>*, which is now defined as *<sup>δ</sup>* : *<sup>Q</sup>* <sup>×</sup> <sup>Σ</sup> −→ <sup>2</sup>*Q*. In case of an NFA, for the transition function we have that for *<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup>, *<sup>δ</sup>*(*Q*0, *<sup>w</sup>*) <sup>⊆</sup> *<sup>Q</sup>*, and *δ*(*q*, *wa*) = *s*∈*δ*(*q*,*w*) *δ*(*s*, *a*). In what follows, we will use the NFA's with only one initial

state as it is defined in [22]. For any NFA *A* = (*Q*, Σ, *δ*, *Q*0, *F*) there is an equivalent NFA *A* = (*Q* ∪ {*q*0}, Σ, *δ* , *q*0, *F*), where *q*<sup>0</sup> ∈/ *Q*, *δ* (*s*, *a*) = *δ*(*s*, *a*), for all *s* ∈ *Q* and *a* ∈ Σ, and *δ* (*q*0, *a*) = *s*∈*Q*<sup>0</sup> *δ*(*s*, *a*). Using the form for NFA with only one initial state, or initially

connected NFAs, simplify most of the definitions and results and the state complexity will differ from the general case by just one state.

For multiple entry automata, we have a quintuple *A* = (*Q*, Σ, *δ*, *Q*0, *F*), where *Q*<sup>0</sup> ⊆ *Q*. In some cases [23], all the states are considered initial states, thus *Q*<sup>0</sup> = *Q*, while in most other cases, we consider *k*-entry DFA so the transition function *δ* is deterministic and #*Q*<sup>0</sup> = *k* [19].

A state *<sup>s</sup>* in a finite automaton *<sup>A</sup>* is reachable if there is a word *<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> such that *δ*(*q*0, *w*) = *s*. In case of a *k*-entry DFA or an NFA, the state *q*<sup>0</sup> must be one of the initial states. A state *<sup>s</sup>* is useful if there exists *<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup> such that *<sup>δ</sup>*(*s*, *<sup>w</sup>*) <sup>∩</sup> *<sup>F</sup>* <sup>=</sup> <sup>∅</sup>. In case of a deterministic *δ*, we have that *δ*(*s*, *w*) ∈ *F*. A sink state or a dead state is a reachable state with all its transitions being self-loops. All states that are not reachable and not useful can be eliminated without changing the language accepted by the automaton. A deterministic automaton with all states reachable and useful, except one sink state, is called a reduced automaton. In the case of nondeterministic automata, an automaton is considered reduced if all its states are both reachable and useful. In what follows, all automata are reduced automata, so they do not have unreachable or unuseful states.

For an alphabet Σ, we can consider a new symbol , called "do not care symbol", which can replace any letter of Σ. Thus, a word *w* over the alphabet Σ = Σ ∪ { }, will be a partial word if <sup>|</sup>*w*| <sup>&</sup>gt; 0. We say that the word *<sup>u</sup>* <sup>∈</sup> <sup>Σ</sup> is weaker than *<sup>v</sup>* <sup>∈</sup> <sup>Σ</sup> , denoted *u v*, if |*u*| = |*v*| and for all positions *i*, 1 ≤ *i* ≤ |*u*|, if *ui* ∈ Σ then *ui* = *vi*.

Let *<sup>L</sup>* be a regular language over the alphabet <sup>Σ</sup> ∪ { }, with *<sup>σ</sup>* : <sup>Σ</sup> −→ <sup>2</sup><sup>Σ</sup> a substitution such that *σ*(*a*) = {*a*} for all *a* ∈ Σ, and *σ*( ) ⊆ Σ. The regular language *<sup>L</sup>*<sup>⊆</sup> <sup>Σ</sup> is recognized by -DFA, *<sup>A</sup>* = (*Q*, <sup>Σ</sup> , *<sup>δ</sup>*, *<sup>q</sup>*0, *<sup>F</sup>*), if *<sup>L</sup>* = *<sup>L</sup>*(*A*). Accordingly, a -DFA *A<sup>σ</sup>* = (*Q*, Σ , *δ*, *q*0, *F*) associated with some substitution *σ* is defined as a DFA that recognizes a partial language *L* , and it is also associated with the total language *σ*(*L* ).

A cover automaton for a finite language *L* is a DFA recognizing a cover language *L* such that *<sup>L</sup>* <sup>=</sup> *<sup>L</sup>* <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* , for *l* being the length of the longest word in *L*. An *l*-NFCA *A* is a cover automaton for the language *<sup>L</sup>*(*A*) <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* , [10,24]. Any DFA *A* accepting a finite language is a DFCA for *L*(*A*) with *l* = max{|*w*| | *w* ∈ *L*(*A*)}.

Two words, *x* and *y*, are similar with respect to the finite language *L*, written *x* ∼*<sup>L</sup> y*, if for every *<sup>w</sup>* <sup>∈</sup> <sup>Σ</sup>≤*l*−max{|*x*|,|*y*|}, *xw* <sup>∈</sup> *<sup>L</sup>*, whenever *yw* <sup>∈</sup> *<sup>L</sup>*. In this definition, *<sup>l</sup>* is the length of the longest words in *L*. The similarity relation on words is not an equivalence relation, as it is only reflexive, symmetric, and semi-transitive.

If *A* is a DFCA for the finite language *L*, we can also define the level of a state as the length of the shortest path from the initial state to that state, that is *levelA*(*p*) = min{|*w*| | *δ*(*q*0, *w*) = *p*}. In case of multiple entry DFCAs, a state will have *k* levels, i.e., *levelA*,*i*(*p*) = min{|*w*| | *δ*(*q*0,*i*, *w*) = *p*}, for all 1 ≤ *i* ≤ *k*, and *levelA*(*p*) = (*levelA*,1(*p*), *levelA*,2(*p*),..., *levelA*,*k*(*p*)), where *Q*<sup>0</sup> = {*q*0,1,..., *q*0,*k*}.

The following definition is in [10] (Definition 2):

**Definition 1.** *In a NFCA A* = (*Q*, Σ, *δ*, *q*0, *F*)*, two states p*, *q* ∈ *Q are similar, written s* ∼*<sup>A</sup> q, if <sup>δ</sup>*(*p*, *<sup>w</sup>*) <sup>∩</sup> *<sup>F</sup>* <sup>=</sup> <sup>∅</sup> *if <sup>δ</sup>*(*q*, *<sup>w</sup>*) <sup>∩</sup> *<sup>F</sup>* <sup>=</sup> <sup>∅</sup>*, for all w* <sup>∈</sup> <sup>Σ</sup>≤*l*−max{*level*(*p*),*level*(*q*)}*.*

In case the NFCA *A* is understood, we may omit the subscript *A*, i.e., we write *p* ∼ *q* instead of *p* ∼*<sup>A</sup> q*, also we can write *level*(*p*) instead of *levelA*(*p*).

We consider only non-trivial NFCAs for *L*, i.e., NFCAs such that *level*(*p*) ≤ *l* for all states *p*, and with all the states useful and reachable.

We define deterministic and nondeterministic state complexity of a language as:

*sc*(*L*) = min{#*Q* | *A* = (*Q*, Σ, *δ*, *q*0, *F*), is deterministic, complete, and *L* = *L*(*A*)}

and

*nsc*(*L*) = min{#*Q* | *A* = (*Q*, Σ, *δ*, *q*0, *F*), is non-deterministic and *L* = *L*(*A*)}.

In case of a finite language *L*, we can also define the cover complexity variants:

*csc*(*L*) = min{#*<sup>Q</sup>* <sup>|</sup> *<sup>A</sup>* = (*Q*, <sup>Σ</sup>, *<sup>δ</sup>*, *<sup>q</sup>*0, *<sup>F</sup>*), deterministic, complete, and *<sup>L</sup>* <sup>=</sup> *<sup>L</sup>*(*A*) <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* }

and

*ncsc*(*L*) = min{#*<sup>Q</sup>* <sup>|</sup> *<sup>A</sup>* = (*Q*, <sup>Σ</sup>, *<sup>δ</sup>*, *<sup>q</sup>*0, *<sup>F</sup>*), non-deterministic, and *<sup>L</sup>* <sup>=</sup> *<sup>L</sup>*(*A*) <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* }.

We have that *ncsc*(*L*) ≤ *nsc*(*L*) ≤ *sc*(*L*), and *ncsc*(*L*) ≤ *csc*(*L*) ≤ *sc*(*L*).

For an automaton *A*, we say that it is minimal if the number of states of *A* is equal to its corresponding complexity; therefore, we can have minimal DFAs, NFAs, DFCAs, NFCAs, -DFAs, MEFAs, and MEFCAs. An algorithm which takes an automaton of one of the above types as input and produces a minimal automaton of the same type as output is called a minimization algorithm. In some cases, minimization algorithms are exponential. Therefore, it is worth designing algorithms that will reduce the number of states, but they may not produce a minimal automaton. In that case, we have simplification algorithms that may reduce the number of states of the automaton used as input and produce an equivalent one with possibly fewer states. Simplification algorithms are preferred for cases when their computational complexity is significantly lower than the complexity of a minimization algorithm.

For either minimization or simplification algorithms, the method that is used the most is to merge two or more states into one state in such a way that the recognized language does not change. By merging state *p* into state *q* we redirect all incoming transitions to state *p* to incoming transitions to state *q*. For outgoing transitions in case of deterministic automata, outgoing transitions from *p* are lost, but outgoing transitions from *q* are preserved. In case of nondeterministic automata merging can be done in many different ways. For example, the following definition is in [10] (Definition 3):

**Definition 2.** *Let A* = (*Q*, Σ, *δ*, *q*0, *F*) *be an NFCA for the finite language L.*

*1. We say that the state q is* weakly mergeable *in state p if the automaton A* = (*Q* , Σ, *δ* , *q*0, *F* )*, where Q* = *Q* − {*q*}*, F* = *F* ∩ *Q , and*

$$\delta'(s,a) = \begin{cases} \delta(s,a), & \text{if } \delta(s,a) \subseteq \mathbb{Q}' \text{ and } \text{s} \neq p, \\ (\delta(s,a) \nmid \{q\}) \cup \{p\}, & \text{if } q \in \delta(s,a) \text{ and } \text{s} \neq p, \\ (\delta(s,a) \cup \delta(q,a)) \nmid \{q\}, & \text{if } \text{s} = p \end{cases}$$

*is also an NFCA for L. In this case, we write p q.*

*2. We say that the state q is* strongly mergeable *in state p, if the automaton A* = (*Q* , Σ, *δ* , *q*0, *F* )*, where Q* = *Q* − {*q*}*, F* = *F* ∩ *Q , and*

$$\delta'(s,a) = \begin{cases} \delta(s,a), & \text{if } \delta(s,a) \subseteq Q'\\ (\delta(s,a) \nmid \{q\}) \cup \{p\}, & \text{if } q \in \delta(s,a), \end{cases}$$

*is also an NFCA for L. In this case, we write p q.*

By Theorem 3 of [10], if two states are similar, they are also strongly mergeable; therefore, we can reduce the size of that automaton.

Next, we analyze two possible extensions of cover automata. One of them is to allow "do not care" symbols, while the other is to add multiple initial states. For these two types of automata, first, we give the new definitions, then we analyze which results hold and which ones need to be adapted to the new concepts.

#### *2.2. Cover Automata for Partial Words*

A DFCA with "do not care" symbols, written -DFCA, is a cover automaton for the finite language *<sup>L</sup>*<sup>⊆</sup> <sup>Σ</sup>≤*<sup>l</sup>* . Please note that in a -DFA or -DFCA, it is not required to have for every state transitions with "do not-care" symbol . Thus, partial automata are usually presented as incomplete automata, namely, the transitions of "do not care" symbol to a dead state are omitted.

The language recognized by a -DFCA, *A*, over the extended alphabet Σ ∪ { } is *<sup>L</sup>* <sup>=</sup> {*<sup>w</sup>* <sup>|</sup> <sup>Σ</sup> ∪ { } | *<sup>δ</sup>*(*q*0, *<sup>w</sup>*) <sup>∈</sup> *<sup>F</sup>* and <sup>|</sup>*w*| ≤ *<sup>l</sup>*}, where *<sup>l</sup>* is the length of the longest accepted word. We need to find the language over the original alphabet Σ, thus we apply a substitution *<sup>σ</sup>* : <sup>Σ</sup> ∪ { } −→ <sup>2</sup><sup>Σ</sup> to get *<sup>σ</sup>*(*L*) as the *<sup>σ</sup>*-language over <sup>Σ</sup>, accepted by the -DFCA.

In [13], as well as in [25], for the substitution *σ* we can have *σ*( ) = Γ ⊆ Σ. In this paper, we only consider the case where *σ*( ) = Σ, although most results are valid even if *σ*( ) ⊂ Σ.

By replacing the "do not care" symbols in a -DFCA with all letters in Σ, the -DFCA becomes a NFCA. Thus, if *L* is a language accepted by a minimal -DFCA with *n* states, then the "do not care" state complexity of *L* is *dnccsc*(*L*) = *n*. Since any DFCA can be also considered a -DFCA, we have that *ncsc*(*L*) ≤ *dnccsc*(*L*) ≤ *dncsc*(*L*) ≤ *sc*(*L*).

#### **3. Cover Automata with "Do Not Care" Symbols**

In our study, we only need to see how "do not care" symbols influence state similarity and mergeability of two states, because everything that would be valid for NFCAs would then apply to -DFCAs. For strong mergeability, we always obtain deterministic transitions because we remove some of the states' transitions.

For a transition *t* = *p <sup>α</sup>* → *q*, *p*, *q* ∈ *Q*, *α* ∈ Σ , and a substitution *σ*, we consider *<sup>σ</sup>*(*t*) = {*<sup>p</sup> <sup>a</sup>* → *q*|*a* ∈ *σ*(*α*)}, i.e., the set of all transitions that can be obtained by substituting the letter *α* ∈ Σ with *σ*(*α*). If *A* = (*Q*, Σ , *δ*, *q*0, *F*) is a DFCA for *L*, we can denote by <sup>Δ</sup> <sup>=</sup> {*<sup>p</sup> <sup>α</sup>* → *q* | *α* ∈ Σ , *δ*(*p*, *α*) = *q*}, i.e., the set of all transitions in the automaton *A* and <sup>Γ</sup> <sup>=</sup> {*<sup>p</sup> <sup>a</sup>* <sup>→</sup> *<sup>q</sup>* <sup>|</sup> (*<sup>p</sup> <sup>a</sup>* <sup>→</sup> *<sup>q</sup>*) <sup>∈</sup> *<sup>σ</sup>*(*<sup>p</sup> <sup>α</sup>* <sup>→</sup> *<sup>q</sup>*),(*<sup>p</sup> <sup>α</sup>* → *q*) ∈ Δ)}, the set of all transitions obtained from the original ones by applying the substitution *σ*.

We now define the compatibility of two states in a -DFCA.

**Definition 3.** *Let A* = (*Q*, Σ , *δ*, *q*0, *F*) *be a -DFCA. Two states p*, *q* ∈ *Q are σ-compatible for the substitution <sup>σ</sup>, denoted by p* <sup>↑</sup> *q, if the set* {(*a*,*s*) <sup>|</sup> (*<sup>p</sup> <sup>a</sup>* <sup>→</sup> *<sup>s</sup>*) <sup>∈</sup> <sup>Γ</sup>} <sup>=</sup> {(*a*,*s*) <sup>|</sup> (*<sup>q</sup> <sup>a</sup>* → *s*) ∈ Γ}*.*

*Two states p*, *q* ∈ *Q are σ-strongly compatible, denoted p* ⇒*q, if they are σ-compatible,* #{*<sup>s</sup>* <sup>|</sup> (*<sup>p</sup> <sup>a</sup>* <sup>→</sup> *<sup>s</sup>*) <sup>∈</sup> <sup>Γ</sup> *or* (*<sup>q</sup> <sup>a</sup>* → *s*) ∈ Γ} ≤ #Σ *, and if there are s*,*r* ∈ *Q and a* ∈ Σ *such that* (*p <sup>a</sup>* <sup>→</sup> *<sup>s</sup>*),(*<sup>p</sup> <sup>a</sup>* → *r*) ∈ Γ*, we either have r* = *s, or* (*p b* → *s*) ∈ Δ*, for all b* ∈ Σ*, or* (*p b* → *r*) ∈ Δ*, for all b* ∈ Σ*.*

*When the substitution <sup>σ</sup> is understood or in case <sup>σ</sup>*( ) = <sup>Σ</sup>*, it can be omitted and we say that p and q are compatible, respectively, strongly compatible.*

In other words, two states are compatible if by applying the substitution of "do not care" symbols for the -transitions, we obtain the same destination states from *p* and *q* using the same letters in Σ. A weak merge, in the sense of Definition 2 can be used in case *p* and *q* are compatible, but we need to check that this procedure won't change the language.

At the same time, two states are strongly compatible if we can take a destination state *s* and all transitions with all letters to *s* can be replaced by only one transition using a "do not care" symbol, and all other destinations can be reached by at most one symbol from Σ for all the other transitions originating in *p* and *q*.

Thus, by merging state *p* with state *q* and considering the set *T* of consolidated transitions, we can replace transitions in *T* with transitions *T* such that


This new procedure can be defined for partial DFAs and it corresponds to the strongly merging procedure in Definition 2.

Let us check the time complexity required to:


To decide if two states are strongly compatible, we need to check the following:


If this condition is not satisfied, we cannot replace all the transitions on *b* ∈ *σ*( ) to only one of the states *s*1, or *s*<sup>2</sup> with the "do not care" symbol, and we do not obtain determinism for the transitions in the merged state.

Because #{*<sup>s</sup>* <sup>|</sup> (*<sup>p</sup> <sup>a</sup>* <sup>→</sup> *<sup>s</sup>*) <sup>∈</sup> *<sup>σ</sup>*(*<sup>p</sup> <sup>α</sup>* <sup>→</sup> *<sup>s</sup>*), *<sup>p</sup> <sup>α</sup>* → *s* ∈ Δ} ≤ #Σ , all these steps, 1 to 4, take *O*(1) time. Of course, for step 4, we may have two choices for the resulting automaton, but either one we choose, it takes constant time to do the merging. In step 4, if we have a transition from state *p* to state *s* with a letter *a* ∈ Σ and a transition from state *p* to state *s* with "do not care" symbol , the transition from state *p* to state *s* with a letter *a* ∈ Σ can be absorbed into transition from state *p* to state *s* with "do not care" symbol , as it is a redundant transition.

In Figure 1 are depicted all possible cases of merging two strongly compatible states, in case the alphabet is Σ = {*a*, *b*}.

**Remark 1.** *By strongly merging two states, we may obtain nondeterministic transitions. However, in the case of strongly compatible states, redundant transitions can be absorbed into the do not care symbol obtaining only deterministic ones.*

For defining the similarity relation in a -DFCA for two states *p* and *q*, we need the states to be similar in the corresponding NFCA, as in Definition 2 of [10].

Hence, we get the following:

**Definition 4.** *For a -DFCA A* = (*Q*, Σ , *δ*, *q*0, *F*) *two states p and q are similar, denoted p* ∼*<sup>A</sup> q, if for all <sup>w</sup>* <sup>∈</sup> <sup>Σ</sup>≤*l*−max{*levelA*(*p*),*levelA*(*q*)} *and a partial word <sup>u</sup> such that <sup>w</sup>* <sup>∈</sup> *<sup>σ</sup>*(*u*)*, there is a partial word v, such that w* ∈ *σ*(*v*)*, and we also have that δ*(*p*, *u*) ∈ *F if δ*(*q*, *v*) ∈ *F.*

$$
\widehat{\wp} \xrightarrow{\diamond, a, b} \widehat{\wp} \xrightarrow{\textstyle \longrightarrow} \widehat{\wp} \xrightarrow{\diamond, a, b} \widehat{\heartsuit}
$$

**Figure 1.** If the two states are strongly compatible and the result of strongly merging them is state *p*, the second transition will be from *p* to *s* and it may overlap with an *a* or a *b* transition, or a diamond transition. In this case, we keep just one transition and we drop the transitions on all letters *b* ∈ Σ from *p* to *s* that are overlapping with it, to avoid nondeterminism. In all cases any non-deterministic choice can be avoided by "absorbing" a letter transition into the "do not-care" symbol transition.

☎

**Lemma 1.** *Let -DFCA A* = (*Q*, Σ , *δ*, *q*0, *F*) *be a -DFCA. If two states p and q are similar, then they can be either strongly merged eliminating redundant transitions, if they are strongly compatible, or weakly merged otherwise.*

**Proof.** Let *<sup>L</sup>* be the language of partial words accepted by *<sup>A</sup>*, *<sup>L</sup>* <sup>=</sup> *<sup>σ</sup>*(*L*) <sup>⊆</sup> <sup>Σ</sup> the associated finite language, and *l* the length of the longest words in *L*. Without any loss of generality, we may assume that *levelA*(*p*) <sup>≤</sup> *levelA*(*q*). Let *<sup>v</sup>* <sup>∈</sup> <sup>Σ</sup>≤*<sup>l</sup>* such that *<sup>δ</sup>*(*q*, *<sup>v</sup>*) <sup>∈</sup> *<sup>F</sup>*, *<sup>v</sup>* <sup>=</sup> *<sup>α</sup>v* , *α* ∈ Σ . It follows that for every word *w* ∈ *σ*(*v*) and any *xq* ∈ *σ*(*yq*) such that *δ*(*q*0, *yq*) = *q* and *xqw* ≤ *l*, we have that *xqw* ∈ *L*. We also have that |*xq*| ≥ *level*(*q*) ≥ *level*(*p*).

There is a partial word *u*, such that *w* ∈ *σ*(*u*) and *δ*(*p*, *u*) ∈ *F* because *p* ∼*<sup>A</sup> q*. Thus, by redirecting all transitions from *q* to *p* (the weakly merging method), we obtain a new automaton *A* for which *xqw* is in the associated language of *A* .

If we have a word *w* in the associated language of *A* , it means that there is a partial word *z* accepted by *A* such that *w* ∈ *σ*(*z*). If for every prefix of *π* of *z*, *δ* (*q*0, *π*) = *p*, then *δ*(*q*0, *π*) = *p*, and *z* is accepted by *A*, therefore *w* ∈ *L*.

We have that *δ* (*p*, *v*) ∈ *F* because *δ* (*q* <sup>0</sup>, *z*) ∈ *F* in case *δ*(*q*0, *π*) = *p* for some *π* with *z* = *πv*. Since *p* ∼*<sup>A</sup> q*, for *y* ∈ *σ*(*v*), there is a partial word *u*, such that *y* ∈ *σ*(*u*) and *δ*(*q*, *u*) ∈ *F*. We have either *δ*(*q*0, *π*) = *p*, or *δ*(*q*0, *π*) = *q* because *A* is obtained from *A* by weakly merging *q* into state *p*. In both cases, *w* ∈ *σ*(*πu*) ∪ *σ*(*πv*), and either *πu* ∈ *L*(*A*), or *πv* ∈ *L*(*A*), so *w* ∈ *L*.

Hence, the language associated with the automaton *A* does not change in case we do a weak merging of similar states.

If *p* and *q* are strongly compatible, let *w* = *aw* , *a* ∈ *σ*( ). Thus, either *δ* (*p*, *a*) = *δ*(*q*, *a*), or *δ* (*p*, ) = *δ*(*q*, *a*). Consequently, the word *xqw* is also in the language associated with the automaton *A* .

If *w* is in the associated language of *A* , then there is a partial word *z* such that *w* ∈ *σ*(*z*). In case *δ*(*q*0, *π*) = *p* for some *π* with *z* = *πv*, because *δ* (*q* <sup>0</sup>, *z*) ∈ *F*, then *δ* (*p*, *v*) ∈ *F* and *w* = *xy*, *y* ∈ *σ*(*v*).

Since *p* ∼*<sup>A</sup> q*, for *y* ∈ *σ*(*v*), there is a partial word *u*, such that *y* ∈ *σ*(*u*), and *δ*(*q*, *u*) ∈ *F*.

Because *A* is obtained from *A* by strongly merging *q* into state *p*, we have either *δ*(*q*0, *π*) = *p*, or *δ*(*q*0, *π*) = *q*. In both cases, *w* ∈ *σ*(*πu*) ∪ *σ*(*πv*), and either *πu* ∈ *L*(*A*), or *πv* ∈ *L*(*A*), so *w* ∈ *L*.

Let us see how we can use the above results to minimize -DFCAs.

In Section 2 of [12], the authors show that NFA minimization is NP-hard even in the case when the NFAs recognize finite languages, and they have limited non-determinism, i.e., the automata have at most one non-deterministic transition. Moreover, Corollary 7 on page 208 of [12], states that the minimization problem is NP-hard even if the input is given as a DFA. Their proof is based on the fact that the normal set cover problem is NP-complete [26,27]. Hence, if you consider these sets as paths, which corresponds to words, in an NFA, finding a minimal NFA is equivalent to finding a minimal set cover. For proving it in case of limited nondeterminism, they need a normal set cover *B* of a set *C*, i.e., for each *c* ∈ *C*, there is a subset *Bc* of *B* such that *c* = ∪*X*∈*BcX* the elements in *Bc* are pairwise disjoint. The partition *B* is separable normal set basis for *C* if *B* can be written as a disjoint union of two other non-empty sets *B*<sup>1</sup> and *B*<sup>2</sup> such that for each *c* ∈ *C*, the subcollection *Bc* contains at most one element of *B*<sup>1</sup> and at most one element of *B*2. To do that, they use a modified version of a known reduction from vertex cover to normal set basis (Lemma 4 in [28]), showing that the second problem is NP-hard. Using this result, they show that some instances of normal set basis sets in the partition will be pairwise disjoint and you can have just one state with two *a*-transitions. For (*C*,*s*), a separable normal set basis they consider, the language considered is *L* = {*acb* | *c* ∈ *C*, *b* ∈ *c*}, over a growing alphabet Σ = {*a*} ∪ <sup>1</sup>≤*i*≤*n*{*ci*, *bi*<sup>1</sup> ,..., *bi*,*ni* }.

All accepted words are of length 3.

Therefore, for our case, we can use the same proof in two ways:


It follows that:

### **Theorem 1.** *Minimizing -DFCAs is NP-hard.*

Therefore, we need to seek simplification algorithms rather than minimization algorithms for -DFCAs. We already know [1,7,24,29] that all minimization algorithms for DFCAs are based on determining all similar states and merge them. For testing the similarity, one method [24,29], is to compute the gap function for two states *p* and *q*, where *gap*(*p*, *q*) is the length of the shortest word that will distinguish between the states *p* and *q*. For -DFCAs, this means that we need to determine the length of the shortest word *w* such that:

1. if *<sup>w</sup>* <sup>∈</sup> *<sup>σ</sup>*(*u*), *<sup>u</sup>* <sup>∈</sup> <sup>Σ</sup>≤*l*−max{*level*(*p*),*level*(*q*)} , and *<sup>δ</sup>*(*q*, *<sup>u</sup>*) <sup>∈</sup> *<sup>F</sup>*, then for any partial word *<sup>v</sup>* <sup>=</sup> *<sup>u</sup>*, *<sup>v</sup>* <sup>∈</sup> <sup>Σ</sup>≤*l*−max{*level*(*p*),*level*(*q*)} such that *<sup>w</sup>* <sup>∈</sup> *<sup>σ</sup>*(*v*), we have that *<sup>δ</sup>*(*p*, *<sup>v</sup>*) <sup>∈</sup>/ *<sup>F</sup>*.


Hence, we deduce that the gap function can be recursively computed as follows: *gap*(*p*, *q*) = 1 + min{*gap*(*r*,*s*) | *r* = *δ*(*p*, *α*),*s* = *δ*(*q*, *β*), *α*, *β* ∈ Σ and we have *α* = *β*, or *α* ∈ *σ*(*β*), or *β* ∈ *σ*(*α*)}.

Because the number of transitions from *p* and *q* is bounded by #Σ , computing the gap function for a DFCA can be done in constant time for any pair *p*, *q*, if we know the gap function for all pairs *r*,*s*, such that *r* = *δ*(*p*, *α*), *s* = *δ*(*q*, *β*), *α*, *β* ∈ Σ .

Two state would be then similar if *gap*(*p*, *q*) ≥ *l* − max(*level*(*p*), *level*(*q*). With these observations and the fact that all known minimization algorithms for DFCAs are based on computing the similarity relation, we can modify any of the known minimizing algorithms for DFCAs [1,4,7,29] or *l*-DFCAs [24], to obtain a simplification algorithm for -DFCAs, without changing their computational complexity. Since the minimization algorithms for DFCAs are at most *O*(*n*4) [1,10], for all these simplification algorithms the time complexity will be at most *O*(*n*4) as well, which is better than the time complexity of the simplification algorithm proposed in [13]. Accordingly, we have obtained the following result:

**Theorem 2.** *For every DFCA minimization algorithm based on merging similar states having the run time complexity of O*(*f*(*n*))*, there is a simplification -DFCA algorithm having the same complexity of O*(*f*(*n*))*.*

A language *L* is *σ*-minimal partial language for *L* if for any other language *L*" such that *σ*(*L*") = *L*, there is no word *w* ∈ *L* such we can find *x* ∈ *L*" with *x* is weaker than *w* and *x* = *w*.

For example, *L* = { *a* } is *σ*-minimal partial language for *L* = {*aaa*, *aab*, *baa*, *bab*}. Indeed, if *L* is *σ*-partial language for *L*, *x* ∈ *L* and *w* ∈ *L* are such that *x w*, then we either have *x* = or *x* = *w*. In the first case, *aba* ∈ *σ*(*L*) = *L* and in the second case *x* = *w* is false. Therefore, *L* is a *σ*-minimal partial language for *L*.

It must be noted that the simplification algorithm proposed in [13] obtains an approximation of the *σ*-minimal partial language *L* for the regular language *L*, and obtaining this *σ*-minimal partial language is NP-hard [13]. The cover language *L* , for the finite language *L* that we obtain by applying the simplification algorithm, may not be a cover language for the *<sup>σ</sup>*-minimal partial language *<sup>L</sup>σ*, i.e., *<sup>L</sup>* <sup>∩</sup> <sup>Σ</sup>≤*l* <sup>=</sup> *<sup>L</sup>σ*, but it is a *<sup>σ</sup>*-partial language that may have a lower state complexity than the original DFCA for *L* and *σ*(*L* ) is a cover language for *L*, i.e., *σ*(*L* ) <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* <sup>=</sup> *<sup>L</sup>*. Please note that *<sup>L</sup><sup>σ</sup>* is the weakest partial language such that *σ*(*Lσ*).

In Figure 2 for the language *L* = {*a*, *b*, *aa*, *ab*, *ba*, *aaa*, *aab*, *aba*, *abb*, *baa*, *bab*}, max{|*w*| | *w* ∈ *L*} = *l* = 3, we have the partial language *L*<sup>1</sup> = { , *ba*, *a* , *a* , *a* }, recognized by the -automaton *A*<sup>1</sup> = ({*a*, *b*}, {0, 1, 2, 3, 4}, *δ*1, 0, {2, 4}), with useful transitions *δ*1(0, *a*) = 1, *δ*1(0, ) = 2, *δ*1(0, *b*) = 3, *δ*1(1, ) = 4, *δ*1(2, *a*) = 0, *δ*(3, *a*) = 2, *δ*1(4, ) = 2, that is a *<sup>σ</sup>*-minimal partial cover language for *<sup>L</sup>*, i.e., *<sup>σ</sup>*(*L*1) <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* <sup>=</sup> *<sup>L</sup>*, and the words in *<sup>L</sup>*<sup>1</sup> are the weakest possible with this property. We have that the *csc*(*L*1) = 5.

The language *L*<sup>2</sup> recognized by the -automaton *A*<sup>2</sup> = ({*a*, *b*}, {0, 1, 2}, *δ*2, 0, {2}), with useful transitions *δ*2(0, *a*) = 2, *δ*2(1, *a*) = 2, *δ*2(0, *b*) = 1, *δ*2(2, ) = 2, is a *σ*-partial cover language for *<sup>L</sup>*, i.e., *<sup>σ</sup>*(*L*2) <sup>∩</sup> <sup>Σ</sup>≤*<sup>l</sup>* <sup>=</sup> *<sup>L</sup>*, and *csc*(*L*2) = 3. *<sup>L</sup>*<sup>2</sup> <sup>∩</sup> <sup>Σ</sup>≤<sup>3</sup> <sup>=</sup> {*a*, *<sup>b</sup>*, *ba*, *<sup>a</sup>* , *<sup>a</sup>* , *ba* } and it contains 6 words, but *<sup>L</sup>*<sup>1</sup> <sup>∩</sup> <sup>Σ</sup>≤<sup>3</sup> <sup>=</sup> { , *ba*, *<sup>a</sup>* , *<sup>a</sup>* , *<sup>a</sup>* } has only 5 words.

The example above shows that it is impossible to obtain a cover language for the *σ*-partial minimal language that has, at the same time, the minimal cover state complexity.

**Figure 2.** Automaton *A*1, left, and automaton *A*2, right. *L*(*A*1) is a cover language for the *σ*-minimal partial language for *L*, and *L*(*A*2) is a cover partial automaton for *L*, where *L* = {*a*, *b*, *aa*, *ab*, *ba*, *aaa*, *aab*, *aba*, *abb*, *baa*, *bab*}.

#### **4. Multiple Entry DFCAs**

For multiple entry DFCAs, we can have two possible flavors of extensions. The first one and the easiest to consider is the same maximum length for all words accepted by the *m*-DFCA. The second approach is to consider for each initial state a different maximum length. Therefore, we can use the following definition:

**Definition 5.** *A multiple entry DFCA with m initial states, i.e., an m-DFCA, is a structure A* = (*Q*, Σ, *δ*, *Q*0, *F*, Λ)*, such that Q,* Σ*, δ, and F are the same as for usual DFCAs, Q*<sup>0</sup> *is the set of initial states,* #*Q*<sup>0</sup> = *m, and* Λ = (*l*1, ... , *lm*) *is a sequence of m integers representing the maximum accepted length for each initial state. If Q*<sup>0</sup> = {*q*0,1, ... *q*0,*m*} *and* Λ = (*l*1, *l*2, ... , *lm*)*, the language accepted by the m-DFCA A is*

$$L(A) = \{ \mathbf{x} \in \Sigma^\* \mid \delta(q\_{0,i}, \mathbf{x}) \in F \text{ and } |\mathbf{x}| \le l\_i, \text{ for some } 1 \le i \le m \}.$$

We have the condition *<sup>L</sup>*(*A*) = <sup>∪</sup>*<sup>m</sup> <sup>i</sup>*=1*Li*, where *Li* <sup>=</sup> *<sup>L</sup>*(*Ai*) <sup>∩</sup> <sup>Σ</sup>≤*li* , *Ai* = (*Q*, <sup>Σ</sup>, *<sup>δ</sup>*, *<sup>q</sup>*0,*i*, *<sup>F</sup>*). The automata *Ai* are subautomata induced by the *m*-DFCA *A*.

We observe from the above definition that the set of initial states has the size *m*. Thus, by replacing the set *Q*<sup>0</sup> with an *m*-tuple *Q*<sup>0</sup> = (*q*0,1, ... *q*0,*m*), if we assign two possible lengths to an initial state, it does not change the accepted language. Assume that the initial states *q*0,*<sup>i</sup>* and *q*0,*<sup>j</sup>* are the same, i.e., *q*0,*<sup>i</sup>* = *q*0,*j*. The automaton will then accept all the words of length less than max{*li*, *lj*}, meaning that we can eliminate the one with the lowest maximum length, getting an (*m* − 1)-DFCA.

In the example given by Björklund and Martens [12], they prove that minimizing *m*-DFAs is NP-hard, using a construction with a finite language. Because any *m*-DFA for a finite language is also an *m*-DFCA, by setting *li* to be the length of the longest accepting walk starting at *q*0,*i*, it follows that

#### **Theorem 3.** *Minimizing m-DFCA is an NP-hard problem.*

We can reduce the size of *m*-DFCA efficiently in a similar way to the previous case for partial automata, obtaining a simplified *m*-DFCA by merging states. To avoid changing the language recognized by an *m*-DFCA *A*, the simplest solution is to merge similar states in all the subautomata *Ai* with the corresponding maximum length *li*. Any other merge of states will modify at least one of the languages involved, which will not guarantee that their union stays the same as before. Therefore, we can obtain the following definition for similarity in *m*-DFCAs:

**Definition 6.** *Let A* = (*Q*, Σ, *δ*, *Q*0, *F*, Λ) *be an m-DFCA for the finite language L. Two states p and q are similar if p and q are similar in all cover automata Ai* = (*Q*, Σ, *δ*, *q*0,*i*, *F*, *λi*)*,* 1 ≤ *i* ≤ *m.*

The simplification algorithms for *m*-DFCAs can be obtained as before by modifying existing DFA-minimization algorithms, therefore in what follows we will focus on state complexity problem, namely, on constructing a minimal DFCA for the same language, and evaluating the state complexity of this transformation.

It is known that for NFA to DFA transformation for finite languages, [30], in case of a binary alphabet, the upperbound is 2 *<sup>n</sup>* <sup>2</sup> <sup>+</sup><sup>1</sup> <sup>−</sup> 1 if *<sup>n</sup>* is even, and 3 · <sup>2</sup> *n*−1 <sup>2</sup> − 1, if *n* is odd, *n* being the number of states of the NFA. Moreover, it is reached by the language *Lm*,*<sup>n</sup>* <sup>=</sup> {*a*, *<sup>b</sup>*}<sup>≤</sup>*ma*{*a*, *<sup>b</sup>*}*<sup>n</sup>* when *<sup>n</sup>* <sup>=</sup> *<sup>m</sup>*, or *<sup>n</sup>* <sup>=</sup> *<sup>m</sup>* <sup>−</sup> 1, so *sc*(*Lm*−1,*m*−1) = <sup>2</sup>*m*+<sup>1</sup> <sup>−</sup> 1, and *sc*(*Lm*,*m*−1) = <sup>3</sup> · <sup>2</sup>*<sup>m</sup>* <sup>−</sup> 1.

Because the length of the longest word is *m* + *n* + 1, the minimal nondeterministic finite automaton recognizing this language will have at least *m* + *n* + 2 states, while the minimal DFA will have at least *m* + *n* + 3 states, [30], Theorem 2. A minimal (*m* + 1)-DFA for *Lm*,*n* has the same number of states as the NFA, plus the sink state, therefore, is minimal as a *m*-DFA. A minimal (*m* + 1)-DFCA for *Lm*,*<sup>n</sup>* has the same number of states as the NFA minus one, because the sink state is similar with state 0, and that is the only possible similarity. We can see that the minimal nondeterministic cover automaton for *Lm*,*<sup>n</sup>* has only *n* + 2 states. For this NFCA for *Lm*,*n*, the initial state is obtained by merging all the *m* + 1-entries into one, so a minimal (*m* + 1)-DFCA must have *m* states more than the NFCA, that is *m* + *n* + 1.

Starting from an *m*-DFA for a finite language, we can construct an equivalent NFA by observing that there is one initial state *q*0,0 with no incoming transition, and for each initial state *q*0,*<sup>i</sup>* ∈ *Q*0, if *δ*(*q*0,*i*, *a*) = *si*, we can add the transitions from *q*0,0 with *a* in *si*, and we delete the sink state. This way, for the *m*-DFA to DFA transformation, we obtain the limits for NFA to DFA transformation, but we need to consider the extra sink state for *m*-DFAs.

Therefore, we just proved the following result:

**Theorem 4.** *In case of a binary alphabet, the upperbound for a n-state m-DFCA to DFCA transformation is* 2 *n*−1 <sup>2</sup> <sup>+</sup><sup>1</sup> <sup>−</sup> <sup>1</sup> *if n is odd, and* <sup>3</sup> · <sup>2</sup> *n*−2 <sup>2</sup> − 1*, if n is even, and the bound is reached.*

Figure 3 shows a 5-DFA with 11 states for the language *L*4,4. This 5-DFA is a minimal multi-entry DFA. Any nondeterministic finite automaton recognizing *L*4,4 must have at least 11 states which is the length of the longest word in *L*4,4 plus 1. A DFA, multi-entry or not must have a sink state, because the language is finite, therefore the automaton depicted in Figure 3a is minimal. The corresponding multi-entry DFCA, Figure 3b has the dead state *d* similar with state 0, so we can reduce the size by one state. The NFCA in Figure 3c recognizes *L*4,4, and it has only 6 states. The general case for *Lm*,*n*−<sup>1</sup> is depicted in Figure 4.

**Figure 3.** Example of 5-DFA having 11 states for *L*4,4 (**a**), the corresponding 5-DFCA (**b**), and the corresponding NFCA (**c**). A corresponding equivalent minimal DFA for *<sup>L</sup>*4,4 has 2<sup>5</sup> <sup>−</sup> 1 states and a minimal DFCA has 16 states.

The upperbound for *m*-DFA to DFCA transformation is the same as the NFA to DFCA transformation, but there is one difference. We have to consider that in the *m*-DFA, we must have one more state as dead state because the language is finite, while in the NFA that state can be eliminated, as it is not useful.

☎

✔❄

**Figure 4.** Example of *<sup>m</sup>*-DFA having *<sup>m</sup>* + *<sup>n</sup>* + 2 states for *Lm*,*n*−<sup>1</sup> (**a**), the corresponding *<sup>m</sup>*-DFCA (**b**), and the corresponding NFCA (**c**).

#### **5. Discussion**

This paper investigates the feasibility of extending the definition of cover automata to include the cases when we allow multiple entries or "do not care" symbols. Because both operations induce a degree of nondeterminism, existing minimization algorithms working on DFAs may not give the smallest automaton in the new class, so we need to verify their run time complexity, and their correctness.

The previous automata constructions prove that minimization problems for certain nondeterministic automata are NP-hard. We checked that the same examples could also be used without any significant modification for cover automata. Hence, the results hold. The proof details for these results were omitted, as it can be found in [12] for NFAs and *m*-DFAs. For cover automata, we only needed to add the "do not care" symbols to substitute one letter in one transition for the first case and to add the maximum length for both cases.

In the previous studies [31,32] on state complexity of partial words DFAs we can find particular classes of languages where minimization bounds can be established. The general case is still open.

I proved that there are simplification algorithms with the same time complexity as existing minimizing DFCA algorithms. I have also computed the state complexity bound for *m*-DFCA to DFCA transformation.

In the case of DFCAs, the idea was floating around even in the 1960s [33,34], but no formal definition was given until 1998. That is the reason why until 2001, there was no result published on this topic, but several papers followed after the publication of [1]. In this paper, I give the required formal definitions for two DFCA extensions, and I also prove some essential results necessary to start any further investigation.

There are several questions that one may ask; for example, the following questions might be of interest:


7. Considering multiple lengths for multiple entry DFAs.

The study of state complexity of operations with finite languages represented by finite deterministic automata was started in [35] and later on in [36]. Later on, the state complexity of operations using nondeterministic automata were considered in [5,37–39]. It would be interesting to see where would the state complexity bounds for operations on these extensions that introduce a low level of nondeterminism would fit: closer to the deterministic results or closer to the non-deterministic models.

For each of these extensions, we need to study the following aspects:


#### **6. Conclusions**

Two extensions are formally defined for the cover automata model of representing finite languages. Fundamental properties of these extensions were checked and proved, followed by the methodology at the end of Section 5. This article also proves that the minimization of -DFCAs and *m*-DFCAs is NP-hard, and it shows a process for obtaining simplification algorithms based on merging states in Theorem 2. The upper bound for *m*-DFCA to DFCA transformation is computed and proved in Theorem 4. The Discussion section also includes open problems and future research directions.

**Funding:** This research received no external funding.

**Acknowledgments:** I am very grateful to the organizers for this volume, In Memoriam of emeritus Professor Solomon Marcus. I was fortunate to participate in the celebration of his 90th birthday when we reconnected after many years, as he was one of the most influential professors in my career. I had the honor of having him as one of the professors during my time as a student at the University of Bucharest. Professor Solomon Marcus will be greatly missed for his friendly and enthusiastic personality by all of us.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**


### *Article* **A Hypergraph Model for Communication Patterns**

**Gabriel Ciobanu**

Faculty of Computer Science, Alexandru Ioan Cuza University, 700506 Iasi, Romania; gabriel@info.uaic.ro † In Memoriam Solomon Marcus (1925–2016).

**Abstract:** The article deals with interaction in concurrent systems. A calculus able to express specific communication patterns is defined, together with its abstract control structures. A hypergraph model for these structures is presented. The hypergraphs are able to properly express the communication patterns, providing a fully abstract model for the pattern calculus. It is also proved that the hypergraph model preserves the operational reductions of processes from pattern calculus and of the actions from the control structures.

**Keywords:** process calculus; communication patterns; control structures; hypergraph model

#### **1. Introduction**

Mathematics has sometimes been called a 'science of patterns' [1], meaning that patterns are at the heart of mathematics. The nice description of mathematics as the "study of patterns" was given by G.H. Hardy in his book *A Mathematician's Apology*: "A mathematician, like a painter or a poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas". Essentially, patterns are regularities that we can perceive. Regarding the skilful ability of applying a pattern to multiple contexts, Solomon Marcus was a wonderful example of applying knowledge patterns to surprising contexts.

Since mathematics and technology have developed a fruitful relationship over past few decades, patterns have been investigated recently in modern fields. New communication technologies have changed the computing landscape, and the Internet is now a platform for large scale distributed programming. Nowadays, we deal with global computation based on multiple interactions with the environment (instead of isolated systems). Concurrency is essential now in computer science; web servers handle multiple simultaneous clients, and cloud servers allow several simultaneous applications and users. Messagepassing represents a way in which concurrent processes communicate (a process is an instance of a running program). In software architecture, a messaging pattern describes how two different processes communicate with each other. In telecommunications, a message exchange pattern describes the messages required by a communications protocol or the message flow between parties involved in communication. For example, when navigating on Internet (representing the channel), a web browser (the communicating party) uses the communication protocol HTTP to request a web page from the server (another communicating party). In general, the interaction between clients and servers follows a specific communication pattern: the client sends a request, the server returns a response, and so on. Such an exchange of messages is only an example of communication patterns. More complicated behaviours appear due to the concurrent interaction of communicating processes; this complexity reveal the necessity to find new ways to describe and build up concurrent systems. The communicating parties in such a concurrent system should have a common language to communicate; moreover, they should follow the rules defined in a communications protocol. There exits already a calculus able to express communication patterns called join calculus; it is used as a basis for some programming languages (JoCaml and C*ω*), but also as a basis for libraries (embedded in C#, F# and Scala). This calculus is based on 'join patterns', namely rules describing how a certain combination of values

**Citation:** Ciobanu, G. A Hypergraph Model for Communication Patterns. *Axioms* **2022**, *11*, 8. https://doi.org/ 10.3390/axioms11010008

Academic Editor: Cristian S. Calude

Received: 30 October 2021 Accepted: 2 December 2021 Published: 23 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

sent through multiple channels triggers a specific reaction and removes the values from the communication channels. Interaction in such a calculus is provided by sharing the communication channels names.

We introduce the pattern calculus as a weak version of join calculus. After presenting the control structures for pattern calculus, we provide a hypergraph model of these structures. The hypergraphs are able to express properly the communication patterns described by the pattern calculus. It is proved that the hypergraph model is fully abstract for the calculus; a model is fully abstract if all observationally equivalent processes represent the same object in the model, meaning also that processes with different behaviour are not mapped to the same hypergraph. Furthermore, there is a correspondence between the dynamics of the processes of the calculus and their hypergraph representation.

#### **2. Pattern Calculus**

The pattern calculus is inspired by the join calculus [2], a calculus proposed to underlie programming languages for distributed systems. A presentation of the join calculus can also be found in [3]. The specific construction of the new calculus is the definition of communication channels: def *uy P* in *Q*. To elucidate the simplicity of this syntactical construction, let us say that it could be expressed in the *π*-calculus [4] by using several syntactical constructions: def *uy P* in *Q* = *νu*.(!*u*(*y*).*P* | *Q*).

The syntax of the pattern calculus is defined by using a countable set X of *names* ranging over *u*, *v*, *x*, ..., together with *u*˜, *v*˜, *x*˜, *y*˜ ... ranging over finite strings of names. We use *P*, *Q*, *R*, ... ranging over the set of processes. The set P of processes contains an *empty process* 0, as well as an *output message uv* sending *v* by using a channel *u*. The process *P* | *Q* describes the *parallel composition* of processes *P* and *Q*. The communication between processes is achieved by the *channel definition* def *uv P* in *Q* indicating that the interaction of processes *P* and *Q* is realized by the channel *u* (which is created only for the communication between them).

**Definition 1.** *The processes of our calculus are defined by the following syntax:*

*P ::=* 0 | *uv* | *P* | *Q* | def *uv P* in *Q .*

In def *uv P* in *Q*, both *u* and *v* are bound. The scope of *v* is *P*, while the scope of *u* is given by the whole definition. It is worth noting that only this definition binds names. The *free names* are defined inductively by fn(0) = ∅, fn(*uv*) = {*u*, *v*}, fn(*P* | *Q*) = fn(*P*) ∪ fn(*Q*), and fn(def *uv P* in *Q*)=(fn(*Q*) ∪ (fn(*P*) − {*v*})) − {*u*}.

A substitution {*y*/*x*}*P* replaces all the free occurrences of name *x* in *P* by name *y*; name-capture is avoided by using the *α*-conversion (defined in the standard way).

**Definition 2.** *A* structural congruence ≡⊆ P×P *is defined as the smallest congruence satisfying the following axioms:*


The evolution of the processes is given by a reduction relation → . For the specific construct def *uy P* in *Q*, the reduction is described mainly by: def *uy P* in *Q* | *uv* → def *uy P* in *Q* | {*v*/*y*}*P*.

More exactly, process *Q* can send a name *v* along the channel *u*, while process *P* waits at the other end of channel *u* to receive certain channel names. When the name *v* is received, process *Q* continues its execution in parallel with process *P* in which all free occurrences

of *y* are replaced by *v*, i.e., {*v*/*y*}*P*. Then, channel *u* remains open to receive other names. The formal definition is given below.

**Definition 3.** *The* reduction relation →⊆ P × P *is defined as the smallest relation satisfying:*

r1*:* def *u*1*v*1 *Q*<sup>1</sup> in def *u*2*v*2 *Q*<sup>2</sup> in ... def *unvn Qn* in (*P* | *uiv*) → def *u*1*v*1 *Q*<sup>1</sup> in def *u*2*v*2 *Q*<sup>2</sup> in ... def *unvn Qn* in (*P* | {*v*/*vi*}*Qi*) *if* {*ui*+1,..., *un*} ∩ (fn(*Qi*) ∪ {*ui*}) = ∅ *with i* ∈ [*n*] *and n* ≥ 1

$$\begin{array}{ll} \text{r2:} & P\_1 \to P\_2\\ \text{r2:} & \overline{\text{def } u \langle v \rangle \rhd Q \text{ in } P\_1 \to \text{def } u \langle v \rangle \rhd Q \text{ in } P\_2} \\\text{r3:} & \frac{P\_1 \equiv Q\_1, \ Q\_1 \to Q\_2 \text{ and } Q\_2 \equiv P\_2}{P\_1 \to P\_2} . \end{array}$$

It is worth noting that there is no rule for parallel composition in the definition of this reduction. The following (easy-to-prove) results show that such a rule for parallel composition is just a consequence.

**Lemma 1.** *Considering any substitution σ* = {*x*/*y*}*, P* ≡ *Q implies σP* ≡ *σQ, and P*<sup>1</sup> → *P*<sup>2</sup> *implies σP*<sup>1</sup> → *σP*2*.*

**Proposition 1.** *P*<sup>1</sup> → *P*<sup>2</sup> *implies Q* | *P*<sup>1</sup> → *Q* | *P*2*.*

#### **3. Hypergraphs**

In the theory of distributed systems, Petri nets [5] and *π*-nets [6] provide both algebraic and graphical descriptions for concurrent systems. Compared to Petri nets, our hypergraph model for pattern calculus has a flexible structure; compared to *π*-nets, the hypergraph model is simpler, but still able to describe a large class of processes.

Following [7], we present the definitions for hypergraphs and some standard related notions such as isomorphism and contractions (on nodes and on edges). For a set *S* of *hyperedges* and a set *V* of *vertices*, it is defined an *incidence* relation *E* ⊆ *S* × *V*. A *rooted hypergraph* is a tuple *H* = *S*, *V*, *E*,*s*, where *s* ∈ *S* is the *root hyperedge*. For a hypergraph *H*, we use the notations *SH*, *VH*, *EH* and *sH*.

The graphical presentation of a hypergraph H is provided by:


**Example 1.** *Considering a hypergraph with SH* = {*s*, *t*, *t* }*, VH* = {*v*, *w*, *w* }*, EH* = {(*s*, *v*), (*t*, *v*),(*t*, *w*),(*t* , *v*),(*t* , *w* )} *and sH* = {*t*}*, various graphical representations are depicted in Figure 1. The left representation uses only lines of non-zero length, while the right one uses only lines of zero length. The representation in the middle is a compromise (between lengths) to provide a reasonable picture.*

**Figure 1.** Graphical representations of a hypergraph.

For a given rooted hypergraph *H* and a nonempty subset *W* ⊆ *VH* of nodes, a *contraction on vertices* is specified by the hypergraph *H*/*W* with the same root hyperedge (*sH*/*<sup>W</sup>* = *sH*), the same hyperedges (*SH*/*<sup>W</sup>* = *SH*), but with *VH*/*<sup>W</sup>* = (*VH* \ *W*) ∪ {*v*} for a fresh *v* ∈ *VH* and *EH*/*<sup>W</sup>* = (*EH* \ *SH* × *W*) ∪ { (*t*, *v*) | {*t*} × *W* ∩ *EH* = ∅ }.

For a given rooted hypergraph *H* and a nonempty subset *T* ⊆ *SH* of hyperedges, a *contraction on hyperedges* is specified by the hypergraph *H*/*T* with the same set of vertices (*VH*/*<sup>T</sup>* = *VH*), but with *SH*/*<sup>T</sup>* = (*SH* \ *T*) ∪ {*t*} for a fresh *t* ∈ *SH*, and *EH*/*<sup>T</sup>* = (*EH* \ *T* × *VH*) ∪ { (*t*, *v*) | *T* × {*v*} ∩ *EH* = ∅ }. Regarding the root hyperedge *sH*/*T*, if *sH* ∈ *T* then *sH*/*<sup>T</sup>* = *t*, otherwise it remains the same *sH*.

**Example 2.** *Considering two vertices v*, *w* ∈ *VH, we denote by Hv*=*<sup>w</sup> the contraction on vertices in H*/{*v*, *w*}*. For two hyperedges s*, *t* ∈ *SH, we denote by Hs*=*<sup>t</sup> the contraction on hyperedges in H*/{*s*, *t*}*. For the hypergraph H used in the previous example, the contraction on vertices Hw*<sup>=</sup>*w and the contraction on hyperedges Ht*<sup>=</sup>*t are depicted in Figure 2.*

**Figure 2.** A contraction on vertices (**left**), and a contraction on hyperedges (**right**).

The *isomorphism* between two hypergraphs *H* and *H* is defined by two bijections *φ<sup>S</sup>* : *SH* → *SH* and *φ<sup>V</sup>* : *VH* → *VH* which satisfy *φS*(*sH*) = *sH* and (*s*, *v*) ∈ *EH* if and only if (*φS*(*s*), *φV*(*v*)) ∈ *EH* for all *s* ∈ *SH* and *v* ∈ *VH*. In such a situation, we say that hypergraphs *H* and *H* are isomorphic (denoted by *H* = *H* ).

The isomorphism relation is an equivalence over hypergraphs. The names of hyperedges and vertices do not play any role in the isomorphism of hypergraphs. For the graphical representation of an equivalence class, it can be used any hypergraph (after removing the names of hyperedges and vertices).

#### **4. Control Structure for Pattern Calculus**

Milner proposed the control structures and action calculi as a unifying framework for the models of concurrent systems in [8]. A control structure defines the static aspects of a process calculus, while the corresponding action calculus describes various models of interactive behaviours. Regarding the behaviour, distinct action calculi differ only in their generators (called controls). Thus, the previously mentioned Petri nets and *π*-nets, as well as our hypergraph model, differ only in their generators. Analyzing these generators, it is possible to compare and classify the formal models for concurrent systems. Moreover, by selecting some specific generators, it is possible to combine existing models in order to obtain a new desired model.

The control structures presented here follow the definitions of [9]. Essentially, a control structure is defined by a set of terms, an equational theory, and a reduction relation over terms. This fact is condensed in the following expression:

#### *ControlStructure* = *Actions* + *EquationalTheory* + *Reaction*.

From an algebraic viewpoint, a control structure is a symmetric strict monoidal category with an additional structure [10]. The morphisms of the symmetric strict monoidal category correspond to the terms of the control structure; they are denoted by *a*, *b*, *c*, ... and called *actions*.

The control structure uses an enumerable set X of *names* together with a signature (*P*, K) in which *P* is a set of prime arities and K is a set of control operators. Every name *x* ∈ X has a prime arity *p* ∈ *P*, and this is denoted by *x* : *p*. Each control *K* ∈ K has an arity rule. In addition to the specific control operators, every control structure contains a *datum* operator *x* :  → *p* (where *x* : *p*) and a *discard* operator *ω<sup>p</sup>* : *p* → , as well as an *abstractor* operator ab*<sup>x</sup> a* : *p* ⊗ *m* → *p* ⊗ *n* (where *x* : *p* and *a* : *m* → *n*). The equational theory is the same for all control structures. To express the evolution, a set *R* of *reaction rules* is used; reaction rules are ordered pairs of terms with the same arity.

Each action *a* possesses a *surface* surf(*a*) = {*x* ∈ *X* | ∃*p*.*x* : *p* and ab*<sup>x</sup> a* = id*<sup>p</sup>* ⊗ *a*}.

The equality = between actions is valid whenever the equation *a* = *b* could be proved by using the axioms of the control structure; otherwise *a* = *b*.

We present here some results used later in the proofs of our results.

**Proposition 2.** *The following properties hold in any control structure:*

surf(*x*) ⊆ {*x*} surf(*ω*) = ∅ surf(*a* ⊗ *b*) ⊆ surf(*a*) ∪ surf(*b*).

*The following properties hold in any control structure, whenever x* ∈ surf(*c*)*:*

$$\mathtt{surt}(\mathtt{id}) = \bigcirc \mathtt{surt}(\mathtt{p}) = \bigcirc \mathtt{surt}(a \cdot b) \subseteq \mathtt{surt}(a) \cup \mathtt{surt}(b).$$

*Additionally,*


**Proposition 3.** *The following properties are provable in any control structure:*

*1.* [*x*/*y*](*a* · *b*)=[*x*/*y*]*a* · [*x*/*y*]*b;*

*2.* [*x*/*y*](*a* ⊗ *b*)=[*x*/*y*]*a* ⊗ [*x*/*y*]*b; 3.* [*x*/*y*](*z*)*a* = (*z*)[*x*/*y*]*a if z* ∈ {*x*, *y*}*;*

*4.* [*x*/*y*](*x*)*a* = (*w*)[*x*/*y*][*w*/*x*]*a if w* ∈ surf(*a*) ∪ {*x*, *y*} *and x* = *y.*

We define the control structure for our pattern calculus, emphasizing on its actions. We also present a graphical representation for its processes. The monoid (N, +, 0) of the natural numbers provides the arity monoid of the control structure, with *m*, *n*, *k*, ... ranging over natural numbers, and [*n*] = {1, 2, ... , *n*} denoting the first *n* natural numbers. The (unique) prime arity 1 is associated with each name *x* ∈ X . For a number *k* and a function *f* : [*n*] → *Y*, we define *k* ⊕ *f* : {*k* + 1, ... *k* + *n*} → *Y* by (*k* ⊕ *f*)(*i*) = *f*(*i* − *k*). Following [9], the control structure is defined over the set X = {*zi* | *i* ∈ N} of names using *x*, *y*, *u*, ... as meta-variables.

Regarding the actions of the control structure for our calculus, they are given by enriched hypergraphs called shortly *pattern nets*. An action *a* = (*H*, Σ) with arity *m* → *n* is given by a hypergraph *H* together with its decoration Σ = I, O, *λ*, *τ*, *μ* consisting of:


We can look at these functions as multisets over *SH* × *VH* × *VH*. We denote by {*x*, *y*, *y*} a multiset *μ* over {*x*, *y*, *z*} such that *μ*(*x*) = 1, *μ*(*y*) = 2 and *μ*(*z*) = 0; we use the standard multiset operations over these functions: (%, −, . . .).

We extend in a straightforward way the isomorphism and contraction introduced for hypergraphs. Considering *ai* = (*Hi*, Σ*i*) with Σ*<sup>i</sup>* = I*i*, O*i*, *λi*, *τi*, *μi* (*i* ∈ [2]), the nets *a*<sup>1</sup> and *a*<sup>2</sup> are isomorphic if there is a hypergraph isomorphism (*φS*, *φV*) between *H*<sup>1</sup> and *H*<sup>2</sup> such that *φ<sup>V</sup>* ◦ I<sup>1</sup> = I2, *φ<sup>V</sup>* ◦ O<sup>1</sup> = O2, *φ<sup>V</sup>* ◦ *λ*<sup>1</sup> = *λ*2, and (*v*, *v* ) ∈ *τ*<sup>1</sup> if and only if (*φV*(*v*), *φV*(*v* )) ∈ *τ*2, together with *μ*1(*s*, *v*, *v* ) = *μ*2(*φS*(*s*), *φV*(*v*), *φV*(*v* )) for all *s* ∈ *SH*<sup>1</sup> and *v*, *v* ∈ *VH*<sup>1</sup> .

For the graphical representations of the pattern nets, let us consider a generic net *a* = (*H*, Σ) with Σ = I, O, *λ*, *τ*, *μ*; the hypergraph *H* is presented by assuming that its lines are of length zero (see Figure 1):


As for hypergraphs, isomorphic nets are not distinguished. The names of vertices and hyperedges do not play any role in the isomorphic nets, and so the graphical representation of an isomorphic (equivalence) class of pattern nets is given by any net of the class after removing the names of vertices and hyperedges.

> *x* <1>

(1)

<1>

The *control structure operators* for our pattern nets are:


The three *controls* generating the pattern nets are:

– *<sup>ν</sup><sup>γ</sup>* = (*H*, <sup>Σ</sup>) : 0 <sup>→</sup> 1 defined by *H* = {*s*}, {*v*}, {(*s*, *v*)},*s* and Σ = ∅, {1 &→ *v*}, ∅, ∅, ∅ <1> – out*<sup>γ</sup>* = (*H*, <sup>Σ</sup>) : 2 <sup>→</sup> 0 defined by *H* = {*s*}, {*v*, *v* }, {(*s*, *v*),(*s*, *v* )},*s* and Σ = ∅, {1 &→ *v*, 2 &→ *v* }, ∅, ∅, {(*s*, *v* , *<sup>v</sup>*)} <2> – If *a* = (*H*, Σ) : 1 → 0 and Σ = I, O, *λ*, *τ*, *μ*, then def*<sup>γ</sup> a* = (*H* , Σ ) : 1 → 0, where *H* = *SH* ∪ {*t*}, *VH* ∪ {*v*}, *EH* ∪ {(*t*, *v*)}, *t*, for fresh *t* ∈ *SH* and *v* ∈ *VH*, and Σ = {1 &→ *v*}, O, *λ*, *τ* ∪ {(*v*, I(1))}, *μ*.

The *equational theory* is defined by the following operators.

Let us consider the nets *ai* = (*Hi*, Σ*i*) with Σ*<sup>i</sup>* = I*i*, O*i*, *λi*, *τi*, *μi* and *λ<sup>i</sup>* : *Zi* → *VHi* , where *i* ∈ [2]. Without loss of generality, we consider *sH*<sup>1</sup> = *sH*<sup>2</sup> = *s*. (*SH*<sup>1</sup> − {*sH*<sup>1</sup> }) ∩ (*SH*<sup>2</sup> − {*sH*<sup>2</sup> }) = ∅ and *λ*1(*z*) = *λ*2(*z*) ∀*z* ∈ *Z*<sup>1</sup> ∩ *Z*2, as well as (*VH*<sup>1</sup> − *λ*1(*Z*<sup>1</sup> ∩ *Z*2)) ∩ (*VH*<sup>2</sup> − *λ*2(*Z*<sup>1</sup> ∩ *Z*2)) = ∅.

– *Identity* id*<sup>γ</sup> <sup>m</sup>* = (*H*, Σ) : *m* → *m* defined by *H* = {*s*}, {*vi*|*i* ∈ [*m*]}, {(*s*, *vi*)|*i* ∈ [*m*]},*s* and Σ = {*i* &→ *vi*|*i* ∈ [*m*]}, {*i* &→ *vi*|*i* ∈ [*m*]}, ∅, ∅, ∅ (1) <1> . . . (m) <m> – *Symmetry* p*<sup>γ</sup> <sup>m</sup>*,*<sup>n</sup>* = (*H*, Σ) : *m* + *n* → *n* + *m* defined by *H* = {*s*}, {*vi*|*i* ∈ [*m* + *n*]}, {(*s*, *vi*)|*i* ∈ [*m* + *n*]},*s* Σ = {*i* &→ *vi*|*i* ∈ [*m* + *n*]}, {*i* &→ *vm*+*i*|*i* ∈ [*n*]} ∪ {*n* + *i* &→ *vi*|*i* ∈ [*m*]}, ∅, ∅, ∅ (1) <n+1> . . . (m) <n+m> (m+1) <1> . . . (m+n) <n>

– *Tensorial product a*<sup>1</sup> ⊗ *a*<sup>2</sup> : *m* + *k* → *n* + *l* of two nets *a*<sup>1</sup> : *m* → *n* and *a*<sup>2</sup> : *k* → *l* is obtained by combining them as follows: in *a*2, the input labels are incremented by *m* and the output labels are incremented by *n*; then overlap the two roots and the vertices of *a*<sup>1</sup> and of *a*<sup>2</sup> with the same name. Formally, *a*<sup>1</sup> ⊗ *a*<sup>2</sup> = (*H*, Σ), where

$$H = \langle \mathcal{S}\_{H\_1} \cup \mathcal{S}\_{H\_2}, V\_{H\_1} \cup V\_{H\_2}, E\_{H\_1} \cup E\_{H\_2}, \mathbf{s} \rangle \text{ and } \mathbf{s}$$

Σ = I<sup>1</sup> ∪ *m* ⊕ I2, O<sup>1</sup> ∪ *n* ⊕ O2, *λ*<sup>1</sup> ∪ *λ*2, *τ*<sup>1</sup> ∪ *τ*2, *μ*<sup>1</sup> % *μ*2.

– *Composition a*<sup>1</sup> · *a*<sup>2</sup> : *m* → *k* of two nets *a*<sup>1</sup> : *m* → *n* and *a*<sup>2</sup> : *n* → *k* is obtained by combining them as follows: overlap the two roots and vertices of *a*<sup>1</sup> and *a*<sup>2</sup> with the same name; for every *i* ∈ [*n*], overlap the vertex labelled *i* in *a*<sup>1</sup> with the vertex labelled (*i*) in *a*2, and then remove the labels (*i*) and *i*.

Formally, *a*<sup>1</sup> · *a*<sup>2</sup> = (*H*, Σ)O1(1)=I2(1),...,O1(*n*)=I2(*n*), where

$$H = \langle \mathbb{S}\_{H\_1} \cup \mathbb{S}\_{H\_2}, V\_{H\_1} \cup V\_{H\_2}, E\_{H\_1} \cup E\_{H\_2}, s \rangle \text{ and}$$

$$\Sigma = \langle \mathbb{T}\_1, \mathbb{O}\_2, \lambda\_1 \cup \lambda\_2, \mathbb{T}\_1 \cup \mathbb{T}\_2, \mu\_1 \oplus \mu\_2 \rangle.$$

– *Abstractor.* Let us consider a net *a* = (*H*, Σ) : *m* → *n* with Σ = I, O, *λ*, *τ*, *μ*.

Then ab*<sup>γ</sup> <sup>x</sup> a* : 1 + *m* → 1 + *n* is obtained from *a* in the following steps: increment all the input and output labels by 1; assign both the input label (1) and the output label 1 to vertex *x*, and then remove the label *x*. Formally, ab*<sup>γ</sup> <sup>x</sup> a* = (*H*, Σ ), where

$$\Sigma' = \langle \{ 1 \mapsto \lambda(\mathbf{x}) \} \cup \mathbf{1} \oplus \mathbf{1}, \{ 1 \mapsto \lambda(\mathbf{x}) \} \cup \mathbf{1} \oplus \mathbf{0}, \lambda - \{ \mathbf{x} \mapsto \lambda(\mathbf{x}) \}, \pi, \mu \rangle \dots$$

In general, these operators over the pattern nets are well-defined. However, the abstractor ab*<sup>γ</sup> <sup>x</sup> a* is not well-defined if a vertex labelled by *x* is not contained in the net *a*. To avoid such a situation, we adjust the definition of the above operators by

$$\operatorname{op}(a,\dots) \stackrel{def}{=} \operatorname{op}^\gamma(a \otimes^\gamma \mathbf{i}, \dots) \otimes^\gamma \mathbf{i}\prime$$

where op stands for each operator defined above, and **i** = (*H*, Σ) is the pattern net

$$H = \langle \{s\}, \{v\_i | i \in \mathbb{N}\}, \{(s, v\_i) | i \in \mathbb{N}\}, s \rangle$$

$$\Sigma = \langle \bigotimes\_{} \bigotimes\_{} \{z\_i \mapsto v\_i | i \in \mathbb{N}\}, \bigotimes\_{} \bigotimes\_{}$$

Following [9], it is not difficult to prove the following result.

**Proposition 4.** *The operators x, ω, ν,* out*,* def*,* id*,* p*,* ·*,* ⊗ *and* ab*<sup>x</sup> define a control structure.*

The actions of this control structure determine the *hypergraph model* for the pattern calculus. We actually use the derived control operators:

$$\begin{array}{rcl} \mathtt{out}\_{\mathsf{u}} & \stackrel{def}{=} & (\langle \mathsf{u} \rangle \otimes \mathsf{id}\_{1}) \cdot \mathsf{out};\\ \mathtt{def}\_{\mathsf{u}}a & \stackrel{def}{=} & \langle \mathsf{u} \rangle \cdot \mathsf{def}\ a. \end{array}$$

**The reaction** ( is the smallest relation over the pattern nets closed under equality, composition, tensorial product and abstraction which satisfies the control rule

$$\mathsf{out}\_{\mathsf{u}} \otimes \mathsf{def}\_{\mathsf{u}} a \searrow\_{\mathsf{u}} a \otimes \mathsf{def}\_{\mathsf{u}} a.$$

The corresponding graphical description of the reaction rule is given by:

In this diagram, the scope of the def operator is represented as a gray patch; due to the properties derived from the syntax of our calculus, this patch can actually be determined from the hypergraph structure.

The operators, actions and reaction complete the definition of our nets.

It is worth noting that the def operator can be generalized, namely we can have a more general control operator def*u*1...*um* by def*u*1...*um a* = (*u*1 ⊗ ... ⊗ *um*) · def *a*. Moreover, the corresponding graphical representation is extended by using *m* external arcs to connect the new root hyperedge to the old one. The corresponding reaction is generalized in the following way: out*u*<sup>1</sup> ⊗ ... ⊗ out*um* ⊗ def*u*1...*um a* ( *a* ⊗ def*u*1...*um a*.

We present some proprieties of the pattern nets. The proofs of these properties are tedious (but easy), based mainly on definitions and the structure of the nets.

**Lemma 2.** *We have the following properties:*

	- *either there exists i* ∈ [3] *such that ai* ( *b and c* = *b* ⊗ *aj* ⊗ *ak, or*
	- *there exist i*, *j* ∈ [3] *such that ai* ⊗ *aj* ( *b and c* = *b* ⊗ *ak, where* [3] = {*i*, *j*, *k*}*.*

*7. ν* · (*x*)*a* ( *b iff a* ( *a and b* = *ν* · (*x*)*a .*

#### **5. Fully Abstract Hypergraph Model of the Pattern Calculus**

This section presents the main results of the paper. These results reveal the hypergraphs as a fully abstract model for the pattern calculus. According to [11], a model is fully abstract if all observationally equivalent terms in the object language represent the same object in the model. This means that processes with different behaviour are not mapped to the same hypergraph. Moreover, we prove a correspondence between the reduction of the processes and the reduction of their hypergraph representation.

**Definition 4.** *The semantic relationship* [[ − ]] *between the pattern calculus processes and the pattern nets is defined by structural induction as follows:*


We prove some results involving this semantic relationship [[ − ]] .

**Lemma 3.** *For every process P* ∈ P*, we have* [[ *P* ]] : 0 → 0 *.*

**Proof.** A simple induction on the structure of *P*. In the case of our nets, 0 is the neutral element of the arity monoid (N, +, 0). For case (4) of the previous definition, we use the discard operator *ω* instead of *ωp*. Since 1 is the only prime arity *p* of the monoid (N, +, 0), we omit the index without any risk of confusion.

**Lemma 4.** *For every process P* ∈ P*, we have* surf( [[ *P* ]] ) ⊆ fn(*P*)*.*

**Proof.** By induction on the structure of *P* (the proof uses Lemma 2).

**Lemma 5.** *For two names x*, *y* ∈ *X and a process P* ∈ P*, we have* [[ {*x*/*y*}*P* ]] = [*x*/*y*] [[ *P* ]] *.*

**Proof.** Induction on the definition of the substitution over processes (and Lemma 5).

**Proposition 5.** *If P* ≡ *Q, then* [[ *P* ]] = [[ *Q* ]] *.*

**Proof.** Induction on the definition of structural congruence. Let us consider the relation

$$\sim = \{ (P, Q) \in \mathcal{P} \mid P \equiv Q \text{ and } \nmid P \parallel = \llbracket Q \rrbracket \}.$$

Proof is reduced to the equality between ∼ and ≡. Obviously, ∼⊆≡. We show that ∼ satisfies the axioms from the definition of ≡. Since ≡ is the smallest relation satisfying these axioms, it follows that ≡⊆∼, and so ∼=≡. Thus, to prove that ≡⊆∼, it is enough to verify that ∼ satisfies the axioms from the definition of ≡.

The cases *P* | 0 ≡ *P*, *P* | *Q* ≡ *Q* | *P* and (*P* | *Q*) | *R* ≡ *P* | (*Q* | *R*) are rather trivial, based on the fact that id<sup>0</sup> is neutral for tensor product, together with the commutativity and associativity of tensor product ⊗ in the equational theory (of the control structures).

Let us consider the other cases.

– def *uv P* in *Q* ≡ def *ut* {*t*/*v*}*P* in *Q*, if *t* ∈ fn(*P*). Assume *t* ∈ fn(*P*). By Lemma 4, it follows that *t* ∈ surf( [[ *P* ]] ). Then, [[ def *ut* {*t*/*v*}*P* in *Q* ]] =


– def *uv P* in *Q* ≡ def *wv* {*w*/*u*}*P* in {*w*/*u*}*Q* if *v* ∈ {*u*, *w*}, *w* ∈ fn(*P* | *Q*). Assume *v* ∈ {*u*, *w*} and *w* ∈ fn(*P* | *Q*); then, *u* = *v* and *w* ∈ fn(*P*) ∪ fn(*Q*) ∪ {*v*}. By Lemma 4, *w* ∈ surf( [[ *P* ]] ) ∪ surf( [[ *Q* ]] ). If *u* = *w*, then the result is trivial. Let us assume that *u* = *w*.

[[ def *wv* {*w*/*u*}*P* in {*w*/*u*}*Q* ]] =

= *ν* · (*w*)( [[ {*w*/*u*}*Q* ]] ⊗ def*<sup>w</sup>* (*v*) [[ {*w*/*u*}*P* ]] ) by Lemma 5 = *ν* · (*w*)([*w*/*u*] [[ *Q* ]] ⊗ def*<sup>w</sup>* (*v*)[*w*/*u*] [[ *P* ]] ) by Proposition 3 and Lemma 2 = *ν* · (*w*)[*w*/*u*]( [[ *Q* ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P* ]] ) by Lemma 2 = [[ def *uv P* in *Q* ]] .

– *Q*<sup>1</sup> | def *uv P* in *Q*<sup>2</sup> ≡ def *uv P* in (*Q*<sup>1</sup> | *Q*2) if *u* ∈ fn(*Q*1). Assume *u* ∈ fn(*Q*1). By Lemma 4, *u* ∈ surf( [[ *Q*<sup>1</sup> ]] ). Then, [[ def *uv P* in (*Q*<sup>1</sup> | *Q*2)]] =

= *ν* · (*u*)( [[ *Q*<sup>1</sup> ]] ⊗ [[ *Q*<sup>2</sup> ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P* ]] ) by Lemma 3 and Proposition 2 = [[ *Q*<sup>1</sup> | def *uv P* in *Q*<sup>2</sup> ]] .

– def *uv P*<sup>1</sup> in def *wt P*<sup>2</sup> in *Q* ≡ def *wt P*<sup>2</sup> in def *uv P*<sup>1</sup> in *Q* if *u* = *w*, *u* ∈ fn(*P*2), and *w* ∈ fn(*P*1).

Assume *u* = *w*, *u* ∈ fn(*P*2) and *w* ∈ fn(*P*1). By Lemma 4, it follows that *u* ∈ surf( [[ *P*<sup>2</sup> ]] ) and *w* ∈ surf( [[ *P*<sup>1</sup> ]] ). Furthermore, by Lemma 2, *w* ∈ surf(def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] . [[ def *uv P*<sup>1</sup> in def *wt P*<sup>2</sup> in *Q* ]] =

= *ν* · (*u*)(*ν* · (*w*)( [[ *Q* ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>2</sup> ]] ) ⊗ def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] ) by Proposition 2 = *ν* · (*u*)(*ν* · (*w*)( [[ *Q* ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>2</sup> ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] )) by Proposition 2 = (*ν* ⊗ *ν*) · (*u*)(*w*)( [[ *Q* ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>2</sup> ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] ) **= X**. In a similar way, we obtain [[ def *wt P*<sup>2</sup> in def *uv P*<sup>1</sup> in *Q* ]] = = (*ν* ⊗ *ν*) · (*w*)(*u*)( [[ *Q* ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>2</sup> ]] ) **= Y**. To complete the proof, it remains to prove that **X** = **Y**. **X** = by Proposition 2 = (*ν* ⊗ *ν*) · p1,1 · (*w*)(*u*)( [[ *Q* ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>2</sup> ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] ) = p0,0 · (*ν* ⊗ *ν*) · (*w*)(*u*)( [[ *Q* ]] ⊗ def*<sup>u</sup>* (*v*) [[ *P*<sup>1</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>2</sup> ]] ) = **Y**.

**Theorem 1.** *If P* → *Q, then* [[ *P* ]] ( [[ *Q* ]] *.*

**Proof.** By induction on the definition of *P* → *Q*. \* r1: *P* → *Q* is def *u*1*y*1 *Q*<sup>1</sup> in def *u*2*y*2 *Q*<sup>2</sup> in ... def *unyn Qn* in *R* | *uiv* → def *u*1*y*1 *Q*<sup>1</sup> in def *u*2*y*2 *Q*<sup>2</sup> in ... def *unyn Qn* in *R* | {*v*/*yi*}*Qi*, where {*ui*+1, ... , *un*} ∩ (fn(*Qi*) ∪ {*ui*}) = ∅, *i* ∈ [*n*], and *n* ≥ 1. According to Lemma 2 and Lemma 4, {*ui*+1, ... , *un*} ∩ surf(def*ui* (*yi*) [[ *Qi* ]] ) = ∅. According to Proposition 2 and using the compatibility of ( with composition, tensorial product and abstraction, [[ *P* ]] = *ν* · (*u*1)(def*u*<sup>1</sup> (*y*1) [[ *Q*<sup>1</sup> ]] ⊗ <sup>=</sup> . . . *ν* · (*ui*)(def*ui* (*yi*) [[ *Qi* ]] ⊗ . . . *ν* · (*un*)(def*un* (*yn*) [[ *Qn* ]] ⊗ [[ *R* ]] ⊗ *v* · out*ui* )...)...) = *ν* · (*u*1)(def*u*<sup>1</sup> (*y*1) [[ *Q*<sup>1</sup> ]] ⊗ by Lemma 2 . . . *<sup>ν</sup>* · (*ui*−1)(def*ui*−<sup>1</sup> (*yi*−1) [[ *Qi*−<sup>1</sup> ]] ⊗ *ν* · (*ui*)( *ν* · (*ui*+1)(def*ui*+<sup>1</sup> (*yi*+1) [[ *Qi*+<sup>1</sup> ]] ⊗ . . . *ν* · (*un*)(def*un* (*yn*) [[ *Qn* ]] ⊗ [[ *R* ]] ⊗ *v* · out*ui* ⊗ def*ui* (*yi*) [[ *Qi* ]] )...)))...) ( *ν* · (*u*1)(def*u*<sup>1</sup> (*y*1) [[ *Q*<sup>1</sup> ]] ⊗ by Lemma 5 . . . *ν* · (*ui*)(def*ui* (*yi*) [[ *Qi* ]] ⊗ . . . *ν* · (*un*)(def*un* (*yn*) [[ *Qn* ]] ⊗ [[ *R* ]] ⊗ [*v*/*yi*] [[ *Qi* ]] )...)...) = [[ *Q* ]] .

\* r2: *P* → *Q* is def *uv R* in *P* → def *uv R* in *Q* with *P* → *Q* .

By induction, [[ *P* ]] ( [[ *Q* ]] . Since ( is closed under composition, tensor and abstraction, it follows that

$$\llbracket \llbracket P \rrbracket \rrbracket = \nu \cdot (u) (\llbracket \rrbracket \rrbracket \otimes \mathtt{def}\_{u}(v) \llbracket \llbracket \mathbb{R} \rrbracket \rrbracket) \mathop{\backslash}\_{\scriptscriptstyle{\mathsf{L}}} \nu \cdot (u) (\llbracket \mathbb{Q}' \rrbracket \otimes \mathtt{def}\_{u}(v) \llbracket \mathbb{R} \rrbracket) = \llbracket \mathbb{Q} \rrbracket \rrbracket.$$

\* r3: *P* → *Q* with *P* ≡ *P* , *P* → *Q* and *Q* ≡ *Q*.

By the induction hypothesis, [[ *P* ]] ( [[ *Q* ]] . By Proposition 5, we have [[ *P* ]] = [[ *P* ]] and [[ *Q* ]] = [[ *Q* ]] . Since ( is closed under equality, then [[ *P* ]] ( [[ *Q* ]] .

$$\mathsf{Lemma 6. } \langle v \rangle \cdot \mathsf{out}\_{\mathsf{u}} \otimes \, \| \, \mathsf{P} \| \, \geq\_{\mathsf{x}} a \quad \text{iff} \quad \mathsf{f} \\ P \parallel \; \geq\_{\mathsf{x}} b \; \mathsf{and} \; a = \langle v \rangle \cdot \mathsf{out}\_{\mathsf{u}} \otimes b.$$

**Proof.** (⇐) A consequence of the fact that the reaction is closed under tensorial product and equality.

(⇒) Induction on the structure of *P*.

	- (1) [[ *Pi* ]] ( *b* and *a* = *v* · out*<sup>u</sup>* ⊗ *b* ⊗ [[ *Pj* ]] ;
	- (2) [[ *Pi* ]] ⊗ [[ *Pj* ]] ( *b* and *a* = *v* · out*<sup>u</sup>* ⊗ *b* ;

(3) *v* · out*<sup>u</sup>* ⊗ [[ *Pi* ]] ( *a* and *a* = *a* ⊗ [[ *Pj* ]] , where {*i*, *j*} = [2].

Note that by Proposition 2, we have [[ *P* ]] = [[ *Pi* ]] ⊗ [[ *Pj* ]] .

In case (1), [[ *P* ]] ( *b* ⊗ [[ *Pj* ]] , and we consider *b* = *b* ⊗ [[ *Pj* ]] . In case (2), we take *b* = *b* . In case (3), by induction, we have [[ *Pi* ]] ( *b* and *a* = *v* · out*<sup>u</sup>* ⊗ *b* . Thus, [[ *P* ]] ( *b* ⊗ [[ *Pj* ]] , considering *b* = *b* ⊗ [[ *Pj* ]] .

	- (1) [[ *P*<sup>2</sup> ]] ( *b* and *a* = *v* · out*<sup>u</sup>* ⊗ *b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ;
	- (2) [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ( *b* and *a* = *v* · out*<sup>u</sup>* ⊗ *b* ;
	- (3) *v* · out*<sup>u</sup>* ⊗ [[ *P*<sup>2</sup> ]] ( *a* and *a* = *a* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] .

In case (1), [[ *P* ]] = *ν* · (*w*)( [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ) ( *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ). Considering *b* = *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ), it satisfies the requirements (according to Proposition 2). In case (2), we have [[ *P* ]] ( *ν* · (*w*)*b* , and consider *b* = *ν* · (*w*)*b* . In case (3), by induction hypothesis, [[ *P*<sup>2</sup> ]] ( *b* and *a* = *v* · out*<sup>u</sup>* ⊗ *b* . Thus, [[ *P* ]] ( *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ), and consider *b* = *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ).

**Lemma 7.** [[ *P* ]] ⊗ [[ *Q* ]] ( *a iff one of the following conditions holds: 1.* [[ *P* ]] ( *b and a* = *b* ⊗ [[ *Q* ]] *;*

*2.* [[ *Q* ]] ( *b and a* = [[ *P* ]] ⊗ *b .*

**Proof.** (⇐) A consequence of the fact that the reaction is closed under tensorial product and equality.

(⇒) Induction on the structure of *P*.


According to Proposition 2, [[ *P* ]] = [[ *Pi* ]] ⊗ [[ *Pj* ]] . In case (*i*), condition *2* holds by taking *b* = *b* . In case (*ii*), we have [[ *P* ]] ( *b* ⊗ [[ *Pj* ]] . Then, condition *1* holds by taking *b* = *b* ⊗ [[ *Pj* ]] . In case (*iii*), condition *1* holds by taking *b* = *b* .

In case (*iv*), by induction, we distinguish two sub-cases:


For (*a*), we obtain [[ *P* ]] ( *b* ⊗ [[ *Pj* ]] , and condition *1* holds for *b* = *b* ⊗ [[ *Pj* ]] . For (*b*), condition *2* holds for *b* = *b* . In both sub-cases, some action commutations are required; they are possible according to Proposition 2.

	- (*i*) [[ *P*<sup>2</sup> ]] ( *b* and *a* = *b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ⊗ [[ *Q* ]] ;

In case (*i*), condition *1* holds for *b* = *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ).

In case (*ii*), by Lemma 2, there exists *b* such that surf(*b*) ⊆ surf( [[ *Q* ]] ) and *b* = *b* ; condition *2* holds for this *b*. In case (*iii*), condition *1* holds for *b* = *ν* · (*w*)*b* .

In case (*iv*), we distinguish two sub-cases:


For (*a*), condition *1* holds for *b* = *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ). For (*b*), there exists *b* such that surf(*b*) ⊆ surf( [[ *Q* ]] ) and *b* = *b* (by Lemma 2); condition *2* holds for this *b*. Proposition 2 is used in all cases and sub-cases.

**Lemma 8.** [[ *P* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( *a iff one of the following conditions holds:*

*1.* [[ *P* ]] ( *b and a* = *b* ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] *;*

$$\text{2.} \quad P \equiv \mathbb{R} \mid \iota \langle v \rangle \text{ and } a = \ulcorner \|\mathbb{R} \mid \{v/y\} \underline{Q}\| \stackrel{\triangle}{\otimes} \mathsf{def}\_{\mathfrak{u}}(y) \|\underline{Q}\| :$$

$$\begin{array}{rcl} 3. & P \equiv \mathsf{def}\,\,\upsilon\_{1}(t\_{1}) \rhd R\_{1} \,\,\mathsf{in}\,\mathsf{def}\,\,\upsilon\_{2}(t\_{2}) \rhd R\_{2} \,\,\mathsf{in}\dots\mathsf{def}\,\,\upsilon\_{n}(t\_{n}) \rhd R\_{n} \,\,\mathsf{in}\,(\mathsf{R}\mid\,\,u(\upsilon\_{n})), \,\,\mathsf{and} \\\ a & = & \upsilon \cdot (\upsilon\_{1})(\mathsf{def}\,\,\upsilon\_{1}(t\_{1}) \,\,\|\,R\_{1}\|) \otimes \\\ & \nu \cdot (\upsilon\_{2})(\mathsf{def}\,\,\upsilon\_{2}(t\_{2}) \,\,\|\,R\_{2}\|) \otimes \\\ & & \vdots \\\ & \nu \cdot (\upsilon\_{n})(\mathsf{def}\,\,\upsilon\_{n}(t\_{n}) \,\|\,R\_{n}\|) \odot \|\,R\_{1}\| \,\|\,\mathcal{R} \mid\,\{\upsilon\_{n}/\} \,\mathcal{Y} \,\|\,\mathcal{R} \mid\, \mathsf{dot} \,\mathsf{d} \,\mathsf{f}\_{n}\,(y \,\|\,\mathcal{Y} \,\|\,\dots) \}, \\\ & \qquad \nu \cdot (\upsilon\_{n})(\mathsf{def}\,\,\upsilon\_{n}(t\_{n}) \,\|\,\mathcal{R}\_{n}\|) \odot \|\,\mathcal{R} \mid\, \mathsf{d} \,\,\|\,\iota \mid \, \mathsf{d} \,\,\mathsf{f}\_{n} \,(y \,\|\,\mathcal{Y} \,\|\,\dots) \,. \end{array}$$

*where vi* ∈ fn(*Q*) ∪ {*u*} *for every i* ∈ [*n*]*.*

**Proof.** (⇐) If condition *1* holds, then the implication follows as a consequence of the fact that the reaction is closed under tensorial product and equality. If condition *2* holds, then we have

$$\begin{array}{llll} \llbracket \, \mathbb{P} \rrbracket \, \otimes \mathtt{def}\_{\scriptscriptstyle\urly}(y) \llbracket \, \mathbb{Q} \rrbracket &=& \mbox{by Proposition 5} \\ =& \llbracket \, R \rrbracket \, \otimes \langle v \rangle \cdot \mathtt{out}\_{\scriptscriptstyle\urly} \diamond \mathtt{def}\_{\scriptscriptstyle\urly}(y) \llbracket \, \mathbb{Q} \rrbracket & \mbox{by Lemma 2} \\ \triangleright\_{\backslash} \llbracket R \rrbracket \, \otimes [v/y] \llbracket \, \mathbb{Q} \rrbracket \, \otimes \mathtt{def}\_{\scriptscriptstyle\urly}(y) \llbracket \, \mathbb{Q} \rrbracket & \mbox{by Lemma 5} \\ =& a. \end{array}$$

If condition *3* holds, it follows by Lemma 2 and Lemma 4 that *vi* ∈ surf(def*<sup>u</sup>* (*y*) [[ *Q* ]] ) for every *i* ∈ [*n*]. Then,

[[ *P* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] = by Propositions 5 and 2 = *ν* · (*v*1)(def*v*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ by Lemma 2 . . . *ν* · (*vn*)(def*vn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* ]] ⊗ *vn* · out*<sup>u</sup>* ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] )...) ( *ν* · (*v*1)(def*v*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ by Lemma 5 . . . *ν* · (*vn*)(def*vn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* ]] ⊗ [*vn*/*y*] [[ *Q* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] )...) = *a*.

(⇒) Induction on the structure of *P*.

– If *P* is the empty process 0 or a message *wv* with *w* = *u*, then [[ *P* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( . The statement of the lemma is obviously true as its premise is not satisfied. On the other hand, if *P* is a message *uv*, then

[[ *P* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( by Lemma 2 ( [*v*/*y*] [[ *Q* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( *a* by Lemma 5 = 0 | {*v*/*y*}*Q* ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] .

Furthermore, *P* ≡ 0 | *uv*. Consequently, condition *2* holds.

– If *P* is a parallel composition *P*<sup>1</sup> | *P*2, then [[ *P*<sup>1</sup> ]] ⊗ [[ *P*<sup>2</sup> ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( *a*. Since def*<sup>u</sup>* (*y*) [[ *Q* ]] ( , it follows from Lemma 2 that one of the following cases remains possible:


. . .

(*iii*) [[ *Pi* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( *a* and *a* = *a* ⊗ [[ *Pj* ]] , where {*i*, *j*} = [2].

According to Proposition 2, we obtain [[ *P* ]] = [[ *Pi* ]] ⊗ [[ *Pj* ]] . In case (*i*), we obtain [[ *P* ]] ( *b* ⊗ [[ *Pj* ]] , and condition *1* holds for *b* = *b* ⊗ [[ *Pj* ]] . In case (*ii*), condition *1* holds for *b* = *b* . In case (*iii*), we distinguish three sub-cases:


$$a' = \begin{array}{c} \upsilon \cdot (\upsilon\_1)(\mathsf{def}\_{\upsilon\_1}(t\_1) \upharpoonright \mathcal{R}\_1 \upharpoonright \otimes \mathsf{c}\_1) \end{array}$$

*ν* · (*vn*)(def*vn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* | {*vn*/*y*}*Q* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] )...), where *vk* ∈ fn(*Q*) ∪ {*u*} for every *k* ∈ [*n*].

In sub-case (*a*), we obtain [[ *P* ]] ( *b* ⊗ [[ *Pj* ]] . Therefore, condition *1* holds for *b* = *b* ⊗ [[ *Pj* ]] . For (*b*), we have *P* ≡ *R* | *Pj* | *uv*. By Proposition 2, *a* = [[ *R* | *Pj* | {*v*/*y*}*Q* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] . Thus, condition *2* holds. For sub-case (*c*), we may assume (without losing generality) that *vk* ∈ fn(*Pj*) for every *k* ∈ [*n*]. By Lemma 4, it follows that *vk* ∈ surf( [[ *Pj* ]] ) for every *k* ∈ [*n*]. Then *P* ≡ def *v*1*t*1 *R*<sup>1</sup> in ... def *vntn Rn* in (*R* | *Pj* | *uvn*), and

*a* = by Proposition 2

= *ν* · (*v*1)(def*v*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ .

.

. *ν* · (*vn*)(def*vn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* | *Pj* | {*vn*/*y*}*Q* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] )...). Thus, condition *3* holds.

– If *P* is a definition def *wt P*<sup>1</sup> in *P*2, then we can assume without losing generality that *w* ∈ fn(*Q*) ∪ {*u*}. By Lemma 4 and Lemma 2, *w* ∈ surf(def*<sup>u</sup>* (*y*) [[ *Q* ]] ). It follows from Proposition 2 that [[ *P* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] = *ν* · (*w*)( [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ⊗def*<sup>u</sup>* (*y*) [[ *Q* ]] ) ( *a*. By Lemma 2, [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( *a* and *a* = *ν* · (*w*)*a* . Since def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ( and def*<sup>u</sup>* (*y*) [[ *Q* ]] ( , then def*<sup>u</sup>* (*y*) [[ *Q* ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ( (according to Lemma 2). It follows that one of the following cases remains possible:

(*i*) [[ *P*<sup>2</sup> ]] ( *b* and *a* = *b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ;

(*ii*) [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ( *b* and *a* = *b* ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ;

(*iii*) [[ *P*<sup>2</sup> ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] ( *a* and *a* = *a* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] .

In case (*i*), condition *1* holds for *b* = *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ). In case (*ii*), condition *1* holds for *b* = *ν* · (*w*)*b* . In case (*iii*), by induction, we distinguish three sub-cases:


*a* = *ν* · (*v*1)(def*v*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ . . .

*ν* · (*vn*)(def*vn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* | {*vn*/*y*}*Q* ]] ⊗ def*<sup>u</sup>* (*y*) [[ *Q* ]] )...), where *vk* ∈ fn(*Q*) ∪ {*u*} for every *k* ∈ [*n*].

In sub-case (*a*), condition *1* holds for *b* = *ν* · (*w*)(*b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ). In sub-case (*b*), we have *P* ≡ def *wt P*<sup>1</sup> in (*R* | *uv*). We distinguish two situations:


In sub-case (*c*), *P* ≡ def *wt P*<sup>1</sup> in def *v*1*t*1 *R*<sup>1</sup> in ... def *vntn Rn* in (*R* | *uvn*). Using Proposition 2, we obtain

$$\begin{array}{rcl} a & = & \nu \cdot (w) (\mathsf{def}\_w \left( t \right) \left\| \begin{array}{c} \mathsf{I}\_1 \right\| \right) \otimes \\ \nu \cdot (v\_1) (\mathsf{def}\_{v\_1} \left( t\_1 \right) \left\| \begin{array}{c} \mathsf{I}\_1 \end{array} \right\| \otimes \\ \vdots \\ \nu \cdot (v\_n) (\mathsf{def}\_{v\_n} \left( t\_n \right) \left\| \begin{array}{c} \mathsf{I}\_n \end{array} \right\| \otimes \left\| \begin{array}{c} \mathsf{I}\_n \end{array} \right\| \otimes \left\| \begin{array}{c} \mathsf{I}\_n \left( y \right) Q \right\| \otimes \mathsf{def}\_u \left( y \right) \left\| Q \right\| \left( \right) \ldots \end{array} \right). \end{array}$$

**Theorem 2.** *If* [[ *P* ]] ( *a, then there exists a process Q such that P* → *Q and* [[ *Q* ]] = *a.*

**Proof.** Induction on the structure of *P*.

– If *P* is the empty process or a message, then [[ *P* ]] ( . Therefore, the statement of the theorem is obviously true because the premise is not satisfied.

– If *P* is a parallel composition *P*<sup>1</sup> | *P*2, then [[ *P*<sup>1</sup> ]] ⊗ [[ *P*<sup>2</sup> ]] ( *a*. By Lemma 7, one of the following cases holds:

(1) [[ *P*<sup>1</sup> ]] ( *a*<sup>1</sup> and *a* = *a*<sup>1</sup> ⊗ [[ *P*<sup>2</sup> ]] ;

(2) [[ *P*<sup>2</sup> ]] ( *a*<sup>2</sup> and *a* = [[ *P*<sup>1</sup> ]] ⊗ *a*2.

It is sufficient to consider the case (1), the other one being similar (symmetric).

By induction, we have *P*<sup>1</sup> → *Q*<sup>1</sup> and *a*<sup>1</sup> = [[ *Q*<sup>1</sup> ]] . According to Proposition 1, *P* → *Q*<sup>1</sup> | *P*<sup>2</sup> and *a* = [[ *Q*<sup>1</sup> ]] ⊗ [[ *P*<sup>2</sup> ]] . Thus, the result of the theorem holds for *Q* = *Q*<sup>1</sup> | *P*2.

– If *P* is a definition def *wt P*<sup>1</sup> in *P*2, then *ν* · (*w*)( [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ( *a*. It follows from Lemma 2 that [[ *P*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ( *a* and *a* = *ν* · (*w*)*a* . By Lemma 8, only one of the following cases holds:

(i) [[ *P*<sup>2</sup> ]] ( *b* and *a* = *b* ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ; (ii) *P*<sup>2</sup> ≡ *R* | *wv* and *a* = [[ *R* | {*v*/*t*}*P*<sup>1</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ; (iii) *P*<sup>2</sup> ≡ def *w*1*t*1 *R*<sup>1</sup> in ... def *wntn Rn* in (*R* | *wwn*) and *a* = *ν* · (*w*1)(def*w*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ . .

.

*ν* · (*wn*)(def*wn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* | {*wn*/*t*}*P*<sup>1</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] )...), where *wi* ∈ fn(*P*1) ∪ {*w*} for every *i* ∈ [*n*].

In case (*i*), by the induction hypothesis, *P*<sup>2</sup> → *Q*<sup>2</sup> and *b* = [[ *Q*<sup>2</sup> ]] . It follows that *P* → def *wt P*<sup>1</sup> in *Q*<sup>2</sup> and *a* = *ν* · (*w*)( [[ *Q*<sup>2</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ) Thus, the result of the theorem holds for *Q* = def *wt P*<sup>1</sup> in *Q*2.

In case (*ii*), we have *P* → def *wt P*<sup>1</sup> in (*R* | {*v*/*t*}*P*1) and *a* = *ν* · (*w*)( [[ *R* | {*v*/*t*}*P*<sup>1</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ) = [[ *Q* ]] . Thus, the result of the theorem holds for *Q* = def *wt P*<sup>1</sup> in (*R* | {*v*/*t*}*P*1).

In case (*iii*), it follows that *wi* ∈ surf(def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ) for any *i* ∈ [*n*] (Lemmas 2 and 4). *P* ≡ def *wt P*<sup>1</sup> in def *w*1*t*1 *R*<sup>1</sup> in ...def *wntn Rn* in (*R* | *wwn*) → def *<sup>w</sup>t <sup>P</sup>*<sup>1</sup> in def *<sup>w</sup>*1*t*1 *<sup>R</sup>*<sup>1</sup> in ... def *wntn Rn* in (*<sup>R</sup>* | {*wn*/*t*}*P*1) # \$% &

*Q a* = *ν* · (*w*)( by Proposition 2 *ν* · (*w*1)(def*w*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ . . . *ν* · (*wn*)(def*wn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* | {*wn*/*t*}*P*<sup>1</sup> ]] ⊗ def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] )...)) = *ν* · (*w*)(def*<sup>w</sup>* (*t*) [[ *P*<sup>1</sup> ]] ⊗ *ν* · (*w*1)(def*w*<sup>1</sup> (*t*1) [[ *R*<sup>1</sup> ]] ⊗ . . . *ν* · (*wn*)(def*wn* (*tn*) [[ *Rn* ]] ⊗ [[ *R* | {*wn*/*t*}*P*<sup>1</sup> ]] )...)) = [[ *Q* ]] .

#### **6. Describing Communication Patterns by Using the Hypergraph Model**

In the Unix operating system, interprocess communications based on message queues allow exchange of information between processes. The processes exchange information by accessing a common message queue. Essentially, one process produces a message queue (via a message-passing module) that other processes may access; often a server places a message onto a queue which can be read by multiple clients. The sending process may specify its type when placing the message in a queue such that the reading processes can select the appropriate message; thus, message queues provide a way of multiplexing information from one producer to more consumers.

As example, we consider a simple system in which only one channel is used to exchange messages between the server and clients, and any message at the input of any client must appear at the output of all the clients (this is a requirement for several social networks including a chat messaging system). A type associated to each message allows a client to access the (unique) message queue for selectively reading only specific messages (in a first-in–first-out manner). We simplify the system, and consider a process *S* working as a server and two clients *A* and *B*. The channels idA and idB are used to indicate the type of messages from *S* to *A* and *B*, respectively; a channel idS indicates the type of messages from the clients to the server. Client *A* uses an input channel inA and an output channel **outA**; client *B* uses channels inB and **outB**). For a message m sent along the input channel inA, the pattern calculus process corresponding to this system is:

$$\begin{array}{rcl}\mathsf{Com}m Syst = & \mathsf{def} & q\langle \mathbf{x} \rangle \mid idS\langle \mathbf{y} \rangle & \rhd & q\langle \mathbf{x} \rangle \mid idA\langle \\_ \rangle \mid q\langle \mathbf{x} \rangle \mid idB\langle \\_ \rangle & \land \\ & q\langle \mathbf{x} \rangle \mid idA\langle \mathbf{y} \rangle & \rhd & outA\langle \mathbf{x} \rangle & \land \\ & q\langle \mathbf{x} \rangle \mid idB\langle \mathbf{y} \rangle & \rhd & outB\langle \mathbf{x} \rangle & \land \\ & & \operatorname{in} A\langle \mathbf{x} \rangle & \rhd & q\langle \mathbf{x} \rangle \mid idS\langle \\_ \rangle & \land \\ & & \operatorname{in} B\langle \mathbf{x} \rangle & \rhd & q\langle \mathbf{x} \rangle \mid idS\langle \\_ \rangle \\ \texttt{in} & & \operatorname{in} A\langle m \rangle & . \end{array}$$

Using the hypergraph model, in Figure 3 is presented the net corresponding to this process.

**Figure 3.** The net of a simple communication system described previously in pattern calculus.

Except the root hyperedge, the structure of this net does not change during the evolution. Therefore, the evolution of the system could be described graphically focusing only on the root hyperedge; this evolution is depicted in Figure 4.

**Figure 4.** The evolution of the system (as it appears in the root hyperedge).

In Figure 4 it is not difficult to check visually the requirement that a message appearing at the input of a client appears also at the output of all the clients. In our case, the message m on the input channel inA (the initial step) appears at the output channels **outA** and **outB** in the final step described in Figure 4.

#### **7. Conclusions and Related Work**

In this paper we introduce a hypergraph model (given by the pattern nets) for the communication patterns. These nets provide a fully abstract model for the pattern calculus. In this way, a new sound graphical model for concurrency is introduced. We present a semantic interpretation of the pattern calculus in the framework of control structures, creating a graphical representation for the pattern calculus given by a new hypergraph model given by the pattern nets. By introducing a mapping from the control structure of pattern calculus into a set of hypergraphs, we provide a graphical model for communication patterns. It is also proved that the hypergraph model preserves the operational reductions of processes from pattern calculus and of the actions from the control structures. As an example, simple interprocess communications based on message queues inspired by the social networks are described by using our pattern nets. This example could be a first step towards more realistic scenarios in which the proposed model can be used to identify control structures supporting specific communication patterns. Future work will investigate realistic autonomic networking, mobility management, multiaccess selection, wireless and mobile networks (as they are presented in [12], for instance).

Graphical representations for process calculi highlight a new perception, providing a visual approach of concurrency and networks. According to our knowledge, just a few papers are devoted to the graphical presentations of the process calculi. We mention our previous attempts, namely the faithful *π*-nets [13], a graphical representation of the *π*-calculus machine [14], and a related approach by using jc-nets [15]. There exist also the graphical representations introduced by Robin Milner, namely action graphs and *π*-nets. Action graphs [16] are the graphical presentation of action calculi; they are very general, and so they are not able to describe specific features of certain action calculi. In the graphical presentation of the *π*-calculus given by the *π*-nets [6], channels are represented as rather complicated nodes called torpedos together with boxes representing guards, and messages are represented as directed arcs. The boxes obscure the internal nodes representing channels; to ensure access to the hidden channels, a rather complex additional mechanism of links is used. To avoid such a mechanism, in [13,14] the channels are represented by nodes, messages are represented by boxes of arcs and guards are represented by arcs between boxes. This approach simplified the graphical representation of the *π*-calculus; unfortunately, it provided

identical representations for processes with different behaviours. Fortunately, this deficiency was overtaken in the pattern calculus hypergraph model: processes with different behaviours are not mapped to the same hypergraph. The hypergraph model is presented in the same formal framework used for the *π*-nets (it is worth noting that hypergraph model avoids certain irrelevant aspects of *π*-nets). It is simpler than the *π*-nets, preserving much of their expressive power (according to [2], the join calculus has the same expressive power as the *π*-calculus). Compared with all of them, the pattern nets represent a simple but sound graphical model for concurrency, providing a fully abstract model for the pattern calculus.

**Funding:** This research received no external funding.

**Acknowledgments:** Many thanks to Mihai Rotaru for his contributions in our past collaboration.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**


### *Article* **Logarithmic SAT Solution with Membrane Computing**

**Radu Nicolescu \*,†, Michael J. Dinneen, James Cooper, Alec Henderson and Yezhou Liu**

School of Computer Science, University of Auckland, Private Bag 92019, Auckland 1142, New Zealand; mjd@cs.auckland.ac.nz (M.J.D.); jcoo092@aucklanduni.ac.nz (J.C.); ahen386@aucklanduni.ac.nz (A.H.); yliu442@aucklanduni.ac.nz (Y.L.)

**\*** Correspondence: r.nicolescu@auckland.ac.nz

† As a humble commemoration of Professor Solomon Marcus' fifth death anniversary.

**Abstract:** P systems have been known to provide efficient polynomial (often linear) deterministic solutions to hard problems. In particular, cP systems have been shown to provide very crisp and efficient solutions to such problems, which are typically linear with small coefficients. Building on a recent result by Henderson et al., which solves SAT in square-root-sublinear time, this paper proposes an orders-of-magnitude-faster solution, running in logarithmic time, and using a small fixed-sized alphabet and ruleset (25 rules). To the best of our knowledge, this is the fastest deterministic solution across all extant P system variants. Like all other cP solutions, it is a complete solution that is not a member of a uniform family (and thus does not require any preprocessing). Consequently, according to another reduction result by Henderson et al., cP systems can also solve *k*-colouring and several other NP-complete problems in logarithmic time.

**Keywords:** membrane computing; P systems; cP systems; NP-complete; NP-hard; SAT; logarithmic time complexity

**MSC:** 68Q07; 68Q10; 68N17; 68W10

**Citation:** Nicolescu, R.; Dinneen, M.J.; Cooper, J.; Henderson, A.; Liu, Y. Logarithmic SAT Solution with Membrane Computing. *Axioms* **2022**, *11*, 66. https://doi.org/10.3390/ axioms11020066

Academic Editor: Gexiang Zhang

Received: 15 January 2022 Accepted: 29 January 2022 Published: 8 February 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

#### **1. Introduction**

The P-versus-NP problem remains one of the most important unsolved problems in computational complexity theory. Loosely following Sipser [1] and keeping the discussion focused on *deterministic algorithms*—as we do throughout this paper—the class P can be viewed as the class of decision problems that can be *solved* "quickly", whereas NP can be viewed as the possibly larger class of decision problems with solutions that can be *verified* "quickly", where "quickly" is taken in the theoretical sense, i.e., polynomial time. It is straightforward to see that P ⊆ NP. However, it is still unknown whether this inclusion is strict or not, in other words, whether P NP or P = NP. In a nutshell, the big theoretical question is whether every problem of which the solution can be verified in polynomial time (NP) can also be solved in polynomial time (P).

The current widespread opinion is that P NP, as there are quite a few "hard" problems that can be "quickly" verified, but do not seem to have "quick" solutions, with their fastest known solutions taking time substantially greater than any polynomial (e.g., exponential). Therefore, many studies have investigated different approaches to solve such hard problems in a reasonable amount of time (e.g., polynomial or even linear time). Such methods include approximation [2], fixing parameters [3], or the use of alternative theoretical models, such as P systems [4–9].

P systems—also known as membrane computing—are a family of parallel and distributed biologically inspired models of computing, proposed by Gheorghe P˘aun in [10], first as cell-like P systems, then followed by many variants, such as P systems with active membranes [11], tissue-like P systems [12], neural-like P systems [13], and P systems with compound terms (cP systems) [14,15]. These systems have been found to have theoretically time-efficient solutions to many hard problems, even beyond NP, e.g., in PSPACE [16–21].

It may be worthwhile to note that, with the exception of cP systems, most other P systems solutions are actually *uniform families* of related solutions, with one custom solution (e.g., custom alphabet and ruleset) for each problem size *n*. Here, uniform means that each custom size *n* solution is built via an additional preprocessing phase, by means of an ad-hoc polynomial-time algorithm (typically not described but reasonably evident). In contrast, cP solutions are given by *fixed-size* alphabets and rulesets (typically small), while running with the same theoretical efficiency, or even faster.

In this work, we present a novel *deterministic* cP solution to SAT, running in *logarithmic time*, O(log *n*). To the best of our knowledge, this represents a significant breakthrough in membrane computing, being orders-of-magnitude faster than all previous *deterministic* solutions. As mentioned, we do not consider here the interesting area of non-deterministic computations, where there are several interesting results, e.g., using neural-like P systems [22].

Our novel solution builds upon and substantially improves the already very fast cP solution to SAT recently proposed by Henderson et al. [4], which runs in square-root time, O( <sup>√</sup>*n*). The solution presented here is based on a fast method of creating and evaluating a complete binary tree of height *n*, in O(log *n*) time. When measuring the number of rule templates, we see that our new solution is comparable to those of previous P systems studies. However, when counting rules rather than the templates, we see that other solutions can have an exponential number of rules.

Using the results presented in this paper, reductions such as those presented in Stamm-Wilbrandt [23] and Henderson et al. [4] will enable more logarithmic time solutions, O(log *n*), to quite a few other NP-complete problems, such as *k*-colouring.

However, to the best of our knowledge, all these efficient solutions are still theoretical and have not yet been practically implemented. Designing efficient, practical implementations is a topic of current research.

#### **2. Background**

In this section, we briefly recall the well-known Boolean satisfiability problem (SAT) and we offer a short introduction to cP systems.

#### *2.1. The SAT Problem*

SAT is one of the best-known examples of an NP-complete problem and is a relatively simple but central problem in many areas of computer science (e.g., complexity, artificial intelligence, cryptography, etc.). Like all other NP-complete problems, it has no known (worst-case) polynomial solution in the Turing machine model (or related models). In this paper, we show that cP systems can theoretically solve SAT in sublinear logarithmic time.

SAT determines if the variables of a given Boolean formula can be assigned Boolean values that evaluate the formula to true. A Boolean formula is an expression involving Boolean variables and Boolean operations. A Boolean formula is in conjunctive normal form (CNF) if it is expressed as a conjunction (∧) of clauses. A clause is a disjunction (∨) of literals. A literal is a variable or its negation (here indicated by overbars).

Basic SAT assumes that the formulae are given in CNF, with implicit existential quantifiers on all variables. The existential quantifier (∃) results are true if one of the possible assignments of the variables allows the formula to be true.

**Example 1.** *For example, the following Boolean formula with two variables is in CNF:*


The size of the problem is given by the number of variables, *n*, e.g., *n* = 2, for the formula of Example 1. There are straightforward bijections between several sets of size 2*n*: (i) candidate solutions (variable allocations) of a CNF formula with *n* variables, (ii) (characteristic functions for) subsets of set {1, 2, ... , *n*}, (iii) branches (root-to-leaf paths) of the complete binary tree of height *n*. For case (iii), a tree path starting from a root can be naturally labelled as a string of bits, where bits indicates its left/right "choices" (turns) in the top-down (root-to-leaf) order.

**Example 2.** *Consider the complete binary tree of Figure 1 of height n* = 2*, with* 4 *branches, in left-to-right order:*


*Note that branches 01 and 10 correspond to solutions for the formula of Example 1.*

**Figure 1.** Complete binary tree of height 2. Nodes hold branch labels, and are decorated with attributes that are explicit corresponding variable allocations. Branches 01 and 10 correspond to solutions for the formula of Example 1, (*x*<sup>1</sup> ∨ *x*2) ∧ (*x*<sup>1</sup> ∨ *x*2).

Our cP solution is based on a parallel construction of complete binary tree branches, followed by a parallel formula evaluation on these branches.

#### *2.2. cP Systems*

In this paper we propose a novel cP solution to a hard problem; to the best of our knowledge, this is the first P solution running in logarithmic time, which represents an improvement of orders of magnitude.

P systems, also known as membrane computing, are a framework for designing computational models inspired by biology. Similarly to many other P systems variants, such as cell-like and tissue-like P systems, cP systems are based on *nested labelled multisets* and offer: (i) unbounded access to resources, such as space and processing power; (ii) toplevel cells, with sub-cells organised into nested tree structures; (iii) graph based networks of top-level cells; and (iv) evolutions driven by formal multiset rewriting rules, with additional messaging primitives between top-level cells.

However, distinctively, cP systems' multiset rewriting rules are *generic*, with *variables instantiated* by *one-way unification* (*pattern matching*). In conjunction with nesting, generic rules provide useful logical and associative capabilities, including good support for emulating arithmetic with natural numbers (base one) and usual data structures (such as lists, strings, and associative arrays). Recall that *instantiations* assign values to variables—ground values in pattern matching—whereas *unifications* are matching instantiations.

Leveraging their capabilities, most P systems variants, including cP systems, are able to transform "brute-force" algorithms into theoretically efficient solutions, with typically linear or sublinear runtimes. This allows the design of theoretically fast solutions to hard problems. Moreover, cP systems solutions for hard problems are typically the fastest, having small runtime coefficients. Additionally, cP systems solutions typically use small rulesets of fixed sizes, which do not change with the problem size (no uniform families, no polynomial preprocessing).

In this section, we introduce the basic features of a simplified version of cP systems, called *single-cell cP systems*, which have one single top-level cell, with nested sub-cells (thus there is no place for top-level cell networks and messaging). Listing 1 describes the basic formal syntax of single-cell cP-systems; for a more comprehensive description and explanation of cP systems, the reader is referred to [14,15]. This formal description consists of two BNF-like grammars, presented together, because of their similarities: (1) a *top-level cell*, in the sequel called *top-cell* (for brevity); (2) a *multiset rewriting rule*. Note that, in this figure and the sequel, we use the following two common abbreviations: *lhs* = left-hand-side, *rhs* = right-hand-side.

**Listing 1.** Simplified syntax for single-cell cP systems. Lhs = left-hand-side, rhs = right-hand-side, var-X = X may contain variables. Braces ({,}) and brackets ([,]) are meta-syntactic constructs followed by repetition bounds; here, braces generate *multisets*, whereas brackets generate *sequences*.

```
<top-cell> ::= <state> <objects>
<state> ::= <atom>
<objects> ::= {<atom> | <sub-cell>}∞
                                    0
<sub-cell> ::= <functor> '('<objects> [';' <objects>]∞
                                                   0 ')'
<functor> ::= <atom>
.........................................................................................
<rule> ::= <lhs> →<mode> <rhs> ['|' <promoters>]∞
                                                    0
<mode> ::= '1' | '+'
<lhs> ::= <state> <var-objects>
<rhs> ::= <state> <var-objects>
<state> ::= <atom>
<promoters> ::= <var-objects>
<var-objects> ::= {<variable> | <atom> | <var-sub-cell>}∞
                                                          0
<var-sub-cell> ::= <functor> '('<var-objects> [';' <var-objects>]∞
                                                                0 ')'
<functor> ::= <atom>
```
A single-cell cP system consists of one single *top-cell*, which—following the first grammar presented in Listing 1—has a *state* and contains *objects*, i.e., *atoms* and recursively nested *sub-cells*.

**Remark 1.** *In Prolog terminology, cell objects are terms, sub-cells are compound terms; and all cell objects are ground, i.e., cannot contain variables. Furthermore, unlike Prolog, cP functors do not have arities, and just represent multiset labels.*

Conventionally, atoms are represented by lowercase letters and variables by uppercase letters. A dedicated atom 1 is typically used to represent unary natural numbers (more details below). Anonymous (discard) variables in cP systems are denoted by underscores ( ). The empty multiset is denoted by *λ*. As usual, multiset elements can be written in any order, and repetitions can be denoted as powers. Sample ground sub-cells: *a*(*bbc*) = *a*(*b*2*c*) = *a*(*bcb*), *a*(*b*(*cc*) *d*(*e f*)), *n*(111) = *n*(13).

**Remark 2.** *The grammar given in Listing 1 specifies that a sub-cell functor can be followed by a sequence of multiset arguments, which seems to require an ad hoc ordering concept. Functors with one single multiset argument are indeed essential in cP systems (similar to terms in Prolog), but functors with two or more arguments are not, because these could be replaced by one more level deeper cell nesting. For example, the sub-cell a*(*bc*; *de*; *f g*) *could be also considered a shorthand for* *a*(*bc* · (*de*) : (*f g*)) *(or a*(: (*f g*) *bc* · (*de*))*, etc.), where the nested functors (*·*) and (*:*) could be given ad hoc or provided by the system. Briefly, this conceptually redundant ordering appears for* convenience *only, and the given grammar could be simplified, and strictly restricted to* nested labelled multisets*. Note that alternative definitions of cP systems use additional parentheses instead of the semicolons used here, e.g., the following two notations describe the same abstract syntax a*(*bc*; *de*; *f g*) ≡ *a*(*bc*)(*de*)(*f g*)*.*

As mentioned, *natural numbers* can be emulated using a dedicated unary symbol, such as 1. By convention, we can also directly use the corresponding numbers, rather than their lower-level unary representation. For example:


A single-cell cP system evolves through a sequence of *configurations* by changing its *state* and *contents*. These changes are driven by the high-level *rewriting rules* associated to its top-cell, which are constructed according to the second grammar presented in Listing 1. Unlike similar cells in cell-like P systems, cP sub-cells are more restricted, by not having their own rules. Thus, sub-cells are just data storage facilities, and are acted upon by the top-cell's rules only. This restriction seems substantially outweighed by the extra power of the cP rules. Unlike other P systems variants, rules in cP systems are *generic* templates, i.e., their var-objects may contain *variables* that must be *instantiated* before the rule application.

Before a rule can apply:


Rules are applied in a *weak priority order*, with rules considered in the given top-down order. Conventionally, the first lhs state is the state of the initial configuration. Once an applicable rule has been found, this commits to the next state, with subsequent rules committing to different states disabled. Rules going to the same state as the applicable rule, which can also be applied, will be applied in the *same step*. This state-based weak priority order supports a straightforward emulation of basic control flow (e.g., goto, conditional goto, or loop structures). Note that rules can be partitioned by their lhs state, without altering the semantics, as long as we keep the relative top-down order of rules starting with the same lhs state.

Essentially, applying a rule:


There are two rule application modes: exactly-once (→1) and max-parallel (→+). An *exactly-once* rule will apply for one single matching (*non-deterministically* chosen). A *maxparallel* rule will apply it as many times as possible, conceptually all in the same step, but following a *serialisation* semantics, i.e., its effects must be identical to a sequential repetition of the same rule in the exactly-once mode (sequence *non-deterministically* chosen). Although, as just mentioned, the cP semantics allow non-deterministic computations, most of our work has focused on *confluent* evolutions, often *deterministic*; the solution proposed in this paper is deterministic.

As with most other P system variants, the *runtime* of single-cell cP systems is measured in *steps*. Generally, a step is indicated by a state change, when a rule commits to a rhs state that differs from its lhs state. If the last applied rule does not change the state, then the control resumes at the first rule of that state, and this is also counted as a step. The system *halts* if a rule commits to a state with no associated rule; such states are called *final*. The system also halts if there are rules for the current state, but none is applicable (†). This last case, marked by a dagger (†), can be easily avoided by adding an extra catch-all rule, which will ensure termination in final states only.

As mentioned, like many other P system rules, cP rules have a significant potential for *non-determinism*. However, well-designed practical applications are highly deterministic. A cP system is *rule-deterministic* if each rule ends with exactly the same results, regardless of whether it is exactly-once or max-parallel, or how exactly it is instantiated and executed. A cP system is *step-deterministic* if each step is *locally confluent* with a guaranteed join after all step rules are applied, i.e., the step ends with exactly the same result, regardless of how its rules are applied. Obviously, rule-determinism is the stronger version, implying the weaker version, step-determinism. In both cases, we consider only evolutions that start from an expected initial configuration (not from arbitrary contents).

#### *2.3. Examples*

We provide several examples to clarify how cP systems are defined and used.

**Example 3.** *Matching examples, var-object (left) = ground object (right):*


**Example 4.** *Consider a cell in state s*<sup>1</sup> *that contains two objects a*(1)*, a*(11)*. Depending on the actual application mode α* ∈ {1, +}*, the following rule increments one or both a's by 1:*

*s*<sup>1</sup> *a*(*X*) →*<sup>α</sup> s*<sup>2</sup> *a*(1*X*)

By unifying the lhs *a*(*X*) against the given *a*s, two ground rules are instantiated:


When the application mode of the rule is exactly-once, *α* = 1, the system nondeterministically applies one of the above two instantiations, (1) or (2). Thus, the result can be either *a*(11), *a*(11) or *a*(1), *a*(111).

However, when the application mode is max-parallel, *α* = +, both instantiations are applied, and the result will be *a*(11), *a*(111). Here, this transformation is rule-deterministic, not depending on the application order, (1,2) or (2,1).

**Example 5.** *Consider a cell in state s*<sup>1</sup> *that contains two objects a*(13)*, b*(15)*, which respectively represent the numbers 3 and 5. The following rule destructively computes their sum, c* = *a* + *b:*

*s*<sup>1</sup> *a*(*X*) *b*(*Y*) →<sup>1</sup> *s*<sup>2</sup> *c*(*XY*)

This rule is instantiated as *<sup>s</sup>*<sup>1</sup> *<sup>a</sup>*(13) *<sup>b</sup>*(15) <sup>→</sup><sup>1</sup> *<sup>s</sup>*<sup>2</sup> *<sup>c</sup>*(18). Its application consumes the given *a*(13) and *b*(15), and creates a new objects *c*(18), corresponding to the sum 3 + 5.

Alternatively, a non-destructive summing can be performed using the following rule, where the given *a* and *b* appear as promoters:

*s*1*λ* →<sup>1</sup> *s*<sup>2</sup> *c*(*XY*) | *a*(*X*) *b*(*Y*)

**Example 6.** *Consider a cell in state s*<sup>1</sup> *that contains two objects a*(1) *and three objects b*(11)*. The following max-parallel rule (1) consumes two a*(1) *and two b*(11)*, creating two objects c*(111) *and leaving exactly one b*(11)*; while the following max-parallel rule (2), which uses promoters, creates six objects c*(111)*, leaving the given as and bs intact:*


Rule (1) could be considered rule-deterministic only if special configurations are guaranteed, such as the one given above; but, more generally, it is highly non-deterministic. Rule (2) is always rule-deterministic; essentially, it makes a Cartesian product of the given *a*s and *b*s, concatenating the contents of all pairs.

**Example 7.** *Consider a cell in state s*<sup>1</sup> *that contains two objects a*(1) *and three objects a*(11)*. The following max-parallel rule removes all duplicates, leaving exactly one a*(1) *and one a*(11)*:*

*s*<sup>1</sup> *a*(*X*) →<sup>+</sup> *s*<sup>2</sup> *λ* | *a*(*X*)

The application of this rule is equivalent to the following sequence of instantiations:

```
s1 a(1) →1 s2 λ | a(1)
s1 a(11) →1 s2 λ | a(11)
s1 a(11) →1 s2 λ | a(11)
```
The transformation is confluent, and the results will be the same, not depending on the relative application order of the above instantiations. After these three applications, no further unifying instantiations are possible because there are no longer sufficient remaining *a*s to satisfy both the lhs and the promoter. Thus, this rule is rule-deterministic.

**Example 8.** *Consider a cell in state s*<sup>1</sup> *that contains one a*(...) *and one b*(...)*, with unspecified contents. The following two-rule sequence models a non-destructive if-then-else operation, c = if a* ≤ *b then 0 else 1, accompanied by a state change (to either s*<sup>2</sup> *or s*3*):*


Rules are applied in weak-priority order. If rule (1) applies, then it commits to the target state *s*2, so rule (2) becomes inapplicable. Otherwise, if rule (1) does not apply, the target state is still undecided, so rule (2) unconditionally applies and commits to target state *s*3.

**Example 9.** *Consider a cell in state s*<sup>1</sup> *that contains a multiset of as, with numerical contents, e.g., a*(5), *a*(3), *a*(5), *a*(9), *a*(7)*. The following two max-parallel rules find the minimum in exactly two steps, regardless of the cardinality of the given multiset:*


Rule (1) makes temporary working copies of all *a*s as *b*s. Rule (2) deletes all *b*s for which there is a strictly lesser *a*. At state *s*3, the cell contains one or more *b*s, all containing the same minimum value; in our given sample scenario, there will be one single *b*(3). Both rules (1) and (2) are rule-deterministic.

#### **3. The Logarithmic cP SAT Solution**

We gradually develop our single-cell cP solution solution in three main phases. First, we show how a cP system can efficiently build all branches of a complete binary tree—this forms the backbone of our SAT solution. Secondly, we refine the building rules to decorate all these branches with explicit variable allocations; although conceptually redundant, explicit variable allocations are critical for efficient processing. Thirdly, and finally, we use these decorated tree branches to evaluate the given CNF formula, for all sets of variable allocations, which solves the SAT problem.

Leveraging the cP max-parallel mode, the full solution ruleset runs very efficiently, in O(log *n*) time. It also has a small fixed size (25 rules) that does not depend on the problem size *n* (no uniform family, no polynomial preprocessing).

#### *3.1. Building Trees*

In this section we solve a subproblem that will later be incorporated in our SAT solution. Using a *single-cell cP system*, we aim to build a complete binary tree of height *n*, in deterministic <sup>O</sup>(log *<sup>n</sup>*) time, by building its 2*<sup>n</sup>* tree branches as cP objects. For simplicity, we also assume that *<sup>n</sup>* is a power of 2, *<sup>n</sup>* <sup>=</sup> <sup>2</sup>*k*, for some *<sup>k</sup>* <sup>≥</sup> 1. If the given *<sup>n</sup>* is not a power of 2, we take *n* to be the next power of 2; we may thus obtain a bigger tree, which, however, does not affect our sought results.

The rules are shown in Listing 2. This ruleset has 8 rules, using 5 states, and assumes that *n* is given at the start via a namesake functor (e.g., *n*(4)). If needed, the reader is advised to crosscheck the appendix for an equivalent pseudocode, cf., Appendix B.

**Listing 2.** Ruleset for building complete binary trees of size *n*.


Rule (1) creates the starting tree, of height 1, with two branches. The current tree height is given by a sub-cell with functor *h*. Our tree branches are sub-cells with functor *t* and two arguments (two for consistency with the next branches that will be built via conceptual concatenation). The initial two branches are encoded as *t*(*λ*; 0) and *t*(*λ*; 1); by discarding the functors and parentheses, these encodings map to usual bit string labels, here 0 and 1, respectively. The cP encoding may seem to be overkill, but is required as cP systems lack strings, and are essentially based on amorphous multisets, where nesting is the only facility for structuring objects. For simplicity, in discussions, we will also use *t* as the name of the current tree (as the tree is completely defined by its branches).

Next, we repeatedly extend the current tree *t*, *k* = log *n* times (taking the ceiling if *n* is not power of 2), by transforming each leaf into the root of a new subtree *t* , ad hoc created as a structurally identical copy of *t*. Thus, the height of our trees grows exponentially: 1, 2, 4, 8, . . . , 2*<sup>k</sup>* = *n*.

Rules (2–8) form the core loop of our system, starting at state *s*<sup>2</sup> and exiting at state *s*5. Rule (2) breaks the loop if the current height *h* has reached (or exceeded) the given *n*. Otherwise, rule (3) copies the current tree *t* into a temporary template *t* . We note that the copy *t* is not really needed here, but adds clarity.

Rules (4–6) creates the new higher tree *t* , as the Cartesian product between the branches of *t* with the branches of *t* , then cleans the no-longer-needed objects *t* and *t* . Each new branch is a concatenation of two previous branches and is represented as a new object *t* with two arguments, one for each component branch. For example, concatenating the branch *z* with the branch *z* creates a new branch *t*(*z*; *z* ).

Rules (7–8) rename *t* as *t*, double the height *h*, and restart the loop from state *s*2.

The following table lists the successively created branches, for *n* = 4. Anecdotally, note the relations *h* = 2*k*, *d* = *k* + 2, where *h* is the height of the current tree *t*; *k* counts the completed iterations of loop (2–8); and *d* is the nesting depth of the branches.


**Theorem 1.** *The cP ruleset 2 builds all branches of the complete binary tree of height n, in* O(log *n*) *time.*

**Proof.** The previous discussion of the rules shows that they indeed build a complete binary tree. Rule (1) takes one step (*s*<sup>1</sup> → *s*2) and creates the initial complete binary tree of height *h* = 1. The loop formed by rules (2–8) takes 3 steps (*s*<sup>2</sup> → *s*<sup>3</sup> → *s*<sup>4</sup> → *s*2), runs *k* = log *n* times (log *n* times, if *n* is not power of 2), each time doubling the tree height *h*. The Cartesian product ensures that all created trees are still complete. The final break exit at rule (2) takes one more step (*s*<sup>2</sup> → *s*5). The total step count is 1 + 3 log *n* + 1 = O(log *n*). The final height is 2*<sup>k</sup>* = *n*.

**Remark 3.** *Ruleset 2 is rule-deterministic (and therefore also step-deterministic). Regardless of how it is instantiated and performed, each rule, whether exactly-once or max-parallel, ends with exactly the same results.*

#### *3.2. Decorating Trees with Variable Allocations*

In this section we extend the ruleset from the previous Section 3.1, by decorating all branches *t* with attributes *a*, representing explicit variable allocations. Although explicit allocations are, at first glance, redundant, because allocations can be recovered by parsing the branch label, they are critical for fast processing.

For example, looking at Figure 1, branch *x* should be decorated by allocations set *a*(*x*), as follows: (i) for the height 1 tree: *a*(0) = {*x*<sup>1</sup> = 0}, *a*(1) = {*x*<sup>1</sup> = 1}; (ii) for the height 2 tree: *a*(00) = {*x*<sup>1</sup> = 0, *x*<sup>2</sup> = 0}, *a*(01) = {*x*<sup>1</sup> = 0, *x*<sup>2</sup> = 1}, etc. Furthermore, for a tree of height 4 = 2 + 2, we should have *a*(0100) = {*x*<sup>1</sup> = 0, *x*<sup>2</sup> = 1, *x*<sup>3</sup> = 0, *x*<sup>4</sup> = 0}. Note that *a*(0100) = *a*(01) ∪ *a* (00), where *a* (00) = {*x*1+<sup>2</sup> = 0, *x*2+<sup>2</sup> = 0}, i.e., *a* (00) is *a*(00) transformed by shifting the indices of its variables by +2.

Recalling that we build trees by means of successive concatenations, our ruleset formalises this intuition. Formally, the allocation set for branch *t*(*X*;*Y*) is given by all sub-cells *a*(*X*;*Y*; *I*; *V*), where *I* is a variable index and *V* its value (0 or 1). These *a* subsets are only virtually grouped together, solely by their shared branch label. This will not be a problem in regard to the logical and associative powers of cP systems. On the contrary, as we will see in the next Section 3.3, these loose associative collections will enable very fast evaluations.

The rules are shown in Listing 3. This ruleset has 14 rules, uses 6 states, and assumes that *n* is given at the start via a namesake functor (e.g., *n*(4)). If needed, the reader is advised to crosscheck the appendix: the sample traces listed in Appendix A and an equivalent pseudocode in Appendix C.

**Listing 3.** Ruleset for decorating trees.


Rule (1) creates the initial height 1 tree *t* and its allocations *a* (as mentioned above).

Rules (2–14) form the core loop, starting at state *s*<sup>2</sup> and exiting at state *s*6. Rule (2) breaks the loop if *h* ≥ *n*. Otherwise, rule (3) copies the current tree *t* into a temporary template *t* , and rule (4) copies the current allocations *a* into temporary objects *a* , *shifting* the variable indices by *h*.

Rules (5–7) creates the new higher tree *t* , as the Cartesian product between the branches of *t* with the branches of *t* , then cleans the no-longer-needed objects *t* and *t* . Rules (8,9) creates the allocations *a* for the new tree *t* : rule (8) "lifts" the allocations *a* belonging to the former tree *t*, and rule (9) "lifts" the allocations *a* belonging to the former template tree *t* . Rules (10,11) clean the now-unneeded objects *a* and *a* .

Rules (12–14) rename *t* as *t* and *a* as *a*, double the height *h*, and restart the loop from state *s*2.

Arguments similar to those used in the proof of Theorem (1) lead us to the following result.

**Proposition 1.** *The cP ruleset 3 builds all branches of the complete binary tree of height n and decorates these with explicit variable allocations, in* O(log *n*) *time.*

**Remark 4.** *Like its base, ruleset 2, ruleset 3 is rule-deterministic (and therefore also step-deterministic). Regardless of how it is instantiated and performed, each rule, whether exactly-once or max-parallel, ends with exactly the same results.*

#### *3.3. Formula Evaluations*

Up to this stage, the tree construction has ignored the actual problem, considering only its size and the number of variables, *n*. It is now time to introduce the formula that we actually want to solve. For this, we assume that the formula is given as the multiset of all its literal objects, *r*, where each literal object has the format *r*(*k*; *i*;*s*), where *k* is a clause index in [1, *m*], *i* is a variable index in [1, *n*] and *s* is a sign in {−, +}, which indicates whether the clause *k* variable *xi* is negated (−) or not (+).

For example, the formula of Example 1, (*x*<sup>1</sup> ∨ *x*2) ∧ (*x*<sup>1</sup> ∨ *x*2), can be given as the multiset containing the following four *r* objects:

*r*(1; 1; +) *r*(1; 2; +) *r*(2; 1; −) *r*(2; 2; −)

For fast processing, we use a lookup table that quickly indicates the value of a literal, based on the variable value, regardless of whether or not the variable is negated. This lookup table is given by the following set with four *w* objects:


where in *w*(*u*;*s*; *v*), *u* is a variable value, *s* is a sign associated with a possible negation, and *v* is the literal value after considering *s*.

The rules are shown in Listing 4. This ruleset has 11 rules, uses 6 states, and assumes: (i) the *r* literal objects representing the given formula; (ii) the *t* and *a* objects as built by the ruleset of Listing 3. If needed, the reader is advised to crosscheck the appendix: the sample traces listed in Appendix A and an equivalent pseudocode in Appendix D.

**Listing 4.** Ruleset for formula evaluations (continuing from Ruleset 3).


The evaluation ruleset starts from *s*6, the end state of the ruleset of Listing 3. Rule (15) makes a Cartesian product of branches and literals, for each branch *t* and literal *r*, creating an object *f* , which combines the branch *t* and the literal *r*.

Rule (16) transforms objects *f* into objects *f* , by replacing sign positions with actual literal values, taken from lookup table *w*. Briefly, these transformed *f* objects record *evaluated literals*, separately for each branch and clause.

For each branch and clause, if there is a literal value 1, then rule (17) keeps this *f* and deletes all other *f* objects. Otherwise, if there still exists a literal value 0 (i.e., if all literal values were 0), then rule (18) keeps this *f* and deletes all other *f* objects (for the same branch and clause). At this stage, for each branch and clause, there is one single *f* object left, indicating the clause value, 1 or 0. Rule (19) transforms these surviving *f* objects into *f* objects, discarding the now-superfluous variable index. In a nutshell, *f* objects record *evaluated clauses*, separately for each branch.

Essentially, rules (20–22) repeat the same pattern and create *f* objects, which indicate *formula values*, separately for each branch. Now, if there is a branch where the formula is evaluated to 1, then rule (23) keeps this *f* and deletes all other *f* objects; otherwise, rule (24) keeps one single *f* that indicates 0 and deletes all other *f* objects.

Finally, there is exactly one *f* object left, which indicates whether or not there is an allocation that satisfies the formula. Using this sole surviving *f* , rule (25) creates a *d* object that records the final decision.

**Example 10.** *The following table summarises the essential evaluation steps, in symbolic representation, for the formula of Example 1, cf. also Figure 1. Each branch has its own copy of formula literals, clause 1:* {*x*1, *x*2}*, clause 2:* {*x*1, *x*2}*.*


If required, we could also return the set of all successful allocations, if any, but here we merely return the sought decision result, *d*(0) (i.e., no), or *d*(1) (i.e., yes). In our example case, there are two successful allocations, for branches 01 and 10, so the final decision is yes, *d*(1).

Straightforward arguments show that the formula is exhaustively evaluated, and the evaluation ruleset takes a constant number of steps (5).

**Proposition 2.** *Given the complete binary tree built and decorated via the ruleset of Listing 3, the ruleset of Listing 4 solves SAT in* O(1) *time.*

**Remark 5.** *Ruleset 4 is only step-deterministic, not rule-deterministic. Three of its steps have deterministic step results, but consist of locally confluent fragments: 17–19, 20–22, and 23–25. The ruleset could be slightly modified to be strictly rule-deterministic, but we prefer the current version, due to its better readability.*

Noting that O(log *n*) + O(1) = O(log *n*), the following theorem is a direct consequence of Propositions 1 and 2. We also include a couple of static metrics provided by a close inspection of the rulesets of our two parts.

**Theorem 2.** *The SAT decision problem can be solved in* O(log *n*) *time by means of a cP system ruleset with 11 states and 25 rules.*

#### *3.4. Other NP-Complete Problems*

Using the results of Stamm-Wilbrandt [23], Henderson et al. [4] have designed a cP solution that achieves a *constant time reduction*, O(1), from another famous NP-complete problem, *k*-colouring, to SAT. Combined with their *square root* SAT solution, O( <sup>√</sup>*n*), they conclude that *k*-colouring and quite a few other NP-complete problems can be solved in *square root* time by cP-systems, as O( <sup>√</sup>*n*) + <sup>O</sup>(1) = <sup>O</sup>( <sup>√</sup>*n*).

Based on the results of this paper, we similarly conclude that *k*-colouring, and possibly many other NP-complete problems, can be solved in *logarithmic* time by means of cPsystems, as O(log *n*) + O(1) = O(log *n*).

**Theorem 3.** *The k-colouring decision problem can be solved in* O(log *n*) *time in the cP system model.*

#### **4. Discussion**

This section starts with a rough summary comparison of a few selected, and hopefully the most relevant, *deterministic* P systems solutions for the SAT problem. Essentially, we want to compare the *ruleset sizes* and the *running times*. Many of these solutions are linear, but their runtime often includes both the number of variables, *n*, and the number of clauses, *m*, e.g., O(*m* + *n*). See Nagy [6] for a short survey on some of the previous P system solutions.

There is also a recently proposed cP solution by Henderson et al. [4], which managed a remarkable breakthrough, being sublinear, O( <sup>√</sup>*n*). Our new solution, proposed in this paper, shows that cP systems are able to solve SAT and other NP-complete problems in a substantially faster sublinear time of O(log *n*). As seen in Table 1, our novel solution surpasses all other extant solutions in runtime, and is comparable to the number of template rules (more about this below).

This comparison is a difficult problem by itself, as the many P systems variants have substantial differences, so one should be careful when "comparing apples with oranges", and then drawing strong conclusions. First, all P systems measure the runtimes in terms of *steps*, which at the first seems to be a uniform measure, but the definition of steps may differ among variants, and may have different granularity.

Secondly, the rules also have different granularity. Here, we attempt to create a more level playing-field by following the methods used by Henderson et al. [16]. Thus, we indicate the ruleset size in two ways: (i) the actual number of *rules*, and (ii) the number of *rule templates*. As defined in [16], rule templates are groupings of similar rules, differing only by symbol indices, e.g., *ai* → *bi*, *i* = 1, 2, ... , *n*, which represents *n* rules but one single rule template. This should considerably level the playing field, as such a template is typically subsumed by one single generic rule in cP systems, e.g., *a*(*I*) → *b*(*I*) | *c*(*I*).

On the other side, when counting rule templates and rules, we did not consider the numbers of repeated copies placed in different membranes/neurons. Additionally, non cP systems solutions are not single solutions, but uniform families of solutions, i.e., a different solution will be used for each different problem size, typically following the same templates, but with different alphabet and ruleset sizes. The needed pre-processing time was roughly estimated from the papers, and presented in a separate column. cP systems do not have such facilities, as they use a fixed ruleset that must be defined in the top-level cell only (subcells do not have their own rules). This may seem to create some bias against cP systems, but we feel that the power of generic rules will finally rebalance the comparison.


**Table 1.** Ruleset size and runtime for several proposed P system solutions. † = this paper. The preprocessing time was only estimated by us.

We conclude this section by noting several research directions that could follow the current result. (1) Design a shallow solution for this problem. (2) As a combined method of space and task optimisation, partially evaluate the given formula while building the tree. This would enable one to prune branches that cannot lead to any solution, because one of the clauses is already false. This should substantially reduce the actual work, and balance it better, possibly leading to more efficient practical implementations. (3) Develop a similar approach for QSAT, a famous related PSPACE-complete problem, which is substantially more complex and challenging. (4) Investigate the feasibility of similar solutions in other P system variants.

#### **5. Conclusions**

In this work, we have presented a novel cP solution to SAT, a famous NP-complete (and thus NP-hard) problem. Our solution is deterministic and runs in logarithmic time, O(log *n*). To the best of our knowledge, this represents a significant breakthrough in membrane computing, being orders-of-magnitude faster than all previous *deterministic* solutions.

In conjunction with a couple of known reduction results, our solution enables further logarithmic-time solutions, O(log *n*), to other NP-complete problems, such as *k*-colouring.

Our results open the way to several other challenging research problems, such as extending this method to cover QSAT (which is a substantially harder, PSPACE-complete problem); designing a time- and space-optimised version and possibly a shallow version; and investigating the feasibility of similar solutions in other P system variants.

**Author Contributions:** Conceptualisation, investigation, and formal analysis: R.N. and A.H.; supervision: R.N. and M.J.D.; writing—original draft preparation: R.N., A.H., J.C., and Y.L.; writing—review and editing: R.N., M.J.D., A.H., J.C., and Y.L.; validation: Y.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A. Traces for Sections "Decorating Trees with Variable Allocations" and "Ruleset Evaluations"**

This section traces critical configuration fragments for the whole proposed SAT algorithm, i.e., the combined rulesets 3 and 4. The trace is organised by steps, listing essential configuration contents at the start of each new step. The initial configuration does not change, so it only appears for state *s*1. We again consider the formula of Example 1: (*x*<sup>1</sup> ∨ *x*2) ∧ (*x*<sup>1</sup> ∨ *x*2), with *n* = 2, *m* = 2.

For readability, the two components of nested cP branch labels, which appear as arguments for functors *t*, *a*, *f* (possibly primed), are indicated by their corresponding binary equivalents (cf,. Section 2.1), which are underlined, e.g.,: *t*(0) = *t*(*λ*; 0), *t*(1) = *t*(*λ*; 1), *t*(00) = *t*(*t*(*λ*; 0); *t*(*λ*; 0)), *t*(01) = *t*(*t*(*λ*; 0); *t*(*λ*; 1)), *a*(01; 1; 0) = *a*(*t*(*λ*; 0); *t*(*λ*; 1); 1; 0), *f*(01; 1; 2; +) = *f*(*t*(*λ*; 0); *t*(*λ*; 1); 1; 2; +), *f* (01; 2; 1) = *f* (*t*(*λ*; 0); *t*(*λ*; 1); 2; 1), etc.

• Enter state *s*1, with immutable objects (not further listed unless actually useful):

*n*(2) *w*(0; +; 0) *w*(0; −; 1) *w*(1; +; 1) *w*(1; −; 0) *r*(1; 1; +) *r*(1; 2; +) *r*(2; 1; −) *r*(2; 2; −)

• Step *s*<sup>1</sup> → *s*2, rule (1): Create initial height 1 tree objects, *t* and *a*.

```
• Enter state s2, with:
```

```
n(2) h(1)
t(0) t(1) a(0; 1; 0) a(1; 1; 1)
```

```
h(1)
t(0) t(1) a(0; 1; 0) a(1; 1; 1)
t

 (0) t

        (1) a
               (0; 2; 0) a
                           (1; 2; 1)
```

```
h(1)
t
(00) t
         (01) t
                 (10) t
                         (11)
a(0; 1; 0) a(1; 1; 1) a
                       (0; 2; 0) a
                                  (1; 2; 1)
```

*h*(1) *t* (00) *t* (01) *t* (10) *t* (11) *a*(00; 1; 0) *a*(01; 1; 0) *a*(10; 1; 1) *a*(11; 1; 1) *a*(00; 2; 0) *a*(10; 2; 0) *a*(01; 2; 1) *a*(11; 2; 1)


```
n(2) h(2)
t(00) t(01) t(10) t(11)
a(00; 1; 0) a(00; 2; 0) a(01; 1; 0) a(01; 2; 1)
a(10; 1; 1) a(10; 2; 0) a(11; 1; 1) a(11; 2; 1)
```

```
r(1; 1; +) r(1; 2; +) r(2; 1; −) r(2; 2; −)
t(00) a(00; 1; 0) a(00; 2; 0)
t(01) a(01; 1; 0) a(01; 2; 0)
t(10) a(10; 1; 0) a(10; 2; 0)
t(11) a(11; 1; 0) a(11; 2; 0)
```
• Step *s*<sup>6</sup> → *s*7, rule (15): Multiply formula literals, making copies for each branch. • Enter state *s*7, with:

```
w(0; +; 0) w(0; −; 1) w(1; +; 1) w(1; −; 0)
t(00) a(00; 1; 0) a(00; 2; 0) f(00; 1; 1; +) f(00; 1; 2; +) f(00; 2; 1; −) f(00; 2; 2; −)
t(01) a(01; 1; 0) a(01; 2; 0) f(01; 1; 1; +) f(01; 1; 2; +) f(01; 2; 1; −) f(01; 2; 2; −)
t(10) a(10; 1; 0) a(10; 2; 0) f(10; 1; 1; +) f(10; 1; 2; +) f(10; 2; 1; −) f(10; 2; 2; −)
t(11) a(11; 1; 0) a(11; 2; 0) f(11; 1; 1; +) f(11; 1; 2; +) f(11; 2; 1; −) f(11; 2; 2; −)
```

```
t(00) a(00; 1; 0) a(00; 2; 0) f 
                                  (00; 1; 0) f 
                                                (00; 1; 0) f 
                                                              (00; 2; 1) f 
                                                                            (00; 2; 1)
t(01) a(01; 1; 0) a(01; 2; 0) f 
                                  (01; 1; 0) f 
                                                (01; 1; 1) f 
                                                              (01; 2; 1) f 
                                                                            (01; 2; 0)
t(10) a(10; 1; 0) a(10; 2; 0) f 
                                  (10; 1; 1) f 
                                                (10; 1; 0) f 
                                                              (10; 2; 0) f 
                                                                            (10; 2; 1)
t(11) a(11; 1; 0) a(11; 2; 0) f 
                                  (11; 1; 1) f 
                                                (11; 1; 1) f 
                                                              (11; 2; 0) f 
                                                                            (11; 2; 0)
```

```
t(00) a(00; 1; 0) a(00; 2; 0) f (00; 1; 0) f (00; 2; 1)
t(01) a(01; 1; 0) a(01; 2; 0) f (01; 1; 1) f (01; 2; 1)
t(10) a(10; 1; 0) a(10; 2; 0) f (10; 1; 1) f (10; 2; 1)
t(11) a(11; 1; 0) a(11; 2; 0) f (11; 1; 1) f (11; 2; 0)
```


	- **–** Intermediate snapshot after rules (23–24):

```
t(00) a(00; 1; 0) a(00; 2; 0)
t(01) a(01; 1; 0) a(01; 2; 0) f (01; 1)
t(10) a(10; 1; 0) a(10; 2; 0)
t(11) a(11; 1; 0) a(11; 2; 0)
```
• Enter state *s*<sup>11</sup> (end, with success), with:

*d*(1) *t*(00) *a*(00; 1; 0) *a*(00; 2; 0) *t*(01) *a*(01; 1; 0) *a*(01; 2; 0) *t*(10) *a*(10; 1; 0) *a*(10; 2; 0) *t*(11) *a*(11; 1; 0) *a*(11; 2; 0)

#### **Appendix B. Pseudocode for Section "Building Trees"**

The pseudocode is shown in Listing A1. We assume that *n* is already given as an initial parameter. Multisets are denoted by capital letters, e.g., *T* is the multiset (actually set) of all *t* objects. Branches are represented by their intuitive bit string notation (not as cP encodings). At state *s*3, the Cartesian product (×) is followed by projecting string concatenations (·) of all pairs, which creates double-length branches.

**Listing A1.** Pseudocode for the ruleset of Listing 2.

*s*1: *h* ← 1; *T* ← {0, 1} // initial tree height and branches *s*2: **if** *h* ≥ *n* **then goto** *s*<sup>5</sup> **else** // alt **while** *h* < *n* **do** ... *T* ← *T* // copy current branches *s*3: *T* ← {*t* · *t* | (*t*, *t* ) ∈ *T* × *T* } // concatenate all branch pairs *T* ← **null** *T* ← **null** *s*4: *T* ← *T*; *T* ← **null** // next tree *h* ← *h* + *h* // next height **goto** *s*<sup>2</sup> *s*5: // end

#### **Appendix C. Pseudocode for Section "Decorating Trees with Variable Allocations"**

The pseudocode is shown in Listing A2. We assume that *n* is already given as an initial parameter. Multisets are denoted by capital letters, e.g., *T* is the set of all *t* objects (branches), where branches are represented by their intuitive bit string notation (not as cP encodings).

Variable allocations are given as partial functions [1, *n*] → {0, 1}. For example, using a Python-like notation, the allocation set {*x*<sup>1</sup> = 0, *x*<sup>2</sup> = 1} is represented as the list *α* = {1 : 0, 2 : 1}; thus *α*[2] = 1. At state *s*2, *σ* is a transformation that *shifts* the variable indices in a given allocation set *α* by a given number *h*, i.e., *σ*(*α*, *h*) = {*i* : (*v* + *h*) | (*i* : *v*) ∈ *α*}; e.g., *σ*({1 : 0, 2 : 1}, 2) = {3 : 0, 4 : 1}, and, more symbolically, {*x*<sup>3</sup> = 0, *x*<sup>4</sup> = 1}.

At state *s*3, the Cartesian product (×) is followed by projecting string concatenations (·) of all pairs, which creates double-length branches.


*s*1: *h* ← 1; *T* ← {0, 1} // initial tree height and branches *A* ← {(0, {1:0}),(1, {1:1})} // initial branch variable allocations *s*2: **if** *h* ≥ *n* **then goto** *s*<sup>6</sup> **else** // alt **while** *h* < *n* **do** ... *T* ← *T* // copy current branches *A* ← {(*t*, *σ*(*α*, *h*)) | (*t*, *α*) ∈ *A*} // copy allocations and shift indices by *h s*3: *T* ← {*t* · *t* | (*t*, *t* ) ∈ *T* × *T* } // concatenate all branch pairs *T* ← **null** *T* ← **null** *s*4: *A* ← {(*t* · *t* , *α*) | *t* · *t* ∈ *T*, |*t*| = |*t* |,(*t*, *α*) ∈ *A*} // lift from *A* ∪ {(*t* · *t* , *α*) | *t* · *t* ∈ *T*, |*t*| = |*t* |,(*t* , *α*) ∈ *A* } // lift from *A A* ← **null** *A* ← **null** *s*5: *T* ← *T*; *T* ← **null** // next tree *A* ← *A*; *A* ← **null** // next allocations *h* ← *h* + *h* // next height **goto** *s*<sup>2</sup> *s*6: // end (of this phase)

#### **Appendix D. Pseudocode for Section "Ruleset Evaluations"**

The pseudocode is shown in Listing A3. We assume that this code follows the code of the preceding section, given in Listing A2. As before, × denotes the Cartesian product operator.

*T* is the set of all branches and *A* is the (conceptually redundant) set of all associated allocations. as constructed using the preceding pseudocode A2, *Rk* is the set of all literals that appear in clause *k* ∈ [1, *m*], and *R* is the set of all possible literals. For example, assuming that its clauses are indexed in left-to-right order, the previously discussed formula, (*x*<sup>1</sup> ∨ *x*2) ∧ (*x*<sup>1</sup> ∨ *x*2), is given by *R*<sup>1</sup> = {*x*1, *x*2}, *R*<sup>2</sup> = {*x*1, *x*2}, *R* = {*x*1, *x*2, *x*1, *x*2}.

We also assume a function *ω* : *R* × *A* → {0, 1}, roughly corresponding to our *w* lookup, such that *ω*(*r*, *α*) is the Boolean value of literal *r* for the allocation set *α* (considering its possible negation). For example, assume that (in symbolical form): *r* = *x*1, *r* = *x*1; and *α* = {*x*<sup>1</sup> = 0, *x*<sup>2</sup> = 1}, i.e., the symbolical form of {1 : 0, 2 : 1}. Then, *ω*(*r*, *α*) = 0, *ω*(*r* , *α*) = 1. **Listing A3.** Pseudocode for the ruleset of Listing 4.


#### **References**


MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel. +41 61 683 77 34 Fax +41 61 302 89 18 www.mdpi.com

*Axioms* Editorial Office E-mail: axioms@mdpi.com www.mdpi.com/journal/axioms

MDPI St. Alban-Anlage 66 4052 Basel Switzerland

Tel: +41 61 683 77 34 Fax: +41 61 302 89 18

www.mdpi.com

ISBN 978-3-0365-3476-3