SlideShare a Scribd company logo
Understanding Distributed Calculi
(not in Haskell)
Pawel Szulc
@rabbitonweb
● Rholang
● Rholang
● Rho-calculus
● Rholang
● Rho-calculus
● Async Pi-calculus
● Rholang
● Rho-calculus
● Async Pi-calculus
● Pi-calculus
● Rholang
● Rho-calculus
● Async Pi-calculus
● Pi-calculus
● Lambda-calculus
λ-calculus
Syntax
L, M, N :: = x variable
λx.M abstraction
M N application
Few definitions
λx.M
Few definitions
λx.M
Bound variable
Few definitions
λx.λy.(x y x) ≡ λz.λw.(z w z)
alpha equivalence
Few definitions
λx.λy.(x y x) ≡ λz.λw.(z w z)
alpha equivalence
Few definitions
λx.λy.(x y x) ≡ λz.λw.(z w z)
alpha equivalence
Few definitions
λx.M ≡ λy.M {y/x} alpha conversion
Few definitions
λx.(x y)
Few definitions
λx.(x y)
free variable
Beta reduction
● Applying argument to a function.
Beta reduction
● Applying argument to a function.
● Consider it as a single computation step.
Beta reduction
(λx.N) M ➝ N{M/x}
Beta reduction - example
Beta reduction - example
(λx.λy.x) z w
Beta reduction - example
(λx.λy.x) z w ➝
(λy.z) w
Beta reduction - example
(λx.λy.x) z w ➝
(λy.z) w ➝
z
Is that it?
L, M, N :: = x
λx.M
M N
(λx.N) M ➝ N{M/x}
Is that it?
L, M, N :: = x
λx.M
M N
(λx.N) M ➝ N{M/x}
Encodings
Encodings
● support for multi argument functions
λ(x,y).M
Encodings
● support for multi argument functions
λ(x,y).M ≡ λx.λy.M
Encodings
● support for multi argument functions
○ Moses Schönfinkel
Encodings
● support for multi argument functions
○ Haskell Curry
Encodings
● support for multi argument functions
● boolean values
Encodings
● support for multi argument functions
● boolean values
True = λt.λf.t
False = λt.λf.f
Encodings
● support for multi argument functions
● boolean values
True = λt.λf.t
False = λt.λf.f
If = λl.λm.λn l m n
And = λb.λc. b c False
Encodings
● support for multi argument functions
● boolean values
● Church numerals
Is there a
calculus for
distributed
computing?
Is there a calculus for distributed computing?
“The inevitability of the lambda-calculus arises
from the fact that the only way to observe a
functional computation is to watch which output
values it yields when presented with different
input values” [1]
Is there a calculus for distributed computing?
“Unfortunately, the world of concurrent
computation is not so orderly. Different notions of
what can be observed may be appropriate in
different circumstances, giving rise to different
definitions of when two concurrent systems have
‘the same behavior’ ” [1]
CCS & CSP
CCS & CSP
CCS - Calculus of Communicating Systems [3]
CSP - Communicating Sequential Processes [4]
π-calculus
What is π-calculus
“π -calculus is a model of computation for
concurrent systems.” [2]
What is π-calculus
“In lambda-calculus everything is a function (...)
In the pi-calculus every expression denotes a
process - a free-standing computational activity,
running in parallel with other process.” [1]
What is π-calculus
“Two processes can interact by exchanging a
message on a channel” [1]
What is π-calculus
“It lets you represent processes, parallel
composition of processes, synchronous
communication between processes through
channels, creation of fresh channels, replication of
processes, and nondeterminism.” [2]
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Input and output example
Model a program that runs single process P, which
sends message hello on channel x and then
receives a message msg on the same channel x.
Input and output example
P :: =x(hello).x(msg).0
Input and output example
P :: = x(hello).x(msg).0
P
Input and output example
P :: = x(hello).x(msg).0
P
xhello
Input and output example
P :: = x(hello).x(msg).0
P x
hello
Input and output example
P :: = x(hello).x(msg).0
P x
hello
Input and output example
P :: = x(hello).x(msg).0
P x
hello
Input and output example
P :: = x(hello).x(msg).0
P x
hello
Input and output example
P :: = x(hello).x(msg).0
P x
msg
Input and output example
P :: = x(hello).x(msg).0
Input and output example
P :: = x(hello).x(msg).0
Input and output example
P :: = x(hello).x(msg).0
P
xhello
Input and output example
P :: = x(hello).x(msg).0
P
xhello
Waits for message ‘msg’ on channel
‘x’, before continuing.
Input and output example
P :: = x(hello).x(msg).0
P
xhello
This is a synchronous call.
It waits until somebody receives it.
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
How to pronounce ν?
lower-case: ν
sound: Nee
greek name: Νι
How to pronounce ν?
lower-case: ν
sound: Nee
greek name: Νι
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
(νx)P restriction bounds a variable
P ::= yx.0
(νx)P restriction bounds a variable
P ::= yx.0
Q ::= (νx)P
(νx)P restriction bounds a variable
P ::= yx.0
Q ::= (νx)P →
(νx)(yx.0)
(νx)P restriction bounds a variable
(νx)yx.0 == (νz)yz.0
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Input and output example revisited
P :: = x(hello).0
Q :: =x(msg).0
R :: = νx(P | Q).0
Input and output example revisited
P :: = x(hello)
Q :: =x(msg)
R :: = νx(P | Q)
R
Input and output example revisited
P :: = x(hello)
Q :: =x(msg)
R :: = νx(P | Q)
R
Input and output example revisited
P :: = x(hello)
Q :: =x(msg)
R :: = νx(P | Q)
P Q
R
Input and output example revisited
P :: = x(hello)
Q :: =x(msg)
R :: = νx(P | Q)
P Qx
R
Input and output example revisited
P :: = x(hello)
Q :: =x(msg)
R :: = νx(P | Q)
P Qx
hello
R
Input and output example revisited
P :: = x(hello)
Q :: =x(msg)
R :: = νx(P | Q)
P Qx
hello
R
Input and output example revisited
P :: = x(hello)
Q :: = x(msg)
R :: = νx(P | Q)
Q
msg
R
Input and output example revisited
P :: = x(hello)
Q :: = x(msg)
R :: = νx(P | Q)
Input and output example revisited
P :: = x(hello)
Q :: = x(msg)
R :: = νx(P | Q)
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Structural Congruence
“Two processes are structurally congruent, if they
are identical up to structure.” [5]
Structural Congruence
P | Q ≡ Q | P commutativity of parallel composition
Structural Congruence
P | Q ≡ Q | P commutativity of parallel composition
(P | Q) | R ≡ P | (Q | R) associativity of parallel composition
Structural Congruence
P | Q ≡ Q | P commutativity of parallel composition
(P | Q) | R ≡ P | (Q | R) associativity of parallel composition
((νx)P) | Q ≡ (νx)(P | Q) “scope extrusion”
Structural Congruence
P | Q ≡ Q | P commutativity of parallel composition
(P | Q) | R ≡ P | (Q | R) associativity of parallel composition
((νx)P) | Q ≡ (νx)(P | Q) “scope extrusion”
!P ≡ P | !P replication
Structural Congruence
P | Q ≡ Q | P commutativity of parallel composition
(P | Q) | R ≡ P | (Q | R) associativity of parallel composition
((νx)P) | Q ≡ (νx)(P | Q) “scope extrusion”
!P ≡ P | !P replication
(νx)(νy)P ≡ (νy)(νx)P restriction
Reduction rules ⟶
Think of it as a operational semantics.
P ⟶ P’ represents a single computation step
Reduction rules ⟶
xy.P | x(z).Q communication
Reduction rules ⟶
xy.P | x(z).Q communication
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → if P → Q reduction under |
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → Q | R if P → Q reduction under |
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → Q | R if P → Q reduction under |
(νx)P → if P → Q reduction under ν
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → Q | R if P → Q reduction under |
(νx)P → (νx)Q if P → Q reduction under ν
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → Q | R if P → Q reduction under |
(νx)P → (νx)Q if P → Q reduction under ν
P → if P ≡ P’ Q’ ≡ Q structural congruence
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → Q | R if P → Q reduction under |
(νx)P → (νx)Q if P → Q reduction under ν
P → if P ≡ P’ → Q’ ≡ Q structural congruence
Reduction rules ⟶
xy.P | x(z).Q → P | [y/z]Q communication
P | R → Q | R if P → Q reduction under |
(νx)P → (νx)Q if P → Q reduction under ν
P → Q if P ≡ P’ → Q’ ≡ Q structural congruence
Some examples(1) - PingPong
PING ::= x(ping).x(pong)
PONG ::= x(ping).x(pong)
P ::= PING | PONG
Some examples(1) - PingPong
PING ::= x(ping).x(pong)
PONG ::= x(ping).x(pong)
P ::= x(ping).x(pong) | x(ping).x(pong)
Some examples(1) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong)
Some examples(1) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong)
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong)
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong)
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= x(pong) | x(pong)
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= x(pong) | x(pong)
Some examples(1) - PingPong
P ::= x(pong) | x(pong)
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= x(pong) | x(pong)
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= 0 | 0
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(1) - PingPong
P ::= 0 | 0
Some examples(1) - PingPong
P ::= 0 | 0
P | 0 ≡ P missing equivalence?
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed Calculi
Some examples(1) - PingPong
P ::= 0 | 0
P | 0 ≡ P wikipedia equivalence
Some examples(1) - PingPong
P ::= 0
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed Calculi
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)(P | Q)
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy)xy.yw.yz | x(y).y(h).y(h))
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy)xy.yw.yz | x(y).y(h).y(h))
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy)xy.yw.yz | x(y).y(h).y(h))
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy)yw.yz | y(h).y(h))
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy)yw.yz | y(h).y(h))
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy)yz | y(w))
xy.P | x(z).Q → P | [y/z]Q communication
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= (νx)((νy) 0 | 0)
Some examples(0) - Sending channels
P ::= (νy)xy.yw.yz
Q ::= x(y).y(h).y(h)
R ::= 0
Some examples(2) - PingPong
PING ::= x(ping).x(pong)
PONG ::= x(ping).x(pong)
P ::= PING | PONG | PONG
Some examples(2) - PingPong
P ::= PING | PONG | PONG
Some examples(2) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong) | x(ping).x(pong)
Some examples(2) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong) | x(ping).x(pong)
Some examples(2) - PingPong
P ::= x(ping).x(pong) | x(ping).x(pong) | x(ping).x(pong)
Some examples(2) - PingPong
P ::=x(pong) | x(ping).x(pong) |x(pong)
Some examples(2) - PingPong
P ::=x(pong) | x(ping).x(pong) |x(pong)
Some examples(2) - PingPong
P ::= 0 | x(ping).x(pong) | 0
Some examples(3) - PingPong
PING ::= x(ping).x(pong)
PONG ::= x(ping).x(pong)
P ::= PING | PONG
Some examples(3) - PingPong
PING ::= x(ping).x(pong)
PONG ::= x(ping).x(pong)
P ::= !PING | !PONG
Some examples(3) - PingPong
P ::= !PING | !PONG
Some examples(3) - PingPong
P ::= !PING | !PONG
!P ≡ P | !P replication
Some examples(3) - PingPong
P ::= PING | !PING | PONG | !PONG
!P ≡ P | !P replication
Some examples(3) - PingPong
P ::= PING | !PING | PONG | !PONG
Some examples(3) - PingPong
P ::= 0 | !PING | 0 | !PONG
Some examples(3) - PingPong
P ::= 0 | PING | !PING | 0 | PONG | !PONG
Some examples(3) - PingPong
P ::= 0 | 0 | !PING | 0 | 0 | !PONG
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
P ::= 0 | xz | y(v)
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
P ::= 0 | xz | y(v) P ::= xy | 0 | z(v)
Some examples(4) - Race Conditions
P ::= xy | xz | x(w).w(v)
P ::= xz | y(v) P ::= xy | z(v)
Benefits
● reason about computation
● detect dead-locks
● detect non-determinism
● reason about structure
● good to describe protocols
● a formal framework for providing semantics for
a high-level language
Issues
● synchronous by nature
Issues
● synchronous by nature
● receiving on send channel - implementation
dilemmas
Implementation issue...
“This seems quite natural.(...).But there’s a big problem here.
ReceivePorts are not Serializable, which prevents us passing
the ReceivePort r1 to the spawned process. GHC will reject the
program with a type error.” [8]
Implementation issue...
“Why are ReceivePorts not Serializable? If you think about it a
bit, this makes a lot of sense. If a process were allowed to send
a ReceivePort somewhere else, the implementation would have
to deal with two things: routing messages to the correct desti‐
nation when a ReceivePort has been forwarded (possibly
multiple times), and routing messages to multiple destinations,
because sending a ReceivePort would create a new copy.” [8]
Implementation issue...
“This would introduce a vast amount of complexity to the
implementation, and it is not at all clear that it is a good feature
to allow. So the remote framework explicitly disallows it,
which fortunately can be done using Haskell’s type system.”
[8]
Issues
● synchronous by nature
● receiving on send channel - implementation
dilemmas
● notion of creating a named channel
async π-calculus
Chemical State Machine
“The chemical abstract machine” G. Berry, G. Boudl
Chemical State Machine
“The chemical abstract machine” G. Berry, G. Boudl
Chemical State Machine
“The chemical abstract machine” G. Berry, G. Boudl
Chemical State Machine
“The chemical abstract machine” G. Berry, G. Boudl
Chemical State Machine
“The chemical abstract machine” G. Berry, G. Boudl
Sync π syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Async π syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy.P output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Async π syntax
P, Q, R :: = 0 inert process
x(y).P input prefix
xy output prefix
P | Q parallel composition
(νx)P restriction
!P replication
Benefits
● almost all expressive power of classical
pi-calculus
● models asynchronous computation
Issues
● Is not a closed theory
● Heating / cooling rules seem like an overkill
● Not as powerful as synchronous version
○ “Comparing the expressive power of the synchronous
and asynchronous pi-calculus” Catuscia Palamidessi
ρ-calculus
RChain - Understanding Distributed Calculi
RChain - Understanding Distributed Calculi
ρ-calculus
“The π-calculus is not a closed theory, but rather
a theory dependent upon some theory of names.
(...) names may be tcp/ip ports or urls or object
references, etc. But, foundationally, one might ask
if there is a closed theory of processes, i.e. one in
which the theory of names arises from and is
wholly determined by the theory of processes.” [7]
Quoting
“Here we present a theory of an asynchronous
message-passing calculus built on a notion of
quoting. Names are quoted processes, and as such
represent the code of a process.(...) Name-passing,
then becomes a way of passing the code of a
process as a message.” [7]
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
x⦉P⦊
“Process P will be packaged up as its code, ⌜P⌝,
and ultimately made available as an output at the
port x” [7]
x⦉P⦊
“Process P will be packaged up as its code, ⌜P⌝,
and ultimately made available as an output at the
port x” [7]
“The lift operator turns out to play a role
analogous to (νx)”
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
⌝x⌜
“The ⌝x⌜ operator (...) eventually extracts the
process from a name. We say ‘eventually’ because
this extraction only happens when quoted process
is substituted into this expression.” [7]
⌝x⌜
“A consequence of this behaviour is that the ⌝x⌜ is
inert, except under an input prefix” [7]
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
x(y) - syntactic sugar
x(y) ≜ x⦉⌝y⌜⦊
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Syntax
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
How to create a single name even?
P, Q ::= 0 inert process
x(y).P input
⌝x⌜ drop
x⦉P⦊ lift
P | Q parallel
x, y ::= ⌜P⌝ quote
Name game!
x ::= ⌜?⌝
Name game!
x ::= ⌜0⌝
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝
x(y) output
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝ // ⌜x(x)⌝
x(y) output
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝
z ::= ⌜⌜0⌝(⌜0⌝).0⌝
x(y).P input
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝
z ::= ⌜⌜0⌝(⌜0⌝).0⌝ // ⌜x(x).0⌝
x(y).P input
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝
z ::= ⌜⌜0⌝(⌜0⌝).0⌝
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝
z ::= ⌜⌜0⌝(⌜0⌝).0⌝
q ::= ⌜0 | 0 ⌝
Name game!
x ::= ⌜0⌝
y ::= ⌜⌜0⌝(⌜0⌝)⌝
z ::= ⌜⌜0⌝(⌜0⌝).0⌝
q ::= ⌜0 | 0 ⌝
p ::= ⌜0 | 0 | 0 ⌝
Are those different names?
x ::= ⌜0⌝
q ::= ⌜0 | 0 ⌝
p ::= ⌜0 | 0 | 0 ⌝
Are those different names?
“This question leads to several intriguing and
apparently fundamental questions. Firstly, if
names have structure, what is a reasonable notion
of equality on names? How much computation, and
of what kind, should go into ascertaining equality
on names?” [7]
Structural congruence
P | 0 ≡ P ≡ 0 | P
P | Q ≡ Q | P
(P | Q) | R ≡ P | (Q | R)
alpha-equivalence
x(z).w⦉y(z)⦊
x(v).w⦉y(v)⦊
alpha-equivalence
x(z).w⦉y(z)⦊
x(v).w⦉y(v)⦊
x(v).w⦉y(v)⦊ {z/v}
Name equivalence
⌜⌝x⌜⌝ ≡ x quote-drop
P ≡ Q ➝ ⌝P⌜ ≡ ⌝Q⌜ struct-equiv
Wait, what?
⌜⌝x⌜⌝ ≡ x
P ≡ Q ➝ ⌝P⌜ ≡ ⌝Q⌜
P | 0 ≡ P ≡ 0 | P
P | Q ≡ Q | P
(P | Q) | R ≡ P | (Q | R)
Wait, what?
⌜⌝x⌜⌝ ≡ x
P ≡ Q ➝ ⌝P⌜ ≡ ⌝Q⌜
P | 0 ≡ P ≡ 0 | P
P | Q ≡ Q | P
(P | Q) | R ≡ P | (Q | R)
“If you made them and they made you...”
⌜⌝x⌜⌝ ≡ x
P ≡ Q ➝ ⌝P⌜ ≡ ⌝Q⌜
P | 0 ≡ P ≡ 0 | P
P | Q ≡ Q | P
(P | Q) | R ≡ P | (Q | R)
It all works out...
⌜⌝x⌜⌝ ≡ x
P ≡ Q ➝ ⌝P⌜ ≡ ⌝Q⌜
P | 0 ≡ P ≡ 0 | P
P | Q ≡ Q | P
(P | Q) | R ≡ P | (Q | R)
Operational Semantics
Operational Semantics
x0
≡ x1
then x0
⦉(Q)⦊ | x1
(y).P ➝ P {⌝Q⌜/y}
Operational Semantics
x0
≡ x1
then x0
⦉(Q)⦊ | x1
(y).P ➝ P {⌝Q⌜/y}
P ➝ P’ then P | Q ➝ P’ | Q
Operational Semantics
x0
≡ x1
then x0
⦉(Q)⦊ | x1
(y).P ➝ P {⌝Q⌜/y}
P ➝ P’ then P | Q ➝ P’ | Q
P ≡ P’ and Q ≡ Q’ and Q’ ➝ P’ then P ➝ Q
x(y) - syntactic sugar
x(y) ≜ x⦉⌝y⌜⦊
x(y) - syntactic sugar proof!
x(z) | x(y).P
x(y) - syntactic sugar proof!
x(z) | x(y).P
P {z/y}
x(y) - syntactic sugar proof!
x(z) | x(y).P
x(y) - syntactic sugar proof!
x(z) | x(y).P ➝
x⦉⌝z⌜⦊ | x(y).P
x(y) - syntactic sugar proof!
x(z) | x(y).P ➝
x⦉⌝z⌜⦊ | x(y).P
x0
≡ x1
then x0
⦉(Q)⦊ | x1
(y).P ➝ P {⌝Q⌜/y}
x(y) - syntactic sugar proof!
x(z) | x(y).P ➝
x⦉⌝z⌜⦊ | x(y).P ➝
P {⌜⌝z⌜⌝/y}
x0
≡ x1
then x0
⦉(Q)⦊ | x1
(y).P ➝ P {⌝Q⌜/y}
x(y) - syntactic sugar proof!
x(z) | x(y).P ➝
x⦉⌝z⌜⦊ | x(y).P ➝
P {⌜⌝z⌜⌝/y}
x(y) - syntactic sugar proof!
x(z) | x(y).P ➝
x⦉⌝z⌜⦊ | x(y).P ➝
P {⌜⌝z⌜⌝/y}
⌜⌝x⌜⌝ ≡ x quote-drop
x(y) - syntactic sugar proof!
x(z) | x(y).P ➝
x⦉⌝z⌜⦊ | x(y).P ➝
P {⌜⌝z⌜⌝/y} ≡
P {z/y}
RHO-lang
● Bisimulation
What we have not covered?
References
1 “Foundational Calculi for Programming Languages” Benjamin C. Pierce
2 "FAQ on π-Calculus" Jeannette M. Wing
3 “A Calculus of Communicating Systems” Robin Milner
4 “Communicating Sequential Processes” C.A.R Hoare
5 https://en.wikipedia.org/wiki/%CE%A0-calculus
6 “The Polyadic Pi-Calculus: a Tutorial” Robin Milner
7 “A Reflective Higher-Ordered Calculus” L.G. Meredith, Matthias Radestock
8 “Parallel and Concurrent Programming in Haskell: Techniques for Multicore”
Pawel Szulc@rabbitonweb
THE END
jobs@pyrofex.net

