• No results found

As noted in the introduction, the Kleene star plays a big role in our proofs.

Therefore we need a notion of a repetitive structure.

Definition 2.4.1. A strongly connected component is a nonempty set T of processes such that for every pair of processes P, P0∈ T , P −→P0, and for all P ∈ T , P −→P0 and P0 −→P implies P0∈ T .

The definition of a strongly connected component in process graphs is equivalent with the standard definition of strongly connected components in graph theory [5]. As with the graph theoretical definition, our definition of strongly connected component is also maximal.

Definition 2.4.2. A strongly connected component T is trivial iff it consists of precisely one state P and P 6−→+P , and non-trivial otherwise.

We will mostly study non-trivial strongly connected components, note that a strongly connected component T is non-trivial iff for every state P ∈ T , P −→+ P .

Lemma 2.4.3. Every process S is contained in exactly one strongly connected component.

Proof. Every process S is at least in some strongly connected component, since S −→0S. Assume that S is in strongly connected components T and T0, then for arbitrary S0 ∈ T and S00 ∈ T0, S0 −→S −→ S00 and S00−→ S −→ S0, therefore every S00 ∈ T0 is also in T and every S0 ∈ T is also in T0, and thus T = T0. Therefore S is in at most one strongly connected component.

Definition 2.4.4. Let T be a strongly connected component. Then (α, Q) is an exit transition of T if P −→ Q for some P ∈ T and Q 6∈ T .α

All transitions from a state in a trivial strongly connected component are exit transitions.

8 2.4 Strongly connected components

Definition 2.4.5. We call an exit transition (α, P ) live if there exists a Q↓

such that P −→Q.

We call an exit transition (α, P ) dead if (α, P ) is not live.

To reason about exit transitions more effectively, we also define states that potentially have some exit transitions.

Definition 2.4.6. Let T be a strongly connected component. Then P ∈ T is an exiting-state of T iff P has a live exit transition or P ↓.

Definition 2.4.7. An exiting-state S is called open iff S↓.

An exiting-state S is called closed iff S6 ↓.

Note that it directly follows that every exiting-state is either open or closed.

Figure 2.1 is an example of a process that has a non-trivial strongly connected component, live and dead exit transitions, and open and closed exiting-states.

P Q R

1 0

b c

a a

a a S

Figure 2.1: Strongly Connected Componentconsisting of P , Q, R, and S In Figure 2.1 we see a non-trivial strongly connected component {P, Q, R, S}.

There are two exit transitions, P −→ 1 and Rb −→ 0. The exit transitionc P −→ 1 is live, as 1 has a derivation to termination. The exit transition Rb −→ 0c is dead, as 0 has no derivation to termination. Both P and S are exiting-states, as P has a live exit transition, and S can terminate. The exiting-state P is closed, as P 6 ↓, and the exiting-state S is open, as S↓.

Chapter 3

Expressivity of Process Algebras Without the Empty Process

Both [3] and [4] contain proofs that BPA0 is less expressive than PA0and that PA0 is less expressive than ACP. The contents and motivation for this thesis originate in [4]. We contemplate the effects of the addition of the empty process to BPA0, PA0, and ACP. As we will find out, the same ordering exists for BPA0,1, PA0,1, and ACP1. The proofs presented in [4] for BPA0 ≺ PA0 and PA0 ≺ ACP can, however, not be reused to prove that BPA0,1 ≺ PA0,1 and PA0,1≺ ACP1.

We will first analyze the argument that BPA0 ≺ PA0 and the problems for translating it to BPA0,1 ≺ PA0,1, and secondly do the same for PA0≺ ACP and PA0,1≺ ACP1.

BPA0 is less expressive than PA0

P 1

2 3

4 a

a a a

a a

a a

a

Figure 3.1: Counterexample P

Bergstra, Fokkink and Ponse propose in their argument a term in PA0, for which they argue exists no term in BPA0. This counterexample is (aa)a k a, as shown in Figure 3.1. They argue that P cannot be expressed in BPA0by the following lemma:

“Let C be a cycle in a labelled transition system associated to a process term over BPA0. Then there is at most one state P ∈ C that has a successor Q such that P is not a proper substate of Q.”

103 Expressivity of Process Algebras Without the Empty Process

