Interaction nets: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Codedot (talk | contribs)
Codedot (talk | contribs)
Line 109: Line 109:
* {{cite journal|last1=Fernández|first1=Maribel|last2=Khalil|first2=Lionel|title=Interaction Nets with McCarthy's Amb: Properties and Applications|journal=Nordic Journal of Computing|date=2003|volume=10|issue=2|pages=134-162|url=https://www.researchgate.net/publication/220369522_Interaction_Nets_with_McCarthy%27s_amb}}
* {{cite journal|last1=Fernández|first1=Maribel|last2=Khalil|first2=Lionel|title=Interaction Nets with McCarthy's Amb: Properties and Applications|journal=Nordic Journal of Computing|date=2003|volume=10|issue=2|pages=134-162|url=https://www.researchgate.net/publication/220369522_Interaction_Nets_with_McCarthy%27s_amb}}
* {{cite journal|last1=Béchet|first1=Denis|last2=Lippi|first2=Sylvain|title=Hard combinators|journal=Electronic Notes in Theoretical Computer Science|date=2008|volume=203|issue=1|pages=31-48|doi=10.1016/j.entcs.2008.03.032}}
* {{cite journal|last1=Béchet|first1=Denis|last2=Lippi|first2=Sylvain|title=Hard combinators|journal=Electronic Notes in Theoretical Computer Science|date=2008|volume=203|issue=1|pages=31-48|doi=10.1016/j.entcs.2008.03.032}}
* {{cite journal|first=Ian|last=Mackie|title=An Interaction Net Implementation of Closed Reduction|pages=43-59|date=2008|doi=10.1007/978-3-642-24452-0_3|journal=Implementation and Application of Functional Languages: 20th International Symposium}}
* {{cite book|first=Maribel|last=Fernández|chapter=Interaction-Based Models of Computation|title=Models of Computation: An Introduction to Computability Theory|publisher=Springer Science & Business Media|pages=107–130|date=2009|isbn=9781848824348}}
* {{cite book|first=Maribel|last=Fernández|chapter=Interaction-Based Models of Computation|title=Models of Computation: An Introduction to Computability Theory|publisher=Springer Science & Business Media|pages=107–130|date=2009|isbn=9781848824348}}
* {{cite journal|first1=Vincent|last1=van Oostrom|first2=Kees-Jan|last2=van de Looij|first3=Marijn |last3=Zwitserlood|title=Lambdascope: Another optimal implementation of the lambda-calculus|date=2010|url=http://www.phil.uu.nl/~oostrom/publication/pdf/lambdascope.pdf}}


== External links ==
== External links ==

Revision as of 07:27, 2 April 2017

Interaction nets are a low level graphical computation paradigm first proposed by Yves Lafont and based on Jean-Yves Girard's proof nets for linear logic. An interaction net system comprises: a set of agents, each with one principal port and zero or more auxiliary ports; a set of rules between agents (there is at most one rule for every pair of agents); and a net on which the rules are to be applied. Compared to traditional term syntax and linear graph grammars, interaction nets enforce linearity -- each resource is used exactly once --, from which we can derive strong confluence. Thus, they provide a natural language for massive parallelism.

They are also at the heart of the efficient and optimal, in Levy's sense, evaluators for lambda calculus available today.

Definitions

Interactions nets are graph-like structures consisting of agents and edges.

An agent of type and with arity has one principal port and 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 called signature.

An interaction net that consists solely of edges is called a wiring and usually denoted as . A tree with its root is inductively defined either as an edge , or as an agent with its free principal port and its auxiliary ports connected to the roots of other trees .

Graphically, the primitive structures of interaction nets can be represented as follows:

Primitives of Interaction Nets

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 (with defined on it) along with a set of interaction rules defined for agents 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 in the interaction calculus, where is called a name.

Any interaction net can be redrawn using the previously defined wiring and tree primitives as follows:

Interaction Net as Configuration

which in the interaction calculus corresponds to a configuration

,

where , , and are arbitrary terms. The ordered sequence in the left-hand side is called an interface, while the right-hand side contains an unordered multiset of equations . Wiring translates to names, and each name has to occur exactly twice in a configuration.

Just like in the -calculus, the interaction calculus has the notions of -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, and configurations are considered equivalent up to -conversion. In turn, substitution is the result of replacing the name in a term with another term if has exactly one occurrence in the term .

Any interaction rule can be graphically represented as follows:

Interaction Rule

where , and the interaction net on the right-hand side is redrawn using the wiring and tree primitives in order to translate into the interaction calculus as 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 , the following reduction:

is called interaction. When one of equations has the form of , indirection can be applied resulting in substitution of the other occurrence of the name in some term :

or .

An equation is called a deadlock if has occurrence in term . Generally only deadlock-free interaction nets are considered. Together, interaction and indirection define the reduction relation on configurations. The fact that configuration reduces to its normal form with no equations left is denoted as .

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 and , then and for some ).

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 with and . Interaction rules for these agents are:

  • called erasing;
  • called duplication;
  • and called annihilation.

Graphically, the erasing and duplication rules can be represented as follows:

Examples of Interaction Nets

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:

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 with two principal ports and the following interaction rules:

Non-deterministic Agent

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 boolean operation that returns true if any of its arguments is true, independently of the computation taking place in the other argument.

Hard interaction systems

References

  • Lafont, Yves (1990). "Interaction nets". Proceedings of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM: 95–108. doi:10.1145/96709.96718.
  • Lafont, Yves (1997). "Interaction Combinators". Information and Computation. 137 (1). Academic Press, Inc.: 69–101. doi:10.1006/inco.1997.2643.
  • Asperti, Andrea; Guerrini, Stefano (1998). The Optimal Implementation of Functional Programming Languages. Cambridge Tracts in Theoretical Computer Science. Vol. 45. Cambridge University Press. ISBN 9780521621120.
  • Fernández, Maribel; Mackie, Ian (1999). "A calculus for interaction nets". Principles and Practice of Declarative Programming. Springer: 170–187. doi:10.1007/10704567.
  • Fernández, Maribel; Khalil, Lionel (2003). "Interaction Nets with McCarthy's Amb: Properties and Applications". Nordic Journal of Computing. 10 (2): 134–162.
  • Béchet, Denis; Lippi, Sylvain (2008). "Hard combinators". Electronic Notes in Theoretical Computer Science. 203 (1): 31–48. doi:10.1016/j.entcs.2008.03.032.
  • Mackie, Ian (2008). "An Interaction Net Implementation of Closed Reduction". Implementation and Application of Functional Languages: 20th International Symposium: 43–59. doi:10.1007/978-3-642-24452-0_3.
  • Fernández, Maribel (2009). "Interaction-Based Models of Computation". Models of Computation: An Introduction to Computability Theory. Springer Science & Business Media. pp. 107–130. ISBN 9781848824348.
  • van Oostrom, Vincent; van de Looij, Kees-Jan; Zwitserlood, Marijn (2010). "Lambdascope: Another optimal implementation of the lambda-calculus" (PDF). {{cite journal}}: Cite journal requires |journal= (help)

External links