Interaction nets are a graphical model of computation devised by French mathematician Yves Lafont in 1990[1] as a generalisation of the proof structures of linear logic. An interaction net system is specified by a set of agent types and a set of interaction rules. Interaction nets are an inherently distributed model of computation in the sense that computations can take place simultaneously in many parts of an interaction net, and no synchronisation is needed. The latter is guaranteed by the strong confluence property of reduction in this model of computation. Thus interaction nets provide a natural language for massive parallelism. Interaction nets are at the heart of many implementations of the lambda calculus, such as efficient closed reduction[2] and optimal, in Lévy's sense, Lambdascope.[3]
Interactions nets are graph-like structures consisting of agents and edges.
An agent of type
\alpha
ar(\alpha)=n\ge0
n
\Sigma
An interaction net that consists solely of edges is called a wiring and usually denoted as
\omega
t
x
x
\alpha
x
xi
ti
Graphically, the primitive structures of interaction nets can be represented as follows:
When two agents are connected to each other with their principal ports, they form an active pair. Foractive pairs one can introduce interaction rules which describe how the active pair rewrites to another interactionnet. An interaction net with no active pairs is said to be in normal form. A signature
\Sigma
ar:\Sigma → N
\alpha\in\Sigma
Textual representation of interaction nets is called the interaction calculus[4] and can be seen as a programming language.
Inductively defined trees correspond to terms
t::=\alpha(t1,...,tn) | x
x
Any interaction net
N
which in the interaction calculus corresponds to a configuration
c\equiv\langlet1,...,tm | v1=w1,...,vn=wn\rangle
where
ti
vi
wi
t1,...,tm
vi=wi
\omega
Just like in the
λ
\alpha
\alpha
t[x:=u]
x
t
u
x
t
Any interaction rule can be graphically represented as follows:
where
\alpha,\beta\in\Sigma
N
\alpha[v1,...,vm]\bowtie\beta[w1,...,wn]
The interaction calculus defines reduction on configurations in more details than seen from graphrewriting defined on interaction nets. Namely, if
\alpha[v1,...,vm]\bowtie\beta[w1,...,wn]
\langle\vect | \alpha(t1,...,tm)=\beta(u1,...,un),\Delta\rangle → \langle\vect | t1=v1,...,tm=vm,u1=w1,...,un=wn,\Delta\rangle
is called interaction. When one of equations has the form of
x=u
x
t
\langle...t... | x=u,\Delta\rangle → \langle...t[x:=u]... | \Delta\rangle
\langle\vect | x=u,t=w,\Delta\rangle → \langle\vect | t[x:=u]=w,\Delta\rangle
An equation
x=t
x
t
c
c'
c\downarrowc'
Interaction nets benefit from the following properties:
c → c1
c → c2
c1 → c'
c2 → c'
c'
These properties together allow massive parallelism.
One of the simplest interaction systems that can simulate any other interaction system is that of interaction combinators.[5] Its signature is
\Sigma=\{\epsilon,\delta,\gamma\}
ar(\epsilon)=0
ar(\delta)=ar(\gamma)=2
\epsilon\bowtie\alpha[\epsilon,...,\epsilon]
\delta[\alpha(x1,...,xn),\alpha(y1,...,yn)]\bowtie\alpha[\delta(x1,y1),...,\delta(xn,yn)]
\delta[x,y]\bowtie\delta[x,y]
\gamma[x,y]\bowtie\gamma[y,x]
Graphically, the erasing and duplication rules can be represented as follows:
with an example of a non-terminating interaction net that reduces to itself. Its infinite reduction sequence starting from the corresponding configuration in the interaction calculus is as follows:
\begin{align} &\langle\varnothing | \delta(\epsilon,x)=\gamma(x,\epsilon)\rangle → \\ &\langle\varnothing | \epsilon=\gamma(x1,x2), x=\gamma(y1,y2), x=\delta(x1,y1), \epsilon=\delta(x2,y2)\rangle → *\\ &\langle\varnothing | x1=\epsilon, x2=\epsilon, x=\gamma(y1,y2), x=\delta(x1,y1), x2=\epsilon, y2=\epsilon\rangle → *\\ &\langle\varnothing | \delta(\epsilon,x)=\gamma(x,\epsilon)\rangle → ... \end{align}
Interaction nets are essentially deterministic and cannot model non-deterministic computations directly. In order to express non-deterministic choice, interaction nets need to be extended. In fact, it is sufficient to introduce just one agent
amb
This distinguished agent represents ambiguous choice and can be used to simulate any other agent with arbitrary number of principal ports. For instance, it allows to define a
ParallelOr