Combinatorics on Traces

Volker Diekert

Fakultät für Mathematik und Informatik Technische Universität München

Für

Christine, Florian, Nikolai und Michael Foreword

Research on formal methods for the description and analysis of the behaviour of nonsequential systems has increased considerably in the last decade. This was mainly due to the rapidly growing importance of multiprocessor configurations, distributed systems and communication networks. Another important factor of acceleration was that a number of older lines of research in informatics, mathematics and logic appeared to fit together when seen under the new aspects of distributedness, concurrency and communication, and that the new theoretical results were greatly needed by practitioners in order to cope with the complexity of nonsequential systems.

There are two main approaches to a theory of nonsequential systems. The older one, created by C.A. Petri at the beginning of the 1960’s, started out from the classical theory of sequential machines but uses as basic notions concurrency and asynchronous communication between distributed activities (which causes local state transformations). The fundamental concept is nonsequentiality, and sequential systems are simply the special cases where concurrency does not occur. The formal system model of this theory, the Petri net, was soon used widely in applications and inspired many theoretical investigations. The development of the Petri-net-related theory was particularly quick and fruitful when deeper connections to classical theories like that of formal languages, semilinear sets and vector addition systems were discovered and intensively used.

The second approach, developed at the end of the 1970’s by R. Milner and C.A.R. Hoare, was more programming language oriented and started out from the ideas around λ-calculus; it is based on the synchronous communication of sequential processes and was the basis for several programming languages and influential theories for the specification and semantics of communicating sequential systems.

One of the reasons for the great success of the Milner-Hoare theory is that it stays very close to the traditional concept of sequential systems. This pertains not only to the structure (non-sequential systems are obtained as parallel compositions of sequential components) but also to the semantics: The behaviour of a system is described from the point of view of one single sequential observer, who only can note sequences of actions or events. Thus concurrent activities of the system are noted in an arbitrary order, i.e. concurrency is modelled by nondeterminism. This allows to use the large body of knowledge from formal language and automata theory and from logics and semantics of sequential programming languages. But it cannot cope adequately with all phenomena of nonsequential systems.

In Petri’s approach a clear distinction between nondeterminism and concurrency is made: Concurrency is considered as a nontransitive relation, in particular it is different from simultaneity. Its complement is describing causal dependencies. Therefore the semantics is technically more complicated. Observations have to include the dependency of activities, i.e. are partially ordered structures for which not much classical theory existed. Although considerable progress has been made in this area, the mathematical treatment of partial order semantics in its full generality is quite cumbersome, such that it is worthwile to look for compromises between the two extremes.

The most successful idea for distinguisting concurrency from nondeterminism without departing too much from the well developed and nice sequential theory came from A. Mazurkiewicz already in 1977. His idea simply is to endow the sequential observer of a nonsequential system with a small amount of information about the structure of the system, namely its concurrency relation. This, however, is only meaningful for unlabelled systems, where actions at different positions have different names, and all are observable. It soon turned out that this nice trick associates well-known mathematical objects to nonsequential systems: the free partially commutative monoids, which are indeed intermediate between the free (noncommutative) monoids used in the Milner-Hoare theory and the free (totally) commutative monoids occuring when Petri nets are viewed from the standpoint of sequential automata theory (namely as vector addition systems).

Following Mazurkiewicz’s terminology, the theory of free partially commutative monoids is called trace theory when it is used for the semantics of nonsequential systems; these monoids are then called trace monoids and their elements traces since they denote traces of processes in nonsequential systems. Trace theory and other investigations of free partially commutative monoids are in a vivid development since a few years. It became clear that trace theory is a mathematically deep and beautiful, semantically powerful and flexible, and a very challenging part of theoretical informatics. This was particularly obvious at the international workshop on free partially commutative monoids organized by V. Diekert as part of the activities of the ESPRIT Basic Research Action No. 3166 “Algebraic and Syntactic Methods in Computer Science (ASMICS)” in October 1989 in Kochel am See, Bavaria, see [Die90c] and [Die90a].

V. Diekert has contributed considerably to this development in three different ways, which are brought together in this LNCS volume. He presents and extends the algebraic and combinatorial foundations of trace theory in a coherent way and embeds it in or relates it to other mathematical or informatical theories. He develops a new theory of replacement systems especially for trace monoids, and he enlarges the range of application of the theory to a much wider class of Petri nets than that considered previously.

This text is selfcontained apart from basic theoretical informatics and is written in a well readable form such that it may serve as a textbook for a first year graduate course.

Munich, April 1990 Wilfried Brauer

Preface

These notes are a treatise on partially commutative words, commonly called traces. The underlying algebraic structures are free partially commutative monoids which have been introduced by P. Cartier and D. Foata in order to solve some combinatorial problems of rearrangement. In computer science they have been recognized as an algebraic model for concurrency. This is essentially due to the work of A. Mazurkiewicz who also introduced the basic notions and the word trace. Mazurkiewicz used traces as a partial order semantics for safe Petri nets. Since his initiating work a systematic study of traces under various aspects has begun.

The present volume is an extended and revised version of the Habilitationsschrift of the author written at the Technical University of Munich. It contains some basic material on traces including Ochmanski’s characterization of recognizable trace languages and Zielonka’s theory of asynchronous automata. The third chapter is devoted to an application of this theory to a modular approach for the computation of Petri net languages. This is based on so-called local morphisms between nets which yield certain homomorphisms between the corresponding trace monoids and allows a convenient treatment of the synchronization of nets. Another part of these notes concern the Möbius function and its relations to semi-Thue systems. In the last chapter we generalize the concept of semi-Thue systems to a combinatorial theory of rewriting on traces. This can be viewed as an abstract calculus for transformations of concurrent processes.

Acknowledgements These notes would have not been written without Professor W. Brauer. I wish to thank him for constant encouragement and support over the last few years. Many fruitful discussions with him stimulated the progress of my work and led to substantial improvements.

Many thanks also to Professors M. Paul and D. Perrin who were further referees of my Habilitationsschrift.

I am also greatly indebted to all members of the group Theoretische Grundlagen der Informatik at Hamburg and Munich. In particular, I am grateful to Heino Carstensen, Jörg Desel, Matthias Jantzen, Dirk Hauschildt, Astrid Kiehn, Manfred Kunde, Klaus-Jörn Lange, Oliver Schoett, Dirk Taubner and Walter Vogler for various exchanges of ideas.

This work has also benefited very much from discussions with my colleagues: Ron Book, Christian Choffrut, Robert Cori, Christine Duboc, Zoltán Ésik, Dominique Foata, Massimiliano Goldwurm, Hendrik-Jan Hoogeboom, Roman König, Giancarlo Mauri, Ernst Mayr, Antoni Mazurkiewicz, Yves Métivier, Maurice Nivat, Edward Ochmanski, Friedrich Otto, Dominique Perrin, Jean-Eric Pin, Nicoletta Sabadini, Jacques Sakarovitch, Volker Strehl, Klaus Reinhardt, Grzegorz Rozenberg, Wolfgang Thomas, Celia Wrathall and Wieslaw Zielonka.

Many of them are gathered in the EBRA-working group No. 3166 “Algebraic and Syntactic Methods in Computer Science (ASMICS)” and/or in the EBRAproject No. 3148 “Design Methods Based on Nets (DEMON)”. I thank these ESPRIT Basic Research Actions, ASMICS and DEMON, for all kinds of support which helped me to complete this work.

Last but not least I thank Harald Hadwiger for his excellent work in transforming the handwritten manuscript into LaTEX and I thank Springer-Verlag for accepting it into its Lecture Notes series.

Munich, April 1990 Volker Diekert

Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1 Free Partially Commutative Monoids . . . . . . . . . . . . . . 9 1.1 An Introductory Example . . . . . . . . . . . . . . . . . . . . . . 9 1.2 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.3 The Levi Lemma for Traces . . . . . . . . . . . . . . . . . . . . . 19 1.4 A Categorial Approach to the General Embedding Theorem … 22 1.5 Algorithms Based on the Embedding Theorem . . . . . . . . . . . 29

2 Recognizable and Rational Trace Languages . . . . . . . . . . 37 2.1 Recognizable and Rational Subsets of a Monoid . . . . . . . . . . 37 2.2 Closure Properties of Recognizable Trace Languages . . . . . . . . 39 2.3 Ochmanski Theory . . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.4 Zielonka Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

3 Petri Nets and Synchronizations . . . . . . . . . . . . . . . . . 57 3.1 Local Morphisms of Petri Nets . . . . . . . . . . . . . . . . . . . . 57 3.2 Synchronization of Petri Nets . . . . . . . . . . . . . . . . . . . . 65 3.3 Local Checking of Trace Synchronizability . . . . . . . . . . . . . 67 3.4 Algorithms on Three-Colored Graphs . . . . . . . . . . . . . . . . 79

4 Complete Semi-Thue Systems and Möbius Functions …. 85 4.1 Semi-Thue Systems . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.2 Complete Presentations of Trace Monoids . . . . . . . . . . . . . 90 4.3 Unambiguous Möbius Functions . . . . . . . . . . . . . . . . . . . 93 4.4 Möbius Functions and Semi-Thue Systems . . . . . . . . . . . . . 103

5 Trace Replacement Systems . . . . . . . . . . . . . . . . . . . . 109 5.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.2 The Knuth-Bendix Completion . . . . . . . . . . . . . . . . . . . 113 5.3 Critical Pairs over Traces . . . . . . . . . . . . . . . . . . . . . . . 116 5.4 The Completion Procedure on Traces . . . . . . . . . . . . . . . . 127 5.5 Some Remarks on Complexity . . . . . . . . . . . . . . . . . . . . 131 5.6 The Condition G_{k}(S) for k ≥ 0 . . . . . . . . . . . . . . . . . . . 133 5.7 An Efficient Algorithm for Computing Irreducible Normal Forms . 137

5.8 Cones and Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

Conclusion and Outlook . . . . . . . . . . . . . . . . . . . . . . . . . 153

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

2

Introduction

Parallelism or concurrency is one of the fundamental concepts in computer science. One motivation for its use is simply to increase the efficiency of sequential programs. With the help of massive parallelism we may hope to solve problems which otherwise would be intractable. Besides this, parallelism serves also as a basis for a general methodology for designing or specifying software (and hardware).

Another important aspect of parallelism is that many existing and an increasing number of forthcoming systems are inherently concurrent. The wide range of such systems includes distributed, decentralised, loosely or tightly coupled, embedded, and reactive systems. The design, the analysis and the verification of such concurrent systems usually turns out to be a very difficult task.

There are essentially two reasons for this. The first one is that the behavior of concurrent systems is much more complex than that of comparable sequential centralized systems. The presence of concurrency implies that in most cases the behavior of a component cannot be understood in isolation. One has always to take into account its multiple interactions with other simultaneously active parts of the system. The second reason concerns the formal methods. They are far from being sufficiently developed for a rigorous formal treatment of concurrent systems. But without a satisfactory theoretical basis and a good formal framework, analysis and verification of concurrent systems can only be based on ad hoc proofs. Since finding ad hoc proofs is difficult this is usually expensive. Even worse, often it leads to mistakes. With the increasing importance of concurrency in computer science this situation is unacceptable. Therefore we need a deeper mathematical theory of parallelism.

A common approach to a systematic study of parallelism requires as a first step that one can associate with each concurrent system a well-defined mathematical object which denotes important aspects of its behavior. On a certain level of abstraction we may say that the setting of a concurrent system is given by a set of atomic actions X = {a, b, c, …} together with a specification of which actions can be performed independently or concurrently. Such a specification is given in our approach by an independence relation I ⊆ X × X. For technical reasons we shall assume that I is irreflexive and symmetric. This reflects that no action can act concurrently to itself and that independence is mutual. Actions which are not independent are called dependent. A concurrent process in this abstraction is a labelled acyclic graph where the labels of nodes are actions and edges represent an ordering between dependent actions. No edges are drawn between independent actions. This is called the dependence graph, or simply the trace, of the process. The trace describes a concurrent process just as a sequential process is described by a string. Simple as it is, the success of trace theory owes very much to this observation.

An execution of a concurrent process has to respect only the ordering between the dependent actions. It follows that if u, v are processes and a, b are independent actions, then uabv and ubav are nothing but different sequential runs of the same concurrent process, or different sequential observations of the same concurrent run.

This leads us to the equivalence relation generated by these pairs uabv, ubav, i.e., to the equivalence generated by the rearrangement of independent actions. Since this equivalence is a congruence, it defines a quotient monoid of X^{∗} which is called the free partially commutative monoid associated with X and I. These monoids have been introduced into combinatorics by P. Cartier and D. Foata. In our model, concurrent processes are associated via their dependence graphs with elements of a free partially commutative monoid. It turns out that the correspondence between dependence graphs and elements of a free partially commutative monoid is one-to-one.

From the graphical representation of a concurrent process by its trace, we may read immediate information. For example, we can see the effect of unbounded parallelism on the reduction in computation time. Namely, in a first parallel step we may perform the minimal elements of the dependence graph. In a second parallel step we may perform the minimal elements of the remaining graph, and so on. (The parallel steps are exactly the factors in the so-called Foata normal form; their number is just the minimal parallel computation time.)

In order to obtain more insight into traces, consider a concurrent process p and let a, b be (not necessarily different) dependent actions which occur in p. Then there is a directed path in the trace of p where all vertices with label a or b occur. Disregarding all other letters, we obtain a string over {a, b}^{∗}. A basic result in trace theory states that a trace is uniquely determined if we know these strings for all dependent a, b ∈ X. The connection between the dependence graphs and these strings over dependent letters has been established, apparently for the first time, by R. Keller in [Kel73]. In his paper the connection was shown directly without involving free partially commutative monoids explicitly. Also, the semantics of the Foata normal form as maximal parallelism is shown there.

However, it is mainly due to of the work of A. Mazurkiewicz that the attention of computer scientists was focused on free partially commutative monoids. Mazurkiewicz also introduced the notion of a trace. He was led to it when he studied the behavior of safe Petri nets, which are a widely adopted model for concurrent systems. A state of the concurrent system is represented by a distribution of tokens over the places and the actions of the system are the transitions of the net. This model incorporates intrinsically an independence relation between different transitions: they are independent if they are not adjacent to a common place. It was discovered by Mazurkiewicz that the behavior of a safe Petri net is best described by traces, [Maz77]. Since the initiating work of Mazurkiewicz traces have been taken up by many people and a profound study under various aspects has begun. The reader may also consult [Maz87], [AR88] and [Per89] for recent excellent overviews.

Let us mention some of the areas where trace theory has been applied. M. Flé and G. Roucairol used traces as a tool for serializability problems in distributed data bases, see [FR82].

The theory of COSY-path-expressions, [LTS79], can be directly formulated in terms of trace theory. There is also a close connection between abstract programming languages, like Milner’s calculus of communicating systems CCS, [Mil80], or Hoare’s language CSP of communicating sequential processes, [Hoa85], and traces in the sense used here – although this is less direct than in COSY.

The theory of formal languages over traces started with the investigation of recognizable subsets of free partially commutative monoids in [Fli74] . Recognizable sets are fundamental for any formal language theory. They are of further importance since they correspond to finite-state controlled structures. Therefore a lot of attention has been paid to them; in particular the relation to rational sets and decidability questions were investigated, see [AW86], [AH87], [BBMS81], [Bra76], [CM85], [CP85], [Mét86], [Sak87]. (This list is not meant to be complete.) Highlights in this area are Ochmanski’s characterization of recognizable languages, [Och85] and Zielonka’s work on asynchronous automata, [Zie87]. Of great interest too is the theory of solving equations over partially commutative variables, see [Dub86].

The application of trace theory to Petri nets has been of constant interest. In particular, the synchronization of trace languages as a tool for a modular computation of net languages has been recognized, see [Maz87].

Only recently have connections between trace theory and rewriting systems been studied. There are several approaches. The link to the theory of semi-Thue systems is the basis for [BL87], [Ott87], [NO88], or [Wra88]. In [Ott89] term rewriting methods from [Jou83] are applied to traces. In [Die87a] we initiated a theory which uses trace rewriting directly. This work has been continued in [Die89] and [Die90a]. Here, it is summarized and extended in the last chapter.

Some other, but not all, of the material above will be treated in this monograph. The contents are organized in detail as follows: The purpose of the first chapter is to introduce the general concepts. We start with an informal example in Sect. 1.1. In Sect. 1.2 we develop the combinatorial background. In particular we give a graph theoretical characterization for the factorization of a trace into subtraces. This elementary operation allows to transform graphical and formal proofs into each other. Section 1.4 gives a categorical approach to the general embedding theorem. The basis is some sort of duality between dependence graphs and free partially commutative monoids. This can be expressed by a contravariant functor. It is one of the reasons that we base our notation on dependence graphs instead of independence graphs. An important well-known result states that a covering of dependence graphs corresponds to an embedding of free partially commutative monoids. In particular, it is possible to represent a trace as a tuple of words. In Sect. 1.5 we present some efficient algorithms for computations which follow such a representation. These algorithms are suitable for implementation and up to constant factors they are of optimal time complexity. In particular we present a linear time algorithm for a subtrace test.

Chapter 2 is devoted to the relation between recognizable and rational sets. It is the least original chapter. No really new result is stated, but we have rewritten proofs. We present a straight path to Ochmanski’s theorem which characterizes recognizable languages in terms of so-called recognizable expressions, and we have included Zielonka’s theory of asynchronous automata.

The behavior of Petri nets in terms of traces is investigated in Chap. 3. In the literature this is limited to the case of safe nets, since for this class of nets, traces give a complete picture of the possible concurrency. For higher nets this is not true anymore. Nevertheless it is our aim to show that traces are a useful tool for Petri nets in general. We introduce so-called local morphisms between nets. The term ‘local’ is derived from the fact that the defining property can be checked locally at the places of the nets. The image net of a local morphism is always transition bounded; the local morphism itself may merge independent transitions together, but also places may be merged. Using local morphism we give a categorical definition of the synchronization of nets as a push-out. This generalizes the usual definition which is restricted to safe nets and to the case of place disjoint nets.

The rough idea behind all this is to imitate some concepts developed in topology. Following these concepts the notion of a covering is introduced. In its simplest case this corresponds to a covering by transition bounded subnets, or more precisely to the natural mapping from the disjoint union of nets to its synchronization. The hope is therefore that if we have a covering of a net N by a net N′ then the behavior of N′ has a simpler description than the behavior of N. Now, local morphisms relate the behavior of nets to each other. But, as in Sect. 1.4, we have a relation in the opposite direction. (However, this is quite natural. Think of the inclusion of nets, where one may restrict the language of the larger net to a smaller one. This is also an exchange of directions.) The main result of Sect. 3.1 states that if N′ → N is a covering of nets then the trace language of N may be identified with the intersection of the trace language of N′ and the image of the free partially commutative monoid which is given by the transitions of N together with their natural independence relation. Our theorem depends heavily on the use of traces. It could not even be formulated adequately without them. In fact, the importance of the theory of traces for higher nets is not the descriptive power of traces, but the convenient way we may compute with them.

In its simplest case the theorem yields back the result that the trace language of the synchronization of two nets is the synchronization of the two trace languages.

The synchronization of trace languages is studied in detail in Sect. 3.3. This section is based on a joint work with W. Vogler. The main result gives a graphtheoretical as well as an algebraic characterization of when the synchronization can be computed really locally on the components. This settles an open problem of [AR86]. Our characterization also has a close connection to the problem of reconstructability, as it is considered in [CM85].

In Sect. 3.4 we show that our graph theoretical condition is NP-complete. Hence, for large dependence alphabets it might be very difficult to decide whether the synchronization of trace languages allows a local description. However, in restricted cases we are able to give polynomial time algorithms.

The last two chapters concern the investigation of replacement systems. In Chap. 4 we concentrate on the classical theory of semi-Thue systems. In Sect. 4.1 we first recall the concepts of this theory and we introduce minimal critical pairs. We show that the confluence of noetherian systems can be checked on these minimal critical pairs. This result is important since it may increase the efficiency of the Knuth-Bendix completion procedure for semi-Thue systems.

In Sect. 4.2 we show that every (finitely generated) free partially commutative monoid has a presentation by some (finite) complete semi-Thue system. This complete system is constructed over the set of ‘parallel steps’. It yields thereby another and elegant proof for the Foata normal form theorem.

Due to a result of F. Otto, [Ott87], no complete presentation exists over a minimal set of generators, in general. In Sect. 4.3 we relate the result of Otto to a well-known conjecture on Möbius functions for free partially commutative monoids. In fact, we settle the conjecture. We thereby establish a direct link between the theory of semi-Thue systems and formal power series. This seems to be very promising for future research. A first step is taken in Sect. 4.4 where we consider arbitrary noetherian semi-Thue systems. We compute the formal inverse of the characteristic series over the irreducible words in terms of left-hand sides. This leads to the notion of an overlapping-chain. Short overlapping-chains have a direct interpretation and it turns out that the overlapping-chains of length three exactly correspond to minimal critical pairs, which were mentioned above. In fact, it was the search for an interpretation of overlapping-chains that led us to the consideration of minimal critical pairs.

In the final chapter we work with replacement systems directly over traces. These replacement systems generalize and unify the notion of semi-Thue systems and vector replacement systems. We base the replacement upon the factorization of traces, more precisely upon the rewriting of subtraces. The general idea of trace replacement systems, however is, to provide an abstract calculus for transformations of concurrent processes.

Let us explain this in more detail. Suppose, we are given a specification by a set of equations over concurrent processes. This may be viewed as a system of rules over traces. The question arises whether two concurrent processes may be transformed into each other by successive applications of the specified rules. In an algebraic translation this question becomes a word problem of a trace replacement system. In general, such a word problem is undecidable. It is solvable if the corresponding system is finite, noetherian and confluent.

The general procedure to find such systems is described by the Knuth-Bendix completion. But in working with traces new difficulties and phenomena arise. These concern mainly the critical pairs which are of overall importance in the completion procedure. We show that even for one-rule systems infinite sets of critical pairs may occur. We therefore have to put restrictions on the systems to ensure finite sets of critical pairs. The restrictions we give are decidable and always satisfied in the case of semi-Thue systems or vector replacement systems. But they go beyond this. We also propose a slightly modified version of the Knuth-Bendix completion which takes care of the restrictions only once in a final step. We give examples where we obtain complete systems which satisfy the restrictions even though at the beginning of the procedure they were violated. We also present examples of complete trace replacement systems which may not be decoded as any complete semi-Thue system or vector replacement system. Thus, our theory is a real generalization. It may be applied to situations where classical approaches fail.

In dealing with trace replacement systems, complexity questions are of central interest. For a given finite system one reduction step can be computed in linear time. This yields a time complexity for computing irreducible normal forms which is a square in the derivation length. We do not know whether this square time bound is optimal, but the restriction to semi-Thue systems or vector replacement systems yields linear time, due to a result of R. Book, [Boo82].

In virtue of this phenomenon we state a decidable sufficient condition which ensures that for a given finite noetherian system, irreducible normal forms can be computed in time linear in the derivation length by a very simple algorithm. This algorithm is a straightforward generalization of the one for semi-Thue systems. In a slightly different form the same algorithm has also been used for traces by C. Wrathall in [Wra88] and by R. Book and H. Liu in [BL87]. The main new result is that our condition is strong enough to decide the confluence in this case.

We also present a uniform algorithm to compute irreducible normal forms which works for every finite noetherian system. Its implementation depends heavily on the construction of Zielonka’s asynchronous automata. If the condition mentioned above is satisfied then this algorithm succeeds in linear time, but in general its worst case behavior is square time. It is a challenging open problem whether a different approach may yield substanially better results.

In the last section we restrict our attention to systems where all left hand sides have some geometric interpretation as cones or blocks. Cones and blocks are certain types of traces. The simplest examples of cones are words in a free monoid and of blocks are vectors in a free commutative monoid.

Thus, already these systems generalize the classical theory of semi-Thue or vector replacement systems. Nevertheless with respect to the problem of deciding confluence and to the time complexity question these systems behave as well as we are used to in the classical cases.

Theses notes are written on an elementary level; i.e., no particular familiarity is required except for some basic mathematical background. We give complete proofs in most cases.

After having read the first chapter, the reader may go straight to one of the following chapters.

8 Introduction

1. Free Partially Commutative Monoids

1.1 An Introductory Example

To give some impression of the background of trace theory we start with a rather informal example. This example reflects only a very small aspect of trace theory, but it may give a first flavour.

Consider a distributed database consisting of a set of records and a set of update transactions which may be performed concurrently. In order to avoid incorrect updates let us follow a protocol which allows concurrent read and exclusive write. To fix ideas, we suppose that our database has records w, x, y, z containing some integer values, and we intend to proceed a sequence of atomic transactions from the the following list:

(a) x := x + y

(b) x := w + x

(c) y := y + z

(d) w := 2y + z

(e) z := y + 2z

(f) x := w + x + y

(g) x := w + x + 2y

From the variables involved we obtain a dependence relation between the transactions which expresses that they may not be executed concurrently. We represent the dependence structure by a graph where the vertices are the transactions and edges are between dependent ones. In our example this yields Figure 1.1.

Let p be any sequence of transactions. Clearly, if we can write p = uxyv for some independent (i.e., not dependent) transactions x, y then the sequential execution of p′ = uyxv yields the same result as p. Since ‘yielding the same result’ is, a priori, an equivalence, we may consider the equivalence relation generated by these pairs (uxyv, uyxv) where x, y are independent. Every such equivalence class is called a trace. If p, p′ belong to the same trace then the effect of p on the database is the same as p′.

[figure: a; b; f; g; c; d; e]

Figure 1.1. Dependence graph of transactions

[figure: d; a; c; b; e; a; c]

Figure 1.2. The Hasse diagram of the trace p = dabcaec

Since the equivalence defined above is in fact a congruence, the set of traces form in a natural way a monoid. Thus we can compute with traces as we are used to do with sequences.

Moreover, traces provide us with some sort of partial order semantics. To define it, start with a sequence p = x_{1} … x_{n} of transactions. With p we associate a directed acyclic labelled graph as follows:

We take a vertex set {v_{1}, …, v_{n}}, where each vertex v_{i} is labelled with the value of x_{i} for i = 1, …, n. Then we draw directed edges from v_{i} to v_{j} if i < j and if x_{i} and x_{j} are dependent. As usual when working with partial orders we may omit redundant edges by drawing the Hasse diagram only.

For example, for p = dabcaec we obtain the graph as in Figure 1.2. The overall effect of p on the database is w := 2y+z, x := w+x+2y+z, y := 2y+4z, and z := y+3z and it is clear that this overall effect is the same for every sequence of transactions which yields the same graph as above.

[figure: d; f; c; e; a; c]

Figure 1.3. The Hasse diagram of p where ab is replaced by f

This graph is called the dependence graph of p. In fact, the trace belonging to the sequence p can be identified with its dependence graph. From this graph we get immediately information on what can be done in parallel: In a first step we may execute exactly those transactions which are minimal in the dependence graph. Taking away the corresponding elements, we obtain new minimal elements which can be performed in a second parallel step and so forth.

This greedy algorithm yields the minimal parallel execution time. In the example above we obtain a sequence of four parallel steps:

{a, d}, {b, c}, {a, e}, {c}.

Later we shall see that this corresponds to the Foata normal form of the trace.

The assumption that update transactions are atomic is a strong simplification. More realistically, we should view a transaction as a finite sequence of atomic actions. This leads to a finer trace model. In particular, it is suitable to handle problems of serializibility, see e.g. [FR85].

Let us briefly discuss another point. In our introductory example ab has the same effect as the transaction f = (x := w + x + y). It follows that in every sequence where ab occurs, we may replace ab by f. This is obviously the case in p = dabcaec, but we may replace ab by f also in p′ = adcbeac, simply because p and p′ describe the same trace. The replacement of ab by f may be viewed as an application of a transformation rule. It may be defined on the dependence graph by substituting the subgraph a → b by f and drawing edges in the ‘right-way’. For p it yields a dependence graph as in Figure 1.3. Observe that the transaction f has to be executed before c and after d, otherwise we would not obtain the same result in the execution anymore. Since we have replaced two actions by one, the sequential time of the replaced process has decreased. But note that the parallel time needs one step more.

A further inspection of the transactions shows that an execution of aba has the same effect as g = (x := x+2y +w). But in the graph belonging to the trace p = dabcaec, a replacement of the subgraph a → b → a by g would lead to serious problems. Indeed, the effect of a{b, c}a on the record x is (x := x + 2y + z + w), the effect of gc it is (x := x+2y +w), and of cg it is (x := x+2y +2z +w). Thus gc ≠ a{b, c}a ≠ cg. Since c occurs after the first a and before the second a the effect of the execution aba depends on the context c. Algebraically this means that aba is not a factor of the trace in Figure 1.2. Taking this into account we shall develop an abstract calculus of transformations which is based on a replacement of so-called subtraces in the last chapter.

1.2 Basic Definitions

In this section we introduce the basic notions of trace theory and we state some elementary results which will be used throughout. A dependence alphabet is a pair (X, D) where X is a (finite) alphabet and D ⊆ X × X is a reflexive, symmetric relation, the dependence relation. The complement of D is irreflexive and symmetric; it is called the independence relation and is denoted by I = X×X\D. Let =_{c} be the equivalence relation on X^{∗} which is generated by all pairs of the form (uabv, ubav) for u, v ∈ X^{∗}, (a, b) ∈ I. Then =_{c} is a congruence and the set of congruence classes forms a monoid M(X, D) with the multiplication [u] · [v] = [uv]. The neutral element is the class of the empty word, it is denoted by 1.

These monoids are called free partially commutative, [Lal79]. They were first studied in mathematics by P. Cartier and D. Foata, [CF69], in order to solve some combinatorial problems. In computer science A. Mazurkiewicz [Maz77] introduced them in connection with the analysis of safe net systems.

Mazurkiewicz called an element of a free partially commutative monoid a trace. This notation is now standard and adopted here. Also we will use the notation trace monoid as an abbreviation for finitely generated free partially commutative monoid.

To explain the term free partially commutative monoid consider any other monoid M. Then a homomorphism of M(X, D) to M is completely determined by a mapping f : X → M (freeness) such that f(a) · f(b) = f(b) · f(a) for all (a, b) ∈ I (partial commutativity).

For example, let (X′, D′), (X, D) be dependence alphabets such that X′ ⊆ X and D′ ⊆ D. Consider the mapping p : X → M(X′, D′) given by p(x) = x if x ∈ X′ and p(x) = 1 otherwise. Obviously, it holds p(a)p(b) = p(b)p(a) in M(X′, D′) for all (a, b) ∈ I. Thus, we obtain a homomorphism p : M(X, D) → M(X′, D′). We refer to this mapping as the canonical projection of M(X, D) onto M(X′, D′).

We have two extreme cases of dependence relations, namely D = X × X and D = id_{X}. The first one yields the free monoid M(X, X × X) = X^{∗}, the second one the free commutative monoid M(X, id_{X}) = IN^{|X|} with basis X. By IN^{|X|} we denote the set of mappings from X to the natural numbers IN which are zero almost everywhere. The monoid structure is given by the usual addition. If X is finite then IN^{|X|} = IN^{X} = set of all mappings from X to IN. Since id_{X} ⊆ D ⊆ X × X for every dependence relation we always have the following sequence of canonical projections:

X^{∗} → M(X, D) → IN^{|X|}

The composition of these mappings coincides with the usual Parikh mapping from words to vectors.

Let w ∈ X^{∗} be a word and let t ∈ M(X, D) be the congruence class of w. We shall write t = [w] to denote this, or simply t = w, if there is no risk of confusion. For the word w we have the usual terms of length, denoted by |w|, for a letter a ∈ X the a-length of w, denoted by |w|_{a} (= number of a occuring in the string w), and alphabet of w, denoted by alph(w) (= {a ∈ X | |w|_{a} ≥ 1}). The meaning of these terms translates immediately to traces. Thus we may write |t| := |w|, |t|_{a} := |w|_{a}, alph(t) := alph(w) for t = [w]. It is also very useful to extend the independence relation I = X × X \ D to words over X and traces in M(X, D). We say that u, v ∈ X^{∗} (u, v ∈ M(X, D) respectively) are independent if alph(u) × alph(v) ⊆ I. Frequently we shall simply write (u, v) ∈ I for this, too.

So far, traces are equivalence classes of words and we can use words to represent them. This allows ambiguity since different words may denote the same trace. This ambiguity vanishes if we represent traces in some normal forms. Historically the first one was given by D. Foata.

In order to define it, let F be the following set of finite non-empty subsets of pairwise independent letters:

F = {F ⊆ X | ∅ ≠ F is finite and (a, b) ∈ I for all a, b ∈ F, a ≠ b}.

Each F ∈ F is called an elementary step and it yields a trace [F] ∈ M(X, D) by taking the product over its elements, [F] = ∏_{a∈F} a. Note that this is well-defined

since F ∈ F consists of finitely many pairwise commuting elements, only.

With the definition of elementary steps the Foata normal form theorem can be stated as follows.

Theorem 1.2.1 ([CF69, Thm 1.2]) Let t ∈ M(X, D) be a trace. There exists exactly one sequence of elementary steps (F_{1}, …, F_{r}), r ≥ 0, F_{i} ∈ F for 1 ≤ i ≤ r such that t = [F_{1}] … [F_{r}] and for all b ∈ F_{i}, 2 ≤ i ≤ r there is some a ∈ F_{i−1} with (a, b) ∈ D. □

There are several different proofs of this basic theorem. In the last chapter we will present a proof which is based on complete semi-Thue systems. It is also possible to derive the Foata normal form from Corollary 1.4.7 below, see Remark 1.4.9 in Sect. 1.4. As a direct consequence from Theorem 1.2.1 free partially commutative monoids are cancellative, see [CF69, Cor. 1.3].

A second possibility to get unique representations of traces is given by their so-called lexicographical normal forms:

Let t ∈ M(X, D) be a trace then the number of strings w ∈ X^{∗} with t = [w] is finite and these strings must have same length. If there is a linear order on X then among these w ∈ X^{∗} with t = [w] there is a string which is lexicographically the first one. This string is called the lexicographic normal form of t. The following proposition characterizes lexicographic normal forms. This proposition is due to A. V. Anisimov and E. Knuth, it has been published in [Per84, Thm. 2.2.].

Proposition 1.2.2 Let (X, D) be a dependence alphabet and ≤ be a linear ordering of X. Then, a word w ∈ X^{∗} is the lexicographic normal form of a trace in M(X, D) if and only if for each factor aub of w with a, b ∈ X, u ∈ X^{∗}, (au, b) ∈ I it holds a < b.

Proof: Clearly, if a lexicographic normal form w of a trace contains a factor aub with (au, b) ∈ I then a < b. For the other direction assume that w, w′ ∈ X^{∗} denote the same trace and that w is lexicographically before w′. Then w = w_{1}aw_{2}, w′ = w_{1}bw′_{2} for some w_{1}, w_{2}, w′_{2} ∈ X^{∗} and a < b. Since free partially commutative monoids are cancellative, aw_{2} and bw′_{2} denote the same trace. But then bw′_{2} = buaw′′_{2} for some u, w′′_{2} ∈ X^{∗}, a ∉ alph(u), and (bu, a) ∈ I. □

Corollary 1.2.3 The set of lexicographic normal forms is a regular language. □

Besides the string representation of traces, traces are given by certain graphs. This graphical representation is extremly helpful.

By a labelled acyclic graph (over X) we understand a triple (V, E, λ) where (V, E) is a finite directed acyclic graph with vertex set V and edge set E ⊆ V ×V and where λ : V → X is a labelling function.

We say that a labelled acyclic graph (V, E, λ) is a dependence graph (over (X, D)) if edges are between different vertices with dependent labels and no further edges exist. The set of isomorphism classes of dependence graphs over (X, D) form a monoid with the multiplication

\begin{aligned}[V_{1}, E_{1}, λ_{1}][V_{2}, E_{2}, λ_{2}] & = & [V_{1} ˙∪V_{2}, E_{1} ˙∪E_{2} ˙∪\{(x, y) ∈ V_{1} × V_{2} | \\ & & (λ(x), λ(y)) ∈ D\}, λ_{1} ˙∪λ_{2}] \end{aligned}

and the neutral element 1 = [∅, ∅, ∅].

For a moment, let Dep(X, D) be this monoid of isomorphism classes. We have a natural mapping dep : X → Dep(X, D) which associates with each letter a ∈ X the dependence graph consisting of one point with label a.

[figure: a; b; c; d; e]

Figure 1.4. Our home-example of a dependence alphabet (X, D)

If (a, b) ∈ I then dep(a) dep(b) and dep(b) dep(a) yield the same graph which consists of two points, labelled a and b, and without any edge. Thus, as explained above, there is a natural homomorphism dep : M(X, D) → Dep(X, D). The mapping dep is surjective since Dep(X, D) is generated by its one-point graphs.

To see that dep is injective let t = [F_{1}] … [F_{r}] be a trace in Foata normal form. Clearly, dep(t) = dep([F_{1}]) … dep([F_{r}]) and one easily sees that for 1 ≤ i ≤ r we have a ∈ F_{i} if and only if there is a vertex x in dep(t) with label a and the longest directed path ending in x has length i − 1. Hence, from dep(t) we get back the Foata normal form of t.

The following well-known proposition is therefore nothing but an easy translation of Foata’s normal form theorem.

Proposition 1.2.4 The free partially commutative monoid M(X, D) is canonically isomorphic to Dep(X, D). □

In the following, a trace t ∈ M(X, D) will simply be identified with its dependence graph dep(t). If the dependence alphabet (X, D) is fixed then the whole information of t is contained in the Hasse diagram of dep(t). Thus, we need not to draw redundant edges. On the other hand, sometimes it is more useful to think of a trace as a labelled partially ordered set. We obtain this partial order as the transitive closure of the directed edges. Again, no information is lost. We therefore have several possibilities to represent a trace and we shall always choose the most appropriate one.

Example: Let (X, D) be given by Figure 1.4 where edges are drawn between different dependent letters.

Let t ∈ M(X, D) be the trace which is given by the string eacbd. Then this trace is also given in the following way: a) Foata normal form: {a, e}, {b, c}, {d},

b) lexicographic normal form: abecd

c) dependence graph:

[figure: e; a; c; b; d]

d) Hasse diagram:

[figure: e; a; c; b; d]

e) the labelled partial order which is obtained from the dependence graph or the Hasse diagram above by setting x ≤ y if there is a directed path from vertex x to vertex y. □

Minimal and maximal elements of traces will be used frequently, for example, in inductive proofs. Let t ∈ M(X, D) be a trace. The set of minimal (maximal respecitively) elements of t is defined by min(t)= {a ∈ X | t = [au] for some u ∈ X^{∗}} (max(t)= {a ∈ X | t = [va] for some v ∈ X^{∗}}). Since these elements commute, they define a trace by taking their product. We denote again this trace by min(t) (max(t) respectively). Then for some u, v ∈ M(X, D) we have t = min(t)u = v max(t). Of course, the sets min(t) and max(t) respectively coincide with the labels of the minimal respectively maximal elements of the dependences graph of t. The trace min(t) is also exactly the first factor in the Foata normal form of t. On the other hand, max(t) need not to be the last factor. This results since Foata normal forms are computed from the left to the right. For example, let t = aab where a and b are independent. Then the Foata normal form of t is {a, b}{a}, but max(t) = {a, b}.

More generally, let t ∈ M(X, D) be a trace and let l ⊆ t be any subset in the dependence graph of t. Then the subgraph induced by l is a dependence graph. Hence it defines a unique trace l ∈ M(X, D).

We shall use the following convention. If u ⊆ t, v ⊆ t are subsets of t then t = u ∪ v, (t = u ˙∪v), means that the labelled vertex set of t is the (disjoint) union of the labelled vertex sets of u and v. The (disjoint) union is not meant with respect to the edge sets. We say that l ⊆ t is a subtrace if for some u, v ⊆ t with t = u ˙∪l ˙∪v we may write t = ulv. Thus, a subtrace corresponds to a factor of t. The other way round, if we have a factorization t = ulv for some u, l, v ∈ M(X, D) then there is a unique way to identify these elements with subtraces of t.

Viewing a trace t as a labelled partial order, we have the following simple but important characterization of subtraces:

Lemma 1.2.5 Let t ∈ M(X, D) be a trace and l ⊆ t be a subset of the dependence graph of t. Let ≤ be the induced partial order on t. Then l ⊆ t is a subtrace of t if and only if for all x, z ∈ l, y ∈ t with x ≤ y ≤ z it holds y ∈ l.

Proof: Let l ⊆ t be a subtrace and write t = ulv for some subtraces u, v ⊆ t with t = u ˙∪l ˙∪v. Let x, z ∈ l and y ∈ t with x ≤ y ≤ z. Then x ≤ y implies y ∉ u and y ≤ z implies y ∉ v, hence y ∈ l.

Assume now, that t is a trace and l ⊆ t is a subset such that for all x, z ∈ l, y ∈ t with x ≤ y ≤ z it holds y ∈ l. If min(t) ⊆ l and max(t) ⊆ l then we have t ⊆ l, hence l = t and l is a subtrace. In the other case say without restriction, there is a ∈ min(t) with a ∉ l. Then we may write t = at′ with l ⊆ t′. By induction on the cardinality of t \ l we obtain that l is a subtrace of t′. Hence t′ = u′lv and t = au′lv. □

Remark 1.2.6 To test whether l ⊆ t defines a subtrace we used the labelled partial order given by t. The reason is that for the dependence graph of t or its Hasse diagram such a test is ‘global’. For these graphs it is not possible to decide in the direct neighborhood of l whether l ⊆ t is a subtrace: Let (X, D) be given by:

a  b  c  d  e.

Consider a situation as in Figure 1.5. In the first case {a, e} ⊆ t_{1} is a subtrace, whereas {a, e} is no subtrace of t_{2}. □

From the characterization of subtraces above we obtain the following fact:

Remark 1.2.7 If t ∈ M(X, D) is a trace and l_{1} ⊆ t, l_{2} ⊆ t are subtraces then l_{1} ∩ l_{2} is subtrace of t, too. □

[figure: t_{2} = ab^{n}cd^{n}e =; t_{1} = ab^{n}d^{n}e =; e; a; e; a; d; b; d; b; d; b; d; b; c]

Figure 1.5. The set l = ae is a subtrace of t_{1} but not of t_{2}

If t ∈ M(X, D) is a trace and l ⊆ t is a subtrace, then we define the subtrace pre(l) of elements before l, suf(l) of elements behind l, and ind(l) of elements independent of l by the following formulae:

pre(l) = {x ∈ t \ l | ∃y ∈ l : x ≤ y},
suf(l) = {z ∈ t \ l | ∃y ∈ l : y ≤ z},
ind(l) = t \ (pre(l) ∪ l ∪ suf(l)).

Note that ind defines a symmetric relation on subtraces l_{1}, l_{2} of t. We have l_{1} ⊆ ind(l_{2}) if and only if l_{2} ⊆ ind(l_{1}). Furthermore, if l_{1} ⊆ ind(l_{2}) then we have (l_{1}, l_{2}) ∈ I. A picture for a partitition of traces based on these subtraces is given by Figure 1.6. The ind(l)-part has been devided into two parts in order to reflect the factorization of the next proposition.

Proposition 1.2.8 Let u, v, t ∈ M(X, D) be traces and l ⊆ t be a subtrace of t. Then we have t = ulv if and only if u = pre(l)u_{1}, v = v_{1} suf(l) for some u_{1}, v_{1} ∈ M(X, D) with u_{1}v_{1} = ind(l).

Proof: Of course, t = pre(l)u_{1}lv_{1} suf(l) holds for all factorizations u_{1}v_{1} = ind(l). Hence, one direction is trivial. For the other direction, assume t = ulv and identify u ⊆ t, v ⊆ t with subtraces. We must have pre(l) ⊆ u, suf(l) ⊆ v; and we can write u = pre(l)u_{1}, v = v_{1} suf(l) for some u_{1}, v_{1} ∈ M(X, D). Since u ∩ suf(l) = ∅, we have u_{1} ⊆ ind(l) and hence t = pre(l)u_{1}lv_{1} suf(l) = pre(l)lu_{1}v_{1} suf(l). Since t = pre(l)l ind(l) suf(l) by the other direction, we obtain u_{1}v_{1} = ind(l) by the cancellativity of free partially commutative monoids. □

Let l ⊆ t be any subset of a trace t. Then we may define the generated subtrace of l in t by the set {y ∈ t | ∃x, z ∈ l : x ≤ y ≤ z}. This set is a subtrace of t and will be denoted by ⟨l⟩. An alternative definition of ⟨l⟩ is given by the intersection of all subtraces l′ ⊆ t which contain l. Thus, ⟨l⟩ is the smallest subtrace of t which contains the subset l of t.

1.3 The Levi Lemma for Traces

Levi’s Lemma for strings has the following generalization:

Proposition 1.3.1 ([CP85, Prop 1.3]) Let x, y, z, t ∈ M(X, D) be traces. Then the following assertions are equivalent:

i) xy = zt

ii) x = ru, y = vs, z = rv, t = us for some r, u, v, s ∈ M(X, D) such that (u, v) ∈ I.

[figure: pre(l); ind(l); ind(l); suf(l); l]

Figure 1.6. Picture of a trace t with a subtrace l ⊆ t.

[figure: =; =; x; y; z; t; r; v; s; u]

Figure 1.7. The “proof” of Levi’s Lemma for traces

Furthermore, if xy = zt then the corresponding traces r, u, v, s ∈ M(X, D) in ii) are uniquely determined and for all letters a ∈ X we have: |r|_{a} = min(|x|_{a}, |z|_{a}), |u|_{a} = |x|_{a} − |r|_{a}, |s|_{a} = min(|y|_{a}, |t|_{a}), and |v|_{a} = |y|_{a} − |s|_{a}.

Proof: ii) ⇒ i): trivial, since (u, v) ∈ I implies uv = vu.

i) ⇒ ii): Let w = xy = zt and identify x, y, z, t with subtraces of w. Define the subtraces r = x ∩ z, u = x ∩ t, v = y ∩ z, s = y ∩ t as in Figure 1.7. Directly from the definition, we obtain x = ru, y = vs, z = rv and t = us. We have to show (u, v) ∈ I, only. Since w = rvus = ruvs, we must have pre(v) ⊆ r and suf(v) ⊆ s, see Proposition 1.2.8. Hence u ⊆ ind(v) since r, u, v, s are pairwise disjoint subtraces. But now u ⊆ ind(v) implies (u, v) ∈ I. Thus, we have ii). To see that r, u, v, s are uniquely determined, simply observe that (u, v) ∈ I implies alph(u) ∩ alph(v) = ∅. Hence we obtain the formulae |r|_{a} = min(|x|_{a}, |z|_{a}) and |s|_{a} = min(|y|_{a}, |t|_{a}) for all a ∈ X. The other two formulae follow. The uniqueness of these subtraces is also clear. □

Let M be any monoid and s, t ∈ M be elements. We say that s is a proper divisor of t if t = usv for some u, v ∈ M with u ≠ 1 or v ≠ 1. We say that the divisor relation is noetherian if there are no infinite chains t_{0}, t_{1}, t_{2}, … such that t_{i+1} is a proper divisor of t_{i} for all i ≥ 0. The following fact is well-known.

Lemma 1.3.2 Let M be a monoid where the divisor relation is noetherian. Then M is generated by the set X = (M \ {1}) \ (M \ {1})^{2}. The inclusion X ↪ M induces a surjective homomorphism π : X^{∗} → M such that π^{−1}(1) = {1}.

Proof: The fact that π : X^{∗} → M is surjective follows easily by noetherian induction. To see that π^{−1}(1) = {1} assume the contrary and let w ∈ X^{+} be the shortest non-empty word such that π(w) = 1. By definition of X the word w is not a letter. Thus, we may write w = uv with π(u) ≠ 1 and π(v) ≠ 1. It follows 1 = π(w) = π(u)π(v) and 1 is a proper divisor of itself. This contradics the hypothesis that the divisor relation is noetherian. □

Remark 1.3.3 The divisor relation is noetherian in free partially commutative monoids. This follows since traces have a length and the length of a trace t is zero only if t = 1. The surjective homomorphism mentioned in the lemma above is the canonical projection p : X^{∗} → M(X, D). Elementary examples where the divisor relation is not noetherian are non-trivial groups or the boolean semi-ring B = {0, 1}.

Definition: Let M be a monoid, we say that Levi’s Lemma holds in M if for all x, y, z, t ∈ M which satisfy xy = zt there are r, u, v, s ∈ M such that x = ru, y = vs, z = rv, t = us and uv = vu.

Remark 1.3.4 Levi Lemma holds in free partially commutative monoids by Proposition 1.3.1. But it holds also in every abelian group or in the boolean semi-ring B. In particular, Levi Lemma alone is not enough to characterize free partially commutative monoids. □

The following algebraic characteriziation of free partially commutative monoids is due to Christine Duboc. It is a generalization of Levi’s result on free monoids, [Lev44]. Later we shall use the corollary below in order to prove that certain fibered products are free partially commutative.

Theorem 1.3.5 ([Dub86, Thm 3.1.6]) A monoid is free partially commutative if and only if the divisor relation is noetherian and Levi’s Lemma holds in it.

Proof: By the remarks above only the ‘if’ part of the assertion requires a proof. Let M be a monoid such that the divisor relation is noetherian and the Levi Lemma holds in M. Define X = (M \{1})\(M \{1})^{2}, and let p : X^{∗} → M be the surjective homomorphism from Lemma 1.3.2. Say that a, b ∈ X, a ≠ b are dependent if ab ≠ ba in M. This gives us a dependence alphabet (X, D), and it is clear that p factorizes through M(X, D). Thus, we obtain a natural surjective homomorphism, denoted again p : M(X, D) → M. We prove by noetherian induction that p is injective. Let t_{1}, t_{2} ∈ M(X, D) such that p(t_{1}) = p(t_{2}) and assume that every proper divisor of p(t_{1}) has exactly one inverse image. If t_{1} ∈ (X ∪ {1}) then t_{1} = t_{2} since p^{−1}(x) = {x} for all x ∈ (X ∪ {1}). If t_{1} ∉ (X ∪ {1}) then we may write t_{1} = xy, t_{2} = zt with x, z ∈ X and y ≠ 1, t ≠ 1. Since p(x)p(y) = p(z)p(t) and p is surjective, Levi’s Lemma for M tells us that there are traces r, u, v, s ∈ M(X, D) such that p(x) = p(r)p(u), p(y) = p(v)p(s), p(z) = p(r)p(v), p(t) = p(u)p(s) and p(uv) = p(vu). Since p(x), p(y), p(z) and p(t) are proper divisors of p(t_{1}) we have x = ru, y = vs, z = rv, and t = us. Now, if r ≠ 1 or s ≠ 1 then p(uv) is a proper divisor of p(t_{1}), too; and it follows uv = vu in M(X, D). Hence t_{1} = ruvs = rvus = t_{2} in this case. Therefore we are reduced to show t_{1} = t_{2} for r = s = 1. If r = s = 1 then u = x ∈ X and v = z ∈ X; hence u, v ∈ X are independent letters and t_{1} = uv = vu = t_{2} are the same trace by the very definition of (X, D). □

Corollary 1.3.6 A submonoid of a free partially commutative monoid is free partially commutative if and only if Levi’s Lemma holds in it.

Proof: Let M′ be a submonoid of a monoid M such that the divisor relation is noetherian in M. Then the divisor relation is noetherian in M′, too. Hence the corollary follows directly from Theorem 1.3.5. □

Remark 1.3.7 The statement of Theorem 1.3.5 given here is slightly different from [Dub86]. C. Duboc does not use the property that the divisor relation is noetherian. Instead she demands that the monoid has a length, i.e., a homomorphism to IN such that the inverse image of 0 is the identity. Clearly, if a monoid has a length then the divisor relation is noetherian. But the converse is false: Consider M = {a, b, c}^{∗}/abc = cb. Since the congruence classes are finite, the divisor relation is noetherian; but M has no length. Thus, our condition is a little bit weaker. □

1.4 A Categorial Approach to the General Embedding Theorem

One of the fundamental properties of free partially commutative monoids states that every such monoid is embeddable in a direct product of free monoids. We will give a proof for this fact from a categorial viewpoint. In fact, this approach yields more general results and it clearifies the real connection between free partially commutative monoids and dependence alphabets. In the following we use the language of categories. For the notions the reader may consult the textbook of S. MacLane [Mac70] or any other books on categories. Nevertheless, the main results can be understood without any knowledge in category theory by the explicit definitions given below. Some results of this section may also be found in [Fis86], where the ideas have been developed in collaboration with the present author. A previous version of this section has also been presented in [DV88].

Every dependence alphabet (X, D) may be viewed as an undirected graph where edges are drawn between different dependent letters. Conversely, given

any undirected graph G = (X, E) with vertex set X and edge set E ⊆ ( \begin{matrix}X \\ 2 \end{matrix} ) =

{{x, y} | x, y ∈ X, x ≠ y} then G corresponds to the dependence alphabet (X, D) with D = {(x, y) ∈ X × X | {x, y} ∈ E or x = y}; let us denote the associated free partially commutative monoid with M(G) = M(X, D). In order to give a functorial meaning to M, we have to say what we understand by a morphism h : (X′, E′) → (X, E) of undirected graphs. We define it as a mapping h : X′ → X such that h^{−1}(x) is finite for all x ∈ X and such that {x′, y′} ∈ E′ implies {h(x′), h(y′)} ∈ E. Note that in particular we have h(x′) ≠ h(y′) for all edges {x′, y′} ∈ E′. The assumption that the fibers h^{−1}(x) are finite is made only to include infinitely generated free partially commutative monoids in our theory. This assumption is not necessary if one deals with finite alphabets only. Clearly, undirected graphs form a category with this kind of morphisms.

Let h : G′ → G be a morphism of undirected graphs, G′ = (X′, E′), G = (X, E) then we define a homomorphism of monoids in the opposite direction M(h) : M(G) → M(G′) by M(h)(y) := ∏_{x∈h^{−1}(y)} x (=product over all elements

in h^{−1}(y)) for y ∈ X and we extend M(h) by multiplication M(h)([y_{1} … y_{n}]) = [M(h)(y_{1}) … M(h)(y_{n})]. To see that M(h) is well-defined let x_{1}, x_{2} ∈ X′ and y_{1} = h(x_{1}), y_{2} = h(x_{2}) ∈ X. Assume that there is no edge between y_{1} and y_{2}. Then there is no edge between x_{1} and x_{2} neither, hence x_{1}x_{2} = x_{2}x_{1} in M(G′). For y = y_{1} = y_{2} this means that the finite product ∏_{x∈h^{−1}(y)} x is a well-defined

trace, for y_{1} ≠ y_{2} this means that the images of independent letters commute; hence M(h) is a well-defined homomorphism.

Proposition 1.4.1 The construction above defines a contravariant functor M from the category of undirected graphs to the category of free partially commutative monoids.

Proof: Obviously, M(id_{G}) = id_{M(G)} for the identity mapping. Let f : G → G′, g : G′ → G′′ be morphisms of undirected graphs. Let z be a vertex

of G′′ then (gh)^{−1}(z) is the disjoint union ⋃_{y∈g^{−1}(z)}^{·} h^{−1}(z). Hence M(gh)(z) =

∏_{y∈g^{−1}(z)} M(h)(z) = M(h)( ∏_{y∈g^{−1}(z)} y) = M(h)M(g)(z). □

Example: i) Let A, B be any sets and f : A → B be a mapping such that f^{−1}(b) is finite for all b ∈ B. We may view f as morphism of undirected graphs f : (A, ∅) → (B, ∅). The associated free partially commutative monoids are IN^{|A|} and IN^{|B|} respectively. The homomorphism M(f) has a very natural interpretation in this case:

M(f) = f^{∗} : IN^{|B|} → IN^{|A|}, m ↦ m f : A →^{f} B →^{m} IN.

ii) Let (X′, D′), (X, D) be dependence alphabets such that X′ ⊆ X and D′ ⊆ D. The functor M applied to the following diagram of inclusions:

(X, X × X)  ↩  (X, D)  ↩  (X, id_{X})
↑  ↑  ↑
(X′, X′ × X′)  ↩  (X′, D′)  ↩  (X, id_{X′})

yields the following diagram of canonical projections:

X^{∗}  →  M(X, D)  →  IN^{|X|}
↓  ↓  ↓

X^{′∗}  →  M(X′, D′)  →  IN^{|X′|} □

For undirected graphs G_{1}, G_{2} we denote their disjoint union by G_{1} ˙∪G_{2}. The complex product G_{1} ∗ G_{2} is defined by the disjoint union together with the additional edges {x_{1}, x_{2}} for all vertices x_{i} of G_{i}, i = 1, 2. Obviously the functor M behaves on these constructions as follows:

Proposition 1.4.2 Let G_{1}, G_{2} be undirected graphs and M_{i} = M(G_{i}) be the associated free partially commutative monoids, i = 1, 2. Then the functor M applied to the canonical injections:

G_{i} ↪  G_{1} ˙∪G_{2}  ↪  G_{1} ∗ G_{2},
(disjoint union)  (complex product)

yields the canonical projections:

M_{1} ∗ M_{2} →  M_{1} × M_{2}  → M_{i} , i = 1, 2. □
(free product)  (direct product)

Another very elementary fact is established next.

Lemma 1.4.3 Let h : G′ → G be a morphism of undirected graphs. Then for all vertices x′ of G′ and all traces t ∈ M(G) we have x′ ∈ alph(M(h)(t)) if and only if h(x′) ∈ alph(t).

Proof: Trivial □

The main interest in the contravariant functor results from the next theorem. This theorem was stated first in [Fis86, Thm. 2.1].

Theorem 1.4.4 Let h : G′ → G be a morphism of undirected graphs and M(h) : M(G) → M(G′) be the associated homomorphism of free partially commutative monoids. Then it holds:

i) The homomorphism M(h) is surjective if and only if h is injective.

ii) The homomorphism M(h) is injective if and only if h is surjective on vertices and edges.

Proof: Let G′ = (X′, E′), G = (X, E) and M′ = M(G′), M = M(G). For simplification we denote the homomorphism M(h) by h^{∗} : M → M′ .

i): Let h : G′ → G be injective. We may view this as an inclusion, X′ ⊆ X, E′ ⊆ E and the morphism h^{∗} : M → M′ becomes the canonical projection of M((X, E)) onto M((X′, E′)).

Now, let h^{∗} : M → M′ be surjective and x, y ∈ X′ such that h(x) = h(y). We have to show x = y. Since h^{∗} is surjective we find a trace t ∈ M with h^{∗}(t) = x. Hence alph(h^{∗}(t)) = {x}. Applying Lemma 1.4.3 twice we have h(y) = h(x) ∈ alph(t) and y ∈ alph(h^{∗}(t)) = {x}; hence x = y.

ii): Assume first that h^{∗} : M → M′ is injective. If h would be not surjective on vertices then there would be some y ∈ X such that h^{−1}(y) is empty. This implies h^{∗}(y) = 1 which is impossible.

If h would be not surjective on edges then there would be some edge {y, z} ∈ E such that all letters in h^{−1}({y, z}) commute in M′. This implies h^{∗}(yz) = h^{∗}(zy) in M′ which is impossible for injective h^{∗} since yz ≠ zy in M.

The most interesting part of the theorem is the other direction of ii) which will be proved now by contradiction using functorial properties. Let h^{∗}(t) = h^{∗}(z) for some t, z ∈ M(G) with t ≠ z. Take u ∈ M(G) of maximal length such that t = ut_{1}, z = uz_{1} for some t_{1}, z_{1}. Then we may assume that we can write t_{1} = at_{2} for some a ∈ X, t_{2} ∈ M(G). Consider the graph inclusion i_{a} : ({a}, ∅) ↪ (X, E). Since h is surjective on vertices we have i_{a} = hf for some f : (a, ∅) ↪ (X′, E′). Hence i_{a}^{∗} = f^{∗}h^{∗} by functorial properties. Since h^{∗}(t) = h^{∗}(z) it follows |t|_{a} = i_{a}^{∗}(t) = i_{a}^{∗}(z) = |z|_{a}. Hence z_{1} = vaw for some v, w ∈ M(G). We may assume that v has minimal length for such a factorization. In particular a ∉ v. On the other hand by the maximality of u we may conclude that v contains a letter b ∈ X which depends on a. Hence we find an edge e = {a, b} ∈ E. Now consider the graph inclusion i_{a,b} : ({a, b}, e) ↪ (X, E). We apply the same argument again. Since h is surjective on edges we have i_{a,b} = fh for some f : ({a, b}, e) ↪ (X, E). It follows p_{a,b}(t) = i_{a,b}^{∗}(t) = i_{a,b}^{∗}(z) = p_{a,b}^{∗}(z) where p_{a,b} : M(G) → {a, b}^{∗} denotes the canonical projection. Since {a, b}^{∗} is cancellative we have p_{a,b}(u) = p_{a,b}(v). But p_{a,b}(u) starts with the letter a while p_{a,b}(u) starts with the letter b. This is a contradiction. □

Corollary 1.4.5 (General Embedding Theorem) Let G be an undirected graph and let {G_{j} | j ∈ J} be a family of subgraphs.

For j ∈ J let π_{j} : M(G) → M(G_{j}) denote the canonical projection and let π : M(G) → ∏_{j∈J} M(G_{j}) be the homomorphism to the direct product given

by π(t) = (π_{j}(t))_{j∈J}. Then the canonical mapping π is injective if and only if

G = ⋃_{j∈J} G_{j}.

Proof: Since the alphabet of each trace is finite, it is easy to see that we are reduced to prove the corollary for finite index sets J only. In the case of finite J we have a canonical morphism of undirected graphs from the disjoint union ˙⋃_{j∈J}G_{j} to G. Hence a diagram:

[figure: G_{j}; G; =; ⋃_{j∈J} G_{j}; ˙⋃_{j∈J}G_{j}; (= disjoint union)]

We may apply the functor M to this diagram and we obtain:

[figure: M(G_{j}); M(G); ∏_{j∈J} M(G_{j}); π_{j}; π; p_{j}]

In this diagram p_{j} denotes the j-th projection, π_{j} and π are as above. Thus the result follows directly from Theorem 1.4.4. □

Remark 1.4.6 Note that the direct product ∏_{j∈J} M(G_{j}) is, in general, not a free

partially commutative monoid since if {M_{j} | j ∈ J} is any family of non-trivial free partially commutative monoids then ∏_{j∈J} M_{j} is free partially commutative if

and only if J is finite.

Indeed, if J is finite then ∏_{j∈J} M_{j} is such a monoid and if J is infinite then it

is enough to observe that the divisor relation is not noetherian for the infinite direct product ∏_{j∈J} M_{j} where M_{j} = IN for all j ∈ J.

How does this fit in our categorial set up? Let G = ⋃_{j∈J} G_{j} and let G̃ = ⋃_{j∈J}^{·} G_{j}

be the disjoint union of the subgraphs G_{j}, j ∈ J. Then M(G̃) is the weak product ⨁_{j∈J} M(G_{j}). This means it is the submonoid of the direct product which consists of

those elements where almost all components are 1. (The plus sign ⨁ is used here to denote weak products. Note however that if differs from the categorial direct sum of monoids. This is the free product which is denoted by the sign ∗.) Now, we obtain a natural morphism G̃ → G in our category of undirected graphs only if for each vertex x of G there are at most finitely many j ∈ J such that x ∈ G_{j}. In this case, of course, we obtain a natural embedding π : M(G) ↪ ⨁_{j∈J} M(G_{j}).

But in general the weak product is not large enough to allow such an embedding. We have to use the direct product. This is unavoidable. It can be shown that the “infinite starfish” M = M_{0}∗(⨁_{i>0} M_{i}) with M_{i} ≅ IN for all i ≥ 0 is not embeddable

in any weak product of free monoids. □

A graph is called complete, or a clique, if any two vertices are connected by an edge. Since every graph is covered by cliques and cliques correspond to free monoids, a special case of Theorem 1.4.4 is the following embedding theorem. For trace monoids it was stated in [CL85, Lemma 3.1] and [CP85, Prop. 1.1]; at least implicitly it also stated in [Kel73, Lemma 2.5]. In terms of histories it can be derived from [Shi79].

Corollary 1.4.7 (Embedding Theorem) Every free partially commutative monoid is a submonoid of a direct product of free monoids. □

For each graph there is one natural choice for a covering by cliques. We can take its edge set and its isolated vertices. One obtains the following version of the embedding theorem:

Corollary 1.4.8 Let (X, D) be a dependence alphabet, E = {{x, y} | (x, y) ∈ D} and Z = {z ∈ X | (y, z) ∉ D ∀y ∈ X, y ≠ z}. Then the canonical projections define an embedding:

π : M(X, D) ↪ ( ∏_{{x,y}∈E}{x, y}^{∗}) × (⨁_{z∈Z} z^{∗}) □

Remark 1.4.9 Let us show how to derive the Foata normal form theorem, Theorem 1.2.1, from the corollary above. For a trace t ∈ M(X, D) the set min(t) of minimal elements as defined in Sect. 1.2 is computable from the embedding π in Corollary 1.4.8. This gives a recursive procedure to compute the Foata normal form of t. The unicity of the normal form is also clear, since π is injective.

Corollary 1.4.10 Free partially commutative monoids are cancellative.

Proof: We already stated in the beginning that this is a consequence of Foata’s theorem. Here, we see it directly from the embedding theorem since direct products of free monoids are cancellative for trivial reasons. □

By the embedding theorem we may represent a trace as a tuple of words. This allows efficient computations on traces which are very easy to implement. In the next section we give some examples of such algorithms. The complexity of these algorithms depends, of course, of the number of components one uses to represent traces. This is the number of cliques which cover the dependence graph of the underlying dependence alphabet. In order to have a small number of cliques one usually tries to find a covering by maximal cliques. Note, however, that there are sometimes several different coverings by maximal cliques:

Example: Let (X, D) be the dependence alphabet which is given by Figure 1.8 and which represents a octahedron. Then there are two different coverings by maximal cliques. The first one corresponds to the embedding

π_{1} : M(X, D) ↪ {a, b, c}^{∗} × {a, d, e}^{∗} × {b, d, f}^{∗} × {c, e, f}^{∗}

The second one corresponds to the embedding

π_{2} : M(X, D) ↪ {d, e, f}^{∗} × {a, b, d}^{∗} × {a, c, e}^{∗} × {b, c, f}^{∗} □

[figure: d; f; e; b; c; a]

Figure 1.8. The octahedron with two different coverings by maximal cliques

1.5 Algorithms Based on the Embedding Theorem

The representation of a trace as a tuple of words leads to efficient algorithms which are suitable for implementation. We describe some of them in detail. We give algorithms which compute the Foata normal form, the lexicographic normal form, and we give a test whether one trace is a subtrace of another. This subtrace test is an anticipation of the last chapter where we investigate replacement systems over traces.

By (X, D) we mean a fixed, finite dependence alphabet. We choose a covering by cliques (X, D) = (⋃_{i=1}^{k} X_{i}, ⋃_{i=1}^{k}(X_{i} ×X_{i})) such that we obtain an embedding:

π : M(X, D) ↪ ∏_{i=1}^{k} X_{i}^{∗} , X = ⋃_{i=1}^{k} X_{i} , D = ⋃_{i=1}^{k}(X_{i} × X_{i}).

A letter of X is called in this section a character and a string means a sequence of characters. By a step we mean a subset of pairwise commuting letters of X. The Foata normal form will be computed as a step sequence. By a tuple we mean an array of k strings. An index means any number in {1, …, k}. An index set denotes any subset of {1, …, k}, and for each a ∈ X we denote by component(a) the index set {i ∈ {1, …, k} | a ∈ X_{i}}.

The term 1 is used to denote the empty string, the empty step-sequence, or the tuple of empty strings. We use some other notations and operations on strings, tuples etc. which meaning will become clear from the context. Every character is also viewed as a string, every string is also viewed as a tuple by using the embedding π. In fact this embedding may be realized by the following trivial algorithm:

Algorithm: function π(s:string):tuple var i:index; var a:char; var t:tuple:=1; while s≠1 do a:=first(s); s:=rest(s);

for all i ∈ component(a)

do t[i]:=t[i]·a

endfor endwhile return t endfunction

The functions we shall use are always assumed to be strict in the sense that once an argument yields an undefined value, the whole function has an undefined value. This happens however only on incorrect inputs, i.e., if the input does not satisfy the specification of the function.

The next function computes the minimal elements of a trace, i.e., the first factor of the Foata normal form. For later use we consider firstly the case that some minimal letters are already known.

The algorithm looks somewhat complicated. Nevertheless the idea is simply that a letter a ∈ X is minimal in a trace t ∈ M(X, D) if and only if a = first(t[i]) for all i ∈ component(a). The slightly complicated structure results only since we tried to be efficient.

Algorithm: function min 1(m:step,t:tuple ∥ t represents a trace with m ⊆ min(t)):step; var B:boolean:=true; var a:char; var F:step:=m; var i,j:index; var I,J:index-set; I:={i ∈{1,…,k}| t[i] ≠ 1 and i ∉ component(a) for all a ∈ m }; (“ New minimal elements must have a component in I ”) while I ≠ ∅ do choose any i ∈ I; I:=I \{i};

a:=first(t[i]); J:=component(a) \{i};

(“ a is a candidat for a new minimal element ”)

while J ≠∅ and B

do choose any j ∈ J; if j ∈ I and a=first(t[j]) (“If t[j]=1 then first(t[j]) is not defined and t is not a trace. (Incorrect input!) The value of the function is undefined in this case since the functions are strict.”) then I:=I\{j}; J:=J\{j} (“ a is still a candidat ”) else B:=false (“ The candidat a is not minimal ”) endif

endwhile;

if B

then F:=F ∪{a}

else B:=true

endif endwhile return F endfunction

If a tuple t does not represent a trace then the input of the function min 1 is not correct and it may yield the value undefined.

But since the input is not inspected at its whole length (for reasons of efficiency in the later algorithms) we can not force this. Moreover since there is some non-determinism in the algorithm above it may happen that on the same incorrect input the value of the function is sometimes undefined and sometimes a step. This results from the possible choices for j ∈ J in the second while-loop. However on correct inputs as specified in the definition of min 1 everything works correctly.

The first factor of the Foata normal form is now:

Algorithm: function min(t:tuple ∥ t represents a trace):step; return min 1(∅,t) endfunction

If l, t ∈ M(X, D) are traces and l is a prefix of t then we denote by l^{−1}t the trace r ∈ M(X, D) such that t = lr. We may view l^{−1}t as a shorthand of a function in two arguments which is defined if l is a prefix of t and which value has the same type as t in this case.

The next algorithm computes the Foata normal form of a trace in linear time on a Turing machine. As a byproduct we obtain a test whether a tuple represents a trace since the value of that function will be defined if and only if the input satisfies the specification.

Algorithm: function Foata-NF(t:tuple ∥ t represents a trace):step-sequence; var F:step; var S:step-sequence:=1; while t≠1 do F:=min(t); S:=S·F; t:=F^{−1}t endwhile return S endfunction

In order to compute the lexicographic normal form of a trace we assume that X is partially ordered such that every step is totally ordered. For example, X itself is totally ordered. The first letter of a step F with respect to this ordering is denoted by lexfirst(F).

Algorithm: function lex-NF(t:tuple ∥ t represents a trace):string; var a:char; var s:string:=1; var F:step:=min(t); while F≠ ∅ do a:=lexfirst(F);

s:=sa; t:=a^{−1}t;

F:=min 1(F\{a},t) endwhile return s endfunction

The algorithm above works again in linear time and it may also be used as a test whether a tuple represents a trace.

Our final goal in this section is to compute a factorization t = pre(l)lu′ for l being a subtrace of the trace t. More precisely, we define functions subtr(l, t) and pre(l, t) of two tuple parameters l and t which represent traces. The value of subtr(l, t) is boolean and true if and only if l is a subtrace. The function pre(l, t) gives the value pre(l) at the first occurrence where we meet l as a subtrace of t. If l and t represent traces but l is no subtrace of t then the value of the function pre(l, t) will be undefined. But we do not say what happens if l or t is a tuple which does not represent a trace. (Such a specification is omitted since again we do not want to inspect the whole input if, for example, l is a prefix of t).

The idea of the function pre(l, t) (and subtr(l, t)) is as follows: if l is a prefix of t then we set pre(l, t) = 1. Otherwise we find an index i ∈ {1, …, k} such that l[i] is no prefix of t[i]. If, in the latter case, we have |l[i]| ≥ |t[i]| then l is no subtrace of t. Otherwise, let a be the first letter of t[i]. Then we may compute recursively pre(l, t) = pre(a, t) a pre(l, (pre(a, t)a)^{−1}t).

We first define a function which takes as input a letter a ∈ X, a trace t ∈ M(X, D) with a ∈ t. It returns the value a if a ∈ min(t) and the value of some b ∈ min(t) such that b ∈ pre(a) otherwise. Note that this does not define a function in the pure sense, since we have nondeterministic output. The variable I below is used to ensure termination even on incorrect input.

Algorithm: function minchar(a:char,t:tuple ∥ t represents a trace such that a ∈ t):char; var i:index; var I:index-set:=∅; var x:char:=a; repeat choose any i ∈ component(x) \ I;

x:=first(t[i]); I:=I∪{i})

until component(x)⊆I return x endfunction

The algorithm to compute minchar terminates in all cases since the index set I is augmented in each loop. But the value of minchar may be undefined on incorrect input. This happens if we want to assign x := first(t[i]), but t[i] is empty since, for example, a ∉ t.

Let us sketch how to prove the correctness of the algorithm above. Let n ≥ 1 be the number of repeat-loops and a_{i} (I_{i} respectively) the values of the variable x (variable I respectively) after the i-th round. Then we have a_{n} ≤ a_{n−1} ≤ … ≤ a_{1} ≤ a_{0} = a. The crucial point is that if a_{i−1} ≠ a_{i} then component(a_{i})∩I_{i−1} = ∅.

From the function above it is very easy to compute pre(a) for a ∈ t where a is a letter and t is a trace. We denote this function by prechar, it is computed in time O(|t|). Although we use the non-deterministic function minchar in it, it is clear that the result depends deterministically on the input.

Algorithm: function prechar(a:char,t:tuple ∥ t represents a trace such that a ∈ t):tuple; var b:char:=minchar(a,t) var s:tuple:=1; while a ≠ b do s:=s·b; t:=b^{−1}t

b:=minchar(a,t) endwhile return s endfunction

If we want to test whether a trace l is subtrace of a trace t, we may proceed as follows.

Algorithm: function subtr(l,t:tuple ∥ l and t represent traces):boolean; var i:index; var a:char; var B:boolean:=true; while l is no prefix of t and B do choose any i such that l[i] is not a prefix of t[i];

if |l[i]| ≥ |t[i]|

then B:=false (“l is not a subtrace of t”)

else a:=first(t[i]);

t:=(prechar(a,t)a)^{−1}t endif

endwhile return B endfunction

Now we handle the case where l is a subtrace of t. We can compute the subtrace of elements before the first occurrence of l as follows:

Algorithm: function pre(l,t:tuple ∥ l ⊆ t is a subtrace):tuple; var i:index; var a:char; var s:tuple; var p:tuple:=1; while l is no prefix of t do choose any i such that l[i] is not a prefix of t[i];

a:=first(t[i]);

s:=prechar(a,t)·a; p:=p·s; t:=s^{−1}t

endwhile return p endfunction

If we know that l and t represent traces then the function pre(l, t) can be used as a subtrace test, too. Since then the value of the function is undefined if and only if l is no subtrace of t.

The time complexity of the function above is O(|l·t|). As in all our algorithms we viewed the alphabet X and the number k of covering cliques as fixed. If X and k are viewed as variable then we have to multiply the complexity by a factor O(k · #X).

36 1. Free Partially Commutative Monoids

2. Recognizable and Rational Trace Languages

2.1 Recognizable and Rational Subsets of a Monoid

In this section we recall some very basic concepts of formal language theory in arbitrary monoids. We give no proofs. They are standard and can be found elsewhere, for example, in [Eil74].

Let M be any monoid. The set of rational expressions, RAT(M), is inductively defined as the smallest set satisfying the following conditions:

If E ⊆ M is finite  then E ∈ RAT(M).
If E_{1}, E_{2} ∈ RAT(M) then (E_{1} ∪ E_{2}) ∈ RAT(M), E_{1} · E_{2} ∈ RAT(M), and E_{1}^{∗} ∈ RAT(M).

The symbols ∪, ·, ∗ are interpreted formally and brackets are used to avoid ambiguity. To each rational expression E ∈ RAT(M) we associate a rational language L(E) ⊆ M by giving the usual semantics to ∪, ·, ∗; i.e., L(E) = E if E ⊆ M is finite, L(E_{1} ∪ E_{2}) = L(E_{1}) ∪ L(E_{2}) (= union), L(E_{1} · E_{2}) = L(E_{1}) · L(E_{2}) = {m_{1}m_{2} ∈ M | m_{i} ∈ L(M_{i}), i = 1, 2} (= concatenation), and L(E^{∗}) = L(E)^{∗} (= generated submonoid).

The set of rational languages of M is denoted by Rat(M).

Proposition 2.1.1 Let E ⊆ M be a subset of a monoid M. Then we have E ∈ Rat(M) if and only if there is a finite alphabet X, a homomorphism h : X^{∗} → M, and a rational language L ⊆ Rat(X^{∗}) such that h(L) = E. □

Corollary 2.1.2 The following assertions hold:

i) M ∈ Rat(M) if and only if M is finitely generated.

ii) If f : M → M′ is a homomorphism of monoids and E ∈ Rat(M) then f(E) ∈ Rat(M′).

iii) If f : M → M′ is a surjective homomorphism then E′ ∈ Rat(M′) if and only if E′ = f(E) for some E ∈ Rat(M). □

An M-automaton is a quadruple A = (Z, δ, q_{0}, F) where Z is the non-empty set of states, δ : Z × M → Z, δ(q, m) = qm is the (partially defined) transition mapping such that q1 = q, (qm)n = q(mn) for all q ∈ Z, m, n ∈ M, q_{0} ∈ Z is the initial state and F ⊆ Z is the set of final states. An M-automaton is called finite if it has only finitely many states. The accepted language of an M-automaton A = (Z, δ, q_{0}, F) is the set L(A) = {m ∈ M | q_{0}m ∈ F }. If L = L(A) for some finite automaton then L is called recognizable. The set of recognizable subsets of M is denoted by Rec(M).

Let L ⊆ M be any subset then the following automaton A_{L} = (Z, δ, q_{0}, F) accepts L where Z = {L(x) | x ∈ M}, L(x) = {y ∈ M | xy ∈ L} for x ∈ M, δ(L(x), y) := L(xy) for x, y ∈ M, q_{0} = L(1) and F = {L(x) | x ∈ L}. The automaton A_{L} is called the minimal automaton of L.

Let y, y′ ∈ M then we have δ(L(x), y) = δ(L(x), y′) for all x ∈ M if and only if for all x, z ∈ M the assertions xyz ∈ L and xy′z ∈ L are equivalent. We write y ≡_{L} y′ in this case. The relation ≡_{L} is a congruence and the quotient monoid Synt(L) = M/_{≡_{L}} is called the syntactic monoid of M. Note that for the canonical morphism h : M → M/_{≡_{L}} we have L = h^{−1}h(L).

Proposition 2.1.3 Let L ⊆ M be a subset of a monoid M. Then the following assertions are equivalent:

i) The subset L ⊆ M is recognizable.

ii) The minimal automaton A_{L} is finite.

iii) The syntactic monoid Synt(L) is finite. □

Corollary 2.1.4 Let f : M → M′ be a homomorphism of monoids. If L′ ∈ Rec(M′) then f^{−1}(L′) ∈ Rec(M). If f is surjective then f^{−1}(L′) ∈ Rec(M) implies L′ ∈ Rec(M′), too. □

Corollary 2.1.5 The recognizable subsets, Rec(M), form a boolean algebra: they are closed under finite union, finite intersection and complementation. □

If M = X^{∗} is a finitely generated monoid then Kleene’s theorem asserts Rec(X^{∗}) = Rat(X^{∗}). In general, both sets are incomparable. However, in finitely generated monoids recognizable subsets are rational:

Corollary 2.1.6 A monoid M is finitely generated if and only if

Rec(M) ⊆ Rat(M). □

Probably the most simple examples where one has a proper containment of Rec(M) in Rat(M) are given by infinite groups. Indeed, let M = G be any group and U ⊆ G be a subgroup. Then U is recognizable in G if and only if it is of finite index in G. Hence, the rational set {1} ⊆ G is recognizable if and only if G is a finite group. This observation leads to an elegant way to deduce that the rational set (1, 1)^{∗} ⊆ IN × IN is not recognizable in IN × IN. In particular, we need no pumping lemma to see this: Let f : IN × IN → Z be the surjective homomorphism onto the group of integers defined by f(1, 0) = 1, f(0, 1) = −1; then f^{−1}(0) = (1, 1)^{∗}. Thus (1, 1)^{∗} would be recognizable only if {0} ∈ Rec(Z): But Z is an infinite group.

2.2 Closure Properties of Recognizable Trace Languages

Rational trace languages are called existentially regular in [AR86] or [AW86] and regular in [Sak87]. On the other hand, regular for trace languages means recognizable in [Och85] or [Zie87] and this is called consistently regular in [AR86], [AW86]. Thus, regular has different meanings. Although the meaning of consistently and existentially regular trace languages is also clear, we prefer to continue to speak of rational and recognizable languages. The notation of regular sets is reserved for rational (or recognizable) subsets of finitely generated free monoids. This seems also to be in accordance with the classical terminology and avoids any confusion.

Let M = M(X, D) be the trace monoid of a fixed finite dependence alphabet (X, D). As before, we write (u, v) ∈ I for u, v ∈ M if alph(u) × alph(v) ⊆ I = X × X \ D.

Clearly, finite trace languages are recognizable and Rec(M) is closed under union. It belongs also to folklore that if M is not free then Rec(M) is not closed under the star operator and hence Rec(M) is properly contained in Rat(M). This can be derived, for example, from the fact that (1, 1)^{∗} ∉ Rec(IN × IN).

The first non-trivial result in this area was obtained by M. Fliess. It states that Rec(M) is closed under concatenation:

Proposition 2.2.1 ([Fli74, Prop. 2.2.15]) Let A, B ∈ Rec(M) be recognizable trace languages then AB ∈ Rec(M).

The original proof by Fliess using Hankel matrices is quite involved. The proof we give here is a slight modification of the one given in [CP85]. This modification is used to develop a linear time algorithm which computes a factorization z = xy with x ∈ A, y ∈ B for given trace z ∈ AB, c.f. Corollary 2.2.3 below, see also [AW86]. The idea behind the proof is to construct first (implicitly) a non-deterministic automaton which recognizes AB and then to define a real M-automaton by the usual power set construction.

Proof: Recall that the states of the minimal automaton which recognizes A (B resp.) are denoted by A(x) (B(x) resp.) with x ∈ M. Consider the following finite set: Q = {(A(x), B(y), alph(y)) | x, y ∈ M}.

For a trace z ∈ M let V (z) = {(A(x), B(y), alph(y)) | z = xy} and Z = {V (z) | z ∈ M}. The set Z is a subset of the finite powerset of Q. There is a natural way to define an operation δ of M on Z, namely by δ(V (z), m) = V (zm). However, the problem is to show that this is well-defined; i.e., if V (z_{1}) = V (z_{2}) for traces z_{1}, z_{2} ∈ M then we have to show V (z_{1}m) = V (z_{2}m) for all m ∈ M. In fact, it is enough to show V (z_{1}a) = V (z_{2}a) for all a ∈ X.

Assume for a moment that we have shown this already then we are through. Indeed,

A = (Z, δ, V (1), {V (z) | z ∈ AB})

is a finite M-automaton which recognizes AB. (Note that V (z_{1}) = V (z_{2}) with z_{2} ∈ AB implies z_{1} ∈ AB by definition of V (z) for z ∈ M.)

In order to prove that the operation δ : Z × M → Z is well-defined we are going back to work on the set Q.

Define a mapping

η : Q × X → Q by η((A(x), B(y), alph(y)), a) = (A(x), B(ya), alph(ya))

and a partial mapping

ϵ : Q × X → Q

by ϵ((A(x), B(y), alph(y)), a) = (A(xa), B(y), alph(y)) if y and a are independent (i.e. (y, a) ∈ I) and undefined otherwise.

(One could view the relation η∪ϵ ⊆ Q×X×Q as edges of a non-deterministic automaton. But we do not insist on this explicitly.)

The remaining claim that V (z_{1}) = V (z_{2}) implies V (z_{1}a) = V (z_{2}a) for all z_{1}, z_{2} ∈ M, a ∈ X, is a consequence of the following lemma.

Lemma 2.2.2 For all z ∈ M and a ∈ X we have

V (za) = η(V (z), a) ∪ ϵ(V (z), a).

Proof: From the definition of η and ϵ we have η(V (z), a) ∪ ϵ(V (z), a) ⊆ V (za). Let (A(x), B(y), alph(y)) ∈ V (za). Then xy = za and by Levi’s Lemma we have x = ru, y = vs, z = rv, a = us for some r, u, v, s ∈ M with (u, v) ∈ I. It follows (A(r), B(v), alph(v)) ∈ V (z). There are two cases, first: u = 1 and s = a, second: u = a and s = 1. In the first case (A(x), B(y), alph(y)) ∈ η(V (z), a) in the second (A(x), B(y), alph(y)) ∈ ϵ(V (z), a). □

Corollary 2.2.3 Let A, B ∈ Rec(M) be recognizable trace languages. Then there is a linear time algorithm which decides on input of a trace z ∈ M whether z ∈ AB and if z ∈ AB then it computes x ∈ A, y ∈ B such that z = xy.

Proof: Let z ∈ M be a trace. We may assume that z is given in the form z = a_{1} … a_{m} with m ≥ 0 and a_{i} ∈ X for 1 ≤ i ≤ m. In time O(m) we compute the sequence V (1), V (a_{1}), V (a_{1}a_{2}), …, V (a_{1} … a_{m}), and we have z ∈ AB if and only if V (z) = V (a_{1} … a_{m}) ∈ F. Assume z ∈ AB then choose q_{m} = (A(x′), B(y′), alph(y′)) ∈ V (z) such that x′ ∈ A, y′ ∈ B. By Lemma 2.2.2 there is a sequence (q_{m}, …, q_{1}, q_{0}) such that q_{0} = (A(1), B(1), ∅) and q_{i} = η(q_{i−1}, a_{i}) or q_{i} = ϵ(q_{i−1}, a_{i}) for all 1 ≤ i ≤ m. Again, this sequence can be computed in O(m) steps, starting with q_{m}. Finally, set x_{0} = y_{0} = 1 and for i = 1, …, m define traces x_{i}, y_{i} inductively as follows: if q_{i} = η(q_{i−1}, a_{i}) then x_{i} := x_{i−1}, y_{i} := y_{i−1}a_{i} else x_{i} := x_{i−1}a_{i}, y_{i} := y_{i−1}. Thus, the whole procedure to compute x_{m}, y_{m} is done in time O(m). It suffices to show z = x_{m}y_{m} and x_{m} ∈ A, y_{m} ∈ B. But this is clear since for all 0 ≤ i ≤ m we have a_{1} … a_{i} = x_{i}y_{i} and q_{i} = (A(x_{i}), B(y_{i}), alph(y_{i})). Hence z = x_{m}y_{m}, and(A(x_{m}), B(y_{m}), alph(y_{m})) = (A(x′), B(y′), alph(y′)) and it follows x_{m} ∈ A, y_{m} ∈ B. □

A trace t ∈ M is called connected if the dependence graph of t is connected or, what amounts to the same, if the letters of alph(t) induce a connected subgraph in the graph of the dependence alphabet (X, D). Every trace t ∈ M has a partition into connected components t = t_{1} ˙∪ … ˙∪t_{n} where t_{i} ⊆ t are non-empty connected subtraces and (t_{i}, t_{j}) ∈ I for 1 ≤ i, j ≤ n, i ≠ j. Obviously, every trace is the product of its connected components. Let L ⊆ M be any trace language then we define the language of its connected components by

Con(L) = {x ∈ M | x is a connected component of some t ∈ L}.

Note that we never have 1 ∈ Con(L) although 1 ∈ M is a connected trace.

Proposition 2.2.4 ([Och85, Lemma 8.1]) Let L ∈ Rec(M) be a recognizable trace language then we have Con(L) ∈ Rec(M).

Proof: Let t ∈ M be any trace. Then y ∈ M is a connected component of t if and only if alph(y) is a non-empty connected subgraph in (X, D) and t = yz for some z ∈ M with alph(y) × alph(z) ∈ I. Hence Con(L) is a finite union of languages of type L_{Y,Z} = {y ∈ M | alph(y) = Y and ∃z ∈ M : yz ∈ L, alph(z) ⊆ Z}. Since the set {y ∈ M | alph(y) = Y } is recognizable, it is enough to show that L_{Z} = {y ∈ M | ∃z ∈ M : yz ∈ L, alph(z) ⊆ Z} is recognizable for every subalphabet Z ⊆ X.

But this is easy: Let A = (Q, δ, q_{0}, F) be any finite M-automaton with L(A) = L. Changing the set of final states we obtain effectively a finite Mautomaton A_{Z} = (Q, δ, q_{0}, {q ∈ Q | ∃z ∈ M : δ(q, z) ∈ F and alph(z) ⊆ Z}) which recognizes L_{Z}. □

The next lemma is due to R. Cori and D. Perrin. It is a generalization of the Levi Lemma for traces.

Lemma 2.2.5 ([CP85, Cor. 1.4]) Let x, y, z_{1}, …, z_{m} ∈ M be traces, m ≥ 1 such that xy = z_{1} … z_{m}. Then there are r_{i}, s_{i} ∈ M, 1 ≤ i ≤ m such that x = r_{1} … r_{m}, y = s_{1} … s_{m}, z_{i} = r_{i}s_{i} for 1 ≤ i ≤ m and (r_{j}, s_{i}) ∈ I for 1 ≤ i < j ≤ m.

Proof: Let t = xy = z_{1} … z_{m}. The proof results directly from Figure 2.1.

Formally, view x, y, z_{1}, …, z_{m} ⊆ t as subtraces of t. Define r_{i} = x ∩ z_{i}, s_{i} = y ∩ z_{i} for 1 ≤ i ≤ m. It follows x = r_{1} … r_{m}, y = s_{1} … s_{m}, and z_{i} = r_{i}s_{i} for 1 ≤ i ≤ m. Let 1 ≤ i < j ≤ m, then r_{j} ∩ pre(s_{i}) = ∅ since t = (r_{1}s_{1}) … (r_{i}s_{i}) … (r_{j}s_{j}) … (r_{m}s_{m}). Analogously, since t = r_{1} … r_{m}s_{1} … s_{m} we have r_{j} ∩ suf(s_{i}) = ∅. Hence r_{j} ⊆ ind(s_{i}), and this implies (r_{j}, s_{i}) ∈ I. □

The following proposition has been shown independently by E. Ochmanski and Y. Métivier. The paper of Métivier is based on previous results obtained by Cori/Perrin, [CP85, Thm. 2.1], and Cori/Métivier, [CM85, Thm. 2.7].

Proposition 2.2.6 ([Och85, Lemma 8.2], [Mét86, Thm. 2.3]) Let L ∈ Rec(M) be a recognizable trace language which consists of connected traces only, i.e., L \ {1} = Con(L). Then we have L^{∗} ∈ Rec(M).

Proof[Mét86]: For a trace x ∈ M let V (x) be set of tuples

(L(r_{1}), …, L(r_{n}), alph(r_{1}), …, alph(r_{n}), alph(p_{0}), …, alph(p_{n}))

where n ≥ 0,r_{i}, p_{i} ∈ M, r_{i} ≠ 1, p_{i} ∈ L^{∗} for 0 ≤ i ≤ n, alph(r_{i}) ≠ alph(r_{j}) for 1 ≤ i ≠ j ≤ n, and x = p_{0}r_{1}p_{1} … r_{n}p_{n}.

Since alph(r_{i}) ≠ alph(r_{j}) for i ≠ j, the number n ≥ 0 is bounded by some constant independent of x; and hence {V (x) | x ∈ M} is a finite set of finite sets. Therefore it is enough to show that V (x) = V (x′) implies L^{∗}(x) = L^{∗}(x′) for all x, x′ ∈ M. Let x, x′, y ∈ M such that V (x) = V (x′) and y ∈ L^{∗}(x). By symmetry it is enough to prove y ∈ L^{∗}(x′).

Since y ∈ L^{∗}(x), we have xy = z_{1} … z_{m} for some m ≥ 0, z_{i} ∈ L, 1 ≤ i ≤ m. By Lemma 2.2.5 there are r_{i}, s_{i} ∈ M, 1 ≤ i ≤ m such that x = r_{1} … r_{m}, y = s_{1} … s_{m}, z_{i} = r_{i}s_{i} for 1 ≤ i ≤ m and (r_{j}, s_{i}) ∈ I for 1 ≤ i < j ≤ m.

Now, for i < j define blocks p_{ij} = r_{i} … r_{j} if s_{i} … s_{j} = 1 and q_{ij} = s_{i} … s_{j} if r_{i} … r_{j} = 1. Note p_{ij}, q_{ij} ∈ L^{∗} for all i < j where these traces are defined.

By a conversion of indices, we obtain for some n ≥ 0:

x = p_{0}r_{1}p_{1} … r_{n}p_{n},  p_{0} ∈ L^{∗}, r_{i} ≠ 1, p_{i} ∈ L^{∗},
y = q_{0}s_{1}q_{1} … s_{n}q_{n},  q_{0} ∈ L^{∗}, s_{i} ≠ 1, q_{i} ∈ L^{∗},
r_{i}, s_{i} ∈ L, and
(r_{i}p_{i}, q_{0}s_{1}q_{1} … s_{i−1}q_{i−1}) ∈ I  for all 1 ≤ i ≤ n

[figure: s_{1}; s_{2}; r_{1}; r_{2}; s_{m}; r_{m}; z_{1}; z_{2}; z_{m}; y; x; =; =; =; t]

Figure 2.1. The generalized Levi Lemma for traces

Assume alph(r_{i}) = alph(r_{j}) for some i ≤ j. Since r_{i}s_{i} ∈ L is a connected trace and this depends on alph(r_{i}s_{i}) only, the trace r_{j}s_{i} is connected, too. Since (r_{j}, s_{i}) ∈ I for i < j and r_{j} ≠ 1, s_{i} ≠ 1, we must have i = j. Thus, (L(r_{1}), … L(r_{n}), alph(r_{1}), …, alph(r_{n}), p_{0}, …, p_{n}) ∈ V (x). Since V (x) = V (x′) we find r′_{1} … r′_{n} ∈ M \ {1}, p′_{0}, …, p′_{n} ∈ L^{∗} such that x′ = p′_{0}r′_{1}p′_{1} … r′_{n}p′_{n} and L(r_{i}) = L(r′_{i}), alph(r_{i}) = alph(r′_{i}), alph(p_{i}) = alph(p′_{i}) for all 1 ≤ i ≤ n. Consider:

x′y = p′_{0}r′_{1}p′_{1} … r′_{n}p′_{n}q_{0}s_{1}q_{1} … s_{n}q_{n} = p′_{0}q_{0}(r′_{1}s_{1})p′_{1}q_{1} … (r′_{n}s_{n})p′_{n}q_{n} ∈ L^{∗}

This shows y ∈ L^{∗}(x′) and hence the result. □

Corollary 2.2.7 Let L ∈ Rec(M) be any recognizable trace language. If Con(L) ⊆ L^{∗} then we have L^{∗} ∈ Rec(M).

Proof: If Con(L) ⊆ L^{∗} then it follows ((Con(L))^{∗} ⊆ L^{∗}. Since the opposite inclusion is true for any language, we have L^{∗} = ((Con(L))^{∗} which is recognizable by the previous proposition. □

Remark 2.2.8 i): The condition Con(L) ⊆ L^{∗} is satisfied if, for example, L is prefix closed, since every connected component of a trace t ∈ M is a prefix of t.

ii): If L is recognizable and Con(L) ⊆ L^{∗} then L^{∗} is a submonoid which is generated by a recognizable set of connected traces. By Proposition 2.2.6 this is enough to ensure that L^{∗} is recognizable. On the other hand this is not a necessary condition: Consider L = {(m, n) ∈ IN × IN | m + n ≥ 2} then L ∪ {(0, 0)} = L^{∗} is recognizable but not generated by connected elements of IN × IN. In fact, up to now no convenient characterization of recognizable submonoids is known. Here we content ourselves to state the following:

Corollary 2.2.9 ([CM85, Thm. 2.7],[Dub86, Thm. 4.3.2]) Let t ∈ M be a trace. Then we have t^{∗} ∈ Rec(M) if and only if t is connected.

Proof: If t is connected then t^{∗} ∈ Rec(M) by 2.2.6. If t is not connected then we may write t = uv = vu for some u, v ∈ M, u ≠ 1, v ≠ 1 with (u, v) ∈ I. Consider the homomorphism f : IN × IN → M, (1, 0) ↦ u, (0, 1) ↦ v. Then f^{−1}(t^{∗}) = (1, 1)^{∗} ⊆ IN × IN and (1, 1)^{∗} is not recognizable in IN × IN. □

2.3 Ochmanski Theory

This section contains the result of E. Ochmanski, [Och85], which characterizes recognizable trace languages in terms of so-called recognizable expressions. Formally, the classical Kleene Theorem is a corollary of Ochmanski’s theorem. Nevertheless, (the non-trivial direction) of Kleene’s theorem is crucial below. Following Ochmanski, we introduce the concurrent iteration by L^{co} = (Con(L))^{∗} for L ⊆ M, i.e., L^{co} is the submonoid generated by all connected components of traces in L. Analogously to rational expressions the set of recognizable expressions, REC(M), is defined. We only replace the (formal symbol) star, ∗, by the symbol of concurrent iteration, co. If E ∈ REC(M) is a recognizable expression then L(E) ⊆ M means the associated language. In particular, L(E^{co}) := L(E)^{co} = (Con(L(E))^{∗}. The preceeding section may be summarized by saying L(E) ⊆ Rec(M) for all E ∈ REC(M). Ochmanski’s theorem says that the converse is also true.

Theorem 2.3.1 ([Och85, Thm. 9]) Let L ⊆ M be a trace language. M = M(X, D) for some finite dependence alphabet (X, D). Then L is recognizable, L ∈ Rec(M), if and only if there is a recognizable expression E ∈ REC(M) such that L = L(E).

The proof of 2.3.1 follows from the next two lemmas which concern lexicographic normal forms. Let < be any linear ordering of the alphabet X. Thus, we may assume X = {a_{1}, …, a_{m}} and a_{1} < ⋯ < a_{m}. For each trace t ∈ M we denote by t̂∈ X^{∗} the lexicographic normal form of t, i.e., the minimal word with respect to the lexicographic order which represents the trace t. Then M̂ = {t̂ ∈ X^{∗} | t ∈ M} is in canonical bijection with M. By the proposition of Anisimov and Knuth, see Proposition 1.2.2, M̂ is exactly the rational set of words which contain no factor of the form bua with a < b and (a, bu) ∈ I.

Lemma 2.3.2 ([Och85, Lemma 4.2]) Let t ∈ M be a trace such that the square of its lexicographic normal form is in lexicographic normal form, i.e., t̂^{2} ∈ M̂. Then t is connected.

Proof: Assume t would not be connected. Write t = uv with u, v ∈ M \ {1}, (u, v) ∈ I. Let U = alph(u) and V = alph(v). Then t̂ ∈ X^{∗} starts with a letter in U or V, say U, and t̂ has the following form t̂= b_{1}w_{1}b_{2}w_{2} … b_{n}w_{n} with n ≥ 2, b_{i} ∈ U ∪ V and b_{i}w_{i} ∈ V^{∗} for i even and b_{i}w_{i} ∈ U^{∗} for i odd, 1 ≤ i ≤ n.

Since t̂ is in lexicographic normal form we have b_{1} < b_{2} < ⋯ < b_{n}. If n is even then (t̂)^{2} contains the factor b_{n}w_{n}b_{1} with b_{1} < b_{n} and (b_{n}w_{n}, b_{1}) ∈ I. But this is impossible. If n is odd then (t̂)^{2} contains the factor b_{n}w_{n}b_{1}w_{1}b_{2} with b_{2} < b_{n} and (b_{n}w_{n}b_{1}w_{1}, b_{2}) ∈ I. Again this is impossible. Hence (t̂)^{2} ∉ M̂ which is a contradiction. □

Let us now define a mapping π : RAT(X^{∗}) → REC(M) on expressions inductively as follows:

If E ⊆ X^{∗} is finite then π(E) means the finite image in M. If E, E_{1}, E_{2} ∈ RAT(X^{∗}) and π(E), π(E_{1}), π(E_{2}) are already defined then set π(E_{1} ∪ E_{2}) = π(E_{1}) ∪ π(E_{2}), π(E_{1} · E_{2}) = π(E_{1}) · π(E_{2}) and π(E^{∗}) = (π(E))^{co}.

Let p : X^{∗} → M be the canonical projection and E ∈ RAT(X^{∗}) then we have pL(E) ⊆ Lπ(E), but no equality in general. The point is that there is equality on lexicographic normal forms:

Lemma 2.3.3 Let E ∈ RAT(X^{∗}) be a rational expression such that L(E) ⊆ M̂. Then we have pL(E) = Lπ(E).

Proof: By structural induction: The formula is obvious for finite E. If E = E_{1} ∪ E_{2} and L(E) ⊆ M̂ then L(E_{1}), L(E_{2}) ⊆ M̂. Hence by induction, pL(E) = pL(E_{1} ∪ E_{2}) = pL(E_{1}) ∪ pL(E_{2}) = Lπ(E_{1}) ∪ Lπ(E_{2}) = Lπ(E). Analogously for E = E_{1}E_{2}. Finally let E = E_{1}^{∗} for some E_{1} ∈ RAT(X^{∗}). Again, if L(E_{1}^{∗}) ⊆ M̂ then L(E_{1}) ⊆ M̂ and L(E_{1})^{∗} ⊆ M̂. Hence we may use induction and Ochmanski’s Lemma tells us that pL(E_{1}) consists of connected traces only. Therefore:

pL(E_{1}^{∗}) = (pL(E_{1}))^{∗} = (Con(pL(E_{1})))^{∗} = (pL(E_{1}))^{co} =
(Lπ(E_{1}))^{co} = L((π(E_{1})^{co}) = Lπ(E_{1}^{∗}). □

Proof of 2.3.1: If E ∈ REC(M) then L(E) ∈ Rec(M) by Sect. 2.2. Let L ∈ Rec(M) be any recognizable language. Then the inverse image p^{−1}(L) is recognizable in X^{∗}. Since M̂ ⊆ X^{∗} is recognizable, too, p^{−1}(L) ∩ M̂ is a recognizable subset of X^{∗}; and by Kleene’s Theorem p^{−1}(L) ∩ M̂ = L(E) for some rational expression E ∈ RAT(X^{∗}). Since L(E) ⊆ M̂, we have L(π(E)) = pL(E) = p(p^{−1}(L) ∩ M̂) = L by Lemma 2.3.3. Since π(E) ∈ REC(M), the Theorem follows. □

Corollary 2.3.4 The set of recognizable trace languages of M is in canonical one-to-one correspondence with the set of regular subsets of M̂. □

2.4 Zielonka Theory

The automata we considered so far have the disadvantage that independent actions can not really act concurrently on the state set. This led W. Zielonka [Zie87] to introduce asynchronous automata which have the ability of simultaneous execution of independent actions. The main result of [Zie87] states that a subset of a trace monoid is recognizable if and only if it is accepted by some finite asynchronous automaton. Our presentation of Zielonka’s result is based on the original paper [Zie87] and on a technical report of Cori/Métevier [CM87]. Almost all results of this section can be found there. We do not claim any originality. We also consider asynchronous cellular automata. These automata were introduced in [Zie89] and also (independently) used in [Die90a]. Although closely related to asynchronous automata, asynchronous cellular automata seem to have a slightly simpler construction. These automata will be used in the last chapter for the design of efficient algorithms to solve word problems over traces.

Let (X, D) be a finite dependence alphabet with independence relation I = X × X \ D and M = M(X, D). A (finite) asynchronous automaton over M is a (finite) M-automaton A = (Z, δ, q_{0}, F) which satisfies the following additional conditions:

1) The state set Z is a cartesian product Z = ∏_{i=1}^{m} Z_{i}.

2) With each a ∈ X there is a associated an index set V (a) ⊆ {1, …, m} such that V (a) ∩ V (b) = ∅ if and only if (a, b) ∈ I.

3) The partially defined transition mapping δ : Z × M → M is given by a collection of partially defined mappings

{δ_{a} : ∏_{i∈V (a)} Z_{i} → ∏_{i∈V (a)} Z_{i} | a ∈ X}.

This means, for a state (z_{1}, …, z_{m}) ∈ Z and a letter a ∈ X the next-state δ((z_{1}, …, z_{m}), a) is defined if and only if δ_{a}((z_{i})_{i∈V (a)}) is defined and in this case the j-th component of δ((z_{1}, …, z_{n}), a) is δ((z_{1}, …, z_{m}), a)_{j} = (δ_{a}((z_{i})_{i∈V (a)}))_{j} for j ∈ V (a) and δ((z_{1}, …, z_{m}), a)_{j} = z_{j} otherwise, 1 ≤ j ≤ m. Thus, the action of a changes the components in V (a) only.

Remark 2.4.1 Every asynchronous automaton can be transformed into an asynchronous automaton where the transition mapping is defined everywhere. This amounts to add to each component Z_{i}, 1 ≤ i ≤ m, a new point, say {∞}. But

observe that for large m > 1 the state set ∏_{i=1}^{m}(Z_{i} ˙∪{∞}) has considerably more

points than ∏_{i=1}^{m} Z_{i}. This is the reason to prefer partial transition mappings. □

The aim of this section is to prove the following deep theorem of Zielonka:

Theorem 2.4.2 ([Zie87]) Let L ⊆ M be a (recognizable) trace language then there exists a (finite) asynchronous automaton which accepts L.

In order to prove this result we use another notion of M-automata. An Mautomaton U = (Z, δ, q_{0}, F) is called asynchronous cellular if the following two condition are satisfied:

1) The state set Z is a cartesian product Z = ∏_{x∈X} Z_{x}

2) The partially defined transition mapping δ is given by a collection of partially defined mappings {δ_{a} : ( ∏_{b∈D(a)} Z_{b}) → Z_{a} | a ∈ X} where D(a) = {b ∈

X | (a, b) ∈ D}.

This means for (z_{x})_{x∈X} and a ∈ X the next state δ_{a}((z_{x})_{x∈X}, a) is defined if and only if δ_{a}((z_{b})_{b∈D(a)}) is defined and in this case we have δ((z_{x})_{x∈X}, a)_{a} = δ_{a}((z_{b})_{b∈D(a)}) and δ((z_{x})_{x∈X}, a)_{y} = z_{y} for y ≠ a. Thus, the action of a changes only the a-component of (z_{x})_{x∈X}, but the new value of z_{a} depends on the bcomponents for b ∈ D(a).

Note that the classes of asynchronous automata and asynchronous cellular automata are incomparable. (It is of course also possible to give a common generalization of both types of automata. This is not needed here and left to the reader.) However, since under an action a ∈ X changes only the a-component of the state set and b ∉ D(a) for (a, b) ∈ I, asynchronous cellular automata also have the ability of simultanously execution of independent actions.

This is a typical situation where we allow common read but exclusive write. Moreover there is a simple standard construction which transforms an asynchronous cellular automaton into an asynchronous one by blowing up the state set. This is the first proposition of this section.

Proposition 2.4.3 Let (X, D) = ⋃_{i=1}^{m}(X_{i}, X_{i} × X_{i}) be a covering by cliques and

let U = ( ∏_{a∈X} Z_{a}, δ, q_{0}, F) be an asynchronous cellular automaton. Then there

is an asynchronous automaton which accepts the same trace language as U and

which has state set ∏_{i=1}^{m}( ∏_{a∈X_{i}} Z_{a}). In particular, the asynchronous automaton is

finite if U is finite.

Proof: Let Y = {(a, i) | 1 ≤ i ≤ m, a ∈ X_{i}}. Consider the diagonal embedding

d : ∏_{a∈X} Z_{a} → ∏_{i∈1}^{m}( ∏_{a∈X_{i}} Z_{a}) = ∏_{y∈Y} Z_{y}, (z_{a})_{a∈X} → (z_{a})_{y∈Y} for y = (a, i)

Viewing d as an inclusion the partial transition mapping δ : ( ∏_{a∈X} Z_{a}) × M →

∏_{a∈X} Z_{a} can also be viewed as a partial mapping δ : ( ∏_{y∈Y} Z_{y})×M → ∏_{y∈Y} Z_{y}. Thus,

A = ( ∏_{y∈Y} Z_{y}, δ, d(q_{0}), d(F)) as an M-automaton which, by the very definition,

accepts the same trace language as U. The automaton A looks like U, but from each original component of the state set of U there are now several copies in A.

Defining Z_{i} = ∏_{a∈X_{i}} Z_{a} and V (a) = {i ∈ {1, …, m} | a ∈ X_{i}} for a ∈ X, we see

that A has the structure of an asynchronous automata. This follows since we

have ∏_{y∈Y} Z_{y} = ∏_{i=1}^{m} Z_{i} and V (a) ∩ V (b) = ∅ if and only if (a, b) ∈ I. □

Let t ∈ M be a trace and p_{1}, p_{2} ⊆ t be prefixes of t, i.e., t = p_{1}s_{1} = p_{2}s_{2} for some s_{1}, s_{2} ∈ M. Then p_{1} ∪ p_{2} ⊆ t is a prefix of t. If max(p_{1}) ⊆ A, max(p_{2}) ⊆ A for some A ⊆ X then we have max(p_{1} ∪ p_{2}) ⊆ A, too. This observation allows to define the maximal prefix of a trace t such that the set of maximal letters of the prefix lies in a given subset A ⊆ X. In the following we denote this prefix by ∂_{A}(t). If A = {a} then we simply write ∂_{a}(t). Note that this prefix is non-empty if and only if a ∈ alph(t). If ∂_{a}(t) ≠ 1 then for the maximal point of t with label a ∈ X we can also write in our previous notation ∂_{a}(t) = pre(a) · a.

It is easy to see that ∂_{A}(t) = ⋃_{a∈A} ∂_{a}(t) and hence ∂_{A∪B}(t) = ∂_{A}(t)∪∂_{B}(t). For

a letter a ∈ X let D(a) = {b ∈ X | (a, b) ∈ D}, then we have ∂_{a}(ta) = ∂_{D(a)}(t)a. These simple identities will be used frequently in the following.

Definition: A mapping φ : M → Q to a set Q is called uniform if for all t ∈ M, a ∈ X, A, B ⊆ X the following two conditions are satisfied:

i) The value of φ(∂_{A∪B}(t)) is uniquely determined by φ(∂_{A}(t)) and φ(∂_{B}(t)).

ii) The value of φ(∂_{D(a)}(ta)) is uniquely determined by φ(∂_{D(a)}(t)) and the letter a.

Our definition of a uniform mapping differs slightly by the one given in [CM87] since we additionally demand ii). Note also that a uniform mapping φ : M → Q gives, in general, no natural M-automaton structure to Q; the reason is that uniformity is in general not enough to calculate the value of φ(ta) from φ(t) and a if t ≠ ∂_{D(a)}(t). However, the point is that a uniform mapping φ : M → Q induces a natural structure of an asynchronous cellular automaton on the cartesian product Q^{X} = ∏_{a∈X} Q_{a} with Q_{a} = Q for all a ∈ X. This is expressed in the next proposition.

Proposition 2.4.4 Let φ : M → Q be a uniform mapping to a set Q and L ⊆ Q be a subset, M = M(X, D). Then there is an asynchronous cellular automaton with state set Q^{X} which accepts the trace language φ^{−1}(L). In particular, if Q is finite then φ^{−1}(L) is recognizable and accepted by a finite asynchronous cellular automaton, and hence by a finite asynchronous automaton.

Proof: We construct an asynchronous cellular automaton U = (Q^{X}, δ, q_{0}, F) which accepts φ^{−1}(L) as follows. The domain of the partially defined transition mapping δ : Q^{X} × M → Q^{X} is the set Z × M where Z = {(φ(∂_{x}(t)))_{x∈X} | t ∈ M}. For (φ(∂_{x}(t)))_{x∈X} and a ∈ X we set δ((φ(∂_{x}(t)))_{x∈X}, a) = (φ(∂_{x}(ta)))_{x∈X}. Since ∂_{x}(ta) = ∂_{x}(t) for all x ≠ a, we see that the action a ∈ X changes the a-component of (φ(∂_{x}(t)))_{x∈X} only. Furthermore, the value of φ(∂_{a}(ta)) is uniquely determined by φ(∂_{D(a)}(t)) and a by condition ii) of a uniform mapping and φ(∂_{D(a)}(t)) is known from (φ(∂_{b}(t)))_{b∈D(a)} by condition i). In particular δ : Z × M → Z is well-defined and it satisfies the requirement for the partially defined transition mapping of asynchronous cellular automata. Finally we put q_{0} = (φ(1), …, φ(1)) and F = {(φ(∂_{x}(t)))_{x∈X} | φ(t) ∈ L}. To see that the asynchronous cellular automaton U accepts φ^{−1}(L) it is enough to notice that the mapping φ : M → Q factorizes through the surjective mapping ψ : M → Z, ψ(t) = (φ(∂_{x}(t)))_{x∈X}. Indeed, condition i) asserts that ξ : Z → Q ξ(ψ(t)) = φ(t) is well-defined. Together with Proposition 2.4.3 we obtain the result. □

By Proposition 2.4.4 the strategy to prove Zielonka’s Theorem 2.4.2 will be to show that every homomorphism h : M → N to a (finite) monoid N factorizes through a uniform mapping φ : M → Q to a (finite) set Q.

In the following we write ∂_{A,B}(t) as a short hand for ∂_{A}(∂_{B}(t)).

The second approximation of a trace has been introduced in [CM87], here we give a slightly different definition which is notational simpler but gives at the beginning less information about a trace. Let t ∈ M be a trace then the second approximation Δ_{2}(t) is defined as a directed graph with vertex set X × X and edge set {((a, c), (b, d)) | ∂_{a,c}(t) is a prefix of ∂_{b,d}(t)}. Note that in our definition it may happen the graph Δ_{2}(t) does not tell us whether ∂_{a,b}(t) = 1. However, later we will use a labelled version of Δ_{2}(t) and then a vertex (a, b) ∈ X × X will have label zero if and only if ∂_{a,b}(t) = 1, therefore this information will be retained later.

Remark 2.4.5 i): Let A, B, C, D ⊆ X be non-empty subsets. Then ∂_{A,C}(t) is a prefix of ∂_{B,D}(t) if and only if for all vertices (a, c) ∈ A × C of Δ_{2}(t) there exists a directed edge to some (b, d) ∈ B ×D. Thus the graph Δ_{2}(t) contains the information about the prefix relation between ∂_{A,C}(t), ∂_{B,D}(t) if A, B, C, D ≠ ∅. ii): In a forthcomming paper of Cori, Métivier and Zielonka (personal communication) it is shown that one can avoid the calculation of the second approximation, thereby simplifying the proof. However, the concept of the second approximation seems to be of independent interest in trace theory. Therefore we think that the “classical” proof is still instructive. □

Lemma 2.4.6 Let t ∈ M be a trace and x ∈ X be a letter. Then the second approximation Δ_{2}(tx) is computable from Δ_{2}(t) and the letter x.

Proof:

Let a, b ∈ X and D(x) = {y ∈ X | (x, y) ∈ D}. Then we have the following relations:

\begin{aligned}∂_{a,b}(tx) & = & ∂_{a,b}(t) if b ≠ x, \\ ∂_{a,b}(tx) & = & ∂_{a,D(x)}(t) if a ≠ b = x, \\ ∂_{a,b}(tx) & = & ∂_{D(x)}(t)x if a = b = x. \end{aligned}

Observe that ∂_{D(x)}(t)x is no prefix of t and that a prefix of t is a prefix of ∂_{D(x)}(t)x if and only if it is a prefix of ∂_{D(x)}(t). Further, ∂_{D(x)}(t)x is a prefix of ∂_{D(y)}(t)y if and only if x = y. Hence, we may compute the edge set of Δ_{2}(tx) from the relations above using Remark 2.4.5 i). □

Lemma 2.4.7 Let t ∈ M be a trace and A, B ⊆ X be subsets such that t = ∂_{A}(t) ∪ ∂_{B}(t). Write t_{1} = ∂_{A}(t), t_{2} = ∂_{B}(t), r = t_{1} ∩ t_{2} with t_{1}, t_{2}, r ∈ M, and let C = {c ∈ X | ∂_{C}(t_{1}) = ∂_{C}(t_{2})}. Then we have r = ∂_{C}(t) = ∂_{C}(t_{1}) = ∂_{C}(t_{2}). In particular, we have max(r) ⊆ C.

Proof: Of course, ∂_{C}(t) ⊆ r. For the other direction let d ∈ r be a fixed point with label d ∈ X. We have ∂_{d}(t) = ∂_{d}(t_{1}) or ∂_{d}(t) = ∂_{d}(t_{2}) since t = t_{1} ∪ t_{2}. Say ∂_{d}(t) = ∂_{d}(t_{1}) and assume ∂_{d}(t) ≠ ∂_{d}(t_{2}). Then d ∉ B and there is a path d < c ≤ b in t_{2} with d ≠ c, (d, c) ∈ D and b ∈ B. It follows c ∈ r and d is not maximal in r. Hence, if c ∈ max(r) then ∂_{c}(t) = ∂_{c}(t_{1}) = ∂_{c}(t_{2}). Since r ⊆ ∂_{max(r)}(t) we have r ⊆ ∂_{C}(t). □

In order to compute the set C from the lemma above we need a labelling of the second approximation. The labelling is based on a function

ν : X × P(X) × M → {0, …, #X}

which is inductively defined as follows:

If t = 1 then we put ν(a, A, t) = 0. If we have ∂_{a,A}(t) ≠ t then we put ν(a, A, t) = ν(a, a, ∂_{a,A}(t)). If we have ∂_{a,A}(t) = t ≠ 1 then we have a ∈ A and we put ν(a, A, t) = min{m ≥ 0 | m ∉ {ν(a, B, t) | a ∉ B}}.

It is trivial to see that ν is well-defined as a function to IN. The statement ν(a, A, t) ≤ #X follows from iii) of the lemma below which lists some properties of the function ν which will be used.

Lemma 2.4.8 We have

i) ν(a, A, t) = ν(a, a, ∂_{a,A}(t)) for all (a, A, t), ii) ν(a, ∅, t) = 0,

iii) if A ≠ ∅ then ν(a, A, t) = ν(a, b, t) for some b ∈ A,

iv) ν(a, A, t) = 0 if and only if ∂_{a,A}(t) = 1,

v) if ∂_{a,A}(t) = ∂_{b,B}(t) then ν(a, A, t) = ν(b, B, t).

Proof: i) and ii) are trivial from the definition. Assertion iii) follows by i) since ∂_{a,A}(t) = ∂_{a,b}(t) for some b ∈ A if A ≠ ∅. Assertion iv) follows by induction using i), ii) and the fact a ∉ ∅. To see v) observe that 1 ≠ ∂_{a,A}(t) = ∂_{b,B}(t) implies a = b, then use i) and iv). □

The function ν : X × P(X) × M → {0, …, #X} induces a function ν_{t} : Δ_{2}(t) → {0, …, #X} by ν_{t}(a, b) = ν(a, b, t). We may view ν_{t} as a labelling function and in the sequel it is this labelled version of the second approximation of a trace which will be used. Using the labelling we may test whether ∂_{a,b}(t) = 1 since assertion iv) of the lemma above says {(a, b) ∈ X × X | ∂_{a,b}(t) = 1} = {(a, b) ∈ X × X | ν_{t}(a, b) = 0}. Note also that assertion v) of the lemma above expresses that the function ν_{t} is constant on strongly connected components of Δ_{2}(t). Our aim is to show that associating with a trace t ∈ M the pair (Δ_{2}(t), ν_{t}) yields a uniform mapping. A step in this direction is the following lemma.

Lemma 2.4.9 Let t ∈ M be a trace and x ∈ X be a letter such that t = ∂_{D(x)}(t). Then (Δ_{2}(tx), ν_{tx}) is computable from (Δ_{2}(t), ν_{t}) and x ∈ X.

Proof: In Lemma 2.4.6 we already have shown how to compute Δ_{2}(tx) without the assumption t = ∂_{D(x)}(t). This assumption is used for the computation of ν_{tx}. Let (a, b) ∈ X × X. Then ν_{tx}(a, b) = ν(a, b, tx) = ν(a, a, ∂_{a,b}(tx)). Now, if b ≠ x then ∂_{a,b}(tx) = ∂_{a,b}(t). Hence ν_{tx}(a, b) = ν_{t}(a, b) for b ≠ x. If a ≠ b = x then ν(a, a, ∂_{a,b}(tx)) = ν(a, a, ∂_{a,D(x)}(t)) = ν(a, a, ∂_{a}(t)) = ν_{t}(a, a). Here, the use of ∂_{D(x)}(t) = t could have been avoided, but this is not possible in last case where a = b = x. Then we have ν_{tx}(a, b) = ν_{tx}(x, x) = ν(x, x, tx) = min{m ≥ 0 | m ∉ ν(x, B, t), x ∉ B} since our assumption implies ∂_{x}(tx) = tx and ν(x, B, tx) = ν(x, B, t) for x ∉ B. But the values of ν(x, B, t) for x ∉ B ≠ ∅ can be read from the function ν_{t} : Δ_{2}(t) → {0, …, #X} since for B ≠ ∅ we find some b ∈ B such that ∂_{x,B}(t) = ∂_{x,b}(t). □

Proposition 2.4.10 Let t ∈ M be a trace and A, B ⊆ X be subsets such that t = ∂_{A}(t) ∪ ∂_{B}(t). Write t_{1} = ∂_{A}(t), t_{2} = ∂_{B}(t), r = t_{1} ∩ t_{2}, t_{1} = ru, t_{2} = rv with t_{1}, t_{2}, r, u, v ∈ M, (u, v) ∈ I. Let φ(t_{i}) = (Δ_{2}(t_{i}), ν_{t_{i}}) for i = 1, 2. Then the following values are computable from φ(t_{1}), φ(t_{2}): i) the set C = {c ∈ X | ∂_{c}(t_{1}) = ∂_{c}(t_{2})}, i.e., the maximal subset C ⊆ X such

that r = ∂_{C}(t),

ii) for F ⊆ X the set alph(∂_{F} (v)),

iii) the second approximation Δ_{2}(t),

iv) the function ν_{t} : Δ_{2}(t) → {0, …, #X}

Proof: i) We show C = {c ∈ X | ν(c, c, t_{1}) = ν(c, c, t_{2})}. Clearly, if c ∈ C, i.e., ∂_{c}(t_{1}) = ∂_{c}(t_{2}), then

ν(c, c, t_{1}) = ν(c, c, ∂_{c}(t_{1})) = ν(c, c, ∂_{c}(t_{2})) = ν(c, c, t_{2}).

Now, let ∂_{d}(t_{1}) ≠ ∂_{d}(t_{2}). Without restriction we may assume that ∂_{d}(t_{1}) is a prefix of ∂_{d}(t_{2}). In particular we have ∂_{d}(t_{1}) ⊆ r, and, since ∂_{d}(t_{1}) ≠ ∂_{d}(t_{2}), we have d ∉ C. By Lemma 2.4.7 there must be some c ∈ C such that ∂_{d}(t_{1}) is a prefix of ∂_{c}(t_{1}) = ∂_{c}(t_{2}) and ∂_{c}(t_{2}) is a prefix of ∂_{d}(t_{2}). Let t′_{2} = ∂_{d}(t_{2}) then we have ∂_{d}(t_{1}) = ∂_{d,c}(t′_{2}) and ν(d, d, t_{2}) = ν(d, d, t′_{2}) = min{m ≥ 0 | m ∉ {ν(d, B, t′_{2}) | d ∉ B}}. Since d ≠ c we have ν(d, d, t_{1}) = ν(d, d, ∂_{d}(t_{1})) = ν(d, d, ∂_{d,c}(t′_{2})) = ν(d, c, t′_{2}) ≠ ν(d, d, t′_{2}) = ν(d, d, t_{2}).

To prove ii), iii), iv) let us call for a moment (e, f) ∈ X × X a u-point if ∂_{e,C}(t_{1}) is a prefix of ∂_{e,f}(t_{1}) but ∂_{e,C}(t_{1}) ≠ ∂_{e,f}(t_{1}), a v-point if ∂_{e,C}(t_{2}) is a prefix of ∂_{e,f}(t_{2}) but ∂_{e,C}(t_{1}) ≠ ∂_{e,f}(t_{1}), and an r-point otherwise. Note that there is a mutual exclusion between these three cases. If C is empty then (e, f) is a u-point if ν(e, f, t_{2}) ≠ 0, (e, f) is a v-point if ν(e, f, t_{2}) ≠ 0 and an r-point in the remaining case ν(e, f, t_{1}) = ν(e, f, t_{2}) = 0. If the set C is non-empty then we may use Remark 2.4.5 to compute from Δ_{2}(t_{1}) whether (e, f) is a u-point and from Δ_{2}(t_{2}) whether (e, f) is a v-point. Assertions ii), iii) and iv) are now easily derived:

ii) For F ⊆ X we have

alph(∂_{F} (v) = {e ∈ X | (e, f) is a v-point for some f ∈ F },

iii) To compute Δ_{2}(t) let (a, c) ∈ X × X be an α-point and (b, c) ∈ X × X a β-point, α, β ∈ {r, u, v}. If {α, β} ⊆ {r, u} then ∂_{a,c}(t) is a prefix of ∂_{b,c}(t) if and only if ∂_{a,c}(t_{1}) is a prefix of ∂_{b,d}(t_{1}). Analogously, we may use Δ_{2}(t_{2}) for {α, β} ⊆ {r, v}. In the remaining case {α, β} = {u, v} there is no prefix relation between ∂_{a,c}(t) and ∂_{b,d}(t).

iv) If (e, f) ∈ X × X is an r-point then ν(e, f, t) = ν(e, f, t_{1}) = ν(e, f, t_{2}). If (e, f) ∈ X × X is a u-point (a v-point respectively) then ν(e, f, t) = ν(e, f, t_{1}) (= ν(e, f, t_{2}) respectively). □

Corollary 2.4.11 Let Q be the finite set Q = {(Δ_{2}(t), ν_{t}) | t ∈ M}. Then the mapping φ : M → Q, φ(t) = (Δ_{2}(t), ν_{t}) is uniform.

Proof: This follows from i), ii), iv) of the proposition above together with Lemma 2.4.9. □

To complete the proof of Theorem 2.4.2 we use the Zielonka’s ∇-function. Let E ⊆ X be a subset and \overline{E} = X \ E. For a trace t ∈ M the trace ∇_{E}(t) is defined by the identity t = ∂\overline{E}(t)∇_{E}(t). Thus, ∇_{E}(t) is the maximal suffix s of t such that alph(s) ⊆ E.

Lemma 2.4.12 Let t ∈ M be a trace, x ∈ X be a letter and I(x) = {y ∈ X | (x, y) ∈ I}. Then it holds ∇_{E}(tx) = ∇_{E}(t)x if x ∈ E and ∇_{E}(tx) = ∇_{E∩I(x)}(t) otherwise.

Proof: Let \overline{E} = X \ E. If x ∈ E then we have ∂\overline{E}(tx) = ∂\overline{E}(t). If x ∉ E then we have ∂\overline{E}(tx) = ∂_{\overline{E}∪D(x)}(t)x. □

Lemma 2.4.13 Let t ∈ M be a trace and A, B ⊆ X be subsets such that t_{1} = ∂_{A}(t), t_{2} = ∂_{B}(t), r = t_{1} ∩ t_{2}, r = ∂_{C}(t), t_{2} = rv with t_{1}, t_{2}, r, v ∈ M, C ⊆ X. Let E ⊆ X be a subset and F = X \ E then we have ∇_{E}(t) = ∇_{G}(t_{1})∇_{H}(t_{2}) for G = {e ∈ E | {e} × alph(∂_{F} (v)) ⊆ I} and H = E \ C.

Proof: Clearly, G ∪ H ⊆ E. It is easy to see that ∇_{H}(t_{2}) = ∇_{E}(v). To see that ∇_{G}(t_{1})∇_{H}(t_{2}) = ∇_{G}(t_{1})∇_{E}(v) is a suffix of t observe that ∇_{G}(t_{1})∂_{F} (v) = ∂_{F} (v)∇_{G}(t_{1}) and ∂_{F} (v)∇_{E}(v) = v. Now, the equality ∇_{E}(t) = ∇_{G}(t_{1})∇_{H}(t_{2}) follows since every point of ∇_{E}(t) which belongs to t_{1} must be independent of every point in ∂_{F} (v). □

Proposition 2.4.14 Let h : M → N be a homomorphism of a trace monoid M to a (finite) monoid N and let Q be the (finite) set

Q = {(Δ_{2}(t), ν_{t}, (h∇_{E}(t))_{E⊆X}) | t ∈ M}

Then the mapping φ : M → Q, φ(t) = (Δ_{2}(t), ν_{t}, (h∇_{E}(t))_{E⊆X}) is uniform and h factorizes through φ.

Proof: In Corollary 2.4.11 we have shown that the mapping is uniform which associates with a trace its labelled second approximation. Therefore the proof of the proposition above follows directly from Lemma 2.4.12 and Lemma 2.4.13 if we can show that the subsets G and H mentioned in Lemma 2.4.13 are computable from (Δ_{2}(t), ν_{t}). For H this follows from Proposition 2.4.10 i) and for G from Proposition 2.4.10 ii). □

Proof of Theorem 2.4.2: Let L ⊆ M be a (recognizable) trace language. Let N be the (finite) quotient monoid of M by the syntactic congruence of L. Then we have L = h^{−1}h(L) for the canonical homomorphism h : M → N. Let Q be the (finite) set Q = {(Δ_{2}(t), ν_{t}, (h∇_{E}(t))_{E⊆X}) | t ∈ M}. We have shown in Proposition 2.4.14 that the mapping φ : M → Q, φ(t) = (Δ_{2}(t), ν_{t}, (h∇_{E}(t))_{E⊆X}) is uniform. Since ∇_{X}(t) = t for all t ∈ M we have that φ(t) = φ(t′) implies h(t) = h(t′) for all t, t′ ∈ M. Hence, we have L = φ^{−1}φ(L). The existence of a (finite) asynchronous cellular automaton which accepts L follows from Proposition 2.4.4. From the uniform automaton the construction for the (finite) asynchronous automaton accepting L is given in Proposition 2.4.3. □

56 2. Recognizable and Rational Trace Languages

3. Petri Nets and Synchronizations

3.1 Local Morphisms of Petri Nets

Since the initiating work of A. Mazurkiewicz, [Maz77], traces have been succesfully applied to Petri net theory. Originally the application of trace theory was limited to so-called safe nets. For these nets, traces describe the possible concurrency completely, whereas for more general nets, traces describe only that part of concurrency which is given by the static net topology, and not that which is given by the dynamic behavior. The aim of this chapter is to show that traces are an important tool for the investigation of Petri nets in general.

A Petri net is a tuple N = (P, T, F, B) where P is a finite set of places, T is a finite set of transitions, F and B are P × T -matrices over IN, the forward and backward incidence matrices. We also view F and B as mappings F, B : T → IN^{P}. By IN^{P} we denote as usual the set of mappings from P to the nonnegative integers. A marking of N is an element of IN^{P}. A transition a ∈ T is enabled under a marking m ∈ IN^{P} if m ≥ F (a). If a ∈ T is enabled under m ∈ IN^{P} then the follower marking m′ = m − F (a) + B(a) may occur. We denote this by m[a⟩m′. For a sequence w = a_{1}a_{2} … a_{n} ∈ T^{∗}, we write m[w⟩m′ if m[a_{1}⟩m_{1}[a_{2}⟩m_{2} … m_{n−1}[a_{n}⟩m′ for some m_{1}, m_{2}, …, m_{n−1} ∈ IN^{P}. We also write m[w⟩ to denote that m[w⟩m′ holds for some m′ ∈ IN^{P}. If we have m[w⟩m′ then we call m′ a follower marking of m. Note that according to this definition every marking is a follower marking of itself. We say that two transitions a, b ∈ T are concurrently enabled under m ∈ IN^{P} if m ≥ F (a) + F (b).

If a Petri net is viewed as a graph then F (p, a), if it is nonzero, denotes the weight of an arc from p to a, if F (p, a) is zero then there is no such arc, and analogously a nonzero value of B(p, a) is the weight of an arc from a to p. Often, a net is given with an initial marking m_{0} ∈ IN^{P}. Then we shall speak of a system. If N is a system then L(N) = {w ∈ T^{∗} | m_{0}[w⟩} denotes the language of N. A system is called 1-safe (or simply safe) if m(p) ≤ 1 for all p ∈ P and all follower markings of m_{0}.

We do not use capacities. They can be handled by introduction of complementary places.

For concurrent systems a partial order semantics is especially suitable. One way to give such a semantics to a net is to associate a dependence alphabet with it. For 1-safe net systems this was first done in [Maz77] and has been taken up by many people. For arbitrary Petri nets N = (P, T, F, B) we associate a dependence alphabet as follows. We say that transition a, b ∈ T are dependent if

[figure: b; d; a; c]

Figure 3.1. Transitions a, b as well as c, d are independent

a = b or a, b are adjacent to some common place p such that F (p, a) · B(p, b) ≠ 0 or B(p, a) · F (p, b) ≠ 0. Thus, two different transitions a, b are dependent if and only if at some place of the net there is an arc from a to this place and from this place to b or vice versa. The dependence relation of N is denoted by D(N), its complement I(N) = T ×T \D(N) is called the independence relation of N. Thus in Figure 3.1 we have (a, c), (a, d), (b, c), (b, d) ∈ D(N) and (a, b), (c, d) ∈ I(N). With a Petri net N we henceforth associate the dependence alphabet (T, D(N)) and the trace monoid M(N) = M(T, D(N)).

Our independence relation can also be characterized as follows. Two different transitions a, b ∈ T are independent if and only if a, b are concurrently enabled under all markings at which some occurrence sequence may begin with ab or ba. In particular, if w ∈ T^{∗} is an occurrence sequence and w′ ∈ T^{∗} denotes the same trace in M(N) then w′ is also enabled. It is therefore sensible to speak of a trace enabled under a marking. Consequently, we associate with a system N = (P, T, F, B; m_{0}) the trace language L_{Θ}(N) = {t ∈ M(N) | m_{0}[t⟩}.

In [Maz77] or [Maz87] a dependence relation for 1-safe nets is defined by the property of being in the neighbourhood of a common place. Thus in Figure 3.1 the transitions a, b, c, d would be pairwise dependent according to Mazurkiewicz’ definition. However for 1-safe nets both definitions of dependence are not essentially different. If two transitions a and b are independent for us, but dependent in [Maz87], then in a 1-safe net there can be no occurrence sequence wabv or wbav. This results simply from the fact that in a 1-safe net two transitions are never concurrently enabled if they are in the neighbourhood of a common place. Therefore the trace languages associated to a 1-safe system here and in [Maz87] can be identified. Trace languages of 1-safe systems are always recognizable. The next proposition implies, as a special case, that the star of such a language is still recognizable.

Proposition 3.1.1 Let N = (P, T, F, B) be a Petri net with some initial marking. If L_{Θ}(N) is recognizable in M(N) then L_{Θ}(N)^{∗} is also a recognizable trace language.

Proof: Trace languages of a system are always prefix closed. Hence the proof of the propositon follows from Corollary 2.2.7 and Remark 2.2.8 i). □

We now introduce a new type of morphism between nets which we call local morphism. All results in this sections will be based on this kind of morphism.

Definition: A local morphism h : N′ → N from a Petri net N′ = (P′, T′, F′, B′) to a Petri net N = (P, T, F, B) is a pair of mappings h = (h_{P} , h_{T}) such that h_{P} : P′ → P and h_{T} : T′ → T satisfy the following properties:

i) for all a′, b′ ∈ D(N′), a′ ≠ b′ it holds h_{T} (a′) ≠ h_{T} (b′),

ii) for all a ∈ T and for all p′ ∈ P′ we have

\begin{aligned}& ∑_{a′∈h_{T}^{−1}(a)} F (p′, a′) & = & F (h_{P} (p′), a) \\ and & ∑_{a′∈h_{T}^{−1}(a)} B(p′, a′) & = & B(h_{P} (p′), a). \end{aligned}

The first condition says that the images of the preset and the postset are disjoint for all places. The second condition expresses the compatibility of the mappings h_{P} and h_{T} with the incidence matrices F and B. In particular, forward arcs are mapped to forward arcs and backward arcs are mapped to backward arcs.

Restricted to the neighbourhood of a place, a local morphism looks like in Figure 3.2. And vice versa: if locally at all places a mapping looks like this then it defines a morphism of nets. (Therefore the name.)

An example of a local morphism is given in Figure 3.3 where the local morphism h : N′ → N is indicated by the labelling.

In order to prove that the composition of two local morphisms is a local morphism again, we state the following lemma. Its proof is trivial from ii) above.

Lemma 3.1.2 Let (h_{P} , h_{T}) : N′ → N be a local morphism and (a′, b′) ∈ D(N′) be a pair of dependent transitions then h_{T} (a′) and h_{T} (b′) are dependent, too. □

Recall that any mapping f : A → B of finite sets induces a homomorphism f^{∗} : IN^{B} → IN^{A} defined by f^{∗}(m) = mf : A →^{f} B →^{m} IN. Applied to a local morphism (h_{P} , h_{T}) : N′ → N we obtain homomorphisms h_{T}^{∗} : IN^{T} → IN^{T′} and h_{P}^{∗} : IN^{P} → IN^{P′}. By linear extension we may view the forward and backward incidence matrices also as homomorphism F, B : IN^{T} → IN^{P}. Writing the elements of IN^{T} and IN^{P} as formal sums ∑_{a∈T} n_{a}a and ∑_{p∈P} n_{p}p respectively where n_{a}, n_{p} ∈ IN

we then have

\begin{aligned}F ( ∑_{a∈T} n_{a}a) & = & ∑_{p∈P}( ∑_{a∈T} n_{a}F (p, a))p and \\ B( ∑_{a∈T} n_{a}a) & = & ∑_{p∈P}( ∑_{a∈T} n_{a}B(p, a))p. \end{aligned}

[figure: b; a; b_{n}; b_{1}; a_{m}; a_{1}; d; c; d_{1}; c_{r}; c_{1}; d_{s}; l; k; l_{n}; l_{1}; k_{m}; k_{1}; u_{1}; v; u; v_{1}; u_{r}; v_{s}; ⋮; ⋮; ⋮; ⋮; ⋮; ⋮; ⋮; ⋮]

Figure 3.2. A local morphism at a place where the mapping is indicated by the labelling with

k = ∑_{i=1}^{m} k_{i}, …, l = ∑_{i=1}^{n} l_{i}, u = ∑_{i=1}^{r} u_{i}, …, v = ∑_{i=1}^{s} v_{i}.

[figure: r; r; r; q; p; q; p; p; s; s; a; a; a; c; b; c; b; b; 2; 2]

Figure 3.3. A local morphism of nets

IN^{T}  ⟶^{F,B}  IN^{P}
↓h_{T}^{∗}  ↓h_{P}^{∗}
IN^{T′}  ⟶^{F′,B′}  IN^{P′}

Figure 3.4. Condition ii) of a local morphism

An easy calculation shows that the condition ii) in the definition of a local morphism may be rephrased saying that the diagram of homomorphisms in Figure 3.4 commutes. Together with Lemma 3.1.2 we obtain the following characterization of local morphisms:

Theorem 3.1.3 Let N′ and N be Petri nets and h_{P} : P′ → P, h_{T} : T′ → T be mappings. Then (h_{P} , h_{T}) : N′ → N is a local morphism if and only if the following two conditions are satisfied:

i’) For all a′, b′ ∈ T′ such that a′ ≠ b′ and (a′, b′) ∈ D(N′) we have h_{T} (a′) ≠ h_{T} (b′) and (h_{T} (a′), h_{T} (b′)) ∈ D(N).

ii’) The diagram in Figure 3.4 commutes □

Corollary 3.1.4 Petri nets with local morphisms form a category. □

From a morphism of nets one would also expect that it relates the behavior of the two respective nets to each other. For local morphisms this works as follows. Condition i’) above says that a local morphism h = (h_{P} , h_{T}) : N′ → N induces a morphism of undirected graphs between the dependence graphs which underly the trace monoids M(N′) and M(N). Therefore we may define a homomorphism in the opposite direction h_{T}^{∗} : M(N) → M(N′), which is induced by h_{T}^{∗} (a) = ∏_{a′∈h_{t}^{−1}(a)} a′ for a ∈ T, see Chap. I, Sect. 1.3. Condition ii’) asserts that h_{T}^{∗} maps

the trace language of N to that of N′. This is established in the following two results. From now on we sometimes write h^{∗} instead of h_{P}^{∗} or h_{T}^{∗}. It will be clear from the context which mapping is meant.

Corollary 3.1.5 Let h : N′ → N be a local morphism of Petri nets, m_{1}, m_{2} ∈ IN^{P} be markings, and a ∈ T be a transition of N. Then m_{1}[a⟩m_{2} implies h^{∗}(m_{1})[h^{∗}(a)⟩ h^{∗}(m_{2}) where h^{∗}(a) ∈ M(N′) is a step, i.e., h^{∗}(m_{1}) ≥ F′(h^{∗}(a)).

Proof: This is easy by the following sequence of implications:

m_{1}[a⟩m_{2} ⇔ m_{1} ≥ F (a) and m_{2} = m_{1} − F (a) + B(a) ⇒ h^{∗}(m_{1}) ≥ h^{∗}F (a) and h^{∗}(m_{2}) = h^{∗}(m_{1}) − h^{∗}F (a) + h^{∗}B(a) ⇔ h^{∗}(m_{1}) ≥ F′h^{∗}(a) and h^{∗}(m_{2}) = h^{∗}(m_{1}) − F′h^{∗}(a) + B′h^{∗}(a) ⇔ h^{∗}(m_{1})[h^{∗}(a)⟩h^{∗}(m_{2}). □

Corollary 3.1.6 Let h : N′ → N be a local morphism of Petri nets. Let m_{0} ∈ IN^{P} be the initial marking of N and h^{∗}(m_{0}) be the initial marking of N′. Then the homomorphism h^{∗} : M(N) → M(N′) restricts to a mapping

h^{∗} : L_{Θ}(N) → L_{Θ}(N′) ∩ h^{∗}(M(N)).

Proof: Iterated application of the corollary above. □

Especially interesting is the case where h^{∗} above is bijective. For this we introduce the following type of local morphisms:

Definition: A local morphism (h_{P} , h_{T}) : N′ → N of Petri nets is called a covering if the mapping h_{P} is surjective on places and transitions.

Remark 3.1.7 i) If h = (h_{P} , h_{T}) : N′ → N is a covering the h_{T} induces a morphism on the underlying dependence graphs of M(N) and M(N′) which is surjective on vertices and edges.

ii) A local morphism (h_{P} , h_{T}) is a covering if h_{P} is surjective and if every isolated transition is the image of h_{T}. The surjectivity of h_{T} follows by property ii) of a local morphism. □

The main theorem of this section is the following:

Theorem 3.1.8 Let h = (h_{P} , h_{T}) : N′ → N be a covering of Petri nets. Let m_{0} be the initial marking of N and h_{P}^{∗} (m_{0}) be the initial marking of N′. Then the mapping

\begin{matrix}h_{T}^{∗} : L_{Θ}(N) & → & L_{Θ}(N′) ∩ h^{∗}(M(N)) \\ a_{1} … a_{n} ∈ T^{∗} & ↦ & ( ∏_{a′_{1}∈h^{−1}(a_{1})} a′_{1}) … ( ∏_{a′_{n}∈h^{−1}(a_{n})} a′_{n}) \end{matrix}

is bijective.

Proof: As stated in Remark 3.1.7, h_{T} viewed as graph a morphism for the respective dependence graphs is surjective on vertices and edges. Thus h^{∗} on M(N) and hence the restriction of h^{∗} to L_{Θ}(N) are injective by the general embedding theorem, Corollary 1.4.5.

To see that h^{∗} is surjective let t ∈ L_{Θ}(N′) ∩ h^{∗}(Θ(N)). We may write t as h^{∗}(a_{1}) … h^{∗}(a_{m}) for some m ≥ 0 and a_{i} ∈ T for 1 ≤ i ≤ m. Since h^{∗}(m_{0}) is the initial marking of N′ and since m_{1}[a⟩m_{2} implies h^{∗}(m_{1})[h^{∗}(a)⟩h^{∗}(m_{2}) for all m_{1}, m_{2} ∈ IN^{P}, a ∈ T, it is enough to show that h^{∗}(m)[h^{∗}(a)⟩ implies m[a⟩ for all m ∈ IN^{P}, a ∈ T: Now, if we have h^{∗}(m)[h^{∗}(a)⟩ then it holds h^{∗}(m) ≥ ∑_{a′∈h_{T}^{−1}(a)} F′(a) = F′h^{∗}(a) = h^{∗}F (a). Since h_{P} is surjective on places this implies

m ≥ F (a) and the result follows. □

The theorem above tells us that if h : N′ → N is a covering then we may split the computation of L_{Θ}(N) into two parts: the (local) computation of L_{Θ}(N′) which might be simpler, and the (global) computation of h^{∗}(M(N)) which involves the trace monoid, only. Note that every net has a covering by its atoms and isolated transitions. (An atom is a single place with its adjacent transitions.) Thus, Theorem 3.1.8 has at least one application for every net. But since the computation of the trace language of the covering net becomes so simple in this particular case, difficulties must be hidden somewhere. It is the intersection which is crucial. (This is analogous to the situation of computations with semi-linear sets, see [ES69].) Let us also mention that Theorem 3.1.8 is a formal generalization of the general embedding theorem. This follows, since for every dependence alphabet (X, D) we may construct a net N with L_{Θ}(N) = M(X, D) and for every morphism of undirected graphs we obtain a corresponding local morphism of nets.

Another easy application of the theorem above is the case of a local morphism (h_{P} , h_{T}) where h_{P} is surjective and h_{T} is bijective.

Corollary 3.1.9 Let (h_{P} , h_{T}) : N′ → N be a covering of Petri nets such that h_{T} is bijective. Let m_{0} be the initial marking of N and h_{P}^{∗} (m_{0}) be the initial marking of N′ and use h_{T} as an identification of T′ and T. Then we have M(N) = M(N′) and L_{Θ}(N) = L_{Θ}(N′).

Proof: Since (h_{P} , h_{T}) is covering and h_{T} is bijective, we may identify the dependence alphabets (T, D(N)) and (T′, D(N′)). The result follows directly from the theorem above. □

Finally note that our results depend substantially on traces: The language of a net may be defined over words, but not over IN^{T}. On the other hand h_{T}^{∗} has its basic definition over IN^{T}, but h_{T}^{∗} has no reasonable definition over T^{∗}. It is exactly on the trace monoid where both fits together. Consider also the following commuting diagram:

T^{∗} ⊇ L(N) ⟶ L_{Θ}(N) ⊆ M(N) ⟶ IN^{T}  ⟶^{F,B} IN^{P}
↓ h_{T}^{∗}  ↓ h_{T}^{∗}  ↓ h_{T}^{∗}  ↓ h_{P}^{∗}
T^{∗} ⊇ L(N′) ⟶ L_{Θ}(N′) ⊆ M(N′) ⟶ IN^{T′}  ⟶^{F′,B′} IN^{P′}

3.2 Synchronization of Petri Nets

A Petri net N′ = (P′, T′, F′, B′) is called a subnet of N = (P, T, F, B) if S′ ⊆ S, T′ ⊆ T and F′, B′ are the restrictions of F, B. A subnet is called transitionbounded if it contains with every place all transitions adjacent to that place. Transition bounded subnets are related to local morphisms as follows:

Lemma 3.2.1 i) Let (h_{P} , h_{T}) : N′ → N be a local morphism then h_{P} (P′) ⊆ P and h_{T} (T′) ⊆ T induce a transition bounded subnet of N. ii) Let N′ be any subnet of a net N then N′ is transition bounded if and only if the inclusions i_{P} : P′ ↪ P, i_{T} : T′ ↪ T yield a local morphism of nets (i_{P} , i_{T}) : N′ → N.

Proof: i) Let p ∈ P be a place of N which is adjacent to a transition a ∈ T. If

p = h_{P} (p′) for some place p′ ∈ P′ then we have ∑_{a′∈h_{T}^{−1}(a)}(F (a′, p′) + B(a′, p′)) =

F (a, p) + B(a, p) > 0. Hence h_{T}^{−1}(a) is not empty. ii) Easy by i). □

Note that if (i_{P} , i_{T}) : N′ → N is a local morphism where the mapping i_{P} is injective then i_{P}^{∗} : IN^{P} → IN^{P′} is just the restriction of a marking of N to a marking of N.

The synchronization of two nets is defined over a common transition bounded subnet. We restrict ourselves to this case in order to have the Theorem 3.2.3 below.

Definition: Let N_{i} = (P_{i}, T_{i}, F_{i}, B_{i}), i = 1, 2 be Petri nets which contain a common transition bounded subnet N′ = (P′, T′, F′, B′). Then the synchronization of N_{1} and N_{2} over N′ is defined by N_{1} ∥_{N′} N_{2} = (P, T, F, B) where P and T are the disjoint unions P = (P_{1} \ P′) ˙∪(P_{2} \ P′) ˙∪P′, T = (T_{1} \ T′) ˙∪(T_{2} \ T′) ˙∪T′, and F, B are the obvious extensions to P and T. If N_{1}, N_{2} have initial markings m_{1}, m_{2} which coincide on N′, then we give N_{1} ∥_{N′} N_{2} as initial marking the natural extension of m_{1} and m_{2} to P.

One should observe that N′, N_{1} and N_{2} may be viewed as transition bounded subnets of the synchronization N_{1} ∥_{N′} N_{2}. In our category of nets the synchronization is characterized as follows:

Proposition 3.2.2 The synchronization N_{1} ∥_{N′} N_{2} of two nets N_{1}, N_{2} with a common transition bounded subnet N′ is a pushout in the category of nets; i.e., for every pair of local morphisms h_{i} : N_{i} → N, i = 1, 2 to a Petri net N with h_{1}i_{1} = h_{2}i_{2} : N′ → N there exists a unique local morphism h : N_{1} ∥_{N′} N_{2} → N such that the diagram in Figure 3.5 commutes:

[figure: N_{2}; i_{2}; N′; j_{2}; i_{1}; j_{1}; h_{2}; h_{1}; N; N_{1}; N_{1} ∥_{N′} N_{2}; ∃!h]

Figure 3.5. The push-out diagram for the synchronization

Proof: Standard □

The synchronization over the empty subnet, which is transition bounded, yields the disjoint union N_{1} ˙∪N_{2} of nets. This is the direct sum in our category.

If we have two nets N_{1}, N_{2} with a common transition bounded subnet N′ then we obtain a natural covering

p : N_{1} ˙∪N_{2} → N_{1} ∥_{N′} N_{2}.

This covering will be used to compute the trace language of a synchronized net. But before we do so, we define the synchronization of traces.

Definition: Let (X_{1}, D_{1}), …, (X_{k}, D_{k}) be dependence alphabets and let M_{i} = M(X_{i}, D_{i}) be the corresponding free partially commutative monoids, i = 1, …, k. Then the synchronization of M_{1}, …, M_{k} is defined by

M_{1} ∥ … ∥ M_{2} = M(⋃_{i=1}^{k} X_{i}, ⋃_{i=1}^{k} D_{i}).

Let L_{i} ⊆ M_{i}, i = 1, …, k. Then the synchronization of L_{1}, …, L_{k} is defined by

L_{1} ∥ … ∥ L_{k} = {t ∈ M_{1} ∥ … ∥ M_{k} | p_{i}(t) ∈ L_{i} for i = 1, …, k}

where p_{i} : M_{1} ∥ … ∥ M_{k} → M_{i} denotes the canonical projection, i = 1, …, k.

Let us now assume that the net N′ is in fact the intersection of nets N_{1} and N_{2} (we may do this in any case by taking suitable isomorphic copies of N_{1} and N_{2}), and let us simply write N_{1} ∥ N_{2} in this case. Since N′ is transition-bounded, two transitions are dependent in N_{1} ∥ N_{2} if and only if they are dependent in N_{1} or in N_{2}. Thus M(N_{1} ∥ N_{2}) = M(N_{1}) ∥ M(N_{2}). Clearly, we can also define the synchronization of several nets N_{1}, …, N_{k} with k ≥ 2. We only have to require that N_{i} ∩ N_{j} is transition bounded in N_{i} and N_{j} for all i ≠ j. We then set inductively

N_{1} ∥ … ∥ N_{k} = (N_{1} ∥ … ∥ N_{k−1}) ∥ N_{k}.

The brackets may be omitted since the operation of synchronization is associative. Of course, it is also commutative and M(N_{1} ∥ … ∥ N_{k}) = M(N_{1}) ∥ … ∥ M(N_{k}) for the trace monoid of the synchronization of nets N_{1}, … N_{k} with k ≥ 2.

There is a strong compatibility between the synchronization of nets and trace languages. This is stated in the next theorem which turns out to be a special case of Theorem 3.1.8

Theorem 3.2.3 Let N_{1}, …, N_{k} be Petri nets with initial markings, k ≥ 2, such that for all 1 ≤ i, j ≤ k, i ≠ j the intersections P_{i} ∩ P_{j}, T_{i} ∩ T_{j} induce a common transition bounded subnet of N_{i} and N_{j} where the initial marking coincides. Then we have

L_{Θ}(N_{1} ∥ … ∥ N_{k}) = L_{Θ}(N_{1}) ∥ … ∥ L_{Θ}(N_{k}).

Proof: By induction we have to consider the case k = 2, only. The natural mapping of the disjoint union to the synchronization, p : N_{1} ˙∪N_{2} → N_{1} ∥ N_{2}, is a covering. Thus, by Theorem 3.1.8, we have p^{∗}(L_{Θ}(N_{1} ∥ N_{2})) = L_{Θ}(N_{1} ˙∪N_{2}) ∩ p^{∗}(M(N_{1} ∥ N_{2})). Up to a natural identification we have M(N_{1} ˙∪N_{2}) = M(N_{1}) × M(N_{2}) and L_{Θ}(N_{1} ˙∪N_{2}) = L_{Θ}(N_{1})×L_{Θ}(N_{2}). Since L_{Θ}(N_{1})×L_{Θ}(N_{2})∩p^{∗}(M(N_{1} ∥ N_{2})) = p^{∗}({t ∈ M(N_{1} ∥ N_{2}) | p_{i}(t) ∈ L_{Θ}(N_{i}) for i = 1, 2}) = p^{∗}(L_{Θ}(N_{1}) ∥ L_{Θ}(N_{2})), we obtain p^{∗}(L_{Θ}(N_{1} ∥ N_{2})) = p^{∗}(L_{Θ}(N_{1}) ∥ L_{Θ}(N_{2})). Since p is a covering, the mapping p^{∗} is injective. Hence the result. □

Corollary 3.2.4 Let N = (P, T, F, B) be a Petri net with initial marking. For p ∈ P let Atom(p) the subnet with place p and adjacent transitions. Then we have

L_{Θ}(N) = ∥_{p∈P} L_{Θ}(Atom(p)).□

3.3 Local Checking of Trace Synchronizability

We have seen that the trace language of a synchronized system

N_{1} ∥ … ∥ N_{k}

can be identified with the set of tuples

{(t_{1}, …, t_{k}) ∈ L_{Θ}(N_{1}) × ⋯ × L_{Θ}(N_{k}) |
∃t ∈ M(N_{1} ∥ … ∥ N_{k}) : p_{i}(t) = t_{i}∀i = 1, …, k}

This description of L_{Θ}(N_{1} ∥ … ∥ N_{k}) contains a global constraint. We have to check the (global) traces t ∈ M(N_{1} ∥ … ∥ N_{k}) whether their projections p_{i}(t) belong to L_{Θ}(N_{i}) for i = 1, …, k. We shall give a graph-theoretical and an algebraic characterization where the synchronization can be described locally. Most of the results are from the revised version of [DV88].

In order to explain what we mean by a local description, we consider the following situation:

Let (X_{i}, D_{i}), i = 1, …, k be dependence alphabets with associated monoids M_{i} = M(X_{i}, D_{i}) for i = 1, …, k, and the synchronization M_{1} ∥ … ∥ M_{k} =

M( ⋃_{i=1}^{k} X_{i}, ⋃_{i=1}^{k} D_{i}). For each i = 1, …, k we denote the canonical projection by

p_{i} : M_{i} ∥ … ∥ M_{k} → M_{i}. For i, j ∈ {1, …, k} let M_{{i,j}} = M(X_{i} ∩ X_{j}, D_{i} ∩ D_{j}) and p_{ij} : M_{j} → M_{{i,j}} be the canonical mappings. Then we obviously have p_{ij}p_{j} = p_{ji}p_{i} for all i, j. Thus, by the general embedding theorem, we obtain a canonical embedding

π : M_{1} ∥ … ∥ M_{k} → {(t_{1}, …, t_{k}) ∈ M_{1} × … × M_{k} | p_{ij}(t_{j}) = p_{ji}(t_{i})

for all i, j}

We say that a synchronization M_{1} ∥ … ∥ M_{k} has a local description if the mapping π above is bijective. The reason is that in this case it can be checked locally on the components of a tuple (t_{1}, …, t_{k}) ∈ M_{1} × … × M_{k} whether this tuple represents a trace of M_{1} ∥ … ∥ M_{k}.

In the sequel we denote the monoid

{(t_{1}, …, t_{k}) ∈ M_{1} × … × M_{k} | p_{ij}(t_{j}) = p_{ji}(t_{i}) for all i, j}

by ⋈ (M_{1}, …, M_{k}).

Remark 3.3.1 The monoid ⋈ (M_{1}, …, M_{k}) can also be defined as a projective limit: For ∅ ≠ J ⊆ {1, …, k} let M_{J} = M( ⋂_{j∈J} X_{j}, ⋂_{j∈J} D_{j}). We obtain canonical

mappings p_{JK} : M_{K} → M_{J} for ∅ ≠ K ⊆ J ⊆ {1, …, k} and thereby a projective system {(M_{K}, p_{JK}) | ∅ ≠ K ⊆ J ⊆ {1, …, k}}. It is easy to see that the monoid ⋈ (M_{1}, …, M_{k}) is naturally isomorphic to the projective limit of this system. □

For the case k = 2 the monoid ⋈ (M_{1}, M_{2}) is the usual fibered product and we prefer to denote it by M_{1} ×_{M_{{1,2}}} M_{2}. But, in general, ⋈ (M_{1}, M_{2}, M_{3}) is not any fibered product of ⋈ (M_{1}, M_{2}) and M_{3}. (In contrast, the synchronization M_{1} ∥ … ∥ M_{3} is the synchronization of (M_{1} ∥ M_{2}) and M_{3}.)

Here, we are interested in the question in which cases the mapping

π : M_{1} ∥ … ∥ M_{k} →⋈ (M_{1}, …, M_{k})

is an isomorphism.

Similar as in Cori/Métivier [CM85] let us introduce the following notation: If a tuple of traces (t_{1}, …, t_{k}) ∈ M_{1} × … × M_{k} belongs to π(M_{1} ∥ … ∥ M_{k}) it is called reconstructible, if it belongs to ⋈ (M_{1}, …, M_{k}) it is called quasireconstructible. Thus, π : M_{1} ∥ … ∥ M_{k} →⋈ (M_{1}, …, M_{k}) is an isomorphism if and only if every quasi-reconstructible tuple of traces is reconstructible.

We need a further notion on graphs. Let (V, E) be any (directed) graph. A (directed) cycle in (V, E) is a sequence of different vertices (x_{1}, …, x_{n}), n ≥ 3 (n ≥ 2) such that there are (directed) edges from x_{i} to x_{i+1} for all i ∈ Z( mod n). A cycle is called chordless if there are no other edges.

Theorem 3.3.2 Let as above:

M_{i} = M(X_{i}, D_{i}) with dependence graph G_{i}, i = 1, …, k, k ≥ 2, G = ⋃_{i=1}^{k} G_{i},

p_{i} : M_{1} ∥ … ∥ M_{k} → M_{i}, p_{ji} : M_{i} → M(X_{i} ∩ X_{j}, D_{i} ∩ D_{j})

the canonical projections, 1 ≤ i, j ≤ k, and

⋈ (M_{1}, …, M_{k}) = {(t_{1}, …, t_{k}) ∈ M_{1} × … × M_{k} | p_{ij}(t_{j}) = p_{ji}(t_{i})

for all i, j}.

Then the following assertions are equivalent:

i) Then canonical embedding

\begin{matrix}π : M_{1} ∥ … ∥ M_{k} & → & ⋈ (M_{1}, …, M_{k}) \\ t & ↦ & (p_{1}(t), …, p_{k}(t)) \end{matrix}

is an isomorphism

ii) Every chordless cycle in the graph G is a cycle in a subgraph G_{i} for some i ∈ {1, …, k}.

Proof: Let (X, D) = ( ⋃_{i=1}^{k} X_{i}, ⋃_{i=1}^{k} D_{i}) and let M̃ be the set of isomorphism

classes of finite directed labelled graphs [V, E, λ] where V is a finite set of vertices, E ⊆ V × V is a set of directed edges and λ : V → X is a labelling function such that the following condition is satisfied for all x, y ∈ V, x ≠ y:

It holds (λ(x), λ(y)) ∈ D if and only if (x, y) ∈ E or (y, x) ∈ E. The set M̃ forms a monoid with the multiplication [V_{1}, E_{1}, λ_{1}][V_{2}, E_{2}, λ_{2}]

[figure: x_{1}; x_{2}; x_{c(i)}; x_{c(i+1)}; x_{n−1}; x_{n}; ∉ D_{i}]

Figure 3.6. A quasi-reconstructible trace which is not reconstructible

= [V_{1} ˙∪V_{2}, E_{1} ˙∪E_{2} ˙∪{(x_{1}, x_{2}) ∈ V_{1} × V_{2} | (λ(x_{1}), λ(x_{2})) ∈ D}, λ_{1} ˙∪λ_{2}] and the unit element 1 = [∅, ∅, ∅].

Note that M̃ contains M_{1} ∥ … ∥ M_{k} as a submonoid, but it contains also graphs with cycles.

For each [V, E, λ] ∈ M̃ and i ∈ {1, …, k} let [V, E, λ]_{i} be the restriction of the graph to the vertices with labels in X_{i} and to edges (x, y) ∈ E with (λ(x), λ(y)) ∈ D_{i}. Let ˜ M̃ be the submonoid of graphs [V, E, λ] such that [V, E, λ]_{i} is acyclic for all i = 1, …, k. If [V, E, λ] ∈ ˜ M̃ then [V, E, λ]_{i} can be identified with a trace of M_{i}. Obviously we have p_{ij}([V, E, λ]_{j}) = p_{ji}([V, E, λ]_{i}). Thus, we obtain a homomorphism from ˜ M̃ to ⋈ (M_{1}, …, M_{k}). One sees easily that this mapping is a bijection. Hence we may identify ⋈ (M_{1}, …, M_{k}) with the set of graphs in ˜ M̃.

i) ⇒ ii): Assume that (x_{1}, …, x_{n}) is a chordless cycle in G which is not a cycle in any G_{i}, 1 ≤ i ≤ k. Then for each i ∈ {1, …, k} there is an index c(i) ∈ Z/( mod n) such that (x_{c(i)}, x_{c(i)+1}) ∉ D_{i}, and this cycle yields a directed labelled graph as in Figure 3.6.

Hence we may identify (x_{1}, …, x_{n}) with an element of ˜ M̃ =⋈ (M_{1}, …, M_{k}). But this element does not belong π(M_{1} ∥ … ∥ M_{k}) since π(M_{1} ∥ … ∥ M_{k}) consists of acyclic graphs only. Therefore π is not surjective.

Formally, the directed cycle corresponds to the following element:

((x_{c(1)+1} … x_{n}x_{1} … x_{c(1)}), …, (x_{c(n)+1} … x_{n}x_{1} … x_{c(n)}))
∈⋈ (M_{1}, …, M_{k}) \ π(M_{1} ∥ … ∥ M_{k}).

ii) ⇒ i): Assume that π : M_{1} ∥ … ∥ M_{k} →⋈ (M_{1}, …, M_{k}) is not an isomorphism, i.e. π is not surjective. Then there is a graph [V, E, λ] in M̃ which contains a directed cycle but the restriction [V, E, λ]_{i} is acyclic for all i ∈ {1, …, k}. Let (x_{1}, …, x_{n}) be a directed cycle in [V, E, λ] of minimal length.

[figure: G :; c; a; b; G_{2} :; G_{1} :; b; a; c; b; a; c]

Figure 3.7. G has a chordless cycle which does neither belong to G_{1} nor to G_{2}

We shall show that all labels λ(x_{1}), …, λ(x_{n}) are different. Since for an edge (x, y) of [V, E, λ] ∈ ˜ M̃ the pair (y, x) is not an edge, we have n ≥ 3. Assume that λ(x_{i}) = λ(x_{j}) for different i, j. Since n ≥ 3 we may assume i − 1 ≢ j mod n. If we had i + 1 ≡ j mod n then there are two cases both being impossible: Either (x_{i−1}, x_{j}) ∈ E and we find a shorter cycle, or (x_{j}, x_{i−1}) ∈ E and we have a triangle with at most two different labels. Thus, all the labels λ(x_{1}), …, λ(x_{n}) are different and (λ(x_{1}), …, λ(x_{n})) is a chordless cycle in the dependence graph G which does not belong to any G_{i} for 1 ≤ i ≤ k. □

Example: Consider a graph as in Figure 3.7. Then G has a chordless cycle, (a, b, c), which neither belongs to G_{1} nor to G_{2}.

Hence π : M_{1} ∥ M_{2} → M_{1}×_{M_{{1,2}}}M_{2} is not surjective. We have ([abc], [bca]) ∈ M_{1} ×_{M_{{1,2}}} M_{2}, but ([abc], [bca]) ∉ π(M_{1} ∥ M_{2}). □

On the other hand for the synchronization over a free monoid we have the following positive result:

Corollary 3.3.3 Let (X_{1}, D_{1}), (X_{2}, D_{2}) be dependence alphabets and M_{1}, M_{2} be the associated free partially commutative monoids.

If M_{{1,2}} = M(X_{1} ∩ X_{2}, D_{1} ∩ D_{2}) is free then

π : M_{1} ∥ M_{2} → M_{1} ×_{M_{{1,2}}} M_{2}

is an isomorphism.

Proof: Let (x_{1}, …, x_{n}) be a cycle in G such that (x_{i}, x_{i+1}) ∉ D_{1} for some 1 ≤ i ≤ n − 1 and (x_{n}, x_{1}) ∉ D_{2}. Then there exists an index j ∈ {1, …, i} and an index l ∈ {i + 1, …, n} such that x_{j}, x_{l} ∈ X_{1} ∩ X_{2}. If M_{{1,2}} is free then we obtain a chord {x_{j}, x_{l}}. □

The corollary above applies to the synchronization of two free monoids. In this particular case it says that the synchronization of two free monoids has always a local description. Such a synchronization corresponds to a covering of the dependence graph by two cliques. For more cliques we may state:

Corollary 3.3.4 Let G be the dependence graph of a dependence alphabet (X, D). Then there exists a covering by cliques,

(X, D) = (⋃_{i=1}^{k} X_{i}, ⋃_{i=1}^{k}(X_{i} × X_{i}))

such that the resulting embedding

π : M(X, D) →⋈ (X_{1}^{∗}, …, X_{n}^{∗})

is an isomorphism if and only if every chordless cycle of G is a triangle.

Proof: i) ⇒ ii): Every chordless cycle in a complete graph is a triangle. ii) ⇒ i): Every triangle is a clique, and therefore we may choose any covering by cliques such that each triangle lies in at least one of them. □

The corollary above characterizes those trace monoids where we find a covering by cliques such that every quasi-reconstructible tuple of words becomes reconstructible. The next one handles a given covering.

Corollary 3.3.5 Let (X, D) = ⋃_{i=1}^{k}(X_{i}, X_{i} × X_{i}) be a covering of cliques. Then

the following assertions are equivalent:

i) All quasi-reconstructible tuples of X_{1}^{∗} × … × X_{k}^{∗} are reconstructible.

ii) Let a_{1}, …, a_{n} ∈ X, n ≥ 3. If for all j mod n there exists some i ∈ {1, …, k} with a_{j}, a_{j+1} ∈ X_{i}, then a_{j}, a_{j+1}, a_{j+2} ∈ X_{i} for some 1 ≤ j ≤ n − 2 and some i ∈ {1, …, k}.

Proof: Let G, G_{i} be the dependence graphs of (X, D), (X_{i}, X_{i} × X_{i}), i = 1, …, k. Assertion i) means that the canonical embedding π is an isomorphism. Sequences a_{1}, …, a_{n} such that for all j mod n there exists i ∈ {1, …, m} with a_{j}, a_{j+1} ∈ X_{i}, as given in ii), are the cycles of G.

i) ⇒ ii): By induction on n, the case n = 3 being obvious by Theorem 3.3.2. For n > 3 the cycle a_{1}, …, a_{n} must have a chord {a_{m}, a_{l}} m < l. Applying the induction hypothesis to a_{m}, a_{m+1}, …, a_{l} gives the result. ii) ⇒ i): is clear from Theorem 3.3.2. □

Example: Let M = {a, b, c, d}^{∗}/ad = da(≅ IN ∗ IN ∗ IN^{2}) and X_{1} = {a, b, c}, X_{2} = {b, c, d}. Then every quasi-reconstructible pair of words (w_{1}, w_{2}) ∈ X_{1}^{∗}×X_{2}^{∗} is reconstructible. Using the shuffle-operator ⨿⨿ of formal language theory we may describe the set of reconstructible pairs as:

{(w_{1}, w_{2}) ∈ X_{1}^{∗} × X_{2}^{∗} | ∃v ∈ {b, c}^{∗} : w_{1} ∈ v ⨿⨿ a^{∗}, w_{2} ∈ v ⨿⨿ d^{∗}}.

Besides the graph theoretical characterization of Theorem 3.3.2 we have the following purely algebraic result.

Theorem 3.3.6 Use the same notation as in Theorem 3.3.2, but assume furthermore that all alphabets X_{i} are finite for i = 1, …, k. Then the following assertions are equivalent:

i) The canonical embedding

π : M_{1} ∥ … ∥ M_{k} →⋈ (M_{1}, …, M_{k})

is an isomorphism

ii) The monoid ⋈ (M_{1}, …, M_{k}) is finitely generated.

Proof: i) ⇒ ii): trivial

ii) ⇒ i): Assume that π : M_{1} ∥ … ∥ M_{k} →⋈ (M_{1}, …, M_{k}) is not surjective. Then, in the notation of the proof to Theorem 3.3.2, we find a graph in ˜ M̃ as in Figure 3.6 above which is a directed cycle and which represents an element of ⋈ (M_{1}, …, M_{k}).

For each m ≥ 1 we may replace x_{1} by a power x_{1}^{m} and we obtain other elements of ⋈ (M_{1}, …, M_{k}) which are represented by directed cycles. Since directed cycles are strongly connected, no such element is a proper product of non-trivial elements. In particular, each strongly connected graph is a necessary generator of ⋈ (M_{1}, …, M_{k}). Since we have found infinitely many of them the result follows. □

The previous result shows that the consideration of ⋈ (M_{1}, …, M_{k}) leads in a quite natural way to the theory of infinitely generated monoids. However, we are still inside the theory of free partially commutative monoids as we see next.

Theorem 3.3.7 Let (X_{i}, D_{i}), i = 1, …, k, k ≥ 2, be dependence alphabets, M_{i} = M(X_{i}, D_{i}) the associated free partially commutative monoids and p_{ij} : M_{j} → M(X_{i} ∩ X_{j}, D_{i} ∩ D_{j}), 1 ≤ i, j ≤ k, i ≠ j be the canonical projections.

Then the monoid ⋈ (M_{1}, …, M_{k}) = {(t_{1}, …, t_{k}) ∈ M_{1} × … × M_{k} | p_{ij}(t_{j}) = p_{ji}(t_{i}) for all i, j} is free partially commutative.

Proof: Since ⋈ (M_{1}, …, M_{k}) is a submonoid of M_{1} × … × M_{k} it is enough to show that the Levi Lemma holds in it, see Corollary 1.3.6. For w ∈ M_{1}×…×M_{k} we denote by w_{i} the corresponding component in M_{i} and by w_{ij} the element p_{ij}(w_{i}) ∈ M(X_{i} ∩ X_{j}, D_{i} ∩ D_{j}), 1 ≤ i, j ≤ k.

Let x, y, z, t ∈⋈ (M_{1}, …, M_{k}) such that xy = zt. Then, by the Levi Lemma for M_{i}, i = 1, …, k, we find r, u, v, s ∈ M_{1} × … × M_{k} such that x = ru, y = vs, z = rv, t = us, and uv = vu in the direct product M_{1} × … × M_{k}. Thus, we have to show only that r, u, v, s belong to the submonoid ⋈ (M_{1}, …, M_{k}) of M_{1} × … × M_{k}. By symmetry and the cancellativity it suffices to prove that r ∈⋈ (M_{1}, …, M_{k}), i.e., r_{ij} = r_{ji} for all i ≠ j.

Since r_{ij}u_{ij} = x_{ij} = x_{ji} = r_{ji}u_{ji} for all i ≠ j, it is enough to show that |r_{ij}|_{a} = |r_{ji}|_{a} for all a ∈ X_{i} ∩ X_{j}, i ≠ j. Now, for a ∈ X_{i} ∩ X_{j}, i ≠ j we have |r_{ij}|_{a} = |r_{i}|_{a} = min(|x_{i}|_{a}, |z_{i}|_{a}) = min(|x_{ij}|_{a}, |z_{ij}|_{a}) = min(|x_{ji}|_{a}, |z_{ji}|_{a}) = |r_{ji}|_{a}. Hence the result. □

Theorem 3.3.7 is somewhat surprising since the category of free partially commutative monoids is not closed under fibered products, even if we allow letter-to-letter morphisms only. For example, consider the monoid

M = {(w, m, n) ∈ {a, b}^{∗} × IN × IN | |w| = m + n}

It is easy to see that M is a fibered product of {a, b}^{∗} and IN^{2} without being free partially commutative. Indeed, it results from the equation (a, 1, 0)(b, 0, 1) = (a, 0, 1)(b, 1, 0) that Levi’s Lemma does not hold in M.

Putting Theorem 3.2.3 and Theorem 3.3.2 together we obtain a condition such that the trace language of a synchronized system N_{1} ∥ … ∥ N_{k} can be computed locally as {(t_{1}, …, t_{k}) ∈ L_{Θ}(N_{1})×…×L_{Θ}(N_{k}) | p_{ij}(t_{j}) = p_{ji}(t_{i}) for all i ≠ j}.

We continue with an example where the condition above is satisfied.

Consider two systems N_{1}, N_{2} with intersection N′ and synchronization N_{1} ∥ N_{2} as in Figure 3.8.

We have:

[figure: (T_{1}, D_{1}); =; d; a; b; c] [figure: (T_{2}, D_{2}); =; d; b; c; e]

[figure: e; b; a; b; b; e; b; a; c; c; c; c; d; d; d; d; s_{1}; p_{1}; q; s_{2}; p_{2}; r; r; (; ); ˙⋃; (; ); N_{1} :; N_{2} :; N′ = N_{1} ∩ N_{2} :; N_{1} ∥ N_{2} :; 2; 2; 2; 2]

Figure 3.8. A synchronized system where the behavior is computable locally

(T_{1} ∩ T_{2}, D_{1} ∩ D_{2}) = b  c  d

[figure: (T, D); =; d; a; b; c; e]

Hence M(N) = M(N_{1}) ×_{M′} M(N_{2}) where M′ = M(T_{1} ∩ T_{2}, D_{1} ∩ D_{2}) by Theorem 3.3.2. Let us show how to compute L_{Θ}(N) = L_{Θ}(N_{1} ∥ N_{2}) locally from L_{Θ}(N_{1}) and L_{Θ}(N_{2}). The elements of L_{Θ}(N_{1}) are exactly the prefixes of the following (infinite) traces

[figure: d; a^{i_{1}}; b^{i_{1}}; c; d; a^{i_{2}}; b^{i_{2}}; c; …]

with 2 = (i_{1} + j_{1}) = (i_{2} + j_{2}) = ⋯ The elements of L_{Θ}(N_{2}) are given by the prefixes of

[figure: e; b^{n}; d^{k}; c; b; d^{m}; b; …]

with k ≤ 1, k + m = 2 and n ≥ 1. Let t_{i} ∈ L_{Θ}(N_{i}) be traces and p′_{i} : M(N_{i}) → M′ = M(T_{1} ∩ T_{2}, D_{1} ∩ D_{2}) be

the canonical projection, i = 1, 2. If t′ = p′_{1}(t′_{1}) = p′_{2}(t′_{2}) then t′ is a prefix of

[figure: b^{n}; d; c; b^{2}; d]

with n = 1 or n = 2.

This gives us a complete description of L_{Θ}(N). We have t ∈ L_{Θ}(N) if and only if t is a prefix of

[figure: N_{1} :; N_{2} :; N_{1} ∥ N_{2} :; a; b; c; c; d; a; a; b; c; d]

Figure 3.9. A synchronized system where the condition of Theorem 3.3.3 is violated

[figure: d; a^{m}; b^{n}; e; c; a^{i}; b^{j}; d]

with m + n = 2, n ≥ 1, and i + j = 2 or t is a prefix of

d  e a^{2} \overline{}

We do not claim that the direct computation of L_{Θ}(N) causes any difficulties. The point was that we have determined this behavior purely local from the components. The example was chosen to show how the machinary works only.

If the condition of Theorem 3.3.2 is violated, it may happen that the trace language of a synchronized net system has no local description in the sense above:

Consider the situation of systems as in Figure 3.9.

We have

[abc] ∈ L_{Θ}(N_{1}) = Prefix([(abc)^{∗}]), and
[cda] ∈ L_{Θ}(N_{2}) = Prefix([(cda)^{∗}]).

Since p_{21}([abc]) = {ac, ca} = p_{12}([cda]) we have ([abc], [cda]) ∈ {(t_{1}, t_{2}) ∈ L_{Θ}(N_{1}) × L_{Θ}(N_{2}) | p_{12}(t_{2}) = p_{21}(t_{1})} but L_{Θ}(N_{1} ∥ N_{2}) = {1} since there is no token on the net.

This raises the question what can be done if M(N_{1} ∥ … ∥ N_{k}) is not isomorphic to ⋈ (M_{1}, …, M_{k}). There is still a local computation if one is willing to renounce some concurrency. Since L_{Θ}(N_{1} ∥ … ∥ N_{k}) = L_{Θ}(N_{1} ∥ … ∥ N_{k}) ∥ L_{Θ}(N_{k}), it is enough to explain this in the case k = 2:

Let (X_{1}, D_{1}), (X_{2}, D_{2}) be dependence alphabets, (X′, D′) = (X_{1} ∩ X_{2}, D_{1} ∩ D_{2}) and D̂ be any dependence relation between D′ and X′ × X′, i.e., D′ ⊆ D̂ ⊆ X′ × X′.

Define: M_{i} = M(X_{i}, D_{i}), M̂_{i} = M(X_{i}, D_{i} ∪ D̂) for i = 1, 2, M = M(X_{1} ∪ X_{2}, D_{1} ∪ D_{2}), M̂ = M(X_{1} ∪ X_{2}, D_{1} ∪ D_{2} ∪ D̂), M′ = M(X′, D′), M̂′ = M(X′, D̂).

We obtain a commutative diagram with canonical mappings:

M̂_{1} ∥ M̂_{2}  ⟶^{π̂}  M̂_{1} ×M̂′ M̂_{2}
↓ p  ↓ q
M_{1} ∥ M_{2}  ⟶^{π}  M_{1} ×_{M′} M_{2}

The canonical projection p is always surjective, but it may happen that q is neither surjective nor injective. Furthermore, it may happen that π is bijective but π̂ is not, or conversely.

However, we claim that for given (X_{1}, D_{1}),(X_{2}, D_{2}) there is always at least one choice for D̂ ⊆ X′ × X′ such that π̂ : M̂_{1} ∥ M̂_{2} → M̂_{1} ×M̂′ M̂_{2} becomes an isomorphism. Indeed, in the worst case take D̂ = X′ × X′ then M̂′ is free and we may apply Corollary 3.3.3.

Since for i = 1, 2 every trace t_{i} ∈ M_{i} may be viewed as a congruence class of traces in M̂_{i} it makes sense to write t̂_{i} ∈ t_{i} for t̂_{i} ∈ M̂_{i}, t_{i} ∈ M_{i} if the canonical projection maps t̂_{i} onto t_{i}. Now, we can use a local description of M̂_{1} ∥ M̂_{2} to compute every synchronization L_{1} ∥ L_{2} ⊆ M_{1} ∥ M_{2} locally:

Theorem 3.3.8 With the notations from above assume that π̂ : M̂_{1} ∥ M̂_{2} → M̂_{1} ×M̂′ M̂_{2} is an isomorphism. Let L_{1} ⊆ M_{1}, L_{2} ⊆ M_{2} be trace languages then π maps L_{1} ∥ L_{2} bijectively onto the following set of pairs:

{(t_{1}, t_{2}) ∈ L_{1} × L_{2} | ∃t̂_{1} ∈ t_{1}, t̂_{2} ∈ t_{2} : p̂_{21}(t̂_{1}) = p̂_{12}(t̂_{2}) in M̂′}

Proof: Since p : M̂_{1} ∥ M̂_{2} → M_{1} ∥ M_{2} is surjective, we obtain from the diagram above π(L_{1} ∥ L_{2}) = qπ̂(p^{−1}(L_{1} ∥ L_{2})). Let L̂_{i} ⊆ M̂_{i} be the inverse image of L_{i} ⊆ M_{i}, i = 1, 2. Then one easily verifies p^{−1}(L_{1} ∥ L_{2}) = L̂_{1} ∥ L̂_{2} and hence π(L_{1} ∥ L_{2}) = qπ̂(L̂_{1} ∥ L̂_{2}).

By assumption π̂ is bijective, hence π̂(L̂_{1} ∥ L̂_{2}) = {(t̂_{1}, t̂_{2}) ∈ L̂_{1} × L̂_{2} | p̂_{21}(t̂_{1}) = p̂_{12}(t̂_{2}) in M̂′}; and applying the mapping q to this set yields the result. □

The theorem above yields a local description of L_{1} ∥ L_{2} which is available in all cases. But this description has the disadvantage that one can not work on traces directly; one has to consider all representatives of a trace t_{i} ∈ M_{i} in M̂_{i} for i = 1, 2.

3.4 Algorithms on Three-Colored Graphs

The graph-theoretical characterization for a local description of a synchronization raises the following problem:

(∗) Given an undirected graph as a union of subgraphs, G = ⋃_{i=1}^{k} G_{i}. Is there

a chordless cycle which is not a cycle in G_{i} for some 1 ≤ i ≤ k?

Obviously, this problem is in NP. We shall prove that it is NP-complete. To see completeness it is enough to consider certain subproblems. We consider only unions of graphs where for each i ∈ {1, …, k} there is exactly one edge which is not an edge of G_{i}. Denote this edge by e_{i}, i = 1, …, k. Then we look for a chordless cycle containing all edges e_{1}, …, e_{k}.

Theorem 3.4.1 The following problem is NP-complete. Given an undirected graph and a subset of edges {e_{1}, …, e_{k}}. Is there a chordless cycle which contains all e_{1}, …, e_{k}?

Proof: We reduce the problem to Satisfiability, (3−SAT), which is well-known to be NP-complete, see e.g. [GJ79, p 46]. Let X be a set of variables, \overline{X} be a disjoint copy of X and V = X ˙∪\overline{X}. By a clause we mean here an expression of the form c = v_{1} ∨ v_{2} ∨ v_{3} with v_{1}, v_{2}, v_{3} ∈ V. To each clause c we associate a graph G(c) as in Figure 3.10.

Now, let e = c_{1} ∧ … ∧ c_{k} be an expression where c_{i} are clauses, i = 1, …, k. To the expression e we associate a graph G(e) in the following way:

First we connect each q_{i} ∈ G(c_{i}) with p_{i+1} ∈ G(c_{i+1}) for i ∈ Z( mod k), and then we draw edges between all v_{i} ∈ G(c_{i}), v_{j} ∈ G(c_{j}) where 1 ≤ i, j ≤ k i ≠ j and \{v_{i}, v_{j}\} = \{x, \overline{x}\} for some x ∈ X. (For example, the expression

(x ∨ y ∨ z) ∧ (\overline{x} ∨ y ∨ z) ∧ (x ∨ y ∨ \overline{z})

[figure: G(c); =; p; v_{2}; v_{3}; v_{1}; q]

Figure 3.10. The graph associated to a clause

[figure: p_{1}; y; q_{1}; p_{2}; y; q_{2}; p_{3}; y; q_{3}; x; x̄; x; z; z; z̄]

Figure 3.11. The graph of (x ∨ y ∨ z) ∧ (\overline{x} ∨ y ∨ z) ∧ (x ∨ y ∨ \overline{z})

is associated with the graph given in Figure 3.11.) It is clear from the construction that the expression e = c_{1} ∧ … ∧ c_{k} has a true assignment if and only if G(e) has a chordless cycle containing all edges

{q_{1}, p_{2}}, {q_{2}, p_{3}}, …, {q_{k−1}, p_{k}}, {q_{k}, p_{1}}

□

The theorem shows that it might be very difficult to decide whether a synchronization M_{1} ∥ … ∥ M_{k} has a local description. In fact, we have shown:

Corollary 3.4.2 The following problem is Co-NP-complete:

Given finite dependence alphabets (X_{1}, D_{1}), …, (X_{k}, D_{k}), k ≥ 2. Let

M_{1}, …, M_{k} be the associated trace monoids. Is the canonical embedding

π : M_{1} ∥ … ∥ M_{k} →⋈ (M_{1}, …, M_{k})

surjective? □

In the rest of this section we restrict ourselves to the case k = 2, i.e., G = G_{1} ∪ G_{2}. In this case it is very suggestive to work with colors. We color an edge of G blue if it belongs to G_{1} but not to G_{2}, yellow if it belongs to G_{2} but not to G_{1}, and green if it belongs to G_{1} ∩ G_{2}. ( ‘Green’ stands for the blending of blue and yellow).

Note that every edge has exactly one color.

In terms of colors, a chordless cycle of G = G_{1} ∪ G_{2} which lies neither in G_{1} nor in G_{2} is the same as a chordless cycle in G with some blue edge and some yellow edge.

In the following we call a graph with a coloring of its edges with blue, yellow and green a three-colored graph. We denote the respective edge sets by E_{blue}, E_{yellow}, E_{green} and write edges {x, y} as xy henceforth. The problem (∗) restricted to the case k = 2 becomes: (∗∗) Given a three-colored graph. Is there a chordless cycle containing some blue edge and some yellow edge? We can also formulate the following polynomially equivalent problem. (∗ ∗ ∗) Given a graph and two edges e_{1}, e_{2}. Is there a chordless cycle containing e_{1} and e_{2}?

It has recently been shown by K. Reinhardt that (∗∗∗) is NP-complete. This is a strengthening of Theorem 3.4.1 and solves Problem 261 of [Die90b] which has been an open question from [DV88].

If the number of green edges is bounded logarithmically in the number of vertices we can give a polynomial algorithm that answers (∗∗). First we will deal with the case that there are no green edges at all.

We call a chordless cycle with some blue and some yellow edge a forbidden cycle.

Algorithm: function forbidden cycle 1 (G: three-colored graph

∥ G = (V, E) has no green edge):boolean;

define a graph H with vertex set V_{blue} ˙∪V_{yellow}, where V_{i} = {X | X is a connected component of (V, E_{i})} for i ∈ { blue, yellow }, and edge set {XY | X ∈ V_{blue}, Y ∈ V_{yellow}, X ∩ Y ≠ ∅}; return H contains a cycle or there are X ∈ V_{blue}, Y ∈ V_{yellow} with |X ∩ Y | ≥ 2 endfunction Theorem 3.4.3 Given a three-colored graph G without green edges. Then forbidden cycle 1 answers (∗∗) in polynomial time.

Proof: The time bound is obvious, thus we only have to prove correctness. Assume that there are forbidden cycles in G. Take one cycle in such a way that if we walk around the cycle the number of color changes is as small as possible. If this number is two we have found a blue and a yellow component with two vertices in common. Otherwise, since each blue and each yellow component is passed at most once and at each color change we walk from a blue component into a yellow one via a common vertex (and vice versa), we get a cycle in H.

Now assume that forbidden cycle 1(G) is true. Then both parts of the hypothesis give us the existence of cycles in G which contain some blue and some yellow edge. A chord of such a cycle gives us two shorter cycles one of which contains some yellow and some blue edge. Thus, a shortest cycle in G which contains some blue and some yellow edge is chordless. □

Now we come to an algorithm for three-colored graphs:

For a graph G = (V, E) and vertices x_{1}, …, x_{n} ∈ V let G − {x_{1}, …, x_{n}} be defined in the obvious way as the graph obtained from G by deleting x_{1}, …, x_{n} and their incident edges. For an edge xy that does not lie on any triangle let G/xy be defined in the obvious way as the graph obtained from G by contracting xy, i.e., by eliminating xy and identifying x and y. Since xy does not lie on a triangle it is obvious how to color the edges of G/xy using the coloring of G.

Algorithm: function forbidden cycle (G: three-colored graph ∥ G = (V, E)):boolean; if there is some green edge xy then return there is some v with vx ∈ E_{i} and vy ∈ E_{j}, {i, j} = { blue, yellow } (“{v, x, y} is a forbidden triangle.”)

or forbidden cycle (G − {x}) (“vertex x is not involved in a forbidden cycle.”)

or forbidden cycle (G − {y}) (“vertex y is not involved in a forbidden cycle.”)

or forbidden cycle ((G − {v | (x, v, y) is a triangle })/xy) (“There are no forbidden triangles with edge xy.”) else return forbidden cycle 1(G) endif endfunction Theorem 3.4.4 There exists a polynomial p such that algorithm forbidden cycle solves Problem (∗∗) on input G = (V, E) in time O(3^{min(|V |,|E_{green}|)} · p(|V |).

Proof: To prove correctness we only have to consider the then-case, which can easily be checked distinguishing several cases. For the time complexity observe that as long as there are green edges we reduce the problem in polynomial time to three subproblems with fewer vertices and fewer green edges.

Now the result follows with Theorem 3.4.3. □

Corollary 3.4.5 (i) Problem (∗∗) can be solved in polynomial time if the number of green edges is bounded logarithmically in the number of vertices. (ii) For dependence alphabets (X_{1}, D_{1}), (X_{2}, D_{2}), Condition (ii) of Theorem 3.3.2 can be checked in polynomial time if |(D_{1} ∩ D_{2}) \ ((X_{1} ∩ X_{2}) × (X_{1} ∩ X_{2}))| is bounded logarithmically in the number |X_{1} ∪ X_{2}|, (in particular, if it is bounded by some constant). □

84 3. Petri Nets and Synchronizations

4. Complete Semi-Thue Systems and Möbius Functions

4.1 Semi-Thue Systems

Most of the material of the first section is standard and can be found e.g. in [Jan88]. It serves as a basic for the following. Some new proofs are given if they seemed to be simpler than the ones found elsewhere. In particular, we show that confluence of noetherian semi-Thue systems can be decided on so-called minimal critical pairs. This is a special case of a result of Winkler-Buchberger [WB83] on term rewriting systems. It is of practical interest since in many cases fewer pairs have to be considered to test confluence. Surprisingly minimal critical pairs appear in a very natural way in computations on Möbius functions. This will be described in Sect. 4.4.

A semi-Thue system is a subset S ⊆ X^{∗} × X^{∗} where X denotes a (finite) alphabet. The elements of S are called rules, here often written in the form l ⇒ r or r ⇐ l if (l, r) ∈ S. We do not use the notation l → r for rules since simple arrows are used in the dependence graphs of traces, which later could lead to confusion. A semi-Thue system S ⊆ X^{∗} × X^{∗} defines a relation by w ⟹_{S} w′ for

w, w′ ∈ X^{∗} if w = ulu′ and w′ = uru′ for some u, u′ ∈ X^{∗}, (l, r) ∈ S. By ⟹_{S}^{∗}

(⟹_{S}^{+} resp.) we denote the reflexive and transitive (transitive resp.) closure of

⟹_{S}. The reflexive, symmetric and transitive closure of ⟹_{S} is denoted by ⟺_{S}^{∗}. It

is a congruence and defines a quotient monoid X^{∗}/⟺_{S}^{∗} which is also denoted by X^{∗}/S. Two systems S, T ⊆ X^{∗} × X^{∗} are called equivalent if X^{∗}/S = X^{∗}/T. The word problem of S is to decide whether two given strings u, v ∈ X^{∗} are congruent modulo S. A classical result of E. Post, [Pos47], states that the word problem of finite semi-Thue systems is recursively unsolvable. A very simple example of a semi-Thue system without a solvable word problem has been constructed by G.S. Ceitin, [Cei58], over the alphabet X = {a, b, c, d, e}. It has only the following seven rules:

ac ⇔ ca , ad ⇔ da
bc ⇔ cb , bd ⇔ db
ce ⇔ eca , de ⇔ edb
c^{2}a ⇔ c^{2}ae.

A semi-Thue system S ⊆ X^{∗} × X^{∗} is called noetherian if there are no infinite

chains w_{0} ⟹_{S} w_{1} ⟹_{S} w_{2} ⟹_{S} w_{3} ⟹_{S} . . ..

It is called confluent if for all u, v, w ∈ X^{∗} with u ⟸_{S}^{∗} v ⟹_{S}^{∗} w there exists

a word z ∈ X^{∗} with u ⟹_{S}^{∗} z ⟸_{S}^{∗} w. We shall also say that a pair (u, w) is

confluent if there exists z ∈ X^{∗} with u ⟹_{S}^{∗} z ⟸_{S}^{∗} w.

A system S ⊆ X^{∗} × X^{∗} is called locally confluent if for all u, v, w ∈ X^{∗} with u ⟸_{S} v ⟹_{S} w the pair (u, w) is confluent. Using noetherian induction one can show that a noetherian system is confluent if and only if it is locally confluent. This fundamental result is due to M. Newman, [New42], see also [Hue80]. A semi-Thue system which is both, noetherian and (locally) confluent, is called complete. By Irr(S) we denote the set of irreducible words, i.e., the set of words which are not of the form ulv for any u, v ∈ X^{∗} and (l, r) ∈ S. If a system S ⊆ X^{∗} × X^{∗} is finite and complete then we may decide the question whether two words are concurrent modulo S in the following way:

Given two input strings u, v ∈ X^{∗}, we compute their irreducible descendants u ⟹_{S}^{∗} û ∈ Irr(S), v ⟹_{S}^{∗} v̂ ∈ Irr(S). The computation of û and v̂ is possible since S is finite and noetherian. Since S is confluent and since confluence is equivalent to the so-called Church-Rosser property, [New42], we have u ⟺_{s}^{∗} v if and only if û = v̂ as strings over X. Thus, if we can present a monoid by a finite complete semi-Thue system, then the monoid is finitely presentable and it has a decidable word-problem. For quite a long time it has been a challenging open problem whether the converse holds. The answer is negative due to a result of C. Squier, [Squ87].

If we know that a system S ⊆ X^{∗} × X^{∗} is noetherian then we can test local confluence and hence confluence by inspecting critical pairs. Critical pairs arise from left-hand sides of rules of the system which are overlapping. Formally they are defined as follows:

One says that (u, v) is a critical pair of S if u, v have either the form u = u_{1}r_{1}, v = r_{2}v_{2} for some u_{1}, v_{1} ∈ X^{∗}, (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S, u_{1}l_{1} = l_{2}v_{2} and |u_{1}| < |l_{2}| or u = r_{1}, v = v_{1}r_{2}v_{2} for some v_{1}, v_{2} ∈ X^{∗}, (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S and l_{1} = v_{1}l_{2}v_{2}.

It is well-known (and easy to see) that S is locally confluent if and only if all critical pairs are confluent. For noetherian systems not all critical pairs need to be considered. We show this in two steps: The first one reduces to the case that no left-hand side of a rule is a factor of any other left-hand side. Then we introduce so-called minimal critical pairs, and we prove that one can decide confluence by only using them.

The first step is done as follows: let S ⊆ X^{∗} × X^{∗} be any given noetherian semi-Thue system. Let L ⊆ X^{∗} be the basis of the ideal X^{∗} \ Irr(S), i.e., L is the uniquely determined minimal set such that X^{∗} \ Irr(S) = X^{∗}LX^{∗}. Then for each l′ ∈ L we choose exactly one rule (l′, r′) ∈ S. This is possible since L ⊆ {l ∈ X^{∗} | (l, r) ∈ S for some r ∈ X^{∗}}. Let S′ ⊆ S be the subsystem defined by the chosen rules (l′, r′). Now for every (l, r) ∈ S \ S′ we take the rule (l′, r′) ∈ S′ such that we have l = ul′v for some u, v ∈ X^{∗}; then we test the confluence of the pair (ur′v, r). If all these pairs are confluent then S′ is an equivalent noetherian subsystem of S, and S is confluent if and only if S′ is confluent. Thus, it is sufficient to show how we can test confluence of noetherian systems where no left-hand side of a rule is a factor of any other left-hand side. For these systems we define minimal critical pairs.

Definition: Let S ⊆ X^{∗} × X^{∗} be a noetherian semi-Thue system such that no left-hand side of a rule is a factor of any other left-hand side. Then (u, v) ∈ X^{∗} × X^{∗} is called a minimal critical pair if for some u_{1}, v_{1} ∈ X^{∗}, (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S, u_{1}l_{1} = l_{2}v_{2}, |u_{1}| < |l_{2}| we have u = u_{1}r_{1}, v = r_{2}v_{2} and for all u′, v′ ∈ X^{∗}, (l, r) ∈ S the equation u′lv′ = u_{1}l_{1} implies v′ = 1 and l = l_{1} or l = l_{2} and u′ = 1.

The definition rephrased in different terms says that minimal critical pairs arise from those words which contain left-hand sides exactly twice, one being a prefix the other one a suffix both having a non-trivial overlapping. To give an example consider the system S = {(abc, r_{1}), (bcd, r_{2}), (cde, r_{3})}. The critical pair with respect to r_{1}de ⟸_{S} abcde ⟹_{S} abr_{3} is not minimal in our sense since bcd is a left-hand side. There are two minimal pairs (r_{1}d, ar_{2}) and (r_{2}e, br_{3}).

More generally, assume that for some a_{1}, …, a_{n} ∈ X we have

S = {a_{i} … a_{n}a_{1} … a_{i−1} ⇒ r_{i} | 1 ≤ i ≤ n}.

Then the system S has n · (n − 1) critical pairs, but only n of them are minimal.

The following result is a special case of the Winkler-Buchberger [WB83] criterium for cirtical pairs of term rewriting systems.

Theorem 4.1.1 Let S ⊆ X^{∗} × X^{∗} be a noetherian semi-Thue system such that no left-hand side of a rule is a factor of any other left-hand side. Then S is confluent if and only if S is confluent on all minimal critical pairs.

Proof: Let ⪯ be the relation on X^{∗} defined by y ⪯ x if x ⟹_{S}^{∗} uyv for some u, v ∈ X^{∗}. Then the relation ≺ (= (⪯ and ≠)) is easily seen to be a wellfounded partial ordering. Consider a critical pair (u, v) which is not minimal in the sense defined above. Then we find words t, w, y, z ∈ X^{+}, x ∈ X^{∗} and rules (l_{1}, r_{1}), (l_{2}, r_{2}), (l, r) ∈ S such that l_{1} = twx, l = wxy, l_{2} = xyz and u = r_{1}yz, v = twr_{2}. Let s = twxyz then, using noetherian induction, we may assume that s is confluent on all words s′ ∈ X^{∗} such that s ≻ s′. In particular, since s ≻ twxy and s ≻ wxyz, the critical pairs (r_{1}y, tr) and (rz, wr_{2}) are confluent. Hence

u = r_{1}yz ⟹_{S}^{∗} w_{1}z ⟸_{S}^{∗} trz ⟹_{S}^{∗} tw_{2} ⟸_{S}^{∗} twr_{2} = v

for some w_{1}, w_{2} ∈ X^{∗}. Since also s ≻ trz we may conclude that the pair (w_{1}z, tw_{2}) is confluent, too. It follows that (u, v) is confluent. □

The idea of the proof above is identical to the one which shows that noetherian systems are confluent if they are locally confluent. The only difference is that we used a finer well-founded ordering.

Theorem 4.1.1 applies, in particular, to normalized systems. A semi-Thue system is called normalized if for all rules (l, r) ∈ S the right-hand side r is irreducible and the left-hand side is irreducible with respect to S \ {(l, r)}. It is well-known that every semi-Thue system S ⊆ X^{∗} × X^{∗} is equivalent to some normalized complete semi-Thue system Ŝ ⊆ X^{∗} × X^{∗} . Furthermore, if S is complete and if we demand Irr(S) = Irr(Ŝ) then Ŝ is uniquely determined. We shall prove this simple fact later in a slightly more general set-up.

Unfortunately, there is no way to decide whether a given finite system S ⊆ X^{∗} × X^{∗} has an equivalent finite complete one, see [O’D83, Thm. 2.3].

It is also well-known that following three problems are recursively unsolvable: Given a finite semi-Thue system S ⊆ X^{∗} × X^{∗} :

i) Is S ⊆ X^{∗} × X^{∗} noetherian?

ii) Is S ⊆ X^{∗} × X^{∗} confluent?

iii) Is S ⊆ X^{∗} × X^{∗} locally confluent?

The undecidability of the first problem follows by simulating a Turing machine, see [HL78] for details. A sketch of proof for the unsolvability of ii), iii) may be found in [BO84, Prop. 1.1]. Let us give a simple proof here (it was already reproduced in [Jan88]): Start with any finite symmetric semi-Thue system S ⊆ X^{∗} × X^{∗} such that X^{∗}/S has an undecidable word problem. For example, take the seven-rule system of Ceitin mentioned above.

Let x, y, z ∉ X be new symbols. For u, v ∈ X^{∗} define a system:

T_{u,v} := S ∪ {x ⇒ yuz, x ⇒ yvz}.

The undecidability of ii) and iii) is immediate from the following claim.

Claim: Let u, v ∈ X^{∗}. Then the following assertion are equivalent

1): u ⟺_{S}^{∗} v,

2): T_{u,v} is confluent,

3): T_{u,v} is locally confluent.

Proof of Claim: 1) ⇒ 2): If we have u ⟺_{S}^{∗} v then (X ∪ {x, y, z})^{∗}/T_{u,v} is isomorphic to the free product (X^{∗}/S)∗({y, z}^{∗}). The implication follows since S is a symmetric system. 2) ⇒ 3): trivial. 3) ⇒ 1): Since T_{u,v} is locally confluent, the pair (yuz, yvz) is confluent. But this pair is confluent only if u ⟺_{S}^{∗} v. □

The central algorithm for finite noetherian systems is the computation of irreducible descendants. There is a standard algorithm to compute these descendants, which is described below. It uses string variables s and t which may be implemented by two push-down stores. We call it right reduce since we work on the input string from right to left.

Algorithm: (Given: alphabet X and S ⊆ X^{∗} × X^{∗} finite noetherian) function right reduce(s:string):string; var t:string:=1; while s ≠ 1 do

s := lead(s); t :=last(s) t;

if t ∈ LX^{∗} with L = {l ∈ X^{∗} | (l, r) ∈ S}

then s := sr, t := l^{−1}t for any (l, r) ∈ S such that t ∈ lX^{∗} endif

endwhile return t endfunction

Proof of Correctness: The algorithm terminates since S is noetherian. Let n be the number of executions of the while-loop and let s_{i}, t_{i}, i = 0, …, n be the values of the variables s and t after the i-th execution of the loop. Clearly s = s_{0}t_{0} ⟹_{S}^{∗} s_{1}t_{1} ⟹_{S}^{∗} … ⟹_{S}^{∗} s_{n}t_{n} = t_{n} =right reduce(s). It is therefore enough to show that t_{i} ∈ Irr(S) for all i = 0, …, n.

Since S is noetherian, we have t_{0} = 1 ∈ Irr(S). Let i ≥ 1, then either t_{i} = last(s_{i−1})t_{i−1} ∈ Irr(S) or t_{i} is a suffix of t_{i−1}. In the latter case t_{i} is irreducible by induction. □

R. Book [Boo82, Thm 4.1] has shown that the algorithm above works in linear time for length-reducing systems. Slightly more generally we will see that it works in linear time for weight-reducing systems. These systems are defined as follows:

A weight function on X is a function γ from X to the positive integers. This function defines a homomorphism γ : X^{∗} → IN with γ^{−1}(0) = {1} by summing up the weights. (The weight function γ(x) = 1 for all x ∈ X yields just the length of words.) A semi-Thue system S ⊆ X^{∗} × X^{∗} is called weight-reducing if there is a weight function γ : X^{∗} → IN such that γ(l) > γ(r) for all (l, r) ∈ S.

The reason that we consider weight-reducing systems instead of length-redu-cing is that the use of weight-reducing systems leads to a larger class of monoids: Let S = {ab → c^{2}}, then S is confluent and weight-reducing, but the monoid M = {a, b}^{∗}/S has no presentation by any finite confluent length-reducing semi-Thue system. In fact, one can show that no confluent length-reducing presentation of M exists over any finite alphabet, see [Die87b, Thm. 2.3].

If S is finite then it is decidable whether S is weight-reducing; and if it is then we may effectively compute a weight function γ : X^{∗} → IN such that γ(l) > γ(r) for all (l, r) ∈ S. Indeed, let X = {a_{1}, …, a_{m}}, S = {(l_{1}, r_{1}), …, (l_{n}, r_{n})}, m, n ≥ 0. The system S is weight-reducing if and only if the following system of n linear equations with variables x_{1}, …, x_{m}, z_{1}, …, z_{m} has a strictly positive rational solution:

(∑_{i=1}^{m}(|l|_{a_{i}} − |r|_{a_{i}})x_{i} = z_{j})_{j=1,...,n}

Proposition 4.1.2 ([Boo82, Thm. 4.1]) If S ⊆ X^{∗} × X^{∗} is a finite weightreducing semi-Thue system then algorithm right reduce works in linear time.

Proof: Let γ : X^{∗} → IN be a weight function and 0 < ϵ < 1 such that (1 − ϵ)γ(l) ≥ γ(r) + ϵ for all (l, r) ∈ S. As above, let s be the input, n be the number of while-loops, and s_{i}, t_{i} the values of the variables s, t after the i-th loop, i = 0, …, n. For i = 0, …, n define δ_{i} := γ(s_{i}) + (1 − ϵ)γ(t_{i}), then we have 0 ≤ δ_{i} ≤ δ_{i−1} − ϵ ≤ δ_{0} = γ(s) for 1 ≤ i ≤ n. Hence n ≤ \frac{1}{ϵγ(s)} ∈ O(|s|). □

4.2 Complete Presentations of Trace Monoids

In the last section we have seen that finite, confluent, weight-reducing semi-Thue systems present monoids with a word problem solvable in linear time. The converse is not true. This can be seen by the consideration of IN^{2}. More generally let (X, D) be a finite dependence alphabet with independence relation I = X × X \ D. We know that the word problem for traces is solvable in linear time. However, unless M(X, D) is free the monoid M(X, D) is not presentable by any finite confluent weight-reducing semi-Thue system T ⊆ Y^{∗} × Y^{∗}. Indeed assume the contrary. Then for u, v ∈ Y^{∗} with u ⟺_{T}^{∗} v there exists a derivation u ⟺_{T} u_{1} ⟺_{T} … ⟺_{T} u_{n} = v of length n ∈ O(|uv|). Now this property does not depend on the presentation. It is therefore also satisfied for the system S = {ab ⇔ ba | (a, b) ∈ I}. If M(X, D) is not free, we find independent letters a, b ∈ X, (a, b) ∈ I. Since every derivation

a^{m}b^{m} ⟺_{S} u_{1} ⟺_{S} … ⟺_{S} u_{n} = b^{m}a^{m}

has length at least n = m^{2}, no such T ⊆ Y^{∗} × Y^{∗} can exist.

On the other hand it is possible to present a trace monoid by some finite complete semi-Thue system without length-increasing rules. Such a complete presentation exists over an alphabet where the letters are the elementary steps of the trace monoid. Recall that the set of elementary steps has been defined by

F = {F ⊆ X | ∅ ≠ F is finite and (a, b) ∈ I for all a, b ∈ F, a ≠ b}

Every elementary step F ∈ F is associated with a trace [F] = ∏_{a∈F} a ∈ M(X, D)

and identifying an element a ∈ X with the singleton set {a} ∈ F we have X ⊆ F.

Theorem 4.2.1 Let S ⊆ F^{∗} × F^{∗} be the semi-Thue system which has the following rules:

F F′ ⇒ F ∪ F′ for F ∪ F′ ∈ F, F ∩ F′ = ∅
F F′ ⇒ (F ∪ F′′)(F′ \ F′′)

for F, F′, F′′ ∈ F, ∅ ≠ F′′ = {a ∈ F′ \ F | F ∪ {a} ∈ F} ≠ F′

Then the inclusion X ⊆ F induces an isomorphism between M(X, D) and F^{∗}/S. The inverse of this isomorphism is given by the mapping ψ : F → M(X, D), F ↦ [F]. The semi-Thue system S ⊆ F^{∗} × F^{∗} is complete; it is finite if and only if the independence relation I ⊆ X × X is finite.

Proof: It is clear that S is finite if and only if I is finite. The system S is noetherian since no rule is length increasing and for each length preserving rule F F′ ⇒ (F ∪F′′)(F′\F′′), the set F′\F′′ is properly included in F′. The confluence of S follows by inspecting the critical pairs. This is easily done and left to the reader. Hence S is complete. To complete the proof, observe that the mapping ψ : F → M(X, D) induces a surjective homomorphism \overline{ψ} : F^{∗}/S → M(X, D) such that \overline{ψ}(x) = x for all x ∈ X and where the inverse mapping is induced by the inclusion X ⊆ F. Hence \overline{ψ} is an isomorphism. □

The classical Foata normal form theorem, see Theorem 1.2.1, turns out to be a corollary:

Corollary 4.2.2 The set of traces in M(X, D) is in canonical bijection with the following set of elementary step sequences:

\begin{aligned}\{F_{1} … F_{r} & | & r ≥ 0, F_{i} ∈ F for i = 1, …, r, ∀i = 1, …, r − 1 \\ & & ∀b ∈ F_{i+1}∃a ∈ F_{i} : (a, b) ∈ D\} \end{aligned}

Proof: This set is the set of irreducible words with respect to the complete system S ⊆ F^{∗} × F^{∗} given above. □

In order to obtain a finite complete presentation of a trace monoid M(X, D) we used the larger alphabet of elementary steps F. Thus, a natural question arises whether we can avoid this, i.e., whether there is a finite complete system S ⊆ X^{∗} × X^{∗} which defines M(X, D). In general, no such system can exist by the following result due to F. Otto:

Proposition 4.2.3 ([Ott87]) Let (X, D) be a finite dependence alphabet with independence relation I = X × X \ D. Then there exists a finite complete semi-Thue system S ⊆ X^{∗} × X^{∗} such that X^{∗}/S = M(X, D) if and only if there is a linear ordering ≤ on X such that the relation ≤ ∩I is transitive.

If ≤ ∩I is transitive then such system S ⊆ X^{∗} × X^{∗} is given by the rules:

ba ⇒ ab for a ≤ b and (a, b) ∈ I.

Proof: Assume first that ≤ ∩I is transitive for some linear ordering ≤ on X. Clearly, the system S = {ba ⇒ ab | a ≤ b, (a, b) ∈ I} is noetherian, and we have X^{∗}/S = M(X, D). The system S is confluent since every critical pair arises from a situation cab ⟸_{S} cba ⟹_{S} bca, (a, b), (b, c) ∈ (≤ ∩I) which has a

resolution cab ⟹_{S}^{∗} abc ⟸_{S}^{∗} bca since (a, c) ∈ (≤ ∩I).

Now, let S ⊆ X^{∗} × X^{∗} be any finite complete system such that X^{∗}/S = M(X, D). We first show that if ca ⇒ ac ∉ S then it holds c^{∗}a^{∗} ⊆ Irr(S). Indeed, let p : X^{∗} → M(X, D) be the canonical projection. If (a, c) ∈ D then p^{−1}p(w) = {w} for every w ∈ {a, c}^{∗}. In particular c^{∗}a^{∗} is an irreducible subset of X^{∗}. If (a, c) ∈ I then a ≠ c and p^{−1}p(ac) = {ac, ca}. Since ca ⇒ ac ∉ S we must have ac ⇒ ca ∈ S. But then every word w ∈ {a, c}^{∗} has a descendant w ⟹_{S}^{∗} w′ ∈ c^{∗}a^{∗}. Since p restricted to c^{∗}a^{∗} is injective, we conclude that c^{∗}a^{∗} is irreducible in this case, too.

Note that (a, c) ∈ I implies either ac ⇒ ca ∈ S or ca ⇒ ac ∈ S for all a, c ∈ X. Assume now we would have ba ⇒ ab ∈ S, cb ⇒ bc ∈ S, but ca ⇒ ac ∉ S. Therefore, we have a^{∗}b^{∗}, b^{∗}c^{∗}, c^{∗}a^{∗} ⊆ Irr(S). Since S is finite we find some large n ≫ 0 that Irr(S) ∋ c^{n}a^{n}b ⟸_{S}^{∗} c^{n}ba^{n} ⟹_{S}^{∗} bc^{n}a^{n} ∈ Irr(S). This is a contradiction to the confluence of S. Hence the relation a < b, defined by ba ⇒ ab ∈ S, is transitive. Now, let ≤ be any linear order on X extending < then it holds <=≤ ∩I. □

Remark 4.2.4 An analogous result as above on so-called semi-commutation systems was independently obtained by Y. Métivier and E. Ochmanski, see [MO88].

The proposition of A. V. Anisimov and E. Knuth, see 1.2.2, can be stated in terms of infinite complete semi-Thue systems as follows:

Proposition 4.2.5 Let (X, D) be a dependence alphabet, I ⊆ X^{∗} × X^{∗} the independence relation extended to words and ≤ be a linear ordering of X. Then the system T = {bua ⇒ aub | (a, ub) ∈ I, a < b} is complete and it presents M(X, D). The set Irr(T) is the set of lexicographic normal forms. □

Putting the last two results together we obtain:

Corollary 4.2.6 Let (X, D) be a finite dependence alphabet and ≤ be a linear ordering of X. Then the following assertions are equivalent:

i) The normalization of the semi-Thue system T ⊆ X^{∗} × X^{∗} above is finite.

ii) The relation ≤ ∩I is transitive.

4.3 Unambiguous Möbius Functions

We first give an informal description of the contents of this section. Let M = M(X, D) be a trace monoid and Z⟨⟨M⟩⟩ be the ring of formal power series over M. One of the fundamental properties of a trace monoid concerns the polynomial μ_{M} = ∑(−1)^{|F |}[F] ∈ Z⟨⟨M⟩⟩ where the sum is taken over those subsets F ⊆ X which consist of pairwise independent letters only and where [F] denotes the trace ∏_{x∈F} x ∈ M. This polynomial has a formal inverse in Z⟨⟨M⟩⟩ which is the

constant function with value one. The polynomial μ_{M} ∈ Z⟨⟨M⟩⟩ is therefore the so-called Möbius function of M.

If we represent each trace [F] in μ_{M} by some word w_{F} ∈ X^{∗} we obtain a polynomial ∑(−1)^{|w_{F} |}w_{F} in the ring of formal power series Z⟨⟨X^{∗}⟩⟩. There are several choices for these polynomials, and each such polynomial will be called a Möbius function for M. We shall call a Möbius function unambiguous if its formal inverse in Z⟨⟨X^{∗}⟩⟩ is the characteristic function of a set of representatives for M.

As reported in [Cho86, Chap II.2] it has been conjectured that for every trace monoid there is at least one unambiguous Möbius function. Further it has been asked how to find the words w_{F} ∈ X^{∗} such that μ = ∑(−1)^{|w_{F} |}w_{F} is unambiguous. It turns out that the conjecture is false. But we will see that, in case of existence, there is a very simple way to compute these words w_{F}.

We prove that the existence of unambiguous Möbius functions is directly related to the existence of transitive orientations of I. We have seen in Proposition 4.2.3 that transitive orientations correspond to finite complete semi-Thue systems S ⊆ X^{∗} × X^{∗} with X^{∗}/S = M. We obtain therefore an intimate connection between unambiguous Möbius functions and finite complete semi-Thue systems. We show that the formal inverse of an unambiguous Möbius function is the characteristic series over the rational set of irreducible words of a finite complete semi-Thue system which defines M. Moreover, starting with a finite complete semi-Thue system S ⊆ X^{∗} × X^{∗} defining M, we obtain, by the formal inverse of the characteristic function over the irreducible words, an unambiguous Möbius function for M. Altogether we obtain a canonical bijection between the following sets: transitive orientations of I, unambiguous Möbius functions for M, finite normalized complete semi-Thue systems which define M.

The existence of a transitive orientation is of purely graph-theoretical nature and can be decided roughly in time O(#X^{3}). Thus, there is a polynomial time algorithm which decides for a finite alphabet X with independence relation I ⊆ X ×X whether there is an unambiguous Möbius function in Z⟨⟨X^{∗}⟩⟩, and which computes such a function in case of existence.

We now start with the formal discussion. Let (X, D) be a finite dependence alphabet with independence relation I = X ×X \D and associated trace monoid M = M(X, D). An orientation of the independence relation I is a subset I^{+} ⊆ I such that we have a disjoint union I = I^{+} ˙∪{(b, a) | (a, b) ∈ I^{+}}. An orientation I^{+} of I is called transitive if (a, b) ∈ I^{+}, (b, c) ∈ I^{+} implies (a, c) ∈ I^{+} for a, b, c ∈ X. If I^{+} ⊆ I is a transitive orientation then X is a partially ordered set, and we will write a < b instead of (a, b) ∈ I^{+} for a, b ∈ X.

A mapping from M to Z is called a formal power series, and the collection of all formal power series is denoted by Z⟨⟨M⟩⟩. This set has a ring structure by the usual addition

(φ + ψ)(w) := φ(w) + ψ(w)

and the multiplication

(φ · ψ)(w) := ∑_{w_{1}w_{2}=w} φ(w_{1})ψ(w_{2})

for φ, ψ ∈ Z⟨⟨M⟩⟩ and traces w, w_{1}, w_{2} ∈ M. The neutral element for the multiplication is the function φ(1) = 1 and φ(w) = 0 for all w ∈ M, w ≠ 1. (For the general theory of formal power series we refer to [KS86].)

A formal power series φ ∈ Z⟨⟨M⟩⟩ has a multiplicative inverse φ^{−1}, called the formal inverse, if and only if φ(1) is a unit in Z, i.e., φ(1) = 1 or φ(1) = −1.

The formal inverse φ^{−1} is given inductively by φ^{−1}(1) := φ(1) and for w ≠ 1 by the identity:

−φ(1)φ^{−1}(w) = ∑_{{w_{1}w_{2}=w \atop w_{1}≠1}} φ(w_{1})φ^{−1}(w_{2})

Every subset N ⊆ M defines a power series ζ_{N} ∈ Z⟨⟨M⟩⟩ by its characteristic function ζ_{N}(w) = 1 if w ∈ N and ζ_{N}(w) = 0 otherwise. In particular, ζ_{M} is the constant function with value 1. Besides in functional notation we also write power series in the form φ = ∑_{w∈M} φ(w)w. This is justified since M → Z⟨⟨M⟩⟩,

w ↦ ζ_{{w}} is an embedding. Then, reading this embedding as an inclusion, the formula φ = ∑_{w∈M} φ(w)w becomes an identity of Z⟨⟨M⟩⟩. The support of a power

series φ ∈ Z⟨⟨M⟩⟩ is the set supp(φ) = {w ∈ M | φ(w) ≠ 0}. Power series with finite support are called polynomials.

Consider the finite set F_{∅} := {F ⊆ X | (a, b) ∈ I for all a, b ∈ F, a ≠ b}. This definition implies ∅ ∈ F_{∅}. Earlier we have defined the set of elementary steps F. There it has been more convenient to exclude the empty set. Hence F = F_{∅} \ {∅}. Every element F ∈ F_{∅} defines as usual a unique trace [F] ∈ M by the product [F] := ∏_{x∈F} x. The Möbius function μ_{M} ∈ Z⟨⟨M⟩⟩ is defined by

the following polynomial

μ_{M} := ∑_{F ∈F_{∅}}(−1)^{|F |}[F]

Since ∅ ∈ F_{∅} and [∅] = 1, we have μ_{M}(1) = 1 and this function has a formal inverse. The most important property of the Möbius function is the following result of Cartier and Foata:

Proposition 4.3.1 ([CF69, Thm. 2.4]) The formal inverse of the polynomial μ_{M} = ∑_{F ∈F_{∅}}(−1)^{|F |}[F] is the constant function with value one: μ_{M}^{−1} = ζ_{M} =

∑_{w∈M} w. □

Here, we are concerned with the question when we can lift the Möbius function μ_{M} ∈ Z⟨⟨M⟩⟩ to a polynomial μ ∈ Z⟨⟨X^{∗}⟩⟩ such that the formal inverse of μ in Z⟨⟨X^{∗}⟩⟩ is a characteristic function over a set of representatives for M.

The link between the rings Z⟨⟨X^{∗}⟩⟩ and Z⟨⟨M⟩⟩ is given by the canonical projection p : X^{∗} → M. It induces a surjective ring homomorphism, denoted again by:

p : Z⟨⟨X^{∗}⟩⟩ → Z⟨⟨M⟩⟩, p(φ) = ∑_{t∈M} ( ∑_{p(w)=t} φ(w) )t

Definition: i): A Möbius function for M over X is a power series μ ∈ Z⟨⟨X^{∗}⟩⟩ such that p(μ) = μ_{M} is the Möbius function in Z⟨⟨M⟩⟩ and such that p : X^{∗} → M is injective on the support of μ. ii): A Möbius function for M μ ∈ Z⟨⟨X^{∗}⟩⟩ is called unambiguous if its formal inverse in Z⟨⟨X^{∗}⟩⟩ is a characteristic function of a set of representatives of M in X^{∗}.

Remark 4.3.2 A Möbius function μ ∈ Z⟨⟨X^{∗}⟩⟩ is unambiguous if and only if its formal inverse has non-negative coefficients.

Proof: This follows by Proposition 4.3.1 and the definition of the ring homomorphism p : Z⟨⟨X^{∗}⟩⟩ → Z⟨⟨M⟩⟩. □

Our ultimative goal is to prove that the set of unambiguous Möbius functions for M is in canonical one-to-one correspondence with the set of transitive orientations of the independence relation I. Moreover, the formal inverse of an unambiguous Möbius function for M will be shown to be the characteristic function over the set of irreducible words of a finite complete semi-Thue system S ⊆ X^{∗} ×X^{∗} which defines the free partially commutative monoid M. In particular, the formal inverse of an unambiguous Möbius function is the characteristic function of a rational cross-section.

Let us start with a transitive orientation I^{+} of the independence relation I ⊆ X × X. We write again a < b instead of (a, b) ∈ I^{+}. We define a finite semi-Thue system S ⊆ X^{∗} × X^{∗} by:

S = S(I^{+}) = {(ab, ba) | a, b ∈ X, a < b}

As we have seen in the preceeding section S ⊆ X^{∗} × X^{∗} is a finite complete system defining M.

Let us define a polynomial μ = μ(I^{+}) ∈ Z⟨⟨X^{∗}⟩⟩ by μ(w) = (−1)^{n} if w = a_{1} … a_{n}, n ≥ 0, a_{i} ∈ X for 1 ≤ i ≤ n, a_{i} < a_{j} for 1 ≤ i < j ≤ n, and put μ(w) = 0 otherwise. We also write μ = ∑_{a_{1}<···<a_{n}}(−1)^{n}a_{1} … a_{n}.

Theorem 4.3.3 The polynomial μ = ∑_{a_{1}<...<a_{n}}(−1)^{n}a_{1} … a_{n} is an unambiguous

Möbius function. Its formal inverse ζ in Z⟨⟨X^{∗}⟩⟩ is the characteristic function of the set of irreducible words Irr(S), i.e., ζ = ∑_{w∈Irr(S)} w.

Proof: Since I^{+} is a transitive orientation, the subsets F ⊆ X, where (a, b) ∈ I for all a, b ∈ F, a ≠ b, are exactly the linearily ordered subsets of X. It follows that μ ∈ Z⟨⟨X^{∗}⟩⟩ is a Möbius function for M. Let ζ ∈ Z⟨⟨X^{∗}⟩⟩ be the formal inverse of μ. We show that ζ(w) = 1 if w ∈ X^{∗} is irreducible and ζ(w) = 0 else.

Clearly, we have μ(1) = ζ(1) = 1 and μ(a) = −1, ζ(a) = 1 for every letter a ∈ X.

Next, observe that every word w ∈ X^{∗}, w ≠ 1 has the form w = a_{1} … a_{m}w′ with m ≥ 1, a_{i} ∈ X for 1 ≤ i ≤ m, a_{i} < a_{j} for 1 ≤ i < j ≤ m, w′ ∈ X^{∗} and if w′ = a_{0}w′′ for some a_{0} ∈ X, w′′ ∈ X^{∗} then we do not have a_{m} < a_{0}.

Lemma 4.3.4 Let w = a_{1} … a_{m}w′ as above. If m = 1 then we have ζ(w) = ζ(w′) else we have ζ(w′) = 0.

Proof of Lemma 4.3.4: For every m ≥ 1 we have

−ζ(w) = ∑_{k=1}^{m} μ(a_{1} … a_{k})ζ(a_{k+1} … a_{m}w′)

Hence, for m = 1 we find −ζ(w) = μ(a_{1})ζ(w′) = −ζ(w′). If m = 2 then −ζ(w) = μ(a_{1})ζ(a_{2}w′) + μ(a_{1}a_{2})ζ(w′) = −ζ(a_{2}w′) + ζ(w′) = −ζ(w′) + ζ(w′) = 0.

Let m > 2. Then by induction:

\begin{aligned}−ζ(w) & = & μ(a_{1} … a_{m−1})ζ(a_{m}w′) + μ(a_{1} … a_{m})ζ(w′) \\ & = & (−1)^{m−1}ζ(w′) + (−1)^{m}ζ(w′) = 0 □ \end{aligned}

Proof of Theorem 4.3.3 (continued): Let w = a_{1} … a_{m}w′ as above. If m ≥ 2 then w is reducible and ζ(w) = 0 by Lemma 4.3.4. If m = 1 then w is irreducible if and only if w′ is irreducible. Further, by Lemma 4.3.4 we have ζ(w) = ζ(w′) in this case. The result follows by induction since ζ(1) = 1 and 1 ∈ Irr(S). □

Remark 4.3.5 In the proof of the theorem above we never used that S = S(I^{+}) is complete. The completeness of S can be deduced from the theorem without inspecting any critical pairs: We have shown that μ^{−1} = ∑_{w∈Irr(S)} w for some

Möbius function μ ∈ Z⟨⟨X^{∗}⟩⟩. Hence Irr(S) must be in bijection with M. Since S is noetherian, this is enough to ensure its completeness. □

If one does not want to involve semi-Thue systems the contents of Theorem 4.3.3 may be rephrased in the following way:

Corollary 4.3.6 Let < be any partial order on X. Let L ⊆ X^{∗} be the finite set of words

L = {a_{1} … a_{m} | m ≥ 0, a_{i} ∈ X for 1 ≤ i ≤ m, a_{i} < a_{j} for 1 ≤ i < j ≤ m}

and let R ⊆ X^{∗} be the complement of the rational set ⋃_{a<b} X^{∗}abX^{∗}. Define

μ′ = ∑_{w∈L}(−1)^{|w|}w and ζ′ = ∑_{w∈R} w. Then μ′ and ζ′ are formal inverses and the

following assertions are equivalent:

i) μ′ is a Möbius function;

ii) μ′ is an unambiguous Möbius function;

iii) R is a rational cross-section of M in X^{∗}.

Proof: Lemma 4.3.4 is valid for every partial order < on X. It follows that μ′ and ζ′ are formal inverses. The implications i) ⇒ ii), and ii) ⇒ iii) are therefore consequences of Remark 4.3.2. To see iii) ⇒ i), let R be a rational cross-section of M in X^{∗}. The reverse operation, rev, on words which is inductively defined by rev(1) = 1 and rev(aw) = rev(w)a for a ∈ X, w ∈ X^{∗}, is also defined for traces. Since rev maps the support of μ′ injectively into R, it follows that the canonical projection restricted to supp(μ′) is injective. We have to show that p(μ′) = μ_{M} is the Möbius function in Z⟨⟨M⟩⟩ where p : Z⟨⟨X^{∗}⟩⟩ → Z⟨⟨M⟩⟩ is the canonical ring-homomorphism. But this is purely formal by Proposition 4.3.1 and 1 = ζ′μ′

and p(ζ′) = ζ_{M} = ∑_{w∈M} w ∈ Z⟨⟨M⟩⟩. □

The next corollary may be interpreted as a Möbius inversion formula:

Corollary 4.3.7 (Same notations as in Corollary 4.3.6). Let Q ⊆ X^{∗} be any subset which is closed under suffixes, and let f, g ∈ Z⟨⟨X^{∗}⟩⟩ be power series.

Then the following formulae are equivalent:

i)  ∑_{{w_{1}w_{2}=w \atop w_{1}∈R}} g(w_{2}) = f(w)  for all w ∈ Q,
ii)  ∑_{{w_{1}w_{2}=w \atop w_{1}∈L}}(−1)^{|w_{1}|}f(w_{2}) = g(w)  for all w ∈ Q.

Proof: i) ⇒ ii): By i) we have (ζ′g)(w) = f(w) for every w ∈ Q and the same holds for every suffix w_{2} of w ∈ Q. Hence, for w ∈ Q we obtain:

g(w) = (μ′ζ′g)(w) = ∑_{w_{1}w_{2}=w} μ(w_{1})(ζ′g)(w_{2})
= ∑_{w_{1}w_{2}=w} μ(w_{1})f(w_{2})
= ∑_{{w_{1}w_{2}=w \atop w_{1}∈L}}(−1)^{|w_{1}|}f(w_{2}).

ii) ⇒ i): analogous. □

Remark 4.3.8 Since R ∩ L = {1} ∪ X, for each w ∈ X^{∗} the sum in formula i) or the sum in formula ii) has at most two terms. In the special case Q = R we have the equivalence:

i)  ∑_{w_{1}w_{2}=w} g(w_{2}) = f(w) for all w ∈ R
ii)  f(1) = g(1)  and,
f(aw) − f(w) = g(aw) for all a ∈ X, w ∈ X^{∗}
such that aw ∈ R. □

Assume now we have given any unambiguous Möbius function μ ∈ Z⟨⟨X^{∗}⟩⟩. For (a, b) ∈ I we either have μ(ab) = 1, μ(ba) = 0 or μ(ba) = 1, μ(ab) = 0. (This follows by the definition of an unambiguous Möbius function and μ_{M}([{a, b}]) = 1.) Thus, the set I^{+}(μ) := {(a, b) ∈ X × X | μ(ab) = 1} is an orientation of I.

Theorem 4.3.9 The orientation I^{+}(μ) is transitive.

Proof: Let ζ ∈ Z⟨⟨X^{∗}⟩⟩ be the formal inverse of μ. Set I^{+} = I^{+}(μ). Let (a, b), (b, c) ∈ I^{+}. We have to show (a, c) ∈ I^{+}. Consider

−ζ(abc) = μ(a)ζ(bc) + μ(ab)ζ(c) + μ(abc)
= μ(a)(−μ(b)ζ(c) − μ(bc)) + ζ(c) + μ(abc)
= −1(1 − 1) + 1 + μ(abc) = 1 + μ(abc)

Since ζ(abc) ≥ 0 we have μ(abc) = −1. In particular, we already have (a, c) ∈ I. Therefore the words abc and bca denote the same trace in M and μ(abc) = −1 implies μ(bca) = 0.

Thus,

−ζ(bca) = μ(b)ζ(ca) + μ(bc)ζ(a)
= −ζ(ca) + 1 = μ(c)ζ(a) + μ(ca) + 1
= μ(ca) ≤ 0

Hence, μ(ca) = 0. Therefore μ(ac) = 1; and this proves (a, c) ∈ I^{+}. □

Corollary 4.3.10 Let X be a finite alphabet, I ⊆ X × X be an independence relation, and M = X^{∗}/{(ab, ba) | (a, b) ∈ I}. Then the following assertions are equivalent:

i) There is a transitive orientation of I.

ii) There is an unambiguous Möbius function for M in Z⟨⟨X^{∗}⟩⟩.

Proof: Combine Theorem 4.3.3 and Theorem 4.3.9. □

Example: i) Let (X, I) be given by the independence graph:

a  b  c  d.

Then a ⟵ b ⟶ c ⟵ d is a transitive orientation and

μ = 1 − a − b − c − d + ba + bc + dc

is an unambiguous Möbius function.

More generally if X has at most four letters then for each independence relation there is always a transitive orientation and hence always an unambiguous Möbius function.

ii) Let (X, I) be given by the graph

[figure: a_{1}; a_{2}; a_{3}; …; a_{n−1}; a_{n}]

with n ≥ 4. Then there exists a transitive orientation if and only if n is even. In particular there is no unambiguous Möbius function for the trace monoid which is associated with the independence graph

[figure: a; e; d; c; b]

So far, we have associated to each transitive orientation an unambiguous Möbius function and to each unambiguous Möbius function a transitive orientation. The question is whether there are other unambiguous Möbius functions. This is not the case but surprisingly the proof is rather complicated compared to the other computations of this section.

Theorem 4.3.11 Let X be a finite alphabet, I ⊆ X × X be an independence relation, and M = X^{∗}/{(ab, ba) | (a, b) ∈ I}. Then the set of transitive orientations of I is in canonical one-to-one correspondence with the set of unambiguous Möbius functions for M in Z⟨⟨X^{∗}⟩⟩.

Proof: It is clear from the construction that we have I^{+} = I^{+}(μ(I^{+})) for every transitive orientation. Let μ be an unambiguous Möbius function and I^{+} = I^{+}(μ) the associated transitive orientation. Define μ′ := μ(I^{+}) ∈ Z⟨⟨X^{∗}⟩⟩, then μ′ is an unambiguous Möbius function by Theorem 4.3.3. We have to show μ′ = μ. From the construction it is clear that μ′(w) = μ(w) for every word of length at most two. The problem is to show this equality for longer words. As usual, we write a < b for (a, b) ∈ I^{+}, i.e., μ(ab) = 1. Observe that it is enough to show μ′(a_{1} … a_{n}) = μ(a_{1} … a_{n}) for n > 2, a_{i} ∈ X and a_{1} < a_{2} < … < a_{n}.

Let ζ ∈ Z⟨⟨X^{∗}⟩⟩ denote the formal inverse of μ′. By definition it is a characteristic function of a set of representatives for M. Assume we would have μ′ ≠ μ, then there is a smallest integer n ≥ 2 and a sequence of linearily ordered letters a_{1} < a_{2} < … < a_{n} such that μ′(a_{1} … a_{n}) ≠ (−1)^{n}.

Claim: Let a_{1} < … < a_{m} be a sequence of linearily ordered letters with 1 ≤ m < n. Then we have ζ(a_{m} … a_{1}) = 1 and ζ(a_{σ(m)} … a_{σ(1)}) = 0 for every non-trivial permutation σ of {1, …, m}.

Proof: To prove the claim, it is enough to show that ζ(a_{m} … a_{1}) = 1. For m = 1 this is obvious. For m ≥ 2 the claim follows by induction since for m < n we have μ′(a_{1} … a_{m}) = μ(a_{1} … a_{m}), hence −ζ(a_{m} … a_{1}) = −ζ(a_{m−1} … a_{1}). □

Proof of 4.3.11 (continued): From the claim we obtain

\begin{aligned}−ζ(a_{1} … a_{n}) & = & μ′(a_{1} … a_{n−1})ζ(a_{n}) + μ′(a_{1} … a_{n}) \\ & = & (−1)^{n−1} + μ′(a_{1} … a_{n}) \end{aligned}

Since, by assumption, μ′(a_{1} … a_{n}) ≠ μ(a_{1} … a_{n}), we have

μ′(a_{1} … a_{n}) = 0 and n must be even. (Otherwise we would have ζ(a_{1} … a_{n}) < 0.)

Let σ be the non-trivial permutation of {1, …, n} such that μ′(a_{σ(1)} … a_{σ(n)}) = 1. Write b_{i} := a_{σ(i)} for i = 1, …, n. We have

−ζ(b_{1} … b_{n}) = ( ∑_{k=1}^{n−1} μ(b_{1} … b_{k})ζ(b_{k+1} … b_{k})) + 1

Thus, there is a smallest integer k, 1 ≤ k ≤ n − 1 such that

μ(b_{1} … b_{k})ζ(b_{k+1} … b_{k}) ≠ 0

Let k be this integer. By the claim above we have b_{1} < ⋯ < b_{k} and b_{k+1} > ⋯ > b_{n}.

If we would have b_{k} < b_{k+1} then k < n − 1 since b_{1} … b_{n} ≠ a_{1} … a_{n}. But then

−ζ(b_{1} … b_{n}) = μ(b_{1} … b_{k})ζ(b_{k+1} … b_{n})
+ μ(b_{1} … b_{k+1})ζ(b_{k+2} … b_{n})
+ 1
= (−1)^{k} + (−1)^{k+1} + 1 = 1

which is impossible.

Hence it holds b_{k} > b_{k+1}. If we would have k > 1 then we would have μ(b_{1} … b_{k−1}) ζ(b_{k} … b_{n}) ≠ 0 contradicting the minimality of k. It follows k = 1 and b_{1} > b_{2} > ⋯ > b_{n}.

This means b_{1} … b_{n} = a_{n} … a_{1}. We obtain μ′(a_{n} … a_{1}) = 1 and

−ζ(a_{n} … a_{1}) = μ(a_{n})ζ(a_{n−1} … a_{1}) + μ′(a_{n} … a_{1}) = −1 + 1 = 0

But this leads to the following contradiction:

\begin{aligned}0 ≥ −ζ(a_{n−1}a_{n}a_{n−1} … a_{1}) & = & μ(a_{n−1})ζ(a_{n} … a_{1}) + μ(a_{n−1}a_{n})ζ(a_{n−1} … a_{1}) \\ & = & 0 + 1 = 1. \end{aligned}

Thus μ′(a_{1} … a_{n}) ≠ μ(a_{1} … a_{n}) is impossible which concludes the proof of Theorem 4.3.11 □

From the correspondence between transitive orientations and unambiguous Möbius functions we may immediately deduce the following corollaries. Of course, these corollaries can be verified by a direct computation, too. They were independently also obtained by Roman König, (personal communication).

Corollary 4.3.12 Let M be a trace monoid generated by some alphabet X, and let M′ ⊆ M be a submonoid generated by some subset X′ ⊆ X.

If μ ∈ Z⟨⟨X^{∗}⟩⟩ is an unambiguous Möbius function for M then the restriction μ′ = ∑_{w∈X^{′∗}} μ(w)w ∈ Z⟨⟨X^{′∗}⟩⟩ is an unambiguous Möbius function for M′. □

Corollary 4.3.13 Let M_{i} be a trace monoid generated by X_{i} such that M_{i} has an unambiguous Möbius function μ_{i} ∈ Z⟨⟨X_{i}^{∗}⟩⟩, i = 1, 2. Let X denote the disjoint union of X_{1} and X_{2}. Then we have:

i) The function

μ_{1} + μ_{2} − 1 = 1 + ∑_{{w_{1}∈X^{∗}_{1} \atop w_{1}≠1}} μ(w_{1})w_{1} + ∑_{{w_{2}∈X^{∗}_{2} \atop w_{2}≠1}} μ(w_{2})w_{2} ∈ Z⟨⟨X^{∗}⟩⟩

is an unambiguous Möbius function for the free product M_{1} ∗ M_{2}.

ii) The function

μ_{1}μ_{2} = ∑_{{w_{1}∈X^{∗}_{1} \atop w_{2}∈X^{∗}_{2}}} μ(w_{1})μ(w_{2})w_{1}w_{2} ∈ Z⟨⟨X^{∗}⟩⟩

is an unambiguous Möbius function for the direct product M_{1} × M_{2}. □

Remark 4.3.14 It follows by Corollary 4.3.13 that every direct product of free monoids has an unambiguous Möbius function. Since every trace monoid is a submonoid of such a direct product, we see that the existence of unambiguous Möbius functions does not transfer to submonoids, in general. (Compare this with the assertion from Corollary 4.3.12.)

Let us now return to the discussion of the existence of finite complete semi-Thue systems for over X defining M. Directly from Proposition 4.2.3 we obtain

Theorem 4.3.15 Let X be a finite alphabet, I ⊆ X × X be an independence relation, and M = X^{∗}/{(ab, ba) | (a, b) ∈ I}. Then the following three sets are in canonical one-to-one correspondence:

i) transitive orientations of I;

ii) unambiguous Möbius functions for M in Z⟨⟨X^{∗}⟩⟩;

iii) finite normalized complete semi-Thue systems over X which define M. □

The question whether there is a transitive orientation of I is purely graphtheoretical. It asks whether the independence graph (X, I) is a so-called comparability graph. It is well-known that this question can be answered in polynomial time, see [Gol86, Chap. 5.6]. Thus analogously to [Ott87, Cor. to Thm. 2] we may state:

Corollary 4.3.16 There is a polynomial time algorithm for the following problem:

Given a finite alphabet X with independence relation I ⊆ X × X.

Decide whether M = X^{∗}/{(ab, ba) | (a, b) ∈ I} has an unambiguous Möbius function in Z⟨⟨X^{∗}⟩⟩ and if it has then compute such a function. □

Remark 4.3.17 In a forthcoming paper we will generalize the results above to a relative situation p : M_{1} → M_{2} where M_{j} = X^{∗}/{(ab, ba) | (a, b) ∈ I_{j}}, j = 1, 2 with independence relations I_{1} ⊆ I_{2}. (Note that we considered here the special case: I_{1} = ∅.)

4.4 Möbius Functions and Semi-Thue Systems

Let S = X^{∗}×X^{∗} be any semi-Thue system. We are going to determine the formal inverse in Z⟨⟨X^{∗}⟩⟩ of the characteristic series over the irreducible words. Of course, this requires that 1 is irreducible, which we shall henceforth assume. For noetherian systems this requirement is always true. Our approach has some nice combinatorial applications. For example it yields, as a special case, a new proof of Lemma 4.3.4 above which need no real computation. Slightly more general, we start with any non-empty subset R ⊆ X^{∗} which is closed with respect to factors, for example R = Irr(S) for a semi-Thue system S. The complement X^{∗} \ R is an ideal which is generated by some basis L ⊆ X^{∗}, i.e., 1 ∈ R = X^{∗} \ X^{∗}LX^{∗} and L ∩ X^{+}LX^{∗} = L ∩ X^{∗}LX^{+} = ∅. (For a system S ⊆ X^{+} × X^{∗} the set L is the set of left-hand sides where no proper factors are other left-hand sides.)

We need a definition. An overlapping-chain with respect to L is a sequence (w_{1}, …, w_{n}), n ≥ 0 of words such that w_{1} ∈ X, w_{i} ∈ R for 1 ≤ i ≤ n and w_{i}w_{i+1} ∈ X^{∗}L \ X^{∗}LX^{+} for 1 ≤ i < n. This means w_{1} is a letter, no factor of w_{i} is in L, a (unique) suffix of w_{i}w_{i+1} is in L and no other factor of w_{i}w_{i+1} belongs to L. In particular, w_{i} ≠ 1 for all 1 ≤ i ≤ n. We have the following basic property:

Lemma 4.4.1 Let (u_{1}, …, u_{m}) and (v_{1}, …, v_{n}) be overlapping-chains such that the word u_{1} … u_{m} is a prefix of v_{1} … v_{n}. Then we have m ≤ n and u_{i} = v_{i} for all 1 ≤ i ≤ m.

Proof: Let 0 ≤ i ≤ min(m, n) be maximal such that (u_{1}, …, u_{i}) = (v_{1}, …, v_{i}). If i = min(m, n) then obviously i = m ≤ n and the result follows. Hence assume i < min(m, n). Since u_{1}, v_{1} are letters, we have 1 ≤ i. Further we have that u_{i+1} is a proper prefix of v_{i+1} or vice versa. Say, u_{i+1} is a proper prefix of v_{i+1}. Then u_{i}u_{i+1} is a proper prefix of v_{i}v_{i+1}, too. But this implies v_{i}v_{i+1} ∈ X^{∗}L ∩ X^{∗}LX^{+}, contradicting the definition of an overlapping-chain. □

Let L be the set of overlapping-chains with respect to L. Then the mapping L → X^{∗}, (w_{1}, …, w_{n}) ↦ w_{1} … w_{n} is injective by the lemma above. Thus, we may identify L with a subset of X^{∗}. If w = (w_{1}, …, w_{n}) ∈ L ⊆ X^{∗} is an overlapping-chain we have a picture as in Figure 4.1 where l_{1}, …, l_{n−1} ∈ L and no other factor of w belong to L. Short overlapping-chains have direct interpretations:

A letter of X is an overlapping-chain if and only if this letter is not in L, overlapping-chains of length two are the elements of {l ∈ L | |l| ≥ 2}.

If S = X^{∗} × X^{∗} is a noetherian semi-Thue system where no left-hand side of a rule is factor of any other left-hand side, then the overlapping-chains of length three correspond exactly to the minimal critical pairs of S. Thus by Theorem 4.1.1 such a system is confluent if and only if it confluent on all overlappingchains of length three. Therefore one is led to consider minimal critical pairs by looking for an interpretation of short overlapping-chains. Also the restriction of Theorem 4.1.1 concerning the left-hand sides is very natural in this context: It simply says L = {l | (l, r) ∈ S}.

The reason why we are interested in overlapping-chains here, is the following identity of formal power series:

[figure: w_{1}; w_{2}; w_{3}; w_{4}; w_{n−1}; w_{n}; l_{1}; l_{2}; l_{3}; l_{4}; l_{n}; l_{n−2}; …; …]

Figure 4.1. An overlapping chain

Theorem 4.4.2 Let L ⊆ X^{∗} and R ⊆ X^{∗} as above, i.e., L is the basis of an ideal and R = X^{∗} \ X^{∗}LX^{∗}, and let L be the set of overlapping-chains with respect to L. Define:

\begin{aligned}μ_{L} & = & ∑_{(w_{1},...,w_{n})∈L}(−1)^{n}w_{1} … w_{n} \\ ζ_{R} & = & ∑_{w∈R} w \end{aligned}

Then the power series μ_{L}, ζ_{R} ∈ Z⟨⟨X^{∗}⟩⟩ are formal inverses of each other.

Proof: Following ideas of [Vie86], we give a “bijective proof” by defining an involution without fixed points ψ on the set L × R \ {(1, 1)}. Let (w, r) ∈ L × R, (w, r) ≠ (1, 1). Define ψ(w, r) = (w′, r′) as follows:

If (w, r) = (1, r_{1}r′) with r_{1} ∈ X, r′ ∈ X^{∗} then set (w′, r′) = (r_{1}, r′).

If (w, r) = ((w_{1}, …, w_{n}), r) such that w_{n}r ∈ R

then set (w′, r′) = ((w_{1}, …, w_{n−1}), w_{n}r).

If (w, r) = ((w_{1}, …, w_{n}), r) such that w_{n}r ∉ R then we obtain a factorization w_{n}r = w_{n}w_{n+1}r′ such that (w_{1}, …, w_{n}, w_{n+1}) is an overlapping-chain and, by the lemma above, this factorization is unique. Set (w′, r′) = ((w_{1}, …, w_{n}, w_{n+1}), r′) in this case.

Obviously in all cases ψ(w′, r′) = (w, r) and it holds: μ_{L}(w)ζ_{R}(r) = −μ_{L}(w′)ζ_{R}(r′) and wr = w′r′ for all (w, r) ∈ L × R \ {(1, 1)}. The

result follows since μ_{L}ζ_{R} = 1 + ∑_{{(w,r)∈L×R \atop (w,r)≠(1,1)}} μ_{L}(w)ζ_{R}(r)wr. □

Let us state some applications of the identy above:

1): Let ρ ⊆ X × X be any relation, \overline{ρ} = X × X \ ρ and L = \{ab | (a, b) ∈ \overline{ρ}\}. Then we have

R = {a_{1} … a_{n} | n ≥ 0, (a_{i}, a_{i+1}) ∈ ρ for 1 ≤ i ≤ n}

and

L = \{a_{1} … a_{m} | m ≥ 0, (a_{i}, a_{i+1}) ∈ \overline{ρ} for 1 ≤ i < n\} = \overline{R}.

Hence, μ_{L}ζ_{R} = μ\overline{R}ζ_{R} = μ_{R}ζ\overline{R} = 1 ∈ Z⟨⟨X^{∗}⟩⟩.

In particular, if X is partially ordered and \overline{ρ} is the relation < then the identity yields Lemma 4.3.4.

2): Let S ⊆ X^{∗} × X^{∗} be a semi-Thue system with 1 ∈ Irr(S), L ⊆ {l ∈ X^{∗} | (l, r) ∈ S} such that L is the basis of the ideal X^{∗} \ Irr(S), and L let be the corresponding set of overlapping-chains. Set μ(S) = μ_{L}. The function μ(S) tells us something about the number of factorizations of a word x ∈ X^{∗} into irreducible factors. Indeed, let μ^{+}(S)(w) (μ^{−}(S)(w) resp.) be the number of factorizations w = w_{1} … w_{n} with 1 ≠ w_{i} ∈ Irr(S) and n even (n odd resp.). Then it holds μ(S) = μ^{+}(S) − μ^{−}(S). This is clear, since the identity (μ^{+}(S) − μ^{−}(S))ζ_{R} = 1 ∈ Z⟨⟨X^{∗}⟩⟩ is trivial for R = Irr(S).

3): For k ≥ 0 and S ⊆ X^{∗} × X^{∗} as above let us define the following integers:

μ^{+}(k) = #{(w_{1}, …, w_{n}) ∈ L | n even, |w_{1} … w_{n}| = k},
μ^{−}(k) = #{(w_{1}, …, w_{n}) ∈ L | n odd, |w_{1} … w_{n}| = k},
ζ(k) = #{w ∈ Irr(S) | |w| = k}.

Then we obtain the following identity of formal power series in one variable:

∑_{k≥0} ζ(k)z^{k} = \frac{1}{(∑_{k≥0}(μ^{+}(k) − μ^{−}(k))z^{k})} □

Finally, let us consider a noetherian semi-Thue system S ⊆ X^{∗} × X^{∗} such that each congruence class modulo S of X^{∗} is finite. Then the number of factorizations w = w_{1}w_{2} modulo S is finite for all w ∈ X^{∗}.

Hence, the monoid X^{∗}/S has a Möbius-function in the sense of Cartier Foata, see [CF69]; and the canonical projection induces a surjective ring homomorphism

p : Z⟨⟨X^{∗}⟩⟩ → Z⟨⟨X^{∗}/S⟩⟩

The theorem above now relates the completeness of S to the Möbius function of the quotient monoid:

Corollary 4.4.3 Let S = X^{∗} × X^{∗} be a noetherian semi-Thue system such that the congruence classes {v ∈ X^{∗} | v ⟺_{S}^{∗} w} are finite for all w ∈ X^{∗}. Then the following assertions are equivalent:

i) The system S is complete.

ii) The power series p(μ(S)) ∈ Z⟨⟨X^{∗}/S⟩⟩ is the Möbius function of the monoid X^{∗}/S.

Proof: The result follows since the noetherian system S is complete if and only

if it holds p( ∑_{w∈Irr(S)} w) = ζ_{M} ∈ Z⟨⟨X^{∗}/S⟩⟩. □

The main application of the above corollary lies in the direction i) ⇒ ii). It is usually a very difficult task to compute Möbius functions of monoids. Now, if we can present a monoid as X^{∗}/S with a complete system S as above then we have found a description of the Möbius function in terms of overlapping-chains.

Example: Let X = {a, b, c} and S = {abc ⟹ cb}. Then S is a complete semi-Thue system such that all congruence classes modulo S are finite. (We have considered the monoid M = X^{∗}/S earlier as an example where the divisor relation is noetherian but no weight function exists.)

Then 1 − a − b − c + abc ∈ Z⟨⟨M⟩⟩ is the Möbius function of M. □

108 4. Complete Semi-Thue Systems and Möbius Functions

5. Trace Replacement Systems

5.1 Preliminaries

In order to define replacement systems over traces it is convenient to develop the relevant notions in a more general framework. These notions are straightforward from the semi-Thue case of Chap. 4.

Let M be any monoid with neutral element 1. A replacement system over M is a subset S ⊆ M × M . It defines a relation ⟹_{S} by ulu′ ⟹_{S} uru′ for u, u′ ∈ M, (l, r) ∈ S. The elements of S are called rules, again often written in the form l ⟹ r for (l, r) ∈ S. A replacement system over a free monoid is therefore

a semi-Thue system, and a replacement system over IN^{k}, k ≥ 1, is called a vector replacement system. If M is a trace monoid then we shall speak of a trace replacement system. As usual, ⟹_{S}^{+}, ⟹_{S}^{∗} and ⟺_{S}^{∗} denote the transitive closure, the reflexive, transitive closure and the symmetric, reflexive, transitive closure of ⟹_{S}. The relation ⟺_{S}^{∗} is a congruence, and we write M/S for its quotient monoid. Frequently bars are used to denote images of M in M/S. By Irr(S) we understand the set of irreducible elements in M, i.e., the set of elements where no rule of S applies to. The complement of Irr(S) is denoted by Red(S). This is the ideal Red(S) = ⋃_{(l,r)∈S} MlM. Note that if S is finite then Red(S) is a rational

set. A system S ⊆ M × M is called normalized if for every rule (l, r) ∈ S the right-hand side r is irreducible and the left-hand side l is irreducible with respect to S \ {(l, r)}. Two systems S ⊆ M × M and T ⊆ M × M are called equivalent if M/S = M/T. A system S ⊆ M × M is called noetherian if there are no infinite chains of the form u_{0} ⟹_{S} u_{1} ⟹_{S} u_{2} ⟹_{S} u_{3} . . .. It is called confluent if for all

u, v, w ∈ M with u ⟸_{S}^{∗} v ⟹_{S}^{∗} w there is a z ∈ M such that u ⟹_{S}^{∗} z ⟸_{S}^{∗} w. A

noetherian system S ⊆ M ×M is confluent if and only if it is locally confluent, i.e. for all u, v, w ∈ M with u ⟸_{S} v ⟹_{S} w there is a z ∈ M such that u ⟺_{S}^{∗} z ⟸_{S}^{∗} w. We say that a system is complete if it is noetherian and (locally) confluent. For complete systems the set Irr(S) is in canonical bijection with the quotient monoid M/S; thus complete systems provide us with normal forms in M for the elements of the quotient. In the following we make the technical assumption on all our systems that 1 never occurs on the left-hand side. Noetherian systems fulfill this assumption trivially since otherwise every element would be reducible.

Often the following situation occurs: We start with some system T ⊆ M ×M, and we are looking for a complete system S ⊆ M × M which is equivalent to T. In order to prove that S is such a system the following characterization is useful.

Proposition 5.1.1 Let S, T ⊆ M × M be replacement systems such that S is noetherian and S ⊆⟺_{T}^{∗}. Then the following assertions are equivalent:

i) S is confluent and equivalent to T.

ii) The canonical mapping M → M/T restricted to Irr(S) is injective.

Proof: i) ⇒ ii): trivial. ii) ⇒ i): Since S ⊆⟺_{T}^{∗} we have the following sequence of canonical mappings:

Irr(S) ⟶^{f} M/S ⟶^{g} M/T.

Since S is noetherian, f is surjective. Since gf is injective by ii), f is injective too, hence f is bijective. In particular, S is confluent. Now, since gf is injective and f is bijective, g is also injective. Since the surjectivity of g is clear, the mapping g is bijective, hence the equivalence of S and T. □

Remark 5.1.2 If S ⊆ M × M is not noetherian then it may happen that Irr(S) → M/T is bijective but S is neither confluent nor equivalent to T. To see this consider the following semi-Thue systems:

\begin{aligned}S & = & \{a ⇒ b, a ⇒ a^{2}, b ⇒ b^{2}\} \\ T & = & \{a ⇒ b, b ⇒ 1\}. \end{aligned}

We have {1} = Irr(S) = {a, b}^{∗}/T but neither S is locally confluent nor {a, b}^{∗}/S is the trivial monoid. □

An admissible well-ordering on M is a well-ordering ≺ of M such that x ≺ y implies uxu′ ≺ uyu′ for all u, u′, x, y ∈ M. (We use linear orderings ≺ only; the generalization to partial orders is straightforward. It is not done here for simplification of the formalism.) If M has such an ordering then uxu′ = uyu′ implies x = y, hence M is cancellative. Furthermore, M is group-free, i.e., uv = vu = 1 implies u = v = 1, and the divisor relation of M is noetherian, i.e., if uxu′ = y with uu′ ≠ 1 then x ≺ y. It follows that every ideal I of M, (i.e. every subset ∅ ≠ I ⊆ M of the form I = MIM), contains a set which is minimal in I for the proper divisor relation. This set is called a basis of I and is uniquely determined. Admissible well-orderings are used for replacement systems to ensure the noetherian condition. If M has an admissible well-ordering then every replacement system is equivalent to a noetherian one. Even more, we have the following fact:

Proposition 5.1.3 Let M be a monoid with an admissible well-ordering. Then every quotient monoid of M is isomorphic to some M/S where S ⊆ M × M is a complete normalized replacement system.

Proof: Let p : M → N be a surjective homomorphism. Since M has an admissible well-ordering ≺, for each m ∈ M there is a unique m̂ ∈ M which is minimal with respect to ≺ such that p(m) = p(m̂). The set I = {m ∈ M | m ≠ m̂} is an ideal since m̂ ≺ m implies um̂v ≺ umv. Hence I is generated by some basis L ⊆ I. Furthermore, the quotient N is given by M/T where T = {(m, m̂) | m ∈ I}. Define S = {(l, l̂) | l ∈ L}, then S is noetherian and S ⊆⟺_{T}^{∗}. Since Irr(S) = {m̂ | m ∈ M} is obviously in bijection with the quotient monoid N, it follows by Proposition 5.1.1 that p induces an isomorphism between M/S and N and that S is complete. Note that S is normalized by construction. □

Particularly useful are admissible well-orderings of Knuth-Bendix type. These are orderings such that for some weight function γ : M → IN, (i.e. a homomorphism from M to IN with γ^{−1}(0) = {1}), the inequality of weights γ(x) < γ(y) implies x ≺ y for all x, y ∈ M. Typical examples of admissible well-ordering of Knuth-Bendix type are the lexical orderings on free monoids X^{∗} or on free commutative monoids IN^{k}, k ≥ 1. For IN^{k}, k ≥ 0, it is well-known that all ideals are finitely generated, this is Dickson’s Lemma [Dic13]. Since the complete system S ⊆ M × M mentioned in the proposition above is finite if and only if the ideal I = {m̂ | m ∈ IN} has a finite basis, we obtain, as a special case, the following

Corollary 5.1.4 i) [Red63], Every finitely generated abelian monoid is finitely presentable. ii) [Buc70], Every finitely generated abelian monoid is presentable by some finite normalized complete vector replacement system. □

Remark 5.1.5 The assertion of 5.1.4 ii) has been shown later in [Gil71] and [BL81], too. In [Die86a] it is shown that finitely generated abelian monoids are also presentable by some finite complete semi-Thue systems over free (noncommutative) monoids. But as in the case of trace monoids we have to add new generators, in general. □

The existence of an admissible well-ordering (of Knuth-Bendix type) transfers to submonoids and is invariant under isomorphisms. Since it is a non-trivial property, this implies that it is a so-called Markov property. It is a well-known classical result that Markov properties are undecidable, [Mar47]. Hence in general, it is undecidable whether a given finitely presented monoid M has such an ordering. However, we have the following positive result.

Proposition 5.1.6 Every submonoid of a direct product of finitely many monoids with admissible well-orderings of Knuth-Bendix type has such an ordering, too.

Proof: For i = 1, 2 let M_{i} be a monoid with an admissible well ordering ≺_{i} of Knuth-Bendix type for the weight function γ_{i} : M_{i} → IN. Then γ : M_{i} × M_{2} → IN, γ(m_{1}, m_{2}) := γ_{1}(m_{1}) + γ_{2}(m_{2}) is a weight function. Define the ordering ≺ by (m_{1}, m_{2}) ≺ (n_{1}, n_{2}) if γ(m_{1}, m_{2}) ≺ γ(n_{1}, n_{2}) or γ(m_{1}, m_{2}) = γ(n_{1}, n_{2}) and (m_{1} ≺_{1} n_{1} or m_{1} = n_{1} and m_{2} ≺_{2} n_{2}). □

Corollary 5.1.7 Every trace monoid has an admissible well-ordering of Knuth-Bendix type.

Proof: This follows by the embedding theorem, see Corollary 1.4.7 □

Sometimes, other well-orderings are more suitable. This increases the flexibility. We shall also use the following:

Proposition 5.1.8 Every submonoid of a free product of monoids with admissible well-orderings of Knuth-Bendix type has such an ordering, too.

Proof: Let M = ∗_{i∈J} M_{i}. The proof is based on the fact that the free monoid

J^{∗} over the index set J has a lexical ordering, (axiom of choice). However, to be more explicit we consider the case J = {1, 2} only. The general case is analogous to the finite case of two monoids. For i = 1, 2 let M_{i}, ≺_{i}, γ_{i} : M_{i} → IN as in the proof of the preceeding proposition. The weight functions γ_{1}, γ_{2} induce a homomorphism γ_{12} : M_{1}∗M_{2} → {a, b}^{∗} by the extension of γ_{12}(m_{1}) = a^{γ_{1}(m_{1})} and γ_{12}(m_{2}) = b^{γ_{2}(m_{2})} for m_{1} ∈ M_{1}, m_{2} ∈ M_{2}. We use the lexical well-ordering ≺_{12} on {a, b}^{∗} to define an ordering ≺ on M_{1} ∗ M_{2} as follows: Let m, m′ ∈ M_{1} ∗ M_{2}, m ≠ m′. If γ_{12}(m) ≺_{12} γ_{12}(m′) then we set m ≺ m′. If γ_{12}(m) = γ_{12}(m′) then we have m = n_{1} … n_{k}, m′ = n′_{1} … n′_{k} with k ≥ 1 and for each j ∈ {1, …, k} exists i ∈ {1, 2} such that n_{j}, n′_{j} ∈ M_{i} \ {1} and n_{j−1} ∈ M_{i} ⇒ n_{j} ∉ M_{i}. Since m ≠ m′ there is a minimal index j ∈ {1, …, k} such that n_{j} ≠ n′_{j}. Define in this case m ≺ m′ if n_{j} ≺_{i} n′_{j}. This is a well ordering of Knuth-Bendix type for the weight function γ : M_{1} ∗M_{2} → IN, γ(m) := |γ_{12}(m)| where || denotes the length of words in {a, b}^{∗}. □

Warning: Let M be a trace monoid and assume that the underlying alphabet is totally ordered. Then we obtain a well-ordering on M if we compare traces by the lexical ordering of their lexicographic normal forms. But this is not an admissible well-ordering. Therefore it may not be used to show that trace replacement systems are noetherian. □

To each noetherian replacement system S ⊆ M ×M we canonically associate a partial ordering ⪯_{S} of M as follows: We define x ⪯_{s} y if y ⟹_{S}^{∗} uxv for some u, v ∈ M. As usual, x ≺_{S} y means x ⪯_{s} y and x ≠ y. This partial ordering becomes important below because of its following basic property. Its proof is easy and left to the reader.

Lemma 5.1.9 Let S ⊆ M × M be a noetherian replacement system and ⪯_{s} be the canonically associated partial ordering above. If the proper divisor relation of M is noetherian then the ordering ≺_{S} is well-founded, i.e., every non-empty subset of M has minimal elements with respect to ≺_{S}. □

Remark 5.1.10 Let ⪯ be an admissible well-ordering of M and S ⊆ M × M be a replacement system such that l ≻ r for all (l, r) ∈ S. Then the hypothesis of the lemma above is satisfied and x ⪯_{S} y implies x ⪯ y for all x, y ∈ M. □

5.2 The Knuth-Bendix Completion

The assertion of Proposition 5.1.3 is purely existential. It gives no answer how to find the complete system S nor whether S is finite. If S is finite then the Knuth-Bendix completion procedure is a general method to construct it. Before we recall the completion procedure, we have to define critical pairs for replacement systems over monoids. This is crucial for the following. Therefore, let us first informally explain the idea of critical pairs:

In order to test local confluence of a given system one usually starts with two rules p, q and considers all pairs resulting from elements of the monoid by application of these two rules. Call these pairs {p, q}-derivable. A subset of these {p, q}-derivable pairs is critical if in some sense it determines the confluence of all {p, q}-derivable pairs. This viewpoint is in the spirit of [Buc85]. It is formalized for our purposes where we work in monoids as follows.

We define critical pairs for noetherian systems only and in the definition we use the partial ordering ⪯_{S} defined at the end of the last section.

Definition: Let S ⊆ M × M be a noetherian replacement system. A pair (t_{1}, t_{2}) ∈ M × M is called S-derivable if for some t ∈ M we have t_{1} ⟸_{S} t ⟹_{S} t_{2}.

A subset of S-derivable pairs is called critical if it contains (t_{1}, t_{2}) or (t_{2}, t_{1}) for all (t_{1}, t_{2}) such that the following holds:

For some t ∈ M we have t_{1} ⟸_{S} t ⟹_{S} t_{2}, the pair (t_{1}, t_{2}) is not confluent, but S is confluent on set of all t′ ∈ M where t′ ≺_{S} t.

Any set of critical pairs is denoted by CritPair(S).

To explain this definition consider the subset N ⊆ M where S is not confluent. If N is not empty then define N′ to be the set of minimal elements of N with respect to the ordering ≺_{S}, otherwise define N′ = ∅. Then any subset of S-derivable pairs is denoted by CritPair(S) if it satisfies

{(t_{1}, t_{2}) | ∃t ∈ N′ : t_{1} ⟸_{S} t ⟹_{S} t_{2}, (t_{1}, t_{2}) is not confluent}

⊆ CritPair(S) ∪ CritPair(S)^{−1}

Obviously, a noetherian system S ⊆ M × M is confluent if and only if all pairs of some set CritPair(S) are confluent. More precisely, we have the following remark.

Remark 5.2.1 i): A noetherian system S has an empty set of critical pairs if and only if S is confluent.

ii): The set of all S-derivable pairs form a set of cirtical pairs.

iii): The set

⋃_{p,q∈S} CritPair({p, q})

is a set of critical pairs for the whole system S. This allows to compute critical pairs locally on at most two rules.

iv): If S is a semi-Thue system or a vector replacement system then the usual set of critical pairs (as well as the minimal critical pairs as defined in Sect. 4.1) form a set of critical pairs CritPair(S).

v): The definition of critical pairs given here differs from the definition given in [Die87a]. However, if a system T ⊆ M × M with S ⊆ T is confluent on a set of critical pairs as defined in [Die87a], then it is also confluent on CritPair(S) as defined above. In fact, it turned out that the former definition was slightly too strong to obtain good finiteness results. □

In order to describe the Knuth-Bendix completion we assume that the monoid M has an admissible well-ordering ≺ such the set {x ∈ M | x ≺ y} is finite for all y ∈ M. We start with a replacement system S_{1} ⊆ M × M such that l ≻ r for all (l, r) ∈ S_{1}. For i ≥ 1 we define a system S_{i+1} inductively as follows. We pick any set C(S_{i}) of S_{i}-derivable pairs. The only assumption on C(S_{i}) is that if S_{i} is not confluent then C(S_{i}) must contain at least one pair (t_{1}, t_{2}) which is not confluent and it holds t_{1} ⟸_{S_{i}} t ⟹_{S_{i}} t_{2} for some t ∈ M such that S_{i} is confluent

on all t′ ∈ M with t′ ≺ t. Thus, it is not necessary to consider all critical pairs of S_{i} in this step, but, of course, C(S_{i}) = CritPair(S_{i}) will do. (The point is that all sets CritPair(S) may be infinite whereas it is in principle enough to consider one pair after the other.) Define S_{i+1} = S_{i} ∪ {(t̃_{1}, t̃_{2}) | ∃(t_{1}, t_{2}) ∈ C(S_{i}) : t_{j} ⟹^{∗}

t̂_{j} ∈ Irr(S_{i}), j = 1, 2, {t̂_{1}, t̂_{2}} = {t̃_{1}, t̃_{2}}, t̃_{1} ≻ t̃_{2}}. Finally, set S^{∗} = ⋃_{i≥1} S_{i}.

Proposition 5.2.2 i): The system S^{∗} defined above is complete and the normalization of S^{∗} is exactly the system mentioned in Proposition 5.1.3. ii): Let i ≥ 1. Then we have S^{∗} = S_{i} if and only if S_{i} = S_{i+1}. iii): If there exists any finite complete system T ⊆ M ×M such that M/S_{1} =

M/T and l ≻ r for all (l, r) ∈ T then we have S^{∗} = S_{i} = S_{i+1} for some i ≥ 1.

iv): If S_{1} is finite then there exists a sequence S_{1} ⊆ S_{2} … such that all S_{i} ⊆ M × M are finite. More precisely there exists such a sequence that for each i ≥ 1 either S_{i+1} has exactly one rule more than S_{i} or S^{∗} = S_{i} and S_{i} is complete.

Proof: i): Assume that S^{∗} would not be complete. Then there exists some t_{1} ⟸_{S^{∗}} t ⟹_{S^{∗}} t_{2} such that (t_{1}, t_{2}) is not confluent but S^{∗} is confluent for all t′_{1} ⟸_{S^{∗}} t′ ⟹_{S^{∗}} t′_{2} where t′ ≺ t. By assumption on the well-ordering ≺ for a given (t_{1}, t_{2}) there are only finitely many such pairs (t′_{1}, t′_{2}). Hence for some i ≥ 1 we have t_{1} ⟸_{S_{i}} t ⟹_{S_{i}} t_{2} and all pairs (t′_{1}, t′_{2}) as above are confluent by S_{i}. Next

consider the set {(t′′_{1}, t′′_{2}) | t′′_{1} ⟸_{S_{i}} t ⟹_{S_{i}} t′′_{2}} and denote it for a moment by C_{i}. The

set C_{i} is finite, say of cardinality k ≥ 1 and it contains (t_{1}, t_{2}). In C(S_{i}) we have to pick at least one element of C_{i}, in C(S_{i+1}) another one and so forth. Indeed,

let (t′′_{1}, t′′_{2}) ∈ C(S_{i}), t′′_{1} ⟸_{S_{i}} t′′ ⟹_{S_{i}} t′′_{2}, such that (t′′_{1}, t′′_{2}) is not confluent but S_{i} is

confluent on all t′ where t′ ≺ t′′. Then t′′ ⪯ t since (t_{1}, t_{2}) is not confluent. But t′′ ≺ t is impossible because otherwise (t′′_{1}, t′′_{2}) were of the type (t′_{1}, t′_{2}) as above. Hence t′′ = t and (t′′_{1}, t′′_{2}) ∈ C_{i}.

Now the completion procedure implies that (t_{1}, t_{2}) is confluent by S_{i+k}. This is a contradiction. Therefore S^{∗} is complete. It is clear that the normal forms are the minimal representants of M/S_{1} in M with respect to the well-ordering ≺. This implies that the normalization of S^{∗} is the system constructed in Proposition 5.1.3.

ii): obvious.

iii): Let T ⊆ M × M be any finite system such that l ≻ r for all (l, r) ∈ T and M/S_{1} = M/T. Then for some i ≥ 0 we have T ⊆⟹_{S_{i}}^{∗}. If T is complete then

S_{i} is complete, too. Hence S^{∗} = S_{i} = S_{i+1}.

iv): This is clear since it is enough to pick C(S_{i}) for i ≥ 1 in such a way that contains at most one pair. □

Remark 5.2.3 The description above of the Knuth Bendix completion transforms directly into a procedure if the following conditions are satisfied:

i) For all x, y ∈ M we may test whether x ≺ y.

ii) For all y ∈ M the finite set {x ∈ M | x ≺ y} is computable.

iii) For all finite systems S ⊆ M × M a set of critical pairs CritPair(S) is effectively constructible and CritPair(S) is finite.

Proof: By i) the monoid has a decidable word problem. Together with ii) it allows us to test for given t, l ∈ M whether t = ulu′ for some u, u′ ∈ M. Thus, we may compute effectively irreducible descendants with respect to finite noetherian systems. By iii), S_{i+1} is constructible from S_{i} and it stays finite if S_{i} is finite. □

Remark 5.2.4 Let M be finitely generated. If ≺ is an admissible well-ordering of Knuth-Bendix type. Then {x ∈ M | x ≺ y} is finite for all y ∈ M. If the weight is known for a set of generators then condition ii) above follows from i).

Proof: Let γ : M → IN be a weight function such that γ(x) < γ(y) implies x ≺ y. Now, for every y ∈ M it holds {x ∈ M | x ≺ y} ⊆ {x ∈ M | γ(x) ≤ γ(y)}. Since M is finitely generated the latter set is finite and computable. □

5.3 Critical Pairs over Traces

By Proposition 5.1.3 and Corollary 5.1.7 every quotient monoid of a trace monoid has a presentation by some complete replacement system.

In order to use the Knuth-Bendix completion procedure for finding this complete system, we have to consider critical pairs. Our first result on critical pairs is negative. In general there are infinitely many critical pairs.

Theorem 5.3.1 Let M be a free partially commutative monoid. If M is neither free nor commutative then there is a finite trace replacement system S ⊆ M × M where no finite set of critical pairs CritPair(S) exists.

Proof: Let M = M(X, D). Since M is neither free nor commutative there are letters a, b, c ∈ X such that (a, b) ∉ D and (b, c) ∈ D. Consider the noetherian system S = {ac ⇒ cc, ca ⇒ cc}. If a and c are independent then S is a one-rule-system. However, in any case for all k ≥ 1 we have ccb^{k}c ⟸_{S} cab^{k}c =

cb^{k}ac ⟹_{S} cb^{k}cc and ccb^{k}c ≠ cb^{k}cc. We show that CritPair(S) must contain these

pairs (ccb^{k}c, cb^{k}cc) for all k ≥ 1. Indeed, let t′ ≺_{S} t = cab^{k}c for some k ≥ 1. If t′ is a factor of t then it contains at most one c or no a, and S is confluent on t′. If t′ is a factor a descendant of t then t′ contains no a, and S is confluent on t′, too. According to the definition we have (ccb^{k}c, cb^{k}cc) ∈ CritPair(S). □

One might think that we have chosen the “wrong” definition of critical pairs and a “better” definition would yield finite sets. However, there can be no reasonable definition of critical pairs such that finite noetherian trace replacement systems have a finite and computable set of critical pairs. This is immediate from the following undecidability result proved by P. Narendran and F. Otto. We refer its proof to the original paper [NO88].

Note that the terminology of [NO88] is different. Instead of defining replacement systems over trace monoids they view them as certain so-called preperfect semi-Thue systems. But this approach is limited to consider only length-reducing systems.

Theorem 5.3.2 (Narendran/Otto) There exists effectively a trace monoid M with only one pair of independent letters such that the confluence of finite lengthreducing trace replacement systems over M is recursively undecidable. □

Remark 5.3.3 The minimal number of generators which are necessary to obtain the undecidability result above is unknown. For example, it is open whether we can decide confluence if M is generated by three letters only. It is also open whether we can decide confluence for finite monadic systems, i.e., for finite systems S where |l| ≥ 2 > |r| for all (l, r) ∈ S. □

For our further investigation of critical pairs we need some notions and combinatorics on traces developped in the first chapter. Recall in particular that a subset l ⊆ t is a subtrace if and only if t = ulu′ for some partition t = u ˙∪l ˙∪u′. We have shown in Lemma 1.2.5 that l ⊆ t is a subtrace if and only if x ≤ y ≤ z with x, z ∈ l implies y ∈ l. For Hasse diagrams this is a global condition and not testable in the neighbourhood of l. (One should have this in mind when one thinks in terms of graph-grammars for replacements of traces.) If l_{1} ⊆ t, l_{2} ⊆ t are subtraces then their intersection l_{1}∩l_{2} and union l_{1}∪l_{2} is defined with respect to t only. Note that l_{1} ∩ l_{2} will be a subtrace whereas l_{1} ∪ l_{2} may be viewed as a labelled subset only. Nevertheless, l_{1} ∪ l_{2} defines a unique trace in M; but this will be, in general, no subtrace of t. The subtraces of elements before, behind, and independent of a given subtrace l have been defined by:

pre(l) := {x ∈ t \ l | x ≤ y for some y ∈ l},
suf(l) := {x ∈ t \ l | y ≤ x for some y ∈ l},
ind(l) := {x ∈ t \ l | x ∉ (pre(l) ∪ suf(l))}.

In particular, t is the disjoint union t = pre(l) ˙∪l ˙∪ ind(l) ˙∪ suf(l). Further, if t = ulu′ then for some v, v′ ∈ M it holds: u = pre(l)v, vv′ = ind(l), and v′ suf(l) = u′.

Let l ⊆ t by any subset of a trace t ∈ M. Then the subtrace of t generated by l has been defined by {y ∈ t | ∃x, z ∈ l : x ≤ y ≤ z}. We have denoted this subtrace by ⟨l⟩, it is the smallest subtrace of t containing l. The following definitions are new:

We say that two subtraces l_{1} ⊆ t, l_{2} ⊆ t are strictly separated if we have l_{i} ⊆ (pre(l_{j}) ∪ ind(l_{j})) for some {i, j} = {1, 2}. Hence l_{1} ⊆ t, l_{2} ⊆ t are strictly separated if and only if for some {i, j} = {1, 2} we can write t = ul_{i}vl_{j}w with u = pre(l_{i}), w = suf(l_{j}).

We say that x ∈ t\(l_{1}∪l_{2}) is between l_{1} and l_{2} if pre(x)∩l_{1} ≠ ∅, suf(x)∩l_{2} ≠ ∅ or suf(x) ∩ l_{1} ≠ ∅, pre(x) ∩ l_{2} ≠ ∅. Note that if x is between l_{1} and l_{2} then x must be independent of the intersection l_{1} ∩ l_{2} and x belongs to the generated subtrace ⟨l_{1} ∪ l_{2}⟩.

Example: We represent traces by their Hasse diagrams.

1) Let t be the following trace:

[figure: a; b; c; d]

Then the subtraces l_{1} = (a → b) and l_{2} = (c → d) have an empty intersection (i.e., no overlapping) but they are not strictly separated.

2) Consider the following picture:

[figure: a; b; d; c; x; y]

Again, the subtraces l_{1} = (a → b) and l_{2} = (c → d) are not strictly separated and they generate the trace t. Here the letters x and y are between l_{1} and l_{2}.

3) Let t be the trace:

[figure: a; c; x; b]

with l_{1} = (a → b), l_{2} = (b → c). Then t is generated by l_{1} and l_{2}, i.e., t = ⟨l_{1} ∪ l_{2}⟩, and x is between l_{1} and l_{2}.

Before we continue let us point out a phenomenon which one meets in dealing with trace replacements and which is not present in classical cases of semi-Thue systems and vector replacement systems. Let (l, r) ∈ S be a rule and t ⟹_{(l,r)} t′

be a reduction step. If S is a semi-Thue system or a vector replacement system then the value of t′ is determined by the replaced subtrace l ⊆ t and by the value of the right-hand side r. (Recall that by the general assumption we do not consider rules (l, r) with l = 1.) This is not true anymore if we deal with traces in general. Then the value of t′ might depend on the explicit factorization t = pre(l)ulv suf(l) with uv = ind(l). To be more precise, let a ∈ X be a letter which is independent of l, then for t = al = la there is a unique subtrace l ⊆ t, but we have ar ⟸_{(l,r)} t ⟹_{(l,r)} ra; and of course ar ≠ ra, in general. This

observation led us in previous papers ([Die87a], [Die89]) to the assumption, called A1), that a and r should commute in all these cases. (Note that the system used in the proof of Theorem 5.3.1 satisfied this assumption.) However, for deciding confluence this assumption is not really necessary. It is enough if the system is confluent on all these pairs (ar, ra). The following lemma is obvious and simply states that the confluence of these pairs is decidable.

Lemma 5.3.4 Let S ⊆ M × M be a finite noetherian trace replacement system, (l, r) ∈ S be a rule, and a ∈ X be a letter such that a is independent of l. Then it is decidable whether the pair (ar, ra) is confluent. □

The following considerations are based on the well-founded partial ordering ≺_{S} of M associated with a noetherian trace replacement system S ⊆ M × M. Recall that for x, y ∈ M we have x ⪯_{S} y if and only if y ⟹_{S}^{∗} uxv for some u, v ∈ M, i.e., x is “smaller” than y if and only if x is a subtrace of some descendant of y. The reason that we do not need the assumption A1) here results from the next lemma.

Lemma 5.3.5 Let S ⊆ M ×M be a noetherian trace replacement system, t ∈ M a trace, l ⊆ t a subtrace and (l, r) ∈ S a rule. Let u_{1}v_{1} = u_{2}v_{2} be two factorizations of ind(l) and t_{i} = pre(l)u_{i}rv_{i} suf(l) for i = 1, 2, i.e., t_{1} ⟸_{(l,r)} t ⟹_{(l,r)} t_{2}. Then

the following implication holds. If the pair (ar, ra) is confluent for all a ∈ X such that a is independent of l and if the system S is confluent on all traces t′ ∈ M such that t′ ≺ t then the pair (t_{1}, t_{2}) is confluent, too.

Proof: For simplification of notation it is convenient to observe first that we may assume pre(l) = suf(l) = 1. Thus, we have t = ind(l)l and t_{i} = u_{i}rv_{i} for i = 1, 2. If we have |u_{1}u_{2}| = 0 then t_{1} = t_{2} and the claim follows. If |u_{1}u_{2}| > 0 then we may assume u_{1} = ua for some u ∈ M, a ∈ X with (a, l) ∈ I. Since (ar, ra) is confluent, the pair (t_{1}, urav_{1}) is confluent, too. The pair (urav_{1}, t_{2}) is confluent by induction since |uu_{2}| < |u_{1}u_{2}|. The lemma follows since urav_{1} ≺ t. □

The next theorem says that in view of the Knuth-Bendix completion it is no restriction to assume that all pairs of the form (ra, ar) as mentioned in the lemma above are confluent. This can be achieved by some sort of pre-completion which always terminates on finite systems.

Theorem 5.3.6 Let ≺ be an admissible well-ordering of M = M(X, D) and S ⊆ M × M be a trace replacement system such that l ≻ r for all (l, r) ∈ S. Then there exists an equivalent system T ⊆ M × M such that l ≻ r for all (l, r) ∈ T and (ra, ar) is confluent by T for all (l, r) ∈ T and a ∈ X where a and l are independent. Furthermore, if S is finite then T is also finite and effectively foundable.

Proof: We obtain the system T by the following procedure. For each a ∈ X consider all (l, r) ∈ S such that a and l are independent but (ar, ra) is not confluent. Note that this concernes only rules where alph(r) is no subset of alph(al). For all these rules (l, r) add the rules ra ⇒ ar (ar ⇒ ra respectively) to S. □

Definition: Let S ⊆ M × M be a noetherian trace replacement system and (l_{1}, r_{1}), (l_{2}, r_{2}) be rules. Then the set of critical traces CT (l_{1}, l_{2}, S) is given by the set of traces t ∈ M satisfying the following two conditions:

1) The left-hand sides l_{1}, l_{2} are subtraces l_{1} ⊆ t, l_{2} ⊆ t such that ⟨l_{1} ∪ l_{2}⟩ = t and l_{1} ⊆ t, l_{2} ⊆ t are not strictly separated.

2) For all subtraces l ⊆ t such that (l, r) ∈ S for some r ∈ M we have for i = 1 or for i = 2 that ⟨l_{i} ∪l⟩ = t and l_{i} ⊆ t, l ⊆ t are not strictly separated.

To illustrate the notion of CT (l_{1}, l_{2}, S) consider the semi-Thue case S ⊆ X^{∗} × X^{∗}, where for further simplification S is assumed to be normalized, thus every left-hand side of S is irreducible with respect to all other rules. Then a word w ∈ X^{∗} belongs to CT (l_{1}, l_{2}, S) if and only if w = l_{1}v = ul_{2}, l_{1}, l_{2} have over-lapping, and there is no third left-hand-side occuring in w. Thus, the word w gives rise to a minimal critical pair (r_{1}v, ur_{2}).

The following theorem shows that the decidability of confluence can be based on these sets CT (l_{1}, l_{2}, S). It is a strengthening of [Die87a, Thm. 2.3] and can be viewed as an analogue to the Winkler-Buchberger criterion for term rewriting systems [WB83], see also [KMN88, section 4,(C1)] and [BD88] for a rather general treatment of critical pair criteria. Compare it also with Theorem 4.1.1 Theorem 5.3.7 Let M = M(X, D) and S ⊆ M × M be a noetherian trace replacement system such that (ra, ar) is confluent for all a ∈ X, (l, r) ∈ S where a and l are independent. Then a set of critical pairs for S is given as follows:

CritPair(S) = {(t_{1}, t_{2}) | t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2} for some t ∈ CT (l_{1}, l_{2}, S),

(l_{i}, r_{i}) ∈ S, t_{i} = pre(l_{i})r_{i} ind(l_{i}) suf(l_{i}), i = 1, 2}

Proof: Consider t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2} for some t ∈ M such that S is con-

fluent on all t′ ∈ M where t′ ≺_{S} t. By Lemma 5.3.5 we may assume that t_{i} = pre(l_{i})r_{i} ind(l_{i}) suf(l_{i}) for i = 1, 2. We have to show that t ∉ CT (l_{1}, l_{2}, S) implies the confluence of (t_{1}, t_{2}). Clearly, we may assume that t = ⟨l_{1} ∪ l_{2}⟩ and l_{1} ⊆ t, l_{2} ⊆ t are not strictly separated. Since t ∉ CT (l_{1}, l_{2}, S), we find a subtrace l ⊆ t for some rule (l, r) ∈ S such that for i = 1 and i = 2 we have that ⟨l_{i} ∪ l⟩ ≠ t or l_{i} ⊆ t, l ⊆ t are strictly separated. For i = 1, 2 we choose any t′_{i} ⟸_{(l_{i},r_{i})} t ⟹_{(l,r)} t′′_{i} such that (t′_{i}, t′′_{i}) is confluent. This is possible: if l_{i} ⊆ t, l ⊆ t are

strictly separated then we may write t = ul_{i}vlw (t = ulvl_{i}w respectively) and the pair (ur_{i}vlw, ul_{i}vrw) ((ulvr_{i}w, urvl_{i}w) respectively) will do, if ⟨l_{i} ∪ l⟩ ≠ t there exists such a pair since ⟨l_{i} ∪ l⟩ ≺ t. By standard techniques we are reduced to show the confluence of the following pairs (t_{1}, t′_{1}), (t′_{1}, t′′_{1}), (t′′_{1}, t′′_{2}), (t′′_{2}, t′_{2}), (t′_{2}, t_{2}). The confluence of (t′_{1}, t′′_{1}), (t′_{2}, t′′_{2}) is known by construction. The confluence of the other three pairs follows by Lemma 5.3.5. □

Directly from the theorem above we obtain the following result:

Corollary 5.3.8 Let S ⊆ M × M be a noetherian trace replacement system. Then the system S is confluent if and only if the following two assertions hold:

i) The pair (ar, ra) is confluent for all (l, r) ∈ S, a ∈ X such that (a, l) ∈ I

ii) For all (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S the system S is confluent on the set of critical traces CT (l_{1}, l_{2}, S) defined above. □

Remark 5.3.9 Observe that, in general ii) does not imply i), unless M is free or commutative (in which case it does for trivial reasons). Indeed if M is neither free nor commutative then there are three different letters a, b, c ∈ X such that (a, c) ∈ I and (b, c) ∈ D. Consider the one-rule system S = {a ⟹ b^{2}}. Then

CT (a, a, S) = {a} and the system is confluent on {a} although (b^{2}c, cb^{2}) is not confluent.

We can give a slightly stronger version of the corollary above taking into account that (ar, ra) must be confluent if al = la. This version will be used in the last section on so-called cones and blocks. It is asymmetric in the sense that we use the sets pre(l_{i}) instead of suf(l_{i}). The analogous statement using suf(l_{i}) is left to the reader.

Corollary 5.3.10 Let S ⊆ M × M be a noetherian trace replacement system. Then the system S is confluent if and only if the following two assertions hold:

i) The pair (ar, ra) is confluent for all (l, r) ∈ S, a ∈ X such that al = la.

ii) The pair

(t_{1}, t_{2}) = (pre(l_{1})r_{1} ind(l_{1}) suf(l_{1}), pre(l_{2})r_{2} ind(l_{2}) suf(l_{2}))

is confluent for all (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S and t ∈ CT (l_{1}, l_{2}, S) such that for i = 1, 2 no maximal letter of pre(l_{i}) commutes with l_{i}.

Proof: Use the same techniques as above. □

The key to our decidability result below is the fact that the sets CT (l_{1}, l_{2}, S) are effectively calculable recognizable trace languages. To see this we introduce sets B(p, q, Y). Such a set roughly stands for the set of possible traces between p and q with alphabet Y. Formally B(p, q, Y) is defined for traces p, q ∈ M and subsets Y ⊆ X by

B(p, q, Y) = {y ∈ M | alph(y) = Y and with respect to

the trace pyq it holds

suf(p) = yq and pre(q) = py}

Note that in the free commutative case M = IN^{X} the set B(p, q, Y) will be empty unless Y ⊆ alph(p) = alph(q). More generally, B(p, q, Y) is empty unless for each maximal element a ∈ p there exists some b ∈ Y ∪alph(q) with (a, b) ∈ D and for each minimal element c ∈ q there exists b ∈ Y ∪alph(p) with (b, c) ∈ D. If B(p, q, Y) is non-empty then it contains those y ∈ M with alph(y) = Y such that every minimal letter of y depends on some letter in p and every maximal letter of y depends on some letter in q. Thus, in all cases B(p, q, Y) is recognizable.

Theorem 5.3.11 Let S ⊆ M × M be a noetherian trace replacement system such that the set of left hand sides is recognizable. Then the set CT (l_{1}, l_{2}, S) is an effectively calculable recognizable trace language for all (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S.

Proof: Let t ∈ M such that t ∈ CT (l_{1}, l_{2}, S). Then l_{1} ⊆ t, l_{2} ⊆ t are nonstrictly separated subtraces and we have t = ⟨l_{1} ∪ l_{2}⟩. Define the following nine subtraces of t:

p_{i} = l_{i} ∩ pre(l_{j})  , {i, j} = {1, 2},
s_{i} = l_{i} ∩ ind(l_{j}) = ind(l_{j}) , {i, j} = {1, 2},
q_{i} = l_{i} ∩ suf(l_{j})  , {i, j} = {1, 2},
s = l_{1} ∩ l_{2}
y_{1} = suf(l_{1}) ∩ pre(l_{2})
y_{2} = suf(l_{2}) ∩ pre(l_{1})

[figure: q_{1}; y_{2}; p_{2}; s_{1}; s; s_{2}; p_{1}; y_{1}; q_{2}]

Figure 5.1. A trace t = ⟨l_{1} ∪ l_{2}⟩ devided into nine subtraces.

We have a picture as in Figure 5.1.

The following formulae hold:

1) p_{i}s_{i}sq_{i} = l_{i} for i = 1, 2

2) (s_{i}, l_{j}) ∈ I for {i, j} = {1, 2}

3) (p_{1}, p_{2}) ∈ I, (q_{1}, q_{2}) ∈ I

4) y_{i} ∈ B(p_{i}, q_{j}, Y_{i}) for some Y_{i} ⊆ {a ∈ X | (a, p_{j}s_{1}ss_{2}q_{i}) ∈ I}, {i, j} = {1, 2}, Y_{1} × Y_{2} ⊆ I

5) s ≠ 1 or p_{1}, p_{2}, q_{1}, q_{2} ≠ 1

Vice versa, if the formulae 1) - 5) hold for some p_{i}, s_{i}, s, q_{i}, y_{i} and i = 1, 2 then t = p_{1}p_{2}y_{1}s_{1}ss_{2}y_{2}q_{1}q_{2} yields a trace with non-strictly separated subtraces l_{1} ⊆ t, l_{2} ⊆ t such that ⟨l_{1} ∪ l_{2}⟩ = t. Thus, the set CT (l_{1}, l_{2}, S) is a subset of a finite union of recognizable sets of the form

p_{1}p_{2}B(p_{1}, q_{2}, Y_{1})s_{1}ss_{2}B(p_{2}, q_{1}, Y_{2})q_{1}q_{2}.

In the following we may think that the data p_{1}, p_{2}, s_{1}, s, s_{2}, q_{1}, q_{2} ∈ M and Y_{1}, Y_{2} ⊆ X are fixed. There are only finitely many traces where p_{1}s_{1}q_{1} = 1 or p_{2}s_{2}q_{2} = 1, thus we assume p_{1}s_{1}q_{1} ≠ 1 ≠ p_{2}s_{2}q_{2}. In the next step one replaces B(p_{i}, q_{j}, Y_{i}) by B_{i} = {y ∈ B(p_{i}, q_{i}, Y_{i}) | p_{i}s_{i}y, ys_{j}q_{j} ∈ Irr(S)} for {i, j} = {1, 2}. This is possible without loosing anything from CT (l_{1}, l_{2}, S). In fact, say p_{1}s_{1}y_{1} is reducible by some rule (l, r) ∈ S. Then the subtrace l ⊆ p_{1}s_{1}y_{1} ⊂ t is strictly separated from l_{2} ⊆ t and ⟨l_{1} ∪ l⟩ ≠ t since p_{2}s_{2}q_{2} ≠ 1. Note that B = p_{1}p_{2}B_{1}s_{1}ss_{2}B_{2}q_{1}q_{2} is recognizable. But it is still too large. It may contain traces t such that l ⊆ t is a subtrace for some left-hand side where ⟨l_{1} ∪ l⟩ ≠ t ≠ ⟨l_{2} ∪ l⟩. It is not very difficult to exclude these traces, too, by distinguishing several cases. This is left to the reader, since in our applications the set B is already finite. □

We now state the main result of this section which follows directly from the theorem above together with Lemma 5.3.4.

Corollary 5.3.12 Let S be a finite noetherian trace replacement system and L = {l ∈ M | (l, r) ∈ S for some r ∈ M} be the set of left-hand sides. Then it is decidable whether the set

CT (S) = ⋃_{{l_{1},l_{2}}⊆L} CT (l_{1}, l_{2}, S)

is finite. If the set CT (S) is finite then it is decidable whether the system S is confluent. □

Remark 5.3.13 The exact calculation of the set CT (S) above seems to be very difficult in general. However, in order to prove that CT (S) is finite it is enough to prove an upper bound on this set. For example we might prove that the length of traces in CT (S) cannot exceed a certain length. Then we can test the confluence on all traces up to this length without knowing the explicit description of CT (S). □

Example: Consider the same trace as in a previous example:

[figure: a; b; c; d]

We may view this as a process consisting of two subprocesses l_{1} = a → b and l_{2} = c → d which may start independently and terminate independently after both have started. Let S = {(l_{1}, r_{1}), (l_{2}, r_{2})} be a replacement system. Assume that M is generated by {a, b, c, d}. Then the set of critical pairs as given above has one element only: {(ar_{2}b, cr_{1}d)}. Clearly, it depends on r_{1}, r_{2} whether S is confluent or not; if r_{1} = c, r_{2} = a then S is confluent since ac = ca, if

r_{1} = da, r_{2} = bd then S is not confluent since abdb ⟹_{S} dadb = dabd ⟹_{S} ddad,

cdad ⟹_{S} bdad = dbad and these elements are different. This shows also that we have to consider critical pairs, even if the left-hand sides have no overlapping.

Another strange thing happens if there is another generator x in M. Surprisingly this has influence on the set of critical pairs and on the confluence of the system.

Let M be generated by a, b, c, d, and x. There is a trace t′ in M such that l_{1} ⊆ t′, l_{2} ⊆ t′, l_{1} and l_{2} are not strictly separated, and some letter is between l_{1} and l_{2} if and only if (x, a), (x, d) ∈ D and (x, b), (x, c) ∉ D. In this case we must have the following picture

[figure: a; b; c; d; x^{n}]

The resulting set of critical pairs is {(ax^{n}r_{2}b, cx^{n}r_{1}d) | n ≥ 0}. Again it depends on r_{1} and r_{2} whether S is confluent or whether actually there is a finite set of critical pairs: If r_{1} = r_{2} = 1 then ax^{n}b = abx^{n} ⟹_{S} x^{n} ⟸_{S} x^{n}cd = cx^{n}d. Hence S is confluent and the empty set is a set of critical pairs, too. If r_{1} = a, r_{2} = c then S is not confluent, and it is easy to see that no proper subset of {(ax^{n}cb, cx^{n}ad) | n ≥ 1} can be a set of critical pairs for S.

Thus, the system

S = {ab ⇒ a, cd ⇒ c}

is not confluent on M although it is confluent on the submonoid generated the letters occurring in S.

Later we shall give a sufficient condition that no such situation arises.

Example: Consider two processes l_{1} = a → b and l_{2} = b → c. Let S = {(l_{1}, r_{1}), (l_{2}, r_{2})} be a replacement system having these processes on the lefthand side. Again, the same phenomena as above arises. If M is generated by {a, b, c} then a set of critical pairs is given by {(r_{1}c, ar_{2})}. Assume there is another generator x. Let t ∈ M be a trace with l_{1} ⊆ t, l_{2} ⊆ t, t = ⟨l_{1} ∪ l_{2}⟩, and l_{1}, l_{2} are not strictly separated. Say there is a letter between l_{1} and l_{2}. Then it holds (x, a), (x, c) ∈ D, but (x, b) ∉ D and every such trace t has the form

[figure: a; b; x^{n}; c]

It follows that the set {(r_{1}x^{n}c, ax^{n}r_{2}) | n ≥ 0} is a set of critical pairs for S. □

So far, in the computation of critical pairs mainly left-hand sides have been taken into acount. A simplification arises if we put some restriction on the possible right-hand sides. Consider the case where we have ra = ar whenever the letter a is independent of any letter in the alphabet of the left-hand side l for (l, r) ∈ S. This is satisfied for example in the semi-Thue case, in the case of vector replacement systems or if r is central in M. Hence, in particular in the case of special systems, i.e., where the right-hand sides are all equal to 1. Then it is enough to consider t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2} where t = ⟨l_{1} ∪ l_{2}⟩ and l_{1}, l_{2} have

overlapping, i.e., l_{1} ∩ l_{2} ≠ ∅. Furthermore the resulting critical pair (t_{1}, t_{2}) has a simpler description where the parts between l_{1} and l_{2} become pre- and suffixes.

Theorem 5.3.14 Let S ⊆ M × M be a noetherian trace replacement system over M = M(X, D). Assume that every letter which is independent of any letter of a left-hand side of a rule commutes with the corresponding right-hand side. Then the system S is confluent if and only if the system is confluent on the set of traces t ∈ M which satisfy the following two conditions:

i) For some (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S there are subtraces l_{1} ⊆ t, l_{2} ⊆ t such that t = ⟨l_{1} ∪ l_{2}⟩, l_{1} ∩ l_{2} ≠ ∅.

ii) If l ⊆ t is any subtrace for some rule (l, r) then for i = 1 or i = 2 we have t = ⟨l_{i} ∪ l⟩ and l_{i} ∩ l ≠ ∅.

Furthermore, for each such trace t let p_{i} = pre(l_{j}) ∩ l_{i}, s_{i} = ind(l_{j}), q_{i} = suf(l_{j}) ∩ l_{i}, y_{i} = (suf(l_{i}) ∩ pre(l_{j})), {i, j} = {1, 2}, and s = l_{1} ∩ l_{2}. Then for the resulting critical pair t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2} we have the formula:

(t_{1}, t_{2}) = (y_{1}p_{2}r_{1}s_{2}q_{2}y_{2}, y_{2}p_{1}r_{2}s_{1}q_{1}y_{1})

Proof: First, observe that the assumption on S implies that ra = ar for all a ∈ X, (l, r) ∈ S where a and l are independent. Thus, we may apply Theorem 5.3.7. Now, consider t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2} with t = ⟨l_{1} ∪ l_{2}⟩. Define the

nine subtraces p_{1}, p_{2}, s, s_{1}, s_{2}, q_{1}, q_{2}, y_{1}, y_{2} as above. Then we may write t_{i} = p_{j}y_{j}s_{j}r_{i}y_{i}q_{j} for {i, j} = {1, 2}. Since we may assume that l_{1}, l_{2} are not strictly separated the assumption on S implies the commutation of r_{i} with y_{i} and y_{j}. Using the other independencies we obtain t_{i} = y_{i}p_{j}s_{j}r_{i}q_{j}y_{j}. This is already the formula above. Following the proof of Theorem 5.3.7 it is enough to show that (t_{1}, t_{2}) is confluent if l_{1} ∩ l_{2} = ∅, i.e., if s = 1. So, let s = 1 then we have p_{1} ≠ 1, p_{2} ≠ 1, q_{1} ≠ 1, q_{2} ≠ 1 because otherwise l_{1}, l_{2} would be strictly separated in t. Then the assumption on S says p_{j}s_{j}r_{i} = r_{i}p_{j}s_{j} and r_{i}q_{j} = q_{j}r_{i} for {i, j} = {1, 2}. Hence (t_{1}, t_{2}) = (y_{1}r_{1}p_{2}s_{2}q_{2}y_{2}, y_{2}p_{1}s_{1}q_{1}r_{2}y_{1}). Since s = 1 we have (t_{1}, t_{2}) = (y_{1}r_{1}l_{2}y_{2}, y_{2}l_{1}r_{2}y_{1}). This pair reduces to (y_{1}r_{1}r_{2}y_{2}, y_{2}r_{1}r_{2}y_{1}). However, we have y_{1}r_{1}r_{2}y_{2} = r_{1}r_{2}y_{1}y_{2} = y_{2}r_{1}r_{2}y_{1} and this concludes the proof. □

It is open whether the structure of critical pairs given in the theorem above is simple enough to decide the confluence. Some further simplifications occur if the system is special, i.e., if all right-hand sides are equal to 1. But even for finite special trace replacement systems we were not able to solve the question of confluence in general. Of course if the subtraces y_{1}, y_{2} are empty then confluence is decidable. A nice example for this is given by the presentation of free partially commutative groups.

Example: Let (X, D) be a dependence alphabet and M = M(X, D). Let \overline{X} be a disjoint copy ofX and set X̃ = X ˙∪\overline{X}. Define on X̃ a dependence relation D̃ ⊆ X̃ × X̃ by (x̃, ỹ) ∈ D̃ if (i(x̃), i(ỹ)) ∈ D where i : X̃ → X denotes the canonical mapping i(x) = i(\overline{x}) = x for x ∈ X.

Let S̃ ⊆ M(X̃, D̃) × M(X̃, D̃) be the special replacement system which is given by the following rules: (1): x\overline{x} ⟹ 1, (2): \overline{x}x ⟹ 1, for x ∈ X.

Then X̃^{∗}/S̃ is the free partially commutative group over (X, D). This is also the group associated with M(X, D). It is very easy to see that the restrictions put on the critical pairs according to the last corollary imply that critical pairs arise only as follows

x ⟸_{(1)} x\overline{x}x ⟹_{(2)} x, \overline{x} ⟸_{(2)} \overline{x}x\overline{x} ⟹_{(1)} \overline{x}.

Hence, S̃ is a complete system. It may be used for normal forms of elements of free partially commutative groups. Since M ⊆ Irr(S̃) ⊆ M(X̃, D̃), we obtain the well-known fact that free partially commutative monoids are embeddable in groups.

5.4 The Completion Procedure on Traces

In the second section we described the Knuth-Bendix completion procedure in general. We could apply it to our situation of free partially commutative monoids if there would be an effective way to compute finite sets of critical pairs. But we have already seen that this is an impossible task. We could restrict ourselves to systems S ⊆ M × M where the recognizable set CT (S) ⊆ M of critical traces is finite and stays finite during the completion procedure. However, the computation of CT (S) and hence of CritPair(S) can be very difficult. So, a calculation of this set should be avoided whenever possible. We will see that indeed the calculation of CT (S) can be postponed at the end of the procedure.

The idea is to use during the procedure the following sets which we have called basic critical pairs.

Definition: Let S ⊆ M ×M be a trace replacement system over M = M(X, D) and let I ⊆ M × M be the independence relation. The set of BCP (S) of basic critical pairs for S is given by the following formula

BCP (S) = {(ra, ar) | a ∈ X, (l, r) ∈ S, (a, l) ∈ I, ra ≠ ar}
∪{(t_{1}, t_{2}) | ∃(l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S, t ∈ M with

subtraces l_{1} ⊆ t, l_{2} ⊆ t such that l_{1}, l_{2} are not strictly separated, every letter of t belongs to l_{1} or to l_{2}, and

t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2}} □

It is clear that the set BCP (S) is finite if S ⊆ M × M is finite and in the next section we will see that BCP (S) can be computed in polynomial time in the size of the system S. A more explicit description of BCP (S) can be easily derived from the proof of Theorem 5.3.11 observing that we consider only the cases where y_{1} = pre(l_{2}) ∩ suf(l_{1}) = y_{2} = pre(l_{1}) ∩ suf(l_{2}) = ∅. The following remark says that basic critical pairs are in some sense the bottom of all cirtical pairs.

Remark 5.4.1 Let ≺ be an admissible well-ordering of a trace monoid M and S ⊆ M × M be a trace replacement system. Then for all t_{1} ⟸_{S} t ⟹_{S} t_{2} with t_{1} ≠ t_{2} there exists a basic critical pair (t′_{1}, t′_{2}) ∈ BCP (S) and some t′ ⪯ t such

that t′_{1} ⟸_{S} t′ ⟹_{S} t′_{2}

Proof: Observe first that for all t ∈ M and all subsets l ⊆ t, l ≠ t (not necessarily subtraces) we have l ≺ t. To see this we reduce by induction to the case t\l = {a}. Then t = l′al′′ for some l′l′′ = l and since 1 ≺ a we have l ≺ t. The proof follows easily from this observation. □

We will run a modified completion procedure as follows. We choose an admissible well-ordering ≺ and we start with a finite system S_{1} where l ≻ r for all (l, r) ∈ S_{1}. We proceed as usual but for the sets C(S_{i}) we always take the finite sets BCP (S_{i}) of basic critical pairs. According to the completion procedure we set S^{∗} = ⋃_{i≥1} S_{i}. Of course, there is no algorithmic way to decide whether the completion procedure stops or not. We are mainly interested in the case where S^{∗} is finite, i.e., at a certain point in the procedure we arrive the situation that all basic critical pairs are confluent. The unsolvable problem is that in general we can not say whether the finite system S^{∗} is confluent or not. (Otherwise

[figure: a^{k}; a; a; c; c; b]

Figure 5.2. The trace ac(a^{k+1} + b)c for k ≥ 0

we would obtain a contradiction to the undecidability result of Narendran/Otto, Theorem 5.3.2).We only can try to prove the confluence by some sufficient condition. For example, we show that CT (S^{∗}) is finite. If CT (S^{∗}) is finite then we can test the confluence of S^{∗} on this set. Note that the test will be positive and can therefore be omitted if we have CritPair(S^{∗}) = BCP (S^{∗}). Because the calculation of CT (S^{∗}) is difficult, we should however normalize S^{∗} first. Since S^{∗} is not known to be complete we have to be a little bit careful with the normalization: We reduce the right-hand sides rule after rule until they are irreducible. Call this new system S^{∗} again. Now, if (l, r) ∈ S^{∗} and l ∉ Irr(S^{∗} \ {(l, r)}) then compute an irreducible descendant l̂ of l with respect to S^{∗} \ {(l, r)}. If l̂ = r then we safely may omit the rule (l, r), otherwise S^{∗} is not complete and we restart the whole procedure again with the system S^{∗} \ {(l, r)} and the new rule (l̂, r) (or (r, l̂) if r ≺ l̂). If, finally, S^{∗} is normalized, confluent on BCP (S^{∗}) and for some further reasons we know that BCP (S^{∗}) = CritPair(S^{∗}), then S^{∗} is a finite normalized complete system for M/S_{1}.

In the following examples we show that this might be a feasible way to treat the completion procedure on traces. We use the notational convention to allow plus-signs between letters which commute. We always use well-orderings as in Proposition 5.1.6 or 5.1.8 without mentioning them explicitly.

Example: Let M = {a, b, c}^{∗}/{(ab, ba)}, the dependence graph of M is a − c − b. Consider the following replacement system

S_{1} = {((a + b)c, 1), (bca, 1), (acb, 1)}.

For this system the set of critical traces CT (S_{1}) is infinite. Indeed, it contains all traces of the form t = ac(a^{k+1} + b)c, k ≥ 0 as shown in Figure 5.2.

However, as we have said above we concentrate on basic critical pairs. Thus we obtain BCP (S_{1}) = {(ca, ac), (cb, bc)}. Assume our well-ordering says ac ≺ ca and bc ≺ cb. Then, after normalization we have

S^{∗} = S_{2} = {((a + b)c, 1), (ca, ac), (cb, bc)}.

Now, let us calculate CT (S^{∗}). We see that all traces ac(a^{k+1} + b)c with k + 1 vanish from CT (S^{∗}) since ca is now a left-hand side of rule. It easily follows that CT (S^{∗}) = {(a+b)ca, (a+b)cb, c(a+b)}. The set CT (S^{∗}) yields the basic critical pairs and these are confluent. The unique normal forms are (a^{2} + b)c, (a + b^{2})c, (a+b)c respectively. Thus, S^{∗} is a finite complete replacement system for M/S_{1}. We have M/S_{1} = M/S^{∗} ≅ Z × Z.

It is worth noting that Z × Z is not presentable by any finite complete semi-Thue system over a free monoid on three letters, see [Die86b]. Here, one commutation rule, namely ab = ba, is enough to obtain such a complete system on three generators.

We finish this section with an non-commutative example which is therefore not presentable by any vector-replacement system, and where the Knuth-Bendix completion algorithm would not terminate in the purely free case neither.

Example: Let M = {a, b, c, g}^{∗}/{(ab, ba), (ac, ca), (bc, cb)} The monoid M is represented by its dependence graph:

[figure: c; b; a; g]

It is isomorphic to IN^{3} ∗ IN. We use a well ordering on M as it is given in Proposition 5.1.8. Consider the following finite noetherian system S_{1} = {((a + b + c), 1), (g^{2}, 1), (ga, bg)}. The system S_{1} is not complete. We have

bg(b + c) ⟸_{S_{1}} g(a + b + c) ⟹_{S_{1}} g, gbg ⟸_{S_{1}} g^{2}a ⟹_{S_{1}} a.

According to the completion procedure we obtain: S_{2} = {(a + b + c, 1), (g^{2}, 1), (ga, bg), (bg(b + c), g), (gbg, a)}. This system is not complete since gb ⟸_{S_{2}} gbg^{2} ⟹_{S_{2}} ag. After the next step, and normalization, we obtain:

S_{3} = {(a + b + c, 1), (g^{2}, 1), (ga, bg), (gb, ag), ((a + b)gc, g)}. Again, S_{3} is not complete. Consider:

gc ⟸_{S_{3}} (a + b + c)gc ⟹_{S_{3}} cg.

But in the next step the completion procedure stops and normalization yields the following system

S^{∗} = {(a + b + c, 1), (g^{2}, 1), (ga, bg), (gb, ag), (gc, cg)}.

It is straightforward to see that CT (S^{∗}) is finite and that CritPair(S^{∗}) = BCP (S). The confluence of S^{∗} is can be proved by inspecting all critical pairs.

It follows that S^{∗} is a complete replacement system. (We may use this system to solve the word problem for M/S_{1} in linear time!) The algebraic structure of M/S_{1} is given by the semi-direct product of Z×Z by Z/2Z where Z/2Z operates

on Z × Z via the matrix ( \begin{matrix}0 & 1 \\ 1 & 0 \end{matrix} ) ∈ SL_{2}(Z).

5.5 Some Remarks on Complexity

In this section we prove some complexity results. First we give an upper bound for the number of basic critical pairs which are computed according to the definition of the preceeding section. The notations are as usual:

Let M = M(X, D) be a trace monoid generated by some finite alphabet X and k ≥ 0 the least integer such that M has an embedding into a k-fold direct

product of free monoids, M ⟶ ∏_{i=1}^{k} X_{i}^{∗}.

Let S ⊆ M × M be a finite replacement system of n rules, n ≥ 1 and let

m := max{|l| | (l, r) ∈ S}. The size ||S|| of S is defined by ||S|| := ∑_{(l,r)∈S}(|l|+|r|).

Theorem 5.5.1 The set of basic critical pairs

BCP (S) = {(ra, ar) | a ∈ X, (l, r) ∈ S, (a, l) ∈ I, ra ≠ ar}
∪{(t_{1}, t_{2}) | ∃(l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S, t ∈ M with

subtraces l_{1} ⊆ t, l_{2} ⊆ t such that l_{1}, l_{2} are not strictly separated, every letter of t belongs to l_{1} or to l_{2}, and

t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2}} □

contains at most \frac{4^{k}(m+1)^{k}n(n+1)}{2} + n(#X − 1) elements.

Proof: Clearly, there are at most n(#X − 1) pairs of the form (ra, ra) such that ra ≠ ar, (l, r) ∈ S, a ∈ X, and (a, l) ∈ I. Hence it is enough to consider the

other pairs of BCP (S). Using the embedding M ⟶ ∏_{i=1}^{k} X_{i}^{∗} every trace t ∈ M

becomes a k-tupel of words t = (t_{1}, …, t_{k}). Let (p, r), (q, s) ∈ S be rules, we count the number of traces t with t = p ∪ q with multiplicities according to the different ways how p and q may occur as subtraces p ⊆ t, q ⊆ t.

Since t = p ∪ q, every letter of t is in p ⊆ t or in q ⊆ t. Hence, for all i = 1, …, k there are u_{i}, v_{i}, w_{i} ∈ X_{i}^{∗}: t_{i} = u_{i}v_{i}w_{i} with

1) u_{i}v_{i} = p_{i}  and  v_{i}w_{i} = q_{i}
or 2) u_{i}v_{i} = q_{i}  and  v_{i}w_{i} = p_{i}
or 3) u_{i}v_{i}w_{i} = p_{i}  and  v_{i} = q_{i}
or 4) u_{i}v_{i}w_{i} = q_{i}  and  v_{i} = p_{i}

Thus, for each i ∈ {1, …, k} there are at most 4(m + 1) choices for u_{i}, v_{i}, w_{i} ∈ X_{i}^{∗}. For each pair (p, r), (q, s) ∈ S this gives 4^{k}(m + 1)^{k} combinations. The result follows because we have to consider at most \frac{n(n+1)}{2} pairs of rules. □

Note that the theorem above is a roughly estimated worst-case analysis. In practice, there should be much less basic critical pairs.

Corollary 5.5.2 For fixed M there is a polynomial time algorithm (in the input size ||S||) which computes the set of basic critical pairs BCP (S).

Proof: Let (p, r), (q, s) ∈ S be rules. In polynomial time we compute all k-tuples of words (t_{1}, …, t_{k}) = (u_{1}, …, u_{k})(v_{1}, …, v_{k})(w_{1}, …, w_{k}) which satisfy one of the conditions 1), …,4) in the proof of Theorem 5.5.1. From these tuples we obtain factorizations t = xpy = x′qy′ in X_{1}^{∗} × … × X_{k}^{∗}. Then one verifies that x, x′, y represent traces in linear time, see Sect. 1.5. (If x, x′, y are traces, then t is a trace and p, q are subtraces.) Next, one decides whether p ∩ q ≠ ∅ or whether p, q are not strictly separated, which is simple for tuples. Finally, one computes the critical pairs from the above factorizations. □

A replacement system S ⊆ M × M over a trace monoid M is called recognizable if the number of right-hand sides is finite and if for each r ∈ M the set {l ∈ M | (l, r) ∈ S} is recognizable in M. Recognizable systems are of interest here since there are fast algorithms to compute direct descendants:

Lemma 5.5.3 Let S ⊆ M ×M be a recognizable trace replacement system. Then there is an algorithm which on input t ∈ M decides in time O(|t|) whether t is reducible with respect to S. If it is then it computes a direct descendant of t.

Proof: This follows from Corollary 2.2.3. □

For finite systems, however, the use of Corollary 2.2.3 in the proof above seems to be not adequate. For finite systems a better algorithm would be based on the function pre(l, t) described in Sect. 1.5.

Let us measure the time complexity to compute irreducible forms for finite noetherian systems S ⊆ M × M in terms of the following function

d_{S} : IN → IN, d_{S}(n) = max{m ∈ IN | t ⟹_{S}^{m} t̂, |t| = n}

5.6. The Condition G_{k}(S) for k ≥ 0 133

This means d_{S}(n) is the maximal number of possible reduction steps starting on a trace of length n. For applications, one is mainly interested in cases where d_{S} grows slowly. This is for example the case when S ⊆ M × M is weight-reducing, then d_{S} is a linear function.

Theorem 5.5.4 Let S ⊆ M×M be a finite noetherian trace replacement system. Then we may compute irreducible normal forms on some (multitape) Turing machine in time O(d_{S}^{2}).

Proof: Consider a derivation chain t ⟹_{S} t_{1} ⟹_{S} … ⟹_{S} t_{m} ∈ Irr(S). For some constant c ≥ 0 we have |t_{i}| = |t| + c · i for 1 ≤ i ≤ m. From the lemma above we can compute the irreducible descendant t_{m} in time O(m · |t| + c\frac{m(m−1)}{2}). Of course, m ≤ d_{S}(|t|) and since we may assume S ≠ ∅ we have |t| ∈ O(d_{S}(|t|)). Hence, we obtain the estimate above. □

If in the proof above the system S has no length-increasing rule then we can choose the constant c to be zero. We obtain a slightly better timebound. Also we can use any weight function instead of the length. Therefore we can formulate the following.

Corollary 5.5.5 Let S ⊆ M × M be a finite complete trace replacement system over M = M(X, D). Then the word problem s ⟺_{S}^{∗} t for traces s, t ∈ M

can be decided in time O(d_{S}^{2}(|s|) + d_{S}^{2}(|t|)). If for some weight function γ : X → IN^{+} the system is not weight-increasing then it can be decided in time O(|s|d_{S}(|s|) + |t|d_{S}(|t|)), and if S is weight-reducing then it can be decided in square time O(|st|^{2}). □

Remark 5.5.6 We have no idea whether the time bounds stated above are optimal. On the other hand in the restricted case of semi-Thue systems (or vectorreplacement systems) we could obtain the same assertion as in Corollary 5.5.5 in time O(d_{S}), see Sect. 4.1. Unfortunately the technique of [Boo82] does not apply to the free partially commutative case in general. It applies to the special systems S̃ ⊆ X̃ × X̃ of Sect. 5.3 which describe free partially commutative groups. It has been shown by C. Wrathall, [Wra88] that these systems allow a linear time algorithm. In the next section we present a more general condition which allows to compute irreducible normal forms in time O(d_{S}).

5.6 The Condition G_{k}(S) for k ≥ 0

Consider a finite noetherian trace replacement system S ⊆ M ×M. The informal reason why, so far, we can not prove a better time bound than O(d_{S}^{2}) is that for some c > 0 there might be irreducible traces t ∈ Irr(S) such that if we multiply t by a letter a ∈ X from the left (or right) then at (or ta) becomes reducible by some rule (l, r) ∈ S, but for all factorizations at = ulv, we have |u| ≥ c|t| and |v| ≥ c|t|. Even if there would be, at this stage, a fast way (constant time) to compute the reduction step at = ulv ⟹_{S} urv, we see no fast way to test whether urv is irreducible, it will take time linear to the length of |t|. Of course, all these problems vanish if we could bound the length of |u| in the situation above by some constant k ≥ 0 depending on S only. This is exactly what the following condition says.

Definition: Let k ≥ 0, X^{(k)} = {t ∈ M | |t| ≤ k}, and S ⊆ M × M be a noetherian trace replacement system with the set of left-hand sides L = {l ∈ M | (l, r) ∈ S for some r ∈ M}. We say that the condition G_{k}(S) holds if we have

X Irr(S) ⊆ Irr(S) ∪ X^{(k)}LM.

The properties we are interested in are summarized in the next theorem.

Theorem 5.6.1 Let k ≥ 0 and S ⊆ M × M be a finite noetherian trace replacement system and L be the set of left-hand sides. Then we have the following assertions.

i) It is decidable whether G_{k}(S) holds.

ii) If G_{k}(S) holds then we can decide whether S is confluent.

iii) If G_{k}(S) holds and if S is confluent then we can decide the word problem of S in time O(d_{S})

Proof: i) trivial since all sets involved for deciding G_{k}(S) are recognizable. ii) We show that the set CT (l_{1}, l_{2}, S) introduced in Sect. 5.3 is finite for all l_{1}, l_{2} ∈ L where as above L = {l ∈ M | (l, r) ∈ S for some r ∈ M}. The result then follows by Corollary 5.3.8.

Let l_{1}, l_{2} ∈ L and t ∈ M be a trace with subtraces l_{1} ⊆ t, l_{2} ⊆ t such that ⟨l_{1} ∪ l_{2}⟩ = t and l_{1} ⊆ t, l_{2} ⊆ t are not strictly separated. As in the proof of Theorem 5.3.11 we devide t into nine subtraces:

p_{i} = l_{i} ∩ pre(l_{j}) ,  {i, j} = {1, 2},
s_{i} = l_{i} ∩ ind(l_{j}) ,  {i, j} = {1, 2},
q_{i} = l_{i} ∩ suf(l_{j}) ,  {i, j} = {1, 2},
s = l_{1} ∩ l_{2},
y_{i} = suf(l_{i}) ∩ pre(l_{j}) , {i, j} = {1, 2}.

Then we have t = p_{1}p_{2}y_{1}s_{1}ss_{2}y_{2}q_{1}q_{2}.

Let F be the finite set of subtraces of traces in X^{(k)}L, i.e., F = {f ∈ M | ∃u, v ∈ M : ufv ∈ X^{(k)}L}. (In fact, for fixed k the cardinality of F is even a polynomial in the size of the system S.) It will be enough to show that if t ∈ CT (l_{1}, l_{2}, S) then we have y_{1}s_{2}q_{2}, y_{2}s_{1}q_{1} ∈ F. We do this by contradiction assuming t ∈ CT (l_{1}, l_{2}, S) and y_{1}s_{2}q_{2} ∉ F. (The case y_{2}s_{1}q_{1} ∉ F is symmetric.) Since s_{2}q_{2} is a subtrace of l_{2} we have s_{2}q_{2} ∈ F and hence |y_{1}| ≥ 1. Therefore p_{1} ≠ 1. This implies y_{1}s_{2}q_{2} ∈ Irr(S), because otherwise t would contain a subtrace l ⊆ y_{1}s_{2}q_{2} ⊆ t for some (l, r) ∈ S such that l_{1} ⊆ t, l ⊆ t are strictly separated and ⟨l_{2} ∪ l⟩ ≠ t. On the other hand p_{2}sy_{1}s_{2}q_{2} = y_{1}l_{2} is reducible since l_{2} ∈ L. Hence for some factorization p_{2}s = w′aw, w′, w ∈ M, a ∈ X, we have wy_{1}s_{2}q_{2} ∈ Irr(S) and awy_{1}s_{2}q_{2} ∉ Irr(S). It follows from G_{k}(S) that awy_{1}s_{2}q_{2} = ulv for some (l, r) ∈ S, u, v ∈ M with ul ∈ X^{(k)}L. Now y_{1}s_{2}q_{2} ∉ F implies that y_{1}s_{2}q_{2} is no subtrace of ul. Hence one (maximal) letter of y_{1}s_{2}q_{2} belongs to v ⊆ t, hence ⟨l_{1} ∪ l⟩ ≠ t. Since p_{1} ≠ 1 we also have ⟨l_{2} ∪ l⟩ ≠ t, thus we have t ∉ CT (l_{1}, l_{2}, S). iii) The following algorithm right reduce_{k} is a straightforward generalization of the technique to compute irreducible normal forms for semi-Thue systems, see Sect. 4.1. We simply take the value of k into account in looking for a possible reduction step.

function right reduce_{k} (s:trace):trace var t:trace:=1 while s ≠ 1 do {“loop-invariant: t is irreducible, st is congruent to the input”}

choose some maximal letter a of s; s := sa^{−1}; t := at; for all (l, r) ∈ S do if t ∈ ulM for some u ∈ M, |u| ≤ k

then s := sur; t := (ul)^{−1}t endif

endfor endwhile return t endfunction

It is easy to see that for every noetherian trace replacement system the algorithm terminates on input length n in time O(d_{s}(n)). If in addition the system satisfies G_{k}(S) then the loop invariant holds and therefore right reduce_{k} computes irreducible descendants. Assertion iii) follows. □

In the proof above we used for each k ≥ 0 a different algorithm. In the next section we present a uniform algorithm which works for every noetherian system S and which has the same time bound O(d_{S}) if G_{k}(S) is satisfied for some k ≥ 0. This is clearly a big advantage. The problem of the new algorithm is however that we need a control structure by finite asynchronous automata. This means we have to use a very complex mechanism which leads to high constants. Open problem Is it decidable whether for given finite S ⊆ M × M there exists k ≥ 0 such that G_{k}(S) holds? This question would have an affirmative answer if we could decide for given recognizable trace languages A, B ⊆ M with A ⊆ MB whether there exists a finite set F ⊆ M such that A ⊆ F B. This seems to be an interesting question for recognizable trace languages independent of trace rewriting. It can be solved for regular word languages.

The reason to consider the condition G_{k}(S) for different k ≥ 0 follows from the next proposition:

Proposition 5.6.2 Let k ≥ 0 and M be neither free nor commutative then there exists a length-reducing trace replacement system S ⊆ M × M of at most two rules such that G_{k+1}(S) holds but not G_{k}(S).

Proof: Since M is neither free nor commutative we find three different letters a, b, c ∈ X such that (a, b) ∈ D and (a, c) ∈ I. Consider the system S = {cb ⟹

1, a^{k+2} ⟹ 1}. Then t = ca^{k+1}b ∈ X Irr(S) but neither t = a^{k+1}cb ∈ Irr(S) nor

a^{k+1}cb ∈ X^{(k)}{cb, a^{k+2}}M. Hence G_{k}(S) does not hold whereas it is easy to see that G_{k+1}(S) is true. □

Remark 5.6.3 i) If M is free or commutative then G_{0}(S) holds for every system S ⊆ M × M. We will see in the last section that for one-rule systems G_{k}(S) implies G_{0}(S) for any k ≥ 0. Therefore, the proposition above is tight. ii) In [Ott89] another decidable and sufficient condition is given such that the confluence of finite noetherian trace replacement systems becomes decidable. The approach of Otto is based on the notion of convergence and coherence for term rewriting systems which was developped by Jouannaud, [Jou83]. Inspecting Otto’s condition it turns out to be equivalent with confluence in our sense and G_{0}(S). Since G_{0}(S) implies G_{k}(S) for all k ≥ 0 and any G_{k}(S) implies the finiteness condition given in Corollary 5.3.12, but non of these implications is reversible, our condition is clearly weaker. Furthermore our approach has the advantage of staying entirely in the theory of traces.

5.7 An Efficient Algorithm for Computing Irreducible Normal Forms

In this section we present an algorithm which computes always irreducible normal forms in time O(d_{S}^{2}) but which has the property that whenever the system satisfies G_{k}(S) for some k ≥ 0 then it works in time O(d_{S}). From this viewpoint it is the best known algorithm in this area. The implementation of the algorithm depends essentially on the existence of finite asynchronous automata which were introduced in [Zie87]. The proof that every recognizable trace language is accepted by such automaton has been quite involved, see Sect. 2.4 and the resulting constants are extremely high. So, in practice it might be necessary to work with “less optimal” algorithms. But may be a better understanding of asynchronous automata will change the situation.

The algorithm we are going to construct is based on a notion of protocols which is available for asynchronous automata, but not for usual finite Mautomata. In fact, we shall use asynchronous cellular automata. It is done here to have smaller state sets. Let us briefly recall the definition.

A finite M-automaton U = (Z, δ, q_{0}, F) (where Z denotes the finite state set, δ : Z × M → Z is the (partially defined) transition mapping, q_{0} ∈ Z is the initial state, and F ⊆ Z is the set of final states) has been called asynchronous cellular if the following conditions hold:

1) The state set Z is a cartesian product Z = ∏_{x∈X} Z_{x}

2) The partially defined transition mapping δ is given by a collection of partial

mappings

{δ_{a} : ( ∏_{b∈D(a)} Z_{b}) → Z_{a} | a ∈ X}

where D(a) = {b ∈ X | (a, b) ∈ D} for a ∈ X.

3) For all traces t ∈ M the state δ(q_{0}, t) is defined.

Condition 2) means that for all a ∈ X and (z_{x})_{x∈X} ∈ ∏_{x∈X} Z_{x} the next-state δ((z_{x})_{x∈X}, a) is defined if and only if δ_{a}((z_{b})_{b∈D(a)}) is defined. In this case we have δ((z_{x})_{x∈X}, a)_{y} = z_{y} for y ≠ a and δ((z_{x})_{x∈X}, a)_{a} = δ_{a}((z_{b})_{b∈D(a)}). Condition 3) is included for technical reasons only.

Let U = (∏_{a∈X} Z_{a}, δ, q_{0}, F) be a asynchronous cellular automaton. A protocol of U is an element of the product space ∏_{a∈X}(Z_{a}^{+}) which are inductively defined as follows:

The element q_{0} ∈ ∏_{x∈X} Z_{x} ⊆ ∏_{x∈X}(Z_{x}^{+}) is a protocol. If p ∈ ∏_{x∈X}(Z_{x}^{+}) is a protocol and a ∈ X is a letter then the protocol ap is defined as follows: Take q ∈ ∏_{x∈X} Z_{x} such that p = qp′ for some p′ ∈ ∏_{x∈X} Z_{x}^{∗}. Then compute δ(q, a)_{a} ∈ Z_{a} and multiply this state from the left to the a-component of p, the other components are unchanged. The reason that we build up protocols from right-to-left is that we view protocols contained in a stack and we follow the convention that the top of a stack is on the left-hand side. It follows from the definition that if t ∈ M is a trace then p = tq_{0} denotes a well-defined protocol with p ∈ ∏_{x∈X} Z_{x}^{+}. The crucial point is that if p = tq_{0} is a protocol and t = at′ for some t′ ∈ M, a ∈ X then the protocol t′q_{0} can be computed from tq_{0} in constant time by erasing the left most state in the a-component of the protocol tq_{0}. More generally, if p = tq_{0} and t = uv then we may compute the protocol vq_{0} starting from p in |u|-steps. We also shall write u^{−1}p to denote the protocol vq_{0} if p = uvq_{0}. This is the same convention as for traces: if t = uv then u^{−1}t denotes the trace v.

If U = (∏_{x∈X} Z_{x}, δ, q_{0}, F) is a finite asynchronous cellular automata then a protocol p ∈ ∏_{x∈X} Z_{x}^{+} is called final if p = zp′ for some z ∈ ∏_{x∈X} Z_{x}, p′ ∈ ∏_{x∈X} Z_{x}^{∗} with z ∈ F. (We could also view ∏_{x∈X} Z_{x}^{+} as a state set of an infinite asynchronous cellular automata where M operates on the left). We are now ready to prove the following result.

Theorem 5.7.1 There is a construction giving on input a finite noetherian trace replacement system S ⊆ M × M an algorithm right reduce_{∞} which satisfies the following assertions:

i) It holds right reduce_{∞}(s) ∈ Irr(S) for all s ∈ M and right reduce_{∞} terminates in time O(d_{S}^{2}).

ii) For some systems S ⊆ M × M the worst-case behavior of right reduce_{∞} is Θ(d_{S}^{2}).

iii) Whenever S ⊆ M × M satisfies G_{k}(S) for some k ≥ 0 then right reduce_{∞} terminates in time O(d_{S}).

Proof: For S ⊆ M × M let U = (∏_{x∈X} Z_{x}, δ, q_{0}, F) be a finite asynchronous cellular automaton which recognizes the set of reducible traces if they are read from right-to-left. A protocol means an element p ∈ ∏_{x∈X} Z_{x}^{+} as defined above. Define the algorithm right reduce_{∞} as follows

function right reduce_{∞} (s:trace):trace var t:trace:=1; var p:protocol:=q_{0}; while s ≠ 1 do choose some a ∈ X which is maximal in s;

s := sa^{−1}; t := at; p := ap; (“time: O(1)”) if p is a final protocol (“recall that p is final if and only if t is reducible, time: O(1)”) then compute some u ∈ M of minimal length such that t = ulv for some (l, r) ∈ S, v ∈ M; (“It is crucial that |u| is minimal and to note that this can be done in time O(|u|). Note also that we must have l ∈ aM, hence v = (ul)^{−1}t ∈ Irr(S) ”) s := sur; t := (ul)^{−1}t; p := (ul)^{−1}p; (“time: O(|u|)”) endif

endwhile return t endfunction.

It is easy to verify the correctness of the algorithm, i.e., right reduce_{∞}(s) ∈ Irr(S) for all s ∈ M, by the following loop-invariants: st is a descendant of the input trace, t is irreducible and p is the protocol tq_{0}. For the time complexity see the comments above. Two points are important: First, the “if-test” can be performed in constant time. This means we try to find a left-hand side inside (the stack) t only if we know that such a left-hand side exists. This was the only reason to work with asynchronous or asynchronous cellular automata. Second, the factorization t = ulv for some u, v ∈ M, (l, r) ∈ M with |u| minimal can be performed in O(|u|) steps. This can be seen, for example, from the representation of a trace as a tuple of words. Now, if the system S satisfies G_{k}(S) for some k ≥ 0 then we will have O(|u|) = O(1). This proves iii). Assertion i) is obvious since we do not enter the then-part of the while-loop if t is an irreducible trace. Assertion ii) is shown in the following example. □

Example: Let (X, D) be given by the graph a−b−c−d. Consider the following special trace replacement system S = {bc ⟹ 1, ad ⟹ 1}. This system is confluent and the function d_{S} is linear. Independently of implementation details the worst-case behavior of the algorithm right-reduce_{∞} above will be Θ(n^{2}).

Indeed, consider an input trace of the form s = (ab)^{n}c^{n}d^{n}. Of course, s reduces to the empty trace. But the algorithm right-reduce_{∞} will perform Θ(n^{2}) times the while-loop. Thus, the time complexity of the algorithm can not be better than Θ(n^{2}) even if the whole while-loop could always be performed in constant time. □

5.8 Cones and Blocks

The property G_{k}(S) of a noetherian trace replacement system is global on the left-hand sides. In particular, we can not check it locally and for large systems it may become very hard to decide whether G_{k}(S) holds for some given k ≥ 0. Furthermore the property is not stable with respect to subsystems. This means if we delete rules from the system then it can be destroyed. Deletion of rules occurs during the normalization process of complete systems which is extremely important to have small systems. Therefore it is desirable to have systems satisfying the property G_{k}(S) locally on each rule. Thus, we are interested in systems such that for some k ≥ 0 we have for each left-hand side l the following local property L_{k}(l) : X(M\MlM) ⊆ MlM ∪ X^{(k)}lM.

Note that this is exactly the restriction of the property G_{k} to each one-rule subsystem. The first observation is that it is now superfluous to consider different k. Indeed let l, t ∈ M = M(X, D) be traces, a ∈ X be a letter such that l ⊆ at is a subtrace, but l is no subtrace of t. If we can not write at = lt′ for some t′ ∈ M then there must be a minimal letter x of t such that a and x are independent but xl ≠ lx.

In this case l is not a subtrace of x^{k}t for any k ≥ 0 and if we factorize ax^{k}t = ulv then we must have u = x^{k+1} and v = 1. Thus, if l does not satisfy L_{0}(l) then L_{k}(l) is false for every k ≥ 0. This fact was already mentioned in Remark 5.6.3 i). We will see in this section that traces satisfying L_{0} have a nice geometric characterization as cones or blocks and that the confluence of noetherian systems where every left-hand side is a cone or a block can be decided on the basic critical pairs.

Definition: Let (X, D) be a finite dependence alphabet.

i) A trace l ∈ M(X, D) is called a cone if every letter x ∈ X which is dependent on any letter of l is dependent on all minimal letters of l.

ii) A trace l ∈ M(X, D) is called a block if every minimal letter of l commutes with l and every other letter x ∈ X which does not commute with l is dependent on all letters in l.

It follows from the definition that a non-empty cone has exactly one minimal element. (In particular, it is a pyramid in the sense of [Vie86, Def. 5.9].) In the following this minimal element is called the top of the cone. Every element of the cone is dependent on its top, therefore cones are connected traces. The top determines the whole dependence relation since a letter x ∈ X is independent of a cone if and only if it is independent of the top. More precisely, let l ⊆ t be a subtrace which is a non-empty cone with top a. Then with respect to t it holds pre(a) = pre(l), ind(a) = ind(l) and suf(a) = (l \ {a}) suf(l). Trivial examples of cones are words in a free monoid. On the other hand, vectors in a free commutative monoid are typical examples of blocks. A block l may have several minimal elements, it is never connected unless l = a^{n} for some a ∈ X, n ≥ 0. This follows since a letter x ∈ X commutes with a trace l if and only if x and l are independent or x is a letter of the alphabet of l and all other letters of alph(l) are independent of x. In particular, every block l has the form l = ∏_{a∈F} a^{n_{a}} where F ⊆ X is a subset of pairwise independent letters, and n_{a} ≥ 1

for all a ∈ F. Thus, a trace l is both, a cone and a block, if and only if l = a^{n} for some a ∈ X, n ≥ 0.

The question whether a trace is a cone (a block respectively) is clearly decidable. But observe that the answer to this question depends on the whole dependence alphabet, not only on the alphabet of the trace.

Example: Let t, l be the traces as in Figure 5.3. Then t is a cone and l is a block over the dependence alphabet A. But neither t is a cone nor l is a block over the dependence alphabet B.

Theorem 5.8.1 Let (X, D) be a finite dependence alphabet and l ∈ M(X, D) be a trace. Then the following assertions are equivalent:

i) For every letter a ∈ X and every trace t ∈ M(X, D) where l is a subtrace of at it holds that l is a subtrace of t or it holds at = lt′ for some t′ ∈ M(X, D).

ii) For all letters x ∈ X we have xl = lx or (x, y) ∈ D for all minimal letters y of l.

iii) The trace l is a cone or a block.

Proof: i) ⇒ ii): Let x ∈ X be a letter which is independent of some minimal letter a ∈ min(l). Consider the trace t = x(l \ {a}), then l is no subtrace of t, but l is a subtrace of at. Hence at = lt′ for some t′ ∈ M. But this implies x = t′ and xl = lx.

ii) ⇒ i): Let a ∈ X, t ∈ M such that l is a subtrace of at but not of t. Let l′ = l ∩ t in at, then al′ = l and t = ul′u′ for some u ⊆ t such that every x ∈ u is independent of a; hence by ii) we have xl = lx for every x ∈ u. Since ul = lu implies ul′ = l′u, we obtain at = aul′u′ = al′uu′ = luu′.

ii) ⇒ iii): Assume that l is not a cone. Then there exist elements x ∈ X, a ∈ l and a minimal element y ∈ min(l) such that (a, x) ∈ D and (x, y) ∉ D. By ii) we obtain lx = xl. Since x is not independent of l, we have x ∈ min(l). Since (x, y) ∉ D, there are at least two different minimal letters in l. Applying ii) again, we see that every minimal letter in l commutes with l and that l must be a block.

iii) ⇒ ii): If l is a block then ii) follows trivially. Hence, we may assume that l is a non-empty cone. Let {a} = min(l) be the top of the cone and let x ∈ X be any letter such that x is independent of a. Then x is independent of l, hence xl = lx.

The equivalence of i), ii) and iii) is thereby shown. □

[figure: t =; b; a; c; l =; b; c]

[figure: alphabet A :; a; c; b; d]

[figure: alphabet B :; a; c; e; b; d]

Figure 5.3. A cone t and a block l over A but not over B

Corollary 5.8.2 Let S ⊆ M × M be a finite confluent weight-reducing replacement system over a trace monoid M such that every left-hand side is a cone or a block. Then the word problem of the monoid M/S is decidable in linear time. □

Remark 5.8.3 i) The previous corollary is a special case of Theorem 5.6.1. Already in this form it is a generalization of [Boo82, Thm. 4.1] since it applies to semi-Thue systems. It generalizes also the result of C. Wrathall [Wra88] on free partially commutative groups.

ii) The well-known result that each finitely generated commutative monoid has word problem decidable in linear time, [Lai67], [FMR68], may be derived from the corollary above as follows: Consider a commuative monoid A on k generators. Let γ_{0} : IN^{k} → IN be the length-function and γ_{i} : IN^{k} → IN be the ith projection, i = 1, …, k. The lexical ordering of IN^{k} is defined by setting u ≻ v for u, v ∈ IN^{k} if for some i ∈ {0, …, k} it holds γ_{j}(u) = γ_{j}(v) for j = 0, …, i − 1 and γ_{i}(u) > γ_{i}(v). Using Knuth-Bendix completion, the monoid A is presentable by some finite complete vector replacement system S ⊆ IN^{k} × IN^{k} such that l ≻ r for all (l, r) ∈ S, see Corollary 5.1.4, [Buc70], [Gil71] or [BL81]. Since S is finite we effectively find positive integers a_{0} ≥ a_{1} ⋯ ≥ a_{k−1} ≥ a_{k} = 1 such that γ(l) > γ(r) for all (l, r) ∈ S where γ : IN^{k} → IN denotes the weight function γ = a_{0}γ_{0} + ⋯ + a_{k}γ_{k}. This can be seen by induction on k. The value of a_{0} is computed at last. The system S is a weight-reducing trace replacement system and every left-hand side of S is a block. Hence every finitely generated commutative monoid is presentable by such a system. Note that we consider only non-uniform word problems whereas the complexity of the uniform word problem, in which the defining relations as well as the words are regarded as instances of the problem, requires already exponential space for commutative semigroups by a result of [MM82].

We already know from Theorem 5.6.1 that we can decide the confluence of a finite noetherian system if all left-hand sides are cones and blocks. In this special case the decision procedure can be considerably simplified.

We need some preparation. We first consider the situation where a trace t contains two subtraces l_{1}, l_{2} being cones or blocks. We distinguish three cases: 1): both subtraces are cones; 2): one is a cone and the other subtrace is a block; and 3): both are blocks.

Lemma 5.8.4 (Cone-cone-case) Let M = M(X, D) be a trace monoid and let l_{1} ⊆ t, l_{2} ⊆ t be subtraces of a trace t. Assume that l_{1} and l_{2} are cones. Then it holds:

i) If l_{1} ∩ l_{2} = ∅ then l_{1} and l_{2} are strictly separated.

[figure: t =; a_{1}; a_{2}; or; t =; a_{1}; a_{2}]

Figure 5.4. Cones with non-trivial intersection

ii) If l_{1} ∩ l_{2} ≠ ∅ then there is no letter between l_{1} and l_{2}; i.e., l_{1} ∪ l_{2} is a subtrace of t. This subtrace is a cone and the top of l_{1} is contained in l_{2} or vice versa.

Proof: We may assume l_{1} ≠ ∅ and l_{2} ≠ ∅. Let a_{1} be the top of l_{1} and a_{2} be the top of l_{2}. If l_{1} ∩ l_{2} = ∅ and l_{1}, l_{2} would be not strictly separated then the tops a_{1}, a_{2} would be not strictly separated, too. But this is clearly impossible. Therefore, we are reduced to prove ii). If l_{1}∩l_{2} ≠ ∅ then a_{1} and a_{2} are dependent, say a_{1} ≤ a_{2}. If a_{2} would not be contained in l_{1}, then we would have a_{1} < a_{2} < b for each b ∈ l_{1} ∩ l_{2}. This contradicts the fact that l_{1} is a subtrace; hence we may assume a_{2} ∈ l_{1}. But then it is clear that there is no letter between l_{1} and l_{2} and that l_{1} ∪ l_{2} is a cone. □

If t ∈ M is a trace with two subtraces l_{1} ⊆ t, l_{2} ⊆ t, l_{1} ∩ l_{2} ≠ ∅ and l_{1}, l_{2} are cones then we may represent this situation by Figure 5.4.

Lemma 5.8.5 (Cone-block-case) Let M = M(X, D) be a trace monoid and l_{1} ⊆ t, l_{2} ⊆ t be subtraces of a trace t ∈ M. Assume that l_{1} is a cone and that l_{2} is a block. Then it holds:

i) If l_{1} ∩ l_{2} = ∅ then l_{1}, l_{2} are strictly separated.

ii) If l_{1} ∩ l_{2} ≠ ∅ then every letter between l_{1} and l_{2} is behind l_{1} and before l_{2}. Furthermore every such letter belongs to the alphabet of l_{2} and it is not equal to the top of l_{1}.

Proof: We may assume that l_{1} is a non-empty cone with top a.

i) Let l_{1} ∩ l_{2} = ∅. If l_{1}, l_{2} were not strictly separated then we would have pre(l_{1}) ∩ l_{2} ≠ ∅ and suf(l_{1}) ∩ l_{2} ≠ ∅. But this implies pre(a) ∩ l_{2} ≠ ∅ and suf(a) ∩ l_{2} ≠ ∅ which contradicts the subtrace property of l_{2}.

[figure: t =; b; b; a; b; c]

Figure 5.5. A cone and a block with non-trivial intersection and a letter between them

ii) Let b ∈ l_{1} ∩ l_{2} and x be a letter between l_{1} and l_{2}. Since x is independent of b ∈ l_{2} and there is a path between x and some letter of the block l_{2}, we have x ∈ alph(l_{2}). A simple observation yields that x depends on the top a of l_{1}. But then x ∈ suf(a) since otherwise there would be a path from x to b. Hence we have x ∈ suf(l_{1}) ∩ pre(l_{2}). Finally, since a depends on b but x is independent of b, the letters x and a are different.

Example: Let (X, D) be the dependence alphabet b — a — c. Then l_{1} = abc is a cone but not a block, l_{2} = bc is a block. Both traces are subtraces of t = ab^{3}c with non-trivial intersection (l_{2} is a subtrace three times). In one case it happens that there is a letter behind l_{1} and before l_{2}. This is shown in Figure 5.5. □

Lemma 5.8.6 (Block-block-case) Let M = M(X, D) be a trace monoid and l_{1} ⊆ t, l_{2} ⊆ t be subtraces of a trace t ∈ M which are not strictly separated blocks. Then alph(l_{1}) ∩ alph(l_{2}) ≠ ∅ and the generated subtrace ⟨l_{1} ∪ l_{2}⟩ is a block with alph(⟨l_{1} ∪ l_{2}⟩) = (alph(l_{1}) ∪ alph(l_{2})).

Proof: Let x, y, z ∈ t such that x ≤ y ≤ z and x ∈ l_{1}, z ∈ l_{2}. If we would have y ∉ (alph(l_{1}) ∪ alph(l_{2})) then we would have l_{1} ⊆ pre(y) and l_{2} ⊆ suf(y). Hence, l_{1}, l_{2} would be strictly separated. Since this has been excluded we have alph(⟨l_{1} ∪ l_{2}⟩) = alph(l_{1}) ∪ alph(l_{2}). If we would have alph(l_{1}) ∩ alph(l_{2}) = ∅ then l_{1}, l_{2} would also be strictly separated. Hence, the intersection is not empty and it also follows that ⟨l_{1} ∪ l_{2}⟩ constitutes a block in t. □

Example: Let X = {a, b, c} where a, b, c are pairwise independent. Let t = a^{3}bc^{3} and l = abc. We may realize l as a subtrace l_{1} of t, for example, by

[figure: c; c; c; ←; ←; b; a; a; a; →; →]

Figure 5.6. Two blocks not strictly separated with non-trivial intersection and letters between them

taking the first a, the only b and the last c of t or as a subtrace l_{2} by taking the last a, the only b and the first c of t. In this case the blocks l_{1}, l_{2} have non-trivial intersection, there is a letter before l_{1} and behind l_{2} and a letter before l_{2} and behind l_{1}. This is shown in Figure 5.6.

We have seen in the lemmata above that there may exist traces t = ⟨l_{1} ∪ l_{2}⟩ such that not strictly separated subtraces l_{1} ⊆ t, l_{2} ⊆ t are cones or blocks. It may occur that t contains a letter between l_{1} ⊆ t l_{2} ⊆ t if one subtrace, say l_{2}, is not a cone. In all these cases however, pre(l_{2}) has a maximal letter which belongs to alph(l_{2}) and hence which commutes with l_{2}. Now, we have seen in Corollary 5.3.10 that these cases can be excluded from the test of confluence. This leads to the following main theorem on cones and blocks.

Theorem 5.8.7 Let S ⊆ M × M be a noetherian trace replacement system over M = M(X, D) such that every left-hand side of S is a cone or a block. Then the system is confluent if and only if the following two conditions hold:

i) The pair (ar, ra) is confluent for all a ∈ X, (l, r) ∈ S such that al = la.

ii) The pair (r_{1}v, ur_{2}u′) is confluent for all (l_{1}, r_{1}), (l_{2}, r_{2}) ∈ S, u, u′, v ∈ M such that:

1) l_{1}v = ul_{2}u′ and every letter of this trace belongs to l_{1} or to l_{2},

2) the traces v and u′ are independent,

3) |v| < |l_{2}|,

4) no maximal letter of u commutes with l_{2}, 5) if l_{1}, l_{2} are blocks then we have u = 1,

6) if l_{1} is a block and l_{2} is a cone but not a block then we have v = 1 or u′ = 1.

Proof: Clearly, if S is confluent then i) and ii) hold. For the reverse we may apply Corollary 5.3.10. Thus, by i) it is enough to show the confluence of pairs (t_{1}, t_{2}) = (pre(l_{1})r_{1} ind(l_{1}) suf(l_{1}), pre(l_{2}r_{2} ind(l_{2}) suf(l_{2})) which result from

t_{1} ⟸_{(l_{1},r_{1})} t ⟹_{(l_{2},r_{2})} t_{2} such that t = ⟨l_{1} ∪ l_{2}⟩, l_{1} ⊆ t, l_{2} ⊆ t are not strictly separated

and no maximal letter of pre(l_{i}) commutes with l_{i}, i = 1, 2. We directly see from the three lemmata above that every letter of t belongs to l_{1} or l_{2}. This means that (r_{1}v, ur_{2}u′) is a basic critical pair.

Now we distinguish several cases: I) The subtraces l_{1} ⊆ t, l_{2} ⊆ t are blocks. This is the easiest case. It follows from Lemma 5.8.6 that t = ⟨l_{1} ∪ l_{2}⟩ is a block of pairwise commuting elements. This implies pre(l_{1}) = pre(l_{2}) = 1. Therefore t = ⟨l_{1} ∪ l_{2}⟩ is the uniquely determined minimal trace containing l_{1} and l_{2}. Let l_{1} = ∏_{a∈F_{1}} a^{m_{a}}, l_{2} = ∏_{a∈F_{2}} a^{n_{a}} then we may write t = ∏_{a∈F_{1}∪F_{2}} a^{max(m_{a},n_{a})}. The formula 1) - 6) are obvious from this description. II) One subtrace is a block the other one is a cone and not a block. Assume first that there is some element before the cone which is not a block. Let l_{2} be the cone and l_{1} be the block. The top of l_{2} is in l_{1} ∩ l_{2} because otherwise l_{1}, l_{2} would be strictly separated. It follows pre(l_{2}) = a^{k} for some k ≥ 1 and {a} = top(l_{2}). Since l_{2} is not a block there is some letter b ∈ alph(l_{2}) with a ≠ b and (a, b) ∈ D. Hence there can be no other letter c ∈ alph(l_{1}) with a ≠ c, because otherwise (b, c) ∈ D, since l_{1} is a block and then, (a, c) ∈ D, since l_{2} is a cone. But we must have (a, c) ∉ D since l_{1} is a block. We conclude l_{1} = a^{n} for some n > k, l_{2} = a^{n−k}v for some v ∈ M and t = l_{1}v = a^{k}l_{2}. Since al_{2} ≠ l_{2}a the assertions 1)

- 6) are easily verified.

Thus, we may assume that there is no element before the cone. Now, switch the notation of the subtraces. Let l_{1} be the cone and l_{2} be the block. If l_{2} is contained in l_{1} then the formulae follow with v = 1. If l_{2} is not contained in l_{1} then we have ind(l_{1}) = ∅. We may write t = l_{1} suf(l_{1}) = pre(l_{2})l_{2} ind(l_{2}) suf(l_{2}). Setting v = suf(l_{1}), u = pre(l_{2}), u′ = ind(l_{2}) suf(l_{2}) we obtain formulae 1) - 6). A trace t where suf(l_{1}), pre(l_{2}), ind(l_{2}) and suf(l_{2}) are all non empty is shown in Figure 5.7. III) Both subtraces l_{1}, l_{2} are cones without being blocks. By Lemma 5.8.4 we know that t = ⟨l_{1} ∪ l_{2}⟩ = l_{1} ∪ l_{2} is a cone. The top of t is the top of l_{1} or of l_{2}, say of l_{1}. Then we have pre(l_{1}) = ind(l_{1}) = ∅. We may write t = l_{1} suf(l_{1}) = pre(l_{2})l_{2} ind(l_{2}) suf(l_{2}). Since suf(l_{1}) ⊆ l_{2} the independence of suf(l_{1}) and suf(l_{2}) follows. Hence we obtain the formulae 1) - 6) with v = suf(l_{1}), u = pre(l_{1}), u′ = ind(l_{2}) suf(l_{2}). This concludes the proof. A trace t containing two cones

[figure: a; d; c; b; c]

Figure 5.7. A trace containing a cone l_{1} = abc^{2}, a block l_{2} = cd such that suf(l_{1}) = d, pre(l_{2}) = a, ind(l_{2}) = b, suf(l_{2}) = c.

where suf(l_{1}), pre(l_{1}) ind(l_{2}), and suf(l_{2}) are all non-empty is shown in Figure 5.8. □

Our considerations were based on the question when we can compute irreducible normal forms from right to the left. Of course, there is no mathematical reason for such a preference. We could also work in the other direction. This leads to a dual definition of a cone: We say that l is a reverse cone if rev(l) is a cone, where rev(l) means the trace which is defined by reversing the ordering in the labelled partial order of l. Using reverse cones instead of cones we obtain completely analogous results. In particular, the last theorem has the following immediate consequence:

Corollary 5.8.8 Let S ⊆ M ×M be a finite noetherian trace replacement system such that all left-hand sides are cones (reverse cones respectively) or blocks. Then it is decidable whether S is confluent on its set of basic critical pairs BCP (S). □

[figure: a; c; e; b; d]

Figure 5.8. A trace containing two cones l_{1} = abcd, l_{2} = ce such that suf(l_{1}) = e, pre(l_{2}) = a, ind(l_{2}) = b, and suf(l_{2}) = d.

Examples:

i) Let (X, D) = a  g  b ; | ; c  , and

S = {gab ⟹ gc, abc ⟹ c^{2}}

Then gab is a cone and abc is a block. According to Theorem 5.8.7 only one critical pair occurs, which is trivially confluent:

gc^{2} ⟸_{(gab,gc)} a ⟵ g ⟶ c ; ↓ ; b ⟹_{(abc,c^{2})} gc^{2}

Hence S is finite length-reducing confluent system. We may solve the word problem of S in linear time using the function right reduce_{0}.

ii) Let (X, D) be as above and

S = {ag⟹gb, bg⟹ga, cg⟹gc, g^{2} ⟹ 1, abc ⟹ 1}.

Then ag, bg, cg, g^{2} are reverse cones and abc is a block. It is easily checked that S is noetherian. By Corollary 5.8.8 we see that all critical pairs of S are confluent. Hence S is a finite complete system. It is a symmetric version of an example which was used earlier in the section of the completion procedure on traces. Since Condition G_{0}(S) holds, right reduce_{0}(s) is irreducible for all traces s ∈ M(X, D).

Although S is not weight-reducing for any weight function γ : X → IN, a simple reflection yields that right reduce_{0} computes irreducible normal forms in linear time. It is remarkable that an analogous function left reduce, which works from the left to the right, needs square time in this case.

iii) The example above is a special case of the following group theoretical situation: Let G be a finitely generated group with an abelian normal subgroup A such that the quotient group E = G/A is finite. Let {a_{1}, …, a_{k}} be a set of generators of A and for each g ∈ E let s_{g} be a representative in G. Then A has a presentation by some finite complete weight-reducing vector replacement system S = IN^{k} × IN^{k} and E has a presentation by its multiplicative table. The relations for G are given by the system S and additional equations of the form:

\begin{aligned}s_{g}s_{h} & = & s_{gh}δ(g, h) & , g, h ∈ E, δ(g, h) ∈ A, \\ as_{g} & = & s_{g}a^{g} & , g ∈ E, a, a^{g} ∈ A. \end{aligned}

This leads to a finite trace replacement system over the free partially commutative monoid M = IN^{k} ∗ {s_{g}; g ∈ E}^{∗} as follows:

\begin{aligned}T & = & S ∪ \{s_{g}s_{h} ⇒ s_{gh}δ(g, h); g, h ∈ E\} \\ & & ∪\{a_{i}s_{g} ⇒ s_{g}a_{i}^{g}; g ∈ E, i = 1, …, k\}. \end{aligned}

The system T is complete and it defines the group G. The left-hand sides of T are blocks if they belong to S and reverse cones otherwise. The function right reduce_{0} computes irreducible normal forms in linear time. Hence the word problem of G is solved in linear time using the system T. Note that we can not expect to find a finite complete semi-Thue system over the set of generators {a_{1}, …, a_{k}} ∪ {s_{g}; g ∈ E} which defines G. This fails already in the case where E is trivial. Thus the use of traces is essential here.

It is open whether one can join cones and reverse cones into a common concept. But this might be difficult. May be it is impossible. Some problems may be seen in Figure 5.9. In this picture l_{1} = gbc denotes a cone, l_{2} = bcg is a reverse cone, l_{1} and l_{2} have non-trivial intersection, but there is a letter between them. We conclude our investigation on traces with this picture. It stands for one of the basic phenomena we met in this theory.

[figure: g; c; b; a; g]

Figure 5.9. A trace containing a cone gbc a reverse cone bcg and with a letter a between them 152 5. Trace Replacement Systems

Conclusion and Outlook

There are basic requirements which should be satisfied by a reasonable model of parallelism. The model should be general enough to cover a large variety of aspects of concurrency. It should be semantically faithful in the sense that essential features are retained. Furthermore, it has to be simple enough such that we are able to understand it; and it must allow efficient computations.

Since these requirements are in general contradictory, we have to compromise. In these notes we have studied Mazurkiewicz-traces, i.e., elements of free partially commutative monoids, as models of parallelism. A trace describes the inherent dependence structure of a concurrent process. Since traces are graphs, they allow to visualize the behaviour of a process immediately. On the other hand, the embedding of traces in a simple algebraic structure leads to efficient algorithms.

Many problems of parallelism can be stated and investigated in terms of traces. Even problems of deadlock and fairness can be studied when infinite traces are used, see [FR85]. The development of further interrelations between concurrency and trace theory is a challenging program.

Our contribution has been mainly concerned with that part of the program which is related to net theory and replacement systems, proving various new results in this area.

The application to net theory has been based on the introduction of local morphisms between Petri nets. We showed thereby that traces are a helpful tool for Petri nets in general and that, from an operational viewpoint, their use is not limited to safe nets.

Local morphisms help to build up Petri net languages in a modular way. Future research should extend this approach. For example: is it possible to apply it to the reachability problem of Petri nets? The decidability of that problem has been shown by E. Mayr, see [May84]. But up to now, the known proofs are rather involved, see also [Kos84], [Reu89]. It would be interesting to know whether our techniques could yield a simplified proof.

For that we probably need a better insight into synchronizations of trace languages. Here, we have settled the question when the synchronization has a local description. We have seen that the answer to that question is Co-NP-complete, but in restricted cases we have tractability.

Since a static description of concurrent processes is insufficient, we have introduced replacement systems over traces. This has increased the flexibility enormously. Trace replacement systems provide us with an abstract calculus for transformations on concurrent processes. We hopefully think that this part of the theory will lead us directly to practical applications.

However, because of the novelty of the theory of trace replacement systems many important and interesting questions are still open. We paid the main attention to complete systems and to critical pairs. We have given some sufficient conditions for a finite system to have a finite set of critical pairs, and we have given an upper bound for their number under that condition.

Weaker conditions would be desirable; and the calculation of an upper bound should be improved by a more sophisticated analysis. Both is of high interest for an effective use of the Knuth-Bendix completion over traces.

The Knuth-Bendix procedure is a method for the construction of complete systems. The interest in these systems results from the solvability of their word problem. In order to have really efficient solutions one has to put further restrictions on complete systems. Such a restriction is a weight reduction. We have seen that a finite confluent weight reducing trace replacement system has a word problem solvable in square time. On the other hand, the restriction to semi-Thue systems or vector replacement systems allows linear time. We have extended the linear time results to systems which satisfy a certain global condition on their left-hand sides. This approach includes systems where all left-hand sides are cones and blocks. It is open whether this limitation can be weakened substantially.

Another open question concerns decidability of confluence. It is shown in [NO88] that the confluence of lenght-reducing trace replacement systems is recursively unsolvable. But we do not know whether it is solvable for monadic or special systems, which seems to be a difficult question.

Besides its connection to parallelism, trace theory is also of interest from a purely mathematical viewpoint. Many identities in combinatorics are based on Möbius inversion. Möbius functions for free partially commutative monoids have been studied since the very beginning of that theory, see [CF69]. Here we have settled a conjecture on Möbius functions with the help of complete semi-Thue systems thereby establishing a new bridge between formal power series and semi-Thue systems. Since both, formal power series and semi-Thue systems, are active areas of research in computer science this bridge is very promising and it should be investigated in more detail.

This shows that the current developments in the theory of traces lead into various directions. In fact, the wide range of the theory made it impossible to cover all aspects. For example we have not treated semi-commutation, infinite traces, probabilistic analysis, context free trace languages, connections between recognizability and monadic second order logic, etc. Some open problems in these areas can be found in [Die90b] where a list of research topics has been collected from several authors on occasion of an international workshop organized by the ESPRIT Basic Research Action No. 3166 ASMICS, [Die90c].

The different perspectives of free partially commutative monoids make trace theory very attractive. We have no doubt that traces will be of continuous interest and importance.

156 Conclusion and Outlook

Bibliography

[AH87] I.J. Aalbersberg and H.J. Hoogeboom. Decision problems for regular trace languages. In Th. Ottmann, editor, Proceedings of the 14th International Colloquium on Automata, Languages and Programming (ICALP’87), Karlsruhe (FRG) 1987, Lecture Notes in Computer Science 267, pages 250–259. Springer, Berlin-Heidelberg-New York, 1987.

[AR86] J. Aalbersberg and G. Rozenberg. Theory of traces. Report 86-16, University of Leiden (The Netherlands), Vakgroep Informatica, 1986.

[AR88] I.J. Aalbersberg and G. Rozenberg. Theory of traces. Theoret. Comput. Sci., 60:1–82, 1988.

[AW86] I.J. Aalbersberg and E. Welzl. Trace languages defined by regular string languages. R.A.I.R.O.-Informatique Théorique et Applications, 20:103– 119, 1986.

[BBMS81] A. Bertoni, A. Brambilla, G. Mauri, and N. Sabadini. An application of the theory of free partially commutative monoids: asymptotic densities of trace languages. In J. Gruska et al., editors, Proceedings of the 10th Symposium on Mathematical Foundations of Computer Science (MFCS’81), Strbske’ Pleso (CSSR) 1981, Lecture Notes in Computer Science 118, pages 205–215. Springer, Berlin-Heidelberg-New York, 1981.

[BD88] L. Bachmair and N. Dershowitz. Critical pair criteria for completion. J. Symbolic Computation, 6:1–18, 1988.

[BL81] A.M. Ballantyne and D.S. Lankford. New decision algorithms for finitely presented commutative semigroups. Comput. and Maths. with Appls., 7:159–165, 1981.

[BL87] R. Book and H.-N. Liu. Rewriting systems and word problems in a free partially commutative monoid. Inform. Proc. Letters, 26:29–32, 1987.

[BO84] G. Bauer and F. Otto. Finite complete rewriting systems and the complexity of the word problem. Acta Inf., 21:521–540, 1984.

[Boo82] R. Book. Confluent and other types of Thue systems. J. Assoc. Comput. Mach., 29:171–182, 1982.

[Bra76] W. Brauer. W-automata and their languages. In A. Mazurkiewicz, editor, Proceedings of the 5th Symposium on Mathematical Foundations of Computer Science (MFCS’76), Gdansk (Poland) 1976, Lecture Notes in Computer Science 45, pages 12–22. Springer, Berlin-Heidelberg-New York, 1976.

[Buc70] B. Buchberger. An algorithm for finding basis a for the residue class ring of a zero dimensional poynomial ideal. aequ. math., 4:374–383, 1970. (Ph.D. Thesis Univ. Innsbruck 1965).

[Buc85] B. Buchberger. Basic features and development of the criticalpair/completion procedure. In J.-P. Jouannaud, editor, Proceedings of Rewriting Techniques and Applications (RTA’85), Dijon (France) 1985, Lecture Notes in Computer Science 202, pages 1–45. Springer, Berlin-Heidelberg-New York, 1985.

[Cei58] G.S. Ceitin. An associative calculus with an insoluble problem of equivalence. Trudy Mat. Inst. Steklov, 52:172–189, 1958. (in Russian).

[CF69] P. Cartier and D. Foata. Problèmes combinatoires de commutation et réarrangements. Lecture Notes in Mathematics 85. Springer, Berlin-Heidelberg-New York, 1969.

[Cho86] C. Choffrut. Free partially commutative monoids. Technical report 86/20, LITP Université de Paris 7, 1986.

[CL85] M. Clerbout and M. Latteux. Partial commutations and faithful rational transductions. Theoret. Comp. Sci., 35:241–254, 1985.

[CM85] R. Cori and Y. Métivier. Recognizable subsets of some partially abelian monoids. Theoret. Comp. Sci., 35:241–254, 1985.

[CM87] R. Cori and Y. Métivier. Approximation d’ une trace, automates asynchrones et ordre des evenement dans les systemes repartis. Technical Report 1-8708, UER de Mathematiques et d’ Informatique, Université de Bordeaux I, 1987.

[CP85] R. Cori and D. Perrin. Automates et commutations partielles. R.A.I.R.O.-Informatique Théorique et Applications, 19:21–32, 1985.

[Dic13] L.E. Dickson. Finiteness of the odd perfect and primitive abundant numbers with n distinct prime factors. Amer. J. Math., 35:413–422, 1913.

[Die86a] V. Diekert. Commutative monoids have complete presentations by free (non-commutative) monoids. Theoret. Comp. Sci., 46:319–327, 1986.

[Die86b] V. Diekert. Complete semi-Thue systems for abelian groups. Theoret. Comp. Sci., 44:199–208, 1986.

[Die87a] V. Diekert. On the Knuth-Bendix completion for concurrent processes. In Th. Ottmann, editor, Proceedings of the 14th International Colloquium on Automata Languages and Programming (ICALP’87), Karlsruhe (FRG) 1987, Lecture Notes in Computer Science 267, pages 42– 53. Springer, Berlin-Heidelberg-New York, 1987. Appeared also in a revised version in Theoret. Comp. Science, 66:117-136, 1989.

[Die87b] V. Diekert. Some properties of weight-reducing presentations. In: Two contributions to the theory of finite replacement systems. Report TUM-I8710, Technical University Munich, 1987.

[Die89] V. Diekert. Word problems over traces which are solvable in linear time. In B. Monien et al., editors, Proceedings of the 6th Annual Symposium on Theoretical Aspects of Computer Science (STACS’89), Paderborn (FRG) 1989, Lecture Notes in Computer Science 349, pages 168–180. Springer, Berlin-Heidelberg-New York, 1989. To appear in revised version in Theoret. Comp. Science.

[Die90a] V. Diekert. Combinatorial rewriting on traces. In C. Choffrut et al., editors, Proceedings of the 7th Annual Symposium on Theoretical Aspects of Computer Science (STACS’90), Rouen (France) 1990, Lecture Notes in Computer Science 415, pages 138–151. Springer, Berlin-Heidelberg-New York, 1990.

[Die90b] V. Diekert. Research topics in the theory of free partially commutative monoids. Bull. of the European Association for Theoretical Computer Science (EATCS), 40:479–491, Feb 1990.

[Die90c] V. Diekert, editor. Free Partially Commutative Monoids. Proceedings of a workshop of the ESPRIT Basic Research Action No 3166: Algebraic and Syntactic Methods in Computer Science (ASMICS), Kochel am See, Bavaria, FRG (1989). Report TUM-I9002, Technical University Munich, 1990.

[Dub86] C. Duboc. Commutations dans les monoides libres: un cadre théorique pour létude du parallelisme. Thèse, Faculté des Sciences de l’Université de Rouen, 1986.

[DV88] V. Diekert and W. Vogler. Local checking of trace synchronizability. In M. Chytil et al., editors, Proceedings of the 13th Symposium on Mathematical Foundations of Computer Science (MFCS’88), Carlsbad (CSSR) 1988, Lecture Notes in Computer Science 324, pages 271–279. Springer, Berlin-Heidelberg-New York, 1988. Revised and extended version in Math. Syst. Theory 22: 161-175, 1989: On the synchronization of traces.

[Eil74] S. Eilenberg. Automata, Languages and Machines, volume I. Academic Press, New York and London, 1974.

[ES69] S. Eilenberg and M.P. Schützenberger. Rational sets in commutative monoids. Journal of Algebra, 13:173–191, 1969.

[Fis86] W. Fischer. Über erkennbare und rationale Mengen in freien partiell kommutativen Monoiden. Report FBI-HH-B-121/86, Fachbereich Informatik der Universität Hamburg, Hamburg, 1986. (Diplomarbeit 1985).

[Fli74] M. Fliess. Matrices de Hankel. J. Math. Pures et Appl., 53:197–224, 1974.

[FMR68] P.C. Fischer, A.R. Meyer, and A.L. Rosenberg. Counter machines and counter languages. Math. Syst. Theory, 2:265–283, 1968.

[FR82] M.P. Flé and G. Roucairol. On the serializability of iterated transactions. In Proceedings ACM SIGACT-SIGOPS, Symposium on Principles of Distr. Comp., Ottawa (Canada) 1982, pages 194–200, 1982.

[FR85] M.P. Flé and G. Roucairol. Maximal serializability of iterated transactions. Theoret. Comp. Sci., 38:1–16, 1985.

[Gil71] R. Gilman. Presentation of groups and monoids. Journal of Algebra, 57:544–554, 1971.

[GJ79] M.R. Garey and D.S. Johnson. Computers and Intractability. Bell Laboratories, Murray Hill, New Jersey, 1979.

[Gol86] M.C. Golumbic. Algorithmic Graph Theory and Perfect Graphs. Academic Press, New York, 1986.

[HL78] G. Huet and D.S. Lankford. On the uniform halting problem for term rewriting systems. Lab. Rep. no 28, INRIA, Le Chesnay, 1978.

[Hoa85] C.A.R. Hoare. Communicating Sequential Processes. Prentice-Hall International, London, 1985.

[Hue80] G. Huet. Confluent reduction: Abstract properties and applications to term rewriting systems. J. Assoc. Comput. Mach., 27:797–821, 1980.

[Jan88] M. Jantzen. Confluent String Rewriting. EATCS Monographs on Theoretical Computer Science 14. Springer, Berlin-Heidelberg-New York, 1988.

[Jou83] J.P. Jouannaud. Confluent and coherent equational term rewriting systems applications to proofs in abstract data types. In Ausiello G. et al., editors, Proceeding of the conference of Trees in Algebra and Programming (CAAP’83), Lecture Notes in Computer Science 159, pages 269– 283. Springer, Berlin-Heidelberg-New York, 1983.

[Kel73] R. Keller. Parallel program schemata and maximal parallelism I. Fundamental results. J. Assoc. Comput. Mach., 20:514–537, 1973.

[KMN88] D. Kapur, D. Musser, and P. Narendran. Only prime superposition need be considered in the Knuth-Bendix completion procedure. J. Symbolic Computation, 6:19–36, 1988.

[Kos84] S.R. Kosaraju. Decidability of reachability in vector addition systems. In Proceedings 14th Ann. ACM STOC, pages 267–281, 1984.

[KS86] W. Kuich and A. Salomaa. Semirings, Automata, Languages. EATCS Monographs on Theoretical Computer Science 5. Springer, Berlin-Heidelberg-New York, 1986.

[Lai67] R. Laing. Realization and complexity of commutative events. Technical Report TR 03 105-48-T, University of Michigan, 1967.

[Lal79] G. Lallement. Semigroups and Combinatorial Applications. John Wiley & Sons, New York, 1979.

[Lev44] F.W. Levi. On semigroups. Bull. Calcutta Math. Soc., 36:141–146, 1944.

[LTS79] P.E. Lauer, P.R. Torrigiani, and M.W. Shields. COSY: A system specification language based on paths and processes. Acta Inf., 12:109–158, 1979.

[Mac70] S. MacLane. Categories. For the Working Mathematician. Graduate Texts in Mathematics 5. Springer, Berlin-Heidelberg-New York, 1970.

[Mar47] A. Markov. On the impossibility of certain algorithms in the theory of associative systems. Dokl. Akad. Nauk SSSR, I,II(55,58):587–590,353– 356, 1947. (in Russian).

[May84] E. Mayr. An algorithm for the general Petri net reachability problem. Siam J. Comput., 13:441–459, 1984.

[Maz77] A. Mazurkiewicz. Concurrent program schemes and their interpretations. DAIMI Rep. PB 78, Aarhus University, Aarhus, 1977.

[Maz87] A. Mazurkiewicz. Trace theory. In W. Brauer et al., editors, Petri Nets, Applications and Relationship to other Models of Concurrency, Lecture Notes in Computer Science 255, pages 279–324. Springer, Berlin-Heidelberg-New York, 1987.

[Mét86] Y. Métivier. Une condition suffisante de reconnaissabilité dans un monoïde partiellement commutatif. R.A.I.R.O.-Informatique Théorique et Applications, 20:121–127, 1986.

[Mil80] R. Milner. A Calculus of Communicating Systems. Lecture Notes in Computer Science 92. Springer, Berlin-Heidelberg-New York, 1980.

[MM82] E.W. Mayr and A.R. Meyer. The complexity of the word problems for commutative semigroups and polynomial ideals. Advances in Math., 46:305–329, 1982.

[MO88] Y. Métivier and E. Ochmanski. On lexicographic semi-commutations. Inform. Proc. Letters, 26:55–59, 1987/88.

[New42] M.H.A. Newman. On theories with a combinatorial definition of “equivalence”. Annals of Math., 43:223–243, 1942.

[NO88] P. Narendran and F. Otto. Preperfectness is undecidable for Thue systems containing only length-reducing rules and a single commutation rule. Inform. Proc. Letters, 29:125–130, 1988.

[Och85] E. Ochmanski. Regular behaviour of concurrent systems. Bull. of the European Association for Theoretical Computer Science (EATCS), 27:56–67, Oct 1985.

[O’D83] C. O’Dunlaing. Undecidable questions related to Church-Rosser Thue systems. Theoret. Comput. Sci., 23:339–345, 1983.

[Ott87] F. Otto. Finite canonical rewriting systems for congruences generated by concurrency relations. Math. Syst. Theory, 20:253–260, 1987.

[Ott89] F. Otto. On deciding confluence of finite string rewriting systems modulo partial commutativity. Theoret. Comput. Sci., 67:19–36, 1989.

[Per84] D. Perrin. Words over a partially commutative alphabet. Report no. 84-59, LITP Université de Paris VII, 1984. Also appeared in A. Apostolico, editor, Combinatorial Algorithms on Words, Springer NATO-ASI Series, Vol. F12, p.329-340, 1986.

[Per89] D. Perrin. Partial commutations. In Proceedings of the 16th International Colloquium on Automata, Languages and Programming (ICALP’89), Stresa (Italy) 1989, Lecture Notes in Computer Science 372, pages 637–651. Springer, Berlin-Heidelberg-New York, 1989.

[Pos47] E. Post. Recursive unsolvability of a problem of Thue. J. Symb. Logic, 12(1):1–11, 1947.

[Red63] L. Redei. Theorie der endlich erzeugbaren kommutativen Halbgruppen. Number 41 in Hamb. Math. Einzelschr. Physica-Verlag, 1963.

[Reu89] C. Reutenauer. Aspects mathématiques des réseaux de Petri. Masson, Paris, 1989.

[Sak87] J. Sakarovitch. On regular trace languages. Theoret. Comput. Sci., 52:59–75, 1987.

[Shi79] M.W. Shields. Adequate path expressions. In G. Kahn, editor, Proceedings Semantics of Concurrent Computation, Evian (France) 1979, Lecture Notes in Computer Science 70, pages 249–265. Springer, Berlin-Heidelberg-New York, 1979.

[Squ87] C. Squier. Word problems and a homological finiteness condition for monoids. Journ. of Pure and Appl. Algebra, 49:201–218, 1987.

[Vie86] X.G. Viennot. Heaps of pieces I: Basic definitions and combinatorial lemmas. In G. Labelle et al., editors, Proceedings Combinatoire énumerative, Montreal, Quebec (Canada) 1985, Lecture Notes in Mathematics 1234, pages 321–350. Springer, Berlin-Heidelberg-New York, 1986.

[WB83] F. Winkler and B. Buchberger. A criterion for eleminating unnecessary reductions in the Knuth-Bendix algorithm. In Proceedings Coll. on Algebra, Combinatorics and Logic in Computer Science, Györ (Hungary), 1983.

[Wra88] C. Wrathall. The word problem for free partially commutative groups. J. Symbolic Computation, 6:99–104, 1988.

[Zie87] W. Zielonka. Notes on finite asynchronous automata. R.A.I.R.O.- Informatique Théorique et Applications, 21:99–135, 1987.

[Zie89] W. Zielonka. Safe executions of recognizable trace languages by asynchronous automata. In A. R. Mayer et al., editors, Proceedings Symposium on Logical Foundations of Computer Science, Logic at Botik ’89,

164 Bibliography

Pereslavl-Zalessky (USSR) 1989, Lecture Notes in Computer Science 363, pages 278–289. Springer, Berlin-Heidelberg-New York, 1989.

Index

admissible well-ordering, 110 asynchronous automaton, 47 asynchronous cellular, 48

basic critical pairs, 128 BCP (S), 128 block, 140

canonical projection, 12 chordless, 69 clique, 27 complete, 27, 86 Con(L), 41 concurrent iteration, 45 concurrently enabled, 57 cone, 140 confluent, 86 connected, 41 consistently regular, 39 covering, 63 critical pair, 86

dependence alphabet, 12 dependence relation, 12

elementary step, 13 existentially regular, 39

Foata normal form, 13 forbidden cycle, 81 free partially commutative, 12

generated subtrace, 19

Hasse diagram, 15

ind(l), 19 independence relation, 12 Irr(S), 109 irreducible, 86

labelled acyclic graph, 14 lexicographic normal form, 14 local description, 68 local morphism, 59 locally confluent, 86

M-automaton, 37

marking, 57 max(t), 16 min(t), 16 minimal critical pair, 87 Möbius function, 95

noetherian, 21 normalized, 88

orientation, 94

pre(l), 19

proper divisor, 20 protocol, 137

quasi-reconstructible, 69

rational expressions, 37 rational languages, 37 recognizable, 38 reconstructible, 69 Red(S), 109 replacement system, 109

semi-Thue system, 85 step sequence, 29 strictly separated, 117 subnet, 65 subtrace, 17 suf(l), 19 system, 57

three-colored graph, 81 trace, 12 trace monoid, 12 transition-bounded, 65

uniform, 49

weak product, 27 weight function, 90 weight-reducing, 90 word problem, 85