Meta-Nu transformations
Rewrites that map a Nu to an equivalent Nu.
Equivalence
Two Nus are equivalent iff they have the same mutation on the Context for any starting Context. Rewrites must preserve equivalence.
Common rewrites
| Rewrite | Example |
|---|---|
| Constant folding | Add(2, 3) → Literal(5) |
| Common-subexpression | shared ref.fetch() collapsed to one read |
| Independence parallelization | a >> b where independent → a | b |
| Identity elimination | Add(x, 0) → x |
Why this is meta
Transformations operate on Nu trees, producing Nu trees. They don't run Nus; they reshape them. Composition rules bound which reshapes are valid.