ArticleslgStudy

computer science

Interaction nets

Interaction nets is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Interaction nets rather than just read about it. In short: Interaction nets are a graphical model of computation devised by French mathematician Yves Lafont in 1989 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 — main illustration
Interaction nets — illustration

Key takeaways

  • Interaction nets belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Interaction nets to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Interaction nets from memory before moving on to harder problems.

Reference excerpt

Interaction nets are a graphical model of computation devised by French mathematician Yves Lafont in 1989 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 used in many implementations of the lambda calculus, such as efficient closed reduction and optimal, in Lévy's sense, Lambdascope.

Definitions Interaction nets are graph-like structures consisting of agents and edges. An agent of type α and with arity ar(α)=n≥0 has one principal port and n auxiliary ports. Any port can be connected to at most one edge. Any edge is connected to exactly two ports. 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 t with its root x is inductively defined either as an edge x, or as an agent α with its free principal port x and its auxiliary ports xi connected to the roots of other trees 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. 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 ar:Σ→ℕ 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 t::=α(t1,…,tn) | 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≡⟨t1,…,tm | v1=w1,…,vn=wn⟩, where ti, vi, and wi are arbitrary terms. The ordered sequence t1,...,tm in the left-hand side is called an interface, while the right-hand side contains an unordered multiset of equations vi=wi. 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. Configurations are considered equivalent up to α-conversion. In turn, substitution t[x:=u] 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 α,β∈Σ, 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 α[v1,…,vm]⋈β[w1,…,wn] 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 α[v1,…,vm]⋈β[w1,…,wn], the following reduction: ⟨t→ | α(t1,…,tm)=β(u1,…,un),Δ⟩→⟨t→ | t1=v1,…,tm=vm,u1=w1,…,un=wn,Δ⟩ 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: ⟨…t… | x=u,Δ⟩→⟨…t[x:=u]… | Δ⟩ or ⟨t→ | x=u,t=w,Δ⟩→⟨t→ | t[x:=u]=w,Δ⟩. 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↓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→c1 and c→c2, then c1→c′ and c2→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 Σ={ϵ,δ,γ} with ar(ϵ)=0 and ar(δ)=ar(γ)=2. Agent ϵ can be seen as an eraser, deleting resources; δ as a duplicator; γ as a constructor, taking two resources and returning some third one- it can represent anything from binary operations, as addition and multiplication, up to general function application in the lambda calculus, taking terms f and x to produce fx. Interaction rules for these agents are:

ϵ⋈α[ϵ,…,ϵ] called erasing; δ[α(x1,…,xn),α(y1,…,yn)]⋈α[δ(x1,y1),…,δ(xn,yn)] called duplication; δ[x,y]⋈δ[x,y] and γ[x,y]⋈γ[y,x] 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: ⟨∅ | δ(ϵ,x)=γ(x,ϵ)⟩→⟨∅ | ϵ=γ(x1,x2), x=γ(y1,y2), x=δ(x1,y1), ϵ=δ(x2,y2)⟩→∗⟨∅ | x1=ϵ, x2=ϵ, x=γ(y1,y2), x=δ(x1,y1), x2=ϵ, y2=ϵ⟩→∗⟨∅ | δ(ϵ,x)=γ(x,ϵ)⟩→…

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

… excerpt ends here. Continue reading the full article.

Illustrations

Interaction nets illustration
Interaction nets illustration
Interaction nets illustration
Interaction nets illustration

Worked examples

Example 1 — a first encounter with Interaction nets

Start with the simplest possible case. Write down what Interaction nets claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Interaction nets before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Interaction nets ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Interaction nets

In research
Interaction nets appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Interaction nets in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Interaction nets is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph rewriting, Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Interaction nets outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Interaction nets” →

How to study Interaction nets in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Interaction nets means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Interaction nets out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Interaction nets in simple terms?

Interaction nets are a graphical model of computation devised by French mathematician Yves Lafont in 1989 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.

Why does Interaction nets matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Interaction nets?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Interaction nets.

Tags

  • Graph rewriting
  • Models of computation

Keep exploring