{'fraction_non_alphanumeric': 0.04018737672583826, 'fraction_numerical': 0.004098865877712032, 'mean_word_length': 4.378584452179679, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Priorities Without Priorities: Representing Preemption in Psi-Calculi

Psi-calculi is a parametric framework for extensions of the pi-calculus with data terms and arbitrary logics. In this framework there is no direct way to represent action priorities, where an action can execute only if all other enabled actions have lower priority. We here demonstrate that the psi-calculi parameters can be chosen such that the effect of action priorities can be encoded. To accomplish this we define an extension of psi-calculi with action priorities, and show that for every calculus in the extended framework there is a corresponding ordinary psi-calculus, without priorities, and a translation between them that satisfies strong operational correspondence. This is a significantly stronger result than for most encodings between process calculi in the literature. We also formally prove in Nominal Isabelle that the standard congruence and structural laws about strong bisimulation hold in psi-calculi extended with priorities.


Introduction
Priorities in process calculi allow certain actions to take precedence over others. This is useful when modelling systems because it admits more fine-grained control over the model's behaviour. Phenomena that exhibit prioritised behaviour include eg. interrupts in operating systems, and exception handling in programming languages. In this paper we demonstrate how priorities can be represented in the psicalculi framework, by encoding them into the logical theory that determines how actions are generated by process syntax.
Psi-calculi [3] is a family of applied process calculi that generalises the pi-calculus in three ways. First, the subjects (designating the communication channels) and objects (designating the communicated data) of input and output actions may be terms taken from an arbitrary set, and not just single names. Second, equality tests on names are replaced by tests of predicates called conditions, taken from an arbitrary logic. Finally, the process syntax is extended with assertions, which can be seen as introducing new facts about the environment in which a process executes. The unguarded assertions of a process influence the evaluation of conditions and the connectivity between channel terms, and can change as the process executes.
In this paper, we show that the psi-framework is sufficiently expressive to represent action priorities derived from a priority order on the communication channels. We are interested in priorities for two reasons. First, previous work on priorities indicate that they are highly expressive: Jeffrey defines a process calculus with time and priority where timed processes can be encoded in the untimed fragment of the calculus [15]; Jensen shows that CCS augmented with priority choice can encode broadcast communication [16]; and Versari et al. shows that CCS with priority and only the prefix and parallel operators can solve both leader election (unlike the pi-calculus), and the "last man standing"-problem (unlike the broadcast pi-calculus) [23]. Second, we are not aware of another process calculus (without priorities) where adding priorities has been shown to yield no increased expressiveness. The prevailing methods to introduce priorities in process algebras are through semantic rules with negative premises or new auxiliary relations to express the absence of higher-priority actions; we shall need none of those.
We accomplish our result as follows. First we define an extension of the psi-calculi framework with explicit channel priorities, where the priority level of a channel can change dynamically during process execution, as defined by an auxiliary relation representing absence of actions. We formally prove, using the interactive theorem prover Isabelle [18], that in this setting strong bisimilarity satisfies the usual algebraic laws and congruence properties familiar from the pi-calculus. We proceed to show that for every psi-calculus with priorities, separate choice and prefix-guarded replication, it can be encoded in a standard psi-calculus without priorities. This encoding satisfies particularly strong quality criteria, namely strong operational correspondence, meaning that the translation does not introduce any protocol in the target language. The main idea is that we use a non-monotonic logic for the assertions, where the appearance of enabled high-priority channels can temporarily prevent lower priority channels from resulting in actions.
The rest of the paper is structured as follows. In Section 2 we briefly recapitulate the essentials of psi-calculi, and in Section 3 we define the extension with explicit channel priorities. Section 4 contains an encoding into standard psi-calculi. In Section 5 we establish strong operational correspondence and briefly discuss other criteria for encodings, among them full abstraction, and Section 6 contains conclusions with future work.
Full proofs of all theorems presented in this paper are available online at http://www.it.uu.se/ research/group/mobility/prio-proofs.pdf.

Psi-calculi
The following is a quick recapitulation of the psi-calculi framework. For an in-depth introduction with motivations and examples we refer the reader to [3].
We assume a countably infinite set of atomic names N ranged over by a, b, . . . , z. Intuitively, names are the symbols that can be scoped and be subject to substitution. A nominal set [21,12] is a set equipped with a formal notion of what it means to swap names in an element; this leads to a notion of when a name a occurs in an element X , written a ∈ n(X ) (pronounced "a is in the support of X "). We write a#X , pronounced "a is fresh for X ", for a ∈ n(X ), and if A is a set of names we write A#X to mean ∀a ∈ A . a#X . In the followingã is a finite sequence of names. The empty sequence is written ε and the concatenation ofã andb is writtenãb. We say that a function symbol is equivariant if all name swappings distribute over it.
A nominal datatype is a nominal set together with a set of functions on it. In particular we shall consider substitution functions that substitute elements for names. If X is an element of a datatype,ã is a sequence of names without duplicates andỸ is an equally long sequence of elements of possibly another datatype, the substitution X [ã :=Ỹ ] is an element of the same datatype as X . The substitution function can be chosen freely, but must satisfy certain natural laws regarding the treatment of names; it must be equivariant, the names a in X [ a := T ] must be alpha-convertible as if they were binding in X . See [3] for details.
A psi-calculus is defined by instantiating three nominal data types and four equivariant operators; formally it is a tuple (T, A, C, ⊢, ⊗, . ↔, 1) as follows.
Definition 1 (Psi-calculus parameters). A psi-calculus requires the three (not necessarily disjoint) nominal data types: the (data) terms T, ranged over by M, N, the conditions C, ranged over by ϕ, the assertions A, ranged over by Ψ, and the four operators: .
The binary functions above will be written in infix. Thus, M . ↔ N is a condition, pronounced "M and N are channel equivalent". We write Ψ ⊢ ϕ, pronounced "Ψ entails ϕ", for (Ψ, ϕ) ∈ ⊢, and if Ψ and Ψ ′ are assertions then so is Ψ ⊗ Ψ ′ , which intuitively represents the conjunction of the information in Ψ and Ψ ′ .
We say that two assertions are statically equivalent, written Ψ ≃ Ψ ′ if they entail the same conditions, i.e. for all ϕ we have that Ψ ⊢ ϕ iff Ψ ′ ⊢ ϕ. We impose certain requisites on the sets and operators: channel equivalence must be symmetric and transitive, ⊗ must be compositional with regard to ≃, and the assertions with (⊗, 1) form an abelian monoid modulo ≃. A frame is an assertion together with a sequence of names that bind into it: it is of the form (ν b)Ψ where b binds into the assertion Ψ. We use F, G to range over frames. We overload Ψ to also mean (νε)Ψ and ⊗ to composition on frames defined by We define F ⊢ ϕ to mean that there exists an alpha variant (ν b)Ψ of F such that b#ϕ and Ψ ⊢ ϕ. We also define F ≃ G to mean that for all ϕ it holds that F ⊢ ϕ iff G ⊢ ϕ. Definition 2 (Psi-calculus agents). Given a psi-calculus P with parameters as in Definition 1, the agents P(P), ranged over by P, Q, . . ., are of the following forms.
Restriction (νa)P binds a in P and input M(λ x)N . P binds x in both N and P. An occurrence of a subterm in an agent is guarded if it is a proper subterm of an input or output term. An agent is assertion guarded if it contains no unguarded assertions. An agent is well-formed if in M(λ x)N.P it holds that x ⊆ n(N) is a sequence without duplicates, that in a replication !P the agent P is assertion guarded, and that in case ϕ 1 : P 1 [] · · · [] ϕ n : P n the agents P i are assertion guarded. The agent case ϕ 1 : P 1 [] · · · [] ϕ n : P n is sometimes abbreviated as case ϕ : P. We sometimes write M(x).P for M(λ x)x.P. From this point on, we only consider well-formed agents.
The frame F (P) of an agent P is defined inductively as follows: The actions ranged over by α, β are of the following three kinds: Output M(νã)N, input M N, and silent τ. Here we refer to M as the subject and N as the object. We and P, and that b Q is similarly fresh. In the rule PAR we assume that define bn(M(νã)N) =ã, and bn(α) = / 0 if α is an input or τ. As in the pi-calculus, the output M(νã)N represents an action sending N along M and opening the scopes of the namesã.

Definition 3 (Transitions).
A transition is written Ψ ✄ P α −→ P ′ , meaning that in the environment Ψ, P can do α to become P ′ . The transitions are defined inductively in Table 1 We identify alpha-equivalent agents, frames and transitions. In a transition the names in bn(α) bind into both the action object and the derivative, therefore bn(α) is in the support of α but not in the support of the transition.

Definition 4 (Strong bisimulation). A strong bisimulation R is a ternary relation on assertions and pairs of agents such that
We define Ψ ✄ P . ∼ Q to mean that there exists a bisimulation R such that R(Ψ, P, Q), and write P . ∼ Q, pronounced P and Q are (strongly) bisimilar, for 1 ✄ P . ∼ Q.
Definition 5 (Strong congruence). We define P ∼ Ψ Q to mean that for all substitution sequences σ , Ψ ✄ Pσ . ∼ Qσ holds. We write P ∼ Q, pronounced P is (strongly) congruent to Q, to mean P ∼ 1 Q.
We have shown [3] that strong bisimilarity preserves all operators except input, and that strong congruence is a congruence and satisfies the expected algebraic laws for structural congruence.

Extension: Psi-calculi with priorities
The most common approaches to implementing priorities in process calculi are (1) to add a priority operator Θ such that Θ(P) may only take the highest-priority actions of P as defined by some ordering on actions [1], and (2) to alway enforce priorities, rather than only at special operators [9,10]. In order to avoid introducing a new operator, we follow the second approach.
We associate a priority level to actions that may depend on the assertion environment, and hence change dynamically as a process evolves. The intuition is that we write Ψ ⊢ M : p to mean that the priority level of communication on the channel M in the environment Ψ is p, where lower values of p indicate higher priority. Priorities are subject to some natural constraints: they must be equivariant, and in a given assertion, channel equivalent terms must have the same unique priority level.
Definition 6 (Psi-calculi with priorities). A psi-calculus with priorities, ranged over by P, Q, is a tuple The semantics of psi-calculi with priorities is as the semantics of psi-calculi, but with two changes. The first is that τ actions are replaced with τ : p actions, where p is the priority level of the transition. The second is that the rules are augmented with side conditions that prevent a process from taking low priority actions. This has a natural formulation in terms of negative premises [5], but in order to make implementation in Isabelle easier we instead define the semantics in two layers, following [9,10,22].
The bottom layer is denoted with the transition arrow −→ b and is used to determine which transitions would be available, disregarding priorities. The semantics of −→ b is exactly as in Table 1 with the sole extension that the COM rule generates an action of kind τ : p, where p is derived from the priority of the channel. We then define a predicate H(α, Ψ, P), which intuitively means that no τ transition whose priority is higher than that of α can be derived from P in Ψ. Finally we define −→ p to represent transitions respecting priorities, where the CASE, PAR, and COM rules get side conditions using H.
Definition 8 (Transitions with priorities). The transitions of psi-calculi with priorities are defined inductively by the same rules as in Table 1, but with all occurrences of −→ replaced with −→ p , and the CASE, COM and PAR rules replaced by the following: The transition relation −→ b is defined by the same rules as −→ p , but with all side conditions involving H omitted.
Strong bisimulation and strong congruence on psi-calculi with priorities can be obtained from Definitions 4-5 by replacing all occurrences of −→ with −→ p . The meta-theory pertaining to strong bisimulation from the original psi-calculi carries over to psi-calculi with priorities, and formal proofs in Isabelle have been carried out: Theorem 1. Strong congruence ∼ on psi-calculi with priorities is a congruence, and satisfies As an example, Versari's π@ [22] is an extension of the pi-calculus with priorities. Input and output prefixes in π@ are of form µ : k(y) and µ : k z , where µ is the subject, k is the priority level and y and z are the objects. The semantics is the standard reduction semantics of the pi-calculus, augmented with side conditions stating that no higher-priority reduction is possible, similar to our use of the H predicate.
π@ can be recovered in our framework as follows. For simplicity we consider only monadic synchronisation. Let the terms be the union of N (corresponding to objects in π@) and {a : n|a ∈ N , n ∈ N} (corresponding to subjects annotated with their priority level), let the conditions be the booleans and the assertions be {1}. Define channel equivalence and : so that a : n is equivalent to itself and has priority n.
As an immediate consequence, we equip π@ with a labelled semantics and a theory of strong bisimulation; no labelled semantics or bisimulation theory has been previously developed for π@.
Note that in our representation of π@, it is possible to write agents where the term a : n occurs in object position. We can rule out such ill-formed agents by using the sort system for psi-calculi described in [6], the details of which are beyond the scope of the present paper.
For a slightly more involved example, we consider dynamic priorities. We define a psi-calculus with priorities based on the pi-calculus, with the addition that channels may have one of two priority levels: 0 (high) and 1 (low). Rather than annotating prefixes with a priority level, we let channels have high priority by default, and let our assertions be the set of channels whose priority have been flipped to low priority. If a channel is asserted to be flipped twice, the assertions cancel each other and the channel is flipped back to high priority. Thus we may flip the priority of a channel a dynamically by asserting {a}. Similarly, asserting {a, b} flips the priorities of both a and b. Composition of assertions is exclusive or, e.g. {a} ⊗ {a, b} = {b}. To illustrate how this calculus can be used, suppose we want to enforce a fairness scheme such that synchronisations on two channels x and y are guaranteed to interleave. This can be achieved by swapping the priorities of x and y after every such synchronisation, as in the following derivation sequence, where for all z ∈ {x, y} we let Note that the above τ sequence is the only possible τ sequence -as long as both x and y are available they are guaranteed to be consumed alternatingly.
Formally, we define this psi-calculus by letting T = N , C = {x = y | x, y ∈ T} ∪ {M : n | M ∈ T ∧ n ∈ N} and by letting A be the finite sets of names. Moreover, let 1 be the empty set and Finally, we let channel equivalence be syntactic equality on names.
The definition of composition as the pairwise exclusive or on the elements of its arguments achieves the priority flip in a manner that is associative, commutative and compositional. This is a useful general technique for constructing psi-calculi where facts can be retracted.

Encoding priorities
In this section we present a translation from psi-calculi with priorities to the original psi-calculi. The main idea is that we augment the assertions with information about prefixes, and ensure that the frame of a process records precisely its enabled prefixes. The H predicate is thus obtained from the entailment relation.
The main technical complication with this idea is that when P takes a transition to P ′ , some of the top-level prefixes of P may be absent in P ′ . The frame of P ′ will always be the frame of P composed with assertions that are guarded in P and unguarded in P ′ ; in other words F (P ′ ) ≃ (ν b P ′ )(Ψ P ⊗ Ψ). It follows that composing with this Ψ must in effect retract the prefixes no longer available in P ′ from Ψ P . For this purpose we use a non-monotonic logic, where assertions contain multisets with negative occurrence [4].

Preliminaries: integer-indexed multisets
Intuitively, an integer-indexed multiset is like a regular multiset, except that the number of occurrences of an element may be negative. We use finite integer-indexed multisets with a maximum element (henceforth abbreviated FIMM), ranged over by E. Let Z ∞ denote Z ∪ {∞}. Formally, the FIMMs over a set S is the set of functions E : S ⇒ Z ∞ such that for all but finitely many elements s ∈ S, E(s) = 0. We define some of the usual operations on sets as follows: The maximal element ∞ will be used to represent prefixes under a replication operator (these are permanently enabled and cannot ever be retracted). We will write {(z 0 )x 0 , . . . , (z n )x n } for the multiset E such that E(x i ) = z i if 0 ≤ i ≤ n, and E(x i ) = 0 otherwise. We will sometimes write x i to mean (1)x i and −x i to mean (−1)x i .

Preliminaries: Requisites and guarding elements
From this point in the paper, we restrict attention to psi-calculi with separate choice and prefix-guarded replication. In other words, case statements have the form case ϕ : α.P, where either every α i is an input, or every α i is an output. Moreover, replications are of the form ! α.P. These restrictions significantly simplify our definitions and proofs. In the conclusion we briefly discuss what would be involved to lift them.
We also require that substitution has no effect on terms where the names being substituted do not occur, i.e. that if x#M then M[ x := T ] = M. This natural requirement on substitution is found in the original publication on psi-calculi [2], but is often omitted since it is not needed for the standard structural and congruence properties of bisimulation.
Further, for convenience we will assume that the psi-calculus under consideration has a condition ⊤ that is always true in every context, i.e. it is such that ∀Ψ.Ψ ⊢ ⊤, ∀σ .⊤σ = ⊤ and n(⊤) = / 0. If such a condition is absent, it can simply be added.
A guarding element is simply a prefix guarded by a condition. Enriching the assertions with FIMMs of guarding elements will provide all the information necessary to encode H in the entailment relation. We consider guarding elements as implicitly quotiented by alpha-equivalence, where the names x in the input prefix M(λ x)X bind into N. We will sometimes write α to mean (⊤, α).

The encoding
Assume a psi-calculus with priorities P = (T, A, C, ⊢, ⊗, . ↔, 1, :). We shall encode it in the psi-calculus . ↔ ′ , (1, / 0)), whose parameters are defined as follows: Assertions in A ′ augment the original assertions with FIMMs of guarding elements, representing the top-level prefixes of a process. The conditions are augmented with multiplicity tests on elements of the FIMMs (only needed for technical reasons concerning the compositionality of ⊗ ′ ), as well as channel equivalence statements. Composition and entailment of multiplicity tests and conditions in C are straightforward. The definition of entailment of channel equivalence statements intuitively means that two channels M, N are equivalent in (Ψ, E) if (1) they are equivalent in Ψ, and (2) E does not contain prefixes that can communicate with each other with a priority higher than that of M, N. This is the mechanism by which we prevent lower-priority actions in the translations: those actions that would be ruled out by H in P are ruled out in Q by not being channel equivalent to anything.

