进程代数CSP基础知识总结

CSP基础知识

CSP: Communicating sequencing process

第一章

1、对确定性进程,如何判断两个进程等价?

答: 确定性进程,需要判断两者alphabet(字母表)和traces(迹)是否相等。即:
α P = α Q \alpha P=\alpha Q αP=αQ
t r a c e s ( P ) = t r a c e s ( Q ) traces( P) =traces( Q ) traces(P)=traces(Q)

2、 t r a c e s ( μ X : A ⋅ F ( x ) ) = ? traces(\mu X: A \cdot F(x)) = ? traces(μX:AF(x))=?

答: t r a c e s ( μ X : A ⋅ F ( x ) ) = { s ∣ 存 在 n ≥ 0 , x ∈ A , s ≤ t r a c e s ( F ( x ) ) n } traces(\mu X: A \cdot F(x)) = \{s|存在n≥0,x \in A,s \le traces(F(x))^{n}\} traces(μX:AF(x))={sn0xAstraces(F(x))n}

3、证明:

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

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

(注: A ∗ A^{*} A means the set of sequences with elements in A)
在这里插入图片描述

(2) t r a c e s ( V M S ) = ∪ n ≥ 0 { s ∣ s ≤ < c o i n , c h o c > n , n ≥ 0 } . traces(VMS) = \cup_{n≥0} \{s| s≤< coin,choc >^{n},n≥0\}. traces(VMS)=n0{ss<coin,choc>n,n0}.

在这里插入图片描述

第二章

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). αP={a,c},andP=(acP),αQ={b,c}andQ=(cbQ).

(1) P ∣ ∣ Q = ? P || Q = ? PQ=?

答:
P ∣ ∣ Q P||Q PQ
= ( a → c → P ) ∣ ∣ ( c → b → Q ) (by definition) = (a → c → P)||(c → b → Q) \tag{by definition} =(acP)(cbQ)(by definition)
= a → ( ( c → P ) ∣ ∣ ( c → b → Q ) ) (by L5A) = a → ((c → P)||(c → b → Q)) \tag{by L5A} =a((cP)(cbQ))(by L5A)
= a → c → ( P ∣ ∣ ( b → Q ) ) = a → c → (P||(b → Q)) =ac(P(bQ))

