Intro duction to

tutorial

Antoni Mazurkiewicz

Institute of Polish Academy of Sciences

ul Ordona Warszawa and

Institute of Informatics Jagiellonian University

ul Nawo jki Krakow Poland

amazwarsipipanwawpl

Novemb er

Abstract

The concept of traces has b een intro duced for describing nonsequential b e

haviour of concurrent systems via its sequential observations Traces represent con

current pro cesses in the same way as strings represent sequential ones The theory

of traces is used as a to ol for reasoning ab out nonsequential pro cesses as a matter

of fact using this theory one can get a calculus of concurrent pro cesses analogous to

the ones available for sequential systems In this intro ductory tutorial we discuss a

numb er of issues that are at the foundations of trace theory Among the discussed

topics are algebraic prop erties of traces dep endence graphs histories xedp oint

calculus for nding the b ehaviour of nets comp ositionality and mo dularity

Key words concurrency traces pro cesses partial ordering nonsequential

systems

Intro duction

The theory of traces has b een motivated by the theory of Petri Nets and the theory of

formal languages and automata

Already in s Carl Adam Petri has develop ed the foundations for the theory of

concurrent systems In his seminal work he has presented a mo del which is based on

the communication of interconnected sequential systems He has also presented an entirely

Mazurkiewicz Intro duction to Trace Theory

new set of notions and problems that arise when dealing with concurrent systems His

mo del or actually a family of netbased mo dels that has b een since generically referred

to as Petri Nets has provided b oth an intuitive informal framework for representing basic

situations of concurrent systems and a formal framework for the mathematical analysis of

concurrent systems The intuitive informal framework has b een based on a very convenient

graphical representation of netbased systems while the formal framework has b een based

on the token game resulting from this graphical representation

The notion of a nite automaton seen as a restricted typ e of Turing Machine has

by then b ecome a classical mo del of a sequential system The strength of automata

theory is based on the simple elegance of the underlying mo del which admits p owerful

mathematical to ols in the investigation of b oth the structural prop erties expressed by the

underlying graphlike mo del and the b ehavioural prop erties based on the notion of the

language of a system The notion of language has provided a valuable link with the theory

of free

The original attempt of the theory of traces was to use the well develop ed to ols

of theory for the analysis of concurrent systems where the notion of

concurrent system is understo o d in very much the same way as it is done in the theory of

Petri Nets The idea was that in this way one will get a framework for reasoning ab out

concurrent systems which for a numb er of imp ortant problems would b e mathematically

more convenient that some approaches based on formalizations of the token game

In s when the basic theory of traces has b een formulated the most p opular

approach to deal with concurrency was interleaving In this approach concurrency is

replaced by nondeterminism where concurrent execution of actions is treated as non

deterministic choice of the order of executions of those actions Although the interleaving

approach is quite adequate for many problems it has a numb er of serious pitfalls We

will briey discuss here some of them b ecause those were imp ortant drawbacks that we

wanted to avoid in trace theory

By reducing concurrency to nondeterminism one assigns two dierent meanings to

the term nondeterministic choice the choice b etween two or more p ossible actions

that exclude each other and the lack of information ab out the order of two or more

actions that are executed indep endently of each other Since in the theory of concurrent

systems we are interested not only in the question what is computed but also in the

question how it is computed this identication may b e very misleading

This disadvantage of the interleaving approach is wellvisible in the treatment of

renement see eg It is widely recognized that renement is one of the basic trans

formations of any calculus of concurrent systems from theoretical metho dological and

practical p oint of view This transformation must preserve the basic relationship b etween

a system and its b ehaviour the b ehaviour of the rened system is the rened b ehaviour

of the original system This requirement is not resp ected if the b ehaviour of the system

is represented by interleaving

Mazurkiewicz Intro duction to Trace Theory

Also in considerations concerning inevitability see the interleaving approach

leads to serious problems In nondeterministic systems where a choice b etween two

partners may b e rep eated innite numb er of times a run discriminating against one of

the partners is p ossible an action of an apriori chosen partner is not inevitable On

the other hand if the two partners rep eat their actions independently of each other an

action of any of them is inevitable However in the interleaving approach one do es not

distinguish b etween these two situations b oth are describ ed in the same way Then as

a remedy against this confusion a sp ecial notion of fairness has to b e intro duced where

in fact this notion is outside of the usual algebraic means for the description of system

b ehaviour

Finally the identication of nondeterministic choice and concurrency b ecomes a

real drawback when considering serializability of transactions To keep consistency

of a database to which a numb er of users have concurrent access the database manager

has to allow concurrent execution of those transactions that do not interfere with each

other To this end it is necessary to distinguish transactions that are in conict from those

which are indep endent of each other the identication of the nondeterministic choice in

the case of conicting transactions with the choice of the execution order in case of

indep endent transactions leads to serious diculties in the design of database managing

systems

Ab ove we have sketched some of the original motivations that led to the formulation of

the theory of traces in Since then this theory has b een develop ed b oth in breadth and

in depth and this volume presents the state of the art of the theory of traces Some of the

developments have followed the initial motivation coming from concurrent systems while

other fall within the areas such as formal language theory theory of partially commutative

monoids graph grammars of words etc

In our pap er we discuss a numb er of notions and results that have played a crucial

role in the initial development of the theory of traces and which in our opinion are still

quite relevant

Preliminary notions

Let X b e a set and R b e a binary relation in X R is an ordering relation in X or X

is ordered by R if R is reexive xR x for all x X transitive xR y R z implies xR z

and antisymmetric xR y and y R x implies x y if moreover R is connected for any

x y X either xR y or y R x then R is said to b e a linear or total ordering A set

together with an ordering relation is an ordered set Let X b e a set ordered by relation

R Any subset Y of X is then ordered by the restriction of R to Y ie by R Y Y

The set f n g will b e denoted by By an alphabet we shall understand

a nite set of symbols letters alphab ets will b e denoted by greek capital letters eg

etc Let b e an alphab et the set of all nite sequences of elements of willl

Mazurkiewicz Intro duction to Trace Theory



b e denoted by such sequences will b e referred to as strings over Small initial

letters a b with p ossible sub or sup erscripts will denote strings small nal latin

letters w u v etc will denote strings If u a a a is a string n is called

1 2 n

the length of u and is denoted by juj For any strings a a a b b b the

1 2 n 1 2 m

concatenation a a a b b b is the string a a a b b b

1 2 n 1 2 m 1 2 n 1 2 m

Usually sequences a a a are written as a a a Consequently a will denote

1 2 n 1 2 n

symb ol a as well as the string consisting of single symb ol a the prop er meaning will b e

always understo o d by a context String of length containing no symb ols is denoted

by The set of strings over an alphab et together with the concatenation op eration and

the empty string as the neutral element will b e referred to as the of strings over



or the generated by Symb ol is used to denote the monoid of strings



over as well the set itself

We say that symb ol a occurs in string w if w w aw for some strings w w For

1 2 1 2

each string w dene Alph w the alphabet of w as the set of all symb ols o ccurring in w

By w a we shall understand the numb er of o ccurrences of symb ol a in string w

Let b e an alphab et and w b e a string over an arbitrary alphab et then w



denotes the string projection of w onto dened as follows

if w

u if w ua a

w





ua if w ua a



Roughly sp eaking pro jection onto deletes from strings all symb ols not in The

subscript in is omitted if is understo o d by a context



The right cancel lation of symb ol a in string w is the string w a dened as follows

a

w if a b

w b a

w ab otherwise

for all strings w and symb ols a b It is easy to prove that pro jection and cancellation

commute

w a w a

 

for all strings w and symb ols a

In our approach a language is dened by an alphab et and a set of strings over



ie a subset of Frequently a language will b e identied with its set of strings

however in contrast to many other approaches two languages with the same set of strings

but with dierent alphab ets will b e considered as dierent in particular two singleton

languages containing only empty strings but over dierent alphab ets are considered as

dierent Languages will b e denoted by initial latin capital letters eg A B with

p ossible subscripts and sup erscripts

Mazurkiewicz Intro duction to Trace Theory

If A B are languages over a common alphab et then their concatenation AB is the

language fuv j u A v B g over the same alphab et If w is a string A is a language

then omitting braces around singletons

w A fw u j u Ag Aw fuw j u Ag

The p ower of a language A is dened recursively

0 n+1 n

A fg A A A



for each n and the iteration A of A is the union

1

n

A

n=0

Extend the pro jection function from strings to languages dening for each language A

and any alphab et the pro jection of A onto as the language A dened as



A f u j u Ag

 

For each string w elements of the set

Pref w fu j v uv w g

are called prexes of w Obviously Pref w contains and w For any language A over

dene

Pref A Pref w

w 2A

Elements of Pref A are called prexes of A Obviously A Pref A Language A

is prex closed if A Pref A Clearly for any language A the language Pref A is



prex closed The prex relation is a binary relation v in such that u v w if and

only u Pref w It is clear that the prex relation is an ordering relation in any set of

strings

Dep endency and traces

