14
Ichiro Satoh π - calculus E-mail: [email protected] Ichiro Satoh π - calculus n CCS n :

さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: [email protected] Ichiro Satoh π-calculus n CCS n

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

�������π-calculus

������

� ��E-mail: [email protected]

Ichiro Satoh

π-calculusn �� ����������CCS�����������

n �� ���:� ���������� �����

Page 2: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

π-calculusn CCS0!��@!�=?;�A1�(�)��7��)+��

n Milner,Parrow,Walker @1989�A

Pxy Px y PP QP Qx Px y PA

:| .| ( ).|| || ( )| [ ]|

=

+

=

0 @��)+<>:9A

@�=?;B%5��C7 �A

@��=?;B%5�3+2!�=?;�7C-��A

@P3+2Q.),�6�$A

@P.Q&��0 �-'6A

@!�=?;B7P198?<0�"*6A

@B.C&��)+.'14P.),�6�$A

@A=P./6.'#A7P-��A

Ichiro Satoh

���� �

n �������

ab P a x x Q by R P x Q b x by RP xy Q b x by Ri e P b Q b x by RP Q b x R y

. | ( ). . | . |( . ){ }| .|( . ){ }| .

( . . | . { }| . )| { }| { }

5 5

55

τ

τ

τ

" →"

" →"

" →"

{ a�b }

{ a }

{ b } RPaa

Qa

{ a�b }

{ a, b }

{ b } RP

baa

Qa b

bbb b

Page 3: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

��"�

n π��!#��*(+/

α τ::|| ( )| ( )

=

xyx yx y

����-���$���% �.

��% �� y &��),' x �$��

��%�� y &��),' x �$��

��),' x �$�����& � y ���

α α α α

τ

fn bn n

xy x y x yx y x y x yx y x y x y

( ) ( ) ( )

{ , } { , }( ) { } { } { , }( ) { } { } { , }

∅ ∅ ∅

Ichiro Satoh

π��

n ��

xy P Pxy. ! →! x z z Q w Q w zx w( ). . { }( )5 5! →!!

x y P x z z Q P y Q y z. | ( ). . | . { }5 5τ" →"

y: y:w x y( )

y: y: xy

y: y: z: z: xy x z( )

w fn Q w y∉ ∨ =( )

fn P( ) �� P��������������

y5

Page 4: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

π"�4��

n -.+&π"�35�����)�29��)��,9

Pxy Px y PP QP Qx Px y PA

:| .| ( ).|| || ( )| [ ]|

=

+

=

0 C��+-?A=<D

C�@B>E(8��F:#�D

C��@B>E(8�6-5$�@B>�:F0 �D

CP6-5Q1+/�9 'D

CP1Q)�!3��0*9D

C$�@B>E:P4<;B?�3%,9D

CE1F)��+-1*47P1+/�9 'D

CA=P1291*&A:P0��D

Ichiro Satoh

���� ������� �

n ������� �����

P P Q QP Q P Q y z

xy x z! →! ! →!!

!→!

' '| ' | '{ }

( )

τ

( )P PP Q P Q

bn fn Qα

α α" →"

" →"∩ = ∅

'| ' |

( ) ( ) ( )Q QP Q P Q

bn fn Pα

α α" →"

" →"∩ = ∅

'| ' |

( ) ( )

xy P Pxy. ! →! ( )x y P P w y w y w fn Px w( ). { } ( )( )! →!! = ∪ ∉

P PP Q P

α

α

" →"

+ " →"

''

P Px P x P

x nα

α α" →"

" →"∉

'( ) ( ) '

( )

P Px x P P

α

α

" →"

= " →"

'[ ] '

P PA P

A Pdef

α

α

" →"

" →"=

''( )

τ τ.P P" →"

α τ∈{ , ( ), }xy x y

P P Q QP Q w P Q

x w x w( ) ( )' '| ( )( ' | ' )

! →!! ! →!!

!→!τ

P Py P P w y

y xw fn P w y

xy

x w

! →!

! →!!

∉ ∨ =

&

'(

)

*+

