Interaction Calculus Fundamentals
- Interaction calculus is a formal framework for rewriting interaction nets, enabling precise specification of reduction systems and analysis of properties like confluence and reversibility.
- It defines reduction via structured rules such as communication, substitution, and collection, ensuring deterministic transformations in net-based computation.
- The framework supports extensions with generic and variadic rules, bridging theoretical insights with practical implementations in systems like inets.
Interaction calculus is a formal framework for reasoning about the reduction and transformation of interaction nets, a graphical computation model based on local graph rewrites via interaction. It generalizes the operational semantics of interaction nets into a textual calculus that is rigorously defined and suitable for analysis of properties like confluence and reversibility. The calculus allows precise specification of reduction systems derived from agent signatures, term structures, and interaction rules, providing a foundation for both theoretical results and practical net-based programming languages (Jiresch, 2012, Salikhmetov, 2018).
1. Formal Structure of Interaction Calculus
Interaction calculus fixes a signature Σ of agent symbols, each with a specified arity . A countable set of names (or ports) is used to construct terms: every name is a term, and if , then is a term. Equations are unordered pairs representing wires (edges) in the underlying net.
A configuration (net) has the form , where are the free (interface) ports—those appearing exactly once in —and all other names in appear exactly twice (bound ports) (Jiresch, 2012).
Active pairs are equations 0, representing two agents connected at their principal ports. The set of rewrite rules 1 consists of interaction axioms of the form
2
where 3 is a finite multiset of equations between the variables 4.
Interaction steps operate by matching active pairs in a configuration to rules in 5: substituting actual terms for variables and replacing the original equation with the renamed right-hand side. Additional reduction rules include communication, substitution, and collection for managing free names and equations (Jiresch, 2012, Salikhmetov, 2018).
2. Reduction Relations and Confluence Properties
The reduction relation in interaction calculus interleaves interaction steps with three bookkeeping rules:
- Communication: 6
- Substitution: 7
- Collection: interface update 8 replaces 9 by 0
- Interaction: applies a matching interaction rule
Uniform confluence holds when subject to a no-ambiguity condition: at most one rule per unordered pair of agent symbols. That is, for any one-step divergence 1 and 2 with 3, there must exist 4 with 5 and 6 (Jiresch, 2012).
A finer analysis of confluence distinguishes standard confluence, upward confluence (the “upside-down” Church–Rosser property), and strong upward confluence (upward diamond). Upward confluence states: for any 7 with 8 and 9, there exists 0 with 1 and 2. Strong upward confluence requires this for one-step reductions (upward diamond) (Salikhmetov, 2018).
In interaction calculus, indirections are neutral for confluence, allowing reduction to focus on interaction steps. Strong upward confluence occurs if and only if the system is reversible: no two distinct active-pair instances clash, and each rule is connected (cannot be partitioned into disjoint variable sets in the R.H.S.) (Salikhmetov, 2018).
3. Generic and Variadic Rule Extensions
Interaction calculus may be extended with generic rules, formalizing higher-order rewrite patterns:
- Ordinary rule: exact agent symbols on both sides
- Fixed-generic rule: one side is a concrete agent, the other a generic variable φ of the same arity (φ may be instantiated by any agent of matching arity)
- Variadic rule: φ has arbitrary arity, denoted φ([x]), supports patterns over agents with variable numbers of ports
Application of generic rules at the calculus level prioritizes ordinary (concrete) rules (default priority constraint, DPC); generic rules are only considered if no ordinary rule matches. For variadic rules, instantiation produces the concrete arity, generates fresh auxiliary names as needed, and copies equations accordingly (Jiresch, 2012).
Generic Rules: Constraints and Ambiguity
To ensure uniform confluence, two constraints are imposed:
- Default Priority Constraint (DPC): always prefer an ordinary rule α=β; only use generic if none applies
- Generic Rule Constraint (GRC): overlaps between generic rules are only permitted if an ordinary rule exists for the pair (coverage is deterministic by DPC)
Non-ambiguity is enforced: for every pair (α,β), at most one matching rule exists (ordinary or generic), except permitted overlapping generic rules resolved by an ordinary rule (Jiresch, 2012).
4. Implementation in the inets System
In the inets system, each interaction rule is compiled to a C function operating on agent handles. A global dispatch table 3 indexes the appropriate function for each unordered agent pair. Fixed-generic rules are stored under a special generic key (4 per arity).
The reduction function first dispatches to the exact rule (ordinary) if available; if not, it attempts the generic alternatives. Compile-time checks ensure the GRC: on adding a new generic rule, any overlap with another generic rule (with matching arities) is only admitted if an ordinary rule exists for those agents. Variadic rules are expanded for each relevant arity up to the program’s maximum (Jiresch, 2012).
7 (Jiresch, 2012)
5. Confluence and Reversibility: Theoretical Landscape
The existence of strong upward confluence in interaction calculus is characterized by reversibility. An interaction system is reversible if (1) no two different active-pair instances clash (their contracted equations intersect) and (2) every interaction rule is connected. This property is extremely restrictive: unique arity for each agent, no duplication-like rules, and no overlap in rule applications for distinct agents of the same arity. Lafont’s interaction combinators fail reversibility both due to disconnected rules and clashing active pairs; trivial systems (all agents arity 0) are vacuously reversible (Salikhmetov, 2018).
Strong upward confluence (diamond) holds if and only if reversibility is satisfied. However, ordinary upward confluence can hold more broadly; for instance, in the linear A-calculus (signature 5, with a single rule), although the system is not reversible, it is still upward confluent—the non-diamond property is rescued by the ability to permute or rename reduction steps to achieve common ancestors along divergent reduction sequences (Salikhmetov, 2018).
6. Worked Examples and Applications
Ordinary Addition on Peano Numbers:
Rules for 6 and 7 agents implement addition:
- 8
- 9 Starting from 0, successive reduction steps yield standard Peano arithmetic over interaction nets (Jiresch, 2012).
Generic Deletion (ε-Rule):
A variadic rule for deletion: 1 Applied to, e.g., 2, yields 3; each output port recursively propagates deletion, supporting structural erasure in net computations (Jiresch, 2012).
Graphical Sketch of the Deletion Rule:
A diagram illustrates that applying the deletion rule to 4—5 splits the connection and propagates 6 to both subnets.
7. Research Context and Theoretical Significance
Interaction calculus provides a formal text-based operational semantics for interaction nets, supporting rigorous analysis of computational properties such as confluence and reversibility. The extension by generic rules significantly enhances expressiveness while maintaining well-behavedness—provided DPC and GRC are enforced. The integration into efficient implementations, exemplified by the inets system, demonstrates the practicality of the calculus, enabling compilation of high-level net programs into efficient executions (Jiresch, 2012).
The upward confluence landscape for interaction calculus is distinct from that of lambda calculus—untyped lambda calculus is not upward confluent, but certain linear variants encoded in interaction calculus are. Reversible interaction systems arising from the calculus provide a form of local reversibility, which is significant for both foundational study of computational models and the abstraction of reversible computation (Salikhmetov, 2018).
A still-open question is the construction of a finite universal reversible interaction system, with each agent having unique arity—a highly restrictive but deeply informative area for further investigation within theoretical computer science.