Lectures onType Theory
Chapter 41
Chapter 41Optional

Interaction Nets and Interaction Combinators

Prerequisites. Direct starred prerequisites: Chapter 40. No later core chapter depends on this route.

Forget the formula labels on a proof net and retain a finite graph of nodes and connection points. Each node has one distinguished connection point. A local rewrite is triggered only when the distinguished points of two nodes meet. Because a distinguished point has at most one mate, two different redexes cannot share a node.

An interaction net is such a finite port graph, with one distinguished port per node and rewrites triggered where two distinguished ports meet.

The bridge from chapter 40 is literal at the local level. Regard the tensor and par links as binary agents whose formula roots are principal ports: a multiplicative proof-net cut is then the active pair , a pair of agents joined at their distinguished ports, and its two smaller cuts are the two boundary reconnections joining the four exposed ports. The proof-net atomic axiom–cut splice is the corresponding nullary wiring case. Interaction nets retain this principal-port mechanism while discarding the logical formula labels.

Agents, ports, and interfaces

An agent symbol α has an arity ar(α). An occurrence of α has one distinguished principal port, at which a rewrite may be triggered, and ar(α) ordered auxiliary ports, which form the rewrite boundary. The arity counts auxiliary ports, not all ports. In diagrams a triangle points toward the principal port: Mathematical diagramDiagram This picture has arity two. The order 1,2 is data even though wires may be drawn with different bends.

Definition 41.1 — Net and interface

Fix a signature Σ with arity map ar:ΣN. A net is a finite set of agent occurrences together with a finite wiring. A wiring component is an undirected interval whose ends may attach to agent ports or remain free; a component may instead be a closed circle with no agent port. Every agent port is incident to at most one wiring component. Thus a net may contain a free wire joining two boundary ends, or a closed wire, even when it contains no agent. The interface is an ordered list of all free wire ends; that order is a list of ports, not the ordered resource context Δ of chapter 38.

A wire has no direction and no value moving along it. Its endpoints only record incidence. Ordering the free ports lets a net denote a component with a stable external calling convention. Rewriting may replace its interior, but not reorder, duplicate, or discard that interface.

Definition 41.2 — Active pair

Two agent occurrences form an active pair when a wire joins their principal ports. We write αβ for its local shape. A principal–auxiliary wire and an auxiliary–auxiliary wire are not redexes.

Mathematical diagramDiagram

An active pair αβ with ordered boundary (x1,x2,y1). The thick principal wire is internal to the redex.

Exercise 41.1

★☆☆ Draw a net with one binary agent α, one unary agent β, and exactly three free ports. Give the interface two different orders. Explain why the underlying graph is the same net component but the two ordered interfaces describe different external conventions. Then connect the two principal ports and count the free ports again.

Local rules and reduction

A rule has a left-hand active pair and a right-hand net with the same ordered boundary. If α has arity m and β arity n, removing the active pair exposes m+n auxiliary wires. The right-hand side must expose exactly those m+n boundary ports, in that order.

Definition 41.3 — Interaction system

An interaction system consists of a signature and a partial function assigning a rule to each unordered symbol pair {α,β}. Thus there is at most one rule for αβ. Rules preserve their ordered boundary and may create or delete only internal agents and wires.

Definition 41.4 — Reduction

If a net N contains an active pair matching the left side of a rule, replace that pair by a fresh copy of the right side and reconnect corresponding boundary ports. The result is written NIM. A net with no active pair for which a rule is defined is in normal form.

These are Lafont’s interaction-net ingredients, with the interface made explicit for the proofs below [Laf90].

The two restrictions do different work. Boundary preservation makes a rule compositional: the context cannot detect which internal representation was used. Uniqueness for a symbol pair prevents two rules from competing for the same active pair.

Lemma 41.5 — Distinct redexes are disjoint

Two distinct active pairs in one net share no agent occurrence.

Proof of Lemma 41.5 — Distinct redexes are disjoint

Proof. An agent has exactly one principal port. If an occurrence belonged to two active pairs, that one port would be matched to the principal ports of two different agents. A partial matching gives it at most one mate. Hence the two active pairs would be the same pair. ◻

A complete arithmetic system

Before considering lambda terms, we calculate in a system small enough to inspect completely. Unary naturals have constructors Z of arity zero and S of arity one. An addition agent A has arity two. Its auxiliary ports are the second addend y and result r; its principal port consumes the first addend.

Definition 41.6 — Unary addition rules

The addition system has the two rules A(y,r)ZIy=r, A(y,r)S(x)Ir=S(s) with A(y,s)x. Here y=r means that the two exposed wires are spliced. The second rule creates one successor on the output and recurses on the predecessor x. The notation displays boundary names only; it does not orient the wires.

Write n for a chain of n successors ending in Z.

Proposition 41.7 — Addition calculates

For all m,nN, the closed configuration A(n,r)m reduces in exactly m+1 interaction steps to an output chain r=m+n.

Proof of Proposition 41.7 — Addition calculates

Proof. Induct on m. For m=0, the AZ rule splices the second addend directly to r, in one step. For m+1, the AS rule creates one output S and leaves A(n,s)m behind it. The induction hypothesis takes m+1 further steps, so the total is m+2, and the output is S(m+n)=m+1+n. ◻

Exercise 41.2

