HOME

TheInfoList



OR:

Interaction nets are a graphical
model of computation In computer science, and more specifically in computability theory and computational complexity theory, a model of computation is a model which describes how an output of a mathematical function is computed given an input. A model describes how ...
devised by Yves Lafont in 1990 as a generalisation of the proof structures of
linear logic Linear logic is a substructural logic proposed by Jean-Yves Girard as a refinement of classical and intuitionistic logic, joining the dualities of the former with many of the constructive properties of the latter. Although the logic has also b ...
. 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 and optimal, in Lévy's sense, Lambdascope.


Definitions

Interactions nets are graph-like structures consisting of ''agents'' and ''edges''. An agent of type \alpha and with ''arity'' \text(\alpha) = n \ge 0 has one ''principal port'' and n ''auxiliary ports''. Any port can be connected to at most one edge. Ports that are not connected to any edge are called ''free ports''. Free ports together form the ''interface'' of an interaction net. All agent types belong to a set \Sigma called ''signature''. An interaction net that consists solely of edges is called a ''wiring'' and usually denoted as \omega. A ''tree'' t with its ''root'' x is inductively defined either as an edge x, or as an agent \alpha with its free principal port x and its auxiliary ports x_i connected to the roots of other trees t_i. 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''. For active pairs one can introduce ''interaction rules'' which describe how the active pair rewrites to another interaction net. An interaction net with no active pairs is said to be in ''normal form''. A signature \Sigma (with \text: \Sigma \rightarrow \mathbb defined on it) along with a set of interaction rules defined for agents \alpha \in \Sigma together constitute an ''interaction system''.


Interaction calculus

Textual representation of interaction nets is called the ''interaction calculus'' and can be seen as a programming language. Inductively defined trees correspond to ''terms'' t ::= \alpha(t_1, \dots, t_n)\ , \ x in the interaction calculus, where x is called a ''name''. Any interaction net N can be redrawn using the previously defined wiring and tree primitives as follows: which in the interaction calculus corresponds to a ''configuration'' c \equiv \langle t_1, \dots, t_m \ , \ v_1 = w_1, \dots, v_n = w_n \rangle, where t_i, v_i, and w_i are arbitrary terms. The ordered sequence t_1,...,t_m in the left-hand side is called an ''interface'', while the right-hand side contains an unordered multiset of ''equations'' v_i = w_i. Wiring \omega translates to names, and each name has to occur exactly twice in a configuration. Just like in the \lambda-calculus, the interaction calculus has the notions of ''\alpha-conversion'' and ''substitution'' naturally defined on configurations. Specifically, both occurrences of any name can be replaced with a new name if the latter does not occur in a given configuration. Configurations are considered equivalent up to \alpha-conversion. In turn, substitution t := u/math> is the result of replacing the name x in a term t with another term u if x has exactly one occurrence in the term t. Any interaction rule can be graphically represented as follows: where \alpha, \beta \in \Sigma, and the interaction net N on the right-hand side is redrawn using the wiring and tree primitives in order to translate into the interaction calculus as \alpha _1,\dots, v_m\bowtie \beta _1,\dots, w_n/math> using Lafont's notation. The interaction calculus defines reduction on configurations in more details than seen from graph rewriting defined on interaction nets. Namely, if \alpha _1,\dots, v_m\bowtie \beta _1,\dots,w_n/math>, the following reduction: \langle \vec t\ , \ \alpha(t_1,\dots,t_m) = \beta(u_1,\dots,u_n), \Delta\rangle \rightarrow \langle \vec t\ , \ t_1 = v_1,\dots, t_m = v_m, u_1 = w_1,\dots, u_n = w_n, \Delta\rangle is called ''interaction''. When one of equations has the form of x = u, ''indirection'' can be applied resulting in substitution of the other occurrence of the name x in some term t: \langle \dots t \dots \ , \ x = u, \Delta\rangle \rightarrow \langle \dots t := u\dots \ , \ \Delta\rangle or \langle \vec t\ , \ x = u, t = w, \Delta\rangle \rightarrow \langle \vec t\ , \ t := u= w, \Delta \rangle. An equation x = t is called a ''deadlock'' if x has occurrence in term t. Generally only deadlock-free interaction nets are considered. Together, interaction and indirection define the reduction relation on configurations. The fact that configuration c reduces to its ''normal form'' c' with no equations left is denoted as c \downarrow c'.


Properties

Interaction nets benefit from the following properties: * locality (only active pairs can be rewritten); * linearity (each interaction rule can be applied in constant time); * strong confluence also known as one-step diamond property (if c \rightarrow c_1 and c \rightarrow c_2, then c_1 \rightarrow c' and c_2 \rightarrow c' for some c'). These properties together allow massive parallelism.


Interaction combinators

One of the simplest interaction systems that can simulate any other interaction system is that of ''interaction combinators''. Its signature is \Sigma = \ with \text(\epsilon) = 0 and \text(\delta) = \text(\gamma) = 2. Interaction rules for these agents are: * \epsilon \bowtie \alpha epsilon,\dots, \epsilon/math> called ''erasing''; * \delta alpha(x_1,\dots, x_n), \alpha(y_1,\dots, y_n)\bowtie \alpha delta(x_1, y_1),\dots, \delta(x_n, y_n)/math> called ''duplication''; * \delta
, y The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
\bowtie \delta
, y The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
/math> and \gamma
, y The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
\bowtie \gamma
, x The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/math> called ''annihilation''. 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 &\langle \varnothing\ , \ \delta(\epsilon, x) = \gamma(x, \epsilon)\rangle \rightarrow \\ &\langle \varnothing\ , \ \epsilon = \gamma(x_1, x_2),\ x = \gamma(y_1, y_2),\ x = \delta(x_1, y_1),\ \epsilon = \delta(x_2, y_2)\rangle \rightarrow^* \\ &\langle \varnothing\ , \ x_1 = \epsilon,\ x_2 = \epsilon,\ x = \gamma(y_1, y_2),\ x = \delta(x_1, y_1),\ x_2 = \epsilon,\ y_2 = \epsilon\rangle \rightarrow^* \\ &\langle \varnothing\ , \ \delta(\epsilon, x) = \gamma(x, \epsilon)\rangle \rightarrow \dots \end


Non-deterministic extension

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 \text with two principal ports and the following interaction rules: 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 \text boolean operation that returns true if any of its arguments is true, independently of the computation taking place in the other arguments.


See also

* Geometry of interaction *
Graph rewriting In computer science, graph transformation, or graph rewriting, concerns the technique of creating a new graph out of an original graph algorithmically. It has numerous applications, ranging from software engineering ( software construction and also ...
* Lambda calculus * Linear graph grammar *
Linear logic Linear logic is a substructural logic proposed by Jean-Yves Girard as a refinement of classical and intuitionistic logic, joining the dualities of the former with many of the constructive properties of the latter. Although the logic has also b ...
*
Proof net In proof theory, proof nets are a geometrical method of representing proofs that eliminates two forms of ''bureaucracy'' that differentiate proofs: (A) irrelevant syntactical features of regular proof calculi, and (B) the order of rules applied in a ...


References


Further reading

* *


External links

* * * * * * {{cite web , last=Salikhmetov, first=Anton , title=Macro Lambda Calculus, url=https://codedot.github.io/lambda/ Models of computation