Also
P ∣ ∣ ( b → Q ) P||(b → Q) P(bQ)
= ( a → ( c → P ) ∣ ∣ ( b → Q ) = (a → (c → P)||(b → Q) =(a(cP)(bQ)
∣ b → ( P ∣ ∣ Q ) ) [ b y L 6 ] |b → (P||Q)) [by L6] b(PQ))[byL6]
= ( a → b → ( ( c → P ) ∣ ∣ Q ) ∣ b → ( P ∣ ∣ Q ) ) ( by L5B) = (a → b → ((c → P)||Q) |b → (P||Q)) \tag{ by L5B} =(ab((cP)Q)b(PQ))( 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} =(abc(P(bQ))bac(P(bQ)))(by above)
= µ X • ( a → b → c → X ∣ b → a → c → X ) = µX • (a → b → c → X|b → a → c → X) =µX(abcXbacX)

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} (PQ)=(acμX(abcXbacX))(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. PQsat0tratrb2.

答:
1.若 t r tr tr 未运行到循环阶段,则 t r ↓ a = 1 tr ↓ a = 1 tra=1 0 0 0 t r ↓ b = 0 tr↓ b = 0 trb=0 满足不等式;
2.若 t r tr tr 运行到循环并恰好完成若干次循环,则由于每次循环 a a a 的个数 = b =\quad b =b 的个数,所以 t r ↓ a − t r ↓ b = 1 tr ↓ a − tr ↓ b = 1 tratrb=1
3.若 t r tr tr 运行到某次循环中,由于本次循环前满足 t r ↓ a − t r ↓ b = 1 tr ↓ a - tr ↓ b= 1 tratrb=1
所以:
若运行 a → b → c → X a → b → c → X abcX,则 t r ↓ a − t r ↓ b = 2 tr↓ a − tr ↓ b =2 tratrb=2 1 1 1
若运行 b → a → c → X b → a → c → X bacX,则 t r ↓ a − t r ↓ b = 0 tr ↓ a- tr ↓ b=0 tratrb=0 1 1 1
综上, 0 ≤ t r ↓ a − t r ↓ b ≤ 2 0 ≤ tr↓ a- tr ↓ b≤ 2 0tratrb2

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

(1)请直观解释此结论的正确性。

答: 因为P和Q的字母表交集最多含有1个元素,所以不会触发 ( c → P ) ∣ ∣ ( d → Q ) = S T O P i f c ≠ d (c → P)||(d → Q) = STOP \quad if c\ne d (cP)(dQ)=STOPifc=d

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

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

第三章

1、

(1) t r a c e s ( P ⊓ Q ) = ? traces(P\sqcap Q) = ? traces(PQ)=?

答: t r a c e s ( P ⊓ Q ) = t r a c e s ( P ) ∪ t r a c e s ( Q ) traces(P\sqcap Q)=traces(P) ∪ traces(Q) traces(PQ)=traces(P)traces(Q)

(2) t r a c e s ( P □ Q ) = ? traces(P \square Q) = ? traces(PQ)=?

答: t r a c e s ( P □ Q ) = t r a c e s ( P ) ∪ t r a c e s ( Q ) traces(P \square Q)= traces(P)∪ traces(Q) traces(PQ)=traces(P)traces(Q)

(3) r e f u s a l s ( P ⊓ Q ) = ? refusals(P \sqcap Q) = ? refusals(PQ)=?

答: r e f u s a l s ( P ⊓ Q ) = r e f u s a l s ( P ) ∪ r e f u s a l s ( Q ) refusals(P\sqcap Q) = refusals(P) ∪ refusals(Q) refusals(PQ)=refusals(P)refusals(Q)

(4) r e f u s a l s ( P □ Q ) = ? refusals(P\square Q) = ? refusals(PQ)=?

答: r e f u s a l s ( P □ Q ) = r e f u s a l s ( P ) ∩ r e f u s a l s ( Q ) refusals(P\square Q)=refusals(P) ∩ refusals(Q) refusals(PQ)=refusals(P)refusals(Q)

(5)令 α P = α Q = α P 1 = α Q 1 = { a , b , c } , \alpha P = \alpha Q = \alpha P_{1} = \alpha Q_{1}= \{a,b,c\}, αP=αQ=αP1=αQ1={a,b,c},

P 1 = ( a → b → S T O P ) P1 = (a → b → STOP) P1=(abSTOP)
P 2 = ( b → c → S T O P ) P2 = (b → c → STOP) P2=(bcSTOP)
P = P 1 ⊓ P 2 P = P1 \sqcap P2 P=P1P2
Q = P 1 □ P 2 Q = P1\square P2 Q=P1P2
问:
r e f u s a l s ( P ) = ? refusals(P) = ? refusals(P)=?
r e f u s a l s ( Q ) = ? refusals(Q) = ? refusals(Q)=?
答:
r e f u s a l s ( P 1 ) = { { } , b , c , b , c } refusals(P1) = \{\{\},{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}\} 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}\} refusals(P)={{},a,b,c,b,c,a,c}
r e f u s a l s ( Q ) = { { } , c } refusals(Q) =\{\{\},{c}\} refusals(Q)={{},c}

(6) r e f u s a l s ( P ∣ ∣ Q ) = ? refusals(P|| Q) = ? refusals(PQ)=?

答: r e f u s a l s ( P ∣ ∣ Q ) = { X ∪ Y ∣ X ∈ r e f u s a l s ( P ) ∧ Y ∈ r e f u s a l s ( Q ) } refusals(P||Q)=\{X ∪ Y | X \in refusals(P) \wedge Y \in refusals(Q)\} refusals(PQ)={XYXrefusals(P)Yrefusals(Q)}

(7) r e f u s a l s ( P ∣ ∣ ∣ Q ) = ? refusals(P|||Q) = ? refusals(PQ)=?

答: r e f u s a l s ( P ∣ ∣ ∣ Q ) = r e f u s a l s ( P □ Q ) = r e f u s a l s ( P ) ∩ r e f u s a l s ( Q ) refusals(P|||Q) =refusals(P\square Q) =refusals(P) \cap refusals(Q) refusals(PQ)=refusals(PQ)=refusals(P)refusals(Q)

2.

(1) d i v e r g e n c e s ( C h a o s ) = ? divergences(Chaos) = ? divergences(Chaos)=?

答: d i v e r g e n c e s ( C h a o s ) = A ∗ divergences(Chaos) = A^* divergences(Chaos)=A

(2) d i v e r g e n c e s ( X : B → P ( X ) ) = ? divergences(X: B → P(X)) = ? divergences(X:BP(X))=?

