 #jsDisabledContent { display:none; } My Account |  Register |  Help Flag as Inappropriate This article will be permanently flagged as inappropriate and made unaccessible to everyone. Are you certain this article is inappropriate?          Excessive Violence          Sexual Content          Political / Social Email this Article Email Address:

# Trace monoid

Article Id: WHEBN0010739141
Reproduction Date:

 Title: Trace monoid Author: World Heritage Encyclopedia Language: English Subject: Collection: Publisher: World Heritage Encyclopedia Publication Date:

### Trace monoid

In mathematics and computer science, a trace is a set of strings, wherein certain letters in the string are allowed to commute, but others are not. It generalizes the concept of a string, by not forcing the letters to always be in a fixed order, but allowing certain reshufflings to take place. Traces were introduced by Cartier and Foata in 1969 to give a combinatorial proof of MacMahon's Master theorem. Traces are used in theories of concurrent computation, where commuting letters stand for portions of a job that can execute independently of one another, while non-commuting letters stand for locks, synchronization points or thread joins.

The trace monoid or free partially commutative monoid is a monoid of traces. In a nutshell, it is constructed as follows: sets of commuting letters are given by an independency relation. These induce an equivalence relation of equivalent strings; the elements of the equivalence classes are the traces. The equivalence relation then partitions up the free monoid (the set of all strings of finite length) into a set of equivalence classes; the result is still a monoid; it is a quotient monoid and is called the trace monoid. The trace monoid is universal, in that all homomorphic monoids are in fact isomorphic.

Trace monoids are commonly used to model concurrent computation, forming the foundation for process calculi. They are the object of study in trace theory. The utility of trace monoids comes from the fact that they are isomorphic to the monoid of dependency graphs; thus allowing algebraic techniques to be applied to graphs, and vice-versa. They are also isomorphic to history monoids, which model the history of computation of individual processes in the context of all scheduled processes on one or more computers.

## Trace

Let $\Sigma^*$ denote the free monoid, that is, the set of all strings written in the alphabet $\Sigma$. Here, the asterisk denotes, as usual, the Kleene star. An independency relation $I$ then induces a binary relation $\sim$ on $\Sigma^*$, where $u\sim v\,$ if and only if there exist $x,y\in \Sigma^*$, and a pair $\left(a,b\right)\in I$ such that $u=xaby$ and $v=xbay$. Here, $u,v,x$ and $y$ are understood to be strings (elements of $\Sigma^*$), while $a$ and $b$ are letters (elements of $\Sigma$).

The trace is defined as the symmetric, reflexive and transitive closure of $\sim$. The trace is thus an equivalence relation on $\Sigma^*$, and is denoted by $\equiv_D$. The subscript D on the equivalence simply denotes that the equivalence is obtained from the independency I induced by the dependency D. Clearly, different dependencies will give different equivalence relations.

The transitive closure simply implies that $u\equiv v$ if and only if there exists a sequence of strings $\left(w_0,w_1,\cdots,w_n\right)$ such that $u\sim w_0\,$ and $v\sim w_n\,$ and $w_i\sim w_\left\{i+1\right\}\,$ for all $0\le i < n$.

## Trace monoid

The trace monoid, commonly denoted as $\mathbb \left\{M\right\}\left(D\right)$, is defined as the quotient monoid

$\mathbb \left\{M\right\}\left(D\right) = \Sigma^* / \equiv_D.$

The homomorphism

$\phi_D:\Sigma^*\to \mathbb \left\{M\right\}\left(D\right)$

is commonly referred to as the natural homomorphism or canonical homomorphism. That the terms natural or canonical are deserved follows from the fact that this morphism embodies a universal property, as discussed in a later section.

## Examples

Consider the alphabet $\Sigma=\\left\{a,b,c\\right\}$. A possible dependency relation is

$\begin\left\{matrix\right\} D$
&=& \{a,b\}\times\{a,b\} \quad \cup \quad \{a,c\}\times\{a,c\} \\
&=& \{a,b\}^2 \cup \{a,c\}^2 \\
&=& \{ (a,b),(b,a),(a,c),(c,a),(a,a),(b,b),(c,c)\}


