<figure><img src="image_1.png" /></figure>

HAL
open science

# Symbolic protocol verification with dice

Vincent Cheval, Raphaëlle Crubillé, Steve Kremer

## ► To cite this version:

Vincent Cheval, Raphaëlle Crubillé, Steve Kremer. Symbolic protocol verification with dice: Process equivalences in the presence of probabilities. Journal of Computer Security, 2023, pp.1-38.
10.3233/JCS-230037. hal-04179875

HAL Id: hal-04179875

https://inria.hal.science/hal-04179875

Submitted on 10 Aug 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Symbolic protocol verification with dice

*Process equivalences in the presence of probabilities*

Vincent Cheval<sup>a</sup>, Raphaëlle Crubillé<sup>b</sup> and Steve Kremer<sup>c</sup>

<sup>a</sup> Inria Paris, France

E-mail: vincent.cheval@inria.fr

<sup>b</sup> CNRS, LIS, Aix Marseille Univ, Université de Toulon, France

E-mail: raphaelle.crubille@lis-lab.fr

<sup>c</sup> Inria Nancy, LORIA, Université de Lorraine, France

E-mail: steve.kremer@inria.fr

**Abstract.** Symbolic protocol verification generally abstracts probabilities away, considering computations that succeed only with negligible probability, such as guessing random numbers or breaking an encryption scheme, as impossible. This abstraction, sometimes referred to as the perfect cryptography assumption, has shown very useful as it simplifies automation of the analysis. However, probabilities may also appear in the control flow where they are generally not negligible. In this paper we consider a framework for symbolic protocol analysis with a probabilistic choice operator: the probabilistic applied π-calculus. We define and explore the relationships between several behavioral equivalences. In particular we show the need for randomized schedulers and exhibit a counter-example to a result in a previous work that relied on non-randomized ones. As in other frameworks that mix both non-deterministic and probabilistic choices, schedulers may sometimes be unrealistically powerful. We therefore consider two subclasses of processes that avoid this problem. In particular, when considering purely non-deterministic protocols, as is done in classical symbolic verification, we show that a probabilistic adversary has—maybe surprisingly—a strictly superior distinguishing power for may testing, which, when the number of sessions is bounded, we show to coincide with purely possibilistic similarity.

Keywords: security protocols, symbolic verification, probabilistic process equivalences

## 1. Introduction

Automated symbolic protocol verification, based on the seminal work of Dolev and Yao [1], has nowadays reached a level of maturity enabling successful use on complex real-world security protocols, including TLS [2, 3], Signal [4], authentication protocols of the 5G standard [5], or EMV's secure payment protocols [6] to name only a few. In the symbolic model, a non-deterministic, computationally unbounded attacker is assumed to have complete control of the network, being able to intercept any messages, and forge new ones. As a counterpart, cryptography is *idealized* and the attacker can only use predefined rules to manipulate messages that are represented by terms, e.g., expressed by an equation $dec(enc(m, k), k) = m$ stating that a message $m$ encrypted with $k$ can be decrypted with the same key. This treatment of cryptography is in opposition to computational models where we assume a probabilistic polynomial time attacker, messages are represented by bitstrings and assumptions that an arbitrary such attacker has at most negligible probability of breaking a cryptographic primitive. Similarly, in the symbolic model, random values, such as keys or nonces, are chosen freshly from an infinite domain, rather than chosen randomly from a sufficiently large domain. These symbolic abstractions of
cryptography and randomness have even been shown sound [7] (under rather strong assumptions) and significantly ease the automation of proofs. Hence, symbolic modeling of messages is arguably useful for formally analyzing cryptographic protocols.

However, the above-described abstractions of randomness only apply to the *messages*, and not to the *control flow*. Typical examples which crucially rely on randomized control flow are mechanisms for providing anonymity, such as the dining cryptographers protocol [8], mix-nets [9] or Crowds [10]. In this paper, we will investigate indistinguishability properties, expressed as equivalences in a cryptographic process calculus, the applied *π*-calculus [11], extended with a probabilistic choice operator. Typically, the testing equivalence expresses that two processes are equivalent if they exhibit the same behaviour when put in parallel with an arbitrary attacker process. Our work presents foundations for a model that (i) extends the scope of symbolic protocol analysis to probabilistic protocols, and (ii) allows to consider a probabilistic attacker (even on non-probabilistic protocols). In particular, when we consider purely concurrent processes–without probabilistic behavior–the equivalence we obtain is strictly stronger than the standard testing equivalence on such purely concurrent processes; in other terms, probabilistic adversaries are–for good reasons, as we will argue–more powerful in order to distinguish such processes than the purely concurrent adversaries considered in existing works and tools.

<figure><img src="image_3.png" /><figcaption>Figure 1. Summary of the relationship between preorders.</figcaption></figure>

**Our contributions.** In a first part we introduce a probabilistic applied *π*-calculus and its semantics, which has similarities to [12], with two major differences. (i) We express our semantics in terms of general non-deterministic probabilistic transition systems (NPLTS)–also called probabilistic automata in the literature–which allows us to benefit from a large body of existing results on these systems [13–19]. (ii) More importantly, we differ in the way non-determinism is resolved: unlike [12] we allow for *randomized schedulers*—rather than choosing one particular non-deterministic choice, we allow the scheduler to choose an arbitrary distribution on the available non-deterministic choices.

Second, we define several notions of preorders and equivalences and study their relations. The main results are also summarized in Figure 1, focusing on preorders (with similar relations between corresponding equivalences). We show, in particular, that

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46
* unlike in the purely non-deterministic case, the may-testing preorder ($\leq_{may}$) is strictly stronger than the trace equivalence preorder ($\leq_{tr}$) (Theorem 1);

* simulation ($\leq_{sim}$) and observational pre-order ($\leq_{obs}$), respectively bisimilarity and observational equivalence, coincide for randomized schedulers (Theorem 2);

* for non-randomized schedulers, these equivalences ($\leq_{sim}^{nr}$ and $\leq_{obs}^{nr}$) do not coincide (Lemma 4), which provides a counter-example to one of the main results in [12].

Third, a well-known phenomenon [20, 21] in process calculi that are both probabilistic and non-deterministic is the existence of some *nonrealistic schedulers* that are able to use the internal probabilistic choices done by an agent in order to schedule another agent's non-deterministic choices, i.e., the scheduler leaks the probabilistic choices. Therefore, we study two important *subclasses* of processes that avoid this phenomenon.

We first consider the classical class of *non-probabilistic processes* (denoted $MP^{np}$), as in the original applied $\pi$-calculus, but in the presence of probabilistic adversaries. We show that, if we additionally bound the number of sessions (denoted $MP^{<\infty, np}$),

* may-testing with probabilistic adversaries coincides with the classical, purely probabilistic notion of similarity (Proposition 5 and Theorem 2). This also provides a contextual characterization of the notion of similarity which is reminiscent of [17] in the setting of CSP;

* verification of testing equivalence with probabilistic adversaries is co-NEXPTIME complete for a large class of cryptographic primitives, relying on results from [22].

We next consider a class of *purely probabilistic* processes with a bounded number of sessions (denoted $MP^{pp}$), which is reminiscent of a probabilistic version of simple processes in [23, 24], and a slight generalization of the processes in [25]. We show that trace equivalence as considered in [25], is

* weaker than may-testing, but

* coincides with a version of may-testing with *determinate attackers*: attacker processes are restricted by disallowing replication, parallel, and non-deterministic choice, but allowing probabilistic choices (Theorem 3).

Next, we present an algorithm for deciding trace equivalence by extending the procedure of the DEEPSEC verifier [22]. Our procedure inherits some limitations (bounded number of sessions, the class of admissible rewrite systems) but provides a more general setting than Bauer *et al.* [26] who additionally bound the size of input messages. We have implemented our procedure in the open-source tool DEEPSEC available at [27].

Finally, we illustrate our framework by studying the Dining Cryptographers protocol. We notably provide a pen and paper proof that the protocol guarantees anonymity (expressed as may-testing equivalence). Using the DEEPSEC tool we also show that anonymity is not provided when coins are biased.

For readability, we often only provide proof sketches and omit some of the most technical proofs. A full version with more detailed proofs is available at [28].

## 2. Probabilistic Applied $\pi$-calculus

In this section we introduce the probabilistic applied $\pi$-calculus, a probabilistic variant of the applied $\pi$-calculus introduced by Goubault-Larrecq *et al.* [12].
## 2.1. Message as terms

Atomic values such as keys and nonces are modelled by names. We assume an infinite set of such names $N = \{a, b, \dots, \}$ and partition it into two disjoint infinite sets $N_{pub}$ and $N_{priv}$. The set of private names $N_{priv}$ is a priori unknown to the attacker and models, e.g., honest keys in a protocol. The set of public names $N_{pub}$ models public values, known to the attacker. The distinction between public and private names is analogous to the distinction between free and bound names in the original applied $\pi$-calculus. We also define an infinite set of variables $\mathcal{X}$. Finally, we consider a finite set of function symbols each equipped with their arity $\mathcal{F} = \{f/n, g/m, \dots\}$. Function symbols model cryptographic operations, e.g., $enc/2$ is a binary symbol that could be used to model encryption. Terms are defined as names, variables, and function symbols applied to other terms. For instance, given two names $a, k \in \mathcal{N}$, $enc(a, k)$ represents the encryption of $a$ with the key $k$. For any $F \subseteq \mathcal{F}$, $N \subseteq \mathcal{N}$ and $V \subseteq \mathcal{X}$, the set of terms built from $N$ and $V$ by applying function symbols in $F$ is denoted by $\mathcal{T}(F, N \cup V)$.

We also suppose that terms are equipped with a binary relation $\doteq$ that expresses that two terms evaluate to the same result, and a predicate $Msg(\cdot)$ that is intended to hold when evaluation succeeds. How $\doteq$ and $Msg(\cdot)$ are precisely defined is not relevant for the results of this paper and we wish to capture several formalisms. $\doteq$ can for instance be defined by an equational theory, as in the applied $\pi$-calculus [11] (where $Msg(\cdot)$ would evaluate to true on any term), by a constructor-destructor rewrite system, allowing evaluation to fail when a destructor application does not reduce, as in the DEEPSEC tool [22], or a combination of these as in the ProVerif tool [29].

Formally, we require that $\doteq$ is symmetric, transitive, and closed under substitution of terms for names and variables, as well as application of function symbols. Moreover, for all $a, b \in \mathcal{N}$, $a = b$ if and only if $a \doteq b$. $Msg(\cdot)$ is supposed to hold on any names, be closed under renamings and $t_1 \doteq t_2$ implies that $Msg(t_1)$ and $Msg(t_2)$. Finally, we require that $Msg(t)$ implies $t \doteq t$.

For example, the $\doteq$ relation could capture that $dec(enc(m, k), k) \doteq m$ for any $m, k$ modelling that decryption cancels out encryption when the same key $k$ is used; one may also define $Msg(dec(n, k))$ as false to express that decryption fails if the ciphertext argument is not an encryption with the matching key.

## 2.2. Syntax of the process calculus

The syntax for processes is defined as follows:

<table><tr><td>P, Q ::=</td><td>processes</td></tr><tr><td>0</td><td>nil</td></tr><tr><td>in(u, x); P</td><td>output</td></tr><tr><td>out(u, v); P</td><td>input</td></tr><tr><td>P | Q</td><td>parallel composition</td></tr><tr><td>!P</td><td>replication</td></tr><tr><td>new a; P</td><td>restriction</td></tr><tr><td>if u = v then P else Q</td><td>conditional</td></tr><tr><td>P + Q</td><td>non-deterministic choice</td></tr><tr><td>P +<sub>p</sub> Q</td><td>probabilistic choice</td></tr></table>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46
where $u, v \in \mathcal{T}(\mathcal{F}, \mathcal{N} \cup \mathcal{X})$, $x \in \mathcal{X}$, $a \in \mathcal{N}$ and $p \in ]0; 1[$. As usual, in examples we will omit trailing 0 processes and else 0 branches. A process $P$ is closed when all variables in $P$ are bound by an input. We also denote by $fn(P)$ the set of free names in $P$, i.e., the names not bound by a restriction, and by $n(P)$ the set of all names occurring in $P$.

**Example 1.** As an example, consider the process $P$:

$$ (\mathit{out}(c, k) + \frac{1}{3} \mathit{out}(c, a)) | \mathit{in}(c, x); \text{ if } x = k \text{ then } \mathit{out}(c, ok) $$

$P$ consists of two parallel processes. The left process outputs on a channel $c$ with probability $\frac{1}{3}$ the name $k$ and with probability $\frac{2}{3}$ the name $a$. The right process inputs a value on channel $c$ and binds this value to $x$. If $x$ equals $k$ then it outputs the constant $ok$.

We denote by $SP$ the set of all processes in the probabilistic applied $\pi$-calculus, and by $MP$ the set of all multisets over $SP$.

## 2.3. Operational semantics

We will now define the semantics of the probabilistic applied $\pi$-calculus. We opt for a different presentation of the semantics than Goubault-Larrecq et al. [12] relying on existing formalisms for transition systems. Moreover, we allow for a more general class of schedulers.

**Notation 1.** Let $S$ be an arbitrary set. We denote by $\mathcal{D}(S)$ the set of all finitely supported probability distributions over $S$ and by $\mathcal{D}^{\leq 1}(S)$ the set of all sub-probability distributions over $S$ (observe that $\mathcal{D}(S) \subseteq \mathcal{D}^{\leq 1}(S)$). For $p, q \geq 0$, and sub-distributions $D, E$, we define the measure

$$ (p \cdot D + q \cdot E)(x) = p \cdot D(x) + q \cdot E(x). $$

When $q = 0$, the resulting sub-distribution does not depend on $E$, and we simply write $p \cdot D$ instead of $p \cdot D + 0 \cdot E$.

If $D \in \mathcal{D}(S)$, we denote by $\text{supp}(D)$ the support of $D$, i.e., the set of all elements $s \in S$ such that $D(s) > 0$. If $S' \subseteq S$, we define $D(S') = \sum_{s \in S'} D(s)$. Finally, we denote by $\delta_x$ the Dirac distribution on $x$.

The operational semantics of processes is defined by a relation between multisets of processes and probability distributions on multisets of processes, denoted $P \to_{\tau} \mu$. This relation is defined in Figure 2.

**Remark 1.** One may note that our calculus offers a non-deterministic choice operator that is resolved internally. This differs from the standard $\pi$-calculus [30] where the non-deterministic choice operator is resolved externally. Note that the original applied $\pi$-calculus [11] does not contain non-deterministic choice.

In the following, we define the operational semantics of our calculus using well studied probabilistic systems. We choose the formalism of non-deterministic probabilistic labelled transition systems (NPLTS) used for instance in [16]. A NPLTS allows to represent states that allow both internal and external non-deterministic behavior. It can be noted that it coincides with the notion of simple probabilistic automata of Segala et al. [13].
$$ \mathcal{P} \cup \{\emptyset\} \to_{\tau} \delta_{\mathcal{P}} $$

$$ \mathcal{P} \cup \{\text{if } u = v \text{ then } P \text{ else } Q\} \to_{\tau} \delta_{\mathcal{P} \cup \{\mathcal{P}\}} $$

if $u \doteq v$

$$ \mathcal{P} \cup \{\text{if } u = v \text{ then } P \text{ else } Q\} \to_{\tau} \delta_{\mathcal{P} \cup \{\mathcal{Q}\}} $$

if $u \not\doteq v$

$$ \mathcal{P} \cup \{\text{out}(u, t).P, \text{in}(v, x).Q\} \to_{\tau} \delta_{\mathcal{P} \cup \{\mathcal{P}, Q\}_{\{x \to t\}}} $$

if $\text{Msg}(t) \wedge u \doteq v$

$$ \mathcal{P} \cup \{P | Q\} \to_{\tau} \delta_{\mathcal{P} \cup \{P, Q\}} $$

$$ \mathcal{P} \cup \{!P\} \to_{\tau} \delta_{\mathcal{P} \cup \{!P, P\}} $$

$$ \mathcal{P} \cup \{\text{new } a; P\} \to_{\tau} \delta_{\mathcal{P} \cup \{P^{a'/a}\}} $$

where $a' \in \mathcal{N}_{\text{priv}}$ is fresh

$$ \mathcal{P} \cup \{P + Q\} \to_{\tau} \delta_{\mathcal{P} \cup \{P\}} $$

$$ \mathcal{P} \cup \{P + Q\} \to_{\tau} \delta_{\mathcal{P} \cup \{Q\}} $$

$$ \mathcal{P} \cup \{P +_p Q\} \to_{\tau} p \cdot \delta_{\mathcal{P} \cup \{P\}} + (1-p) \cdot \delta_{\mathcal{P} \cup \{Q\}} $$

<caption>Figure 2. Semantics of the calculus</caption>

**Definition 1.** A NPLTS is a triple $(S, \mathcal{A}, \text{trans})$, where

* $S$ is a set of states,

* $\mathcal{A} = \{\tau\} \cup \mathcal{A}_{\text{ext}}$ is a set of labels, and

* $\text{trans}: S \to \mathcal{A} \to \mathcal{P}(\mathcal{D}(S))$ is a transition function: for each state in $S$, and each label in $\mathcal{A}$, $\text{trans}(s)(a)$ is a set of (finitely supported) distributions.

The label $\tau$ is the *internal action* and the labels in $\mathcal{A}_{\text{ext}}$ are the *external actions*. For $s \in S, a \in \mathcal{A}$, we write $s \xrightarrow{a} D$ when $D \in \text{trans}(s, a)$.

In the remaining of this paper, we may define a NPLTS by only its transition function, i.e., we will say that $\text{trans}: S \to \mathcal{A} \to \mathcal{P}(\mathcal{D}(S))$ is the NPLTS $(S, \mathcal{A}, \text{trans})$.

We now express our operational semantics as a NPLTS without external actions, i.e., $\mathcal{A}_{\text{ext}} = \emptyset$. External actions will be used to express our labeled semantics in Section 4.1.

**Definition 2.** The *operational semantics* is the NPLTS $\mathcal{N}^o = (\mathcal{MP}, \{\tau\}, \text{trans}^o)$ where for every $s \in \mathcal{MP}$, $\text{trans}^o(s)(\tau) = \{D \mid s \to_{\tau} D\}$.

Note that the states of the NPLTS $\mathcal{N}^o$ contain all possible multisets of processes and how they are executed. Obviously, $\mathcal{N}^o$ is thus an infinite transition system. In examples illustrating transitions of a multiset of processes $\mathcal{P}$, we only show the relevant fragment of $\mathcal{N}^o$ that contains $\mathcal{P}$.

**Example 2.** The complete execution of the process $\mathcal{P}$, introduced in Example 1 is given in Figure 3.

### 3. Behavioral equivalences

In this section we define probabilistic versions of two classical equivalences: *may-testing* and the stronger *observational equivalence*. In order to do so we first introduce the notion of *resolution* (also known as scheduler), i.e., how internal non-determinism is resolved, and the notion of *barb*, which models an observational action.
<figure><img src="image_4.png" /></figure>

<figure><img src="image_5.png" /><figcaption>Figure 3. Semantics of the process *P* from Example 2</figcaption></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /></figure>

<figure><img src="image_9.png" /></figure>

<figure><img src="image_10.png" /></figure>

<figure><img src="image_11.png" /></figure>

<figure><img src="image_12.png" /></figure>

<figure><img src="image_13.png" /></figure>

<figure><img src="image_14.png" /></figure>

<figure><img src="image_15.png" /></figure>
abuse of notation, the transition function

$$ \text{trans} : S \to \mathcal{D}(S) \sqcup (\emptyset \to \mathcal{D}(S) \cup \{\star\}) $$

of such RPLTS is rewritten as

$$ \text{trans} : S \to \mathcal{D}(S) \sqcup \{\star\} $$

as for any set $X$, the cardinality of the set $(\emptyset \to X)$ is 1.

Before defining the notion of resolution–or schedulers–, we need to introduce two classical notions in probabilistic models: the convex hull of a set of distributions and the probabilistic lifting of a function.

**Notation 2.** Let $S$ be a set of states. The convex hull of $\Delta \subseteq \mathcal{D}(S)$, denoted $\text{conv}(\Delta)$, is the set of distributions $D \in \mathcal{D}(S)$ such that

$$ \exists \alpha_1, \dots, \alpha_n \in \mathbb{R}. \quad \exists D_1, \dots, D_n \in \Delta. \quad \sum_{i=1}^{n} \alpha_i = 1 \text{ and } D = \sum_{i=1}^{n} \alpha_i \cdot D_i $$

Intuitively, rather than choosing one distribution in $\Delta$, each element in $\text{conv}(\Delta)$ corresponds to a distribution over the distributions in $\Delta$. This will be useful for defining randomized schedulers.

Next, we lift functions to distributions: applying a function $f$ to a distribution simply defines a new distribution that transfers, according to $f$, the probability weight of elements in the domain of $f$ to its image, possibly summing these weights when $f$ maps several inputs to a same output.

**Notation 3.** Let $S, S'$ be two sets of states and $f: S \to S'$. We define the function $\bar{f}: \mathcal{D}(S) \to \mathcal{D}(S')$ to be the probabilistic lifting of $f$, where

$$ \bar{f}(D) = \sum_{s \in S} D(s) \cdot \delta_{f(s)} $$

When obvious from context, we will overload the notation and write $f$ instead of $\bar{f}$.

We now define resolutions for a NPLTS that allow to solve the internal, but not external, non-determinism: a resolution describes one of the possible ways of turning an NPLTS into a RPLTS. It means that for each state $s$, a resolution should choose whether $s$ is an internal state or external state; in the first case, a unique post-transition distribution must be chosen; in the second case, for each external action $a$, the resolution must choose to either stop (i.e., $\text{trans}(s) = \star$) or a unique distribution $D$ such that $s \xrightarrow{a} D$ (i.e., $\text{trans}(s) = D$). Due to the possible existence of cycles in the NPLTS, a scheduler that visits multiple times a certain state $s$ must be able to choose differently how to resolve the non determinism every time it visits $s$. This leads to the notion of correspondence function.

**Definition 4** ([16]). A randomized resolution for a NPLTS $N = (S, A, \text{trans})$ is a pair $(\text{corr}, R)$ where

* $R = (S', A, \text{trans}')$ is a RPLTS, and

* $\text{corr}: S' \to S$ is the correspondence function such that for all states $s' \in S'$, $\text{trans}'(s')(a) = D$ implies $\text{corr}(D) \in \text{conv}(\text{trans}(\text{corr}(s'))(a))$.

Given a NPLTS $N$ we denote by $\mathcal{R}_r(N)$ the set of randomized resolutions. Additionally, we denote $\mathcal{R}_r^o = \mathcal{R}_r(N^o)$. Figure 4 shows an example of a resolution from $\mathcal{R}_r^o$ for the process $P$ from Example 2.
<figure><img src="image_16.png" /><figcaption>Figure 4. Example of a randomized resolution for process P from Example 2 where the correspondence function corr is the identity.</figcaption></figure>

## 3.2. Computing the probability to reach a barb

The notion of *barb* is a classical way of expressing observables. Intuitively a state of $N^o$, i.e., a multiset of processes, exhibits a barb *c* whenever an output on channel *c* is possible.

**Definition 5.** For $c \in \mathcal{N}_{pub}$ and $P \in \mathcal{MP}$, we say that $P$ exhibits barb *c* when there exists a process out($u, t$). $Q$ in $P$ where $c \doteq u$ and $Msg(t)$. We denote by $\downarrow c$ the set of all multisets of processes that exhibit the barb *c*.

We next define the probability of reaching a state in a set of target states, in a fully probabilistic transition system, i.e., in a transition system where all non-determinism–internal or external–has already been resolved. We first define the probability of reaching such a state in at most *n* steps, and then we take the probability of reaching them eventually as the limit of the *n*-step reaching probabilities.

**Definition 6.** Let $R = (S, \mathcal{A}, \text{trans})$ be a RPLTS, $\mathcal{T} \subseteq S$ a set of states, and *s* an initial state. For every $n \in \mathbb{N}$ we define the probability of reaching $\mathcal{T}$ from *s* in at most *n* steps as:

$$ \text{RProb}_{R}^{\le 0}(s, \mathcal{T}) = \begin{cases} 1 & \text{if } s \in \mathcal{T} \\ 0 & \text{otherwise.} \end{cases} \qquad \text{RProb}_{R}^{\le n+1}(s, \mathcal{T}) = \begin{cases} 1 & \text{if } s \in \mathcal{T} \\ 0 & \text{if } s \notin \mathcal{T} \land s \in S_{\text{ext}}(R) \\ \sum_{u \in \text{supp}(D)} D(u) \cdot \text{RProb}_{R}^{\le n}(u, \mathcal{T}) & \text{if } s \notin \mathcal{T} \land \text{trans}(s)(\tau) = D \end{cases} $$

We define the probability of reaching $\mathcal{T}$ from *s* as:

$$ \text{RProb}_R(s, \mathcal{T}) = \lim_{n \to +\infty} \text{RProb}_R^{\le n}(s, \mathcal{T}). $$

Note that, as $\text{RProb}_R^{\le n}(s, \mathcal{T})$ is an increasing function in *n* we can replace the limit by the supremum on $n \in \mathbb{N}$.

Given $N = (S_N, \mathcal{A}, \text{trans}_N)$, we denote by $\text{RProb}_{\mathcal{R}_r(N)}(s, \mathcal{T})$ the probability:

$$ \sup \left\{ \text{RProb}_R(s', \text{corr}^{-1}(\mathcal{T})) \mid (\text{corr}, R) \in \mathcal{R}_r(N), \text{corr}(s') = s \right\} $$
### 3.3. Defining May Testing Equivalence

Intuitively, two processes are may-testing equivalent if they exhibit the same observations when executed in the presence of any attacker process. This models the inability of an arbitrary process to distinguish them. More formally, two multisets of processes $\mathcal{P}$ and $\mathcal{Q}$ are may testing equivalent when the attacker has the same probability over all schedulers to exhibit the barb $c$ in both $\mathcal{P}$ and $\mathcal{Q}$.

**Definition 7 (May testing equivalence).** Let $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}$. We say that $\mathcal{P} \preceq_{may} \mathcal{Q}$ iff:

$$ \begin{array}{l} \forall \mathit{Adv} \in \mathcal{MP} \text{ s.t. } \mathit{fn}(\mathit{Adv}) \subseteq \mathcal{N}_{\mathit{pub}}. \\ \forall c \in \mathcal{N}_{\mathit{pub}}. \end{array} \qquad \mathrm{RProb}_{\mathcal{R}_r^o}(\mathcal{P} \cup \mathit{Adv}, \downarrow c) \le \mathrm{RProb}_{\mathcal{R}_r^o}(\mathcal{Q} \cup \mathit{Adv}, \downarrow c) $$

We say that $\mathcal{P}, \mathcal{Q}$ are may testing equivalent, denoted $\mathcal{P} \approx_{may} \mathcal{Q}$, when $\mathcal{P} \preceq_{may} \mathcal{Q}$ and $\mathcal{Q} \preceq_{may} \mathcal{P}$.

**Remark 3.** One could also consider a more fine-grained definition of may testing pre-order that guarantees the equality of probabilities between two schedulers rather than comparing the probabilities over all schedulers. Formally, this pre-order, denoted $\preceq_{may}'$, requires that for all resolutions $(\mathit{corr}, R) \in \mathcal{R}_r(\mathcal{N})$ and state $s$ of $R$ such that $\mathit{corr}(s) = \mathcal{P} \cup \mathit{Adv}$, there exist a resolution $(\mathit{corr}', R')$ and a state $s'$ of $R'$ such that $\mathit{corr}'(s') = \mathcal{Q} \cup \mathit{Adv}$ and

$$ \mathrm{RProb}_R(s, \mathrm{corr}^{-1}(\downarrow c)) = \mathrm{RProb}_{R'}(s', \mathrm{corr}'^{-1}(\downarrow c)) $$

However, the resulting relation is counter-intuitive and distinguishes processes

$$ \mathcal{P} := \{\{\mathit{out}(a, 0)\}\} \quad \text{and} \quad \mathcal{Q} := \{\{\mathit{out}(a, 0) + \frac{1}{2}(\mathit{out}(a, 0) + \frac{1}{2}\mathit{out}(a, 0))\}\}. $$

Indeed, we can show that $\mathcal{Q} \preceq_{may}' \mathcal{P}$: for $\mathit{Adv} = \{0\}$, there exists a resolution $(\mathit{corr}, R)$ such that

$$ \mathit{corr}(s) = \mathcal{P} \cup \mathit{Adv} \quad \text{and} \quad \mathrm{RProb}_R(\mathcal{Q}, \downarrow a) = \frac{1}{2} $$

but for every resolution $(\mathit{corr}', R')$ such that $\mathit{corr}'(s') = \mathcal{Q} \cup \mathit{Adv}$,

$$ \mathrm{RProb}_{R'}(\mathcal{P}, \downarrow a) = 1. $$

### 3.4. Defining Observational Equivalence

In this section, we define observational preorders and equivalence which are stronger than may testing. When studying cryptographic protocols we suppose that internal actions are not observable and therefore only study weak equivalences hiding whether such internal actions take place or not. To define the observational preorder we need to introduce a weak relation for internal actions. In a purely non-deterministic system this simply corresponds to the reflexive, transitive closure $\to^*$. However, in our setting we need to compute the corresponding distributions.

**Definition 8.** Let $N$ be a NPLTS and $D, E \in \mathcal{D}^{\le 1}(S_N)$.

We write $D \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_r(\mathcal{N})} E$ when there exists $(\mathit{corr}, R) \in \mathcal{R}_r(\mathcal{N})$ and $D', E' \in \mathcal{D}^{\le 1}(S_R)$ such that
• $\mathrm{corr}(D') = D$, $\mathrm{corr}(E') = E$, $\mathrm{supp}(E') \subseteq S_{\mathrm{ext}}(R)$,

• $\forall u \in S_{\mathrm{ext}}(R)$. $E'(u) = \sum_{s' \in S_R} D'(s') \cdot \mathrm{RProb}_R(s', \{u\})$.

To define the observational preorder, we additionally need to lift relations defined on a given set to relations on sub-distributions over this set.

**Definition 9 (Lifting of a relation).** Let $R$ be a binary relation on a discrete set $S$. We define the lifting of $R$ to sub-distributions as the binary relation on $D^{\leq 1}(S)$, denoted $\hat{R}$, defined as:

$$D \hat{R} E \text{ when } \forall S' \subseteq S, D(S') \leq E(R(S'))$$

$$\text{where } R(S') = \{s \in S \mid s' \in S' \wedge s' R s\}.$$

Using these notions of weak transition and lifting of relations to sub-distributions we can define observational equivalence.

**Definition 10.** The observational preorder $\leq_{\mathrm{obs}}$ is the largest relation $R$ on $\mathcal{MP}$ such that $P R Q$ implies :

• $\forall c \in \mathcal{N}_{\mathrm{pub}}$. $\mathrm{RProb}_{\mathcal{R}_c^o}(P, \downarrow c) \leq \mathrm{RProb}_{\mathcal{R}_c^o}(Q, \downarrow c)$;

• if $P \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_c^o} D$ and $D \in \mathcal{D}(S_{N^o})$ then $Q \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_c^o} E$, $E \in \mathcal{D}(S_{N^o})$ and $D \hat{R} E$;

• $\forall$ closed $\mathrm{Adv} \in \mathcal{MP}$ such that $\mathrm{fn}(\mathrm{Adv}) \subseteq \mathcal{N}_{\mathrm{pub}}$. $\{\mathrm{Adv}\} \cup P R \{\mathrm{Adv}\} \cup Q$.

The observational equivalence $\approx_{\mathrm{obs}}$ is defined by additionally requiring $R$ to be symmetric.

**Remark 4.** Note that we slightly diverge from the original definition of observational equivalence [11] where an evaluation context $C[\_]$ is of the form

$$\text{new } n_1; \dots; \text{new } n_k; (\_ | A)$$

In our definition we simply consider a parallel process, and no additional name restriction. However, we now show that these two definitions coincide. Intuitively, restricting names whose scope includes the adversarial process $A$ does not provide additional distinguishing power and these names could as well be public. While this result is of independent interest, the reader may safely skip the remainder of this section without hindering their understanding of the rest of the paper.

Our distinction between private and public names enforces that all restricted names $n_1, \dots, n_k$ are in $\mathcal{N}_{\mathrm{priv}}$. Applying an adversarial context with restriction in our formalism corresponds to applying a renaming from public to fresh private names. Hence, in our formalism the original observational equivalence can be defined as follows.

**Definition 11.** The original observational preorder $\leq_{\mathrm{ori}}^R$ is the largest relation $R$ on $\mathcal{MP}$ such that $P R Q$ implies :

• for all $c \in \mathcal{N}_{\mathrm{pub}}$, $\mathrm{RProb}_R(P, \downarrow c) \leq \mathrm{RProb}_R(Q, \downarrow c)$;

• if $P \stackrel{\tau}{\Rightarrow}_R D$ then $Q \stackrel{\tau}{\Rightarrow}_R E$ and $D \hat{R} E$;

• for all closed $\mathrm{Adv} \in \mathcal{MP}$, for all renaming $\rho$, if $\mathrm{fn}(\mathrm{Adv}) \subseteq \mathcal{N}_{\mathrm{pub}}$, $\mathrm{dom}(\rho) \subseteq \mathcal{N}_{\mathrm{pub}}$, $\mathrm{img}(\rho) \subseteq \mathcal{N}_{\mathrm{priv}}$ and $\mathrm{img}(\rho) \cap n(P, Q, \mathrm{Adv}) = \emptyset$ then $\{\mathrm{Adv}\rho\} \cup P\rho R \{\mathrm{Adv}\rho\} \cup Q\rho$.
The original observational equivalence $\approx_{\text{ori}}^{\mathcal{R}}$ is defined by additionally requesting $R$ to be symmetric and in the second bullet point, by requesting both $D \hat{R} E$ and $E \hat{R} D$ to hold.

We now show that the two notions coincide. Intuitively, restricting names whose scope includes the adversarial process *Adv* corresponds to making previously public channels invisible to the attacker at later steps, which does not provide additional distinguishing power.

**Lemma 1.** $\leq_{\text{ori}}^{\mathcal{R}} = \leq_{\text{obs}}^{\mathcal{R}}$ and $\approx_{\text{ori}}^{\mathcal{R}} = \approx_{\text{obs}}^{\mathcal{R}}$.

**Proof.** Taking $\rho$ to be the empty renaming, we have that $\leq_{\text{ori}}^{\mathcal{R}} \subseteq \leq_{\text{obs}}^{\mathcal{R}}$ and $\approx_{\text{ori}}^{\mathcal{R}} \subseteq \approx_{\text{obs}}^{\mathcal{R}}$.

Define the relation $\mathcal{R}$ as $\mathcal{P} \mathcal{R} \mathcal{Q}$ iff there exists $\mathcal{P}', \mathcal{Q}'$ and a renaming $\rho$ such that $\mathcal{P} = \mathcal{P}'\rho, \mathcal{Q} = \mathcal{Q}'\rho, \mathcal{P}' \leq_{\text{obs}}^{\mathcal{R}} \mathcal{Q}', \text{dom}(\rho) \subseteq \mathcal{N}_{\text{pub}}, \text{img}(\rho) \subseteq \mathcal{N}_{\text{priv}}$ and $\text{img}(\rho) \cap n(\mathcal{P}', \mathcal{Q}', \text{Adv}) = \emptyset$.

As $\doteq$ is closed under substitution of names by terms, we can show that $\mathcal{P}\rho \to_{\tau} D\rho$ iff $\mathcal{P} \to_{\tau} D$. This can be propagated to schedulers, i.e. $(\text{corr}, R) \in \mathcal{R}_{\tau}^{\circ}$ if and only if $(\text{corr}\rho, R) \in \mathcal{R}_{\tau}^{\circ}$. Hence, we derive that

* $\text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}, \mathcal{T}) = \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}\rho, \mathcal{T}\rho)$

* $D \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{\tau}^{\circ}} E$ if and only if $D\rho \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{\tau}^{\circ}} E\rho$

We now show that $\mathcal{R}$ satisfies the three items in Definition 11:

* Let $c \in \mathcal{N}_{\text{pub}}$. If $c \in \text{dom}(\rho)$ then $c$ does neither occur in $\mathcal{P}'\rho$ nor in $\mathcal{Q}'\rho$. Hence, $\text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}', \downarrow c) = 0 = \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{Q}', \downarrow c)$. Otherwise, $\downarrow c = \downarrow c\rho \cup \mathcal{T}$ where for all $\mathcal{P}' \in \mathcal{T}, \text{fn}(\mathcal{P}') \cap \text{dom}(\rho) \neq \emptyset$. Since, $\mathcal{P}'\rho$ and $\mathcal{Q}'\rho$ do not contain public names from $\text{dom}(\rho)$, they can never reach states from $\mathcal{T}$. Hence, $\text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}'\rho, \downarrow c) = \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}'\rho, \downarrow c\rho) = \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}', \downarrow c)$. Since $\mathcal{P}' \leq_{\text{obs}}^{\mathcal{R}} \mathcal{Q}'$, we deduce that