That lemma expresses the crucial idea, but is strictly speaking incorrect. Take the BPA0 term P = (a(b + c0))de, as shown in Figure 3.2. Consider the cycle (P, P0). In that cycle P has Q as a successor, and P0 has deadlock, 0, as a successor. Clearly, P and P0 are not proper substates of Q and 0 respectively.

A problem similar to this also exists in BPA0,1, we have circumvented this problem by defining live exit transitions in Definition 2.4.5. The lemma in [4]

could easily be corrected by demanding that Q has a derivation to termination, which 0 does not have in the counterexample depicted in Figure 3.2.

P P0 to 1 and P and P0 are clearly not proper substates of 1. One could weaken the lemma, by replacing the requirement that there is at most one state P ∈ C that can properly exit C, by the requirement that if there is more than one state P ∈ C that can properly exit C, then some property holds. The latter is a logical consequence of the original lemma. By instantiating the right property we shall find the proof for BPA0,1≺ PA0,1.

PA0 is less expressive than ACP

Bergstra, Fokkink and Ponse propose in their argument a term in ACP, for which they argue is no term in PA0. This counterexample is (aa)a k a, where γ(a, a) = a, as shown in Figure 3.4.

They argue that P cannot be expressed in PA0 by the following lemma:

3 Expressivity of Process Algebras Without the Empty Process11

“Let C be a cycle in a labelled transition system associated to a process term over PA0. If there is a state in C with an exit action, then every other state in C has only successors in C.”

Note that an exit action in their work is a transition to a state that represents termination. a counterexample for this lemma. It contains the cycle C = (P, P0), and C contains a state with an exit action, namely P , therefore every other state in C should only have successors in C. However, there is also a state P0 in C, P0 has a successor that is clearly not in C, namely 0. This can again be repaired by demanding that every other state in C has only successors in C or dead successors. However, this is not enough. With that quick fix, we might still have the PA0 term P = (a(b + cc))de, as shown in Figure 3.5. C = (P, Q) is a valid cycle, but a state R outside C exists, where R is a successor of Q.

Intuitively we would like to have ‘cycles’ that also contain R, or any other state that is still in the same repetitive structure. This is why we use strongly connected components instead of cycles. So the second fix is that we take C as a strongly connected component, and not as a cycle.

With the modifications such that it holds for PA0, that lemma still does not hold for PA0,1, as shown by the counterexample C = (P, P0) (see Figure 3.3), where P = 1(a(1 + b1))c1 and P0 = (1 + b1)(a(1 + b1))c1, since both P and P0 have a c-action, that effectively is an exit action. There is no obvious way to weaken that lemma to a property that could prove PA0,1≺ ACP1. The essential concept is that a process that must contain a parallel composition due to its behavior, cannot do an exit action in PA0since that would require both

123 Expressivity of Process Algebras Without the Empty Process

sides to do an action, thus requiring two steps to termination. The idea that a process needs a behavior that requires the term to contain a parallel operator, and an action that cannot come from either side of the parallel operator is the only overlap between the proof that PA0≺ ACP and PA0,1≺ ACP1.

Chapter 4

Relative Expressivity of BPA 0,1 and PA 0,1

To prove that PA0,1 is strictly more expressive than BPA0,1 using strongly connected components, we first analyze the syntactic structure of the terms that constitute a non-trivial strongly connected component in BPA0,1.

To find that syntactic structure, we define a function on terms that is non-increasing over the derivation of a term. Since there is a derivation from a term to itself in a non-trivial strongly connected component, possibly via some other term in that non-trivial strongly connected component, that function must have equal values for each term in a non-trivial strongly connected component. We call this function the operator counter.

Since many terms may only do transitions that decrease the operator count, only a small subset of all terms, namely the terms that may do a transition that does not decrease the operator count, are possibly in some non-trivial strongly connected component. We will, therefore, use the operator counter to prove the properties to which a term must cohere when it is inside a non-trivial strongly connected component. We use the restriction on the possible shapes of terms inside a non-trivial strongly connected component to find a restriction on the possible behaviors of processes that have a repetitive structure. Lastly, we will find a counter-example in PA0,1that contains a repetitive structure that violates the restrictions from BPA0,1.

4.1 Operator counter

We will define a function on terms. This function is designed to be non-increasing over a derivation. The intuition behind the function is that it is an upper bound on the number of times we can ‘see’ a certain operator as main operator in a derivation. What it means to ‘see’ a certain operator is not immediately obvious, and we will clarify the intuition per operator.

