nustack

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

RewriteExample
Constant foldingAdd(2, 3) → Literal(5)
Common-subexpressionshared ref.fetch() collapsed to one read
Independence parallelizationa >> b where independent → a | b
Identity eliminationAdd(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.

On this page