$$ \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{P}', \downarrow c) \leq \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{Q}', \downarrow c) \leq \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{Q}'\rho, \downarrow c\rho) \leq \text{RProb}_{\mathcal{R}_{\tau}^{\circ}}(\mathcal{Q}', \downarrow c) $$

* If $\mathcal{P}\rho \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{\tau}^{\circ}} D\rho$ then $\mathcal{P}' \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{\tau}^{\circ}} D$. By $\mathcal{P}' \leq_{\text{obs}}^{\mathcal{R}} \mathcal{Q}'$, we have $\mathcal{Q}' \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{\tau}^{\circ}} E$ and $D \leq_{\text{obs}}^{\mathcal{R}} E$. This implies that $D\rho \hat{R} E\rho$ with $\mathcal{Q}'\rho \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{\tau}^{\circ}} E\rho$.

* Let $\text{Adv} \in \mathcal{MP}$ and $\rho'$ be a renaming such that $\text{fn}(\text{Adv}) \subseteq \mathcal{N}_{\text{pub}}, \text{dom}(\rho') \subseteq \mathcal{N}_{\text{pub}}, \text{img}(\rho') \subseteq \mathcal{N}_{\text{priv}}$ and $\text{img}(\rho') \cap n(\mathcal{P}'\rho, \mathcal{Q}'\rho) = \emptyset$. Note that the domains of $\rho$ and $\rho'$ may not be disjoint. Similarly, the process $\text{Adv}$ may contain public names from $\text{dom}(\rho)$.

Hence, let $\rho_{\text{pub}}$ be a renaming such that $\text{dom}(\rho_{\text{pub}}) = \text{dom}(\rho) \cap (\text{dom}(\rho') \cup \text{fn}(\text{Adv})), \text{img}(\rho_{\text{pub}}) \subseteq \mathcal{N}_{\text{pub}} \setminus \text{fn}(\mathcal{P}', \mathcal{Q}', \text{Adv})$. Hence, we define $\rho_1 = \rho\rho_{\text{pub}}^{-1}\rho'$.

We have $\mathcal{P}'\rho_1 = (\mathcal{P}'\rho)\rho'$ since $\text{img}(\rho_{\text{pub}}) \subseteq \mathcal{N}_{\text{pub}} \setminus \text{fn}(\mathcal{P}', \mathcal{Q}', \text{Adv})$. Moreover, as $\text{dom}(\rho_{\text{pub}}) = \text{dom}(\rho) \cap (\text{dom}(\rho') \cup \text{fn}(\text{Adv}))$, we have that

$$ (\text{Adv}\rho_{\text{pub}})\rho = \text{Adv}\rho_{\text{pub}}\rho|_{\text{dom}(\rho)\setminus\text{dom}(\rho_{\text{pub}})} = \text{Adv}\rho|_{\text{dom}(\rho)\setminus\text{dom}(\rho_{\text{pub}})}\rho_{\text{pub}} = \text{Adv}\rho_{\text{pub}} $$

Therefore, $\text{Adv}\rho_{\text{pub}}\rho_1 = \text{Adv}\rho_{\text{pub}}\rho_{\text{pub}}^{-1}\rho' = \text{Adv}\rho'$. This allows us to deduce that $\{\text{Adv}\rho'\} \cup \mathcal{P}'\rho' = (\{\text{Adv}\rho_{\text{pub}}\} \cup \mathcal{P}')\rho_1$. Similarly, we have $\{\text{Adv}\rho'\} \cup \mathcal{Q}'\rho' = (\{\text{Adv}\rho_{\text{pub}}\} \cup \mathcal{Q}')\rho_1$.

We know that $\mathcal{P}' \leq_{\text{obs}}^{\mathcal{R}} \mathcal{Q}'$. Hence $\{\text{Adv}\rho_{\text{pub}}\} \cup \mathcal{P}' \leq_{\text{obs}}^{\mathcal{R}} \{\text{Adv}\rho_{\text{pub}}\} \cup \mathcal{Q}'$ which allows us to conclude that $\{\text{Adv}\rho_{\text{pub}}\rho_1\} \cup \mathcal{P}'\rho_1 \mathcal{R}\{\text{Adv}\rho_{\text{pub}}\rho_1\} \cup \mathcal{Q}'\rho_1$ and so $\{\text{Adv}\rho'\} \cup \mathcal{P}\rho' \mathcal{R}\{\text{Adv}\rho'\} \cup \mathcal{Q}\rho'$. $\square$
<figure><img src="image_17.png" /><figcaption>Figure 5. Labelled semantics: definition of →_a</figcaption></figure>

## 4. Labelled semantics and equivalences

As usual in π-calculi, and in the applied π-calculus, we can define a labelled semantics. The intent of the labels is to capture adversarial actions and avoid the universal quantification over processes in equivalence definitions.

### 4.1. Labelled semantics

A state in this labelled semantics is defined by associating a multiset of processes with a frame, modeling the adversary's knowledge. We consider a new set of variables $AX = \{ax_1, ax_2, \dots\}$ distinct from $X$ that will act as pointers to messages that were previously output.

**Definition 12.** An extended process is a pair $(\mathcal{P}, \phi)$, where $\mathcal{P} \in \mathcal{MP}$ and $\phi$ is a ground substitution

$$ \{ax_1 \mapsto t_1; \dots; ax_n \mapsto t_n\} $$

such that $ax_i \in AX$, $t_i \in T(F, N)$ and $Msg(t_i)$ for $1 \le i \le n$.

We denote by $SP_\ell$ the set of all extended processes.

A *recipe* is a term from $T(F, N_{pub} \cup AX)$ representing how an attacker can deduce a message.

**Notation 4.** If $D$ is a distribution over $\mathcal{MP}$, and $\phi$ a frame, we write $(D, \phi)$ for the distribution over extended processes defined as $(D, \phi) = \sum_{\mathcal{P} \in \text{supp}(D)} D(\mathcal{P}) \cdot \delta_{(\mathcal{P}, \phi)}$.

We now define the NPLTS $N^\ell$ for the labelled semantics. External actions model interactions with the attacker.

**Definition 13.** The labelled semantics is the NPLTS $N^\ell = (SP_\ell, \{\tau\} \cup A_{ext}^\ell, \text{trans}^\ell)$ where

* $A_{ext}^\ell$ is the set of labels $in(\xi, \zeta)$, $out(\xi, ax)$, $(\xi \stackrel{?}{=} \zeta)$ and $(\xi \stackrel{\neq}{=} \zeta)$ with $\xi, \zeta$ recipes and $ax \in AX$;

* $\text{trans}^\ell((\mathcal{P}, \phi))(a) = \{D \mid (\mathcal{P}, \phi) \to_a D\}$ where $\to_a$ is defined in Figure 5.

Note that when we lift $\to_\tau$ to extended processes we suppose that the freshness requirement of a new name $a'$ in the (NEW) rule of Figure 2 also applies to the frame $\phi$, i.e., $a'$ must not appear in $\phi$.

**Remark 5.** It should be noted that we deal with static equivalence in a different way as done usually in the applied π-calculus, or implicitly in the probabilistic applied π-calculus [12]: we encode static equivalence into the NPLTS $N^\ell$ by a countable set of actions–all the tests $(\xi \stackrel{?}{=} \zeta)$ and their negations–
instead of just one action testing static equivalence. The motivation behind this choice is to be able to represent every *action* from the NPLTS by an *elementary action* of the adversary. As shown later, this choice has no effect on the definition of the simulation pre-orders or on bisimulation, but it leads to a slightly different notion of trace equivalence, that is closer to may testing equivalence.

## 4.2. Defining Trace Equivalence

We first define the probability of executing a trace for a given resolution. As we are interested in weak trace preorder (where internal actions cannot be observed), traces are sequences of external actions only. Our definition uses the previously introduced notation $RProb_R(s, \{t\})$: recall that this denotes the probability of reaching state $t$ from state $s$ using only internal actions for some resolution (corr, $R$).

**Definition 14.** Let $R = (S, \{\tau\} \sqcup A_{ext}, \text{trans})$ be a RPLTS. Let $w \in A_{ext}^*$ be a trace, i.e., a finite word on the alphabet $A_{ext}$. For all states $s \in S$, we define the probability of executing $w$ starting from $s$ in $R$ as:

* $\text{Prob}_R(s, \epsilon) = 1$

* $\text{Prob}_R(s, a, w) = \sum_{\substack{t \in S \\ \text{trans}(t)(a)=D}} \text{RProb}_R(s, \{t\}) \cdot \sum_{s' \in \text{supp}(D)} D(s') \cdot \text{Prob}_R(s', w)$

Given a NPLTS $N = (S, A, \text{trans})$, we denote by $\text{Prob}_{\mathcal{R}_r(N)}(s, w)$ the probability:

$$ \sup\{\text{Prob}_R(s', w) \mid (\text{corr}, R) \in \mathcal{R}_r(N), \text{corr}(s') = s\} $$

This allows us to define trace equivalence of $(\mathcal{P}, \phi)$ and $(\mathcal{P}', \phi')$: intuitively any trace that can be executed in $(\mathcal{P}, \phi)$ can be executed with at least the same probability in $(\mathcal{P}', \phi')$ and vice-versa.

**Definition 15 (trace equivalence).** Let $(\mathcal{P}, \phi), (\mathcal{P}', \phi') \in SP_\ell$. We say that $(\mathcal{P}, \phi) \leq_{tr} (\mathcal{P}', \phi')$ iff

$$ \text{for all } w \in A_{ext}^* \cdot \text{Prob}_{\mathcal{R}_r(N^\ell)}((\mathcal{P}, \phi), w) \leq \text{Prob}_{\mathcal{R}_r(N^\ell)}((\mathcal{P}', \phi'), w) $$

$(\mathcal{P}, \phi)$ and $(\mathcal{P}', \phi')$ are trace equivalent, denoted $(\mathcal{P}, \phi) \approx_{tr} (\mathcal{P}', \phi')$, iff

$$ (\mathcal{P}, \phi) \leq_{tr} (\mathcal{P}', \phi') \quad \text{and} \quad (\mathcal{P}', \phi') \leq_{tr} (\mathcal{P}, \phi). $$

Unlike, in the purely possibilistic case, in our probabilistic setting trace preorder is (strictly) weaker than the may testing preorder.

**Theorem 1.** Let $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}$ be two processes.

$$ \mathcal{P} \leq_{may} \mathcal{Q} \Rightarrow (\mathcal{P}, \emptyset) \leq_{tr} (\mathcal{Q}, \emptyset) $$

Moreover there exist processes $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}$ such that

$$ (\mathcal{P}, \emptyset) \leq_{tr} (\mathcal{Q}, \emptyset) \quad \text{and} \quad \mathcal{P} \not\leq_{may} \mathcal{Q} $$
$$ \mathcal{P} = \{ \text{new } k; (P(0) | P(0) | P(1) | P_{\text{dec}}) \} $$

$$ \text{and } \mathcal{Q} = \{ \text{new } k; (P(0) | P(1) | P(1) | P_{\text{dec}}) \} $$

$$ \text{where } P(x) = \text{new } r; \text{out}(c, \text{enc}(x, r, k)) $$

$$ \text{and } P_{\text{dec}} = \text{in}(d, y); \text{out}(d, \text{dec}(y, k)) $$

<caption>Figure 6. $\mathcal{P}, \mathcal{Q}$ such that $(\mathcal{P}, \emptyset) \le_{tr} (\mathcal{Q}, \emptyset)$ and $\mathcal{P} \not\le_{may} \mathcal{Q}$</caption>

Figure 6 witnesses that the implication is strict. $\mathcal{P}$ and $\mathcal{Q}$ output each 3 encrypted bits (in a non-deterministic order). $\mathcal{P}$ outputs twice the encryption of 0; $\mathcal{Q}$ twice the encryption of 1. The (randomized) encryption ensures that these three values are indeed indistinguishable. We give the adversary a single access to a decryption oracle $P_{\text{dec}}$. Intuitively, trace equivalence holds, as the scheduler can ensure that matching encryptions are sent to $P_{\text{dec}}$. However, may-testing does not hold: the attacker chooses uniformly at random one of the three encryptions to submit. The probability to hit 0 will be $\frac{2}{3}$ in $\mathcal{P}$ and only $\frac{1}{3}$ in $\mathcal{Q}$.

Observe that Theorem 1 holds for any processes and does not require them to be image-finite, contrary to usual results in the literature, e.g., [23]. This discrepancy comes from our choice of labelled actions for static equivalence (see Remark 5): a trace cannot test directly static equivalence, but can only do a finite numbers of recipe tests. We believe this variant definition of trace equivalence to be of independent interest as it provides an exact characterization of may testing in the purely non-deterministic case.

### 4.3. Defining (bi)simulations

In this section, we define simulations on probabilistic processes and corresponding equivalences. Our definition of simulation preorder is similar to the definition of randomized weak simulation preorder introduced by Segala and Lynch for probabilistic automata [13]. We reuse the lifting of a relation and the weak relation for internal actions defined in Section 3.4 but applied to the NPLTS $N^l$. In particular, given an action $a \in \mathcal{A}_{\text{ext}}^l$ and two distributions $D, D' \in \mathcal{D}(S)$, we write $D \stackrel{a}{\Rightarrow}_{\mathcal{R}_t^l} D'$ when $D \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_t^l} E_1$, $E_1 \stackrel{a}{\rightarrow} E_2$ and $E_2 \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_t^l} D'$ for some $E_1, E_2$ and where $\mathcal{R}_t^l$ denotes $\mathcal{R}_t(N^l)$. Here $E_1 \stackrel{a}{\rightarrow} E_2$ is the natural lifting of the transition function of $N^l$, i.e., $E_2 = \sum_s E_1(s) \cdot D$ with $s \stackrel{a}{\rightarrow} D$.

**Definition 16.** A relation $R \subseteq (S_{N^l} \times S_{N^l})$ is

* a simulation if $s_1 R s_2$ implies that for all $a \in \mathcal{A}_{\text{ext}}^l \cup \{\tau\}, D_1 \in \mathcal{D}(S_{N^l})$

if $s_1 \stackrel{a}{\rightarrow} D_1$ then $s_2 \stackrel{a}{\Rightarrow}_{\mathcal{R}_t^l} D_2$, $D_2 \in \mathcal{D}(S_{N^l})$ and $D_1 \hat{R} D_2$

* a bisimulation if $R$ is a simulation and $R$ is symmetric.

The simulation preorder, denoted $\leq_{sim}$, is the largest simulation and bisimilarity, denoted $\approx_{bi}$, is the largest bisimulation. We define similarity, denoted $\approx_{sim}$, as $\leq_{sim} \cap \leq_{sim}^{-1}$.

As usual in the field of (bi)simulation, it can be shown that $\leq_{sim}$, respectively $\approx_{bi}$, exists [19] and that it is a pre-order, i.e., a reflexive and transitive relation, respectively an equivalence, i.e., a reflexive, symmetric and transitive relation [18].
The following proposition from [18] states that, as usual in the non-probabilistic case, the weak arrow $\underset{\sim}{\to}^{a}_{R_f^l}$ can replace the single arrow $\to^a$ in the definition of simulation.

**Proposition 1.** Let $R$ be the largest binary relation on $S_{N^l}$ such that $s_1 R s_2$ implies that for every $a \in A_{ext} \cup \{\tau\}$,

$$ \text{if } s_1 \underset{R_f^l}{\stackrel{a}{\Rightarrow}} D_1 \text{ then } s_2 \underset{R_f^l}{\stackrel{a}{\Rightarrow}} D_2, D_2 \in \mathcal{D}(S_{N^l}) \text{ and } D_1 \hat{R} D_2 $$

$$ \text{We have } R = \leq_{sim}. $$

**Remark 6.** Observe that our choice of labelled actions for static equivalence (see Remark 5) has no impact on the resulting simulation and bisimulation. Indeed, if two $N^l$-states $(\mathcal{P}, \phi)$ and $(\mathcal{Q}, \psi)$ are in the simulation pre-order or bisimulation, then $\phi$ is statically equivalent to $\psi$. Indeed, for all $a \in \{\xi \stackrel{?}{=} \zeta, \xi \neq \zeta\}$, $\delta_{(\mathcal{P}, \psi)} \stackrel{a}{\to} \delta_{(\mathcal{P}, \phi)}$ implies that $\delta_{(\mathcal{Q}, \psi)} \stackrel{a}{\Rightarrow} \delta_{(\mathcal{P}, \phi)} \stackrel{?}{=} \delta_{(\mathcal{Q}, \psi)}$. Since neither the $a$ transition or $\tau$ transition modifies the frame, the former indicates that $\delta_{(\mathcal{Q}, \psi)} \stackrel{\tau}{\Rightarrow} \delta_{(\mathcal{P}, \phi)} \stackrel{a}{\Rightarrow} E_1$, $E_1 \stackrel{a}{\to} E_2$ and $E_2 \stackrel{\tau}{\Rightarrow} \delta_{(\mathcal{P}, \phi)} \stackrel{?}{=} \delta_{(\mathcal{Q}, \psi)}$. The former ensures that $\mathrm{supp}(E_1) \neq \emptyset$. Therefore, for all $\xi, \zeta$, if $\xi \stackrel{?}{=} \zeta$ or $\xi \neq \zeta$ holds on $\phi$ then it also holds on $\psi$ respectively. It implies that $\phi$ and $\psi$ are statically equivalent.

We now show that observational preorder and equivalence are exactly characterized by the simulation preorder and bisimilarity.

**Theorem 2.** Let $\mathcal{P}, \mathcal{Q}$ two processes in $\mathcal{MP}$.

$$ \mathcal{P} \leq_{obs} \mathcal{Q} \text{ iff } (\mathcal{P}, \emptyset) \leq_{sim} (\mathcal{Q}, \emptyset) \quad \text{and} \quad \mathcal{P} \approx_{obs} \mathcal{Q} \text{ iff } (\mathcal{P}, \emptyset) \approx_{bi} (\mathcal{Q}, \emptyset) $$

**Proof sketch.** We here provide the main intuitions of the proof that $\mathcal{P} \leq_{obs} \mathcal{Q}$ iff $(\mathcal{P}, \emptyset) \leq_{sim} (\mathcal{Q}, \emptyset)$.

(⇒). To show that observational preorder implies simulation, we need to represent the frame of an extended process $(\mathcal{P}, \phi)$ as a process: we output in parallel the terms $ax_i\phi$, with $ax_i \in \mathrm{dom}(\phi)$, on a public channel $c_i$, distinct for each $i$ and not occurring anywhere in $(\mathcal{P}, \phi)$. Thus, we build the relation $\mathcal{R}$ such that

