Terminology for property of recursion definitions
This sounds to me like a Catamorphism, specifically, a Tree Fold. If you're familiar with the foldr list function of functional programming (I believe Python has this too), this is also a catamorphism.

In general, the categories functions are divided into like this are called recursion schemes. The classic introduction to them is Bananas, Lenses, Envelopes and Barbed Wire. If you're familiar with Haskell, the modern translation guide might help.

Some more information is provided in the Origami Programming paper.