Concurrency

Concurrency

```
A[x] -> B.y
P[z] -> Q.w
✅
```

```
A[x] -> B.y
P[z] -> Q.w
C[m] -> D.k
```

```
A[x] -> B.y
✅
C[m] -> D.k
```

```
✅
P[z] -> Q.w
C[m] -> D.k
```

Asynchrony

Asyncrony

```
A[x] -> B.y
P[z] -> A.w
A[m] -> D.k
```

Asyncrony

```
A[x] -> B.y
P[z] -> A.w
A[m] -> D.k
```

```
✅
P[z] -> A.w
A[m] -> D.k
```

Asyncrony

```
A[x] -> B.y
P[z] -> A.w
A[m] -> D.k
```

```
✅ -> B.y
P[z] -> A.w
A[m] -> D.k
```

```
✅ -> ✅
P[z] -> A.w
A[m] -> D.k
```

Asyncrony

```
A[x] -> B.y
P[z] -> A.w
A[m] -> D.k
```

```
✅ -> B.y
✅
A[m] -> D.k
```

```
✅
P[z] -> A.w
A[m] -> D.k
```

Asyncrony

```
A[x] -> B.y
P[z] -> A.w
❌
```

```
A[x] -> B.y
P[z] -> A.w
A[m] -> D.k
```

```
A[x] -> B.y
✅
A[m] -> D.k
```

```
✅
P[z] -> A.w
A[m] -> D.k
```

Projection

```
let x@A = crunch()
let y@B = crunch()
A[x] -> B.x
B[y] -> A.y
```

```
let x@A = crunch()
let y@B = crunch()
A[x] -> B.x
B[y] -> A.y
```

A

```
x = crunch()
```

```
let x@A = crunch()
let y@B = crunch()
A[x] -> B.x
B[y] -> A.y
```

A

```
x = crunch()
```

B

```
y = crunch()
```

```
let x@A = crunch()
let y@B = crunch()
A[x] -> B.x
B[y] -> A.y
```

A

```
x = crunch()
send("A",x)
```

B

```
y = crunch()
x = receive("A")
```

```
let x@a = crunch()
let y@b = crunch()
A[x] -> B.x
B[y] -> A.y
```

A

```
x = crunch()
send("B",x)
y = receive("B")
```

B

```
y = crunch()
x = receive("A")
send("A",y)
```

Confluence

`project(p,c) = (succ,EP)`

Where:

- (
`p`

) is a process name - (
`c`

) is a choreography - (
`EP`

) is a single endpoint - (
`succ`

) is a boolean signaling success

```
Definition project_def:
...
∧ project proc (Com p1 v1 p2 v2 c) =
if proc = p1 ∧ proc = p2
then (F,Nil)
else if proc = p1
then Send p2 v1 <Γ> project proc c
else if proc = p2
then Receive p1 v2 <Γ> project proc c
else project proc c
...
```