$$ (\mathcal{P}, \phi) \mathcal{R} (\mathcal{Q}, \phi') \quad \text{if} \quad \mathcal{P} \cup \{\{\mathrm{out}(c_i, ax_i\phi)\}\}_{i=1}^n \leq_{obs} \mathcal{Q} \cup \{\{\mathrm{out}(c_i, ax_i\phi')\}\}_{i=1}^n $$

with $|\mathrm{dom}(\phi)| = |\mathrm{dom}(\phi')| = n$ and $c_1, \dots, c_n \in \mathcal{N}_{pub}$ pairwise distinct and not occurring in $\mathcal{P}, \mathcal{Q}, \phi, \phi'$. As the public channels $c_i$ do not occur anywhere else, any internal transition on

$$ \mathcal{P}_1 = \mathcal{P} \cup \{\{\mathrm{out}(c_i, ax_i\phi)\}\}_{i=1}^n $$

must correspond to an internal transition on $\mathcal{P}$; and similarly for $\mathcal{Q}$.

For all visible actions, we rely on $\leq_{obs}$ being closed by composition with an adversarial process. For example, when the action is the test $\xi \stackrel{?}{=} \zeta$, we compose with the adversarial process that (i) reads the frame, (ii) applies the test, and (iii) outputs on a fresh public channel $\mathcal{ok}$ if the test succeeds:

$$ \mathrm{Adv} = \mathrm{in}(c_1, x_1); \dots; \mathrm{in}(c_n, x_n); \text{ if } \xi\rho = \zeta\rho \text{ then } \mathrm{out}(\mathcal{ok}, \mathcal{ok}) $$
where $x_1, \dots, x_n$ are fresh variables and $\rho = \{ax_i \mapsto x_i\}_{i=1}^n$. We then consider the transition

$$ \{\text{Adv}\} \cup \mathcal{P}_1 \stackrel{\tau}{\Longrightarrow} \mathcal{R}_r^\rho \delta_{\mathcal{P} \cup \text{out}(\text{ok},\text{ok})} $$

and the fact that $\text{RProb}_{\mathcal{R}_r}(\mathcal{P} \cup \text{out}(\text{ok}, \text{ok}), \downarrow \text{ok}) = 1$ to conclude. Indeed, for

$$ \{\text{Adv}\} \cup \mathcal{Q} \cup \{\text{out}(c_i, ax_i\phi').0\}^{n}_{i=1} \stackrel{\tau}{\Longrightarrow}_r E $$

to exist with $\delta_{\mathcal{P} \cup \text{out}(\text{ok},\text{ok})} \hat{R} E$, $\{\text{Adv}\} \cup \mathcal{Q} \cup \{\text{out}(c_i, ax_i\phi'); 0\}^{n}_{i=1}$ must also have passed the test $\xi\rho = \zeta\rho$ in the conditional branching. Hence $\xi\phi' = \zeta\phi'$ and so $(\mathcal{Q}, \phi') \xrightarrow{\xi\phi'\zeta} \delta_{(\mathcal{Q}, \phi')}.$

When the visible action is an output or an input, the process is more complicated. The adversarial process starts by reading the frame as before and executing the action. The last part of the adversarial process consists in outputting again the frame so that we re-enter the relation $\mathcal{R}$. Assume for instance the action $\text{in}(\xi, \zeta)$. By definition, $\mathcal{P} = \mathcal{P}_1 \cup \{\text{in}(c, x); P\}$ with $\xi\phi \doteq c$, $(\mathcal{P}, \phi) \xrightarrow{\text{in}(\xi, \zeta)} \delta_{\mathcal{P}_1 \cup \{\mathcal{P}\sigma\}}$ and $\sigma = \{\zeta\phi/x\}$.

We consider the following adversarial process Adv:

$$ \text{Adv} = \text{in}(c_1, x_1); \dots; \text{in}(c_n, x_n); \text{out}(\xi\rho, \zeta\rho); (\text{out}(\text{ok}, \text{ok}) + 0.5 (\text{out}(c'_1, x_1) | \dots | \text{out}(c'_n, x_n))) $$

where $c'_1, \dots, c'_n$ are fresh public names pairwise distinct not occurring anywhere else. We will conclude by considering the transition

$$ \{\text{Adv}\} \cup \mathcal{P} \cup \{\text{out}(c_i, ax_i\phi); 0\}^{n}_{i=1} \stackrel{\tau}{\Longrightarrow}_r D $$

where $D = 0.5 \cdot \delta_{\mathcal{P}_1 \cup \{\mathcal{P}\{\zeta\phi/x\}, \text{out}(\text{ok},\text{ok})\}} + 0.5 \cdot \delta_{\mathcal{P}_1 \cup \{\mathcal{P}\{\zeta\phi/x\}\} \cup \{\text{out}(c'_i, ax_i\phi); 0\}^{n}_{i=1}}$. Indeed, for

$$ \{\text{Adv}\} \cup \mathcal{Q} \cup \{\text{out}(c_i, ax_i\phi'); 0\}^{n}_{i=1} \stackrel{\tau}{\Longrightarrow}_r E $$

to exist with $D \hat{R} E$, $\{\text{Adv}\} \cup \mathcal{Q} \cup \{\text{out}(c_i, ax_i\phi'); 0\}^{n}_{i=1}$ must also have applied an internal transition executing the construct $\text{out}(\xi\rho, \zeta\rho)$ which allows for the labeled action $\text{in}(\xi, \zeta)$ to be executed on $(\mathcal{Q}, \phi')$.

($\Leftarrow$). Showing that simulation implies observational preorder is more straightforward. We build a relation $\mathcal{R}$ such that $\mathcal{P}\mathcal{R}\mathcal{Q}$ when there exist two extended processes $(\mathcal{P}_1, \phi), (\mathcal{Q}_1, \phi')$ with compatible frames (i.e. $\text{dom}(\phi) = \text{dom}(\phi')$), a renaming $\rho$ from $\mathcal{N}_{\text{pub}}$ to $\mathcal{N}_{\text{priv}}$, and a multiset of adversarial processes $\mathcal{P}_{\text{Att}}$ such that:

* names in $\text{img}(\rho)$ do not occur in $\mathcal{P}_1, \phi, \mathcal{Q}_1$ and $\phi'$;

* $\mathcal{P} = \mathcal{P}_1\rho \cup \mathcal{P}_{\text{Att}}\{ax_i\phi/x_i\}_{i=1}^n\rho$;

* $\mathcal{Q} = \mathcal{Q}_1\rho \cup \mathcal{P}_{\text{Att}}\{ax_i\phi'/x_i\}_{i=1}^n\rho$;

* $(\mathcal{P}_1, \phi) \leq_{\text{sim}} (\mathcal{Q}_1, \phi')$.

The renaming $\rho$ replaces the private names that are generated by the processes in $\mathcal{P}_{\text{Att}}$ (through the construct new $a$; $P$) with public names that are chosen fresh (i.e. not in $\mathcal{P}_1, \phi, \mathcal{Q}_1$ and $\phi'$). $\square$
## 4.4. Randomized vs non-randomized schedulers

All our equivalence notions are based on randomized schedulers where the non-determinism is solved by picking a distribution from the convex hull of the available distributions. In the literature, more restrictive non-randomized schedulers have also been considered when defining observational equivalence and bisimilarity [12]. A non-randomized scheduler solves the non-determinism by choosing directly one of the available distributions. Formally, in Definition 4, instead of requiring that $\text{trans}'(s')(a) = D$ implies $\text{corr}(D) \in \text{conv}(\text{trans}(\text{corr}(s'))(a))$, a non-randomized resolution requires that $\text{trans}'(s')(a) = D$ implies $\text{corr}(D) \in \text{trans}(\text{corr}(s'))(a)$ and $\text{corr}$ is injective on the support of $D$.

Denoting by $\mathcal{R}_{nr}(N)$ the set of all non-randomized schedulers of $N$, we can naturally update the notions used to define behavioural equivalences to non-randomized schedulers. For instance, we denote by $\text{RProb}_{\mathcal{R}_{nr}(N)}(s, T)$ the probability of reaching $T$ from $s$ over all non randomized schedulers $\mathcal{R}_{nr}(N)$. Similarly, $\text{Prob}_{\mathcal{R}_{nr}(N)}(s, w)$ denotes the probability of executing the trace $w$ from $s$ over all schedulers from $\mathcal{R}_{nr}(N)$. Updating the definitions results into may-testing and trace preorder for non-randomized schedulers, denoted $\leq_{may}^{nr}$ and $\leq_{tr}^{nr}$ respectively. We now show that $\leq_{may}$ and $\leq_{tr}$ do not depend on the whether schedulers are randomized or not (unlike simulation based notions as we will see below).

**Lemma 2.** May testing and trace preorders with randomized and non-randomized resolutions coincide:

$$ \leq_{may} = \leq_{may}^{nr} \quad \text{and} \quad \leq_{tr} = \leq_{tr}^{nr} $$

**Proof sketch.** The core of the proof is the following fact: when we fix a randomized resolution $R$, an initial state $s$, and $n \in \mathbb{N}$, it is possible to decompose the behaviour of $R$ from state $s$ and during the $n$ first execution steps into a weighted family of non-randomized resolution $(\alpha_i, R_i)_{i \in I}$ (where the weight $\alpha_i$ is a coefficient in $[0, 1]$, in the sense that for every set of processes $\mathcal{P}$, $\text{RProb}_{R}^{\leq n}(s, \mathcal{P}) = \sum_{i \in I} \alpha_i \text{RProb}_{R_i}^{\leq n}(s, \mathcal{P})$. The construction of this decomposition is defined inductively on $n$. $\square$

This result is of interest as it is often easier to manipulate non-randomized schedulers, and we expect automated verification to be more convenient as well.

When considering observational equivalence, simulation and bisimulation, non-randomized schedulers raise a number of issues. First, as highlighted for instance in [19, 31], when considering bisimulation or simulation on general NPLTSs, non-randomized resolutions result into relations that are not transitive. We show that even on the specific NPLTS $N^l$, simulation is not transitive.

Simulation for non-randomized scheduler is naturally defined by extending the notation $D \stackrel{\tau}{\Rightarrow}_{R_r(N)} E$ to non-randomized scheduler, denoted $D \stackrel{\tau}{\Rightarrow}_{\mathcal{R}_{nr}(N)} E$: from Definition 8, we require $(\text{corr}, R)$ to be in $\mathcal{R}_{nr}(N)$ and additionally require an injectivity property on the correspondence function, i.e., $\text{corr}$ is injective on the support of $D'$. We denote the resulting simulation with non-randomized schedulers by $\leq_{sim}^{nr}$ (and similarly for $\leq_{obs}^{nr}$, $\approx_{obs}^{nr}$ and $\approx_{bi}^{nr}$).

**Lemma 3.** $\leq_{sim}^{nr}$ is not transitive.
<figure><img src="image_18.png" /></figure>

For readability, $\alpha$ stands for all labels ($\xi \sim \xi'$), with closed recipes $\xi, \xi'$ such that $\xi \sim \xi' (\sim \in \{\doteq, \neq\})$ and $P_{ab}(p) = \{\{\text{out}(a, c)\} +_p \text{out}(b, c)\}$

(a) The fragment of $N^l$ corresponding to $(\{\{Q\}\}, \emptyset)$ and $(\{\{R\}\}, \emptyset)$.

<figure><img src="image_19.png" /></figure>

(b) The resolution for $(\{\{R\}\}, \emptyset) \stackrel{\tau}{\Rightarrow}_{R_{nr}} 0.5 \cdot \delta_{\text{out}(a,c)} + 0.5 \cdot \delta_{\text{out}(b,c)}$.

<caption>Figure 7. Fragments of $N^l$ showing $(\{\{P\}\}, \emptyset) \leq_{sim}^{nr} (\{\{R\}\}, \emptyset) \leq_{sim}^{nr} (\{\{Q\}\}, \emptyset)$ but $(\{\{P\}\}, \emptyset) \not\leq_{sim}^{nr} (\{\{Q\}\}, \emptyset)$</caption>

**Proof sketch.** Consider processes

$$P = \text{out}(a, c) +_{0.5} \text{out}(b, c)$$

$$Q = (\text{out}(a, c) +_{0.9} \text{out}(b, c)) + (\text{out}(a, c) +_{0.1} \text{out}(b, c))$$

$$Q' = \text{if } c = c \text{ then } Q \text{ else } 0$$

$$R = Q +_{0.5} Q'$$

The corresponding fragment of $N^l$ is displayed in Figure 7a. We will show that

$$(\{\{P\}\}, \emptyset) \leq_{sim}^{nr} (\{\{R\}\}, \emptyset) \text{ and } (\{\{R\}\}, \emptyset) \leq_{sim}^{nr} (\{\{Q\}\}, \emptyset) \text{ but } (\{\{P\}\}, \emptyset) \not\leq_{sim}^{nr} (\{\{Q\}\}, \emptyset)$$

It is easy to see that $(\{\{Q\}\}, \emptyset) \approx_{bi}^{nr} (\{\{Q'\}\}, \emptyset)$ and so $(\{\{R\}\}, \emptyset) \leq_{sim}^{nr} (\{\{Q\}\}, \emptyset)$. The difficult part of the proof of $(\{\{P\}\}, \emptyset) \leq_{sim}^{nr} (\{\{R\}\}, \emptyset)$ is to match

$$(\{\{P\}\}, \emptyset) \stackrel{\tau}{\rightarrow} 0.5 \cdot \delta_{(\{\text{out}(a,c)\}, \emptyset)} + 0.5 \cdot \delta_{(\{\text{out}(b,c)\}, \emptyset)}$$

This is achieved by the scheduler displayed in Figure 7b.
<figure><img src="image_20.png" /></figure>

For readability, $\alpha(\phi)$ stands for all labels $\xi \sim \xi'$ with $\xi, \xi'$ closed recipes such that $\xi\phi \sim \xi'\phi$ and $\sim \in \{\doteq, \neq\}$.

(a) The fragment of $N^l$ corresponding to $\{\llbracket Q\rrbracket, \emptyset\}$ and $\{\llbracket P\rrbracket, \emptyset\}$

$$ 
\begin{align*}
\mathcal{P}_{da} &= \text{out}(d, c); (\text{out}(a, c) + 0.9 \ 0) & \mathcal{P}_{a+} &= \{\llbracket \text{out}(a, c) + 0.9 \ 0 \rrbracket\} & \mathcal{P}_{a} &= \{\llbracket \text{out}(a, c) \rrbracket\} \\
\mathcal{P}_{db} &= \text{out}(d, c); (\text{out}(b, c) + 0.9 \ 0) & \mathcal{P}_{b+} &= \{\llbracket \text{out}(b, c) + 0.9 \ 0 \rrbracket\} & \mathcal{P}_{b} &= \{\llbracket \text{out}(b, c) \rrbracket\} \\
\phi &= \{\text{ax}_1 \to c\} & \phi' &= \{\text{ax}_1 \to c, \text{ax}_2 \to c\}
\end{align*}
$$

<figure><img src="image_21.png" /></figure>

(b) The fragment of $N^o$ corresponding to $\{\llbracket P; \text{in}(d, x).0 \rrbracket\}$ and $\{\llbracket Q; \text{in}(d, x).0 \rrbracket\}$

<caption>Figure 8. Fragments of NPLTS showing $(\{\llbracket Q\rrbracket, \emptyset\}) \approx_{bi}^{nr}(\{\llbracket P\rrbracket, \emptyset\})$ and $(\{\llbracket Q\rrbracket\} \not\approx_{obs}^{nr} \{\llbracket P\rrbracket\})$.</caption>

Finally, we prove $(\{\llbracket P\rrbracket, \emptyset\}) \not\leq_{sim}^{nr}(\{\llbracket R\rrbracket, \emptyset\})$ by showing that the transition $(\{\llbracket P\rrbracket, \emptyset\}) \xrightarrow{\tau} 0.5 \cdot \delta_{(\{\llbracket \text{out}(a,c)\rrbracket, \emptyset\}) + 0.5 \cdot \delta_{(\{\llbracket \text{out}(b,c)\rrbracket, \emptyset\})}}$ cannot be simulated in $(\{\llbracket Q\rrbracket, \emptyset\})$. $\square$

Note that the definitions of bisimilarity in [12] rely on non-randomized schedulers. Even though this does not necessarily imply that their relation is not transitive (as they focus directly on the semantics of processes) we show in the next lemma that $\approx_{bi}^{nr}$ and $\approx_{obs}^{nr}$ do not coincide, hence disproving [12, Theorem 2]. This reenforces our belief that it is preferable to use randomized schedulers in our definition.

**Lemma 4.** There exist processes $P, Q \in SP$ such that

* $(\{\llbracket Q\rrbracket, \emptyset\}) \approx_{bi} (\{\llbracket P\rrbracket, \emptyset\}),$

* $(\{\llbracket Q\rrbracket, \emptyset\}) \approx_{bi}^{nr} (\{\llbracket P\rrbracket, \emptyset\}),$ and

* $\{\llbracket Q\rrbracket\} \not\leq_{obs}^{nr} \{\llbracket P\rrbracket\}.$
**Proof sketch.** We consider the following processes:

$$P = \text{out}(d, c); (\text{out}(a, c) +_{0.9} 0) + \\ \text{out}(d, c); (\text{out}(b, c) +_{0.9} 0)$$

$$P' = \text{if } c = c \text{ then } P \text{ else } 0$$

$$Q = P + \frac{1}{2} P'$$

Both $\langle\langle Q \rangle\rangle, \emptyset \approx_{bi}^{nr} \langle\langle P \rangle\rangle, \emptyset$ and $\langle\langle Q \rangle\rangle, \emptyset \approx_{bi}^{nr} \langle\langle P \rangle\rangle, \emptyset$ are proved by showing that the binary relation $R$, defined as the reflexive, symmetric and transitive closure of $\{((\langle\langle Q \rangle\rangle, \emptyset), (\langle\langle P \rangle\rangle, \emptyset)), ((\langle\langle P \rangle\rangle, \emptyset), (\langle\langle P' \rangle\rangle, \emptyset))\}$, is a bisimulation (see Figure 8a).

To prove that $\langle\langle Q \rangle\rangle \leq_{obs}^{nr} \langle\langle P \rangle\rangle$, we show that $\langle\langle Q; \text{in}(d, x).0 \rangle\rangle \leq_{obs}^{nr} \langle\langle P; \text{in}(d, x).0 \rangle\rangle$. In particular (see Figure 8b), we build a non-randomized scheduler such that $\langle\langle Q; \text{in}(d, x).0 \rangle\rangle \stackrel{\tau}{\Rightarrow}_{R_{nr}(N^o)} D$ where $D = 0.45 \cdot \delta_{P_a} + 0.45 \cdot \delta_{P_b} + 0.1 \cdot \delta_{\emptyset}$. However, there is no distribution $E$ such that $\langle\langle P; \text{in}(d, x).0 \rangle\rangle \stackrel{\tau}{\Rightarrow}_{R_{nr}(N^o)} E$, and $D \leq_{obs}^{nr} E$. $\square$

Remark that we have cast the definitions of [12] in our own framework. In the full version [28] we show that processes $P, Q$ in Lemma 4 can be adapted to obtain the counterpart of Lemma 4 in the exact framework of [12]. The failure of the proof of [12, Theorem 2] can be traced back to the auxiliary lemma [12, Lemma 3] that states that bisimilarity is closed under application of closing evaluation contexts. No proof of this lemma is however provided, and it is actually false: as shown in the proof of (our) Lemma 4, the extended processes $(\langle\langle Q \rangle\rangle, \emptyset)$ and $(\langle\langle P \rangle\rangle, \emptyset)$ defined there are bisimilar (with respect to non-randomized schedulers), but it is not the case of the extended processes $(\langle\langle Q | \text{in}(d, x).0 \rangle\rangle, \emptyset)$ and $(\langle\langle P | \text{in}(d, x).0 \rangle\rangle, \emptyset)$.

## 5. Well behaved subclasses of protocols

It is a well-known phenomenon that non-determinism and probabilistic choices do not interact well: a particular scheduler may for instance leak a secret probabilistic choice. Such schedulers are generally deemed unrealistic, and several papers aim at restricting schedulers, e.g., [20, 21]. We illustrate this phenomenon on the following example.

**Example 3.** Consider the processes

$$P := (\text{in}(c, x). \text{if } x = 0 \text{ then } \text{out}(ok, 1) \text{ else } \text{out}(bad, 1)) + \frac{1}{2} \\ (\text{in}(c, x). \text{if } x = 0 \text{ then } \text{out}(bad, 1) \text{ else } \text{out}(ok, 1))$$

$$Q := \text{in}(c, x).(\text{out}(ok, 1) + \frac{1}{2} \text{out}(bad, 1))$$

One may, intuitively, consider that these two processes exhibit the same behaviour. $Q$ takes an input and then with probability $\frac{1}{2}$ decides to either output on $ok$ or on $bad$. $P$ on the other hand first chooses a branch with probability $\frac{1}{2}$. Each branch performs an input and, depending on the input value, outputs either on $ok$ or on $bad$. As the two branches make opposite choices on the output according to the input value, one might expect the probability to output on $ok$ to be $\frac{1}{2}$.
However, P and Q are not may testing equivalent and can be distinguished by the adversary Adv = $\{\text{out}(c, 0) | \text{out}(c, 1)\}$. Indeed, we can show that:

$$RProb_{R^c}(P \cup Adv, \downarrow ok) = 1 \quad RProb_{R^c}(Q \cup Adv, \downarrow ok) = \frac{1}{2}$$

Intuitively, this results from the fact that the resolution may leak the probabilistic choice through the non-deterministic choice of the attacker to output 0 or 1. The resolution chooses the attacker to output 0 in the first probabilistic branch of P and 1 in the second.

In this section we identify two subclasses of processes that avoid this problem. The first such subclass is that of non-probabilistic processes, i.e., without the $+_p$ operator (we denote by $MP^{np}$ all the multisets of such processes). This is the class of the original applied $\pi$-calculus which also enjoys good tool support. Figure 6 already illustrated that even on non-probabilistic processes, probabilistic adversaries have a stronger distinguishing power for the may testing equivalence. We formally characterize this distinguishing power when restricting protocols to a bounded number of sessions (denoted $MP^{<\infty, np}$), i.e., considering processes without replication: for this subclass, may-testing coincides with similarity. We therefore inherit from [22] the fact that deciding may-testing is coNEXP complete for a large class of cryptographic primitives.

The second subclass considers purely probabilistic processes with (nearly) no non-determinism. We show that trace equivalence in this class (as considered for instance in [25]) corresponds to may-testing with a restricted, determinate adversary process. We also sketch how the algorithms of the DEEPSEC prover [22] could be adapted to check trace equivalence in this probabilistic setting.

## 5.1. Non-probabilistic processes

### 5.1.1. May-testing with non-probabilistic adversaries and trace equivalence coincide

Our definitions of may testing and trace equivalence coincide with the classical definitions of the original, purely non-deterministic applied $\pi$-calculus when all processes are non probabilistic. As a first step, we observe that the weak operational semantics we defined in Section 4.3 is a conservative extension of the weak (non-probabilistic) operational semantics: indeed, when considering non-probabilistic processes, all distributions in the (labeled) operational semantics are Dirac distributions.

**Notation 5.** We write $SP_\ell^{np}$ for the set of all non-probabilistic extended processes We write $\to_{np}$, respectively $\xrightarrow{a} \to_{np}$, for the one-step reduction relation we obtain when we restrict the NPLTS $N^o$ to $MP^{np}$, respectively $N^l$ to $SP_\ell^{np}$. For $P, Q \in MP^{np}$, we write $P \Rightarrow_{np} Q$ when there exists a sequence $P = P_0 \to_{np} \dots \to_{np} P_n = Q$.

**Lemma 5.** Let $P, Q \in MP^{np}$.

$$P \Rightarrow_{np} Q \quad \text{iff} \quad RProb_{R_{nr}(N^o)}(P, \{Q\}) = 1$$

We look now at *preorder relations* between non-probabilistic processes. We first recall formally how may testing, trace equivalence and bisimulation are defined for non-probabilistic processes (Definition 17 below). Those definitions are coherent with those from the literature, e.g [23], (up to the difference on static equivalence, discussed in Remark 5).
**Notation 6.** If $b$ is a barb, we write $\mathcal{P} \downarrow_b$ when there exists $Q$ such that $\mathcal{P} \Rightarrow_{np} Q$, and $Q \downarrow_b$. For $a \in \mathcal{A}_{ext}^\ell$, we write $(\mathcal{P}, \phi) \stackrel{a}{\Rightarrow}_{np} (Q, \psi)$ when $(\mathcal{P}, \phi) \xrightarrow{a} \mathcal{P} \Rightarrow_{np} \dots \xrightarrow{a} \mathcal{P} \Rightarrow_{np} (Q, \psi)$. If $\alpha = a_1, \dots, a_n$ is a trace, we write $(\mathcal{P}, \phi) \stackrel{\alpha}{\Rightarrow}_{np} (Q, \psi)$ when there exists a sequence $(\mathcal{P}, \phi) \stackrel{a_1}{\Rightarrow}_{np} \dots \stackrel{a_n}{\Rightarrow}_{np} (Q, \psi)$.

**Definition 17.** We define the binary relations $\leq_{sim}^{np}$, $\leq_{tr}^{np}$, $\leq_{sim}^{np}$ on $\mathcal{MP}^{np}$ as follows:

* $\mathcal{P} \leq_{sim}^{np} Q$ when $\forall \mathrm{Adv} \in \mathcal{MP}^{np} \text{ s.t. } \mathrm{fn}(\mathrm{Adv}) \subseteq \mathcal{N}_{pub} \cdot \forall c \in \mathcal{N}_{pub} \cdot \mathrm{Adv} \cup \mathcal{P} \downarrow_c$ implies $\mathrm{Adv} \cup Q \downarrow_c$;

* $(\mathcal{P}, \phi) \leq_{tr}^{np} (Q, \psi)$ when for every trace $\alpha$, $(\mathcal{P}, \phi) \stackrel{\alpha}{\Rightarrow}_{np} (\mathcal{P}', \phi')$ implies $(Q, \psi) \stackrel{\alpha}{\Rightarrow}_{np} (Q', \psi')$;

* $\leq_{sim}^{np}$ is the largest reflexive and transitive relation $R$ such that $(\mathcal{P}, \phi) R (Q, \psi)$ implies that for every $a \in \mathcal{A}_{ext}^\ell \cup \{\tau\}$, and $(\mathcal{P}, \phi) \xrightarrow{a} \mathcal{P} \Rightarrow_{np} (\mathcal{P}', \phi')$, there exists $(Q', \psi')$ such that $(Q, \psi) \xrightarrow{a} \mathcal{P} \Rightarrow_{np} (Q', \psi')$ and $(\mathcal{P}', \phi') R (Q', \psi')$.

The preorders $\leq_{sim}$ and $\leq_{tr}$–and the corresponding equivalence relations–are conservative extensions of $\leq_{sim}^{np}$ and $\leq_{tr}^{np}$. As expected, the preorder $\leq_{may}$ is not a conservative extension of $\leq_{may}^{np}$, because of the additional expressive power of probabilistic adversaries. Nonetheless, we can recover $\leq_{may}^{np}$ when we restrict the adversaries in the definition of $\leq_{may}$ to non-probabilistic adversaries.

**Proposition 2.** Let $\mathcal{P}, Q \in \mathcal{MP}^{np}$.

* $(\mathcal{P}, \emptyset) \leq_{sim}^{np} (Q, \emptyset)$ iff $(\mathcal{P}, \emptyset) \leq_{sim} (Q, \emptyset)$;

* $(\mathcal{P}, \emptyset) \leq_{tr}^{np} (Q, \emptyset)$ iff $(\mathcal{P}, \emptyset) \leq_{tr} (Q, \emptyset)$;

* $(\mathcal{P}, \emptyset) \leq_{may}^{np} (Q, \emptyset)$ iff $\begin{array}{l} \forall \mathrm{Adv} \in \mathcal{MP}^{np} \text{ s.t. } \mathrm{fn}(\mathrm{Adv}) \subseteq \mathcal{N}_{pub} \cdot \forall c \in \mathcal{N}_{pub} \\ \mathrm{RProb}_{\mathcal{R}_{nr}(N^o)}(\mathcal{P} \cup \mathrm{Adv}, \downarrow c) \leq \mathrm{RProb}_{\mathcal{R}_{nr}(N^o)}(Q \cup \mathrm{Adv}, \downarrow c) \end{array}$

**Proof sketch.** For may-testing and trace preorder, the proof uses crucially the fact that it is enough to consider non-randomized distributions (thanks to Lemma 2), and from there, we conclude using Lemma 5. Since it is not possible to consider only non-randomized schedulers in the definition of simulation, the proof of the first point in Proposition 2 is more subtle, and uses well-structured properties of the lifting of a relation from Definition 9. We need to show (1) that the (non-probabilistic) simulation $\leq_{sim}^{np}$ is a probabilistic simulation in the sense of Definition 16, and (2) that $\leq_{sim}$ is also a non-probabilistic simulation in the sense of Definition 17.

* Suppose that $\mathcal{P} \leq_{sim}^{np} Q$ for $\mathcal{P}, Q \in \mathcal{SP}^{np}$. Let $a \in \mathcal{A}_{ext}^\ell \cup \{\tau\}$, $D \in \mathcal{D}(\mathcal{S}_{N'})$ such that $\mathcal{P} \xrightarrow{a} D$. Looking at the way we defined $\xrightarrow{a} \mathcal{P}$ (and since $\mathcal{P}$ is non-probabilistic), we also see that $\mathcal{P} \xrightarrow{a} \mathcal{P}'$ for every $\mathcal{P}'$ is the support of $D$. From there, we obtain that for each $i$, there exists $Q'_i$ such that $Q \xrightarrow{a} \mathcal{P}' Q'_i$, and $\mathcal{P}' \leq_{sim}^{np} Q'_i$. At that point, we build $E = \sum_i D(\mathcal{P}'_i) \cdot \delta_{Q'_i}$, and we can see that $Q \xrightarrow{a} E$. Moreover, the structural properties of the lifting allows us to go from $(\forall i, \mathcal{P}'_i \leq_{sim}^{np} Q'_i)$ to $D \leq_{sim}^{np} E$. Hence, we have shown that $\leq_{sim}^{np}$ is indeed a probabilistic simulation in the sense of Definition 16.

* Suppose that $\mathcal{P} \leq_{sim} Q$ for $\mathcal{P}, Q \in \mathcal{SP}^{np}$. Let $a \in \mathcal{A}_{ext}^\ell \cup \{\tau\}$, and $\mathcal{P}' \in \mathcal{SP}^{np}$ such that $\mathcal{P} \xrightarrow{a} \mathcal{P}'$. This transition carries over to $N^\ell$, i.e., $\mathcal{P} \xrightarrow{a} \mathcal{P}'$. We obtain that there exists a distribution $E$ such that $Q \xrightarrow{a} E$, and $\delta_{\mathcal{P}'} \leq_{sim} E$. But by structural property of the lifting, we have that $\mathcal{P}' \leq_{sim} Q'$ for every element $Q'$ in the support of $E$. Moreover, since $Q$ is non-probabilistic, it holds that $Q \xrightarrow{a} \mathcal{P}' Q'$ for every element $Q'$ in the support of $E$. Since $E$ is a distribution, there exists at least one such element $Q'$, thus we can conclude. $\square$
The following result indicates that may testing and trace equivalence coincide in non-probabilistic settings. In particular, we recover the fact that for the classical definitions in non-probabilistic settings, trace equivalence implies may-testing, as shown in [23].

**Proposition 3.** Let $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}^{\text{np}}$.

$$ (\mathcal{P}, \emptyset) \leq_{tr} (\mathcal{Q}, \emptyset) \quad \text{iff} \quad \begin{array}{l} \forall \mathit{Adv} \in \mathcal{MP}^{\text{np}} \text{ s.t. } \mathit{fn}(\mathit{Adv}) \subseteq \mathcal{N}_{\text{pub}}, \forall c \in \mathcal{N}_{\text{pub}}. \\ \text{RProb}_{\mathcal{R}_{\text{nr}}(\mathcal{N}^o)}(\mathcal{P} \cup \mathit{Adv}, \downarrow c) \leq \text{RProb}_{\mathcal{R}_{\text{nr}}(\mathcal{N}^o)}(\mathcal{Q} \cup \mathit{Adv}, \downarrow c) \end{array} $$

### 5.1.2. May-testing and simulation coincide for bounded processes

We rely on a modal characterization of strong simulation on image finite labeled transition systems (LTS) by a Hennessy-Milner logic [32] (HML).

We can rely on strong simulation as it is a well-known fact ([33]) that simulation for a LTS can be expressed as strong simulation on the corresponding weak LTS, that is, in our case all transitions $(\mathcal{P}, \phi) \xrightarrow{\tau^*} \phi \xrightarrow{a} \tau^* \xrightarrow{\downarrow c}$ $(\mathcal{Q}, \psi)$ are merged into a single transition.

A LTS is image finite when the LTS cannot infinitely branch from a state and a label. Therefore, as we consider only bounded processes and by denoting $\leq_{ssim}^L$ the strong simulation relation on a LTS L, we can build an image finite LTS $L^\ell$ such that for all $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}^{\text{np}}$:

$$ (\mathcal{P}, \emptyset) \leq_{\text{sim}} (\mathcal{Q}, \emptyset) \quad \text{iff} \quad (\mathcal{P}, \emptyset) \leq_{\text{ssim}}^{L^\ell} (\mathcal{Q}, \emptyset) $$

Our HML characterization consists in expressing strong simulation preorder by the means of satisfaction of logical formulas by the LTS.

**Definition 18.** Let $\mathcal{A}$ be a countable set of actions. We define the set of logical formulas as:

$$ F \in \mathcal{F} := \top | a.F | F_1 \wedge F_2, \quad \text{where } a \in \mathcal{A} $$

In our case, the set of actions corresponds to $\mathcal{A}_{\text{ext}}^\ell$ that is indeed countable. The satisfaction of such formulas by a LTS is defined as follows.

**Definition 19.** Let $L = (\mathcal{S}, \mathcal{A}, \rightarrow)$ be a LTS. We say that $L$ satisfies a formula $F$, written $s \models F$, if for all $s \in \mathcal{S}$,

* $s \models \top$;

* $s \models a.F$ when $s \xrightarrow{a} t$ and $t \models F$;

* $s \models F_1 \wedge F_2$ when $s \models F_1$ and $s \models F_2$.

The following proposition shows how to relate strong simulation with satisfiability of logical formulas.

**Proposition 4 (HML caracterisation of simulation).** For an image finite LTS L,

$$ s \leq_{ssim}^L t \quad \text{iff} \quad \forall F \in \mathcal{F}. s \models F \text{ implies } t \models F $$

In order to prove that simulation coincides with may-testing for bounded non-probabilistic processes, we show that we can emulate any logical formula by a probabilistic adversary: for all formulas $F$, we
build a probabilistic adversary $Adv_F^c$ such that for all bounded non-probabilistic extended processes $(\mathcal{P}, \phi)$,

$$ (\mathcal{P}, \emptyset) \models F \quad \text{iff} \quad \text{RProb}_{\mathcal{R}_t}(\mathcal{P} \cup \{\text{Adv}_F^c\}, \downarrow c) = 1 $$

The construction of $Adv_F^c$ is defined as follows.

**Definition 20.** Let $F$ be a formula in $\mathcal{F}$, $ok \in \mathcal{N}_{pub}$ such that $ok \notin fn(F)$ and $n \in \mathbb{N}$. We let $\{\text{Adv}_F^c\} = \text{Adv}_{F,0}^{ok}$ and define $\text{Adv}_{F,n}^{ok}$ by induction on the syntax of $F$:

* if $F = \top$ then $\text{Adv}_{F,n}^{ok} = \text{out}(ok, ok)$.

* if $F = \text{in}(\xi, \zeta)$. $F'$ then $\text{Adv}_{F,n}^{ok} = \text{out}(\xi, \zeta)$; $\text{Adv}_{F',n}^{ok}$ when $\text{vars}(\xi, \zeta) \subseteq \mathcal{AX}_n$ and $\text{Adv}_{F,n}^{ok} = 0$ otherwise.

* if $F = \text{out}(\xi, \mathbf{ax})$. $F'$ then $\text{Adv}_{F,n}^{ok} = \text{in}(\xi, \mathbf{ax})$; $\text{Adv}_{F',n+1}^{ok}$ when $\mathbf{ax} = \mathbf{ax}_{n+1}$, $\text{vars}(\xi) \subseteq \mathcal{AX}_n$ and $\text{Adv}_{F,n}^{ok} = 0$ otherwise.

* if $F = (\xi \stackrel{?}{=} \zeta)$. $F'$ then $\text{Adv}_{F,n}^{ok} = \text{if } \xi = \zeta$ then $\text{Adv}_{F',n}^{ok}$ when $\text{vars}(\xi, \zeta) \subseteq \mathcal{AX}_n$ and $\text{Adv}_{F,n}^{ok} = 0$ otherwise.

* if $F = (\xi \stackrel{?}{\neq} \zeta)$. $F'$ then $\text{Adv}_{F,n}^{ok} = \text{if } \xi = \zeta$ then 0 else $\text{Adv}_{F',n}^{ok}$ when $\text{vars}(\xi, \zeta) \subseteq \mathcal{AX}_n$ and $\text{Adv}_{F,n}^{ok} = 0$ otherwise.

* if $F = F_1 \wedge F_2$, then $\text{Adv}_{F,n}^{ok} = \text{Adv}_{F_1,n}^{ok} + \frac{1}{2} \text{Adv}_{F_2,n}^{ok}$.

In Definition 20, the integer $n$ and the conditions on the variables of $\xi, \zeta$ ensure that the adversarial process $\text{Adv}_{F,n}^{ok}$ is closed (no free variables). This is not a restriction as $(\mathcal{P}, \emptyset) \models F$ implies that $F$ satisfies these conditions. In particular, we note that conjunction is encoded by probabilistic choice and on formula $\top$, the adversary process exhibits the barb $c$. The main result of this section follows almost directly.

**Proposition 5.** Let $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}^{<\infty, np}$.

$$ (\mathcal{P}, \emptyset) \leq_{\text{sim}} (\mathcal{Q}, \emptyset) \quad \text{iff} \quad \mathcal{P} \leq_{\text{may}} \mathcal{Q} $$

Cheval et al. have shown [22] that both deciding trace equivalence and bisimilarity is coNEXPTIME complete when cryptographic primitives are modelled by a subterm convergent destructor rewrite system and the number of sessions is bounded. (We refer the reader to [22] for a precise definition of this class of rewrite systems.) The hardness proof reduces SUCCINT 3SAT to both trace equivalence and bisimilarity using a same encoding which also proves hardness of similarity. The coNEXPTIME decision procedure for bisimilarity can be directly adapted to the case of similarity, hence, we have the following result.

**Corollary 1.** Let $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}^{<\infty, np}$. Deciding $\mathcal{P} \approx_{may} \mathcal{Q}$ is coNEXPTIME complete when $\doteq$ is defined by a subterm convergent destructor rewrite system.

### 5.1.3. May-testing and simulation do not coincide for unbounded processes

We consider the following two simple LTS $L_1$ and $L_2$, that are an asymmetric variant of the LTSs used in [34] to show that the finitary HML does not characterize bisimulation.
<figure><img src="image_22.png" /></figure>

1

<figure><img src="image_23.png" /></figure>

2

3

4

5

6

7

8

9

Though both L₁ and L₂ may produce an unbounded number of a transitions, the initial transition in L₂ decides on an arbitrary, but fixed number of a transitions in the rest of the execution. This in particular shows that L₂ does not simulate L₁, i.e., L₁ ≁<sub>sim</sub> L₂.

In the applied π-calculus, L₁ can be represented by the process !out(c, a). Modeling L₂ is more complex: we non-deterministically choose an integer n ≥ 0, and output n + 1 times a. The non deterministic choice of n is realized through the following process that outputs the unary encoding hⁿ(b) of n:

$$Q_{count}(e) = \text{new } d. (\text{out}(d, b) | \text{!in}(d, x). (\text{out}(e, x) + \text{out}(d, h(x))))$$

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

Channel *d* represents a memory cell initiated with a public name *b* (encoding 0). When reading on *d* the current value *x*, the process non deterministically chooses to increment *x* (updating the cell with *h*(*x*)) or to *select* the value *x* by outputting it on channel *e*.

It remains to model the process that given an integer *x*, produces *x* + 1 outputs of *a*:

$$Q_{out}(e) = \text{new } d'.\text{in}(e, x). (\text{out}(d', b) | \text{!in}(d', y).\text{out}(c, a).\text{if } x = y \text{ then } 0 \text{ else } \text{out}(d', h(y)))$$

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

**Lemma 6.** Let $Q = \text{new } e.(Q_{count}(e) | Q_{out}(e))$. We have:

$$ (!\text{out}(c, a), \emptyset) \not\leq_{sim}^{N^t} (Q, \emptyset) \text{ but } !\text{out}(c, a) \leq_{may} Q$$

**Proof sketch.** (!out(c, a), ∅) ≁<sub>sim</sub><sup>N<sup>t</sup></sup> (Q, ∅) is shown by relying on the same idea used to show L₁ ≁<sub>sim</sub> L₂. Before the first output on c, Q must produce a communication on e, hence fixing the value of x used in Q<sub>out</sub>(e) which bounds the number of following outputs on c by x + 1. As !out(c, a) may output on c an unbounded number of times, we conclude.

To prove that !out(c, a) ≤<sub>may</sub> Q, we unfold the definition of RProb<sub>R</sub>({!out(c, a)}) ∪ Adv, ↓ ch) and focus on RProb<sub>R</sub><sup>≤n</sup>(s, corr<sup>-1</sup>(↓ ch)) where (corr, R) is a resolution, n ∈ N and corr(s) = {!out(c, a)} ∪ Adv. One can notice that by definition, the number of transitions from s in the computation of RProb<sub>R</sub><sup>≤n</sup>(s, corr<sup>-1</sup>(↓ ch)) is bounded by n. Thus, the resolution R may at most unfold n times the process !out(c, a). By denoting P<sup>n</sup> = <out(c, a); ... ; out(c, a)>, we can build a resolution whose probability to exhibit the barb ch from {P<sup>n</sup>} ∪ Adv is the same as RProb<sub>R</sub><sup>≤n</sup>(s, corr<sup>-1</sup>(↓ ch)). We then rely on (P<sup>n</sup>, ∅) ≤<sub>sim</sub> (Q, ∅) and Theorem 2 to conclude that RProb<sub>R</sub><sup>≤n</sup>(s, corr<sup>-1</sup>(↓ ch)) ≤ RProb<sub>R</sub>({Q} ∪ Adv, ↓ ch) which allows us to conclude. □
## 5.2. Purely probabilistic processes

At the opposite of the spectrum of purely non-deterministic processes, we study *purely probabilistic* processes with (nearly) no non-determinism. A similar class of processes has been considered in [25, 26] to model various protocols relying on randomization (e.g., Crowds [10], mix-net [9], electronic voting [35]). They consider systems that are built as the parallel composition of independent agents, called *roles*, and where all communications are mediated by the adversary. Moreover, the internal behavior of each role is deterministic; the only non-determinism is controlled by the adversary–thus external–and consists in the adversary’s choice for scheduling the communications. We model purely probabilistic processes as follows.

**Definition 21.** A process is *fully determinate* if it does not contain the operators `+`, `|`, nor `!`.

$\mathcal{P} = \{P_1, \dots, P_n\} \in \mathcal{MP}$ is *purely probabilistic* when:

* each $P_i$ is fully determinate;

* there exist distinct public channels $c_1, \dots, c_n \in \mathcal{N}_{pub}$ such that for all $i \in \{1, \dots, n\}$, all input and output actions in $P_i$ are on $c_i$.

The class of purely probabilistic multisets of processes is denoted by $\mathcal{MP}^{pp}$.

$\mathcal{MP}^{pp}$ can also be seen as a probabilistic extension of the class of *simple processes* introduced in [36] to show that trace equivalence coincides with observational equivalence for such processes.

### 5.2.1. Removing scheduling of $\tau$-actions

In [25, 26], the authors consider trace equivalence for a slightly restricted fragment of purely probabilistic processes. More precisely, all processes have exactly the same control structure which removes the necessity of scheduling honest $\tau$-actions and allows to directly consider *strong* trace equivalence, as exactly the same $\tau$-actions occur. In this work, we lift this restriction on the shape of the processes and show instead that the non-determinism related to honest $\tau$ actions is inconsequential when deciding trace equivalence. Indeed, in a multiset of processes $\{P_1, \dots, P_n\}$, a $\tau$ action may be available simultaneously in multiple components. However, all such $\tau$-action are in fact purely deterministic (e.g., conditional branching, probabilistic choice). Moreover, as the $P_i$s do not contain parallel composition and all input and output occur on distinct channels $c_i$, no internal communication between processes $P_i$ and $P_j$ is possible.

We show that to compute the probability of executing a trace $w$, we only need to consider a single *maximal* resolution on the NPLTS $N^l$. Such a resolution always executes an action when at least one is available. Formally, a resolution (*corr*, *R*) with $R = (S, A, \text{trans})$ on purely probabilistic processes is maximal when for all $s \in S$, if there exists *corr(s)* $\xrightarrow{a}$ *D* in $N^l$ for some *a*, *D* then *trans(s)(a)* = *D'* for some *D'*.

**Proposition 6.** Let $(\mathcal{P}, \phi)$ be an extended purely probabilistic process. For all maximal resolutions (*corr*, *R*) on $N^l$, for all $s \in S(R)$ with *corr(s)* = $(\mathcal{P}, \phi)$,

$$ \forall w \in \mathcal{A}_{\text{ext}}^{*} . \text{Prob}_{R}(s, w) = \text{Prob}_{\mathcal{R}_{l}'}((\mathcal{P}, \phi), w). $$
### 5.2.2. May-testing and trace equivalence coincide for fully determinate adversaries

As illustrated in Example 3, may-testing is strictly stronger than trace equivalence even on purely probabilistic processes due to the non-determinism in the adversarial process. However, by restricting the adversarial process to be fully determinate, we can show that may-testing and trace equivalence coincide. We define the resulting *determinate may testing preorder*, denoted $\leq_{d-may}$, exactly as in Definition 7 but additionally restrict the adversary process *Adv* to be a singleton $\{\{A\}\}$ where *A* is fully determinate.

**Theorem 3.** Let $\mathcal{P}, \mathcal{Q} \in \mathcal{MP}^{pp}$.

$$ \mathcal{P} \leq_{d-may} \mathcal{Q} \quad \text{iff} \quad (\mathcal{P}, \emptyset) \leq_{tr} (\mathcal{Q}, \emptyset) $$

**Proof sketch.** To prove that $(\mathcal{P}, \emptyset) \leq_{d-may} (\mathcal{Q}, \emptyset)$ implies $\mathcal{P} \leq_{tr} \mathcal{Q}$ we encode any trace $w$ into a determinate adversary $Adv_w^c$ where $c$ is fresh. $Adv_w^c$ is defined in a similar way as $Adv_F^c$ (Section 5.1), e.g.,

$$ Adv_{in(\xi, \zeta), w'}^c = out(\xi, \zeta); Adv_{w'}^c \quad \text{and} \quad Adv_{(\xi \stackrel{?}{=} \zeta), w'}^c = \text{if } \xi = \zeta \text{ then } Adv_{w'}^c $$

In particular, on the empty trace the adversary process exhibits the barb $c$: $Adv_c^c = out(c, c)$. We obtain that

$$ \mathrm{Prob}_{\mathcal{R}_t(N^l)}((\mathcal{P}, \emptyset), w) = \mathrm{RProb}_{\mathcal{R}_t^p}(\mathcal{P} \cup \mathcal{A}_{dv}, \downarrow c) $$

The other implication is more difficult as the adversarial process *Adv* is allowed to use probabilistic choices which cannot be directly encoded in a trace. Instead, we show that any adversarial process *Adv* aiming to exhibit a barb *c* corresponds to a multiset of weighted traces $\mathrm{Tr}(Adv)$, built inductively on *Adv*. For instance, when $Adv = Adv_1 +_p Adv_2$ and

$$ \mathrm{Tr}(Adv_i) = \{\{(p_k^i, w_k^i)\}_{k=1}^{n_1}\} \quad \text{for } i = 1, 2 $$

then

$$ \mathrm{Tr}(Adv) = \{\{(p \cdot p_k^1, w_k^1)\}_{k=1}^{n_1}\} \cup \{\{((1-p) \cdot p_k^2, w_k^2)\}_{k=1}^{n_2}\} $$

For other constructs, the set of weighted traces is built as expected, e.g., $\mathrm{Tr}(0) = \emptyset$ and $\mathrm{Tr}(\mathrm{new } a; Adv') = \mathrm{Tr}(Adv')$. For outputs or inputs, we additionally test if the channel corresponds to the barb *c*, i.e., when $Adv = out(\xi, \zeta)$; $Adv'$ and $\mathrm{Tr}(Adv') = \{\{(p_k, w_k)\}_{k=1}^n\}$,

$$ \mathrm{Tr}(Adv) = \{\{(p_k, (\xi \stackrel{?}{=} c).in(\xi, \zeta).w_k)\}_{k=1}^n\} \cup \{\{(1, \xi \stackrel{?}{=} c)\}\} $$

This construction yields the following property:

$$ \begin{aligned} \mathrm{RProb}_{\mathcal{R}_{nr}(N^o)}(P \cup Adv, \downarrow c) = & \mathrm{RProb}_{\mathcal{R}_{nr}(N^o)}(P, \downarrow c) \\ & + (1 - \mathrm{RProb}_{\mathcal{R}_{nr}(N^o)}(P, \downarrow c)) \cdot \sum_{(\alpha, w) \in \mathrm{Tr}(Adv)} \alpha \cdot \mathrm{Prob}_{\mathcal{R}_{nr}(N^o)}((P, \emptyset), w) \end{aligned} $$

Intuitively, exhibiting the barb on *c* does not require any interaction with the adversary, or this interaction is correctly encoded in $\mathrm{Tr}(Adv)$. Using this property we easily conclude. $\square$
## 6. Deciding trace equivalence and tool support

As previous mentioned, Cheval et al. [22] designed a decision procedure for trace equivalence when cryptographic primitives are modelled by a subterm convergent destructor rewrite system and a bounded number of sessions. This procedure is based on constraint solving techniques that represent the infinite set of all possible concrete executions of the processes and an arbitrary attacker as a finite symbolic tree, called the partition tree. Intuitively, each node of this symbolic tree represents the state of the two processes after executing a trace tr. Due to non-determinism, a node may contain several constraint systems corresponding to every possible interleaving allowing the execution of a given trace tr. Deciding trace equivalence between processes A and B, in the original, non-probabilistic setting, requires to check that each node of the symbolic tree contains at least one constraint system derived from process A and one from process B; or the node is empty.

We show how to extend this procedure in order to decide trace equivalence in a general setting where both probabilistic and non-determinism behavior may co-exist in the process. Obviously, we inherit the setting of a bounded number of sessions and cryptographic primitives modeled by a subterm convergent destructor rewrite system.

Following Lemma 2, proving $(\mathcal{P}, \phi) \leq_{tr} (\mathcal{P}', \phi')$ is equivalent to proving $(\mathcal{P}, \phi) \leq_{nr} (\mathcal{P}', \phi')$. Thus, by definition, we focus on the computation of $\text{Prob}_{\mathcal{R}_{nr}(N^l)}((\mathcal{P}, \phi), w)$ for all $w \in \mathcal{A}_{\text{ext}}^{l*}$. A main difficulty stems from the presence of universal quantification over resolutions. However, as $\mathcal{P}$ is bounded, we can completely ignore resolutions and focus on the labelled semantics, as shown by the following property.

**Lemma 7.** Let $(\mathcal{P}, \phi) \in \mathcal{SP}^{<\infty}_l$. Let $a \in \mathcal{A}_{\text{ext}}^l$. Let $w \in \mathcal{A}_{\text{ext}}^{l*}$.

$$ \text{Prob}_{\mathcal{R}_{nr}(N^l)}((\mathcal{P}, \phi), \epsilon) = 1 \qquad \text{Prob}_{\mathcal{R}_{nr}(N^l)}((\mathcal{P}, \phi), a.w) = \max(p_1, p_2) $$

where

$$ p_1 = \max_{(\mathcal{P}, \phi) \to_D D} \sum_{(\mathcal{P}', \phi') \in \text{supp}(D)} D((\mathcal{P}', \phi')) \cdot \text{Prob}_{\mathcal{R}_{nr}(N^l)}((\mathcal{P}, \phi), a.w) $$

$$ p_2 = \max_{(\mathcal{P}, \phi) \to_a D} \sum_{(\mathcal{P}', \phi') \in \text{supp}(D)} D((\mathcal{P}', \phi')) \cdot \text{Prob}_{\mathcal{R}_{nr}(N^l)}((\mathcal{P}, \phi), w) $$

Note that this inductive definition is well founded as the size of the processes strictly decreases at each semantics step since there is no replication.

As mentioned above, partition trees [22] are a finite symbolic representation of the concrete executions of the two initial processes. Each node contains all reachable states of the two processes after executing some trace w. However, to compute the probability $\text{Prob}_{\mathcal{R}_{nr}(N^l)}((\mathcal{P}, \phi), w)$, Lemma 7 also requires to know the different semantics steps that led to the process states after executing w. In other words, it requires the history of each extended processes. Therefore, to simplify the probability computation, we extended the labelled semantics by adding the history of transitions leading to the extended process. To further simplify, we assume that each input, output, probabilistic choice and non-deterministic choice are decorated with a label $\ell \in \mathcal{L}$, denoted $\text{in}^\ell(u, x)$; $P$, $\text{out}^\ell(u, v)$; $P$ and $P +_p^\ell Q$, $P +^\ell Q$ respectively. Additionally, we assume that all labels are distinct in the initial processes.

**Definition 22.** We define history entries as elements from $\{h_1(\ell), h_2(\ell, \ell'), h_+(\ell, p, i), h_c(\ell, i) \mid i \in \{0, 1\}, p \in ]0, 1[, \ell \text{ label}\}$. A history, usually denoted H, is a sequence of history entries.
Extended processes and the labelled semantics can naturally be extended to include history. In particular when $(\mathcal{P}, \phi) \to_a D$ and $(\mathcal{P}', \phi') \in \text{supp}(D)$, we define $(\mathcal{P}, \phi, \mathcal{H}) \xrightarrow{a} (\mathcal{P}', \phi', \mathcal{H}')$ where:

1

2

3

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_+(\ell, p, 0)$ when $\mathcal{P} = \mathcal{Q} \cup \{\mathcal{P} +_p^\ell \mathcal{Q}\}$ and $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{P}\}$;

4

5

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_+(\ell, p, 1)$ when $\mathcal{P} = \mathcal{Q} \cup \{\mathcal{P} +_p^\ell \mathcal{Q}\}$ and $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{Q}\}$;

6

7

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_c(\ell, 0)$ when $\mathcal{P} = \mathcal{Q} \cup \{\mathcal{P} +_p^\ell \mathcal{Q}\}$ and $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{P}\}$;

8

9

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_c(\ell, 1)$ when $\mathcal{P} = \mathcal{Q} \cup \{\mathcal{P} +_p^\ell \mathcal{Q}\}$ and $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{Q}\}$;

10

11

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_2(\ell, \ell')$ when $\mathcal{P} = \mathcal{Q} \cup \{\text{out}^\ell(u, t) \cdot \mathcal{P}, \text{in}^{\ell'}(v, x) \cdot \mathcal{Q}\}$, $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{P}, \mathcal{Q}\{x \mapsto t\}\}$;

12

13

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_1(\ell)$ when $\mathcal{P} = \mathcal{Q} \cup \{\text{out}^\ell(u, t) \cdot \mathcal{P}\}$ and $a = \text{out}(\xi, \mathcal{ax}_n)$ and $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{P}\}$;

14

15

16

17

* $\mathcal{H}' = \mathcal{H} \cdot \mathcal{h}_1(\ell)$ when $\mathcal{P} = \mathcal{Q} \cup \{\text{in}^\ell(u, x) \cdot \mathcal{P}\}$ and $a = \text{in}(\xi, \zeta)$ and $\mathcal{P}' = \mathcal{Q} \cup \{\mathcal{P}\{x \mapsto \zeta\phi\}\}$;

18

19

* $\mathcal{H}' = \mathcal{H}$ otherwise.

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

Given $w \in \mathcal{A}_{\text{ext}}^{\ell *}$, we write $(\mathcal{P}, \phi, \mathcal{H}) \stackrel{w}{\Rightarrow} (\mathcal{P}', \phi', \mathcal{H}')$ when $(\mathcal{P}, \phi, \mathcal{H}) \xrightarrow{a_1} \dots \xrightarrow{a_n} (\mathcal{P}', \phi', \mathcal{H}')$ and $w$ is $a_1 \dots a_n$ with the $\tau$ labels removed.

Since labels occur at most once in the initial process, intuitively, two extended processes with a shared prefix executed the same semantics steps. In other words, if

$$ (\mathcal{P}, \phi, \mathcal{H}) \stackrel{w}{\Rightarrow} (\mathcal{P}_1, \phi_1, \mathcal{H}_0 \cdot \mathcal{H}_1) \quad \text{and} \quad (\mathcal{P}, \phi, \mathcal{H}) \stackrel{w}{\Rightarrow} (\mathcal{P}_2, \phi_2, \mathcal{H}_0 \cdot \mathcal{H}_2) $$

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

then there exist $w_0, w_1$ and an extended process $(\mathcal{P}_0, \phi_0, \mathcal{H}_0)$ such that $w = w_0 w_1$ and

<figure><img src="image_24.png" /></figure>

We now describe how we can compute the probability that $(\mathcal{P}, \phi)$ executes a trace $w$ from the set of histories obtained after executing $w$, i.e. $\{\mathcal{H}' | (\mathcal{P}, \phi, \mathcal{H}') \stackrel{w}{\Rightarrow} (\mathcal{P}', \phi', \mathcal{H}')\}$ where $\mathcal{H}'$ denotes the empty sequence.

**Definition 23.** Let $S$ be a set of histories. We denote by $S|_h = \{\mathcal{H}' | (h \cdot \mathcal{H}') \in S\}$. We define $\text{compute}(S)$ inductively as follows:

34

35

36

37

38

39

40

41

42

43

44

45

46

* $\text{compute}(\emptyset) = 0$

40

41

42

43

44

45

46

* $\text{compute}(\{\mathcal{H}'\}) = 1$, i.e., if $S$ is the singleton containing the empty sequence

40

41

42

43

44

45

46

* otherwise

$$ \text{compute}(S) = \max \left\{ \begin{array}{l} \max_{\ell} \text{compute}(S|_{h_1(\ell)}) \\ \max_{\ell, \ell'} \text{compute}(S|_{h_2(\ell, \ell')}) \\ \max_{\ell, i} \text{compute}(S|_{h_c(\ell, i)}) \\ \max_{\ell, p} (p \cdot \text{compute}(S|_{h_+(\ell, p, 0)}) + (1-p) \cdot \text{compute}(S|_{h_+(\ell, p, 1)})) \end{array} \right. $$

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46
The correspondence between Prob<sub>R<sub>nr</sub>(N<sup>l</sup>)</sub>((P, φ), w) and the function compute(·) is given in the following lemma.

**Lemma 8.** Let (P, φ) be an extended process, $w \in A_{ext}^l$ and $S = \{H' | (P, \phi,[]) \stackrel{w}{\Rightarrow} (P', \phi', H')\}$. We have that Prob<sub>R<sub>nr</sub>(N<sup>l</sup>)</sub>((P, φ), w) = compute(S).

This lemma provides the core property that allows us to update the partition trees generated by the procedure in [22] as well as the test performed on each node of this partition tree to conclude trace preorder.

**Theorem 4.** Let P, Q ∈ MP<sup>∞</sup> and ≜ be defined by a subterm convergent destructor rewrite system. Trace preorder (((P}}, Ø) ≜<sub>tr</sub>((Q}}, Ø) is decidable.

**Proof sketch.** First, we show that we can restrict the set of traces we need to verify. In particular, it suffices to look at traces $w \in A_{ext}^l$ that can be split in two parts: $w = w_1 \cdot w_2$ where $w_2$ only consists of actions of the form $\xi \doteq \zeta$ or $\xi \not\doteq \zeta$, and $w_1$ of any other kind of actions. In other words, we can push static equivalence tests towards the end of traces. Moreover, for all concrete traces $w_1$ not containing static equivalence tests, it suffices to check a finite number of concrete traces $w_1^1, \dots, w_2^n$ built only on static equivalence tests. To do this, we use a proof technique similar to the proof in [23] showing that trace equivalence and may testing coincide for processes with bounded number of sessions. Let us define the sets $S_P(w_1) = \{(P', \phi', H') | ((P}}, Ø,[]) \stackrel{w_1}{\Rightarrow} (P', \phi', H')\}$ and $S_Q(w_1) = \{(P', \phi', H') | ((Q}}, Ø,[]) \stackrel{w_1}{\Rightarrow} (P', \phi', H')\}$. Since P and Q are bounded processes, $S_P(w_1)$, $S_Q(w_1)$ and $(S_P(w_1) \cup S_Q(w_1)) \setminus \sim$ are finite (here $\sim$ refers to static equivalence of frames). Therefore, for all $(P', \phi', H') \in S_P(w_1) \cup S_Q(w_1)$, we can define a finite sequence of actions $w_2$ built only on actions of the form $\xi \doteq \zeta$ or $\xi \not\doteq \zeta$ that exactly defines the equivalence class of $(P', \phi', H')$ in $(S_P \cup S_Q) \setminus \sim$, i.e., for all $(P'', \phi'', H'') \in S_P(w_1) \cup S_Q(w_1)$, $\phi' \sim \phi''$ if and only if $(P'', \phi'', H'') \stackrel{w_2}{\Rightarrow} (P'', \phi'', H'')$. Thus, if we denote by W this set of traces sufficient for proving trace preorder, we have that (((P}}, Ø) ≜<sub>tr</sub>((Q}}, Ø) if and only if for all $w \in W$, Prob<sub>R<sub>nr</sub>(N<sup>l</sup>)</sub>((P}, Ø), w) ≜ Prob<sub>R<sub>nr</sub>(N<sup>l</sup>)</sub>((Q}, Ø), w).

Second, similarly to how we augmented our labelled semantics with histories, we also augment the symbolic semantics used in [22] to generate partition trees with histories. As the addition of histories in symbolic extended processes does not impact in any way the generation of the partition trees, we can deduce from [22] that there exists a partition tree from P and Q, denoted PTree(P, Q). Thus, each node $\eta$ of the partition tree will now contain a set $\Gamma(\eta)$ of symbolic processes of the form $(P_c, \phi_c, C, H)$ where $(P_c, \phi_c)$ is an open extended processes, C is a set of constraints and H is a history. The set $\Gamma(\eta)$ can furthermore be divided into the sets of symbolic processes coming from P and from Q, respectively $\Gamma_P(\eta)$ and $\Gamma_Q(\eta)$. If we denote by $H(S)$ the set of histories of the (symbolic) extended processes in S, our decision procedure consists in checking that for all nodes $\eta \in PTree(P, Q)$, compute(H($\Gamma_P(\eta)$)) $\le$ compute(H($\Gamma_Q(\eta)$)).

To show that it indeed decides trace preorder, we recall that soundness of partition trees ensures that the nodes of the partition tree rooted by (((P}}, Ø,[]) and (((Q}}, Ø,[]) contain the symbolic processes representing all concrete extended processes reached after executing some trace w and that are statically equivalent. Moreover, completeness of partition trees ensures that for all concrete traces $w \in W$, there exists a node in the partition tree such that if (((P}}, Ø,[]) $\stackrel{w}{\Rightarrow}$ (P', $\phi'$, H') or (((Q}}, Ø,[]) $\stackrel{w}{\Rightarrow}$ (P', $\phi'$, H') then $\Gamma(\eta)$ contains a symbolic process representing (P', $\phi'$, H').

Formally, we show that:
• Soundness: $\forall \eta \in \text{PTree}(P, Q), \exists w \in W \text{ s.t. } H(S_P(w)) = H(\Gamma_P(\eta)) \text{ and } H(S_Q(w)) = H(\Gamma_Q(\eta))$

• Completeness: $\forall w \in W, \exists \eta \in \text{PTree}(P, Q) \text{ s.t. } H(S_P(w)) = H(\Gamma_P(\eta)) \text{ and } H(S_Q(w)) = H(\Gamma_Q(\eta))$

Applying Lemma 8, we obtain that

$$ \forall w \in W, \begin{array}{l} \text{Prob}_{\mathcal{R}_{nr}(N^t)}((\{\{P\}\}, \emptyset), w) \le \text{Prob}_{\mathcal{R}_{nr}(N^t)}((\{Q\}, \emptyset), w) \\ \text{if and only if} \end{array} $$

$$ \forall \eta \in \text{PTree}(P, Q), \text{compute}(H(\Gamma_P(\eta))) \le \text{compute}(H(\Gamma_Q(\eta))) $$

which allows us to conclude the proof. □

As a direct corollary we obtain that we can decide determinate may testing for purely probabilistic processes as it coincides with trace equivalence.

**Corollary 2.** Let $P, Q \in \mathcal{MP}^{pp}$ and $\doteq$ be defined by a subterm convergent destructor rewrite system. Determinate may testing preorder $(\{\{P\}\}, \emptyset) \le_{d-may} (\{\{Q\}\}, \emptyset)$ is decidable.

We have implemented the procedure described above in the DEEPSEC tool. The input language has been extended with a probabilistic choice operator $+_p$ where $p$ is a real number in $]0, 1[$. When trace equivalence between 2 processes is queried, the tool uses the above procedure for verification. The development is available on DEEPSEC's official github repository at [27].

As we will see in Section 7, we can use DEEPSEC to show that the dining cryptographers protocol does not provide anonymity when coins are biased.

## 7. An example: dining cryptographers

In this section, we illustrate our framework by proving anonymity of the well-known *dining cryptographers* protocol. This protocol has been designed to solve the following problem: three participants have a secret bit $b_i \in \{0, 1\}$, such that at most one of these bits equals 1, i.e. the sum $s$ of the three bits is either 0 or 1. The goal is to determine whether $s = 1$ while hiding any additional information of each $b_i$; in particular, if $s = 1$, it must be impossible to identify for which $i b_i = 1$. To do so, we suppose that each pair of participants $\{a_i, a_j\}$ has a private coin, that they can toss privately, i.e., only $a_i$ and $a_j$ can read the result. To solve the above described problem, participants proceed as follows:

(1) each pair $(a_i, a_j)$ of participants tosses its coin, and privately shares the result $c_{i,j}$;

(2) each participant $a_i$ outputs their result $r_i$, computed as the exclusive or (xor) of their secret bit $b_i$, and the result of both their left and right coins;

(3) each participant can compute $s$ by doing the xor of all the three $r_i$.

We suppose that the secret bits $b_i$ of each participant are determined by an assignment $B: \{a_1, a_2, a_3\} \to \{0, 1\}$, and denote by $DC_B$ the process (defined below) modeling the protocol with the given assignment. As we are interested in anonymity we focus on the case where one secret bit is 1 and we denote by $W_1$ the set of 1-weighted assignment functions, that is those functions that assign map exactly one participant to 1. Then, the security property for the dining cryptographers protocol can be stated as

$$ \forall B, B' \in W_1. DC_B \approx_{may} DC_{B'} $$
that is no adversary should be able to distinguish the systems $DC_B$ and $DC_{B'}$ whenever one of the secret bits equals 1.

Our contributions in this section are the following. First, we model the dining cryptographers protocol as a process $DC_B$ in the probabilistic applied $\pi$-calculus. Then we give a manual proof that (when coins are unbiased) $DC_B$ and $DC_{B'}$–where $B, B'$ are assignment functions as above–are may-testing equivalent. Finally, we show, using the tool DEEPSEC, that when the coins are biased those systems are not trace equivalent, thus not may-testing equivalent (Theorem 1).

### 7.1. Dining cryptographers in the probabilistic applied $\pi$-calculus

We split the definition of $DC_B$ in several components. First, we model the fact that two adjacent participants can toss a coin, and privately share the result. We model this by the oracle process $O_{c_l, c_r}$ (indexed by channels $c_l, c_r$): it performs a fair probabilistic choice, and sends the result in parallel on channel $c_r$ on its right, and channel $c_l$ on its left.

$$O_{c_l, c_r} := (\text{out}(c_l, 0) | \text{out}(c_r, 0)) +_{1/2} (\text{out}(c_l, 1) | \text{out}(c_r, 1))$$

We now define the process that models one agent $A_{c_l, c_r, c}(b)$: it is indexed by three channels–(private) channels $c_l$ and $c_r$ for communicating with the oracle placed to its left, respectively to its right, and a (public) channel $c$ for sending its final result. It also depends on the agent’s secret bit $b \in \{0, 1\}$.

$$A_{c_l, c_r, c}(b) := \text{in}(c_r, x_r); \text{in}(c_l, x_l); \text{out}(c, x_l \oplus x_r \oplus b)$$

where $\oplus$ models bitwise xor.

**Notation 7.** We fix a set of public names $\mathcal{A} = \{a_1, a_2, a_3\} \subseteq \mathcal{N}_{pub}$ and we will identify each participant to their public channel $a_i$.

Moreover, we define the set of oracles (or edges), that we note $\mathcal{E} := \{\{a_i, a_j\} | i \neq j, a_i, a_j \in \mathcal{A}\}$. Observe that $\mathcal{E}$ has three elements, that we call $e_1, e_2, e_3$ for convenience.

We also fix a set of 6 private names $\mathcal{C} = \{c_1, \dots, c_6\} \subseteq \mathcal{N}_{priv}$ that will serve as the private channels between oracles and participants; each of the three participants has access to two oracles. We formalize the association between channels, oracles and participants by three functions

$$c : \mathcal{A} \cup \mathcal{E} \to C \times C$$

$$e : C \to E$$

$$a : C \to A$$

Function $c$ associates to an agent or an edge the pair of channels (we denote by $c.l$ and $c.r$ the first and second projection of $c$ respectively). Functions $e$ and $a$ associate to a channel, the corresponding agent, respectively edge.

The overall system using these notations is depicted in Figure 9. Given $B \in \mathcal{W}_1$ we can now define the process $DC_B$ that puts in parallel three participants, and their three coin toss oracles. The agent channels used by the participants to communicate their final results are public. By contrast, the channels used to communicate with the oracles are hidden from the adversary, thus private and bound by new.

$$DC_B := \text{new } c_1, \dots, c_6 (||_{e \in \mathcal{E}} O_{c_l(e), c_r(e)} ||_{a \in \mathcal{A}} A_{c_l(a), c_r(a), a}(B(a)))$$

We can now formally state that the dining cryptographers protocol does ensure anonymity.
<figure><img src="image_25.png" /><figcaption>Figure 9. Dining cryptographers: graph representation</figcaption></figure>

**Theorem 5.** $\forall B, B' \in W_1$. $DC_B \approx_{may} DC_{B'}$

In order to show Theorem 5, we are going to show use the labelled semantics and show a stronger result, i.e. that $DC_B$ and $DC_{B'}$ are bisimilar.

## 7.2. Labelled semantics for the dining cryptographers protocol

The labelled semantics for our model of the dining cryptographers protocol is however complex: one of the reasons is that we do not enforce a particular order for the communications between the oracles $O_i$ and the participants $A_i$. Thus, we have both probabilistic and non-deterministic concurrent behaviors. As a consequence, it is difficult to prove our equivalence result directly in the NPLTS $N^l$. To solve this problem, we define an auxiliary simplified NPLTS $N_{DC}$, and show that:

(1) $N_{DC}$ is bisimilar to $N^l$;

(2) for every $B, B' \in W_1$ the $N_{DC}$-states corresponding to $DC_B$ and $DC_{B'}$ are bisimilar in $N_{DC}$.

The main idea for the construction of the auxiliary NPLTS $N_{DC}$ is that only relevant steps should appear. More precisely, we note that a run of the protocol should be entirely characterized by the oracles' probabilistic choices, and the order in which participants output their results. By contrast, the order of internal communications between participants and oracles occur-on the private channels $c_i$-is irrelevant.

**Definition 24.** We define sets of internal events $\Lambda$ and external events $\Lambda^{ext}$ as :

$$ \Lambda := \{e[\leftarrow b] \mid e \in \mathcal{E}, b \in \{0, 1\}\} \quad \Lambda^{ext} := \{a[\rightarrow b] \mid a \in \mathcal{A}, b \in \{0, 1\}\} $$

The event $e[\leftarrow b]$ means that oracle $e \in \mathcal{E}$ is sampling $b \in \{0, 1\}$. The event $a[\rightarrow b]$ means that participant $a \in \mathcal{A}$ is outputting $b$ on their public channel. We call history a pair $h = (s, l)$, where $s$ is a set of internal events in $\Lambda$ and $l$ is a list of external events in $\Lambda^{ext}$ such that no participant $a \in \mathcal{A}$ occurs twice in $l$. We denote by $\mathcal{H}$ the set of all such $h$.

**Notation 8.** To each history $h = (s, l)$, we associate a frame $\phi_h := \{ax_1 = b_1, \dots, ax_n = b_n\}$ when $l = (a_1[\rightarrow b_1], \dots, a_n[\rightarrow b_n])$. Moreover, for $e \in \mathcal{E}$, and history $h = (s, l)$, we write $e \in s$ when $e[\leftarrow b] \in s$ for some boolean $b$, and $e \notin h$ otherwise. We define similarly $a \in l$ and $a \notin l$ for $a \in \mathcal{A}$. We denote the empty history by $\epsilon_{\mathcal{H}} := (\emptyset, \epsilon)$.

We are now ready to define our simplified NPLTS $N_{DC}$. $N_{DC}$ has exactly the same set of actions as $N^l$, the NPLTS built from the labelled semantics. A state of $N_{DC}$ encapsulates information about both the
(relevant) history, and the assignment function of secret bits $\mathcal{A} \to \{0, 1\}$. These information are enough to decide how a history is modified by an action. More precisely three kinds of actions can be enabled in a given state.

The first kind are actions of the form $(\xi \stackrel{?}{=} \zeta)$, $(\xi \stackrel{\neq}{=} \zeta)$ that in $N^\ell$ perform an equality test on the frame. In $N_{DC}$ the equality test is performed on $\phi_h$, the frame built unambiguously from the history as defined in Notation 8. The second kind of action is the internal action $\tau$: in $N_{DC}$ $\tau$-actions correspond to a step where an oracle, that *does not already appear in the history*, randomly samples a boolean $b$. After such a $\tau$-action, which is inherently probabilistic, the information that this oracle has sampled $b$ is added to the history. The last kind of actions are the (external) output actions: some participant $a \in \mathcal{A}$ can output a result $b$–if no output by $a$ is already recorded in the history–when the history contains the information of the boolean chosen by both oracles adjacent to $a$, and that moreover $b$ is equal to the xor of these two booleans with the secret bit of $a$.

**Definition 25.** We define a NPLTS $N_{DC} = (S_{DC}, A_{DC}, \text{trans}_{DC})$ where $S_{DC} := \{(h, B) \mid h \in \mathcal{H}, B \in W_1\}, A_{DC} := \{\tau\} \cup A_{\text{ext}}^\ell$, and the transition function $\text{trans}_{DC}$ is defined as:

$$((s, l), B) \xrightarrow{\tau} \frac{1}{2} \cdot \delta_{(s \cup (e[\leftarrow 0], l), B)} + \frac{1}{2} \cdot \delta_{(s \cup (e[\leftarrow 1], l), B)} \quad \text{when } e \notin s$$

$$((s, l), B) \xrightarrow{\text{out}(a,b)} \delta_{(s,l::(a[\rightarrow b]),B)} \quad \text{when } a \notin l, \exists b_l, b_r \in \{0, 1\}, e_l(a)[\leftarrow b_l] \in s \land e_r(a)[\leftarrow b_r] \in s \\ \land b = b_r \oplus b_l \oplus B(a)$$

$$(h, B) \xrightarrow{(\xi \stackrel{?}{=} \zeta)} \delta_{(h,B)} \quad \text{when } \text{vars}(\xi, \zeta) \subseteq \text{dom}(\phi_h) \land \xi\phi_h \doteq \zeta\phi_h$$

$$(h, B) \xrightarrow{(\xi \stackrel{\neq}{=} \zeta)} \delta_{(h,B)} \quad \text{when } \text{vars}(\xi, \zeta) \subseteq \text{dom}(\phi_h) \land \xi\phi_h \neq \zeta\phi_h.$$

We now follow the road-map that we outlined in the beginning of the present section: first we show that we can replace the study of the labelled semantics for $DC_B$ by the study of $N_{DC}$, by exhibiting a bisimilarity between those two NPLTSs (Proposition 7). Then, we show that the $N_{DC}$ states (corresponding to) $DC_B$ and $DC_{B'}$ are bisimilar as soon as $B, B' \in W_1$ (Proposition 8).

**Proposition 7.** There exists an NPLTS bisimulation $R$ on $N_{DC} \cup N^\ell$ such that for every $B \in W_1$, it holds that $(\epsilon_{\mathcal{H}}, B) R (DC_B, \emptyset)$.

**Proposition 8.** If $B, B' \in W_1$ then the $N_{DC}$-states $(\epsilon_{\mathcal{H}}, B)$ and $(\epsilon_{\mathcal{H}}, B')$ are bisimilar.

From Propositions 7 and 8, we can show that the process $DC_B$ and $DC_{B'}$ are equivalent for the labelled bisimulation from Definition 16 in Section 4. We state this result formally below.

**Corollary 3 (Security for the dining cryptographers protocol).** If $B, B' \in W_1$ then $DC_B \approx_{bi} DC_{B'}$.

**Proof.** Recall that by definition of $\approx_{bi}$, we need to show that the states $s_B := (DC_B, \emptyset)$ and $s_{B'} := (DC_{B'}, \emptyset)$ are bisimilar in $N^\ell$. Since we know by Proposition 8 that $t_B := (\epsilon_{\mathcal{H}}, B)$ and $t_{B'} = (\epsilon_{\mathcal{H}}, B')$ are bisimilar in $N_{DC}$, we also have $(t_B, t_{B'}) \in (\sim_{N_{DC} \cup N^\ell})$ (because $N^\ell$ and $N_{DC}$ have disjoint state spaces). By Proposition 7, we also have that $t_B \sim_{N_{DC} \cup N^\ell} s_B$, and $t_{B'} \sim_{N_{DC} \cup N^\ell} s_{B'}$. Since $\sim_{N_{DC} \cup N^\ell}$ is an equivalence relation, we can combine all this to obtain that $s_B \sim_{N_{DC} \cup N^\ell} s_{B'}$. From here (again because $N^\ell$ and $N_{DC}$ have disjoint state spaces), we conclude that $s_B \sim_{N^\ell} s_{B'}$. $\square$
As an immediate consequence of Corollary 3, and since labelled bisimulation is stronger than may-testing equivalence, we obtain a proof of Theorem 5, i.e. that $\forall B, B' \in W_1, DC_B \approx_{may} DC_{B'}$.

### 7.3. Analysis with DEEPSEC

We have analyzed the Dining Cryptographers protocol using our probabilistic extension of the DEEPSEC tool [27]. The encoding of processes $DC_B$ for $B \in W_1$ is straightforward and follows directly the modeling above. Although DEEPSEC does not support xor in general, we can easily encode the ternary version using 8 rewrite rules $xor(b_1, b_2, b_3) \to b$ for $b_1, b_2, b_3 \in \{0, 1\}$ and $b = b_1 \oplus b_2 \oplus b_3$. Restricting to a ternary xor is not a loss of generality as the protocol does not take any input from the adversary and only honest users construct xor-terms.

As a first result we can show that

$$ \forall B, B' \in W_1. \quad DC_B \approx_{tr} DC_{B'} $$

This result is actually not satisfactory, as trace equivalence is strictly weaker than may testing (which also motivated the pen and paper proof of the previous section). More interesting is the fact that we can show that anonymity is broken when we use a biased coin, i.e., we replace the probability 0.5 in the coin tossing oracle by a probability $p \neq 0.5$. If we denote the modified process by $DC_B^p$ we can for instance show, using DEEPSEC, that, as expected,

$$ DC_{B_1}^{0.4} \not\approx_{tr} DC_{B_2}^{0.4} $$

where $B_i$ assigns $b_i$ to 1 and remaining bits to 0. Given that trace equivalence is strictly weaker than may-testing this implies that may testing does not hold either.

Given the rather small size of the processes DEEPSEC performs these verifications in about 1 second each.

## 8. Conclusion and future work

In this paper we introduced a framework to reason about indistinguishability properties, modelled as process equivalences, in symbolic models enhanced with probabilities. Defining such a framework turns out to rely on subtle technicalities such as the need for randomized schedulers, overlooked in previous attempts. In addition to solving technical problems, we believe that randomized schedulers capture more faithfully the idea that one cannot predict how non-determinism is resolved. Randomized schedulers generalize the idea that a schedulers chooses a particular distribution among the ones available by allowing an arbitrary combination (in the convex hull) of the available distributions.

We define different, classical behavioral and labelled equivalences and show their precise relations. As usual in models mixing non-determinism and probabilities, the resulting equivalences may be considered as too strong: indeed arbitrary schedulers may leak the (private) probabilistic choices of the processes and give the attacker an unrealistically strong distinguishing power. Defining more restricted schedulers that are only allowed partial knowledge of the current state, such as in [20], is orthogonal to our work. We however believe that our work provides a convenient framework for defining such more fine-grained notions of schedulers and consider this an interesting direction for future work.
We therefore study two classes of protocols where this problem is avoided. First, we study protocols that do not make probabilistic choices, but allow the adversary to do so. This class of non-probabilistic protocols corresponds to the classical setting and captures all major case studies performed in the context of symbolic models. Our results highlight that the classical notion of may-testing, considered rather intuitive as it models an arbitrary attacker running in parallel, does not take into account attackers that make probabilistic choices. Interestingly, when bounding the number of sessions, (non-probabilistic) similarity exactly captures such probabilistic attackers and offers an attractive target for automated analysis. Second, we study a class of fully probabilistic protocols, also considered in [25], and show that trace equivalence on such protocols coincides with may testing in the presence of a (syntactic) class of determine attackers. One may indeed argue that determinacy removes artificial non-deterministic choices that the attacker could exploit and that correspond to unrealistic behaviors. When protocols can be expressed in the class of purely probabilistic processes, from a formal analysis point, it seems appealing to do so as it also simplifies the analysis.

We also show how deciding trace equivalence can be automated in the presence of probabilities. We propose a decision procedure that extends previous work by Cheval *el al* [22] and implement this procedure in the DEEPSEC tool. Hence, we provide tool support for proving determinate may-testing on the class of purely probabilistic processes when the number of sessions is bounded and cryptographic primitives are modeled as a subterm destructor rewrite system. On more general classes of processes, our tool can be used for attack finding: disproving trace equivalence implies that may testing (and all stronger equivalences) does not hold either, therefore violating security properties stated as an equivalence.

Finally, we illustrate our framework by studying the well-known Dining Cryptographers protocol. We model the protocol and its anonymity property in the probabilistic applied π-calculus. Then, we use our framework to prove that anonymity holds, and demonstrate DEEPSEC’s attack finding ability on a variant of the protocol that uses a biased coin.

Our work paves the road towards several future works, in addition to exploring restricted schedulers mentioned above. The insight that (purely possibilistic) similarity takes into account probabilistic adversaries (as it coincides with may testing) when the number of sessions is bounded and protocols are non-deterministic motivates adding support for (bi)similarity in a tool such as DEEPSEC (which currently only verifies trace equivalence). A different direction going beyond the subclasses considered in this paper is to investigate restrictions of the scheduler (building, e.g., on ideas from [20, 21]) in our framework to limit the adversary’s power without restricting the class of protocols. Finally, a more prospective direction is the use of more quantitative equivalences, i.e., distances between processes, that might be interesting to compare different protocols that try to achieve a same property.

**Acknowledgments.** We thank Alwen Tiu and the anonymous reviewers for their helpful comments and suggestions. This work has been partly supported by the ANR Research and teaching chair in AI ASAP with support from the region Grand Est and by France 2030 program managed by ANR (ANR-22-PECY-0006).

References

[1] D. Dolev and A.C. Yao, On the security of public key protocols, *IEEE Trans. Inf. Theory* **29**(2) (1983), 198–207. doi:10.1109/TIT.1983.1056650.

[2] K. Bhargavan, B. Blanchet and N. Kobeissi, Verified models and reference implementations for the TLS 1.3 standard candidate, in: *IEEE Symposium on Security and Privacy (S&P’17)*, IEEE, 2017, pp. 483–502.
[3] C. Cremers, M. Horvat, J. Hoyland, S. Scott and T. van der Merwe, A Comprehensive Symbolic Analysis of TLS 1.3, in: *ACM SIGSAC Conference on Computer and Communications Security (CCS'17)*, ACM, 2017, pp. 1773–1788.

[4] K. Cohn-Gordon, C. Cremers, B. Dowling, L. Garratt and D. Stebila, A formal security analysis of the signal messaging protocol, *Journal of Cryptology* 33(4) (2020), 1914–1983.

[5] D.A. Basin, J. Dreier, L. Hirschi, S. Radomirovic, R. Sasse and V. Stettler, A Formal Analysis of 5G Authentication, in: *ACM SIGSAC Conference on Computer and Communications Security (CCS'18)*, D. Lie, M. Mannan, M. Backes and X. Wang, eds, ACM, 2018, pp. 1383–1396. doi:10.1145/3243734.3243846.

[6] D.A. Basin, R. Sasse and J. Toro-Pozo, The EMV Standard: Break, Fix, Verify, in: *42nd IEEE Symposium on Security and Privacy (S&P'21)*, IEEE, 2021, pp. 1766–1781. doi:10.1109/SP40001.2021.00037.

[7] V. Cortier, S. Kremer and B. Warinschi, A Survey of Symbolic Methods in Computational Analysis of Cryptographic Systems, *Journal of Automated Reasoning* 46(3–4) (2010), 225–259. doi:10.1007/s10817-010-9187-9.

[8] D. Chaum, The Dining Cryptographers Problem: Unconditional Sender and Recipient Untraceability, *J. Cryptol.* 1(1) (1988), 65–75. doi:10.1007/BF00206326.

[9] D. Chaum, Untraceable Electronic Mail, Return Addresses, and Digital Pseudonyms, *Commun. ACM* 24(2) (1981), 84–88. doi:10.1145/358549.358563.

[10] M.K. Reiter and A.D. Rubin, Crowds: Anonymity for Web Transactions, *ACM Trans. Inf. Syst. Secur.* 1(1) (1998), 66–92. doi:10.1145/290163.290168.

[11] M. Abadi, B. Blanchet and C. Fournet, The applied pi calculus: Mobile values, new names, and secure communication, *Journal of the ACM (JACM)* (2017).

[12] J. Goubault-Larrecq, C. Palamidessi and A. Troina, A probabilistic applied pi-calculus, in: *Asian Symposium on Programming Languages and Systems*, Springer, 2007, pp. 175–190.

[13] R. Segala and N. Lynch, Probabilistic simulations for probabilistic processes, *Nordic Journal of Computing* 2(2) (1995), 250–273.

[14] A. Parma and R. Segala, Logical characterizations of bisimulations for discrete probabilistic systems, in: *International Conference on Foundations of Software Science and Computational Structures*, Springer, 2007, pp. 287–301.

[15] V. Castiglioni, Trace and Testing Metrics on Nondeterministic Probabilistic Processes, in: *Combined 25th International Workshop on Expressiveness in Concurrency and 15th Workshop on Structural Operational Semantics and 15th Workshop on Structural Operational Semantics (EXPRESS/SOS) 2018*, Vol. 276, 2018, pp. 19–36.

[16] F. Bonchi, A. Sokolova and V. Vignudelli, The theory of traces for systems with nondeterminism and probability, in: *2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)*, IEEE, 2019, pp. 1–14.

[17] Y. Deng, R. Van Glabbeek, M. Hennessy and C. Morgan, Testing finitary probabilistic processes, in: *International Conference on Concurrency Theory*, Springer, 2009, pp. 274–288.

[18] M. Stoelinga, Alea jacta est: verification of probabilistic, real-time and parametric systems, PhD thesis, University of Nijmegen, the Netherlands, 2002.

[19] C.G. Eisentraut, Principles of Markov automata, PhD thesis, Saarländische Universitäts- und Landesbibliothek, 2017.

[20] K. Chatzikokolakis and C. Palamidessi, Making random choices invisible to the scheduler, *Inf. Comput.* 208(6) (2010), 694–715. doi:10.1016/j.ic.2009.06.006.

[21] M.S. Alvim, M.E. Andrés, C. Palamidessi and P. van Rossum, Safe Equivalences for Security Properties, in: *Theoretical Computer Science - 6th IFIP TC 1/WG 2.2 International Conference, TCS 2010, Held as Part of WCC 2010*, C.S. Calude and V. Sassone, eds, IFIP Advances in Information and Communication Technology, Vol. 323, Springer, 2010, pp. 55–70. doi:10.1007/978-3-642-15240-5_5.

[22] V. Cheval, S. Kremer and I. Rakotonirina, DEEPSEC: Deciding Equivalence Properties in Security Protocols - Theory and Practice, in: *Proceedings of the 39th IEEE Symposium on Security and Privacy (S&P'18)*, IEEE Computer Society Press, San Francisco, CA, USA, 2018, pp. 525–542. doi:10.1109/SP.2018.00033.

[23] V. Cheval, V. Cortier and S. Delaune, Deciding equivalence-based properties using constraint solving, *Theor. Comput. Sci.* 492 (2013), 1–39. doi:10.1016/j.tcs.2013.04.016.

[24] H. Comon-Lundh and V. Cortier, Computational soundness of observational equivalence, in: *ACM Conference on Computer and Communications Security (CCS'08)*, P. Ning, P.F. Syverson and S. Jha, eds, ACM, 2008, pp. 109–118. doi:10.1145/1455770.1455786.

[25] R. Chadha, A.P. Sistla and M. Viswanathan, Verification of randomized security protocols, in: *32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS'17)*, IEEE, 2017, pp. 1–12.

[26] M.S. Bauer, R. Chadha, A.P. Sistla and M. Viswanathan, Model checking indistinguishability of randomized security protocols, in: *International Conference on Computer Aided Verification (CAV'18)*, Springer, 2018, pp. 117–135.

[27] The DEEPSEC tool, 2023, https://github.com/DeepSec-prover/deepsec/tree/probability.

[28] V. Cheval, R. Crubillé and S. Kremer, Symbolic protocol verification with dice: process equivalences in the presence of probabilities (extended version), 2023, https://hal.inria.fr/hal-03683907/document.

[29] B. Blanchet, Modeling and Verifying Security Protocols with the Applied Pi Calculus and ProVerif, *Foundations and Trends in Privacy and Security* (2016).

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46
[30] R. Milner, J. Parrow and D. Walker, A Calculus of Mobile Processes, I, Inf. Comput. 100(1) (1992), 1–40. doi:10.1016/0890-5401(92)90008-4.

[31] Y. Deng, Axiomatisations and types for probabilistic and mobile processes, PhD thesis, École des Mines de Paris, 2005.

[32] M. Hennessy and R. Milner, On observing nondeterminism and concurrency, in: Automata, Languages and Programming (ICALP'80), J. de Bakker and J. van Leeuwen, eds, Springer, 1980, pp. 299–309.

[33] R. Amadio, Operational methods in semantics, 2016.

[34] R.J. van Glabbeek, Bounded nondeterminism and the approximation induction principle in process algebra, in: Annual Symposium on Theoretical Aspects of Computer Science, Springer, 1987, pp. 336–347.

[35] D. Chaum, P.Y.A. Ryan and S.A. Schneider, A Practical Voter-Verifiable Election Scheme, in: 10th European Symposium on Research in Computer Security (ESORICS'05), S.D.C. di Vimercati, P.F. Syverson and D. Gollmann, eds, Lecture Notes in Computer Science, Vol. 3679, Springer, 2005, pp. 118–139. doi:10.1007/11555827_8.

[36] V. Cortier and S. Delaune, A Method for Proving Observational Equivalence, in: 22nd IEEE Computer Security Foundations Symposium, (CSF'09), IEEE Computer Society, 2009, pp. 266–276. doi:10.1109/CSF.2009.9.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46