More Related Content

PDF
Understanding distributed calculi in Haskell
PDF
Athens workshop on MCMC
PPT
Variational Inference
PDF
Variational Bayes: A Gentle Introduction
PDF
Some Thoughts on Sampling
PDF
ABC in Roma
PDF
Shanghai tutorial
PDF
Lecture 2 predicates quantifiers and rules of inference
Understanding distributed calculi in Haskell
Athens workshop on MCMC
Variational Inference
Variational Bayes: A Gentle Introduction
Some Thoughts on Sampling
ABC in Roma
Shanghai tutorial
Lecture 2 predicates quantifiers and rules of inference

What's hot (20)

PDF
Discussion of Fearnhead and Prangle, RSS< Dec. 14, 2011
PPT
Predicates and Quantifiers
PDF
Lecture 11 f17
PDF
Stack of Tasks Course
PDF
Germany2003 gamg
PDF
RuleML 2015 Constraint Handling Rules - What Else?
PDF
Lecture 4 f17
PPTX
Unit 1 quantifiers
PDF
Lecture 3 qualtifed rules of inference
PDF
140106 isaim-okayama
PDF
Hamilton-Jacobi equations and Lax-Hopf formulae for traffic flow modeling
PDF
QMC: Transition Workshop - Probabilistic Integrators for Deterministic Differ...
PDF
015 canonical tranformation ii
PDF
08 Machine Learning Maximum Aposteriori
PDF
Code of the multidimensional fractional pseudo-Newton method using recursive ...
PDF
MAP Estimation Introduction
PDF
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
PPT
Otter 2014-12-22-01-slideshare
PDF
Lambda Calculus by Dustin Mulcahey
PPTX
Predicates and Quantifiers
Discussion of Fearnhead and Prangle, RSS< Dec. 14, 2011
Predicates and Quantifiers
Lecture 11 f17
Stack of Tasks Course
Germany2003 gamg
RuleML 2015 Constraint Handling Rules - What Else?
Lecture 4 f17
Unit 1 quantifiers
Lecture 3 qualtifed rules of inference
140106 isaim-okayama
Hamilton-Jacobi equations and Lax-Hopf formulae for traffic flow modeling
QMC: Transition Workshop - Probabilistic Integrators for Deterministic Differ...
015 canonical tranformation ii
08 Machine Learning Maximum Aposteriori
Code of the multidimensional fractional pseudo-Newton method using recursive ...
MAP Estimation Introduction
no U-turn sampler, a discussion of Hoffman & Gelman NUTS algorithm
Otter 2014-12-22-01-slideshare
Lambda Calculus by Dustin Mulcahey
Predicates and Quantifiers
Ad