★★☆ Give the complete reduction of A(2,r)3. At every step list the ordered boundary inherited by the replaced active pair. Verify both the output and the exact step count of proposition 41.7.

The one-step diamond

Ordinary local confluence permits each branch to take several steps before joining. Interaction systems satisfy a sharper property.

Definition 41.8 — Strong confluence

Write NM for a port-preserving graph isomorphism fixing the interface. A relation is strongly confluent when, whenever NM1 and NM2, either M1M2, or there is a net P with M1P and M2P, up to consistent renaming of fresh internal ports and agents.

Proof of Theorem 41.9 — Strong confluence of interaction systems

Proof. Consider reductions of N at redexes r1 and r2. If the redexes coincide, the unordered pair of symbols determines at most one rule. Fresh names may differ, but the two contracta are isomorphic.

If the redexes are distinct, lemma 41.5 says that their agent occurrences are disjoint. Contracting r1 changes only its local interior and reconnects the same boundary ports, so r2 remains an active pair. Apply the same argument after the exact renaming r1r2: r1 remains after contracting r2. Contract the surviving redex on each branch. Both results replace the same two disjoint subgraphs by fresh copies of the same two right-hand sides, and are therefore isomorphic after renaming fresh internal data. ◻

Mathematical diagramDiagram

The nontrivial one-step diamond. Brackets record the redexes still present, not a semantic interpretation.

The qualification “modulo isomorphism” matters whenever a rule creates fresh internal names.

Corollary 41.10 — Confluence

If NIM1 and NIM2, then there are P1P2 with M1IP1 and M2IP2. Consequently a normal form, when it exists, is unique up to isomorphism.

Proof of Corollary 41.10 — Confluence

Proof. Pass to interface-fixing isomorphism classes of nets. The isomorphism branch of definition 41.8 becomes equality, and the other branch is a literal one-step diamond. Induct on the length of the first reduction: push its first step across the first step of the other reduction, transport the remaining reduction along the resulting isomorphism, and apply the induction hypothesis to the shorter strip. Lifting the join from isomorphism classes gives representatives P1P2. If both endpoints are normal, their joining reductions are empty, so the endpoints are isomorphic. ◻

Confluence is not termination. Add a nullary symbol Ω and the rule ΩΩIΩΩ, using a fresh copy of the same two-agent active pair. The resulting system remains strongly confluent but admits an infinite reduction.

Exercise 41.3

★★☆ Construct a net containing two disjoint active pairs, one AS and one AZ. Draw both orders of contraction and give the explicit port correspondence between the two final nets. Identify the exact line of theorem 41.9’s proof that would fail if one symbol pair had two different rules.

Exercise 41.4

★☆☆ Prove that the Ω extension is strongly confluent and not strongly normalizing. Explain why this is not a counterexample to corollary 41.10 or to uniqueness of normal forms.

Parallel developments

A finite set of initially active pairs may be contracted in any order because those pairs are disjoint.

Definition 41.11 — Development

When one active pair is contracted, every other initially present active pair survives as the same two occurrences with the same principal wire; that surviving copy is its residual. By lemma 41.5, the residual is unique until it is contracted. Let R be a finite set of active pairs in N. A development of R contracts each residual of a member of R exactly once and contracts no active pair created by those contractions.

Because initial active pairs are disjoint, contracting one neither erases nor duplicates another. Each has one unambiguous residual until it is contracted.

Theorem 41.12 — Independence of developments

All developments of the same finite set R end in isomorphic nets. Every development has exactly |R| steps.

Proof of Theorem 41.12 — Independence of developments

Proof. Every development lists each member of R exactly once, through its unique residual, so its contraction order is a permutation of R. Any two finite permutations are connected by adjacent transpositions. It is therefore enough to exchange two consecutive contractions r,s. Their residual active pairs are disjoint, so the one-step diamond gives NrsNsr. An interface-fixing isomorphism carries every remaining agent occurrence, hence every remaining residual, to its mate; the common suffix can therefore be replayed on the other representative. Each adjacent transposition preserves the endpoint up to isomorphism, and a finite chain of them relates any two developments. Since each member has exactly one residual and is contracted once, every development has |R| steps. ◻

Thus an already chosen frontier can execute in parallel. Newly created redexes still require synchronization, and the theorem gives no bound on work to normal form.

Exercise 41.5

★★☆ For three initial active pairs r,s,t, write the six sequential orders of a complete development. Use adjacent swaps and the one-step diamond to connect all six endpoints. State why the same proof does not identify a development that also contracts a redex created by r.

A linear lambda fragment

A full untyped lambda encoding must account for weakening and contraction. For exactly-once terms, however, the beta step is represented by wiring alone.

Definition 41.13 — Exactly-once lambda terms

Terms are t,u::=xλx.ttu, subject to two conditions: in λx.t, the variable x occurs free exactly once in t; and in tu, the sets of free variables are disjoint.

The translation T(t) has one root interface port and one interface port for each free variable, in a fixed order. A variable is a wire from its free-variable port to the root. A binary Lam agent has auxiliary ports for the binder and body; a binary App agent has auxiliary ports for argument and result. The principal ports of Lam and App meet precisely when an abstraction is used as a function. Their rule splices argument to binder and body to result: App(T(u),r)Lam(x,T(t))Ix=T(u),r=T(t). The displayed names denote the four exposed boundary wires. Exactly-once use ensures that the binder has one endpoint to splice.

Theorem 41.14 — One beta step

