代数演算子
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2021/09/13 22:25 UTC 版)
「Communicating Sequential Processes」の記事における「代数演算子」の解説
CSP には様々な代数演算子がある。主なものを以下に挙げる。 プレフィックス プレフィックス演算子は、イベントとプロセスを結合して新たなプロセスを生成する。たとえば、 a → P {\displaystyle a\rightarrow P} は、 a {\displaystyle {\mathit {a}}} にその環境と通信させようとするプロセスであり、 a {\displaystyle {\mathit {a}}} の後では、プロセス P {\displaystyle {\mathit {P}}} として振舞う。 決定的選択 決定的(または外部)選択演算子は、プロセスの将来を2つのコンポーネントプロセス間の選択で定義可能とするもので、プロセス群と初期イベントとのやり取りによって環境が選択を行うことを可能にする。たとえば ( a → P ) ◻ ( b → Q ) {\displaystyle \left(a\rightarrow P\right)\Box \left(b\rightarrow Q\right)} は、初期イベント a {\displaystyle {\mathit {a}}} および b {\displaystyle {\mathit {b}}} とやり取りしようとするプロセスであり、環境がどちらの初期イベントとやり取りすることを選択したかによって、 P {\displaystyle {\mathit {P}}} または Q {\displaystyle {\mathit {Q}}} として振舞うようになる。 a {\displaystyle {\mathit {a}}} および b {\displaystyle {\mathit {b}}} と同時にやり取りする場合、選択は非決定的となる。 非決定的選択 非決定的(または内部)選択演算子は、プロセスの将来を2つのコンポーネントプロセス間の選択で定義可能とするものだが、環境がどちらのコンポーネントプロセスを選択するかを制御できない。たとえば ( a → P ) ⊓ ( b → Q ) {\displaystyle \left(a\rightarrow P\right)\sqcap \left(b\rightarrow Q\right)} は、 ( a → P ) {\displaystyle \left(a\rightarrow P\right)} または ( b → Q ) {\displaystyle \left(b\rightarrow Q\right)} のどちらかとして振舞う。 a {\displaystyle {\mathit {a}}} または b {\displaystyle {\mathit {b}}} を受容することを拒否でき、環境が a {\displaystyle {\mathit {a}}} と b {\displaystyle {\mathit {b}}} の両方を提供する場合にそれとやり取りするだけである。決定的選択で選択肢である2つの初期イベントが同一である場合、非決定性が生じる。したがってたとえば、 ( a → a → S T O P ) ◻ ( a → b → S T O P ) {\displaystyle \left(a\rightarrow a\rightarrow STOP\right)\Box \left(a\rightarrow b\rightarrow STOP\right)} は次と等価である。 a → ( ( a → S T O P ) ⊓ ( b → S T O P ) ) {\displaystyle a\rightarrow \left(\left(a\rightarrow STOP\right)\sqcap \left(b\rightarrow STOP\right)\right)} インターリーブ インターリーブ演算子は、完全に独立した並行動作を表す。次のプロセス P | | | Q {\displaystyle P\;\vert \vert \vert \;Q} は、 P {\displaystyle {\mathit {P}}} と Q {\displaystyle {\mathit {Q}}} が同時並行に動作することを意味する。両方のプロセスが発生するイベントは時系列上でインターリーブされる。 インタフェース並列 インタフェース並列演算子は、コンポーネントプロセス間で同期を必要とする並行動作を表す。インタフェースにおけるイベントは、全コンポーネントプロセスがそのイベントに関わることが可能な場合にのみ発生する。たとえば、次のプロセス P | [ { a } ] | Q {\displaystyle P\left\vert \left[\left\{a\right\}\right]\right\vert Q} は、イベント a {\displaystyle {\mathit {a}}} が発生する前に P {\displaystyle {\mathit {P}}} と Q {\displaystyle {\mathit {Q}}} が共にそのイベントを扱える状態になっている必要があることを意味する。したがって例えば、次のプロセス ( a → P ) | [ { a } ] | ( a → Q ) {\displaystyle \left(a\rightarrow P\right)\left\vert \left[\left\{a\right\}\right]\right\vert \left(a\rightarrow Q\right)} は、イベント a {\displaystyle {\mathit {a}}} を扱うことができ、次のように表せる。 P | [ { a } ] | Q {\displaystyle P\left\vert \left[\left\{a\right\}\right]\right\vert Q} 一方 ( a → P ) | [ { a , b } ] | ( b → Q ) {\displaystyle \left(a\rightarrow P\right)\left\vert \left[\left\{a,b\right\}\right]\right\vert \left(b\rightarrow Q\right)} は、単純なデッドロックを意味する。 隠蔽 隠蔽演算子は、何らかのイベントを観測不可能とすることでプロセスの抽象化手段を提供する。隠蔽の例として次の ( a → P ) ∖ { a } {\displaystyle \left(a\rightarrow P\right)\setminus \left\{a\right\}} は、イベント a {\displaystyle {\mathit {a}}} が P {\displaystyle {\mathit {P}}} の中で出現しないものとすると、以下のように省略可能である。 P {\displaystyle {\mathit {P}}}
※この「代数演算子」の解説は、「Communicating Sequential Processes」の解説の一部です。
「代数演算子」を含む「Communicating Sequential Processes」の記事については、「Communicating Sequential Processes」の概要を参照ください。
- 代数演算子のページへのリンク