By a dependency we shall mean any nite reexive and symmetric relation ie a nite

set of ordered pairs D such that if a b is in D then b a and a a are in D Let D

b e a dep endency the the domain of D will b e denoted by and called the alphabet of

D

D Given dep endency D call the relation I D independency induced

D D D

by D Clearly indep endency is a symmetric and irreexive relation In particular the

empty relation identity relation in and the full relation in the relation are

dep endencies the rst has empty alphab et the second is the least dep endency in the

third is the greatest dep endency in Clearly the union and intersection of a nite

numb er of dep endencies is a dep endency It is also clear that each dep endency is the

union of a nite numb er of full dep endencies since any symmetric and reexive relation

is the union of its cliques

Mazurkiewicz Intro duction to Trace Theory

2 2

Example The relation D fa bg fa cg is a dep endency fa b cg I

D D

fb c c bg 2

In this section we cho ose dep endency as a primary notion of the trace theory however

for other purp oses it may b e more convenient to take as a basic notion concurrent alphabet

ie any pair D where is an alphab et and D is a dep endency or any pair I

where is an alphab et and I is an indep endency or reliance alphabet ie any triple

D I where is an alphab et D is a dep endency and I is indep endency induced by

D

Let D b e a dep endency dene the trace equivalence for D as the least congruence



in the monoid such that for all a b

D

D

a b I ab ba

D D

Equivalence classes of are called traces over D the trace represented by string w

D

 

is denoted by w By we shall denote the set fw j w g and by the

D D D D

D

set fa j a g

D D

2 2

Example For dep endency D fa bg fa cg the trace over D represented by string

abbca is abbca fabbca abcba acbbag 2

D

By denition a single trace arises by identifying all strings which dier only in the



ordering of adjacent indep endent symb ols The quotient monoid M D is called



D

D

the over D and its elements the traces over D Clearly M D is generated

by In the monoid M D some symb ols from commute in contrast to the monoid

D

of strings for that reason M D is also called a free partial ly commutative monoid over

D As in the case of the monoid of strings we use the symb ol M D to denote the monoid

itself as well as the set of all traces over D It is clear that in case of full dep endency ie if

D is a single clique traces reduce to strings and M D is isomorphic with the free monoid

of strings over We are going to develop the algebra of traces along the same lines as

D

 

it has b een done in case of of strings Let us recall that the mapping

D D

such that

w w

D D



is a homomorphism of onto M D called the natural homomorphism generated by the

equivalence

D

Now we shall give some simple facts ab out the trace equivalence and traces Let D

b e xed from now on subscripts D will b e omitted if it causes no ambiguity I will b e

the indep endency induced by D will b e the domain of D all symb ols will b e symb ols

in all strings will b e strings over and all traces will b e traces over D unless

D D

explicitly stated otherwise

It is clear that u v implies Alph u Alph v thus for all strings w we can



dene Alph w as Alph w Denote by a binary relation in such that u v if

Mazurkiewicz Intro duction to Trace Theory



and only if there are x y and a b I such that u xaby v xbay it is not

dicult to prove that is the symmetric reexive and transitive closure of In other

words u v if and only if there exists a sequence w w w n such that

0 1 n

w u w v and for each i i n w w

0 n i1 i



Permutation is the least congruence in such that for all symb ols a b

ab ba

If u v we say that u is a p ermutation of v Comparing with we see at once that

u v implies u v

R

Dene the mirror image w of string w as follows

R R R

ua au

for any string u and symb ol a It is clear that the following implication the mirror rule

holds

R R

u v u v

R R

thus we can dene w as equal to w

Since obviously u v implies u a v a and is the transitive and reexive

closure of we have the following prop erty the cancellation prop erty of traces

u v u a v a

thus we can dene w a as w a for all strings w and symb ols a

We have also the following projection rule

u u v

v  

for any alphab et b eing a consequence of the obvious implication u u v

v  

Let u v b e strings a b b e symb ols a b If ua v b then applying twice rule

we get u b v a denoting u b by w by the cancellation rule again we get u

ua a v b a v ab w b Similarly we get v w a Since ua v b w ba w ab

and by the denition of traces ab ba Thus we have the following implication for all

strings u v and symb ols a b

ua v b a b a b I w u w b v w a

Obviously u v xuy xv y If xuy xv y by the cancellation rule xu xv

R R R R R R

by the mirror rule u x v x again by the cancellation rule u v and again by

the mirror rule u v Hence from the mirror prop erty and the cancellation prop erty it

follows the following implication

xuy xv y u v

Extend indep endency relation from symb ols to strings dening strings u v to b e

indep endent u v I if Alph u Alph v I Notice that the empty string is

indep endent of any other w I trivially holds for any string w

Mazurkiewicz Intro duction to Trace Theory

Prop osition For al l strings w u v and symbol a Alph v uav w a a v I

Proof By induction If v the implication is clear Otherwise there is symb ol

b a and string x such that v xb By Prop osition a b I and uaxb w a By

cancellation rule since b a we get uax w ba By induction hyp othesis a x I

Since a b I a xb I which proves the prop osition 2

The next theorem is a trace generalization of the Levi Lemma for strings which

reads for all strings u v x y if uv xy then there exists a string w such that either

uw x w y v or xw u w v y In case of traces this useful lemma admits more

symmetrical form

Theorem Levi Lemma for traces For any strings u v x y such that uv xy there

exist strings z z z z such that z z I and

1 2 3 4 2 3

u z z v z z x z z y z z

1 2 3 4 1 3 2 4

Proof Let u v x y b e strings such that uv xy If y the prop osition is proved by

setting z u z z z v Let w b e a string and e b e a symb ol such that y w e

1 2 4 3

0 00 0 00

Then there can b e two cases either there are strings v v such that v v ev and

00 0 00 0 00 00

e Alph v or there are strings u u such that u u eu and e Alph u v

0 00

In case by the cancellation rule we have uv v xw by induction hyp othesis

0 0 0 0

there are z z z z such that

1 2 3 4

0 0 0 0 0 00 0 0 0 0

z w z z x z z v z z uv z

4 2 3 1 4 3 2 1

0 0 0 0 0 0 00

and z z I Set z z z z e z z z z By Prop osition e v I

1 2 3 4

2 3 1 2 3 4

0 0 0 0 0

hence e z I and e z I Since e z I ez z e and it is easy to check

3 4 4 4 4

0 0 0

that equivalences are satised We have also z z I and e z I it yields

2 3 3

0 0

I which proves z z I e z z

2 3

3 2

0 00

In case by cancellation rule we have u u v xw and by induction hyp othesis there

0 0 0 0

are z z z z such that

1 2 3 4

0 0 0 00 0 0 0 0 0 0

u z z u v z z x z z w z z

1 2 3 4 1 3 2 4

0 0 0 0 0 0

and z z I Set as ab ove z z z z e z z z z By Prop osition

1 2 3 4

2 3 1 2 3 4

00 0 0 0 0 0 0

v I hence e z inI and e z I Since ue z z e z ez z z equiva e u

2 4

3 4 2 4 2 4

0 0 0

lences are satised By induction hyp othesis z z I together with e z inI it

2 3 3

implies z z I 2

2 3

Let u v b e traces over the same dep endency Trace u is a prex of trace v and

v is a dominant of u if there exists trace x such that ux v Similarly to the case

of strings the relation to b e a prex in the set of all traces over a xed dep endency is

Mazurkiewicz Intro duction to Trace Theory

y

x

z

3

z

4

z

1

z

2

u v

Figure Graphical interpretation of Levi Lemma for traces

a

R

ab ac

R

abb abc

R

abbc

abbca

2 2

Figure Structure of prexes of abbca for D fa bg fa cg D

Mazurkiewicz Intro duction to Trace Theory

an ordering relation however in contrast to the prex relation in the set of strings the

prex relation for traces orders sets of traces in general only partially

2 2

The structure of prexes of the trace abbca for dep endency fa bg fa cg is given

in the Figure

Prop osition Let w be a trace and u v be prexes of w Then there exist the

greatest common prex and the least common dominant of u and v

Proof Since u v are prexes of w there are traces x y such that ux v y Then

by Levi Lemma for traces there are strings z z z z such that u z z x z z v

1 2 3 4 1 2 3 4

z z y z z and z z are indep endent Then z is the greatest common prex and

1 3 2 4 2 3 1

z z z is the least common dominant of u v Indeed z is a common prex of b oth

1 2 3 1

u v it is the greates common prex since any symb ol in z do es not o ccur in z and

2 3

any symb ol in z do es not o ccur in z hence any extension of z is not a prex either of

3 2 1

z z u or of z z v Thus any trace b eing a prex of u and of v must b e a

1 2 1 3

prex of z Similarly z z z is a common dominant of u v but any prop er prex

1 1 2 3

of z z z is either not dominating u if it do es not contain a symb ol from z or not

1 2 3 2

dominating v if it do es not contain a symb ol from z 2

3

Let us close this section with a characterization of trace monoids by homomorphisms

socalled dep endency morphisms