Lemma 2. Q is a psi-calculus, meaning that it satisfies the requisites outlined in Section 2.
The translation of agents from P to Q is defined by the function : P(P) ⇒ P(Q). The main idea is that in parallel to every prefix, we add the prefix as an assertion (recall that Ψ denotes the assertion Ψ occurring as a process), so that it can be used when deciding channel equivalences. The continuation after the prefix contains the same prefix negatively, and since {α} ∪ {−α} = / 0 the effect is to retract the prefix from the frame once it has been used, and thus ensures that the frame of an agent P contains an up-to-date copy of the top-level prefixes of P. Since replicated prefixes are permanently enabled, a replicated prefix is asserted with infinite multiplicity to ensure that it is never retracted. For case statements, we make sure to retract the guarding elements associated with the other branches after a particular branch has been chosen.
Recall that we require that substitution has no effect on terms where the names being substituted

Quality of the encoding
In this section, we show that the encoding presented in Section 4.3 satisfies strong operational correspondence, and briefly discuss two other quality criteria: Gorla's framework [13] and full abstraction.
The main result of this paper is a one-to-one transition correspondence between agents in P and their encodings in Q: Theorem 3 (Strong operational correspondence).
Gorla [13] proposes a unified approach to encodability results, wherein a translation function is considered an encoding if it satisfies the five properties compositionality, name invariance, operational correspondence, divergence reflection, and success sensitiveness.
Because our encoding satisfies strong operational correspondence, the three last criteria follow immediately. Name invariance is immediate since our encoding is equivariant, and compositionality holds with the caveat that we must consider replicated prefixes !α.P as an operator in itself, rather than considering the replication and the prefix as separate operators, and likewise for case-guarded prefixes.
Full abstraction means that two agents are equivalent iff their translations are equivalent. The encoding presented in Section 4.3 is not fully abstract with respect to strong bisimilarity. This is because we require bisimilar agents to be statically equivalent, but the translation function introduces assertions such that the translation of bisimilar agents may not be statically equivalent. For a simple example, consider the agents P = α.0 and Q = α.P, where α is an output prefix. Clearly P | P . ∼ p Q holds, but for P = α | α.(0 | −α ) and Q = α | α.( P | −α ), we have F ( P | P ) ⊢ ′ (2)α but F ( Q ) ⊢ ′ (2)α and hence P | P . ∼ Q . At first glance, this difference between P | P and Q seems to be an unimportant technicality: the conditions (2)α and (1)α are not intended to be used as guards in case-statements. Their only use is in the evaluation of channel equivalences, but F ( P | P ) and F ( Q ) entail the same channel equivalences since the set of prefixes available coincides. To motivate that they must be considered different, consider the distinguishing context R = −α | β | γ.0, where β is an input that can synchronise with α, and γ has lower priority than α; we have that R | Q can take an action on γ, but R | P | P cannot. This highlights an interesting difference between P and Q: in P, a prefix describes both an interaction possibility and a constraint on other (lower-priority) interactions; in Q, the interaction possibility and interaction constraint are two separate syntactical elements. This means that in Q we may write α , which is a process with no transitions that blocks lower-priority transitions as though it had an α-transition; conversely α.P has a non-blocking α-transition that may be blocked by higher-priority transitions.
Note that in the counterexample to full abstraction presented above, the context R is not in the range of · . Thus our encoding may well satisfy weak full abstraction [19], meaning that full abstraction holds if we restrict attention to contexts in the range of · . An investigation of this is deferred to future work.
A related question is whether a fully abstract encoding of P into some psi-calculus exists. The following theorem, inspired by recent work by Gorla and Nestmann [14] and Parrow [20] , shows that because of the generality of the psi-calculi framework a trivial fully abstract "encoding" with strong bisimilarity as the target equivalence always exists, regardless of the source language and source equivalence under consideration.
Let S be a set ranged over by s, and ∼ be an equivalence on S. Then there is a psi-calculus S with no terms, with elements of S as assertions and conditions, where entailment is ∼. Define the encoding S : S ⇒ P(S ) by s S s .
This "encoding" simply embeds both the source language and source equivalence into a target language with no transition behaviour at all. We conclude that a meaningful approach to full abstraction would have to impose additional criteria. For an example, if we consider Gorla's criteria presented earlier, this "encoding" satisfies name invariance and divergence reflection, but fails to satisfy compositionality, operational correspondence and success sensitiveness.