The first operator is the alternative composition. Consider a transition P + Q−→ R, if R has the alternative composition as the main operator, intuitivelyα

14 4.1 Operator counter

this is a different instance of the alternative composition. Consider, for example a1+b(c1+d1), where a1+b(c1+d1)−→ c1+d1 is a valid transition with clearlyb a new instance of the alternative composition as the main operator. Perhaps the most surprising definition is P as OC+(P) = 0. However, consider the fact that, every term reachable from P in at least one step is of the shape P0· P. Definition 4.1.1. The alternative composition counter function OC+of a term is inductively defined below.

1. OC+(0) = 0 2. OC+(1) = 0

3. OC+(a.P ) = OC+(P )

4. OC+(P + Q) = max(OC+(P ), OC+(Q)) + 1 5. OC+(P · Q) = OC+(Q)

6. OC+(P) = 0

We will now prove that the alternative composition counter is a non-increasing function.

Lemma 4.1.2. If P −→ R then OCα +(P ) ≥ OC+(R)

Proof. We do structural induction on P and therefore distinguish cases accord-ing to the syntactic form of P .

1. If P = 0, then P −→ R is not possible, and the claim automatically holds.α 2. If P = 1, then P −→ R is not possible, and the claim automatically holds.α 3. If P = a.P0, then only a.P0 −→ R is possible, and R = Pa 0. According to

the definition OC+(P ) = OC+(P0) = OC+(R).

4. If P = P0+ P00, then, without loss of generality, P0−→ R. By inductionα hypothesis OC+(P0) ≥ OC+(R), so OC+(P ) = max(OC+(P0), OC+(P00))+

1 > OC+(R).

5. If P = P0 · P00, then we distinguish two cases. If we apply operational rule 7, then R = P000· P00, and OC+(P ) = OC+(P00) = OC+(R). Or if we apply operational rule 8, then P00 −→ R, by induction hypothesisα OC+(P00) ≥ OC+(R) and OC+(P ) = OC+(P00) by definition.

6. If P = P0∗, then R = P00· P0∗, and by definition OC+(P0∗) = OC+(P00· P0∗) = OC+(R).

Corollary 4.1.3. If P −→Q, then OC+(P ) ≥ OC+(Q).

Proof. The corollary follows by induction over the length of P −→ Q using Lemma 4.1.2.

4.1 Operator counter 15

Consider a transition a.P −→ P . If P happens to be of the form a.Pa 0, the intuition tells us that we see a new prefix, as we expect a.a.1 to have a prefix count of 2.

Definition 4.1.4. The prefix counter function OCa. of a term is inductively defined below.

1. OCa.(0) = 0 2. OCa.(1) = 0

3. OCa.(a.P ) = OCa.(P ) + 1

4. OCa.(P + Q) = max(OCa.(P ), OCa.(Q)) 5. OCa.(P · Q) = OCa.(Q)

6. OCa.(P) = 0

We will now prove that the prefix counter is a non-increasing function.

Lemma 4.1.5. If P −→ R then OCα a.(P ) ≥ OCa.(R)

Proof. We do structural induction on P and therefore distinguish cases accord-ing to the syntactic form of P .

1. If P = 0, then P −→ R is not possible, and the claim automatically holds.α 2. If P = 1, then P −→ R is not possible, and the claim automatically holds.α 3. If P = a.P0, then only a.P0−→ R is possible, and R = Pa 0. According to

the definition OCa.(P ) ≥ OCa.(P0) = OCa.(R).

4. If P = P0+ P00, then, without loss of generality, P0−→ R. By inductionα hypothesis OCa.(P0) ≥ OCa.(R), so OCa.(P ) = max(OCa.(P0), OCa.(P00)) ≥ OCa.(R).

5. If P = P0· P00, then we distinguish two cases. If we apply operational rule 7, then R = P000 · P00, and OCa.(P ) = OCa.(P00) = OCa.(R). Or if we apply operational rule 8, then P00 −→ R, by induction hypothesisα OCa.(P00) ≥ OCa.(R) and OCa.(P ) = OCa.(P00) by definition.

6. If P = P0∗, then R = P00· P0∗, and by definition OCa.(P0∗) = OCa.(P00· P0∗) = OCa.(R).

Corollary 4.1.6. If P −→Q, then OCa.(P ) ≥ OCa.(Q).