Similar to RChain - Understanding Distributed Calculi (20)

PPTX
Formal methods 5 - Pi calculus
PDF
A Context-Based Semantics for SPARQL Property Paths over the Web
PPTX
Otter 2016-11-28-01-ss
PDF
Sep logic slide
PDF
dma_ppt.pdf
PDF
Kolev skalna2018 article-exact_solutiontoa_parametricline
PPTX
The Logic of Quantum Physics
PDF
Proof techniques and quantifiers : lecture 3
PDF
Truth, deduction, computation lecture b
PDF
Boolean Programs and Quantified Propositional Proof System -
PPT
Ch09.ppt dilfidsnpfpdsvklnvskv vdv;dlvd k;vsvdvk
PDF
Linear Bayesian update surrogate for updating PCE coefficients
PPT
chapter9.ppt
PPTX
FUZZY LOGIC
PDF
Process Algebras and Petri Nets are Discrete Dynamical Systems
PDF
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
PDF
DISMATH_Part1
PDF
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
PDF
Control Synthesis by Sum of Squares Optimization
Formal methods 5 - Pi calculus
A Context-Based Semantics for SPARQL Property Paths over the Web
Otter 2016-11-28-01-ss
Sep logic slide
dma_ppt.pdf
Kolev skalna2018 article-exact_solutiontoa_parametricline
The Logic of Quantum Physics
Proof techniques and quantifiers : lecture 3
Truth, deduction, computation lecture b
Boolean Programs and Quantified Propositional Proof System -
Ch09.ppt dilfidsnpfpdsvklnvskv vdv;dlvd k;vsvdvk
Linear Bayesian update surrogate for updating PCE coefficients
chapter9.ppt
FUZZY LOGIC
Process Algebras and Petri Nets are Discrete Dynamical Systems
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
DISMATH_Part1
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Control Synthesis by Sum of Squares Optimization
Ad

