# CSP基础知识

CSP: Communicating sequencing process

## 第一章

### 1、对确定性进程，如何判断两个进程等价？

α P = α Q \alpha P=\alpha Q
t r a c e s ( P ) = t r a c e s ( Q ) traces( P) =traces( Q )

### 3、证明：

（下述两道证明题均是采用数学归纳法证明）

#### （1） t r a c e s ( R U N A ) = A ∗ . traces(RUN_{A}) = A^{*}.

（注： A ∗ A^{*} means the set of sequences with elements in A）

## 第二章

### 1、Let α P = { a , c } , a n d P = ( a → c → P ) , α Q = { b , c } a n d Q = ( c → b → Q ) . \alpha P = \{a,c\},\quad and \quad P = (a → c → P), \quad \alpha Q = \{b,c\}\quad and \quad Q = (c → b → Q).

#### （1） P ∣ ∣ Q = ? P || Q = ?

P ∣ ∣ Q P||Q
= ( a → c → P ) ∣ ∣ ( c → b → Q ) (by definition) = (a → c → P)||(c → b → Q) \tag{by definition}
= a → ( ( c → P ) ∣ ∣ ( c → b → Q ) ) (by L5A) = a → ((c → P)||(c → b → Q)) \tag{by L5A}
= a → c → ( P ∣ ∣ ( b → Q ) ) = a → c → (P||(b → Q))

Also
P ∣ ∣ ( b → Q ) P||(b → Q)
= ( a → ( c → P ) ∣ ∣ ( b → Q ) = (a → (c → P)||(b → Q)
∣ b → ( P ∣ ∣ Q ) ) [ b y L 6 ] |b → (P||Q)) [by L6]
= ( a → b → ( ( c → P ) ∣ ∣ Q ) ∣ b → ( P ∣ ∣ Q ) ) ( by L5B) = (a → b → ((c → P)||Q) |b → (P||Q)) \tag{ by L5B}
= ( a → b → c → ( P ∣ ∣ ( b → Q ) ) ∣ b → a → c → ( P ∣ ∣ ( b → Q ) ) ) (by ‡above) = (a → b → c → (P||(b → Q)) |b → a → c → (P||(b → Q))) \tag{by ‡above}
= µ X • ( a → b → c → X ∣ b → a → c → X ) = µX • (a → b → c → X|b → a → c → X)

Therefore
( P ∣ ∣ Q ) = ( a → c → μ X ( a → b → c → X ∣ b → a → c → X ) ) (by ‡above) (P||Q) = (a → c → μX(a → b → c → X|b → a → c → X)) \tag{by ‡above}

#### （2）Please prove that P ∣ ∣ Q s a t 0 ≤ t r ↓ a − t r ↓ b ≤ 2. P|| Q \quad sat\quad 0 ≤ tr↓ a-tr↓ b ≤ 2.

1.若 t r tr 未运行到循环阶段，则 t r ↓ a = 1 tr ↓ a = 1 0 0 t r ↓ b = 0 tr↓ b = 0 满足不等式；
2.若 t r tr 运行到循环并恰好完成若干次循环，则由于每次循环 a a 的个数 = b =\quad b 的个数，所以 t r ↓ a − t r ↓ b = 1 tr ↓ a − tr ↓ b = 1
3.若 t r tr 运行到某次循环中，由于本次循环前满足 t r ↓ a − t r ↓ b = 1 tr ↓ a - tr ↓ b= 1

### 2、If P and Q never stop and if α P ∩ α Q \alpha P \cap \alpha Q contains at most one element, then ( P ∣ ∣ Q ) (P || Q) never stops.

#### （2）当 α P ∩ α Q \alpha P \cap \alpha Q 含有 2 个或更多元素时，此结论不成立，举例说明。

α P = α Q = { a , b } , \alpha P = \alpha Q = \{a, b\},
P = a → b → P ; P = a \rightarrow b \rightarrow P;
Q = b → a → Q ; Q = b \rightarrow a \rightarrow Q;
P ∣ ∣ Q = S T O P . P || Q = STOP.

## 第三章

### 1、