Proof. The corollary follows by induction over the length of P −→ Q using Lemma 4.1.5.

16 4.1 Operator counter

A term that has the unary Kleene star as the main operator, has the property that every term reachable in one or more steps has the sequential composition as the main operator, or in other words for every derivation P−→+P0, there are Q, Q0 such that P0 = Q · Q0. Therefore we intuitively expect the operator of the unary Kleene star to not exceed 1.

Note that the reason why the definition of OC(P · Q) seems a little peculiar is that we want to differentiate between terms such as 1P and P. If the operator counter function is non-increasing, then we trivially see that there is no derivation 1P−→P, as the latter has a higher unary Kleene star count.

Definition 4.1.7. The unary Kleene star counter function OC of a term is inductively defined below.

1. OC(0) = 0 2. OC(1) = 0

3. OC(a.P ) = OC(P )

4. OC(P + Q) = max(OC(P ), OC(Q))

5. OC(P · Q) =

(0, if ∃Q0 Q = Q0∗

OC(Q), if ¬∃Q0 Q = Q0∗

6. OC(P) = 1

We will now prove that the unary Kleene star counter is a non-increasing func-tion.

Lemma 4.1.8. If P −→ R then OCα (P ) ≥ OC(R)

Proof. We do structural induction on P and therefore distinguish cases accord-ing to the syntactic form of P .

1. If P = 0, then P −→ R is not possible, and the claim automatically holds.α 2. If P = 1, then P −→ R is not possible, and the claim automatically holds.α 3. If P = a.P0, then only a.P0 −→ R is possible, and R = Pa 0. According to

the definition OC(P ) = OC(P0) = OC(R).

4. If P = P0+ P00, then, without loss of generality, P0−→ R. By inductionα hypothesis OC(P0) ≥ OC(R), so OC(P ) = max(OC(P0), OC(P00)) ≥ OC(R).

5. If P = P0 · P00, then we distinguish two cases. If we apply operational rule 7, then R = P000 · P00, and OC(P ) = OC(P00) = OC(R). Or if we apply operational rule 8, then P00 −→ R, by induction hypothesisα OC(P00) ≥ OC(R) and OC(P ) = OC(P00) by definition.

6. If P = P0∗, then R = P00· P0∗, and by definition OC(P0∗) > OC(P00· P0∗) = OC(R).

4.1 Operator counter 17

Corollary 4.1.9. If P −→Q, then OC(P ) ≥ OC(Q).

Proof. The corollary follows by induction over the length of P −→ Q using Lemma 4.1.8.

For a term P · Q −→ Pα 0· Q, there are two different intuitions. One could argue that the sequential composition in P · Q is the same as in P0· Q, since it remains ‘untouched’, but one could also argue that, as the term is different, we see another instance of a sequential composition as main operator. For our definition, we rely on the first intuition, and treat a sequential composition as different only if the right hand side has been changed.

Due to the Kleene star, the definition of OC·(P · Q) is a bit peculiar again. As-sume we take a naive definition of OC·(P ·Q), for example OC·(P ·Q) = OC·(Q)+

1. If a Q0 exists such that Q = Q0∗, then OC·(P · Q0∗) = OC·(Q0∗) + 1 = 2.

However a transition Q0∗−→ P · Qα 0∗ exists, making the sequential composition counter function not non-increasing. This cannot be fixed by changing the value of OC·(Q0∗), as this changes the value of OC·(P · Q0∗) with the same amount.

The case distinction for OC·(P · Q) fixes this non-increasingness problem, as can be seen in the corresponding lemma. The non-naive definition also matches the intuition that a derivation P0Q −→ Pα 1Q −→ . . .β −→ Pγ nQ can only see precisely one sequential composition, as the right hand side remains constant.

Definition 4.1.10. The sequential composition counter function OC·of a term is inductively defined below.

We will now prove that the sequential composition counter is a non-increasing function.

Lemma 4.1.11. If P −→ R then OCα ·(P ) ≥ OC·(R)

Proof. We do structural induction on P and therefore distinguish cases accord-ing to the syntactic form of P .

1. If P = 0, then P −→ R is not possible, and the claim automatically holds.α 2. If P = 1, then P −→ R is not possible, and the claim automatically holds.α 3. If P = a.P0, then only a.P0−→ R is possible, and R = Pa 0. According to

the definition OC·(P ) = OC·(P0) = OC·(R).