'( ) '{ } ( ' )( )

�����

Page 5: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

π��(�� �31/34n ����� �'+-��

COM: P P Q QP Q P Q y z

xy x z! →! ! →!!

!→!

' '| ' | '{ }

( )

τ

( )PAR: P PP Q P Q

bn fn Qα

α α" →"

" →"∩ = ∅

'| ' |

( ) ( )

OUT: xy P Pxy. ! →!

α τ∈{ , ( ), }xy x y

( )IN: x y P P w y w y w fn Px w( ). { } ( )( )! →!! = ∪ ∉

x y x z z yy

. | ( ). . | .|

0 5 0 0 5 00 05

τ" →"

" →"���

y*$)P�(���'����

��.�"�-%!')��(��120/(���%�&,& #%

Ichiro Satoh

�������

P P Q QP Q P Q y w

xy x w! →! ! →!!

!→!

' '| ' | '{ }

( )

τ( )P P

P Q P Qbn fn Q

α

α α" →"

" →"∩ = ∅

'| ' |

( ) ( )

xy P Pxy. ! →! ( )x y P P w y w y w fn Px w( ). { } ( )( )! →!! = ∪ ∉

xy P x z Q R P Q y z RP Q R y z

. |( ( ). | ) |( { }| )|( | ){ }

τ

τ

" →"

" →"/

��

x y P P x z Q Q w zx z Q R Q w z R

xy P x z Q R P Q w z R y w

xyx w

x w w z w fn Pbn x w fn Q

. ( ). { }( ). | { }|

. | ( ( ). | ) | ( { }| ){ }

( )

( ) ( )( ( )) ( )

! →!! →!!! →!!

! →!

#$%

&'(

= ∪ ∉

∩ =∅τ

xy P x z Q R. |( ( ). | )

Page 6: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

π��(����22/33n π��(����

( )RES: P Px P x P

x nα

α α" →"

" →"∉

'( ) ( ) '

( )

OPEN: P Py P P w y

y xw fn P w y

xy

x w

! →!

! →!!

∉ ∨ =

&

'(

)

*+

'( ) '{ } ( ' )( )

CLOSE: P P Q QP Q w P Q

x w x w( ) ( )' '| ( )( ' | ' )

! →!! ! →!!

!→!τ

( )x P &) P�%� x-��$,#&

���4(& )�������4(& )OPEN&CLOSE'*,

��-/.10�'�$

��-�!�+�/.10- ",

Ichiro Satoh

������3/3

SUM: P PP Q P

α

α

" →"

+ " →"

''

MATCH: P Px x P P

α

α

" →"

= " →"

'[ ] '

IDE: P y x PA y P

A y Pdef{ ~ ~} '

( ~ ) '( ( ~ ) )

α

α

" →"

" →"= ~y y y n= 1

Page 7: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

π��"��

n π��"��+*-

P Pxy! →! '

P Px y( ) '! →!!

P Px y( ) '! →!!

P Pτ" →" ' ����(���� � P�& P� !�����'t.P $�# P���!%���'

,.) x !�� � y(��� P�& P� !�����'!%���'

,.) x !�� � y(��� P�& P� !�����'!%���'

,.) x !� � y(��� P�& P� !�����'!%���'

x y( )

x y( )

( )y xy

Ichiro Satoh

�������

n �������

ab P b a x Q R

P b Q b b b x R b b

. | ( )( ( ). | )|( ' )( { ' }{ }| { ' })τ" →"

{ a�b } P

Q

R

b’�����

{ a�b}

P

Q

R

b�����a

{ a�b}{ a }

( )( | ) ( ' )( { ' } | { ' })x P Q x P x x Q x x=�� ���

Page 8: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

�������

n �������

( )( . | )| ( ). ( )( | | { })a ba P Q b x R a P Q R a xτ" →"

{ a�b }P

Q

R

a� �

{ b } { a�b}

P

Q

R

a� �

b{ a�b}

Ichiro Satoh

3421���

n 3421�-���

�5��0�%&3421 vs��0�%&3421→ ��.��0��%(!/

n CCS+*-3421���0π��,��5�������������

n &'%�π��-���).�0�$�%0�" �# /

Page 9: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

�����Bisimulation

n

P

P�

αQ

( , )P Q S∈

P

P�

Q

Q�( ' , ' )P Q S∈

( , )P Q S∈

P Q( , )P Q S∈

��

α α

P

Q�

αQ

( , )P Q S∈

P

P�

Q

Q�( ' , ' )P Q S∈

( , )P Q S∈

α α

Ichiro Satoh

Early Bisimulationn

#$(������� S�� (#�� P ~E Q #��P#Q'�����"�(#��

������� )P,Q) ÎS #'���&��+� �x%��!��&*����� (�#

( ) ' ' : ' ( ' , ' )( ) ' ( , )

' : ' : ( ' { } , ' { })( )

( )

( )

12

3

P P Q Q Q and P Q S

P P and x FN P Q th en

Q Q Q and y P y x Q y x S

S

ax a x

a x

a x

! →! ⇒ ∃ ! →! ∈

! →!! ∉

∃ ! →!! ∀ ∈

���

Page 10: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

Early Bisimulation

P

P�a x( )

{ }y x1 { }y xn

Q

Q�a x( )

{ }y x1 { }y xn

( '{ }, '{ })P y x Q y x S1 1 ∈

P y x'{ }1 P y xn'{ } Q y x'{ }1 Q y xn'{ }

( '{ }, '{ })P y x Q y x Sn n ∈

P

P�ax

Q( , )P Q S∈

( , )P Q S∈

P

P�

Q

Q�( ' , ' )P Q S∈

( , )P Q S∈

axax

P Q( , )P Q S∈

��

P

P�a x( )

{ }y x1 { }y xn

Q( , )P Q S∈

P y x'{ }1 P y xn'{ }

Q�a x( )

Ichiro Satoh

Late Bisimulationn

#$(� ����� S�� (#�� P ~L Q #��P#Q'� ���"�(#��

� ����� )P,Q) ÎS #'���&��+���x%��!��&*����� (�#

( ) ' ' : ' ( ' , ' )( ) ' ( , )

, ' : ' ( ' { } , ' { })( )

( )

( )

12

3

P P Q Q Q and P Q S

P P and x FN P Q th en

y Q Q Q and P y x Q y x S

S

ax a x

a x

a x

! →! ⇒ ∃ ! →! ∈

! →!! ∉

∀ ∃ ! →!! ∈

���

Page 11: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

Late Bisimulation

n

P

P�a x( )

{ }y x1 { }y xn

Q

Q�a x( )

{ }y x1 { }y xn

( '{ }, '{ })P y x Q y x S1 1 ∈

P y x'{ }1 P y xn'{ } Q y x'{ }1 Q y xn'{ }

( '{ }, '{ })P y x Q y x Sn n ∈

P

P�

Q

Q�( ' , ' )P Q S∈

P

P�a x( )

{ }y x1 { }y xn

Q

P

P�ax

Q( , )P Q S∈

( , )P Q S∈( , )P Q S∈

( , )P Q S∈

axax

P Q( , )P Q S∈

��

P y x'{ }1 P y xn'{ }

Ichiro Satoh

�2E$&

n "1CE+�

n �,/' �E "1F��?JE:

n 75UXRQ/'

n UXRQ@EGEK3���C>B�=�>

n UXOWVYO.0E��1

n 4� UXOWVYO.08MTPLNS�.0E��1K���

n UXOWVYO.0C>BE�!

n π/'D�%D9<UXOWVYO.0�"(E�-

n 6�3���E��

n �3�HI6�3�DGCA<�;"1#�)�;�*Z

n

Page 12: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

π8.Q�B)n ��(I'&R$�P�6OQEn

n �m?ag_XfQ9>7;m

n ag[Z�#ROSI^j\ehV�Qag_XfF�=n ^j\ehV�Q?ehVR��,

n ��(I'2R�6ROD

n �magWdbhW7;MIK +k�mPICT-lmn !�<�Q�1kUj`�G�?C�=Q�� ONlQ�4R�A

n �Q��i�"agWdbhW7;LS��

n %:YZ]cR&/�2OQEkπ8.*QCWB-lnn CCSLS%:YZ]cQ&/R�A

n �03�F5@JHTn

Ichiro Satoh

�������n

!P ! | !P P P≡

( )νx P

xy y Pn1 .P x y y Px y y P

n

n

:: .[ ]| ( ).|

= 1

1

����

x y y P x z z Q P Q y z y zn n n n.[ ] | ( ). | { , , }1 1 1 1 …τ" →"

�Replication)

� �Restriction)( ) ( )νx P x P is

���π���Polyadic π Calculus)

Page 13: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

����

n ���� ������������

P Q P

x P

xy P x y P

| !

( )

. ( ).

ν

Parallelism

Naming, Restriction, Abstraction

Sending, Receiving����Binding �� Guarding ����

xy x z P P y z| ( ). { }!→!

Binding �� Guarding ���� →Action Structure Milner93]

Ichiro Satoh

��� ��������

n ��������������� ����������

P Q Q P P Q R P Q R P P

P Q Q P P Q R P Q R P P P P P

x y P y x P x x P Q P x Q x fn P

x x P P

A P A Pdef

| | |( | ) ( | )| |

( ) ( )

( )( ) ( )( ) ( ) ( )( | ) |( ) ( )

[ ]

( )

≡ ≡ ≡

+ ≡ + + + ≡ + + + ≡ + ≡

≡ ≡ ≡ ∉

= ≡

≡ =

0

0

0 0 if

where

STRUCT: P Q P P P QQ Q

≡ " →" ≡

" →"

α

α

' ' ''

Page 14: さくらのレンタルサーバichiro-satoh.jp/lectures/model/2018/process-pi-calculus.pdf · Ichiro Satoh π-calculus E-mail: ichiro@nii.ac.jp Ichiro Satoh π-calculus n CCS n

Ichiro Satoh

��� ��������

n ��������������� ����������

P Q P P P QQ Q

≡ " →" ≡

" →"

α

α

' ' ''

( )Q QP Q P Q

bn fn Pα

α α" →"

" →"∩ = ∅

'| ' |

( ) ( )

xy P Pxy. ! →! ( )x y P P w y w y w fn Px w( ). { } ( )( )! →!! = ∪ ∉

P Px P x P

x nα

α α" →"

" →"∉

'( ) ( ) '

( )

P P Q QP Q w P Q

x w x w( ) ( )' '| ( )( '| ' )

! →!! ! →!!

!→!τ

P Py P P w y

y xw fn P w y

xy

x w

! →!

! →!!

∉ ∨ =

&

'(

)

*+

'( ) '{ } ( ' )( )

( ( ). )|( . ) { }| + + ! →!x y P xz Q P z y Qτ