A dependency morphism wrt D is any homomorphism from the monoid of strings

over onto another monoid such that

D

A w w

A a b I ab ba

A ua v u v a

A ua v b a b a b I



Lemma Let be a dependency morphism u v a b If ua v b and



a b then there exists w such that u w b and v w a

Proof Let u v a b b e such as assumed in the ab ove Lemma and let

ua v b

Applying twice A to we get

u b v a

Mazurkiewicz Intro duction to Trace Theory

Set w u b Then

w a u ba

ua b since a b

v from by A

and

w b u bb

v ab from

v b a since a b

u from by A

2

Lemma Let be dependency morphisms wrt the same dependency Then x

y x y for al l x y

Proof Let D b e a dep endency and let b e two concurrency mappings wrt dep en



dency D x y and x y If x then by A y and clearly x y



If x then y Thus x ua y v b for some u v a b and we have

ua v b

There can b e two cases In the rst case we have a b then by A u v and by

induction hyp othesis u v Thus ua v b which proves x y In

the second case a b By A a b I By Lemma we get u w b v w a



for some w By induction hyp othesis

u w b v w a

hence

ua w ba v b w ab

By A since a b I

ba ab

hence w ba w ab which proves x y 2

Theorem If are dependency morphisms wrt the same dependency onto monoids

M N then M is isomorphic with N

Mazurkiewicz Intro duction to Trace Theory

Proof By Lemma the mapping dened by the equality

w w



for all w is a homomorphism from M onto N Since has its inverse namely

1

w w

which is a homomorphism also is a homomorphism from N onto M is an isomorphism

2

Theorem The natural homomorphism of the monoid of strings over onto the

D

monoid of traces over D is a dependency morphism

Proof We have to check conditions A A for w w Condition A is obviously

D

satised condition A follows directly from the denition of trace monoids Condition

A follows from the cancellation prop erty condition A follows from 2

Corollary If is a dep endency morphism wrt D onto M then M is isomorphic

with the monoid of traces over D and the isomorphism is induced by the mapping such

that a a for all a Proof It follows from Theorem and Theorem

D D D

2

Dep endence graphs

Dep endence graphs are thought as graphical representations of traces which make explicit

the ordering of symb ol o ccurrences within traces It turns out that for a given dep endency

the algebra of traces is isomorphic with the algebra of dep endency graphs as dened

b elow Therefore it is only a matter of taste which ob jects are chosen for representing

concurrent pro cesses equivalence classes of strings or lab elled graphs

Let D b e a dep endency relation Dep endency graphs over D or dgraphs for short

are nite oriented acyclic graphs with no des lab elled with symb ols from in such a

D

way that two no des of a dgraph are connected with an arc if and only if they are dierent

and lab elled with dep endent symb ols Formally a triple

V R

is a dep endence graph dgraph over D if

V is a nite set of no des of

R V V the set of arcs of

V the lab elling of D

Mazurkiewicz Intro duction to Trace Theory

a

A

A

A

A

b b

A

AU

A

c

A

A

A

b

A

A

A

A

AU

R

a

2 2

Figure A dep endence graph over D fa bg fa cg

such that

+

R id acyclicity

V

1

v v R R id v v D Dconnectivity

1 2 V 1 2

0 00 0 00

Two dgraphs are isomorphic if there exists a bijection b etween their no des

preserving lab elling and arc connections As usual two isomorphic graphs are identied

all subsequent prop erties of dgraphs are formulated up to isomorphism The empty d

graph will b e denoted by and the set of all isomorphism classes of dgraphs over

D by

D

2 2

Example Let D fa bg fa cg Then the no de lab elled graph V R with

V f g

R f g

a b c b a

is a dgraph It is isomorphic to the graph in Fig

The following fact follows immediately from the denition

0 00 0 0 00

Prop osition Let D D be dependencies V R be a dgraph over D V R be

00 0 00 0 00

a dgraph over D If D D then R R 2

Mazurkiewicz Intro duction to Trace Theory

a a

H

H

Hj

A

c c

A

A

A

P

b b

P

A

P

P

AU

P

P

P

P

Pq

a a

R R

R R

b b

Figure Dgraphs comp osition

A vertex of a dgraph with no arcs leaving it leading to it is said to b e a maxi

mumminimum resp vertex Clearly a dgraph has at least one maximum and one

minimum vertex Since dgraphs are acyclic the transitive and reexive closure of d

graph arc relation is an ordering Thus each dgraph uniquely determines an ordering

of symb ol o ccurrences This ordering will b e discussed later on for the time b eing we

only mention that considering dgraphs as descriptions of nonsequential pro cesses and

dep endency relation as a mo del of causal dep endency this ordering may b e viewed as

causal ordering of pro cess events

Observe that in case of full dep endency D ie if D S S the arc relation of

D D

any dgraph g over D is the linear order of vertices of g in case of minimum dep endency D

ie when D is an identity relation any dgraph over D consists of a numb er of connected

comp onents each of them b eing a linearly ordered set of vertices lab elled with a common

symb ol

Dene the comp osition of dgraphs as follows for all graphs in the comp o

1 2 D

sition with with is a graph arising from the disjoint union of and by

1 2 1 2 1 2

adding to it new arcs leading from each no de of to each no de of provided they are

1 2

lab elled with dep endent symb ols Formally V R i there are instances

1 2

V R V R of resp ectively such that

1 1 1 2 2 2 1 2

V V V V V

1 2 1 2

R R R R

1 2 12

1 2

where R denotes a binary relation in V such that

12

v v R v V v V v v D

1 2 12 1 1 2 2 1 2

Example In Fig the comp osition of two dgraphs is presented thin arrows represent

arcs added in the comp osition

Mazurkiewicz Intro duction to Trace Theory

Prop osition The composition of dgraphs is a dgraph

Proof In view of and it is clear that the comp osition of two dgraphs

1 2

is a nite graph with no des lab elled with symb ols from It is acyclic since and

D 1

are acyclic and by in there is no arcs leading from no des of to no des of

2 2 1

Let v v b e no des of with v v D If b oth of them are no des of or of

1 2 1 2 1

then by Dconnectivity of comp onents and by they are also joined in If v is a

2 1

no de of and v is a no de of then by and they are joined in which proves

1 2 2

Dconnectivity of 2

Comp osition of dgraphs can b e viewed as sequential as well as parallel com

p osing two indep endent dgraphs ie dgraphs such that any no de of one of them is

indep endent of any no de of the other we get the result intuitively understo o d as paral

lel comp osition while comp osing two dep endent dgraphs ie such that any no de of one

of them is dep endent of any lab el of the other the result can b e viewed as the sequential

or serial comp osition In general dgraph comp osition is a mixture of parallel and

sequential comp ositions where some but not all no des of one dgraph are dep endent

on some no des of the other and some of them are not The nature of comp osition of

dgraphs dep ends on the nature of the underlying dep endency relation

Denote the empty graph with no no des by e The set of all dgraphs over a dep en

dency D with comp osition dened as ab ove and with the empty graph as a distinguished

element forms an algebra denoted by GD

Theorem The GD is a monoid

Proof Since the empty graph is obviously the neutral left and right element wrt to

the comp osition it suces to show that the comp osition of dgraphs is asso ciative Let

for i V R b e a representant of dgraph such that V V for i j

i i i i i j

By simple calculation we prove that is isomorphic to the dgraph V R

1 2 3

with

V V V V

1 2 3

R R R R R R R

1 2 3 12 13 23

1 2 3

where R denotes a binary relation in V such that

ij

v v R v V v V v v D

1 2 ij 1 i 2 j 1 2

and the same result we obtain for 2

1 2 3

Let D b e a dep endency For each string w over S denote by hw i the dgraph

D D

dened recursively

hi e hw ai hw i a fa ag

D D D

Mazurkiewicz Intro duction to Trace Theory

for all strings w and symb ols a In other words hw ai arises from the graph hw i by adding

to it a new no de lab elled with symb ol a and new arcs leading to it from all vertices of

hw i lab elled with symb ols dep endent of a

2 2

Dgraph habbcai with dep endency D fa bg fa cg is presented in Fig

D

Let dep endency D b e xed from now on and let I hw i denote I hw i re

D D D

sp ectively

Prop osition For each dgraph over D there is a string w such that hw i

Proof It is clear for the empty dgraph By induction let b e a nonempty dgraph

remove from one of its maximum vertices It is clear that the resulting graph is a d

graph By induction hyp othesis there is a string w such that hw i is isomorphic with this

restricted dgraph then hw ai where a is the lab el of the removed vertex is isomorphic

with the original graph 2

Therefore the mapping hi is a surjection



Prop osition Mapping GD dened by w hw i is a dependency mor

phism wrt D

Proof By Prop osition mapping is a surjection By an easy induction we prove that

for each strings u v

uv huv i hui hv i u v

and clearly hi e Thus is a homomorphism onto GD Condition A is

obviously satised If a b I dgraph habi has no arcs hence it is isomorphic with hbai

