HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, a history monoid is a way of representing the histories of concurrently running computer processes as a collection of strings, each string representing the individual history of a process. The history
monoid In abstract algebra, a monoid is a set equipped with an associative binary operation and an identity element. For example, the nonnegative integers with addition form a monoid, the identity element being . Monoids are semigroups with identity ...
provides a set of synchronization primitives (such as locks, mutexes or thread joins) for providing rendezvous points between a set of independently executing processes or threads. History monoids occur in the theory of concurrent computation, and provide a low-level mathematical foundation for process calculi, such as CSP the language of
communicating sequential processes In computer science, communicating sequential processes (CSP) is a formal language for describing patterns of interaction in concurrent systems. It is a member of the family of mathematical theories of concurrency known as process algebras, or p ...
, or CCS, the calculus of communicating systems. History monoids were first presented by M.W. Shields.M.W. Shields "Concurrent Machines", ''Computer Journal'', (1985) 28 pp. 449–465. History monoids are
isomorphic In mathematics, an isomorphism is a structure-preserving mapping or morphism between two structures of the same type that can be reversed by an inverse mapping. Two mathematical structures are isomorphic if an isomorphism exists between the ...
to trace monoids (free partially
commutative In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Perhaps most familiar as a pr ...
monoids) and to the
monoid In abstract algebra, a monoid is a set equipped with an associative binary operation and an identity element. For example, the nonnegative integers with addition form a monoid, the identity element being . Monoids are semigroups with identity ...
of dependency graphs. As such, they are free objects and are universal. The history monoid is a type of semi-abelian categorical product in the
category Category, plural categories, may refer to: General uses *Classification, the general act of allocating things to classes/categories Philosophy * Category of being * ''Categories'' (Aristotle) * Category (Kant) * Categories (Peirce) * Category ( ...
of monoids.


Product monoids and projection

Let :A=(\Sigma_1,\Sigma_2,\ldots,\Sigma_n) denote an ''n''-tuple of (not necessarily pairwise disjoint)
alphabets An alphabet is a standard set of letter (alphabet), letters written to represent particular sounds in a spoken language. Specifically, letters largely correspond to phonemes as the smallest sound segments that can distinguish one word from a ...
\Sigma_k. Let P(A) denote all possible combinations of one finite-length string from each alphabet: :P(A)=\Sigma_1^* \times \Sigma_2^* \times \cdots \times \Sigma_n^* (In more formal language, P(A) is the
Cartesian product In mathematics, specifically set theory, the Cartesian product of two sets and , denoted , is the set of all ordered pairs where is an element of and is an element of . In terms of set-builder notation, that is A\times B = \. A table c ...
of the
free monoid In abstract algebra, the free monoid on a set is the monoid whose elements are all the finite sequences (or strings) of zero or more elements from that set, with string concatenation as the monoid operation and with the unique sequence of zero ...
s of the \Sigma_k. The superscript star is the
Kleene star In mathematical logic and theoretical computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation on a Set (mathematics), set to generate a set of all finite-length strings that are composed of zero or more repe ...
.) Composition in the product monoid is component-wise, so that, for :\mathbf=(u_1,u_2,\ldots,u_n) \, and :\mathbf=(v_1,v_2,\ldots,v_n) \, then :\mathbf=(u_1v_1,u_2v_2,\ldots,u_nv_n) \, for all \mathbf, \mathbf in P(A). Define the union alphabet to be :\Sigma=\Sigma_1 \cup \Sigma_2 \cup \cdots \cup \Sigma_n. \, (The union here is the
set union In set theory, the union (denoted by ∪) of a collection of sets is the set of all elements in the collection. It is one of the fundamental operations through which sets can be combined and related to each other. A refers to a union of ze ...
, not the
disjoint union In mathematics, the disjoint union (or discriminated union) A \sqcup B of the sets and is the set formed from the elements of and labelled (indexed) with the name of the set from which they come. So, an element belonging to both and appe ...
.) Given any string w\in \Sigma^*, we can pick out just the letters in some \Sigma_k^* using the corresponding string projection \pi_k:\Sigma^*\to\Sigma_k^*. A distribution \pi:\Sigma^*\to P(A) is the mapping that operates on w\in \Sigma^* with all of the \pi_k, separating it into components in each free monoid: :\pi(w)\mapsto (\pi_1(w), \pi_2(w), \ldots , \pi_n(w)). \,


Histories

For every a\in\Sigma, the tuple \pi(a) is called the elementary history of ''a''. It serves as an
indicator function In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , then the indicator functio ...
for the inclusion of a letter ''a'' in an alphabet \Sigma_k. That is, :\pi(a)=(a_1,a_2,\ldots,a_n) where :a_k=\begin a \mbox a\in \Sigma_k \\ \varepsilon \mbox . \end Here, \varepsilon denotes the
empty string In formal language theory, the empty string, or empty word, is the unique String (computer science), string of length zero. Formal theory Formally, a string is a finite, ordered sequence of character (symbol), characters such as letters, digits ...
. The history monoid H(A) is the submonoid of the product monoid P(A) generated by the elementary histories: H(A) = \^* (where the superscript star is the Kleene star applied with a component-wise definition of composition as given above). The elements of H(A) are called global histories, and the projections of a global history are called individual histories.


Connection to computer science

The use of the word ''history'' in this context, and the connection to concurrent computing, can be understood as follows. An individual history is a record of the sequence of states of a process (or thread or
machine A machine is a physical system that uses power to apply forces and control movement to perform an action. The term is commonly applied to artificial devices, such as those employing engines or motors, but also to natural biological macromol ...
); the alphabet \Sigma_k is the set of states of the process. A letter that occurs in two or more alphabets serves as a synchronization primitive between the various individual histories. That is, if such a letter occurs in one individual history, it must also occur in another history, and serves to "tie" or "rendezvous" them together. Consider, for example, \Sigma_1=\ and \Sigma_2=\. The union alphabet is of course \Sigma=\. The elementary histories are (a,a), (b,\varepsilon), (c,\varepsilon), (\varepsilon,d) and (\varepsilon,e). In this example, an individual history of the first process might be bcbcc while the individual history of the second machine might be ddded. Both of these individual histories are represented by the global history bcbdddcced, since the projection of this string onto the individual alphabets yields the individual histories. In the global history, the letters b and c can be considered to commute with the letters d and e, in that these can be rearranged without changing the individual histories. Such commutation is simply a statement that the first and second processes are running concurrently, and are unordered with respect to each other; they have not (yet) exchanged any messages or performed any synchronization. The letter a serves as a synchronization primitive, as its occurrence marks a spot in both the global and individual histories, that cannot be commuted across. Thus, while the letters b and c can be re-ordered past d and e, they cannot be reordered past a. Thus, the global history bcdabe and the global history bdcaeb both have as individual histories bcab and dae, indicating that the execution of d may happen before or after c. However, the letter a is synchronizing, so that e is guaranteed to happen after c, even though e is in a different
process A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management * Business process, activities that produce a specific s ...
than c.


Properties

A history monoid is isomorphic to a trace monoid, and as such, is a type of semi-abelian categorical product in the
category Category, plural categories, may refer to: General uses *Classification, the general act of allocating things to classes/categories Philosophy * Category of being * ''Categories'' (Aristotle) * Category (Kant) * Categories (Peirce) * Category ( ...
of monoids. In particular, the history monoid H(\Sigma_1,\Sigma_2,\ldots,\Sigma_n) is isomorphic to the trace monoid \mathbb(D) with the dependency relation given by :D=\left(\Sigma_1\times\Sigma_1\right)\cup \left(\Sigma_2\times\Sigma_2\right)\cup \cdots \cup \left(\Sigma_n\times\Sigma_n\right). In simple terms, this is just the formal statement of the informal discussion given above: the letters in an alphabet \Sigma_k can be commutatively re-ordered past the letters in an alphabet \Sigma_j, unless they are letters that occur in both alphabets. Thus, traces are exactly global histories, and vice versa. Conversely, given any trace monoid \mathbb(D), one can construct an isomorphic history monoid by taking a sequence of alphabets \Sigma_ = \ where (a, b) ranges over all pairs in D.


Notes


References

* Antoni Mazurkiewicz, "Introduction to Trace Theory", pp. 3–41, in ''The Book of Traces'', V. Diekert, G. Rozenberg, eds. (1995) World Scientific, Singapore {{ISBN, 981-02-2058-8 * Volker Diekert, Yves Métivier,
Partial Commutation and Traces
, In G. Rozenberg and A. Salomaa, editors, ''Handbook of Formal Languages'', Vol. 3, Beyond Words, pages 457–534. Springer-Verlag, Berlin, 1997. Concurrency (computer science) Semigroup theory Formal languages Free algebraic structures