Papers
Topics
Authors
Recent
Search
2000 character limit reached

Interaction Nets: A Graph Rewriting Framework

Updated 7 February 2026
  • Interaction nets are a graph rewriting formalism defined by agents with a principal port and auxiliary ports, using local rewrite rules to update only the interacting parts.
  • They support efficient in-place rewriting and parallel execution, with strong confluence ensuring that non-overlapping reductions lead to unique normal forms.
  • Advanced features include nested patterns, generic and variadic rules, and robust algebraic models that underpin practical implementations and higher-order language compilation.

Interaction nets are a local, strongly confluent graph rewriting formalism introduced by Yves Lafont in 1990 as an abstraction of computation based on agents interacting via explicitly structured ports and rewrite rules. They serve as a universal model for graph reduction, functional evaluation, and as a compilation target for higher-order and pattern-rich programming languages, with a minimal and rigorous algebraic semantics. Their inherent support for parallelism, confluence, in-place computation, and extensibility makes them central to both the theoretical and practical study of computation as interaction.

1. Formalism: Agents, Nets, and Rewriting

An interaction net system is defined by a finite signature Σ\Sigma of agent symbols, each with fixed arity ar(α)Nar(\alpha)\in\mathbb{N}. Each occurrence of αΣ\alpha\in\Sigma in a net forms an agent with one principal port and ar(α)ar(\alpha) auxiliary ports. Nets are finite undirected graphs whose vertices are agents; edges—wires—connect pairs of ports, and any unconnected port is a free port, forming the net's interface (Salikhmetov, 2013, Salikhmetov, 2017, Huber et al., 26 Mar 2025).

Reduction is governed by interaction rules: for each unordered pair {α,β}\{\alpha,\beta\} (at most one per pair), a rule

α(x1,,xn),β(y1,,ym)N\langle \alpha(x_1,\ldots,x_n),\,\beta(y_1,\ldots,y_m)\rangle \to N

replaces the active pair (two agents joined at their principal ports) with a net NN whose interface maps bijectively onto the auxiliary ports of both agents. The rewrite only affects the agents involved and their local wiring; all other structure is preserved.

Key properties:

  • Locality: Only the directly interacting pair and local wires are rewritten; surrounding structure is untouched.
  • Strong confluence: For non-overlapping redexes, reduction steps commute (permutation equivalence). If two rules apply in parallel, any reduction sequence leads deterministically (up to isomorphism) to the same normal form.
  • Linearity: Each rewrite is O(1)O(1) in affected nodes.
  • Expressiveness: The interaction combinators system (a minimal signature) is Turing-complete (Salikhmetov, 2017).

2. Operational Semantics and Calculi

Multiple textual calculi—such as the interaction calculus and the weak interaction calculus—capture the dynamics of nets as configurations:

C=v1=w1,...,vk=wkC = \langle v_1=w_1, ..., v_k=w_k \rangle

with names occurring at most twice (or zero times) per configuration. Reduction is given by three rules (Salikhmetov, 2017):

  • Interaction: Applies an interaction rule when both sides are principal ports of agents.
  • Indirection: Substitutes names when equations mix agent terms and names.
  • Delegation: Propagates annotations such as neededness (see Section 4).

Cost models and practical implementations (pointer machines, data-structures, LL0 imperative language) precisely track agent creation, port wiring, and worklist scheduling (Hassan et al., 2015). Correctness, confluence, and efficiency can be reasoned about at both equation and memory/allocation levels.

3. Advanced Extensions: Pattern Matching, Recursion, and Genericity

Nested Patterns and Higher-Order Rules

Classical interaction nets restrict each rule to two directly connected agents, making nested pattern matching cumbersome and requiring auxiliary nodes/rules (Hassan et al., 2010). Enhanced systems (INP) allow nested active pairs: rules can match patterns deeper in the net topology, provided constraints—sequentiality and subnet-freeness—ensure confluence. Compilation algorithms destructure nested rules incrementally into ordinary sets.

Generic and Variadic Interaction Rules

To support higher-order computations (e.g., duplication, deletion, monadic effects), generic rules extend the calculus:

  • Fixed-arity generic agents act as meta-variables over the signature, matching any agent of the same arity.
  • Variadic rules use meta-notation for a variable number of auxiliary ports, supporting agents such as ϵ\epsilon (deletion) or δ\delta (duplication) by matching and expanding arities at compile time.
  • Two constraints—Default Priority Constraint and Generic Rule Constraint—guarantee uniform confluence even with genericity (Jiresch, 2012).

Recursion and Iterators