It proves A By denition dgraph huai for string u and symb ol a has a maximum

vertex lab elled with a if huai hv i then hv i has also a maximum vertex lab elled with

a removing these vertices from b oth graphs results in isomorphic graphs it is easy to

see that removing such a vertex from hv i results in hv ai Hence hui hv ai which

proves A If huai hv bi and a b then has at least two maximum vertices one

of them lab elled with a and the second lab elled with b Since b oth of them are maximum

vertices there is no arc joining them It proves a b I and A is satised 2

Theorem The trace monoid M D is isomorphic with the monoid GD of dgraphs

over dependency D the isomorphism is induced by the bijection such that a hai

D D

for al l a D

Mazurkiewicz Intro duction to Trace Theory

2 2 2 2 2 2 2

fa cg fc dg fa b cg fb c dg fa bg fa cg fc dg

a a

d

b b

H

1 2

Hj

c c c

d d d

Figure Trace pro jections

Proof It follows from Corollary to Theorem 2

The ab ove theorem claims that traces and dgraphs over the same dep endency can

b e viewed as two faces of the same coin the same concepts can b e expressed in two

dierent ways sp eaking ab out traces the algebraic character of the concept is stressed

up on while sp eaking ab out dgraphs its causality or ordering features are emphasized

We can consider some graph theoretical features of traces eg connectivity of traces

as well as some algebraic prop erties of dep endence graphs eg comp osition of dgraphs

Using this isomorphism one can prove facts ab out traces using graphical metho ds and

the other way around prove some graph prop erties using algebraic metho ds In fact

dual nature of traces algebraic and graphtheoretical was the principal motivation to

intro duce them for representing concurrent pro cesses

An illustration of graphtheoretical prop erties of traces consider the notion useful

in the other part of this b o ok of connected trace a trace is connected if the dgraph

corresp onding to it is connected The algebraic denition of this notion could b e the

following trace t is connected if there is no nonempty traces t t with t t t and such

1 2 1 2

that Alph t Alph t I A connected component of trace t is the trace corresp onding

1 2

to a connected comp onent of the dgraph corresp onding to t the algebraic denition of

this notion is much more complex

As the second illustration of graph representation of traces let us represent in

2 2

graphical form pro jection of trace abcd with dep endency fa b cg fb c dg onto

1

2 2

dep endency fa cg fc dg and pro jection of the same trace onto dep endency

2

2 2 2

fa bg fa cg fc dg Fig Pro jection is onto dep endency with smaller al

1

phab et than the original symb ol b is deleted under pro jection pro jection preserves

2

all symb ols but delete some dep endencies namely dep endency b c and b d

Mazurkiewicz Intro duction to Trace Theory

Histories

The concepts presented in this section originate in pap ers of MW Shields ShShSh

The main idea is to represent nonsequential pro cesses by a collection of individual his

tories of concurrently running comp onents an individual history is a string of events

concerning only one comp onent and the global history is a collection of individual ones

This approach app ealing directly to the intuitive meaning of parallel pro cessing is partic

ularly well suited to CSPlike systems where individual comp onents run indep endently

of each other with one exception an event concerning a numb er of in CSP at most

two comp onents can o ccur only coincidently in all these comp onents handshaking

or rendezvous synchronization principle The presentation and the terminology used

here have b een adjusted to the present purp oses and dier from those of the authors

Let b e a ntuple of nite alphab ets Denote by P the

1 2 n

pro duct monoid

  

1 2 n

The comp osition in P is comp onentwise if u u u u v v v v

1 2 n 1 2 n

then

uv u v u v u v

1 1 2 2 n n

  

for all u v

1 2 n

Let and let b e the pro jecton from onto for i n

1 2 n i i

   

By the distribution in we understand here the mapping

1 2 n

dened by the equality

w w w w

1 2 n

For each a the tuple a will b e called the elementary history of a Thus the

elementary history of a is the ntuple a a a such that

1 2 n

a if a

i

a

i

otherwise

Thus elementary history a is ntuple consising of one symb ol strings a that o ccur

in p ositions corresp onding to comp onents containing symb ol a and of empty strings that

o ccur in the remaining p ositions

Let H b e the submonoid of P generated by the set of all elementary histories

in P Elements of H will b e called global histories or simply histories and

comp onents of global histories individual histories in

Example Let fa bg fa cg Then fa b cg and the

1 2 1 2

elementary histories of are a a b c The pair

w abba aca

Mazurkiewicz Intro duction to Trace Theory

is a global history in since

w a ab b ca a

abbca

The pair abba cca is not a history since it cannot b e obtained by comp osition of ele

mentary histories 2

From the p oint of view of concurrent pro cesses the subalgebra of histories can b e

interpreted as follows There is n sequential comp onents of a concurrent system each of

them is capable to execute sequentially some elementary actions creating in this way

a sequential history of the comp onent run All of comp onents can act indep endently of

each other but an action common to a numb er of comp onents can b e executed by all of

them coincidently There is no other synchronization mechanisms provided in the system

Then the join action of all comp onents is a ntuple of individual histories of comp onents

such individual histories are consistent with each other ie roughly sp eaking they

can b e combined into one global history The following theorem oers a formal criterion

for such a consistency

Prop osition The distribution in is a homomorphism from the monoid of strings

over onto the monoid of histories H

Proof It is clear that the distribution of any string over is a history in H It

is also clear that any history in H can b e obtained as the distribution from a string

over since any history is a comp osition of elementary histories a a a

1 2 m

a a a By prop erties of pro jection it follows the congruency of the distribution

1 2 m

uv u v 2

2 2 2

The distribution in is Theorem Let D

1 2 n

n 2 1

a dependency morphism wrt D onto the monoid of histories H

Proof Denote the assumed dep endency by D and the induced indep endency by I By

Prop osition the distribution is a homomorphism onto the monoid of histories By its

denition we have at once w w which proves A By the denition of

dep endency two symb ols a b are dep endent i there is index i such that a as well as b

b elongs to ie a b are indep endent i there is no index i such that contains b oth

i i

of them It proves that if a b I then ab ba since for all i n

a if a

i

b if b

ab ba

i

i i

in the remaining cases

Thus A holds To prove A assume ua v then we have ua v for all

i i

i n hence ua a v a since pro jection and cancellation commute

i i

ua a v a ie u v a for all i which implies u v a

i i i i

It proves A Supp ose now ua v b if it were i with a b it would b e

i i

ua v b which is imp ossible Therefore there is no such i ie a b I 2

i i

Mazurkiewicz Intro duction to Trace Theory

Theorem Monoid of histories H is isomorphic with the monoid of

1 2 n

2 2 2

traces over dependency

1 2 n

Proof It follows from the Theorem and Corollary to Theorem 2

Therefore similarly to the case of dgraphs histories can b e viewed as yet another

third face of traces to represent a trace by a history the underlying dep endency should

b e converted to a suitable tuple of alphab ets One p ossibility but not unique is to take

cliques of dep endency as individual alphab ets and then to make use of Theorem for

2

constructing histories As an example consider trace abbca over dep endency fa bg

2

fa cg as in the previous sections then the system comp onents are fa bg fa cg and

the history corresp onding to trace abbca is the history abba aca

Ordering of symb ol o ccurrences

Traces dep endence graphs and histories are the same ob jects from the algebraic p oint of

view since monoids of them are isomorphic they b ehave in the same way under com

p osition However actually they are dierent ob jects their dierence is visible when

considering how symb ols are ordered in corresp onding ob jects traces graphs and histo

ries

There are two kinds of ordering dened by strings the ordering of symb ols o ccurring

in a string called the o ccurrence ordering and the ordering of prexes of a strings

the prex ordering Lo oking at strings as at mo dels of sequential pro cesses the rst

determines the order of event o ccurrences within a pro cess The second is the order of

pro cess states since each prex of a string can b e interpreted as a partial execution of the

pro cess interpreting by this string and such a partial execution determines uniquely an

intermediate state of the pro cess Both orderings although dierent are closely related

given one of them the second can b e reconstructed

Traces are intended to b e generalizations of strings hence the ordering given by traces

should b e a generalization of that given by strings Actually it is the case as we could

exp ect the ordering resulting from a trace is partial In this chapter we shall discuss in

details the ordering resulting from trace approach

We start from string ordering since it gives us some to ols and notions used next

for dening the trace ordering We shall consider b oth kinds of ordering rst the prex

ordering and next the o ccurrence ordering Next we consider ordering dened within

dep endence graphs nally ordering of symb ols supplied by histories will b e discussed

In the whole section D will denote a xed dep endency relation b e its alphab et

I the indep endency relation induced by D All strings are assumed to b e strings over

The set of all traces over D will b e denoted by the same symb ol as the monoid of traces

over D ie by M D

Mazurkiewicz Intro duction to Trace Theory

Thus in contrast to linearly ordered prexes of a string the set P r ef t is ordered

by only partially Interpreting a trace as a single run of a system its prex structure can

b e viewed as the partially ordered set of all intermediate global system states reached