If (λx.t)u is an exactly-once term, then T((λx.t)u)IT(t[u/x]) up to interface-preserving isomorphism.

Proof of Theorem 41.14 — One beta step

Proof. By construction, the outer application connects the principal port of its App agent to the principal port of the translated abstraction’s Lam agent. Their rule removes those agents, connects the root of T(u) to the unique free-x port of T(t), and connects the body root to the result. This is exactly the inductive translation of postfix capture-avoiding substitution t[u/x]. The free interfaces are disjoint by definition 41.13, so no other wire is changed. ◻

Corollary 41.15 — Exact beta correspondence

For every exactly-once term v, beta-redex occurrences in v are in bijection with AppLam active pairs in T(v). If the occurrence contracts v to v, the corresponding interaction contracts T(v) to T(v), up to interface-preserving isomorphism.

Proof of Corollary 41.15 — Exact beta correspondence

Proof. Induct on v. A variable has neither kind of redex. Under an abstraction, both sets are exactly those in the body, so use the induction hypothesis. In an application tu, the pairs inside the two disjoint subnet translations correspond to the redexes inside t and u by induction. There is one additional active pair at the application root exactly when t=λx.w; that is exactly the additional beta-redex occurrence. Theorem 41.14 proves that contracting this pair yields T(w[u/x]) up to interface-preserving isomorphism. Compatible translation contexts reconnect the same ordered boundary, so an inner contraction also produces T(v). No other pair can appear across the disjoint free-variable interfaces. ◻

Exercise 41.6

★★☆ Translate (λx.x)u and (λx.λy.xy)u, and perform the outer interaction in each net. Match the results with u and λy.uy. Then explain exactly why the same two-agent rule cannot translate λx.xx: a single binder port cannot be spliced to two occurrences.

The two-occurrence term exposes the failure in symbols. Translating the application in λx.xx would require the one binder endpoint bx to satisfy bx=u1andbx=u2,u1u2, where u1,u2 are the two variable-interface endpoints. A port belongs to at most one wire, so the second equation cannot be added. The repair must introduce an explicit duplicator whose two outputs meet u1,u2.

Erasure, duplication, and readback

The obstruction in the last exercise can be made local for finite constructor trees. Add a nullary eraser E and a binary duplicator D, whose auxiliary ports are its two outputs. For every constructor symbol α of arity n, add the rules Eα(x1,,xn)IEx1,,Exn, D(,r)α(x1,,xn)I=α(1,,n),r=α(r1,,rn),D(i,ri)xi(1in). The first right side is empty when n=0. The equations on the second right side attach two fresh copies of the root to the two output wires, then send one duplicator down each child. Both schemas preserve their ordered boundaries. They are finitely many rules only when the constructor signature is finite.

Proposition 41.16 — Resource-manager calculation

Let U be a finite rooted constructor tree with no sharing or cycle. Connecting E to its root erases U in exactly |U| interactions. Connecting D(,r) to its root produces two disjoint copies of U at ,r in exactly |U| interactions.

Proof of Proposition 41.16 — Resource-manager calculation

Proof. Induct on U=α(U1,,Un). The root interaction takes one step. Erasure leaves one eraser at each Ui; the induction hypotheses erase them in i|Ui| steps. Duplication creates two roots and one duplicator at each Ui; the induction hypotheses create the two copies of every child in the same sum. In either case the total is 1+i|Ui|=|U|. Disjointness follows because every right-hand side uses fresh agent occurrences for its two roots. ◻

For unary naturals this proof is visible. Erasing 2=S(S(Z)) takes the three interactions ES, ES, and EZ. Duplicating 1=S(Z) takes one DS step, which leaves two output successors and one new DZ redex; contracting that redex is the second and last step and leaves two output zeros.

Define the external readback on a normal unary tree by rb(Z)=0,rb(S(x))=1+rb(x). It follows by induction that rb(n)=n. Thus the arithmetic calculation has an observable result: A(n,r)mIr=m+n,rb(r)=m+n. Readback is a named external function on normal numeral trees, not another interaction rule and not a semantic double-bracket notation.

These agents also give an exact nonlinear calculation on a deliberately finite fragment. A constructor template B[x1,,xk] is a finite constructor tree with distinct variable leaves x1,,xk, each occurring once. Let U be a closed finite constructor tree. Define Tres as T on Lam, App, wires, and constructors, except that the binder of (λx.B[x,,x])U is connected to E when k=0, directly to the unique occurrence when k=1, and to a fixed full binary tree of k1 duplicators whose ordered leaves feed the k occurrences when k2. The tree shape is part of the translation; it performs no implicit meta-level copying.

Theorem 41.17 — Finite nonlinear beta simulation and reflection

