Previous Contents Next

3.7   Join-patterns

join-pattern ::= pattern   { | pattern }
pattern ::= name (   [ name   { , name } ] )

Join-patterns are first used to define fresh port names. The simple pattern a (  x 1,... ,  x n) is a definition for a channel a of arity n. Sending n values v 1 , ..., v n on a results in the firing of a ``guarded'' process, with the variables x 1 , ..., x n bound to v 1 , ..., v n. The variables x 1 , ..., x n are much like formal parameters and their scope restricts to the guarded process. If a is a synchronous name, then an implicit continuation argument is created, which follows the same scope restrictions as other arguments.

Join-patterns also are templates that are the basic synchronization construct in the join-calculus. A join-pattern of the kind a 1 (   x 1 , ... ,   x m ) | ... |   a n (   y 1 , ... ,   y l ) defines the port names a 1, ...a n. It also expresses a synchronization between these names. When concurrent invocations on the port names a 1, ...a n are present, the join-pattern is enabled and some action is to be taken. The action is to fire a process that is guarded by the pattern. At that time, the formal parameters x 1 ,..., x m, ..., y 1 , ..., y l, are bound to the actual values given as arguments to the names a 1, ..., a n.

Patterns are linear: a variable cannot appear several times in a given pattern. This applies both to port names and formal arguments. At the moment, there are no anonymous formal parameters: formal arguments must all be variables.


Previous Contents Next