Conclusion
In this paper, we have defined an extension of the psi-calculi framework with dynamic action priorities, and translated it to the original framework. This illustrates the high expressiveness of the assertion mechanism in psi-calculi: usually, it is necessary to introduce negative premises or define a multi-layered transition system in order to obtain action priorities in a given calculus; for psi-calculi, what is already there suffices.
The extension with explicit priorities is interesting in its own right despite the encoding. Expressiveness is not usefulness. Modelling a system with priorities in terms of the translation would be more cumbersome than representing priorities directly. Also, strong bisimulation in the extension is useful for proving equivalences that fail to hold in the encoding.
The most closely related development to psi-calculi with priorities is the attributed pi-calculus with priorities, written π(L ) [17]. It is designed as a generalisation of π@ [22] and the stochastic pi-calculus. Input and output prefixes take the form e 1 [e ′ 1 ]?
x and e 2 [e ′ 2 ]! y, where e 1 and e 2 are subjects, x and y are objects and e ′ 1 and e ′ 2 are interaction constraints, which may be instantiated to priorities or stochastic rates. e ranges over expressions in an attribute language, which is a kind of call-by-value λ -calculus equipped with a big-step reduction relation. The idea in the case of priorities is that if the expressions e 1 and e 2 reduce to the same channel name, and e reduces to some values v, and the application e ′ 1 e ′ 2 reduces to the priority level r, then e 1 [e ′ 1 ]? x.P | e 2 [e ′ 2 ]! e.Q reduces to P[ x : = v] | Q, unless another pair of prefixes can similarly communicate on a higher priority level. The focus is on developing type systems to prevent mismatches, on showing how the calculus can be applied to model phenomena in systems biology, and on the development and implementation of a stochastic simulation algorithm.
While π(L ) and our approach both generalise π@, the way the priorities are set up have several interesting differences that suggest incomparable expressive power in general. Priority levels in π(L ) are taken from an arbitrary partial order, whereas our priorities are natural numbers. Thus in π(L ) we may have systems where actions have mutually incomparable priority levels, unlike psi-calculi with priorities. The reason we use natural numbers is that the proof of Theorem 1 uses induction and successor arithmetic on the priority level; for future work we would like to investigate alternative proof strategies that would permit a generalised notion of priorities. In psi-calculi, priority levels are associated to communication channels, whereas in π(L ) they are associated with a particular pair of prefixes. The priority level of a particular pair in π(L ) is however static and cannot be influenced by the environment in any way, whereas in our approach priorities are dynamic and may change arbitrarily as the assertion environment evolves. While psi-calculi has no explicit notion of computation on data such as that given by the attribute language, the substitution function can be chosen so that it performs explicit computation on data, or implicit computation can be performed during the evaluation of entailments. For a detailed discussion of how to express computation on data in psi-calculi we refer to [6].
The translation assumes separate choice and prefix-guarded replication. An interesting question is if these assumptions can be relaxed. Allowing mixed choice is possible, but a different definition of guarding elements must be made, that records which prefixes occur in different branches of the same case-statement. With the current definition, case ⊤ : M [] ⊤ : M has the same guarding elements as M | M , meaning that the former erroneously blocks other transitions as if a communication on M could be derived. Allowing unguarded choice and replication would be more difficult, but we conjecture that it is possible at the expense of compositionality. The solution would involve extending the guarding elements to contain whole syntax trees, including binders. We then lose compositionality since if e.g. case ⊤ : P [] ⊤ : Q takes a transition from Q, the derivative must contain an assertion that retracts all interaction possibilities offered by P. Hence the translation of Q depends on P, violating compositionality.
Another way to introduce priorities in process calculi is with a priority choice operator P+ Q, as is done for CCS in [8]. It is like the standard choice operator, with two exceptions. First, P and Q may for technical reasons not contain unguarded output prefixes. Second, transitions from P take precedence over Q. More precisely, its semantics is defined so that it may always act as P, but may act as Q only if no synchronisation on the prefixes of P is possible in the current environment. This operator could be encoded in psi-calculi using techniques similar to those presented in this paper. The main idea is to augment the assertions with information about output prefixes as in Section 4.3, and to translate priority choice as P+ Q = case ⊤ : P [] ϕ P : Q , where ϕ P is a condition that holds if no output prefixes matching the inputs of P are enabled in the current environment. A more detailed investigation of this idea is deferred to future work.
We would also like to investigate if a result by Jensen [16], that broadcast communication can be encoded in CCS with priority choice up-to weak bisimulation, can be adapted to our setting. If broadcast psi-calculi [7] can be encoded in psi-calculi with priorities, then by transitivity so can the original psicalculi. This would contrast with the situation in the pi-calculus, where broadcast communication cannot be encoded [11].
Since both the original psi-calculi and their extension with priorities have been formalised in Nominal Isabelle, we aim to formalise the correspondence results in this paper, in order to be more certain of their correctness. As a first step, it would be necessary to develop a formalisation of FIMMs in Isabelle, and integrate it with the nominal logic package.