For a constructor template B[x1,,xk] and a closed constructor tree U, the source beta step (λx.B[x,,x])UβB[U/x1,,U/xk] corresponds to exactly one AppLam interaction followed by a complete resource-manager development. The development uses c(k,U)={|U|,k=0,0,k=1,(k1)|U|,k2 interactions and ends in Tres(B[U/x1,,U/xk]), up to interface-preserving isomorphism. Conversely, the unique outer AppLam pair reflects the displayed beta redex, and every complete development of the resource managers reaches that same translated contractum.

Proof of Theorem 41.17 — Finite nonlinear beta simulation and reflection

Proof. The first interaction splices the argument root to the binder resource tree and the body root to the result, exactly as in theorem 41.14. If k=0, proposition 41.16 erases U in |U| steps. If k=1, the splice already is the translated substitution. For k2, each of the k1 duplicators in the fixed full binary tree meets one complete copy of U along its output path. The proposition gives |U| interactions at each such node and two disjoint output copies; induction over the duplicator tree therefore gives (k1)|U| interactions and k copies in leaf order. Plugging those copies into the constructor template is precisely postfix simultaneous substitution.

For reflection, no manager rule creates a Lam or App, so the outer active pair comes only from the displayed source redex. Manager redexes for distinct constructor subtrees are disjoint. Theorem 41.12 permits adjacent swaps of their steps, and the induction just given fixes the endpoint and count. Hence every complete manager development has the stated result. ◻

This theorem covers weakening and finite multiplicity only when the argument is a closed constructor tree and the body is a constructor template. General lambda graphs may contain binders inside the duplicated argument, sharing, cycles, and resource managers themselves. The theorem is not a full nonlinear lambda encoding and carries no Lévy-optimality claim.

Exercise 41.7

★★☆ Write every interaction in the erasure of 2 and the duplication of 1. Give the boundary of each root rule, verify the two step counts in proposition 41.16, and explain why the induction does not apply to a shared diamond or a cyclic net.

Exercise 41.8

★★★ Apply theorem 41.17 first to (λx.Z)2 and then to (λx.C(x,C(x,x)))1, where C is a binary constructor. Draw the binder resource tree, list every manager interaction, and check the formulas c(0,2)=3 and c(3,1)=4. State why replacing 1 by a lambda graph would leave the theorem’s scope.

Interaction combinators

Lafont’s interaction combinators form a universal interaction system with three symbols: binary γ and δ, and nullary ε. Because symbol pairs are unordered, six pair classes suffice. Fix the intrinsic auxiliary order 1,2 on both binary symbols. If the old boundary of a binary–binary pair is (a1,a2,b1,b2), five rules have the following exact port equations: εεIC,εγ(a1,a2)ICa1=ε, a2=ε,εδ(a1,a2)ICa1=ε, a2=ε,γ(a1,a2)γ(b1,b2)ICa1=b2, a2=b1,δ(a1,a2)δ(b1,b2)ICa1=b1, a2=b2. The eraser on the right of equation 41.2, equation 41.3 is a fresh nullary agent whose principal port is connected to the named old boundary endpoint. Thus those rows expose the same two boundary wires as their left sides. The γγ annihilation crosses the intrinsic positions; δδ preserves them. A spatially reflected glyph can hide that difference, which is why the equations carry numbered ports.

Mathematical diagramDiagram

The two annihilation wirings with intrinsic auxiliary positions visible: γ crosses positions and δ preserves them.

The earlier AppLam pair uses two different symbols and its own same-position boundary convention; neither symbol is the combinator γ. Likewise, the later HVM2 table calls a runtime tag “constructor-like” only as a role comparison. It is not an identification of that runtime rule, the linear lambda rule, and equation 41.4. Port order is fixed separately for each signature.

For the sixth, mixed rule, take fresh internal wire names pij (i,j{1,2}) and set γ(a1,a2)δ(b1,b2)ICa1=δ(p11,p21),a2=δ(p12,p22),b1=γ(p11,p12),b2=γ(p21,p22). Each equation attaches an old endpoint to the principal port of one fresh agent; each pij occurs exactly twice and joins auxiliary port i of the j-th new δ to auxiliary port j of the i-th new γ. Thus the mixed right side has four fresh agents and exactly the old ordered boundary.

Mathematical diagramDiagram

Complete port incidence of the mixed γδ rule. The numbered equations, not spatial bends, fix the intrinsic port order.

Together, equation 41.1, equation 41.2, equation 41.3, equation 41.4, equation 41.5, equation 41.6 are Lafont’s six diagrams in algebraic port form [Laf97].

The equations compute immediately. Attach nullary ε1 to a1 and ε2 to b2 in a γ(a1,a2)γ(b1,b2) pair. Then {γγ,a1=ε1,b2=ε2}IC(41.4){a2=b1,ε1ε2}IC(41.1){a2=b1}. The first rule crosses intrinsic positions and creates the second active pair; the second removes it. This two-step instance consumes two of the six rules before the general simulation result is invoked.

Theorem 41.18 — Universality of interaction combinators

Let I=(Σ,R) be a finitely presented interaction system, with the reduced-right-side convention fixed in Lafont’s §1.6. There is an effective symbol translation ΦI sending every n-ary αΣ to a principal interaction-combinator net of arity n. It extends compositionally to nets, preserves their ordered interfaces, and for every source rule instance NIM satisfies ΦI(N)ICΦI(M) up to interface-preserving net isomorphism. Consequently a source reduction sequence is simulated by concatenating finite combinator reductions.

Proof of Theorem 41.18 — Universality of interaction combinators

Imported proof. This is Lafont’s Theorem 1 in §2 of the local author copy, printed p. 8 [Laf97]. The relation IC permits a reduction of arbitrary finite length, possibly zero. The result is existence and simulation, not a claim that translated programs preserve source step count or asymptotic cost.

The construction proceeds in two layers. First, each source symbol and each source interaction rule is compiled into a finite net with the same free-port interface. Second, Lafont builds the required finite routing, copying, and selection gadgets from γ,δ,ε, and shows that the net compiled from a source redex reduces to the net compiled from its right-hand side. Closure under contexts then gives the simulation of arbitrary source steps. Reproducing the gadget library would replace this chapter’s local proofs with many pages of source diagrams. We therefore state and use the simulation theorem rather than reconstructing the entire gadget library. Its conclusion is only the forward existence statement NIN implies ΦI(N)ICΦI(N); it does not reflect arbitrary target reductions back to source steps. Lafont’s separate Proposition 4 gives constants depending on the finite source system that bound the combinator steps used to simulate an n-step source reduction. That bound is not an implementation-cost theorem. ◻

Exercise 41.9

★★☆ Count the unordered pairs of the three symbols γ,δ,ε and reproduce all six boundary equations above. For the mixed rule, check all four old endpoints and all four pij: each old endpoint must occur once on each side and each fresh wire exactly twice on the right. Explain why transposing just one new agent’s auxiliary order gives a different rule.

One agent that breaks the diamond

The proof of theorem 41.9 uses two facts. Distinct active pairs are disjoint, and an active pair determines at most one right-hand side. Multiple principal ports destroy the first fact: one amb occurrence may belong to two active pairs at once. INAMB’s two interactions with each ordinary agent also abandon the global unique-rule presentation, but the counterexample below fails specifically because its two redexes overlap at amb.

Fernández and Khalil isolate that obstruction in the calculus INAMB. The new agent amb has two principal ports and two auxiliary ports. We write (p0,p1)amb(m,a) for an occurrence, where p0,p1 are the two possible inputs, m is the main output, and a is the remaining auxiliary connection. For every ordinary agent α, there are two rules: an α-agent arriving at p0 is relayed to m, and an α-agent arriving at p1 is relayed to m. Fernández–Khalil’s Definition 4.2 writes a rule by displaying its right-hand-side wiring to the left of . With that convention, the two complete rules are (,)amb(α(x),)α(x)and(,)amb(α(x),)α(x). The arguments of each displayed amb term record the resulting wiring: α(x) is exposed at the main output and relays the unselected principal connection to the auxiliary port. The dash marks the principal port chosen for the interaction; it is not a missing term.

Now connect α(x) to p0 and β(y) to p1, with αβ. The two one-step reductions expose different root agents at m: NAmb0Nα,NAmb1Nβ. Choose α and β with no rule between their exposed forms. Then neither branch has a one-step reduct joining the other. This is the exact line at which the diamond proof fails. The failure is intentional; INAMB supplies a nondeterministic choice, not a second strongly confluent interaction system.

Proposition 41.19 — The deterministic hypothesis is necessary

There is a finite INAMB net with two non-isomorphic one-step reducts that have no common one-step reduct. Hence the one-step diamond and strong-confluence conclusions of theorem 41.9 do not transfer to INAMB.

Proof of Proposition 41.19 — The deterministic hypothesis is necessary

Proof. Choose the two competing agents already displayed to be distinct nullary symbols κ0 and κ1, with no rules on either exposed form. Selecting p0 leaves κ0 at the main output and selecting p1 leaves κ1. Both results are normal. The agent at that fixed output differs, so no interface-fixing isomorphism carries one result to the other; normality also rules out a one-step join. The competing unordered symbol pairs are distinct, so this counterexample violates the disjoint-redex lemma, not rule uniqueness for either of those two pairs. ◻

Angelic and infinity merge

Let a stream be a chain of unary element agents ending at an interface port. An angelic merge of two streams must produce an infinite output if either input can keep producing; it need not serve both inputs fairly. Every output element is an unaltered input element, and elements from either one input retain their original order. Put the two input heads at the principal ports of amb. When a head α wins, relay α to the output and reconnect the continuation of that input, together with the untouched other input, to a fresh merge agent. Thus the active principal port chooses the next output cell and the same wiring recursively restores the merge. If both heads are ready, the choice is nondeterministic. If only one is ready, that branch remains available.

The source constructs infinity merge from a nondeterministic natural number generator. The generator uses amb, the ordinary eraser, and duplicator to choose a finite numeral while preserving its interface. An oracle repeatedly chooses n, emits exactly n cells from the first input, chooses n, and emits exactly n cells from the second. If an input contains fewer than the number just requested, that branch blocks. Nevertheless, if one input is infinite, every cell of the other input eventually appears in the output. This is the source’s infinity-merge guarantee. It is weaker than fairness: INAMB does not implement fair merge. Panangaden and Shanbhogue prove the strict implementation hierarchy: fair merge cannot be implemented by angelic merge, and angelic merge cannot be implemented by infinity merge [PS92]. Fernández and Khalil invoke that result at printed p. 4 and use it to delimit their own constructions of angelic and infinity merge [FK02].

Exercise 41.10

★★☆ Draw two successive recursive states of angelic merge when both inputs begin with a unary cell. Give the two first-step reducts, name the preserved input tail in each, and show that both reducts expose another merge state. Then state why this calculation proves neither fairness nor strong confluence.

The textual multiple-principal-port calculus

The metatheorems are stated for the paper’s textual calculus INMPP. Fix agents α with auxiliary arity n and a finite number m>0 of principal ports. Terms and equations are t::=x(1,,p1,,p+1,,m)α(t1,,tn),q::=(1,,m)α(k1,,kn)t=u. A name occurs at most twice. One occurrence denotes a free port and two occurrences denote a wire. A dash selects the principal port currently exposed by a term. A multiequation ()α(k) records all potential principal interactions of one occurrence at once.

A term is INMPP-normal when it is a variable, or a selected-principal term whose auxiliary subterms are INMPP-normal and in which every name used at a principal port of that term or a subterm occurs at most once. This is Fernández–Khalil Definition 4.3; it differs from interaction-net normal form. A configuration tΔ has a list of INMPP-normal interface terms and a multiset of equations. No principal name is shared by two interface terms or between the interface and Δ. The load-bearing nondeterministic rule selects one principal component of a multiequation: t(1,,p1,(k<q,,k>q)β(u),p+1,,m)α(s),ΔInd3t(<p,,>p)α(s)=(k<q,,k>q)β(u),Δ. The other two indirection rules substitute a name or expose a named principal port. Interaction replaces an explicit active equation by a fresh instance of its rule; collection moves a normal component to the interface; multiset congruence reorders equations. These clauses make the selected principal port visible in the dynamics instead of hiding the nondeterministic choice in a graph picture.

Port types are polarized types σs, with s{+,}, and a wire joins dual polarities. Each agent supplies one user-defined Graft rule typing all its principal ports and auxiliary subnets together. Write α(t):(σ1s1,,σmsm) for its Graft conclusion. The structural core contains Xx:σs, x:σsAxΓ,t:σsΔ,u:σsΓ,Δ, t=u:Cut. The rules that close all principal ports or expose exactly port j are {Γi,i:σisi}1imΓ,α(t):(σ1s1,,σmsm)Γ1,,Γm,Γ,(1,,m)α(t):MultiCut. The selected form is {Γi,i:σisi}ijΓ,α(t):(σ1s1,,σmsm){Γi}ij,Γ,(<j,,>j)α(t):σjsjSelect. All displayed premise contexts are pairwise name-disjoint. These side conditions make the proof below a graph-construction induction. For amb, the Graft rule is Γ,t0:φs,t1:φsΓ,amb(t0,t1):(φs,φs)Graftamb. Both principal ports consequently have the same type and direction. The two amb rules are typeable because either selected principal port is cut against the same dual type and the unselected connection is preserved.

Theorem 41.20 — Typed INMPP safety, reconstructed

For the textual calculus above:

  1. every typeable configuration is free of cycles consisting solely of principal-port connections;

  2. indirection, interaction by a typeable rule, collection, and multiset congruence preserve the interface types; and

  3. therefore reduction by typeable rules preserves principal-cycle deadlock freedom.

Proof of Theorem 41.20 — Typed INMPP safety, reconstructed

Proof. The source states Propositions 4.10 and 4.13 without proofs; we reconstruct the required mechanism. For clause 1, induct on the height of the typing derivation. Ax contributes one wire and no cycle. A Graft instance joins an agent to the pairwise disjoint auxiliary premise nets and leaves its principal ports exposed, so any principal cycle would already occur in a premise. Cut joins the exposed roots of two disjoint premise nets by one edge and therefore cannot close a cycle. MultiCut attaches distinct premise nets to all principal ports of one freshly grafted agent; its incidence graph is a star of disjoint components. Select makes the same attachments except at port j, which remains exposed. Exchange changes no incidence. These cases exhaust the derivation and establish absence of principal cycles.

For clause 2, inspect the final dynamic rule while inducting on the height of its typing derivation. Indirection (i) eliminates a name edge by capture-avoiding substitution; indirection (ii) exposes the same named principal port; and indirection (iii) replaces a multiequation by the corresponding Select conclusions and one Cut. Each rearranges the same dual occurrences. Interaction is the load-bearing case: the definition of a typeable rule supplies a derivation of its active equation and a derivation of its right-hand-side equations under exactly the same typed boundary, so replacing the former by a fresh copy of the latter preserves the conclusion. The two collection rules invert Ax or Select and move the resulting INMPP-normal term to the interface. Multiset congruence is exchange. Hence every dynamic rule preserves the interface typing. Clause 3 applies clause 1 to the preserved derivation after each step. ◻

The last clause is conditional twice: the initial configuration must be typeable and every interaction rule used by reduction must satisfy the paper’s typeable-rule definition. It is not progress for arbitrary INAMB nets, and a configuration may still wait for data without containing a principal-port cycle.

Encoding INMPP in INAMB

Before translation, collection and indirection put a configuration into shallow form: its interface contains only names, while each equation contains names or one agent occurrence with named ports. An agent with m principal ports is represented by a chain ambm of binary amb agents. A selector records which branch won, duplicators preserve the other boundary data, and clearing agents erase abandoned alternatives. The configuration translation θ leaves name equations unchanged, splits an explicit active equation through a fresh name, and sends a multiequation ()α(t) to the selector configuration ()Sambm(α(t,g2,,gm),Cl(g2),,Cl(gm)). For every source rule between principal port p of α and port q of β, the target rule connects the selected projections αq and βp, translates the source rule’s residual equations, and retains the remaining named boundary in reverse order around the selected port. This is the source’s Definitions 4.15 and 4.16, including its selector, labelling, duplicator, eraser, and clearing rules.

Theorem 41.21 — INMPP–INAMB operational correspondence, imported

For a shallow INMPP configuration c:

  1. If cINMPPc. Some INAMB image d of c reduces to the image of c, possibly accompanied by finite trees of duplicators, erasers, and labelling agents that further erase.

  2. If θ(c)Id, then there is c with cINMPPc such that d further reduces to the image of c plus such erasable administrative trees.

Proof of Theorem 41.21 — INMPP–INAMB operational correspondence, imported

Imported proof. Source note. The syntax and dynamics are Definitions 4.1–4.5. Graft typing and its safety results are Definitions 4.7–4.9 and 4.11 and Propositions 4.10 and 4.13. The encoding correspondence is Definitions 4.15–4.16 and Propositions 4.17–4.18 of Fernández and Khalil’s complete 2002 paper [FK02]. Their angelic and infinity merges are Examples 3.1 and the construction on pp. 5–6. The paper rules out fair merge at this signature. Its later process- and term-rewriting encodings, and claims unique to the expanded 2003 article, are outside this chapter. Proposition 4.14 is the shallow-form result used before θ. ◻

Exercise 41.11

★★★ Derive both amb interactions from Graft-amb, Ax, and Cut. Mark the dual type at the selected principal port and the preserved type at the other port. Then construct an untypeable two-agent principal-cycle and identify the failed polarity equation. Explain why theorem 41.20 excludes that cycle but does not restore the diamond of theorem 41.9.

A scheduler with a small invariant

A mutable implementation stores an agent tag, its auxiliary-port array, and one peer reference per connected port. Reconnecting a rule touches only the two redex agents, the rule’s fresh agents, and the exposed boundary peers. A work queue may contain candidate principal–principal wires.

The graph store maintains four incidence invariants after every accepted rewrite: every live internal port has exactly one peer; the peer relation is symmetric; every peer names a live agent and an in-range port (or one declared boundary endpoint); and no port of a retired agent remains reachable. A reference reducer may check all four after every interaction. A queue entry is only a candidate address pair, never authority to mutate the graph; the current peer table decides whether it is still a redex.

Call a scheduler enqueue-complete when the initial queue covers every initial redex and every rewrite enqueues every newly created rule-bearing principal–principal wire. Call it validating when dequeue checks that both endpoints are live, mutually connected principal ports with a rule. Call it fair when, for every candidate c and dequeue index n, if c remains in the queue after index n, then some dequeue with index mn removes c. A redex is permanently live after index n when it is never contracted and neither of its principal agents is disconnected after n.

Proposition 41.22 — Queue invariant

Suppose the scheduler satisfies both completeness conditions above and validates every dequeued candidate. Then:

  1. every contracted pair is a live redex;

  2. every live redex is initially covered or is enqueued by the rewrite that creates it;

  3. a candidate that fails validation performs no write, and a duplicate of an already-contracted redex fails validation; and

  4. if the scheduler is also fair, a permanently live redex is contracted after finitely many dequeues.

Proof of Proposition 41.22 — Queue invariant

Proof. Validation proves safety at the moment of contraction. Initial coverage is the base case for completeness. Thereafter a redex can become newly live only when a rule reconnects a principal port or creates a new agent; the enqueue discipline covers both cases. A duplicate that survives validation contracts the redex once, and all later copies become stale; a candidate that was already stale fails validation before any mutation. Finally, fairness gives a finite dequeue index at which a permanently live candidate reaches the head, where it still passes validation. ◻

Locks or ownership must protect the two active agents and the boundary writes of a rule. Disjoint-redex theory explains why independent critical sections can commute; it does not itself prevent a data race in an unsafe graph store.

Exercise 41.12

★★☆ Give an execution in which a queued candidate becomes stale before dequeue and show that validation rejects it. Exhibit two completeness failures: start with a live redex missing from the initial queue, and separately omit the enqueue step for one newly created principal–principal wire. State which of initial coverage, enqueue preservation, validation safety, and fairness each example concerns.

Implementation case study: HVM2

Appendix E records the reproducible implementation evidence. The mathematical object used here is its finite dispatcher table and the work/span calculation below.

The paper-level rule table has ten named interactions:

Name Purpose in the implementation report
Link follow or splice a variable link
Call expand a global reference
Void remove a vacuous pair
Erase propagate erasure
Commute commute two binary nodes of different types
Annihilate annihilate two binary nodes of the same type
Operate1, Operate2 the two numeric-operation phases
Switch1, Switch2 the two conditional-switch phases

The C/CUDA dispatcher compresses these into eight tags: LINK, CALL, VOID, ERAS, ANNI, COMM, OPER, and SWIT. Thus “ten paper rules” and “eight dispatcher classes” count different layers and are not contradictory. The implementation’s node tags include VAR, REF, ERA, NUM, CON, DUP, OPR, and SWI; VAR is a wire-level reference rather than one of the seven agent-like constructors.

The closest interaction-combinator role map is Lafont roleHVM2 tagboundaryeraser εERAnullaryconstructor γCONbinaryduplicator δDUPbinary On this three-tag subtable, unequal binary tags select COMM, equal binary tags select ANNI, and eraser/binary pairs select ERAS. This is a role-level map, not a proof that the runtime’s one ANNI procedure realizes both intrinsic port permutations in equation 41.4, equation 41.5; that claim would require a separate verification of its stored port orientation. REF, NUM, OPR, SWI, and global-link state are HVM2 extensions, not Lafont combinators.

The evaluator map has three stages. The implementation represents a net as a root tree and a bag of redex equations; nullary ERA/REF/NUM and binary CON/DUP/OPR/SWI are the seven agent-like forms. Dispatch maps the ordered pair of runtime tags to one class, pops one entry from the local redex bag, canonicalizes tag order, calls one of interact_link through interact_swit, requeues a failed claim, and counts successful non-LINK interactions. The evaluator drains that bag; readback follows the runtime root and reconstructs an AST by tag. This gives the concrete parsed root/redex bagruntime ports and bags,runtime ports and bagsdispatcher interactions,dispatcher interactionsAST readback map used by the finite calculation.

One small schedule benchmark can be checked without importing the paper’s performance claims. In the paper’s concrete net syntax, take 0 & * ~ * & * ~ *. The root is the number 0; the bag contains two independent ERAERA pairs. The dispatch table sends both to VOID. Left-then-right and right-then-left each perform exactly two counted interactions, while an ideal two-worker frontier has work 2 and span 1: work is the total number of interactions, while span is the length of the longest dependency chain under ideal parallel scheduling. Neither interaction touches the root, so the readback code returns 0. This is an interaction-count/readback microbenchmark, not a wall-clock benchmark: it records neither hardware nor throughput. The Kappa companion encodes both schedules and the common readback as finite data.

The preceding strong-confluence theorem applies only after one verifies the interaction-system hypotheses for the modeled rules, including side conditions and state effects. The implementation report itself highlights the CONSWI entry as problematic and says that either its COMM entry or the SWIT reduction must change. We therefore report the selected table without upgrading its work-in-progress confluence claim to a theorem. A source-code dispatcher table is evidence for what the selected implementation does. It is not by itself a proof of confluence, an optimality theorem, or a speedup claim. Benchmarks, when present, would establish performance only for their recorded hardware, programs, build, and measurement protocol [Hig26].

Exercise 41.13

★★☆ Reconcile the ten paper-level names with the eight dispatcher tags by giving the two many-to-one groupings. Then classify VAR and the seven agent-like node tags, give the ε/γ/δ role map and its port-orientation caveat, and trace the evaluator map from parsed redex bag through dispatch to AST readback using the three-stage map above. Finally calculate both orders, work, span, and readback of the two-VOID microbenchmark. State two additional obligations required before theorem 41.9 may be applied to this implementation.

Exercise 41.14

★☆☆ For each claim, name the minimum suitable evidence: (a) a local rule exists in the selected program; (b) the abstract rewrite relation is strongly confluent; (c) a lambda encoding is Lévy-optimal; (d) one build is faster than another on a workload. Choose among source inspection, a mathematical proof, an encoding theorem, and a reproducible benchmark. Explain why none may replace the others.

Executable companion.

The Kappa companion recorded in appendix E executes the unary-addition trace, two finite normalization schedules, unordered rule-key and boundary checks, and the HVM2 dispatcher table. It supplies regression evidence for those examples, but proves none of the confluence, simulation, universality, or optimality results above.

Confluence, simulation, and implementation evidence

For finite first-order interaction systems with at most one rule per unordered symbol pair, theorem 41.9 derives strong confluence from the one-step diamond, and theorem 41.12 proves independence of finite developments. The exact linear and finite constructor-tree simulations are corollary 41.15, theorem 41.17; interaction-combinator universality is theorem 41.18; and the executable scheduler preserves proposition 41.22. These statements establish neither a Lévy-optimal lambda encoding nor a bound comparing graph-reduction work with beta-reduction work: either conclusion requires an explicit encoding and cost relation. For the nondeterministic extension, proposition 41.19 marks the failed deterministic hypothesis, while theorem 41.20, theorem 41.21 delimit typed safety and the INMPP-to-INAMB correspondence. The explicit net framework and one-step diamond argument follow de Falco [dF10].

None of these problems is a prerequisite for a later chapter.

Suggested first pass.

Begin with the combinator boundary calculation, isolate the INAMB choice, continue with the queue invariant, and finish with the executable reducer.

Exercise 41.15

★★☆ Reconstruct the six combinator right boundaries from the six equations in section 41.8. Starting from the two-step γγ calculation above, swap one intrinsic auxiliary position and show the exact boundary equation that changes.

Exercise 41.16

★★☆ For two independent arithmetic redexes, enumerate left-first and right-first queue executions. After every dequeue, check incidence symmetry, enqueue-completeness, validation, and the fairness condition used in proposition 41.22.

Exercise 41.17

★★☆ Instantiate proposition 41.19 with two distinct nullary agents. Draw the two normal, non-isomorphic reducts and then type both selected interactions using Graft-amb and Cut. Explain why subject reduction is compatible with the failure of strong confluence.

Exercise 41.18

★★★ Practical project.interaction-net-reducer Implement the finite interaction-net reducer and validated work queue in Kappa. Maintain the four incidence invariants stated in section 41.10, and validate a queued candidate before every write. The oracle must compute 3+2 in four interactions, join two disjoint one-step schedules, agree on two normalization schedules, preserve erasure/duplication counts, enforce unordered rule uniqueness and boundary arity, and compute work (2), span (1), and zero readback for the two independent void candidates. Mutate successor addition so it omits the increment; the mutant must type-check and audit cleanly but fail the arithmetic oracle. Appendix E records the four acceptance commands and appendix F gives the construction stages.

Search the book

Type to search the local edition.