答: { ⟨ x ⟩ ⌢ s ∣ x ∈ B ∧ s ∈ d i v e r g e n c e s ( P ( x ) ) } \{⟨x⟩\smallfrown s | x \in B \wedge s \in divergences(P(x))\} {xsxBsdivergences(P(x))}

(3) d i v e r g e n c e s ( P ⊓ Q ) = ? divergences(P \sqcap Q) = ? divergences(PQ)=?

答: 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) divergences(P)divergences(Q)

(4) d i v e r g e n c e s ( P □ Q ) = ? divergences(P\square Q) = ? divergences(PQ)=?

答: 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) divergences(P)divergences(Q)

(5) d i v e r g e n c e s ( P ∥ Q ) = ? divergences(P∥Q) = ? divergences(PQ)=?

答: { s ⌢ t ∣ t ∈ ( α P ∪ α Q ) ∗ ∧ ( ( s ↾ α P ∈ d i v e r g e n c e s ( P ) ∧ s ↾ α Q ∈ t r a c e s ( Q ) ) ∨ ( s ↾ α P ∈ t r a c e s ( P ) ∧ s ↾ α Q ∈ d i v e r g e n c e s ( Q ) ) } \{s \smallfrown t|t \in (\alpha P ∪ \alpha Q) ^{*} \wedge ((s \upharpoonright\alpha P \in divergences( P )\wedge s \upharpoonright \alpha Q \in traces(Q)) ∨ (s \upharpoonright \alpha P \in traces(P) \wedge s\upharpoonright \alpha Q \in divergences(Q))\} {stt(αPαQ)((sαPdivergences(P)sαQtraces(Q))(sαPtraces(P)sαQdivergences(Q))}

(6) d i v e r g e n c e s ( P ∣ ∣ ∣ Q ) = ? divergences(P|||Q) = ? divergences(PQ)=?

答: { u ∣ ∃ s , t • u i n t e r l e a v e s ( s , t ) ∧ ( ( s ∈ d i v e r g e n c e s ( P ) ∧ t ∈ t r a c e s ( Q ) ) ∨ ( s ∈ t r a c e s ( P ) ∧ t ∈ d i v e r g e n c e s ( Q ) ) ) } \{u | \exists s, t • u \quad interleaves (s, t) \wedge ((s \in divergences(P) \wedge t \in traces(Q)) ∨ (s \in traces(P) \wedge t \in divergences(Q)))\} {us,tuinterleaves(s,t)((sdivergences(P)ttraces(Q))(straces(P)tdivergences(Q)))}
∧ \wedge

3.

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

答: f a i l u r e s ( P ) = { ( s , X ) ∣ s ∈ t r a c e s ( P ) ∧ X ∈ r e f u s a l s ( P / s ) } failures(P) =\{(s, X)| s \in traces(P) \wedge X \in refusals(P/s)\} failures(P)={(s,X)straces(P)Xrefusals(P/s)}

(2)P 与 Q 的定义如上述第三章的 1、(3)所定义:

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

(3)

f a i l u r e s ( P ⊓ Q ) = ? failures(P \sqcap Q) = ? failures(PQ)=?
答: f a i l u r e s ( P ⊓ Q ) = f a i l u r e s ( P ) ∪ f a i l u r e s ( Q ) failures(P \sqcap Q) =failures(P)\cup failures(Q) failures(PQ)=failures(P)failures(Q)

f a i l u r e s ( X : B → P ( X ) ) = ? failures(X: B → P(X)) = ? failures(X:BP(X))=?
答: { ( < > , X ) ∣ X ⊆ ( α P − B ) } ∪ { ( ⟨ x ⟩ ⌢ s , X ) ∣ x ∈ B ∧ ( s , X ) ∈ f a i l u r e s ( P ( x ) ) } \{(<>, X)| X \subseteq (\alpha P − B)\} ∪ \{(⟨x⟩ \smallfrown s, X)| x \in B \wedge (s, X) \in failures(P(x))\} {(<>,X)X(αPB)}{(xs,X)xB(s,X)failures(P(x))}

f a i l u r e s ( P ∥ Q ) = ? failures(P ∥ Q) = ? failures(PQ)=?
答: f a i l u r e s ( P ∣ ∣ Q ) = { ( s , X ∪ Y ) ∣ s ∈ ( α P ∪ α Q ) ∗ ∧ ( s ↾ α P , X ) ∈ f a i l u r e s ( P ) ∧ ( s ↾ α Q , Y ) ∈ f a i l u r e s ( Q ) } ∪ { ( s , X ) ∣ s ∈ d i v e r g e n c e s ( P ∣ ∣ Q ) } failures(P||Q) = \{(s, X \cup Y )|s \in (\alpha P ∪ \alpha Q) ^{*} \wedge (s \upharpoonright \alpha P, X) \in failures(P) \wedge (s\upharpoonright \alpha Q, Y ) \in failures(Q)\} \cup \{(s, X)|s \in divergences(P||Q)\} failures(PQ)={(s,XY)s(αPαQ)(sαP,X)failures(P)(sαQ,Y)failures(Q)}{(s,X)sdivergences(PQ)}

f a i l u r e s ( P □ Q ) = ? failures(P \square Q) = ? failures(PQ)=?
答: { ( s , X ) ∣ ( s , X ) ∈ f a i l u r e s ( P ) ∩ f a i l u r e s ( Q ) ) ∨ ( s ≠ < > ∧ ( s , X ) ∈ f a i l u r e s ( P ) ∪ f a i l u r e s ( Q ) ) } ∪ { ( s , X ) ∣ s ∈ d i v e r g e n c e s ( P □ Q ) } \{(s, X)|(s, X) \in failures(P) ∩ failures(Q)) \vee (s \ne <>\wedge (s, X) \in failures(P) \cup failures(Q))\} \cup \{(s, X)| s \in divergences(P \square Q)\} {(s,X)(s,X)failures(P)failures(Q))(s=<>(s,X)failures(P)failures(Q))}{(s,X)sdivergences(PQ)}

