In mathematics and computer 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 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, or CCS, the calculus of communicating systems. History monoids were first presented by M.W. Shields.[1]
History monoids are isomorphic to trace monoids (free partially commutative monoids) and to the monoid 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 of monoids.
Let
denote an n-tuple of (not necessarily pairwise disjoint) alphabets. Let denote all possible combinations of one finite-length string from each alphabet:
(In more formal language, is the Cartesian product of the free monoids of the . The superscript star is the Kleene star.) Composition in the product monoid is component-wise, so that, for
and
then
for all in . Define the union alphabet to be
(The union here is the set union, not the disjoint union.) Given any string , we can pick out just the letters in some using the corresponding string projection. A distribution :\Sigma ^{*}\to P(A)} is the mapping that operates on with all of the , separating it into components in each free monoid:
For every , the tuple is called the elementary history of a. It serves as an indicator function for the inclusion of a letter a in an alphabet . That is,
where
Here, は空文字列を表します。は積モノイドのサブモノイドである。基本的な歴史によって生成されたもの:(上付き文字の星印は、上記のように成分ごとの組成定義を適用したクリーネ星印である。) これらはグローバルヒストリーと呼ばれ、グローバルヒストリーの予測は個人ヒストリーと呼ばれます。
この文脈における「履歴」という言葉の使用と、並行コンピューティングとの関連性は、次のように理解できます。個々の履歴は、プロセス(またはスレッドまたはマシン)の状態のシーケンスの記録です。これはプロセスの状態の集合です。
2つ以上のアルファベットに存在する文字は、様々な個々の履歴間の同期の基本要素として機能する。つまり、そのような文字が1つの履歴に存在する場合、それは必ず他の履歴にも存在し、それらを「結びつける」あるいは「合流させる」役割を果たす。
例えば、そして組合のアルファベットはもちろん基本的な歴史は、、、そしてこの例では、最初のプロセスの個々の履歴は次のようになります。2番目の機械の個々の履歴はこれら二つの個々の歴史は、世界史によって代表される。なぜなら、この文字列を個々のアルファベットに投影すると、個々の歴史が得られるからである。グローバルな歴史では、文字はそして文字と交換可能と考えることができるそしてつまり、これらのプロセスは個々の履歴を変更することなく再配置できるということです。このような交換は、単に最初のプロセスと2番目のプロセスが同時に実行されており、互いに順序付けされていないことを示しているにすぎません。つまり、それらは(まだ)メッセージを交換したり、同期を実行したりしていません。
手紙同期プリミティブとして機能し、その出現はグローバル履歴と個別履歴の両方において交換不可能な地点を示す。したがって、文字はそして過去に並べ替えることができますそしてそれらは過去には並べ替えることができませんこうして世界史はそして世界史両者とも個々の歴史を持っているそしてこれは、前後に起こる可能性があるしかし、手紙は同期しているので、必ず起こる、 それでもとは異なるプロセスにある。
履歴モノイドはトレースモノイドと同型であり、したがってモノイドの圏における半アーベル圏積の一種である。特に、履歴モノイドはトレースモノイドと同型である依存関係は次のように与えられる。
簡単に言うと、これは上記の非公式な議論を正式に述べたもので、アルファベットの文字です。アルファベットの文字を超えて可換に並べ替えることができるただし、両方のアルファベットに存在する文字の場合は例外です。したがって、痕跡はまさにグローバルな歴史であり、その逆もまた然りです。
逆に、任意のトレースモノイドが与えられた場合アルファベットのシーケンスを取ることで、同型な履歴モノイドを構築できます。どこすべてのペアの範囲。