Diagram rewriting replaces a piece of a diagram matching a pattern with another piece, reconnecting the wires. Matching happens on the diagram's hypergraph structure, so rules are insensitive to layout and port naming — formal pattern symbols in port positions bind to whatever wiring the match finds. This tech note builds rewrite rules for algebraic laws and applies them with
The paclet provides constructors for the standard interaction-net rule schemas. Two facing copy nodes annihilate into parallel wires:
A node commutes past a copy node, duplicating itself:
An eraser propagates through a process, erasing it port by port:
Erasing one branch of a copy leaves a plain wire:
These rules drive lambda-calculus evaluation as interaction nets: beta reduction is an annihilation between a lambda node and an application node, and copy/erase rules implement sharing and garbage collection.