Functional recursion (iterators, folds) is encoded by dedicating new agents per program instance, with interaction schemes for constructor and recursive cases. Mechanized translations from λ\lambda-calculus with recursive types extend the signature and rule set at compile time, maintaining a precise correspondence between program semantics and net reduction (0910.3321).

4. Cost Models, Parallelism, and In-Place Computation

Parallel (Needed) Reduction

Historically, canonical weak reduction to interface normal form has O(d)O(d) cost per step (where dd is the term depth), due to traversals under abstractions. A key refinement is needed reduction (Salikhmetov, 2017):

  • Explicitly decorates needed agents/equations with a “!”.
  • Delegation rules propagate neededness upwards.
  • Worklists only carry needed redexes or agents; scheduling is any-order or parallel.
  • Each reduction (interaction, indirection, delegation) is O(1)O(1) per step. All needed redexes can be contracted in parallel; no root/node or free-port discipline is necessary.

In-Place and Memory-Efficient Rewriting

Interaction nets support in-place rewriting: active pairs can reuse the memory cells of the old nodes, as long as the right-hand side net is no larger (in agent count) than the left (Mackie et al., 2016). The precise reuse is annotated via *L/*R marks on rules, supported by an optimal matching algorithm over subterms of the rule right-hand side. This property is critical for resource-constrained or embedded systems and gives formal guarantees of O(1) additional memory.

Rule RHS size Memory reuse policy Additional allocation
2 agents Reuse both LHS agents none
<2 agents Reuse 1 or both LHS none or discard one
>2 agents Reuse, but must allocate O(# new agents)

5. Typing, Algebraic Models, and Semantic Foundations

Typing and Compilation

Lafont’s original type system assigns both a value sort and a polarity (++/-) to each agent port. The well-typedness of nets is structurally enforced and preserved under reduction. Advanced static embeddings (e.g., in OCaml with GADTs) provide zero-cost compile-time type and arity checks, guarantee exhaustiveness of the reduction function, and enable safe parallel execution where only compatible agents can interact (Huber et al., 26 Mar 2025).

Algebraic and Categorical Models

Interaction nets can be described algebraically as partial permutations/gluings, with reduction via the execution formula of Geometry of Interaction (GoI); AC-nets collapse to interaction nets via a canonical construction (Falco, 2010). The GoI semantics algebraically weights paths through the net, providing complete characterizations of persistence, normalization, and invariants in Differential Interaction Nets and beyond (0804.1435).

Comparison with Bigraphs

Bigraphical nets (“binets”) generalize interaction nets by adding place graphs (nesting hierarchy) to the existing link graphs (wiring). This hierarchical extension supports natural encodings of pattern-rich calculi and enables finer-grained concurrency. However, binets trade some of the strong global confluence of interaction nets for greater expressivity and direct modeling of lexical scope and nested computation (Fernández et al., 2013).

6. Implementation, Parallel and Hardware-Oriented Realization

Efficient implementation models allocate agent nodes as records (heap or array-indexed), with ports as pointers or indices and an explicit active equation stack/worklist (Hassan et al., 2015). Optimization strategies include:

  • Directed and in-place encodings: minimize heap allocation, especially for actively reused agent pairs.
  • Worklists and fine-grained parallelism: as redexes do not overlap, parallel execution requires minimal synchronization. On hardware (multicore, GPU), parallelism is exploited by evaluating many independent active pairs simultaneously.
  • GPU realization: Net structures are stored as device arrays; kernels execute interaction and communication steps in parallel. Challenges include efficiently handling irregular graph structures, dynamic output sizes, and variable available parallelism (Jiresch, 2014).
Strategy Efficient for (Nets) Overhead
Pointer-based General O(1) redex, O(d) if indirection
Array-based (GPU) Highly parallel Sort/merge needed for communication
In-place, annotated Memory-limited Static/compile-time computation of reuse policy

7. Applications, Expressive Power, and Research Directions

Interaction nets provide a minimal yet universal substrate for:

  • Pure λ\lambda-calculus and combinatory logic (token-passing, optimal reduction)
  • Functional programming languages with pattern matching, iteration, and recursion (0910.3321)
  • Models of digital physics emphasizing asynchrony, clockless and local computation (Salikhmetov, 2017)
  • Algebraic and logical proof systems, including extensions for non-deterministic and differential computation (0804.1435)
  • Visual and graphical programming paradigms (Huber et al., 26 Mar 2025)

Key ongoing research and engineering challenges include extending the calculus for richer patterns and higher-order features (genericity, variadic rules), automating the translation and verification of rules to guarantee confluence and efficiency, scaling parallel implementations to hardware with irregular workloads, and further integrating categorical/algebraic semantics for foundations and correctness.

Topic to Video (Beta)

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Interaction Nets.