#### （5）令 α P = α Q = α P 1 = α Q 1 = { a , b , c } , \alpha P = \alpha Q = \alpha P_{1} = \alpha Q_{1}= \{a,b,c\},

P 1 = ( a → b → S T O P ) P1 = (a → b → STOP)
P 2 = ( b → c → S T O P ) P2 = (b → c → STOP)
P = P 1 ⊓ P 2 P = P1 \sqcap P2
Q = P 1 □ P 2 Q = P1\square P2

r e f u s a l s ( P ) = ? refusals(P) = ?
r e f u s a l s ( Q ) = ? refusals(Q) = ?

r e f u s a l s ( P 1 ) = { { } , b , c , b , c } refusals(P1) = \{\{\},{b},{c},{b,c}\}
r e f u s a l s ( P 2 ) = { { } , a , c , a , c } refusals(P2) =\{\{\},{a},{c},{a,c}\}
r e f u s a l s ( P ) = { { } , a , b , c , b , c , a , c } refusals(P) = \{\{\},{a},{b},{c},{b,c},{a,c}\}
r e f u s a l s ( Q ) = { { } , c } refusals(Q) =\{\{\},{c}\}

∧ \wedge

### 3.

#### （3）

f a i l u r e s ( P ⊓ Q ) = ? failures(P \sqcap Q) = ?

f a i l u r e s ( X : B → P ( X ) ) = ? failures(X: B → P(X)) = ?

f a i l u r e s ( P ∥ Q ) = ? failures(P ∥ Q) = ?

f a i l u r e s ( P □ Q ) = ? failures(P \square Q) = ?

f a i l u r e s ( P ∣ ∣ ∣ Q ) = ? failures(P|||Q) = ?

### 4.对非确定性进程，如何判断两个进程等价？

α P = α Q \alpha P=\alpha Q
d i v e r g e n c e s ( P ) = d i v e r g e n c e s ( Q ) divergences(P)=divergences(Q)
f a i l u r e s ( P ) = f a i l u r e s ( Q ) failures(P)=failures(Q)

## CSP： Operational Semantics

### 1、如何从 CSP 通讯的操作语义角度理解 CSP 并发定义中要求公共事件须同步？

A和B之间存在通信的管道，可以发送某种类型的消息，B在接收到A的消息之前，并不清楚A发送的内容，只知道类型；

## CCS： Bisimulation

### 1.CCS 中 Strong Bisimulation 是如何定义的？

A binary relation S ⊆ P × P S \subseteq P × P over agents is a strong bisimulation if ( P , Q ) ∈ S (P, Q) \in S implies, for all α ∈ A c t \alpha \in Act ,
(1) Whenever P → α P ′ P \xrightarrow {\alpha }P' then, for some Q ′ Q' , Q → α Q ′ Q\xrightarrow {\alpha}Q' and ( P ′ , Q ′ ) ∈ S (P' ,Q' ) \in S
(2) Whenever Q → α Q ′ Q \xrightarrow {\alpha } Q' then, for some P ′ P' , P → α P ′ P \xrightarrow {\alpha }P' and ( P ′ , Q ′ ) ∈ S (P', Q') \in S
Denoted by P ∼ Q P \sim Q .

### 2.CCS 中 Weak Bisimulation 是如何定义的？

A binary relation S ⊆ P × P S \subseteq P × P over agents is a weak bisimulation if ( P , Q ) ∈ S (P, Q) \in S implies, for all α ∈ A c t \alpha \in Act ,
(1) Whenever P → α P ′ P \xrightarrow {\alpha } P' then, for some Q ′ Q' , Q    ⟹    α ^ Q ′ Q \stackrel{ \hat\alpha }{ \implies}Q' and ( P ′ , Q ′ ) ∈ S (P' ,Q' ) \in S
(2) Whenever Q → α Q ′ Q \xrightarrow {\alpha } Q' then, for some P ′ P' , P    ⟹    α ^ P ′ P \stackrel{ \hat\alpha }{ \implies} P' and ( P ′ , Q ′ ) ∈ S (P', Q') \in S
Denoted by P ≈ Q P \approx Q .

12-12
09-19

12-05
10-29
06-08 180
05-08 2228
09-05
07-12
08-01 5927
07-25 232
07-21 2948
08-02 1270