during this run In this interpretation represents the initial state incomparable prexes

represent states arising in eect of events o ccurring concurrently and the ordering of prex

represents the temp oral ordering of system states

Occurrence ordering in strings At the b eginning of this section we give a couple



of recursive denition of auxiliary notions All of them dene some functions on in

D

0

these denitions w denotes always a string over and e e e symb ols in

D D

Let a b e a symb ol w b e a string the numb er of o ccurrences of a in w is here denoted

by w a Thus a w aa w a w ba w a for all strings w and symb ols

a b The occurrence set of w is a subset of

Occ w fa n j a n w ag

It is clear that a string and its p ermutation have the same o ccurrence set since they

have the same o ccurrence numb er of symb ols hence all representants of a trace over an

arbitrary dep endency have the same o ccurrence sets

Example The o ccurrence set of string abbca is the set

fa a b b c g

2

Let R and A b e an alphab et dene the pro jection R of R onto A as

A

follows

R fa n R j a Ag

A

It is easy to show that

Occ w Occ w

A A

Thus Occ w Occ w

A

The occurrence ordering in a string w is an ordering Ord w in the o ccurrence set of

w dened recursively as follows

Ord Ord w a Ord w Occ w a fa w ag

Thus Ord w Occ w Occ w It is obvious that Ord w is a linear ordering for

any string w

Occurrence ordering in traces In this section we generalize the notion of o ccur

rence ordering from strings to traces Let D b e a dep endency As it has b een already

noticed u v implies Occ u Occ v for all strings u v Thus the o ccurrence set

for a trace can b e set as the o ccurrence set of its arbitrary representant Dene now

Mazurkiewicz Intro duction to Trace Theory

the o ccurrence ordering of a trace w as the intersection of o ccurrence orderings of all

representants of w

Ord w Ord u

uw

This denition is correct since all instances of a trace have the common o ccurrence set

and the intersection of dierent linear ordering in a common set is a partial ordering of

this set Thus according to this denition ordering of all representants of a single trace

form all p ossible linearizations extensions to the linear ordering of the trace o ccurrence

ordering From this denition it follows that the o ccurrence ordering of a trace is the

greatest ordering common for all its representants In the rest of this section we give

some prop erties of this ordering and its alternative denitions

We can interprete the ordering Ord w from the p oint of view of concurrency as

follows Supp ose there is a numb er of observers lo oking at the same concurrent pro cess

represented by a trace Observation made by each of them is sequential each of them

sees only one representant of this trace If two observers discover an opp osite ordering

of the same events in the observed pro cess it means that these events are actually not

ordered in the pro cess and that the dierence noticed by observers results only b ecause

their sp ecic p oints of view Thus such an ordering should not b e taken into account

and consequently two events can b e considered as really ordered in the pro cess if and

only if they are ordered in the same way in all p ossible observations of the pro cess all

observers agree on the same ordering

Dgraph ordering Consider now dgraphs over D Let V R b e a dep en

dence graph Let as in case of strings a denotes the numb er of vertices of lab elled

with a Dene the o ccurrence set of as the set

Occ fa n j n ag

We say thet a vertex v precedes vertex u in if there is an arc leading from v to u in

Let v a n denotes a vertex of lab elled with a which is preceded in by precisely n

vertices lab elled with a Observe that for each element a n in the o ccurrence set of

there exists precisely one vertex v a n

Occurrence relation for is the binary relation Q in Occ such that

a n b m Q v a n v b m R

2

Example The diagram of the o ccurrence relation for the dgraph habbcai over fa bg

2

fa cg is given in Fig 2

Since Q is acyclic its transitive and reexive closure of Q is an ordering relation

in the set Occ this ordering will b e called the occurrence ordering of and will b e

denoted by Ord

Prop osition For each string w the ordering Ord w is an extension of Ord hw i to

a linear ordering

Mazurkiewicz Intro duction to Trace Theory

a

A

A

A

A

b

A

AU

A

c

A

A

A

b

A

A

A

A

AU

R

a

2 2

Figure The o ccurrence relation for dgraph habbcai over D fa bg fa cg

D

Proof It follows easily from the denition of arc connections in dgraphs by comparing

it with the denition of Ord w given by 2

Prop osition Let be a dgraph and let S be an extension of Ord to a linear

ordering Then there is a string u such that S Ord u and g hui

Proof By induction If is the empty graph then set u Let b e not empty and

let S b e the extension of Ord g to a linear ordering Let a n b e the maximum element

of S Then has a maximum vertex lab elled with a Delete from this vertex and

denote the resulting graph by delete also the maximum element from S and denote the

resulting ordering by R Clearly R is the linear extension of by induction hyp othesis

there is a string say w such that R Ord w and hw i But then S Ord w a and

hw ai Thus u w a meets the requirement of the prop osition 2

Theorem For al l strings w Ord w Ord hw i

Proof Obvious in view of the denition of the trace ordering and prop ositions and

2

This theorem states that the intersection of linear orderings of representants of a

trace is the same ordering as the transitive and reexive closure of the ordering of the

dgraph corresp onding to that trace

History ordering Now let b e ntuple of nite alphab ets

1 2 n

2 2 2

D b e the pro jection on and let b e the

1 2 n i i

1 2 n

distribution function

Mazurkiewicz Intro duction to Trace Theory

Fact For any string w over and each i n

Ord w Ord w

i i

Proof Equality holds for w Let w ue for string u and symb ol e If

e equality holds by induction hyp othesis since w u Let then

i i i

a By denition Ord ua Ord u Occ ua fa ua g By induction

i

hyp othesis Ord u Ord u by Occ ua Occ ua a implies

i i i i i

ua ua hence Ord ua Occ ua fa ua g Ord ua It

i i i i

ends the pro of 2

Fact For each string w over

n

Occ w Occ w

i

i=1

Proof Since by denition Occ w Occ w and Occ w Occ w for

i i i

S

n

each i n hence Occ w Occ w Let e k Occ w hence a k

i

i=1

Occ w for i such that a thus a k Occ w for this i but it means that

i i i

S

n

Occ w which completes the pro of 2 a k

i

i=1

Let w w w b e a global history dene

1 2 n

n



Ord w Ord w w w

i 1 2 n

i=1

The following theorem close the comparison of dierent typ es of dening trace or

dering

S

2

Theorem Let D let w be distribution function in and let

1 2 n

i

hw i be the dgraph hw i Then for each string w Ord w Ord hw i

D

Proof Let D b e such as assumed ab ove let hw i denotes hw i and let w

D

w w w Thus for each i w w Since Occ w Occ hw i and

1 2 n i i

Occ w Occ w we have Occ w Occ hw i Any two symb ols in are dep endent

i i i

S

n

hence Ord w Ord hw i Therefore Ord w Ord hw i and since Ord hw i is

i i

i=1

S

n



an ordering Ord w Ord hw i To prove the inverse inclusion observe that

i

i=1

0 0 00 00 0 00

if there is an arc in an o ccurrence graph from e k to e k then e e D it

0 00 0 0 00 00

means that there is i such that e e and that e k e k Ord w hence

i i

0 0 00 00

e k e k Ord w It ends the pro of 2

The history ordering dened by is illustrated in Fig

Mazurkiewicz Intro duction to Trace Theory

a b b c c e

e

e

a

e

e e

b b

e

e

e

e e

c c

e

e

Figure History ordering e follows a

Mazurkiewicz Intro duction to Trace Theory

It explains the principle of history ordering Let us interprete ordering Ord w in

similar way as we have done it in case of traces Each individual history of a comp onent

can b e viewed as the result of a lo cal observation of a pro cess limited to events b elonging

to the rep ertoire of the comp onent From such a viewp oint an observer can notice only

events lo cal to the comp onent he is situated at remaining actions are invisible for him

Thus b eing lo calized at ith comp onent he notices the ordering Ord w only To

i

discover the global ordering of events in the whole history all such individual histories

have to b e put together then events observed coincidently from dierent comp onents

form a sort of links b etween individual observations and make p ossible to discover an

ordering b etween events lo cal to separate and remote comp onents The rule is an event

00 00 0 0

o ccurrence a n follows another event o ccurrence a n if there is a sequence of

0 0 00 00

event o ccurrences b eginning with a n and ending with a n in which every element

follows its predecessor according to the individual history containing b oth of them Such

a principle is used by historians to establish a chronology of events concerning remote and

separate historical ob jects

Let us comment and compare all three ways of dening ordering within graphs traces

and histories They have b een dened in the following way

Ord hw i as the transitive and reexive closure of arc relation of hw i

Ord w as intersection of linear orderings of all representants of w

Ord w as the transitive closure of the union of linear orderings of all

w comp onents

i

All of them describ e pro cesses as partially ordered sets of event o ccurrences They

have b een dened in dierent way in natural way for graphs as the intersection of indi

vidually observed sequential orderings in case of traces and as the union of individually

observed sequential orderings in case of histories In case of traces observations were

complete containing every action but sometimes discovering dierent orderings of some

events in case of histories observations were incomplete limited only to lo cal events but

