let A(n) | B() = P(n) and A(n) | C() = Q(n) ;;This defines three names

According to the general join-calculus semantics, the guarded process

Reactivity information is to be considered at the definition level, since matching is indeed performed at this level. Moreover, in order to use finite-state automata, we want this information to range on a finite set of possible values. As far as matching is concerned and by the linearity of patterns, only the presence or absence of messages matters. Thus, let us call

For instance, if some messages are pending on

A

Definition status evolves towards matching status as messages arrive. This yields a first kind of “increasing” transitions. More specifically, when a message arrives on some name, then this name status either evolves from

Definition status also evolves when matching occurs. This yields new, “decreasing”, transitions that we call matching transitions. According to the join-calculus semantics, matching may occur at any moment (provided of course that matching is possible). As a consequence, matching transitions start from matching states and they are unlabeled. In the

Observe that there may be several matching transitions starting from a given status. This is not always a consequence of the non-deterministic semantics of the join-calculus.

Often, ambiguity is only apparent. For instance, matching transitions starting from

However, some true non-determinism is still present. Consider status

Finally, a view of join-matching compilation can be given by taking together both kinds of transitions. This yields a non-deterministic automaton.

Note that matching of non-linear patterns can also be compiled using automata. For instance, if a name appears at most twice in one or more pattern, then it status will range on

Fortunately, it is quite possible to do so. It suffices to perform matching as soon as possible. More precisely, when a message arrives and carries definition status into matching status, matching is performed immediately, while definition status is adjusted to reflect message consumption. This results in pruning the status space just below matching statuses.

In practise, in the

Observe that all transitions are now labeled and that a name labels a transition when message reception on this name triggers that transition. Furthermore, matching transitions that correspond to firing

For instance, there are two

By contrast, from status

In the rest of the paper, we take automata such as the one of figure 1 as suitable abstractions of join-pattern compilation output.

As an example of the consequence of the “match as soon as possible” behavior, consider this definition:

let A() = print(1); and B() = print(2); and A() | B() = print(3); ;;Then, we get the following automaton: Status

Next, to illustrate the effect of deleting ambiguous matching transitions, consider the following definition:

let A() = print(1); and A() | B() = print(2);Such a definition will get compiled into one of the following deterministic automata: In the case of the left automaton, only