A recent paper on the arXiv introduces and studies pattern-based tree transformations, a formalism in which a rewrite rule is given by a pair of tree patterns. The paper's motivating example is the distributive law: a source pattern (x·y)+(x·z) paired with a target pattern x·(y+z). Such a rule matches any tree that fits the source shape and rewrites it into the corresponding target shape.
The central concern, as the title suggests, is type-checking. The paper asks how to check that a transformation defined by these patterns is well-typed, meaning the rewrite is guaranteed to be valid on all matching inputs. This is a step toward giving programmers and tool builders static guarantees about tree-manipulating code.
The work is still at the level of a research preprint, and the abstract does not yet describe the full type system or its decidability. But the example and framing point to applications in compilers, program optimisation, and term rewriting, where such algebraic rewrites are common.