f a i l u r e s ( P ∣ ∣ ∣ Q ) = ? failures(P|||Q) = ? failures(PQ)=?
答: { ( s , X ) ∣ ∃ t , u • ( t , X ) ∈ f a i l u r e s ( P ) ∧ ( u , X ) ∈ f a i l u r e s ( Q ) } ∪ { ( s , X ) ∣ s ∈ d i v e r g e n c e s ( P ∣ ∣ ∣ Q ) } \{(s, X)| ∃t, u• (t, X) \in failures(P) \wedge (u, X) \in failures(Q) \} ∪ \{(s, X)| s \in divergences(P|||Q)\} {(s,X)t,u(t,X)failures(P)(u,X)failures(Q)}{(s,X)sdivergences(PQ)}

4.对非确定性进程,如何判断两个进程等价?

答:对非确定性进程而言,使用traces已经无法区分(如,第三章的 1、(3)所定义的两进程 P P P Q Q Q α P = α Q \alpha P=\alpha Q αP=αQ,且 t r a c e s ( P ) = t r a c e s ( Q ) traces(P)=traces(Q ) traces(P)=traces(Q));进一步引入 r e f u s a l s refusals refusals,但是用 r e f u s a l s refusals refusals来判断,具有局限性。最终,通过 a l p h a b e t alphabet alphabet d i v e r g e n c e s divergences divergences f a i l u r e s failures failures综合判断。
即:
α P = α Q \alpha P=\alpha Q αP=α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) 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) failures(P)=failures(Q)

CSP: Operational Semantics

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

答:
A和B之间存在通信的管道,可以发送某种类型的消息,B在接收到A的消息之前,并不清楚A发送的内容,只知道类型;
只有在A发送的同时,B同步接收,双方才可以通信,因此公共事件须同步。

2、从 CSP 的操作语义的角度定义:

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

答: f a i l u r e s ( P ) = d f { s , X ∣ ∃ P 1 , P 2 ⋅ P    ⟹    s P 1 ∧ P 1 → ∗ P 2 ∧ s t a b l e ( P 2 ) ∧ ∀ c ∈ X ⋅ ¬ ( P 2 → ) } failures(P) ={}_{df}\{s,X|\exists P_{1},P_{2}\cdot P\stackrel{s}{ \implies}P1\wedge P_{1}\xrightarrow {*}P_2\wedge stable(P_2)\wedge \forall c\in X\cdot \lnot (P_2\rightarrow)\} failures(P)=df{s,XP1,P2PsP1P1 P2stable(P2)cX¬(P2)}

(2) d i v e r g e n c e s ( P ) = ? divergences(P) = ? divergences(P)=?

答: d i v e r g e n c e s ( P ) = d f { s ∣ ∃ P 1 ⋅ P    ⟹    s s P 1 ∧ ↑ P 1 } divergences(P) = {}_{df}\{s|\exists P_{1}\cdot P\stackrel{s}{ \implies}{s} P_{1}\wedge \uparrow P_{1}\} divergences(P)=df{sP1PssP1P1}

CCS: Bisimulation

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

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

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

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

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页