discovering always the prop er ordering of noticed events In the case of traces the way

of obtaining the global ordering is by comparing all individual observations and rejecting

a sub jective and irrelevant information by intersection of individual orderings in case

of histories all individual observations are collected together to gain complementary and

relevant information by unifying individual observations While the second metho d has

b een compared to the metho d of historians the rst one can b e compared to that of

physicists In all three cases the results are the same it gives an additional argument for

the ab ove mentioned denitions and indicates their soundness

Trace languages

Let D b e a dep endency by a trace language over D we shall mean any set of traces over

D The set of all trace laguages over D will b e denoted by T For a given set L of D

Mazurkiewicz Intro duction to Trace Theory

strings over denote by L the set fw j w Lg and for a given set T of traces

D D D

S

over D denote by T the set fw j w T g Clearly

D

L L and T T

D D

for all string languages L and trace languages T over D String language L such

S

that L L is called to b e existential ly consistent with dep endency D The

D

comp osition T T of trace languages T T over the same dep endency D is the set ft t j

1 2 1 2 1 2

t T t T g The iteration of trace language T over D is dened in the same way as

1 2 2 2

the iteration of string language

1

n 

T T

n=0

where

0 n+1 n

T and T T T

D

The following prop osition results directly from the denitions

Prop osition For any dependency D any string languages L L L over and for

1 2 D

any family fL g of string languages over

i i2I D

D

L L L L

1 2 D 1 2 D

D

L L L L

1 2 1 D 2 D

L L L L

1 2 D 1 2 D

D

L L

i D i D

i2I i2I

 

L L

D

D

2

Before dening the synchronization of languages which is the most imp ortant op

eration on languages for the present purp ose let us intro duce the notion of pro jection

adjusted for traces and dep endencies

Let C b e a dep endency C D and let t b e a trace over D then the trace projection

t of t onto C is a trace over C dened as follows

C

if t

C D

t if t t e e

t

C 1 1 D C

C

t e if t t e e

C 1 C 1 D C

Intuitively trace pro jection onto C deletes from traces all symb ols not in and weakens

C

the dep endency within traces Thus the pro jection of a trace over dep endency D onto a

dep endency C which is smaller but has the same alphab et as D is a weaker trace

containing more representants the the original one

The following prop osition is easy to prove

Mazurkiewicz Intro duction to Trace Theory

Prop osition Let C D be dependencies D C Then u v u v

C D D D

2

Dene the synchronization of the string language L over with the string language

1 1

L over as the string language L k L over such that

2 2 1 2 1 2

w L w L w L k L

2 1  1 2 

2 1

Prop osition Let L L L L be string languages be the alphabet of L be the

1 2 3 1 1 2

alphabet of L let fL g be a family of string languages over a common alphabet and

2 i i2I

let w be a string over Then

1 2

L k L L

L k L L k L

1 2 2 1

L k L k L L k L k L

1 2 3 1 2 3