More from Pawel Szulc (20)

PDF
Getting acquainted with Lens
PDF
Impossibility
PDF
Maintainable Software Architecture in Haskell (with Polysemy)
PDF
Painless Haskell
PDF
Trip with monads
PDF
Trip with monads
PDF
Illogical engineers
PDF
Illogical engineers
PDF
Software engineering the genesis
PDF
Make your programs Free
PDF
Going bananas with recursion schemes for fixed point data types
PDF
“Going bananas with recursion schemes for fixed point data types”
PDF
Writing your own RDD for fun and profit
PDF
The cats toolbox a quick tour of some basic typeclasses
PDF
Introduction to type classes
PDF
Functional Programming & Event Sourcing - a pair made in heaven
PDF
Apache spark workshop
PDF
Introduction to type classes in 30 min
PDF
Real world gobbledygook
PDF
Apache spark when things go wrong
Getting acquainted with Lens
Impossibility
Maintainable Software Architecture in Haskell (with Polysemy)
Painless Haskell
Trip with monads
Trip with monads
Illogical engineers
Illogical engineers
Software engineering the genesis
Make your programs Free
Going bananas with recursion schemes for fixed point data types
“Going bananas with recursion schemes for fixed point data types”
Writing your own RDD for fun and profit
The cats toolbox a quick tour of some basic typeclasses
Introduction to type classes
Functional Programming & Event Sourcing - a pair made in heaven
Apache spark workshop
Introduction to type classes in 30 min
Real world gobbledygook
Apache spark when things go wrong

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Programs and apps: productivity, graphics, security and other tools
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
sap open course for s4hana steps from ECC to s4
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

RChain - Understanding Distributed Calculi