\end{matrix}

The corresponding independency is

$I_D=\\left\{\left(b,c\right)\,,\,\left(c,b\right)\\right\}$

Therefore, the letters $b,c$ commute. Thus, for example, a trace equivalence class for the string $abababbca$ would be

$\left[abababbca\right]_D = \\left\{abababbca\,,\; abababcba\,,\; ababacbba \\right\}$

The equivalence class $\left[abababbca\right]_D$ is an element of the trace monoid.

## Properties

The cancellation property states that equivalence is maintained under right cancellation. That is, if $w\equiv v$, then $\left(w\div a\right)\equiv \left(v\div a\right)$. Here, the notation $w\div a$ denotes right cancellation, the removal of the first occurrence of the letter a from the string w, starting from the right-hand side. Equivalence is also maintained by left-cancellation. Several corollaries follow:

• Embedding: $w \equiv v$ if and only if $xwy\equiv xvy$ for strings x and y. Thus, the trace monoid is a syntactic monoid.
• Independence: if $ua\equiv vb$ and $a\ne b$, then a is independent of b. That is, $\left(a,b\right)\in I_D$. Furthermore, there exists a string w such that $u=wb$ and $v=wa$.
• Projection rule: equivalence is maintained under string projection, so that if $w\equiv v$, then $\pi_\Sigma\left(w\right)\equiv \pi_\Sigma\left(v\right)$.

A strong form of Levi's lemma holds for traces. Specifically, if $uv\equiv xy$ for strings u, v, x, y, then there exist strings $z_1, z_2, z_3$ and $z_4$ such that $\left(w_2, w_3\right)\in I_D$ for all letters $w_2\in\Sigma$ and $w_3\in\Sigma$ such that $w_2$ occurs in $z_2$ and $w_3$ occurs in $z_3$, and

$u\equiv z_1z_2,\qquad v\equiv z_3z_4,$
$x\equiv z_1z_3,\qquad y\equiv z_2z_4.$

## Universal property

A dependency morphism (with respect to a dependency D) is a morphism

$\psi:\Sigma^*\to M\,$

to some monoid M, such that the "usual" trace properties hold, namely:

1. $\psi\left(w\right)=\psi\left(\varepsilon\right)$ implies that $w=\varepsilon$
2. $\left(a,b\right)\in I_D$ implies that $\psi\left(ab\right)=\psi\left(ba\right)\,$
3. $\psi\left(ua\right)=\psi\left(v\right)\,$ implies that $\psi\left(u\right)=\psi\left(v\div a\right)$
4. $\psi\left(ua\right)=\psi\left(vb\right)\,$ and $a\ne b$ imply that $\left(a,b\right)\in I_D$

Dependency morphisms are universal, in the sense that for a given, fixed dependency D, if $\psi:\Sigma^*\to M\,$ is a dependency morphism to a monoid M, then M is isomorphic to the trace monoid $\mathbb\left\{M\right\}\left(D\right)$. In particular, the natural homomorphism is a dependency morphism.

## Normal forms

There are two well-known normal forms for words in trace monoids. One is the lexicographic normal form, due to Anatolij V. Anisimov and Donald Knuth, and the other is the Foata normal form due to Pierre Cartier and Dominique Foata who studied the trace monoid for its combinatorics in the 1960s.

## Trace languages

Just as a formal language can be regarded as a subset of $\Sigma^*$ the set of all possible strings, so then a trace language is defined as subset of $\mathbb\left\{M\right\}\left(D\right)$ all possible traces.

A language $L\subset\Sigma^*$ is a trace language, or is said to be consistent with dependency D if

$L=\bigcup \left[L\right]_D$

where

$\left[L\right]_D=\\left\{\left[w\right]_D \vert w\in L \\right\}$

is the trace closure of a set of strings, and

$\bigcup T = \\left\{w \vert \left[w\right]_D\in T \\right\}$

is the set of strings in a set of traces.