f g k f g f g

   [

1 2 1 2

L k L L k L

i i

i2I i2I

L k L fw g L f w g k L f w g

1 2 1  2 

1 2

fw gL k L f w gL k f w gL

1 2  1  2

1 2

S

0

Proof Equalities are obvious Let w w L k L it means that

i 

i2I

S S

0

L k w L and w L ie w L and w L then i I

i i  i  

i2I i2I

L which proves To prove let u L k L fw g it means that there exists v

1 2

such that v L k L and u v w by denition of synchronization v L and

1 2  1

1

v L b ecause w is a string over this is equivalent to v w L f w g

 2 1 2  1 

2 1 1

and v w L f w g it means that u L f w g k L f w g Pro of of

 2  1  2 

2 2 1 2

is similar 2

Dene the synchronization of the trace language T over D with the trace language

1 1

T over D as the trace language T k T over D D such that

2 2 1 2 1 2

t T k T t T t T

1 2 D 1 D 2

1 2

Prop osition For any dependencies D D and any string languages L over L

1 2 1 D 2

1

over

D

2

L k L L k L

1 D 2 D 1 2 D [D

1 2 1 2

Proof

L k L ft j t L t L g

1 D 2 D D 1 D D 2 D

1 2 1 1 2 2

fw j w L w L g

D [D S 1 S 2

1 2

D D

1 2

fw j w L k L g

D [D 1 2

1 2

fw j w L k L g

1 2 D [D

1 2

L k L

1 2 D [D

1 2 2

Mazurkiewicz Intro duction to Trace Theory

a

a c a

Q

Q

Qs

c

b

k

R

c

e

b

Q

Q

Qs

e

d b

d

Figure Synchronization of two singleton trace languages

Prop osition Let T T T T be trace languages let D be the dependency of T

1 2 3 1 1

D be the dependency of T let fT g be a family of trace languages over a common

2 2 i i2I

dependency and let t be a trace over D D Then

1 2

T k T T

T k T T k T

1 2 2 1

T k T k T T k T k T

1 2 3 1 2 3

f g k f g f g

D D D [D

1 2 1 2

T k T T k T

i i

i2I i2I

T k T ftg T f tg k T f tg

1 2 1 D 2 D

1 2

ftgT k T f tgT k f tgT

1 2 D 1 D 2

1 2

Proof It is similar to that of Prop osition

2 2 2 2

Example Let D fa b dg fb c dg D fa b cg fa c eg T

1 2 1

fcabd g T facbe g The synchronization T k T is the language facbde g

D 2 D 1 2 D

1 2

2 2

over dep endency D D D fa b c dg fa c eg Synchronization of these two

1 2

trace languages is illustrated in Fig where traces are represented by corresp onding

dgraphs without arcs resulting by transitivity from others

Observe that in a sense the synchronization op eration is inverse w r to pro jection

namely we have for any trace t over D D the equality

1 2

ftg f tg k f tg

D D

1 2

Observe also that for any traces t over D t over D the synchronization ft g k ft g

1 1 2 2 1 2

is either empty or a singleton set Thus the synchronization can b e viewed as a partial

op eration on traces In general it is not so in case of strings synchronization of two

singleton string languages may not b e a singleton Eg the synchronization of the string

Mazurkiewicz Intro duction to Trace Theory

language fabg over fa bg with the string language fcdg over fc dg is the string language

fabcd acbd cabd acdb cadb cdabg while the synchronization of the trace language fabg

2 2

over fa bg with the trace language fcdg over fc dg is the singleton trace language

2 2

fabcdg over fa bg fc dg It is yet another justication of using traces instead of

strings for representing runs of concurrent systems

Synchronization op eration can b e easily extended to an arbitrary numb er of argu

ments for a family of trace languages fT g with T b eing a trace language over D we

i i2I i i

S

dene k T as the trace language over D such that

i2I i i

i2I

t k T t T

i2I i i2I D i

i

Fact If T T are trace languages over a common dependency then T k T T T

1 2 1 2 1 2

Proof Let T T b e trace languages over dep endency D then t T k T if and only

1 2 1 2

if t T and t T but since t is a trace over D t t hence t T and

D 1 D 2 D 1

t T 2

2

A trace language T is prexclosed if s v t T s T

Prop osition If T T are prexclosed trace languages then so is their synchroniza

1 2

tion T k T

1 2

Proof Let T T b e prexclosed trace languages over dep endencies D D resp ectively

1 2 1 2

0 00 0 00

Let t T k T and let t b e a prex of t then there is t such that t t t But

1 2

0 00 0 00

then by prop erties of pro jection t t t t t T and t

D D D D 1 D

1 1 1 1 2

0 00 0 00 0 0

t t t t T since T T are prexclosed t T and t

D D D 2 1 2 D 1 D

2 2 2 1 2

0

T hence by denition t T k T 2

2 1 2

Fixedp oint equations Let X X X Y b e families of sets n and let

1 2 n

f X X X Y f is monotone if

1 2 n

0 00 0 0 0 00 00 00

i X X f X X X f X X X

i i 1 2 n 1 2 n

0 00

for each X X X i n

i

i i

Fact Concatenation union iteration and synchronization operations on string trace

langages are monotone

Proof Obvious in view of corresp onding denitions 2

Fact Superposition composition of any number of monotone operations is monotone

Mazurkiewicz Intro duction to Trace Theory

Proof Clear 2

Let D D D D b e dep endencies n and let

1 2 n

 





 





D D

D

D

n

1 2

f

f is congruent if

0 00 0 0 0 00 00 00

i X X f X X X f X X X

D D D D

i i i i 1 2 n 1 2 n





0 00

D

i

i n for all X X

i i

Fact Concatenation union iteration and synchronization operations on string lan

gages are congruent

Proof It follows from Prop osition and Prop osition 2

Fact Superposition composition of any number of congruent operations is congruent

Proof Clear 2

Let D D D D b e dep endencies n and let

1 2 n

 





 





D D

D

D

n 2 1

f

b e congruent Denote by f the function

D

T T T T

D D D D

n

1 2

f

D

dened by the equality

f L L L f L L L

1 2 n D D 1 D 2 D n D

n

1 2

This denition is correct by congruency of f

X X

We say that the set x is the least xed p oint of function f if f x x

0 0 0

and for any set x with f x x the inclusion x x holds

0

 

 

D D

Theorem Let D be a dependency and f be monotone and congruent

If L is the least xed point of f then L is the least xed point of f

0 0 D D

Mazurkiewicz Intro duction to Trace Theory

Proof Let D f and L b e such as dened in the formulation of Theorem First observe

0

0

that for any L with f L L we have L L Indeed let L b e the least set of strings

0

0 0 0 0 0 0

such that f L L then L L Since f is monotone f f L f L hence f L

0 0 0 0

meets also the inclusion and consequently L f L hence L f L and by the

0

denition of L we have L L L Now

0 0

L f L f L

0 D 0 D D 0 D

by congruency of f Thus L is a xed p oint of f We show that L is the

0 D D 0 D

least xed p oint of f Let T b e a trace language over D such that f T T

D D

S S S

and set L T Thus L T and T L L By we have f L

D D

S S S

f L by congruency of f we have f L f L by denition of L we

D D D D

S S S S

have f L f T and by denition of T we get f T T and again

D D D D

S

by denition of L T L Collecting all ab ove relations together we get f L L

Thus as we have already proved L L hence L L T It proves L to b e

0 0 D D 0

the least xed p oint of f 2

D

This theorem can b e easily generalized for tuples of monotonic and congruent func

tions As we have already mention functions built up from variables and constants by

means of union concatenation and iteration op erations can serve as examples of mono

tonic and congruent functions Theorem allows to lift the wellknown and broadly

applied metho d of dening string languages by xed p oint equations to the case of trace

languages It oers also a useful and handy to ol for analysis concurrent systems repre

sented by elementary net systems as shown in the next section

It is worthwhile to note that under the same assumptions as in Theorem M can

0

b e the greatest xed p oint of a function f while M is not the greatest xed p oint of

0

f

Elementary Net Systems

In this section we show how the trace theory is related to net mo dels of concurrent

systems First elementary net systems intro duced in on the base of Petri nets and

will b e presented The b ehaviour of such systems will b e represented by string languages

describing various sequences of system actions that can b e executed while the system

is running Next the trace b ehaviour will b e dened and compared with the string

b ehaviour Finally comp ositionality of b ehaviours will b e shown the b ehaviour of a

net comp osed from other nets as comp onents turns out to b e the synchronization of the

comp onents b ehaviour

Elementary net systems By an elementary net system called simply net from

now on we understand any ordered quadruple

0

N P E F m

N N N N

Mazurkiewicz Intro duction to Trace Theory

x

e c

b

x

d

a

Figure Example of an elementary net system

where P E are nite disjoint sets of places and transitions resp F P E

N N N N N

0

E P the ow relation and m P It is assumed that D omF C odF

N N N N N

N

1

P E there is no isolated places and transitions and F F Any subset of

N N

0

P is called a marking of N m is called the initial marking A place in a marking is

N

N

said to b e marked or carrying a token

As all other typ es of nets elementary net systems are represented graphically using

b oxes to represent transitions circles to represent places and arrows leading from circles

to b oxes or from b oxes to circles to represent the ow relation in such a representation

circles corresp onding to places in the initial marking are marked with dots In Fig the

net P E F m with

P f g

E fa b c d eg

F f a a b b c c

d d b b e e g

m f g

is represented graphically

P

Dene Pre Post Prox as functions from E to such that for all a E as follows

Pre a fp j p a F g

N N

Post a fp j e p F g

N N

Prox a Pre a Post a

N N N

places in Pre a are called the entry places of a those in Post a are called the

N N

exit places of a and those in Prox a are neighbours of a the set Prox a is the

N N

1

neighb ourho o d of a in N The assumption F F means that no place can b e

an entry and an exit of the same transition The subscript N is omitted if the net is understo o d

Mazurkiewicz Intro duction to Trace Theory

P P

N

Transition function of net N is a partial function E such that

N N

N

Pre a m Post a m

1 1

m a m

N 1 2

m m Pre a Post a

2 1

As usual subscript N is omitted if the net is understo o d this convention will hold for

all subsequent notions and symb ols related to them

Clearly this denition is correct since for each marking m and transition a there

exists at most one marking equal to m a If m a is dened for marking m and

transition a we say that a is enabled at marking m We say that the transition function

describ es single steps of the system

 P  P

Reachability function of net N is the function E dened recursively

N

by equalities



m m

N

 

m w a m w a

N

N N

P 

for all m w E a E

 P

Behavioural function of net N is the function E dened by w

N N

 0 

m w for all w E

As usual the subscript N is omitted everywhere the net N is understo o d

The set of strings S D om is the sequential b ehaviour of net N the set

N

of markings R C od is the set of reachable markings of N Elements of S will b e

N

called execution sequences of N execution sequence w such that w m P is said

to lead to m

The sequential behaviour of N is clearly a prex closed language and as any prex

closed language it is ordered into a tree by the prex relation Maximal linearly ordered

subsets of S can b e viewed as sequential observations of the b ehaviour of N ie obser

vations made by observers capable to see only a single event o ccurrence at a time The

ordering of symb ols in strings of S reects not only the ob jective causal ordering of

event o ccurrences but also a sub jective observational ordering resulting from a sp ecic

view over concurrent actions Therefore the structure of S alone do es not allow to decide

whether the dierence in ordering is caused by a conict resolution a decision made in

the system or by dierent observations of concurrency In order to extract from S the

causal ordering of event o ccurrences we must supply S with an additional information as

such information we take here the dep endency of events

Dependency relation for net N is dened as the relation D E E such that

N

a b D Prox a Prox b

N N N

Intuitively sp eaking two transitions are dep endent if either they share a common entry

place then they comp ete for taking a token away from this place or they share a

Mazurkiewicz Intro duction to Trace Theory

common exit place and then they comp ete for putting a token into the place or an entry

place of one transition is the exit place of the other and then one of them waits for the

other Transitions are indep endent if their neighb ourho o ds are disjoint If b oth such

transitions are enabled at a marking they can b e executed concurrently indep endently

of each other

Dene the nonsequential b ehaviour of net N as the trace language S and denote it

D

by B That is the nonsequential b ehaviour of a net arises from its sequential b ehaviour

N

by identifying some execution sequences as it follows from the dep endency denition

two such sequences are identied if they dier in the order of indep endent transitions

execution

Sequential and nonsequential b ehaviour consistency is guaranteed by the following

prop osition where the equality of values of two partial functions means that either b oth

of them are dened and then their values are equal or b oth of them are undened

Prop osition For any net N the behavioural function is congruent wr to D ie



for any strings u v E u v implies u v

D

Proof Let u v it suces to consider the case u xaby and v xbay for in

D



dep endent transitions a b and arbitrary x y E Because of the b ehavioural function

denition we have to prove only

m a b m b a

for an arbitrary marking m By simple insp ection we conclude that b ecause of indep en

dency of a and b ie b ecause of disjointness of neighb ourho o ds of a and b b oth sides of

the ab ove condition are equal to a conguration

m Pre a Pre b Post a Post b

or b oth of them are undened 2

This is another motivation for intro ducing traces for describing concurrent systems

b ehaviour from the p oint of view of reachability p ossibilities all equivalent execution

sequences are the same As we have shown earlier ring traces can b e viewed as partially

ordered sets of symb ol o ccurrences two o ccurrences are not ordered if they represent

transitions that can b e executed indep endently of each other Thus the ordering within

ring traces is determined by mutual dep endencies of events and then it reects the causal

relationship b etween event o ccurrences rather than the non ob jective ordering following

from the string representation of net activity

Two traces are said to b e consistent if b oth of them are prexes of a common trace

A trace language T is complete if any two consistent traces in T are prexes of a trace

in T

Mazurkiewicz Intro duction to Trace Theory

x

e c

b b

x

d

a

Figure Decomp osition of a net into two sequential comp onents

Prop osition The trace behaviour of any net is a complete trace language

Proof Let B b e the trace b ehaviour of net N I b e the indep endence induced by D and

let w u B and let w x uy for some strings x y Then by Levi Lemma for traces

there are strings v v v v such that v v w v v x v v u v v y and v v

1 2 3 4 1 2 3 4 1 3 2 4 2 3

I Let m v Since w D om v v D om since u v v D om

1 1 2 1 3

 

hence m v is dened and m v is dened since v v I v v v v v v

2 3 2 3 1 2 3 1 3 2

   

moreover m v v is dened m v v is dened and m v v m v v It

2 3 3 2 2 3 3 2

means that v v v v v v D om ie w v uv D om It ends the pro of 2

1 2 3 1 3 2 3 2

Comp osition of nets and their b ehaviours Here we are going to present a

mo dular way of nding the b ehaviour of nets It will b e shown how to construct the

b ehaviour of a net from b ehaviours of its parts The rst step is to decomp ose a given

net into mo dules next to nd their b ehaviours and nally to put them together nding

in this way the b ehaviour of the original net

Let I f ng we say that a net N P E F m is comp osed of nets

N P E F m i I and write

i i i i i

N N N N

1 2 n

if i j implies P P N are pairwise placedisjoint and

i j i

n n n n

m F m E F P E P

i i i i

i=1 i=1 i=1 i=1

The net in Fig is comp osed from two nets presented in Fig

Mazurkiewicz Intro duction to Trace Theory

Comp osition of nets could b e dened without assuming the disjointness of sets of

places instead we could use the disjoint union of sets of places rather than the set

theoretical union in the comp osition denition However it would require a new denition

of nets with two nets considered identical if there is an isomorphism identifying nets with

dierent sets of places and preserving the ow relation and the initial marking For sake

of simplicity we assume sets of places of the comp osition comp onents to b e disjoint and

we use the usual settheoretical union in our denition

Prop osition Composition of nets is associative and commutative

Proof Obvious 2

0

Let I f ng and let N N N N N N P E F m for

1 2 n i i i i

i

all i I Let Pre Post Prox b e denoted by Pre Post Prox moreover let b e

N N N i i i i

i i i

the pro jection functions from E onto E Finally let m m P for any m P

i i i

S

P and Prop osition Let Q R P and set Q Q P R R P If P

i i I i I

i2I

the members of the family fP g are pairwise disjoint then

i i2I

Q m i I Q m

i i

R Q m i I R Q m

i i i

m Q R i I m Q R

i i i

R m Q i I R m Q

i i i

S S

and Q Q R R

i i

i2I i2I

Proof Clear 2

S

n

Prop osition D D

N N

i=1 i

Proof Let a b D N by denition Prox a Prox b by Prox a

Prox b Q Prox a Prox b Q hence by Prop osition a b D

i2I i i i

S S

n n

Prox a Prox b Q Q Prox a Prox b

i i i

i=1 i=1

S

n

a b D 2

N

i=1

i

Prop osition Let denotes the transition function of N Then

i i

0 00 0 00 0 00

m a m i I a E m a m a E m m

i i i

i i i i

0 00

for al l m m P and a E

Mazurkiewicz Intro duction to Trace Theory

Proof It is a direct consequence of Prop osition 2

From the ab ove prop osition it follows by an easy induction

 0 00  0 00

m w m i I m w m

i

i i i

The main theorem of this section is the following

Theorem

k k B k B B B

N N N N +N ++N

n n

2 1 1 2

  0

Proof Set m fw E j m w mg for each m P and m

i

  0  0

fw E j m w mg for each m P by Prop osition m w m

i i

i i i

 0

m w m thus w m w m It means that

i2I i i i2I i i i

i i

m m k m k k m

1 1 2 2 n n

Thus by denition of the b ehaviour the pro of is completed 2

This theorem allows us to nd the b ehaviour of a net knowing b ehaviours of its

comp onents One can exp ect the b ehaviour of comp onents to b e easier to nd than that

of the whole net As an example let us nd the b ehaviour of the net in Fig using

its decomp osition into two comp onents as in Fig These comp onents are sequential

from the theory of sequential systems it is known that their b ehaviour can b e describ ed

by the least solutions of equations

X X be b

1 1

X X abc ab a d

2 2

for languages X X over alphab ets fb eg fa b c dg resp ectively By denition of trace

1 2

b ehaviour of nets by Theorem and Theorem and we have

X X be b

1 D 1 D D D D

1 1 1 1 1

X X abc ab a d

2 D 2 D D D D D D

2 2 2 2 2 2 2

2 2

with D fb eg D fa b c dg The equation for the synchronization X k X is

1 2 1 2

by prop erties of synchronization as follows

X k X X be b k X abc ab a d

1 D 2 D 1 D D D D 2 D D D D D D

1 2 1 1 1 1 2 2 2 2 2 2

and after some easy calculations using Prop osition we get

X k X X k X abc abe ab a d

1 2 D 1 2 D D

Mazurkiewicz Intro duction to Trace Theory

a

2

a

1

R

a

b

n

1

R

b b

2 m

Figure An example of atomic net

2 2

with D D D fb eg fa b c dg Observe that comp osition of two comp onents

1 2

that are sequential results in a net with some indep endent transitions in the consid

ered case the indep endent pairs of transitions are a e c e d e and their symmetric

images

There exists a standard set of very simple nets namely nets with a singleton set of

places the b ehaviours of which can b e considered as known Such nets are called atomic

or atoms an arbitrary net can b e comp osed from such nets hence the b ehaviour of any

net can b e comp osed from the b ehaviours of atoms Thus giving the b ehaviours of atoms

we supply another denition of the elementary net system b ehaviour More formally let

0

N P E F m b e a net for each p P the net

0

N fpg Prox p F m

p p p

where

0 0

F fe p j e Pre pg fp e j e Post pg m m fpg

p p

is called an atom of N determined by p Clearly the following prop osition holds

Prop osition Each net is the composition of al l its atoms

The b ehaviour of atoms can b e easily found Namely let the atom N b e dened as

0

N fpg A Z F m where A fe j e p F g Z fe j p e F g Say that N is

0 0

marked if m fpg and unmarked otherwise ie if m Then by the denition of



b ehavioural function trace b ehaviour B is the trace language ZA Z if it is

N D

0

 2

marked and AZ A if it is unmarked where D A Z

D

Conclusions

Some basic notions of trace theory has b een briey presented In the next chapters of this

b o ok this theory will b e made broader and deep er the intention of the present chapter

Mazurkiewicz Intro duction to Trace Theory

x

e c

b b

e c

b b

x

d

a a

Figure Atoms of net in Fig

was to show some initial ideas that motivated the whole enterprise In the sequel the

reader will b e able to get acquainted with the development trace theory as a basis of non

standard logic as well as with the basic and involved results from the theory of monoids

with prop erties of graph representations of traces and with generalization of the notion

of nite automaton that is consistent with the trace approach All this work shows that

the concurrency issue is still challenging and stimulating fruitful research

Acknowledgements The author is greatly indebted to Professor Grzegorz

Rozenb erg for his help and encouragement without them this pap er will not app ear

Also the supp ort of Esprit CALIBAN Working Group is gratefully acknowledged

References

Aalb ersb erg IJJ Studies in Trace Theory PhD Dissertation Leiden University

Bakker de JW Ro ever de WP Rozenb erg G eds Stepwise Renement of

Distributed Systems Pro c of REX Workshop Lecture Notes in Computer Science

Ehrenfeucht A Rozenb erg G On the Structure of Dependence Graphs Rapp ort

Dept of Computer Science University of Leiden

Fle M P and Roucairol G On Serializability of Iterated Transactions Pro c

ACM SIGACTSIGOPS Symp on Princ of Distrib Comp Ottawa

Mazurkiewicz Intro duction to Trace Theory

Grab owskiJ On partial languages Fundamenta Informaticae

GyoryGKnuthERonyaiLGrammatical Projections Elementary

Constructions Working Pap er I I MTA SZTAKI Budap est

HoareCAR Communicating Sequential Processes Communications of the ACM

vol

Janicki R Mazurkiewicz traces semantics for communicating sequential processes

Pro c th Europ ean Workshop on Appl and Theory of Petri Nets Aarhus

Knuth E Petri nets and trace languages Pro c st Europ Conf on Parallel and

Distr Pro cessing Toulouse

Levi F W On Bull of the Calcutta Math So c

MazurkiewiczA Concurrent Program Schemes and Their Interpretations DAIMI

TechnRep of Aarhus University PB

Mazurkiewicz A Traces histories graphs instances of a process monoid

Lecture Notes in Computer Science

MazurkiewiczA Semantics of Concurrent Systems A Modular FixedPoint Trace

Approach LNCS

Mazurkiewicz A Ochmanski E Penczek W Concurrent Systems and

Inevitability Theoretical Computer Science

PetriCA Fundamentals of a Theory of Asynchronous Information Flow Pro c of

IFIP Congress North Holland Amsterdam

Petri CA Concepts of Net Theory Pro ceedings of the Symp osium and Summer

Scho ol on MFCS High Tatras

Petri CA NonSequential Processes GMDISF Rep ort Gesellschaft fuer

Mathematik und Datenverarb eitung mbH Bonn

Rozenb erg G Behaviour of elementary net systems Advances in Petri Nets

Part I Pro ceedings of an Advanced Course Lecture Notes in Computer Science

Rozenb erg G Thiagara jan PS Petri Nets Basic Notions Structure and

Behaviour Lecture Notes in Computer Science

Shields MW NonSequential Behaviour Part Int Rep ort CSR Dept of

Computer Science University of Edinburgh

Thiagara jan PS Elementary net systems Advances in Petri Nets Part I

Pro ceedings of an Advanced Course Lecture Notes in Computer Science

Mazurkiewicz Intro duction to Trace Theory

Zielonka W Proving assertions about paral lel programs by means of traces ICS

PAS Rep ort Inst of Comp Science Polish Academy of Sciences Warszawa