Pipe-calculus: Difference between revisions

Line 249: Line 249:
\def\fail{\textbf{fail}}
\def\fail{\textbf{fail}}
\def\pipe{\rhd}
\def\pipe{\rhd}
\def\pass{\textbf{pass}}
\def\in{\,?}
\def\in{\,?}
\def\out{!}
\def\out{!}
Line 271: Line 270:
</math>
</math>


Unlike other combinators, rules for <math>\pipe</math> has to be attempted in the listed order. <ref>This is only a technical detail. Rewrite rules can be defined without overlapping but it requires more cases.</ref>
Unlike other combinators, rules for <math>\pipe</math> have to be attempted in the listed order. There are multiple reasons to this.
As it fails in the default case, <math>\pipe</math> never occurs in normal forms.
 
# The processes <math>a^- . s \pipe a^+ . t</math> and <math>\in x . s \pipe \out t . u</math> behave differently depending on the order of rule application, even if their normal forms are identical.
# The process <math>r \alt s \pipe t \alt u</math> produces subresults in different order depending of the order of rule application. Explicit application order avoids nondeterminism in both cases.
# We need a default rule that fails in order to ensure that <math>\pipe</math> never occurs in normal forms<ref>The default case allows for embedding synchronisation failure in the object language, so it can be captured by <math>\mid</math>.</ref>.


<math>
<math>
\begin{alignat}{1}
\begin{alignat}{2}
a^+ . s \pipe a^- . t \rew & s \pipe t \\
a^+ . s \pipe a^- . t \rew & s \pipe t \\
\out s . t \pipe \in x . u \rew & t \pipe u[s/x] \\
\out s . t \pipe \in x . u \rew & t \pipe u[s/x] \\
r \alt s \pipe t \alt u \rew & (r \pipe t \alt u) \alt (s \pipe t \alt u) \\
s \alt t \pipe u \rew & (s \pipe u) \alt (t \pipe u) \\
s \alt t \pipe u \rew & (s \pipe u) \alt (t \pipe u) \\
s \pipe t \alt u \rew & (s \pipe t) \alt (s \pipe u) \\  
s \pipe t \alt u \rew & (s \pipe t) \alt (s \pipe u) \\  
\fail \pipe t \rew & t \\
\fail \pipe t \rew & t \\
s \pipe t \rew & \fail \\
s \pipe \succeed \rew & \succeed \\
s \pipe t \rew & \fail & \\
\end{alignat}
\end{alignat}
</math>
</math>
283

edits