Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit forwarding #26

Open
np opened this issue Dec 9, 2015 · 0 comments
Open

Implicit forwarding #26

np opened this issue Dec 9, 2015 · 0 comments

Comments

@np
Copy link
Owner

np commented Dec 9, 2015

The suggestion to be discussed here is the following.

Explicitly forwarding is a burden, we have to introduce twice as many names and then connect them. Combined with the current shortcoming of the lack of inference for forwarders we have to carefully pick the session and the correct order.

Consider the following function composing two processes of matching types:

comp1 =
  \(S0 S1 S2 : Session)
   (p0 : < S0 -o S1 >)
   (p1 : < S1 -o S2 >)->
   proc(c : S0 -o S2)
     c{ni0,i2}
     new [i : S0 -o S1, ni]
     new [j : S1 -o S2, nj]
     ni[i0,ni1]
     nj[i1,ni2]
     ( @p0(i)
     | @p1(j)
     | fwd(S0)(i0,ni0)
     | fwd(S1)(i1,ni1)
     | fwd(S2)(i2,ni2))

I'm suggesting something along the lines of:

comp1 =
  \(S0 S1 S2 : Session)
   (p0 : < S0 -o S1 >)
   (p1 : < S1 -o S2 >)->
   proc(c : S0 -o S2)
     c{~i0,i2}
     new [i : S0 -o S1, ni]
     new [j : S1 -o S2, nj]
     ni[i0,~i1]
     nj[i1,~i2]
     ( @p0(i)
     | @p1(j))

Here I've marked the channels to be connected with ~ as I'm concerned of the unintended use of this feature. Still we can consider the fully implicit version.

We don't have patterns inside allocated channels but this would help even further:

comp1 =
  \(S0 S1 S2 : Session)
   (p0 : < S0 -o S1 >)
   (p1 : < S1 -o S2 >)->
   proc(c : S0 -o S2)
     c{~i0,i2}
     new [i : S0 -o S1, [i0,~i1]]
     new [j : S1 -o S2, [i1,~i2]]
     ( @p0(i)
     | @p1(j))

It remains that we need to implement some basic inference first.

Any comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant